Description Usage Arguments Details Value Author(s) Examples
Write adegenet's genind object to GENEPOP format
1  | writeGenPop(gi, file.name, comment)
 | 
gi | 
 A   | 
file.name | 
 A character string defining file name. You will have to specify the extension as well.  | 
comment | 
 A character string with a desired comment that will be prepended to the beginning of the file.  | 
Function will write adegenet's genind object to GENEPOP as defined at
http://genepop.curtin.edu.au/help_input.html. First line is a comment, second line is loci names and the rest consists
of lines "pop" and genotype names and their allele values on corresponding loci. This function differs from
writeGenePop, relies on defined strata and is more general.
A file on disk, function return NULL to R.
Roman Lustrik (roman.lustrik@biolitika.si)
1 2 3 4 5 6 7 8 9 10  | library(adegenet)
data(nancycats)
# Genind object must have a population defined. This is trivial with strata.
other(nancycats)$pop <- sample(letters[1:4], size = nInd(nancycats), replace = TRUE)
strata(nancycats) <- data.frame(pop = other(nancycats)$pop)
setPop(nancycats) <- ~pop
# write the file and remove it
writeGenPop(nancycats, file.name = "test.gen", comment = "is a no comment")
file.remove("test.gen")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.