Learn R Programming

diemr (version 1.4.3)

emPolarise: Polarises a marker

Description

Changes encodings of genomic markers according to user specification.

Usage

emPolarise(origM, changePolarity = TRUE)

Value

Returns a character vector with polarised markers.

Arguments

origM

A character vector of genotypes comprising of _012 encodings.

changePolarity

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

See Also

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

Examples

Run this code
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"

Run the code above in your browser using DataLab