Learn R Programming

pcadapt (version 4.4.0)

bed2matrix: Convert a bed to a matrix

Description

Convert a bed to a matrix

Usage

bed2matrix(bedfile, n = NULL, p = NULL)

Value

An integer matrix.

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.

Examples

Run this code
bedfile <- system.file("extdata", "geno3pops.bed", package = "pcadapt")
mat <- bed2matrix(bedfile)
dim(mat)
table(mat)

Run the code above in your browser using DataLab