correlation-methods: Creation of an ExposomeCorr from an ExposomeSet.

correlationR Documentation

Creation of an ExposomeCorr from an ExposomeSet.

Description

Method to calculate the correlation between the exposures of an ExposomeSet. The correlation method takes into account the nature of each pair of exposures: continuous vs. continuous uses cor function from R base, categorical vs. categorical uses cramerV function from lsr R package and categorical vs. continuous exposures correlation is calculated as the square root of the adjusted r-square obtained from fitting a lineal model with the categorical exposures as dependent variable and the continuous exposure as independent variable. The function creates and returns an ExposomeCorr object.

Usage

correlation(object, ..., warnings = TRUE)

Arguments

object

ExposomeSet which exposures will be used to calculate their correlation

...

Other arguments passed to cor, cramersV or to lm.

warnings

(default TRUE) If set to FALSE warnings will not be displayed.

Value

ExposomeCorr with the correlation between the selected exposures and their description

See Also

plotCorrelation to plot the correlations of an ExposomeCorr, clustering to see how the exposures can cluster samples, pca to compute PCA on exposures

Examples

data("exposome")
expo.c <- correlation(expo)
expo.c
expo.c.table <- extract(expo.c)

isglobal-brge/rexposome documentation built on Feb. 4, 2023, 12:35 p.m.