subset.viterbi: Subsetting Viterbi results

View source: R/subset_viterbi.R

subset.viterbiR Documentation

Subsetting Viterbi results

Description

Pull out a specified set of individuals and/or chromosomes from the results of viterbi()

Usage

## S3 method for class 'viterbi'
subset(x, ind = NULL, chr = NULL, ...)

## S3 method for class 'viterbi'
x[ind = NULL, chr = NULL]

Arguments

x

Imputed genotypes as output from viterbi().

ind

A vector of individuals: numeric indices, logical values, or character string IDs

chr

A vector of chromosomes: logical values, or character string IDs. Numbers are interpreted as character string IDs.

...

Ignored.

Value

An object of class "viterbi", like the input, with the selected individuals and/or chromosomes; see viterbi().

Examples

grav2 <- read_cross2(system.file("extdata", "grav2.zip", package="qtl2"))

g <- viterbi(grav2)
# keep just individuals 1:5, chromosome 2
gsub <- g[1:5,2]
# keep just chromosome 2
gsub2 <- g[,2]

qtl2 documentation built on May 29, 2024, 11:46 a.m.