get_pheno: Get the phenotype matrix

Description Usage Arguments Value Examples

View source: R/get_pheno.R

Description

This function can return a number of different trait matrices depending on the arguments.

Usage

1
2
3
4
5
get_pheno(
  data_obj,
  scan_what = c("eigentraits", "normalized_traits", "raw_traits"),
  covar = NULL
)

Arguments

data_obj

a Cape object

scan_what

A character string. One of "eigentraits", "normalized.trait", or "raw_traits." If "eigentraits" the function returns the eigentraits matrix. If "normalized_traits" the function returns the trait matrix after mean-centering and normalizing. If "raw.trait" the function returns the trait matrix before mean-centering and normalization were applied.

covar

A character value indicating which, if any, covariates the traits should be adjusted for. If covariates are specified, the function fits a linear model to specify the traits with the covariates and returns the matrix of residuals (i.e. the traits after adjusting for the covariates).

Value

A matrix in which each column is a trait, and each row is an individual. The values correspond to the argument settings described above.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
#get eigentrait matrix
eigenT <- get_pheno(data_obj, "eigentraits")

#get normalized trait matrix
pheno <- get_pheno(data_obj, "normalized_traits")

#get normalized traits adjusted for sex
pheno <- get_pheno(data_obj, "normalized_traits", covar = "sex")

#get raw trait matrix
pheno <- get_pheno(data_obj, "raw_traits")

## End(Not run)

cape documentation built on Feb. 10, 2021, 5:06 p.m.