# Load the iris dataset
data(iris)
# Define the formula
formula <- "Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width"
# Define the pca_varlist
pca_varlist <- list(c("Sepal.Width", "Petal.Length"),
c("Sepal.Width", "Petal.Width"))
# Define the n_pca_list
n_pca_list <- list(2, 2)
# Set scaling values
lpca_center_list <- list("none", "none")
lpca_scale_list <- list("none", "none")
lpca_undo_list <- list(FALSE, FALSE)
# Run compswap
compswap_results <- compswap(data = iris,
formula = formula,
engine = "stats",
.pca_varlist = pca_varlist,
.n_pca_list = n_pca_list,
.lpca_center_list = lpca_center_list,
.lpca_scale_list = lpca_scale_list,
.lpca_undo_list = lpca_undo_list)
Run the code above in your browser using DataLab