subset_dims: Subset dimensions of a caobj

Description Usage Arguments Value Examples

View source: R/CA.R

Description

Subsets the dimensions according to user input.

Usage

1
subset_dims(caobj, dims)

Arguments

caobj

A caobj.

dims

Integer. Number of dimensions.

Value

Returns caobj.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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(cnts)
ca <- subset_dims(ca, 2)

elagralinska/APLpackage documentation built on Dec. 20, 2021, 4:15 a.m.