phenotype: Create a phenotype object

Description Usage Arguments Details Value See Also

View source: R/phenotype.R

Description

This function creates a phenotype object.

Usage

1
2
3
4
phenotype(data, formula = NULL, family = NULL, id = NULL, gender = NULL,
  include = NULL, exclude = NULL)

is_phenotype(x)

Arguments

data

a data frame (or object coercible by as.data.frame to a data frame) containing the variables in the model.

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.The details of model specification are given under 'Details' in the "lm" help file.

id

(optional) column name identifier of the unique subjects in data. If given the phenotype sample ids will become the rownames of data. If id is NULL the suject id's are assumed to be the rownames of data.

gender

(optional) column name identifier for the gender in data

include

(optional) character vector of the subjects in id to be included in the analysis. See Details.

exclude

(optional) character vector of the subjects in id to be excluded in the analysis. See Details.

reduce

logical. Should the dataset be reduced to only columns used in formula. See Details

Details

data and formula are similar to what is needed for lm. If a formula is not specifed, no further analysis will run.

If the id is not specified it is assumed that the rownames in data are the unique subject identifier. If id is specifed then rownames(data) will be set to id. Thus the subject id's must be unique and without duplication.

If the gender column is not specified it will be set to NULL.

Typically either include or exclude, or both, is set to NULL. It is important to note that return include and exclude are taken from the subjects in data and not from the input parameters. [TBD: explain include/exclude]

If reduce == TRUE then data is reduced to a data.frame containing the variables used in formula plus gender. See get_all_vars for specifics.

Value

an object of class 'phenotype'. This is a list typicaly used to feed into an analysis function.

An object of class 'phenotype' is a list containing at least the following components:

It is important to note that return include and exclude are taken from data and not from the input parameters.

See Also

get_all_vars


DavisBrian/gwasr documentation built on May 6, 2019, 1:55 p.m.