Joining Data with data.table in R
Scott Ritchie
Postdoctoral Researcher in Systems Genomics
Přidání informací z pravé data.table do levé data.table
merge(x = demographics, y = shipping, by = "name", all.x = TRUE)

Přidání informací z levé data.table do pravé data.table
merge(x = demographics, y = shipping, by = "name", all.y = TRUE)

# Right join
merge(x = demographics, y = shipping, by = "name", all.y = TRUE)
# Same as
merge(x = shipping, y = demographics, by = "name", all.x = TRUE)
Výchozí hodnoty parametrů all, all.x a all.y jsou FALSE ve funkci merge()
Výchozí hodnoty argumentů funkce lze zjistit pomocí help("merge")
Levé spojení shipping s demographics:
merge(demographics, shipping, by = "name", all.x = TRUE)
Pravé spojení shipping s demographics:
merge(demographics, shipping, by = "name", all.y = TRUE)
Joining Data with data.table in R