read.loci {pegas} | R Documentation |
This function reads allelic data from a text file: rows are individuals, and each column is an allele. By default, the header of the file gives the locus names. If one column is labelled ``population'', it is taken as a population variable.
read.loci(file, header = TRUE, loci.sep = " ", allele.sep = "/", col.pop = "none", col.loci = NULL, skip = 0)
file |
a file name specified by either a variable of mode character, or a quoted string. |
header |
a logical specifying whether the first line of the data
file gives the names of the loci (TRUE by default). |
loci.sep |
the character(s) separating the loci (columns) in the data file (a space by default). |
allele.sep |
the character(s) separating the alleles for each locus in the data file (a slash by default). |
col.pop |
specifies whether one of the column of the data file
identifies the population; default "none" , otherwise an
integer giving the number of the column. |
col.loci |
a vector of integers specifying the indices of the columns that are loci. By default, all columns are taken as loci except one labelled "population", if present. |
skip |
an integer specifying the number of lines in the data file to be skipped before reading the data. |
The rownames of the returned object identify the individual genotypes;
they are either taken from the data file if present, or given the
values "1"
, "2"
, ...
In the returned object, alleles are separated by "/"
, even if
it is not the case in the data file.
a data frame with class c("loci", "data.frame")
. Details on the
structure can be found in
http://ape.mpl.ird.fr/pegas/DefinitionDataClassesPegas.pdf
Emmanuel Paradis