spatial_gradient_screening.RdConducts spatial gradient screening.
spatial_gradient_screening(
coords_df,
variables,
resolution,
cf = 1,
rm_zero_infl = TRUE,
n_random = 10000,
sign_var = "fdr",
sign_threshold = 0.05,
skip_comp = FALSE,
force_comp = FALSE,
model_subset = NULL,
model_add = NULL,
model_remove = NULL,
control = NULL,
seed = 123,
verbose = TRUE
)A data.frame that contains at least a numeric variable named
dist as well the numeric variables denoted in variables.
Character vector of numeric variable names that are integrated in the screening process.
Units value of the same unit of the dist variable in
coords_df.
Number of random permutations for the significance testing of step 2.
Either p_value or fdr. Defaults to fdr.
The significance threshold. Defaults to 0.05.
A list of arguments as taken from stats::loess.control().
Default setting is stored in SPATA2::sgs_loess_control.
Numeric value. Sets the random seed.
Logical. If TRUE, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
A list of four slots:
variables: A character vector of the names of all variables included in the screening.
model_df: A data.frame of the models used for step 3.
loess_models: A named list of loess models for all variables integrated in the screening process. Names correspond to the variable names.
pval: Data.frame of three variables: variable, lds, p_value and fdr. Contains the results of step 2. Each observation corresponds to the inferred gradient of a variable.
eval: Data.frame of five variable: variable, model, corr, mae rmse. Contains the results of step 3. Each observation corresponds to a gradient ~ model fit. Variables correspond to the evaluation metrics of the fit.