prep_MRF_covariates_spatial {MRFcov} | R Documentation |
Cross-multiply response and covariate variables and build spatial splines
Description
This function performs the cross-multiplication necessary
for prepping datasets to be used in MRFcov_spatial
models.
Usage
prep_MRF_covariates_spatial(data, n_nodes, coords)
Arguments
data |
Dataframe. The input data where the |
n_nodes |
Integer. The index of the last column in data which is represented by a node in the final graph. Columns with index greater than n_nodes are taken as covariates. Default is the number of columns in data, corresponding to no additional covariates |
coords |
A two-column |
Details
Observations of nodes (species) in data
are prepped for
MRFcov_spatial
analysis by multiplication. This function is useful if
users wish to prep the spatial splines beforehand and split the
data manually for out-of-sample cross-validation. To do so,
prep the splines here and set prep_splines = FALSE
in MRFcov_spatial
Value
Dataframe of the prepped response and covariate variables necessary for
input in MRFcov_spatial
models