geno.cvt1: Genotype code convertor 1

View source: R/simer.Genotype.r

geno.cvt1R Documentation

Genotype code convertor 1

Description

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

Usage

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

Arguments

pop.geno

genotype matrix of (0, 1).

ncpus

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

Details

Build date: Nov 14, 2018 Last update: Jan 30, 2025

Value

genotype matrix of (0, 1, 2).

Author(s)

Dong Yin

Examples


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


simer documentation built on April 3, 2025, 9:24 p.m.