subset-scores: Subset a scores object

subset-scoresR Documentation

Subset a scores object

Description

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

Usage

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

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

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

Arguments

x

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

Examples


# Get a few polygenic scores:
my_scores <- get_scores(sprintf('PGS%06d', 10:14), progress_bar = FALSE)

#
# Subsetting by position
#
my_scores[c(1, 3, 5)]@scores

#
# Subsetting by PGS identifier (character)
#
my_scores[c('PGS000011', 'PGS000014')]@scores


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