Description Usage Arguments Details Value Examples
Calculates the association plot coordinates for either the rows, columns or both (default).
1 | apl_coords(caobj, group, calc_rows = TRUE, calc_cols = TRUE)
|
caobj |
A "cacomp" object with principal row coordinates and standard column coordinates calculated. |
group |
Numeric/Character. Vector of indices or column names of the columns to calculate centroid/x-axis direction. |
calc_rows |
TRUE/FALSE. Whether apl row coordinates should be calculated. Default TRUE. |
calc_cols |
TRUE/FALSE. Whether apl column coordinates should be calculated. Default TRUE. |
Coordinates (x,y) of row vector \vec{r} are defined as
x(\vec{r}) := ≤ft|\vec{r}\right|\cos(φ(\vec{r}))
y(\vec{r}) := ≤ft|\vec{r}\right|\sin(φ(\vec{r}))
The x-direction is determined by calculating the centroid of the columns selected with the indices in "group".
Returns input "cacomp" object and adds components "apl_rows" and/or "apl_cols" for row and column coordinates. In "group" the indices of the columns used to calculate the centroid are saved.
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(1234)
# Simulate scRNAseq data.
cnts <- data.frame(cell_1 = rpois(10, 5),
cell_2 = rpois(10, 10),
cell_3 = rpois(10, 20),
cell_4 = rpois(10, 20))
rownames(cnts) <- paste0("gene_", 1:10)
cnts <- as.matrix(cnts)
# Run correspondence analysis.
ca <- cacomp(obj = cnts, princ_coords = 3)
# Calculate APL coordinates:
ca <- apl_coords(ca, group = 3:4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.