Att sammanfoga data med data.table i R
Scott Ritchie
Postdoctoral Researcher in Systems Genomics
Lägg till information från den högra data.table till den vänstra data.table
merge(x = demographics, y = shipping, by = "name", all.x = TRUE)

Lägg till information från den vänstra data.table till den högra 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)
Standardvärden för all, all.x och all.y är FALSE i funktionen merge()
Slå upp standardvärden för argument med help("merge")
Left join av shipping till demographics:
merge(demographics, shipping, by = "name", all.x = TRUE)
Right join av shipping till demographics:
merge(demographics, shipping, by = "name", all.y = TRUE)
Att sammanfoga data med data.table i R