tidy_fstat | R Documentation |
Used internally in radiator
and might be of interest for users.
The function tidy_fstat
reads a file in the
fstat file (Goudet, 1995)
into a wide or long/tidy data frame
To manipulate and prune the dataset prior to tidying, use the functions
tidy_genomic_data
and
genomic_converter
, that uses blacklist and whitelist along
several other filtering options.
tidy_fstat(data, strata = NULL, tidy = TRUE, filename = NULL)
data |
A fstat
filename with extension |
strata |
(optional) A tab delimited file with 2 columns. Header:
|
tidy |
(optional, logical) With |
filename |
(optional) The file name for the tidy data frame
written to the working directory.
Default: |
The output in your global environment is a wide or long/tidy data frame.
If filename
is provided, the wide or long/tidy data frame is also
written to the working directory.
Thierry Gosselin thierrygosselin@icloud.com
Goudet J. (1995). FSTAT (Version 1.2): A computer program to calculate F-statistics. Journal of Heredity 86:485-486
## Not run:
# We will use the fstat dataset provided with adegenet package
require("hierfstat")
# The simplest form of the function:
fstat.file <- radiator::tidy_fstat(
data = system.file(
"extdata/diploid.dat",
package = "hierfstat"
)
)
# To output a data frame in wide format, with markers in separate columns:
nancycats.wide <- radiator::tidy_fstat(
data = system.file(
"extdata/diploid.dat",
package = "hierfstat"
),
tidy = FALSE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.