Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cor

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,...)
          ## Default S3 method:
cor(x, y=NULL, use="everything", 
                       method=c("pearson", "kendall", "spearman"),...)
          ## S3 method for class 'acomp'
cor(x,y=NULL,...,robust=getOption("robust"))
          ## S3 method for class 'rcomp'
cor(x,y=NULL,...,robust=getOption("robust"))
          ## S3 method for class 'aplus'
cor(x,y=NULL,...,robust=getOption("robust"))
          ## S3 method for class 'rplus'
cor(x,y=NULL,...,robust=getOption("robust"))
          ## S3 method for class 'rmult'
cor(x,y=NULL,...,robust=getOption("robust"))

Arguments

x

a data set, eventually of amounts or compositions

y

a second data set, eventually of amounts or compositions

use

see cor

method

see cor

...

further arguments to cor e.g. use

robust

A description of a robust estimator. FALSE for the classical estimators. See mean.acomp for further details.

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.

Value

The correlation matrix.

Author(s)

K.Gerald v.d. Boogaart http://www.stat.boogaart.de

See Also

Examples

data(SimulatedAmounts)
meanCol(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]))

compositions

Compositional Data Analysis

v2.0-1
GPL (>= 2)
Authors
K. Gerald van den Boogaart <boogaart@hzdr.de>, Raimon Tolosana-Delgado, Matevz Bren
Initial release
2021-01-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.