join {analogue}R Documentation

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 "...", 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 standard practice in ecology and palaeoecology. If you want to replace with another value, then set na.replace to FALSE and do the replacement later.

Value

A data frame containing the merged data sets.

Author(s)

Gavin L. Simpson

See Also

merge

Examples

## 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), ]

[Package analogue version 0.3-3 Index]