Learn R Programming

gaston (version 1.2)

write.bed.matrix: Save a bed.matrix

Description

Save a bed.matrix in several files

Usage

write.bed.matrix(x, basename, bed = paste(basename, ".bed", sep=""),   
                              fam = paste(basename, ".fam", sep=""),
                              bim = paste(basename, ".bim", sep=""), 
                              rds = paste(basename, ".rds", sep=""))

Arguments

Details

If any of bed, fam, bim and rds is NULL, the corresponding file will not be written.

The .fam and .bim files are useful for reading files with other softwares. The .rds file can be read by read.bed.matrix.

The .bed, .fam and .bim files follow the PLINK specifications (http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#bed).

See Also

read.bed.matrix, saveRDS

Examples

Run this code
# Load data
data(LCT)
x <- as.bed.matrix(LCT.gen, LCT.fam, LCT.bim)

# Write object in LCT.bed and LCT.RData
write.bed.matrix(x, "LCT")

Run the code above in your browser using DataLab