emPolarise {diemr}R Documentation

Polarises a marker

Description

Changes encodings of genomic markers according to user specification.

Usage

emPolarise(origM, changePolarity = TRUE)

Arguments

origM

character vector of genotypes comprising of _012 encodings.

changePolarity

logical scalar, indicating whether to leave the marker as is (FALSE) or whether to change its polarity (TRUE).

Value

Returns a character vector with polarised markers.

Note

Note that diem and importPolarized accept also a U encoding for an unknown or third allele, but emPolarise requires all U to be replaced with ⁠_⁠.

See Also

diem for determining appropriate marker polarity with respect to a barrier to geneflow.

Examples

emPolarise(c("0", "0", "1", "2", "2"), TRUE)
# [1] "2" "2" "1" "0" "0"

emPolarise(c("0", "_", "2", "2", "1"), FALSE)
# [1] "0" "_" "2" "2" "1"

[Package diemr version 1.2.2 Index]