add.phdata {GenABEL} | R Documentation |
Adds phenotypic variables to @phdata slot
of an gwaa.data-class
object
add.phdata(data, phdata)
data |
an object of gwaa.data-class |
phdata |
data frame |
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.
Updated object of gwaa.data-class
Yurii Auclhenko
merge.gwaa.data
,
merge.snp.data
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