Learn R Programming

compositions (version 0.9-11)

cor.acomp: Correlations of amounts and compositions

Description

Computes the correlation matrix in the various approaches of compositional and amount data analysis.

Usage

cor(x,y=NULL,...)
          ## S3 method for class 'default':
cor(x, y=NULL, use="all.obs", method=c("pearson", 
    "kendall", "spearman"),...)
          ## S3 method for class 'acomp':
cor(x,y=NULL,\dots)
          ## S3 method for class 'rcomp':
cor(x,y=NULL,\dots)
          ## S3 method for class 'aplus':
cor(x,y=NULL,\dots)
          ## S3 method for class 'rplus':
cor(x,y=NULL,\dots)
          ## S3 method for class 'rmult':
cor(x,y=NULL,\dots)

Arguments

x
a dataset, eventually of amounts or compositions
y
a second dataset, eventually of amounts or compositions
use
see cor
method
see cor
...
further arguments to cor e.g. use

Value

  • The correlation matrix.

Details

The correlation matrix does not make much sense for compositions.

In R versions older than v2.0.0, cor was defined in package ``base'' instead of in ``stats''. This might produce some misfunction.

See Also

var.acomp

Examples

Run this code
data(SimulatedAmounts)
mean.col(sa.lognormals)
cor(acomp(sa.lognormals5[,1:3]),acomp(sa.lognormals5[,4:5]))
cor(rcomp(sa.lognormals5[,1:3]),rcomp(sa.lognormals5[,4:5]))
cor(aplus(sa.lognormals5[,1:3]),aplus(sa.lognormals5[,4:5]))
cor(rplus(sa.lognormals5[,1:3]),rplus(sa.lognormals5[,4:5]))
cor(acomp(sa.lognormals5[,1:3]),aplus(sa.lognormals5[,4:5]))

Run the code above in your browser using DataLab