Access slots in a cacomp object
cacomp_slot.Rd
Access slots in a cacomp object
Examples
# Simulate scRNAseq data.
cnts <- data.frame(cell_1 = rpois(10, 5),
cell_2 = rpois(10, 10),
cell_3 = rpois(10, 20))
rownames(cnts) <- paste0("gene_", 1:10)
cnts <- as.matrix(cnts)
# Run correspondence analysis.
ca <- cacomp(obj = cnts, princ_coords = 3, top = 5)
#> No dimensions specified. Setting dimensions to: 2
#> Please consider setting the dimensions to a lower value to speed up the calculation.
#> Recommended dimensionality: << min(nrows, ncols) * 0.2
# access left singular vectors
cacomp_slot(ca, "U")
#> Dim1 Dim2
#> gene_10 -0.637567772 0.2580198
#> gene_4 0.765832223 0.1546521
#> gene_7 -0.080908929 -0.5350181
#> gene_5 -0.008859746 0.6562842
#> gene_6 -0.019585524 -0.4388112