subset-scores | R Documentation |
You can subset scores by identifier or by position using the
`[`
operator.
## S4 method for signature 'scores,missing,missing,missing'
x[i, j, ..., drop = FALSE]
## S4 method for signature 'scores,numeric,missing,missing'
x[i, j, ..., drop = FALSE]
## S4 method for signature 'scores,character,missing,missing'
x[i, j, ..., drop = FALSE]
x |
A scores object. |
i |
Position of the identifier or the name of the identifier itself. |
j |
Not used. |
... |
Additional arguments not used here. |
drop |
Not used. |
A scores object.
# Get a few polygenic scores:
my_scores <- get_scores(sprintf('PGS%06d', 10:14), progress_bar = FALSE)
#
# Subsetting by position
#
my_scores[c(1, 3, 5)]@scores
#
# Subsetting by PGS identifier (character)
#
my_scores[c('PGS000011', 'PGS000014')]@scores
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.