bed2matrix {pcadapt} | R Documentation |
Convert a bed to a matrix
Description
Convert a bed to a matrix
Usage
bed2matrix(bedfile, n = NULL, p = NULL)
Arguments
bedfile |
Path to a bed file. |
n |
Number of samples. Default reads it from corresponding fam file. |
p |
Number of SNPs. Default reads it from corresponding bim file. |
Value
An integer matrix.
Examples
bedfile <- system.file("extdata", "geno3pops.bed", package = "pcadapt")
mat <- bed2matrix(bedfile)
dim(mat)
table(mat)
[Package pcadapt version 4.3.5 Index]