join {analogue} | R Documentation |
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.
join(..., verbose = FALSE, na.replace = TRUE)
... |
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. |
A data frame containing the merged data sets.
Gavin L. Simpson
## 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), ]