powered by
Convert a bed to a matrix
bed2matrix(bedfile, n = NULL, p = NULL)
An integer matrix.
Path to a bed file.
Number of samples. Default reads it from corresponding fam file.
Number of SNPs. Default reads it from corresponding bim file.
bedfile <- system.file("extdata", "geno3pops.bed", package = "pcadapt") mat <- bed2matrix(bedfile) dim(mat) table(mat)
Run the code above in your browser using DataLab