Learn R Programming

quincunx (version 0.1.9)

subset-cohorts: Subset a cohorts object

Description

You can subset cohorts by identifier or by position using the `[` operator.

Usage

# S4 method for cohorts,missing,missing,missing
[(x, i, j, ..., drop = FALSE)

# S4 method for cohorts,numeric,missing,missing [(x, i, j, ..., drop = FALSE)

# S4 method for cohorts,character,missing,missing [(x, i, j, ..., drop = FALSE)

Value

A cohorts object.

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.

Examples

Run this code
if (FALSE) { # interactive()
# 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')]
}

Run the code above in your browser using DataLab