% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/corral.R
\name{corral_preproc}
\alias{corral_preproc}
\title{Preprocess a matrix for Correspondence analysis}
\usage{
corral_preproc(
  inp,
  rtype = c("standardized", "indexed", "hellinger"),
  row.w = NULL,
  col.w = NULL
)
}
\arguments{
\item{inp}{matrix, numeric, counts or logcounts; can be sparse Matrix or matrix}

\item{rtype}{character indicating what type of residual should be computed; options are "indexed", "standardized", and "hellinger"; defaults to "standardized." \code{indexed} and \code{standardized} compute the respective chi-squared residuals and are appropriate for count data. The \code{hellinger} option is appropriate for continuous data.}

\item{row.w}{numeric vector; Default is \code{NULL}, to compute row.w based on \code{inp}. Use this parameter to replace computed row weights with custom row weights}

\item{col.w}{numeric vector; Default is \code{NULL}, to compute col.w based on \code{inp}. Use this parameter to replace computed column weights with custom column weights}
}
\value{
sparse matrix, processed for input to \code{compsvd} to finish CA routine
}
\description{
This function performs the row and column scaling pre-processing operations, prior to SVD, for the corral methods. See \code{\link{corral}} for single matrix correspondence analysis and \code{\link{corralm}} for multi-matrix correspondence analysis.
}
\examples{
mat <- matrix(sample(0:10, 500, replace=TRUE), ncol=25)
mat_corral <- corral_preproc(mat)
corral_output <- compsvd(mat_corral, ncomp = 5)
}
