encodeGenotypes: Encode genotype strings as genotype integers.

Description Usage Arguments Value

View source: R/encodeGenotypes.R

Description

Encode genotype strings as genotype integers.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
encodeGenotypes(x, genotypes)

## S3 method for class 'character'
encodeGenotypes(x, genotypes)

## S3 method for class 'data.frame'
encodeGenotypes(x, genotypes)

## S3 method for class 'matrix'
encodeGenotypes(x, genotypes)

Arguments

x

Object containing genotype strings.

genotypes

Sorted character vector of genotype symbols. Input genotype strings should be elements of this vector.

Value

Object of the same class and dimensions as input object, but with genotype strings encoded as genotype integers. Missing values ('-') are replaced with the character NA value.


gact/shmootl documentation built on Nov. 11, 2021, 6:23 p.m.