Computes and displays a p
by p
matrix of correlation coefficients based on symmetric balances for a n
by p
matrix or data frame of compositional data. Computation of the correlation coefficients is by any valid R method, by default "spearman"
. The symmetric balance coefficients are displayed in the upper triangle, and for comparison, the correlation coefficients of the input data are displayed in the lower triangle. If "pearson"
coefficients are required the option of a log transformation for the data is provided.
gx.symm.coords.r(x, log = FALSE, method = "spearman" )
n
by p
matrix or data frame of compositional data for which the correlation coefficients will be computed.
to compute the non-symmetric balance coefficients with a logarithmic transformation and plot scaling, set log = TRUE
.
the valid R method for computation of the correlation coefficients, the default is "spearman"
.
the p
by p
matrix of correlation coefficients.
Garrett, R.G., Reimann, C., Hron, K., Kynclova, P. and Filzmoser, P., 2017. Finally, a correlation coefficient that tells the geochemical truth. Explore - Assoc. Applied Geochemists Newsletter, 176:1-10.
Reimann, C., Filzmoser, P., Hron, K., Kynclova, P. and Garrett, R.G., 2017. Correlation Analysis for Compositional (Environmental) Data. Science of the Total Environment, 607-608:965-971.
# NOT RUN {
## Make test data available
data(nockolds)
## Compute and display correlation coefficients for the nockolds data
gx.symm.coords.r(nockolds)
## Save the matrix for further use
save <- gx.symm.coords.r(nockolds)
## Compute and display correlation coefficients for the nockolds data
## based on pearson product moment correlation coefficients with a
## logarithmic transform for the non-symmetric balance coefficients
gx.symm.coords.r(nockolds, method = "pearson", log = TRUE)
## Clean-up
rm(nockolds)
rm(save)
# }
Run the code above in your browser using DataLab