Learn R Programming

pbatR (version 0.6)

phe: Phenotype Object

Description

Creates, tests, reads, or writes an object of class phe.

Usage

as.phe( df, pid="pid", id="id" )

is.phe( obj )

read.phe( filename, na.strings=c("-",".","NA"), lowercase=TRUE, ... )

write.phe( file, phe )

Arguments

df
Dataframe with the data
pid
String for the column header for 'pid' - pedigree ID.
id
String for the column header for 'id' - ID.
obj
any object
filename
Filename to open; does not need .phe extension.
na.strings
Strings that represent NA; defaults should be fine here.
lowercase
When TRUE (default), enforces all headers to lowercase for convenience.
...
Options for read.table. Do not put in header=TRUE, as this will cause an error, as the header is automatically loaded.

With the proper file formatting, this should not

file
string representing filename, or a connection for file output
phe
An object of class 'phe' (see as.phe).

References

http://www.biostat.harvard.edu/~clange/default.htm http://www.people.fas.harvard.edu/~tjhoffm/pbatR.html

See Also

read.ped, write.ped, as.ped, as.pedlist

Examples

Run this code
# A highly artificial example just to get you used to the syntax
#  of using 'as.phe'.
x <- data.frame( pid    = c(1,1,2,2,2),
                 id     = c(1,2,3,4,5),
                 age    = c(14,45,33,22,21),
                 weight = c(150,100,180,185,110) )
x
myPhe <- as.phe( x );
myPhe

# And just another e.g. capitolizing on prior code
names(x)[1:2] <- c("thepid","theid")
x
myPhe <- as.phe( x, pid="thepid", id="theid" )
myPhe  # same as before!

Run the code above in your browser using DataLab