textmodel_ca implements correspondence analysis scaling on a dfm. The method is a fast/sparse version of function ca.

textmodel_ca(x, smooth = 0, nd = NA, sparse = FALSE,
  residual_floor = 0.1)



the dfm on which the model will be fit


a smoothing parameter for word counts; defaults to zero.


Number of dimensions to be included in output; if NA (the default) then the maximum possible dimensions are included.


retains the sparsity if set to TRUE; set it to TRUE if x (the dfm) is too big to be allocated after converting to dense


specifies the threshold for the residual matrix for calculating the truncated svd.Larger value will reduce memory and time cost but might reduce accuracy; only applicable when sparse = TRUE


textmodel_ca() returns a fitted CA textmodel that is a special class of ca object.


svds in the RSpectra package is applied to enable the fast computation of the SVD.


You may need to set sparse = TRUE) and increase the value of residual_floor to ignore less important information and hence to reduce the memory cost when you have a very big dfm. If your attempt to fit the model fails due to the matrix being too large, this is probably because of the memory demands of computing the \(V \times V\) residual matrix. To avoid this, consider increasing the value of residual_floor by 0.1, until the model can be fit.


Nenadic, O. and Greenacre, M. (2007). Correspondence analysis in R, with two- and three-dimensional graphics: The ca package. Journal of Statistical Software, 20 (3), http://www.jstatsoft.org/v20/i03/.

See also


ieDfm <- dfm(data_corpus_irishbudget2010) wca <- textmodel_ca(ieDfm)
#> Error in get(".SigLength", envir = env): object '.SigLength' not found
#> Error in summary(wca): object 'wca' not found