if (FALSE) { # rlang::is_installed("mixOmics") && !butcher:::is_cran_check()
library(butcher)
do.call(library, list(package = "mixOmics"))
# pls ------------------------------------------------------------------
fit_mod <- function() {
boop <- runif(1e6)
pls(matrix(rnorm(2e4), ncol = 2), rnorm(1e4), mode = "classic")
}
mod_fit <- fit_mod()
mod_res <- butcher(mod_fit)
weigh(mod_fit)
weigh(mod_res)
new_data <- matrix(1:2, ncol = 2)
colnames(new_data) <- c("X1", "X2")
predict(mod_fit, new_data)
predict(mod_res, new_data)
}
Run the code above in your browser using DataLab