Backtransform scaled predictors in the input data (obtained via
download_model()
) to their original scales. This is done by first
back-scaling to the log-scale, and then backtranformed to the original
scale (the predictors were log-transformed as described in Lai et al. 2021).
backtransform(data)
Defaults to the data object in download_model()
(see Examples), but could also be another data.frame
with the same
predictor names, should you wish to (back)scale and (back)center using the
same means and standard deviations for any reason.
A backtransformed data.frame
with predictors at their original
scales.
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. doi:10.1111/avsc.12548
# download the model object containing input data
novelforest_model <- download_model()
#> To save the model locally, use argument save_to = 'path/filename.rds'
#> Downloading model (size: 16.5 Mb)
dat <- backtransform(novelforest_model$data)
head(dat)
#> SD_N_0 dist size nitrogen phosphorous potassium patch SD_N_2 SD_E_0
#> 1 2 3293.800 38.15329 2730 17.40 59.1 AD 1.600000 3
#> 2 8 3174.000 38.15329 1750 9.32 54.7 AD 5.128205 2
#> 3 2 3262.353 38.15329 2590 12.40 82.5 AD 1.600000 2
#> 4 1 3315.600 38.15329 2310 6.16 76.6 AD 1.000000 1
#> 5 0 3358.000 38.15329 2520 6.51 53.9 AD 0.000000 3
#> 6 6 3671.503 21.44964 2660 23.60 71.2 AW 4.121951 2
#> SD_E_2 FD_N_0 FD_N_2 FD_E_0 FD_E_2
#> 1 1.549356 6.068161 6.068161 19.061061 14.349844
#> 2 1.124514 176.741963 80.528861 6.345825 6.345825
#> 3 1.045431 6.276896 6.276896 6.351461 6.351461
#> 4 1.000000 0.000000 0.000000 0.000000 0.000000
#> 5 2.461538 0.000000 0.000000 19.061061 13.579309
#> 6 1.800000 95.149105 54.255080 6.345825 6.345825