write_genepop_zlr: Write Genepop file

Description Usage Arguments Value Author(s) Examples

View source: R/write_genepop_zlr_aw3.R

Description

This function writes a genepop file from hierfstat format data.

Usage

1
2
write_genepop_zlr(loci, pops, ind.ids, folder = getwd(), filename,
  missingVal = NA, ncode = 2, diploid = T)

Arguments

loci

Data frame of genotypes in hierfstat format.

pops

Vector of (equal length to rows of genotypes) designating populations for each individual

ind.ids

Vector of individual Identifiers ( must be equal in length to rows of genotypes)

folder

Directory for saving genepop output file

filename

File name for output file also the description at top of genepop file

missingVal

specifies the value of missing data in loci object. Defaults to NA.

ncode

2 x number of characters per allele (i.e. 22 = ncode = 2, since 1 character per allele going into the function * 2)

diploid

logical for whether the data is diploid or not

Value

returns a list of length 2. The output contains the filename of created genepop file and information for identifying populations following Genepop and NeEstimator Analysis.

Author(s)

Zak Robinson, Contact: zachary.robinson(at)umontana.com

Examples

1
2
3
4
5
data("wgp_example")

write_genepop_zlr(loci = wgp_example[,3:ncol(wgp_example)],pops = wgp_example$pop,
ind.ids = wgp_example$ind_id,folder = "",filename ="genepop_output.txt",missingVal = NA,
ncode = 2,diploid = TRUE)

zakrobinson/RLDNe documentation built on April 12, 2021, 1:50 p.m.