prep_MRF_covariates: Cross-multiply response and covariate variables

View source: R/prep_MRF_covariates.R

prep_MRF_covariatesR Documentation

Cross-multiply response and covariate variables

Description

This function performs the cross-multiplication necessary for prepping datasets to be used in MRFcov models. This function is called by several of the functions within the package.

Usage

prep_MRF_covariates(data, n_nodes)

Arguments

data

Dataframe. The input data where the n_nodes left-most variables are outcome variables to be represented by nodes in the graph

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

Details

Observations of nodes (species) in data are prepped for MRFcov analysis by multiplication. This function is not designed to be called directly, but is used by other functions in the package (namely MRFcov, MRFcov_spatial, cv_MRF_diag, and bootstrap_MRF)

Value

Dataframe of the prepped response and covariate variables necessary for input in MRFcov models


nicholasjclark/MRFcov documentation built on March 30, 2024, 10:31 p.m.