# Toy example with iris data
# Cartesian merge example
iris_bis = iris
names(iris_bis) = c(paste0("x_", 1:4), "species_bis")
# We must have a common key on which to merge
iris_bis$id = iris$id = 1
# merge, we chunk 'x' by 50 rows
hdd_path = tempfile()
hdd_merge(iris, iris_bis, newfile = hdd_path,
rowsPerChunk = 50, allow.cartesian = TRUE)
base_merged = hdd(hdd_path)
summary(base_merged)
print(base_merged)
Run the code above in your browser using DataLab