Description Usage Arguments Author(s) References Examples
This function converts the genetic data of an ecogen object
in a SPAGeDi input file.
When distance classes are required, they can be constructed by combining
the parameters "int", "smin", "smax", "nclass", "seqvec" and "size", as
described in the function eco.lagweight
.
A distance matrix can also be included using the "distmat" parameter.
Missing data must be coded as a single "NA" in the G data frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ecogen2spagedi(
eco,
pop = NULL,
ndig = NULL,
dir = "",
outName = "infile.spagedi.txt",
smin = 0,
smax = NULL,
int = NULL,
nclass = NULL,
seqvec = NULL,
size = NULL,
bin = c("sturges", "FD"),
distmat = NULL,
latlon = FALSE,
to_numeric = FALSE,
nout = 3,
recode = c("all", "column", "paired"),
replace_in = NULL,
replace_out = NULL,
...
)
|
eco |
Object of class "ecogen". |
pop |
The name of the S slot column with the groups for the output data. The default option includes all the individuals into a single group. |
ndig |
Number of digits coding each allele in the output file (e.g., 1: x, 2: xx, or 3: xxx). If NULL, the vale will be deduced from the number of digits used for coding alleles in the ecogen object. |
dir |
output path. Default = "" (current directory). |
outName |
The name of the output file. |
smin |
Minimum class distance in the units of the XY slot data. |
smax |
Maximum class distance in the units of the XY slot data. |
int |
Distance interval in the units of the XY slot data. |
nclass |
Number of classes. |
seqvec |
Vector with breaks in the units of the XY slot data. |
size |
Number of individuals per class. |
bin |
Rule for constructing intervals when a partition parameter (int, nclass or size) is not given. Default is Sturge's rule (Sturges, 1926). Other option is Freedman-Diaconis method (Freedman and Diaconis, 1981). |
distmat |
Distance matrix to include (optional). |
latlon |
Are the coordinates in decimal degrees format? Defalut FALSE. If TRUE,
the coordinates must be in a matrix/data frame with the longitude in the first
column and latitude in the second. The position is projected onto a plane in
meters with the function |
to_numeric |
Recode the genetic data into numeric format? If TRUE,
the functions performs the correction via |
nout |
Number of digits in the output when to_numeric = TRUE. |
recode |
Recode mode when to_numeric = TRUE: "all" for recoding the data considering all the individuals values at once (e.g., protein data), "column" for recoding the values by column (e.g., microsatellite data), "paired" for passing the values of allelic states and corresponding replacement values, using the replace_in and replace_out arguments (e.g. replace_in = c("A", "T", "C", "G"), replace_out = c(1,2,3,4)). |
replace_in |
vector with states of the data matrix to be replaced, when recode = "paired". This argument must be used in conjunction with the argument "replace_out". |
replace_out |
vector with states of the data matrix used for replacement, when recode = "paired". This argument must be used in conjunction with the argument "replace_in". |
... |
Additional parameters passed to |
Leandro Roser learoser@gmail.com
Freedman D., and P. Diaconis. 1981. On the histogram as a density estimator: L 2 theory. Probability theory and related fields, 57: 453-476.
Hardy O. and X Vekemans. 2002. SPAGeDi: a versatile computer program to analyse spatial genetic structure at the individual or population levels. Molecular ecology notes, 2: 18-620.
Sturges H. 1926. The choice of a class interval. Journal of the American Statistical Association, 21: 65-66.
1 2 3 4 5 6 7 | ## Not run:
data(eco.test)
ecogen2spagedi(eco, dir = "", pop = "pop", ndig = 1,int=2, smax=6, outName="infile.spagedi.txt")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.