Learn R Programming

paramlink (version 0.3-1)

read.linkdat: Read/write 'linkdat' objects

Description

Create 'linkdat' object from a pedigree file with simulation and/or marker information (e.g. pre-makeped format).

Usage

read.linkdat(file, header=FALSE, missing=0, model=NULL, ...)

write.linkdat(x, file="", col.names=FALSE)

Arguments

file
the name of the file containing the pedigree. See Details for format information.
header
a logical value indicating whether the file contains column names.
missing
a numeric or character of length 1 indicating the code for missing marker alleles.
model
optional: the linkage model to be passed onto setModel (see this for details).
x
a code{linkdat} object.
col.names
a logical value indicating if column names should be included in the file.
...
further arguments to be passed to read.table.

Value

  • For read.linkdat, a linkdat object.

Details

The input to read.linkdat should be a file with numerical columns in the following order (standard LINKAGE format): 1 Family id (optional), 2 Individual id, 3 Father id, 4 Mother id, 5 Sex, 6 Affection status, 7 First allele of first marker, 8 Second allele of first marker, 9 First allele of second marker, a.s.o. Only columns 2-6 are mandatory. The first column is interpreted as family id if its first two entries are equal.

See Also

linkdat

Examples

Run this code
data(toyped)
toy = linkdat(toyped)
write.linkdat(toy, "toy.ped", col.names=TRUE)
toy2 = read.linkdat("toy.ped", header=TRUE)
stopifnot(all.equal(toy, toy2))

Run the code above in your browser using DataLab