geno.cvt2 {simer}R Documentation

Genotype code convertor 2

Description

Convert genotype matrix from (0, 1, 2) to (0, 1).

Usage

geno.cvt2(pop.geno, ncpus = 0)

Arguments

pop.geno

genotype matrix of (0, 1, 2).

ncpus

the number of threads used, if NULL, (logical core number - 1) is automatically used.

Details

Build date: Jul 11, 2020 Last update: Jan 29, 2025

Value

genotype matrix of (0, 1).

Author(s)

Dong Yin

Examples


library(bigmemory)
options(bigmemory.typecast.warning=FALSE)
pop.geno <- matrix(sample(c(0, 1, 2), 8, replace = TRUE), 2, 4)
pop.geno[]
bigmat <- geno.cvt2(pop.geno)
bigmat[]
pop.geno <- as.big.matrix(pop.geno, type = 'char')
bigmat <- geno.cvt2(pop.geno)
bigmat[]


[Package simer version 1.0.0 Index]