Read PLINK BED/BIM/FAM files into R
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
plink2R Removed old dependency on mmap Oct 27, 2016
.gitignore gitignore May 19, 2014
README.md Cleaned up docs Dec 18, 2014
data.bed github readme Jan 28, 2014
data.bim github readme Jan 28, 2014
data.fam github readme Jan 28, 2014
plink2R.R Cleaned up docs Dec 18, 2014

README.md

plink2R

plink2R natively reads PLINK (http://pngu.mgh.harvard.edu/~purcell/plink) BED/BIM/FAM files into R.

Missing genotypes are imputed by assigning missing values the per-SNP average.

Depends on Rcpp, RcppEigen

Example:

library(plink2R)
dat <- read_plink("data")
dim(dat$bed)
dim(dat$fam)
dim(dat$bim)

Also see the file plink2.R for an example.

If there are missing genotypes, these will by default be assigned as NA. To do simple imputation of missing genotypes (for each SNP, randomly assigning to the missing genotypes values sampled proportionally to the non-missing genotypes in the SNP), use read_plink("data", impute="random").