corral_preproc {corral}R Documentation

Preprocess a matrix for Correspondence analysis

Description

This function performs the row and column scaling pre-processing operations, prior to SVD, for the corral methods. See corral for single matrix correspondence analysis and corralm for multi-matrix correspondence analysis.

Usage

corral_preproc(
  inp,
  rtype = c("standardized", "indexed", "hellinger"),
  row.w = NULL,
  col.w = NULL
)

Arguments

inp

matrix, numeric, counts or logcounts; can be sparse Matrix or matrix

rtype

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

row.w

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

col.w

numeric vector; Default is NULL, to compute col.w based on inp. Use this parameter to replace computed column weights with custom column weights

Value

sparse matrix, processed for input to compsvd to finish CA routine

Examples

mat <- matrix(sample(0:10, 500, replace=TRUE), ncol=25)
mat_corral <- corral_preproc(mat)
corral_output <- compsvd(mat_corral, ncomp = 5)

[Package corral version 1.0.0 Index]