sdapredvars | R Documentation |
Function for preparing explanatory variables data for SDA-based prediction or the testing data for cross validation
sdapredvars(xlist)
xlist |
A list of the SDA explanatory variables |
A data.frame of variables for prediction or validation
data("obs")
data("sample_vars_sda")
obs$Cr_ppm <- log(obs$Cr_ppm)
krm <- rmvoutlier(obs$Cr_ppm)
y <- obs$Cr_ppm[-krm]
x <- list(sample_vars_sda[[1]][-krm, 1:11])
kvalidate <- sample(length(y), 0.3*length(y), replace = FALSE)
yv <- y[kvalidate]
xv <- lapply(x, function(x) x[kvalidate,])
sdaxv <- sdapredvars(xv)
sdayxv <- cbind(yv, sdaxv)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.