subset-cohorts | R Documentation |
You can subset cohorts by identifier or by position using the
`[`
operator.
## S4 method for signature 'cohorts,missing,missing,missing'
x[i, j, ..., drop = FALSE]
## S4 method for signature 'cohorts,numeric,missing,missing'
x[i, j, ..., drop = FALSE]
## S4 method for signature 'cohorts,character,missing,missing'
x[i, j, ..., drop = FALSE]
x |
A cohorts 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 cohorts object.
# Get a few cohorts by their symbol:
my_cohorts <- get_cohorts(c('23andMe', 'BioImage', 'Rotterdam-SI', 'SGWAS'),
progress_bar = FALSE)
#
# Subsetting by position
#
my_cohorts[c(1, 3)]
#
# Subsetting by cohort symbol (character)
#
my_cohorts[c('23andMe', 'SGWAS')]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.