Description Usage Arguments Details Author(s) References Examples
A function to visualize the correlation of the relative or percental cell numbers and the abiotic parameters.
1 2 3 4 5 | ## S4 method for signature 'data.frame'
correlation(x,cortype="spearman",exact=FALSE,colkey=bluered(21),Rowv=TRUE,Colv=TRUE,symm=TRUE,distfun=function(c) as.dist(1 - c),dendrogram="both",main="",verbose=FALSE,...)
## S4 method for signature 'matrix'
correlation(x,cortype="spearman",exact=FALSE,colkey=bluered(21),Rowv=TRUE,Colv=TRUE,symm=TRUE,distfun=function(c) as.dist(1 - c),dendrogram="both",main="",verbose=FALSE,...)
|
x |
Data frame or matrix of correlation values. Use one row per sample and one column per gate/abiotic parameter. Use the first column for the first gate/abiotic parameter. The names of the gates and abiotic parameters may not contain any whitespace. If the values contain commas they must be expressed as ".". Missing values or NA's are allowed but should be expressed as "NA" or empty entries within the table. |
cortype |
Character string indicating which correlation coefficient is used. Choose between "spearman" (default), "kendall" and "pearson". See Details for more information. |
exact |
logical (default=FALSE). Do not compute exact p-values. Used for Kendall's tau and Spearman's rho. Can be changed to TRUE if R can compute exact p-values without ties. Computing exact p-values depends on the dataset. For more details type "?cor.test" into R command line. |
colkey |
Indicating the color key/palette used for visualization (default=bluered(21)). See Details for more information. |
Rowv |
logical (default=TRUE). The row dendrogram will be arranged according to similarity. FALSE will arrange the dendrogram according to the sequence of data e.g. according to sampling. |
Colv |
logical (default=TRUE). Determines how the column dendrogram should be reordered. Has the same options as the Rowv argument above. |
symm |
logical (default=TRUE). Indicates if x should be treated symmetrically. Can only be TRUE if x is a square matrix. |
distfun |
Function used for the computation of the distance (dissimilarity) between both rows and columns (default=function(c) as.dist(1 - c)). |
dendrogram |
Character string indicating whether dendrograms should be displayed (default="both"). Can be changed to "row", "column" or "none". Rowv/Colv has to be set TRUE to show a dendrogram for the rows/columns. |
main |
Character string used as title of the correlation heatmap (default="") |
verbose |
logical (default=FALSE). Change to TRUE to print estimates and additional information to the heatmap. |
... |
Additional heatmap parameters. For more details type "?heatmap.2" into R command line. |
Visualize the correlations between the cell number variations and abiotic parameters as a heatmap using the heatmap.2 function of the package "gplots" (see reference Warnes et al. 2013). Spearman's rank-order correlation coefficient (r_S) is used for this purpose, by default (see reference Koch et al. 2013, Box 1 for more details). This value varies between -1 and 1. The stronger the correlation, the closer the value of the coefficient to 1 (for positive correlations) or -1 (for negative correlations). Kendall's tau rank correlation coefficient also assigns the values to ranks but considers the difference between the probability that any two points will agree on the relative ranks compared to the probability that they will disagree. Pearson's product-moment correlation coefficient uses the true values and can be chosen to depict linear relationships. You can choose the color key/palette and the gradiations for visualization. By choosing the default color key positive correlations will be shown in shades of red, negative correlations will be shown in shades of blue and neutral correlations will be shown in white. Other possibilities are e.g. topo.colors(16), cm.colors(15) or heat.colors(11). The space within the brackets defines the gradiations of the color key. For more details type "??Palettes" into R command line. It is also possible to define an own color palette. For more details on that type "?colorRampPalette" into R command line.
Joachim Schumann joachim.schumann@ufz.de, Christin Koch christin.koch@ufz.de, Susanne Günther susanne.guenther@ufz.de, Ingo Fetzer info.fetzer@stockholmresilience.su.se, Susann Müller susann.mueller@ufz.de
Koch, Christin and Günther, Susanne and Desta, Adey Feleke and Hübschmann, Thomas and Müller, Susann (2013). Cytometric fingerprinting for analysing microbial intra-community structure variation and identifying sub-community function. Nature Protocols, 8(1):190-202,
Gregory R. Warnes, Ben Bolker, Lodewijk Bonebakker, Robert Gentleman, Wolfgang Huber Andy Liaw, Thomas Lumley, Martin Maechler, Arni Magnusson, Steffen Moeller, Marc Schwartz and Bill Venables (2013). gplots: Various R programming tools for plotting data. R package version 2.12.1. http://CRAN.R-project.org/package=gplots
1 2 3 4 5 6 7 8 9 10 11 12 13 | require(gplots)
## Show the correlation saved in dataset Corr_data_sample
## Use default parameters
data(Corr_data_sample)
correlation(Corr_data_sample[,-1])
## Change the title to "Correlation heatmap"
## Use palette heat.colors(11) as color key
data(Corr_data)
correlation(Corr_data_sample[,-1],colkey=heat.colors(11),main="Correlation heatmap")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.