corral_preproc: Preprocess a matrix for Correspondence analysis

Description Usage Arguments Value Examples

View source: R/corral.R

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

1
2
3
4
5
6
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

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

corral documentation built on Nov. 8, 2020, 8:25 p.m.