# Load example data
data(mtcars)
# Prepare data for PLS regression
X <- mtcars[, c("wt", "hp", "disp")]
Y <- mtcars[, "mpg", drop = FALSE]
# Fit PLS model with 2 components
pls.fit <- pls.regression(X, Y, n.components = 2)
# Print a LaTeX-formatted summary
pls.summary(pls.fit, include.scores = FALSE)
Run the code above in your browser using DataLab