The function read.genepop reads Genepop data files (.gen) and
convert them into a genind object.
Note: read.genepop is meant for DIPLOID DATA ONLY. Haploid
data with the Genepop format can be read into R using
read.table or read.csv after removing headers and 'POP'
lines, and then converted using df2genind.
Usage
read.genepop(file,missing=NA,quiet=FALSE)
Arguments
file
a character string giving the path to the file to
convert, with the appropriate extension.
missing
can be NA, 0 or "mean". See details section.
quiet
logical stating whether a conversion message must be
printed (TRUE,default) or not (FALSE).
Value
an object of the class genind
encoding
UTF-8
Details
There are 3 treatments for missing values:
- NA: kept as NA.
- 0: allelic frequencies are set to 0 on all alleles of the concerned
locus. Recommended for a PCA on compositionnal data.
- "mean": missing values are replaced by the mean frequency of the
corresponding allele, computed on the whole set of
individuals. Recommended for a centred PCA.
References
Raymond M. & Rousset F, (1995). GENEPOP (version 1.2): population
genetics software for exact tests and ecumenicism. J. Heredity,
86:248-249