Skip to content

Determine the names of the features (rotation) or samples (projection) above/below a specified cutoff (value) in the principal component dimension specified by dim.

Usage

get_pca_names(x, type = c("rotation", "projection"), dim = 1L, value)

Arguments

x

A pca class object. See pca().

type

character(1). Matched. Either "rotation" or "projection".

dim

integer(2). Which PCA dimension to select.

value

numeric(1). The value corresponding to the dimension to interrogate for names.

Value

A character string corresponding to the feature names that exceed value in the dimension dim.

See also

Author

Stu Field

Examples

pca <- pca(pcapkg:::log10_ft(simdata))
get_pca_names(pca, "r", 1, 0.1)      # feature names
#>  [1] "seq.2802.68" "seq.1942.70" "seq.9608.12" "seq.3459.49"
#>  [5] "seq.3865.56" "seq.3363.21" "seq.4487.88" "seq.5994.84"
#>  [9] "seq.4936.96" "seq.2277.95" "seq.4914.10" "seq.3476.4" 
#> [13] "seq.7841.8"  "seq.4461.56" "seq.8797.98"

get_pca_names(pca, "p", value = 0.1) # sample names
#>  [1] "28704098_1" "74703475_1" "93904282_1" "56899633_1" "46713227_1"
#>  [6] "69694117_1" "97975242_1" "40869963_1" "35984450_1" "25885578_1"
#> [11] "19400953_1" "35274802_1" "42005783_1" "94064776_1" "99784020_1"
#> [16] "69925630_1" "70477393_1" "65263757_1" "71305641_1" "88325979_1"
#> [21] "63149125_1" "65054205_1" "43721936_1"