# get path to example data from the opendataformat package (data.zip)
path <- system.file("extdata", "data.odf.zip", package = "opendataformat")
# read four columns of example data specified as ODF from ZIP file
df <- read_odf(file = path, select = 1:4)
# read other columns of example data specified as ODF from ZIP file
df2 <- read_odf(file = path, select = 4:7)
# generate a variable for joining both datasets:
df$id<-1:20
df2$id<-1:20
# merge both datasets by id column
merged_df<-merge(df, df2)
#merge both datasets by shared key columns between the two tables
merged_df2<-merge(df, df2)
Run the code above in your browser using DataLab