Learn R Programming

cape (version 2.0.2)

select.by.ind: Subset a cross object to include specific individuals

Description

This function subsets a cross to include individuals based on either phenotypic or genotypic values. For example, this function can subset a cross to include all individuals with a phenotype value greater than x or a genotype value equal to y.

Usage

select.by.ind(data.obj, geno.or.pheno = pheno, expr)

Arguments

data.obj
The object in which all results are stored. See read.population.
geno.or.pheno
A character value, either "geno", or "pheno" to specify which matrix should be used to subset individuals.
expr
An quoted expression used to subset individuals.

Value

The cross object is returned including only the individuals meeting the criteria in the provided expression.

See Also

select.by.chr

Examples

Run this code
data(obesity.cross)
hist(obesity.cross$pheno[,"insulin"], main = "original insulin distribution",
xlab = "insulin (ng/mL)", xlim = c(0, 30))
obesity.cross <- select.by.ind(obesity.cross, "pheno", "insulin < 25")
hist(obesity.cross$pheno[,"insulin"], main = "subset insulin distribution", 
xlab = "insulin (ng/mL)", xlim = c(0, 30))

Run the code above in your browser using DataLab