subset-traits: Subset a traits object

subset-traitsR Documentation

Subset a traits object

Description

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

Usage

## S4 method for signature 'traits,missing,missing,missing'
x[i, j, ..., drop = FALSE]

## S4 method for signature 'traits,numeric,missing,missing'
x[i, j, ..., drop = FALSE]

## S4 method for signature 'traits,character,missing,missing'
x[i, j, ..., drop = FALSE]

Arguments

x

A traits 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 traits object.

Examples


# 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']


quincunx documentation built on July 9, 2023, 7:32 p.m.