View source: R/1.2b.f.sel.env.R
select_vars | R Documentation |
This function creates a correlation matrix for the layers of a raster brick/stack and returns a brick containing the least correlated variables below the cutoff value.
select_vars(
env = NULL,
cutoff = 0.9,
corr.mat = NULL,
sample.size = NULL,
names.only = F,
plot.dend = T,
rm.old = F,
sp.nm = "sp",
filename = NULL
)
env |
raster brick/stack |
cutoff |
A numeric value for the pair-wise absolute correlation cutoff. |
corr.mat |
Correlation matrix from which variables will be selected. If the correlation matrix was already computed from env, you can just input here and choose other cutoff values for selecting variable layers. |
sample.size |
Numeric. Number of cells of each layer to be sampled and used for computing correlation. If NULL (default), all cells are used to compute correlation. between variables. |
names.only |
Logical. Return only the names of selected variables (T) or return the raster brick containing the least correlated variables (F). |
plot.dend |
Logical. Plot dendrogram of correlation distance between variables, showing cutoff limit and selected (black) and discarded (red) variables |
rm.old |
Logical. Remove (T) old env variables from folder? |
sp.nm |
Species name. Used to name the output folder |
filename |
Output filename |
This function creates a correlation matrix for the layers of a raster brick/stack, then searches for pair-wise correlations above the cutoff, eliminates variables with most pair-wise correlations and retains the largest number of variables with pair-wise correlation below the cutoff Optionally, a raster brick containing only the variables with correlation below the cutoff is returned.
select_vars_b
, correlated
, findCorrelation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.