cor2m {ecodist} | R Documentation |
cor2m generates a correlation table between the variables of 2 matrices–by design, species and environment. It stores these in a table with species as columns and envnvironmental variables as rows, so it's easy to scan. It also removes correlations less than a user-specified alpha (0.05 by default)
cor2m(x, y, trim = TRUE, alpha = 0.05)
x |
A matrix of species (or other) variables |
y |
A matrix of environmental (or other) variables matching the sites of x |
trim |
If trim is TRUE, set rho<critical value(alpha) to 0 |
alpha |
alpha p-value to use with trim |
Correlate variables from 1 matrix with variables from another matrix. If TRIM, set rho<critical value(alpha) to 0. Computes this critical value as a t-test with n-2 df.
Returns a correlation table between the variables of 2 matrices.
Dean Urban
# toy example speciesdata <- matrix(runif(50), nrow=10) colnames(speciesdata) <- c("spA", "spB", "spC", "spD", "spE") envdata <- matrix(runif(30), nrow=10) colnames(envdata) <- c("var1", "var2", "var3") sppenv.cor <- cor2m(speciesdata, envdata)