Learn R Programming

quincunx (version 0.1.9)

subset-scores: Subset a scores object

Description

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

Usage

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

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

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

Value

A scores object.

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.

Examples

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

Run the code above in your browser using DataLab