prepare_data | R Documentation |
Create train and test datasets given a formula and data
prepare_data( formula, data, test_prop = 0, keep.var = NULL, drop_na = TRUE, spatial = FALSE, seed = NULL )
formula |
the formula for the LMM or RF |
data |
the complete dataset |
test_prop |
the amount of rows to keep in the test dataset (default = 0) |
keep.var |
a vector of character strings indicating which variables to keep in the dataset on top of those defined by the formula |
drop_na |
whether to drop NAs or not (default = TRUE) |
spatial |
whether or not keeping predictor for fitting spatial effects (default = FALSE) |
seed |
an optional seed for the RNG |
prepare_data(log(staff_rangers + 1) ~ log(GDP_2019) + Matern(1|long + lat), data = data_rangers, test_prop = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.