rbind.genalex: Combine class genalex data sets by adding rows

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Combine class genalex data sets onto one larger class genalex data set. Population names and sizes are adjusted accordingly. The data sets must have the same locus names and ploidy, but the order of the loci may differ, and the final data set will have the locus order of the first. Sample names must be unique across all data sets. Data set title and sample and population column headers are taken from the first data set unless supplied in the names argument. If one data set contains extra columns, all must contain extra columns, and these are combined along with the rest of the data.

Usage

1
rbind.genalex(..., names = NULL, deparse.level = 1)

Arguments

names

List containing names: title for data set title, sample for sample column header, and pop for population column header. If names or any of its fields are not provided, the names of the first argument to ... are used.

deparse.level

Not used (yet)

...

Class genalex data sets. If only one data set is supplied, it is returned unmodified.

Value

Annotated data frame of class genalex. If names or any of its fields are not provided, the names of the first argument are used. The data.file.name attribute is a character representation of the call to rbind.

Note

If one of the arguments is class 'data.frame', then this function will not be called, instead the rbind.data.frame method of base R will be called silently and will return an object of class 'data.frame' with a structure that is probably not what you intended. Objects of class genalex also have class 'data.frame'. The selection of which method to use, in this case rbind.data.frame, occurs during method dispatch for rbind, so it is not a condition that can be checked by this function. To prevent this, assure that data frames have been converted to class genalex prior to calling this function by using as.genalex, and if there are doubts as to the class of any of the ... arguments, use is.genalex to check the class of the returned value.

Author(s)

Douglas G. Scofield

See Also

genalex, rbind, as.genalex, is.genalex, cbind.genalex

Examples

1
2
3
4
5
6
7
gt1 <- data.frame(a = 11:13, a.2 = 14:16, b = 101:103, b.2 = 104:106)
x1 <- genalex(1:3, "snurf", gt1)
gt2 <- data.frame(a = 21:23, a.2 = 24:26, b = 201:203, b.2 = 204:206)
x2 <- genalex(4:6, "snirf", gt2)
x <- rbind(x1, x2)
x
attributes(x)

douglasgscofield/readGenalex documentation built on May 15, 2019, 10:43 a.m.