View source: R/importPolarized.r
| importPolarized | R Documentation |
Reads genotypes from a file and changes marker polarity.
importPolarized(
files,
changePolarity,
ChosenInds,
ChosenSites = "all",
nCores = 1,
verbose = FALSE,
simplify = TRUE,
...
)
files |
A character vector with paths to files with genotypes. |
changePolarity |
A logical vector or a list of logical vectors with length equal to the number of markers. |
ChosenInds |
A numeric or logical vector of indices of individuals to be included in the analysis. |
ChosenSites |
A logical vector indicating which sites are to be included in the analysis. |
nCores |
A numeric number of cores to be used for parallelisation. Must be
|
verbose |
Logical whether to show messages on import progress. |
simplify |
Logical. If |
... |
Optional numeric vector of |
For details on the input data format, check the file with
CheckDiemFormat.
The changePolarity argument influences how each marker is imported. Value
FALSE means that the marker will be imported as it is saved in the file. Value
TRUE means that the genotypes encoded as 0 will be imported as 2, and genotypes
encoded in the file as 2 will be imported as 0.
Returns a character matrix with rows containing individual genotypes and columns
containing markers. If simplify = FALSE, returns a list of matrices corresponding to
compartments in files.
diem for determining appropriate marker polarity with respect to a barrier to gene flow.
dat <- importPolarized(
files <- system.file("extdata", "data7x3.txt", package = "diemr"),
changePolarity = c(FALSE, TRUE, TRUE),
ChosenInds = 1:6,
ChosenSites = "all",
simplify = TRUE
)
dat
# m1 m2 m3
# 1 "0" "1" "2"
# 2 "0" "0" "0"
# 3 "1" "1" "0"
# 4 "1" "2" "0"
# 5 "2" "2" "1"
# 6 "2" "2" "_"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.