Read Allelic Data Files
This function reads allelic data from a text file: rows are individuals, and columns are loci and optional variables. By default, the first line of the file gives the locus names. If one column is labelled ‘population’, it is taken as a population variable.
a file name specified by either a variable of mode character, or a quoted string.
a logical specifying whether the first line of the data
file gives the names of the loci (
the character(s) separating the loci (columns) in the data file (a white space by default).
the character(s) separating the alleles for each locus in the data file (a forward slash by default).
specifies whether one of the column of the data file identifies the population. By default, if one column is labelled ‘population’ (case-insensitive), it is taken as the population variable; otherwise an integer giving the number of the column or a character string giving its name. It is eventually renamed ‘population’ and transformed as a factor.
a vector of integers or characters specifying the indices or the names of the columns that are loci. By default, all columns are taken as loci except the population one, if present or specified.
further arguments passed to
The rownames of the returned object identify the individual genotypes;
they are either taken from the data file if present, or given the
"2", ... Similarly for the colnames: if
absent in the file (in which case
header = FALSE must be set),
they are given the values
In the returned genotypes, alleles are separated by
if it is not the case in the data file.
The vignette “Reading Genetic Data Files Into R with adegenet
and pegas” explains how to read various file formats including
Excel files (type
vignette("ReadingFiles") in R).
A data frame with class
c("loci", "data.frame"). It is a data
frame with an attribute
"locicol" specifying the columns that
must be treated as loci. The latter are factors. The other columns can
be of any type.
Details on the structure can be found in http://ape-package.ird.fr/pegas/DefinitionDataClassesPegas.pdf
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.