Learn R Programming

rgr (version 1.1.15)

gx.symm.coords.r: Displays a Matrix of Correlation Coefficients based on Symmetric Balances

Description

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.

Usage

gx.symm.coords.r(x, log = FALSE, method = "spearman" )

Arguments

x

n by p matrix or data frame of compositional data for which the correlation coefficients will be computed.

log

to compute the non-symmetric balance coefficients with a logarithmic transformation and plot scaling, set log = TRUE.

method

the valid R method for computation of the correlation coefficients, the default is "spearman".

Value

r.sbs

the p by p matrix of correlation coefficients.

References

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.

See Also

gx.symm.coords, gx.symm.coords.plot

Examples

Run this code
# 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