write_hzar | R Documentation |
Write a HZAR file (Derryberry et al. 2013), from a tidy data frame. Used internally in radiator and might be of interest for users.
write_hzar(
data,
distances = NULL,
filename = NULL,
parallel.core = parallel::detectCores() - 1
)
data |
A tidy data frame object in the global environment or
a tidy data frame in wide or long format in the working directory.
How to get a tidy data frame ?
Look into radiator |
distances |
(optional) A file with 2 columns, |
filename |
(optional) The file name prefix for the HZAR file
written to the working directory. With default: |
parallel.core |
(optional) The number of core used for parallel
execution during import.
Default: |
Integrated filters: Only polymorphic markers found in common between populations/strata are used to generate the HZAR file.
A HZAR file is written in the working directory.
Thierry Gosselin thierrygosselin@icloud.com
Derryberry EP, Derryberry GE, Maley JM, Brumfield RT. hzar: hybrid zone analysis using an R software package. Molecular Ecology Resources. 2013;14: 652-663. doi:10.1111/1755-0998.12209
## Not run:
# The simplest form of the function:
hzar.data <- radiator::write_hzar(data = tidydata)
# Using genepop dataset, nancycats, from adegenet
# require(adegenet)
nancycats <- system.file("files/nancycats.gen", package = "adegenet")
# using genomic_converter:
nanycats.hzar <- radiator::genomic_converter(data = nancycats, output = "hzar")
# using the separate modules:
# tidy the genepop file then pipe the result in write_hzar
nanycats.hzar <- radiator::tidy_genepop(data = nancycats) %>%
radiator::write_hzar(data = .)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.