Last chance! 50% off unlimited learning
Sale ends in
You can subset traits by identifier or by position using the
`[`
operator.
# S4 method for traits,missing,missing,missing
[(x, i, j, ..., drop = FALSE)# S4 method for traits,numeric,missing,missing
[(x, i, j, ..., drop = FALSE)
# S4 method for traits,character,missing,missing
[(x, i, j, ..., drop = FALSE)
A traits object.
A traits object.
Position of the identifier or the name of the identifier itself.
Not used.
Additional arguments not used here.
Not used.
if (FALSE) { # interactive()
# Get a few traits:
my_traits <- get_traits(trait_term = 'stroke', exact_term = FALSE,
progress_bar = FALSE)
#
# Subsetting by position
#
my_traits[1]
#
# Subsetting by EFO trait identifier (character)
#
my_traits['EFO_0000712']
}
Run the code above in your browser using DataLab