multi_join | R Documentation |
This function joins up to five data sets using the function dplyrinner_join
from the package "dplyr". Each data set is individually joined with the next one. This way, several data sets of which only pairs have the same id variable can be joined.
multi_join(...)
... |
Up to five data frames that should be joined. |
A data frame.
# Creating several data frames.
id <- c(1:100)
var1 <- runif(100, 1, 5)
var2 <- runif(100, 1, 5)
var3 <- runif(100, 1, 5)
data1 <- data.frame(id, var1)
data2 <- data.frame(id, var2)
data3 <- data.frame(id, var3)
# Join all of them
multi_join(data1, data2, data3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.