% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01-s4_generics.R, R/03-s4_methods.R
\name{xres}
\alias{xres}
\alias{xres,m8_model-method}
\title{Compute X residual matrix
Returns the residual matrix (E) of an OPLS model.}
\usage{
xres(object)

\S4method{xres}{m8_model}(object)
}
\arguments{
\item{object}{An object.}
}
\value{
Numeric matrix containing the X residuals.
}
\description{
Compute X residual matrix
Returns the residual matrix (E) of an OPLS model.
}
\examples{
data(covid)
cv <- balanced_mc(k = 5, split = 2/3)
scaling <- uv_scaling(center = TRUE)
model <- opls(X = covid$X, Y = covid$an$type, scaling, cv)
X_res <- xres(model)
dim(X_res) == dim(covid$X)
}
