Learn R Programming

analogue (version 0.3-3)

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)

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

Value

  • 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)
## process so common set of columns for training and test
## number of training set samples
n.train <- nrow(swapdiat)

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

## convert to proportions
dat <- dat / 100
## subset data back into training and test sets
swapdiat <- dat[1:n.train, ]
rlgh <- dat[(n.train+1):nrow(dat), ]

Run the code above in your browser using DataLab