## load the example data
data(swapdiat, swappH, 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
## merge training and test set using left join
head(join(swapdiat, rlgh, verbose = TRUE, type = "left"))
## load the example data
data(ImbrieKipp, SumSST, V12.122)
## merge training and test set on columns
dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
## extract the merged data sets and convert to proportions
ImbrieKipp <- dat[[1]] / 100
V12.122 <- dat[[2]] / 100
## show just the first few lines of each data set
head(dat, n = 4)
## show just the last few lines of each data set
tail(dat, n = 4)
## merge training and test set using inner join
head(join(ImbrieKipp, V12.122, verbose = TRUE, type = "inner"))
## merge training and test set using outer join and replace
## NA with -99.9
head(join(ImbrieKipp, V12.122, verbose = TRUE, value = -99.9))
Run the code above in your browser using DataLab