# NOT RUN {
x <- mtcars[-1]
x <- transform(x,
cyl = factor(cyl, ordered=TRUE),
vs = factor(vs),
gear = factor(gear)
)
y <- mtcars$mpg
cv <- resample("crossvalidation", y)
data <- pre_split(x, y, cv[[1]]) %>%
pre_factor_to_logical(base = c(cyl="4", vs="0"),
drop=c(cyl=FALSE, gear=FALSE))
data$fit$x
# }
Run the code above in your browser using DataLab