aldex.corr {ALDEx2} | R Documentation

## Calculate correlation with a continuous variable

### Description

`aldex.corr` calculates the expected values for the correlation between each feature and a continuous variable, using data returned returned by `aldex.clr` and a vector of the continuous variable. By default uses pearson but method="kendall" or "spearman" can be passed to the cor.test function.

### Usage

    aldex.corr(clr, cont.var, verbose = FALSE, ...)

### Arguments

`clr` | An `ALDEx2` object. The output of `aldex.clr`.
`cont.var` | A continuous numeric vector
`verbose` | A boolean. Toggles whether to print diagnostic information while running. Useful for debugging errors on large datasets. Applies to `effect = TRUE`.
`...` | Arguments passed to `cor.test`.

### Value

Returns a data.frame of the average coefficients and their p-values for each feature, with FDR appended as a `BH` column.

### Author(s)

Thom Quinn, Greg Gloor

### References

Please use the citation given by `citation(package="ALDEx2")`.

### See Also

`aldex`, `aldex.clr`, `aldex.ttest`, `aldex.kw`, `aldex.glm`, `aldex.effect`, `aldex.corr`, `selex`

### Examples

    data(selex)
    #subset for efficiency
    selex <- selex[1201:1600,]
    conds <- c(rep("N", 7), rep("S",7))
    cont.var <-  1:14
    x <- aldex.clr(selex, conds)
    corr.test <- aldex.corr(x, cont.var)

[Package ALDEx2 version 1.18.0 Index]