ecogen2genepop: Exporting an ecogen genetic data frame into Genepop format

Description Usage Arguments Value Author(s) Examples

Description

This function converts the genetic data of an ecogen object into a Genepop input file.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ecogen2genepop(
  eco,
  dir = "",
  outName = "infile.genepop.txt",
  grp = NULL,
  nout = 3,
  sep = "",
  recode = c("none", "all", "column", "paired"),
  replace_in = NULL,
  replace_out = NULL,
  ...
)

Arguments

eco

Object of class "ecogen".

dir

output path. Default = "" (current directory).

outName

The name of the output file.

grp

The name of the S slot column with groups in which the sample must be divided (e.g., populations). If groups are not given (grp = NULL), all individuals will be assigned to a single one.

nout

Number of digits in the output file.

sep

Character separating alleles.

recode

Recode mode: "none" for no recoding (defalut), "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 eco.format

Value

A Genepop file in the working directory.

Author(s)

Leandro Roser learoser@gmail.com

Examples

1
2
3
4
5
6
7
8
## Not run: 

data(eco.test)
ecogen2genepop(eco, dir = "", outName = "infile.genepop.txt", grp = "pop")
# an output file "infile.genepop.txt" is generated in the working directory


## End(Not run)

EcoGenetics documentation built on July 8, 2020, 5:46 p.m.