subset-cohorts {quincunx} | R Documentation |
Subset a cohorts object
Description
You can subset cohorts by identifier or by position using the
`[`
operator.
Usage
## 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]
Arguments
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. |
Value
A cohorts object.
Examples
# 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')]
[Package quincunx version 0.1.10 Index]