Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


EcoGenetics (version 1.0)

ecogen: Creating a new ecogen object.

Description

Creating a new ecogen object.

Usage

ecogen(XY = data.frame(), P = data.frame(), G = data.frame(),
  E = data.frame(), S = data.frame(), C = data.frame(), missing = c("0",
  "NA", "MEAN"), ploidy = 2, ...)

Arguments

XY
Data frame of 2 columns by n rows (individuals), in UTM format.
P
Data frame of n rows (individuals) with phenotypic data (traits in columns).
G
Data frame of n rows (individuals) with genotypic data (loci in columns). Data should be in a format accepted by the adegenet df2genind function.
E
Data frame of n rows (individuals) with environmental data in columns.
S
Data frame of n rows (individuals) with group factors in columns. Different columns indicate levels or grouping schemas (see details).
C
data frame of n rows (individuals) with custom variables.
missing
Argument passed to df2genind when G input is a data.frame. Else, when data is of classes "DNAbin" or "alignment", this function can operate over missing with the same three values ("0", "NA",
ploidy
Ploidy of the G data frame. For an haploid data frame, ploidy =1 must be included in the function. Default ploidy = 2 for this class of data.
...
further arguments passed to df2genind when G data is of class "data.frame", otherwise are passed to DNAbin2genind when G data is of

Details

This is a generic function for creating an ecogen object. The non genetic data must be of class "data.frame". For the genetic data, there are three options: Data of "data.frame" class, (for example, microsatellite, AFLP, RAPD, etc.); data of "DNAbin" class (ape data). The program recognizes the classes and can discern a codominant data frame from a presence - absence data frame. When data is composed entirely of two values, the program takes these data is of presence - absence type. Cells in data frames with missing data must be filled with 0.

See Also

df2genind

Examples

Run this code
#Example with G data of class "data.frame", corresponding to
#microsatellites of a diploid organism:
data(eco.test)
eco <- ecogen(XY = coordinates, P = phenotype, G = genotype,
E = environment, S = as.data.frame(structure))
eco <- eco.sortalleles(eco, 1)

#Example with G data of class "data.frame", corresponding to a
#presence - absence molecular marker:
dat <- sample(c(0,1),100,rep = TRUE)
dat <- data.frame(matrix(dat,10,10))
eco <- ecogen(G = dat)

#Example with G data of class "DNAbin":
require(ape)
data(woodmouse)
G <- woodmouse
eco <- ecogen( G = G)

#Example with G data of class "alignment":
require(seqinr)
data(mase)
G <- mase
eco <- ecogen( G = G)

Run the code above in your browser using DataLab