View source: R/download_model.R
download_model | R Documentation |
novelforest_data
Download the brms
model fitted to novelforest_data
(Lai et al. 2021).
The model object is too large (16.5 MB) to be included with the package,
so this function downloads the model from the developmental GitHub website.
The generalised linear mixed-effect model was fitted via brms::brm
so
this package is recommended to make full use of the model object.
download_model(save_to = NULL)
save_to |
Path and name of the file where the R object is saved to. Defaults to NULL, which does not save the model object locally. |
A brms
model output of class brmsfit
,
which is a list containing the input data
and other slots
that store the model components.
Notably, the data
slot contains a data.frame
with the following
response variables:
first-order native taxonomic diversity, i.e., species richness
second-order native taxonomic diversity, i.e., inverse Simpson index
first-order exotic taxonomic diversity
second-order exotic taxonomic diversity
first-order native functional diversity
second-order native functional diversity
first-order exotic functional diversity
second-order exotic functional diversity,
and the following explanatory variables (and measurement units if you backtransform
them using backtransform
):
Distance to old-growth forests (m)
Patch area (km^2)
Total soil nitrogen (mg/kg)
Total extractable soil phosphorous (mg/kg)
Total extractable soil potassium (mg/kg)
Forest patch ID
#' Note that all explanatory variables were log-transformed and standardised to zero mean and
unit standard deviations. Use backtransform
to obtain the variables in
their original scales. See Lai et al. (2021) for more details on model building and
data collection.
Lai, H.R., Tan, G.S.Y., Neo, L., Kee, C.Y., Yee, A.T.K., Tan, H.T.W. and Chong, K.Y. (2021) Decoupled responses of native and exotic tree diversities to distance from old-growth forest and soil phosphorous in novel secondary forests. Applied Vegetation Science, 24, e12548. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/avsc.12548")}
backtransform, brms::brmsfit, brms::brm
## Not run:
novelforest_model <- download_model()
# library(brms) # recommended
summary(novelforest_model)
# to obtain input data
novelforest_model$data
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.