add.phdata {GenABEL}R Documentation

Adds phenotypic variables to gwaa.data object

Description

Adds phenotypic variables to @phdata slot of an gwaa.data-class object

Usage

add.phdata(data, phdata)

Arguments

data an object of gwaa.data-class
phdata data frame

Details

The "phdata" data frame is simply merged to the @phdata slot of the "data", and is sorted according to the right order.

The "phdata" frame should contain single variable named "id", preferably of "character" class. It may contain "sex" variable, but that will be re-named to avoid duplication with the default sex variable presented in @phdata.

Value

Updated object of gwaa.data-class

Author(s)

Yurii Auclhenko

See Also

merge.gwaa.data, merge.snp.data

Examples

        data(srdta)
# take a small subset for this example
        srdta <- srdta[1:10,1:5]
        srdta
# generate id names
        ids <- paste("p",c(2,1,7,3,5,9,11,22,27),sep="")
# generate some random trait values
        newtra <- rnorm(9)
# make data frame
        x <- data.frame(id=ids,newtra=newtra)
        x
# now add this new trait to the data
        srdta1 <- add.phdata(srdta,x)
        srdta1

[Package GenABEL version 1.4-2 Index]