# cor: Correlations of amounts and compositions In compositions: Compositional Data Analysis

## Description

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

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15``` ``` 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

`var.acomp`

## Examples

 ```1 2 3 4 5 6 7``` ```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])) ```

### Example output

```Loading required package: tensorA

Attaching package: 'tensorA'

The following object is masked from 'package:base':

norm

Welcome to compositions, a package for compositional data analysis.
Find an intro with "? compositions"

Attaching package: 'compositions'

The following objects are masked from 'package:stats':

cor, cov, dist, var

The following objects are masked from 'package:base':

%*%, scale, scale.default

Cu        Zn        Pb
5.392698 14.908465 38.319017
Cd          Co
Cu -0.09523015  0.09523015
Zn -0.01806860  0.01806860
Pb  0.06635710 -0.06635710
Cd          Co
Cu -0.05397537  0.05397537
Zn -0.02733591  0.02733591
Pb  0.04157885 -0.04157885
Cd          Co
Cu -0.13655989 -0.10701624
Zn -0.14212410 -0.12289844
Pb -0.04364565 -0.03854308
Cd          Co
Cu -0.1194319 -0.10617287
Zn -0.1491914 -0.14016729
Pb -0.0498596 -0.05170684
Cd          Co
Cu -0.04033043 -0.02282343
Zn -0.05860886 -0.05584438
Pb  0.05886045  0.04699779
```

compositions documentation built on June 14, 2018, 5:03 p.m.