Learn R Programming

analogue (version 0.4-0)

join: Merge species data sets on common columns (species)

Description

Merges any number of species matrices on their common columns to create a new data set with number of columns equal to the number of unqiue columns across all data frames. Needed for analysis of fossil data sets with respect to training set samples.

Usage

join(..., verbose = FALSE, na.replace = TRUE, split = TRUE)

Arguments

...
data frames containing the data sets to be merged
verbose
logical; if TRUE, the function prints out the dimensions of the data frames in "dots", as well as those of the returned, merged data frame.
na.replace
logical; samples where a column in one data frame that have no matching column in the other will contain missing values (NA). If na.replace is TRUE, these missing values are replaced with zeros. This is s
split
logical; should the merged data sets samples be split back into individual data frames, but now with common columns (i.e. species)?

Value

  • If split = TRUE, a list of data frames, with as many components as the number of data frames originally merged.

    Otherwise, a data frame containing the merged data sets.

See Also

merge

Examples

Run this code
## load the example data
data(swapdiat)
data(swappH)
data(rlgh)

## merge training and test set on columns
dat <- join(swapdiat, rlgh, verbose = TRUE)

## extract the merged data sets and convert to proportions
swapdiat <- dat[[1]] / 100
rlgh <- dat[[2]] / 100

Run the code above in your browser using DataLab