Unire i dati con data.table in R
Scott Ritchie
Postdoctoral Researcher in Systems Genomics
Aggiungi informazioni dal data.table di destra al data.table di sinistra
merge(x = demographics, y = shipping, by = "name", all.x = TRUE)

Aggiungi informazioni dal data.table di sinistra al data.table di destra
merge(x = demographics, y = shipping, by = "name", all.y = TRUE)

# Right join
merge(x = demographics, y = shipping, by = "name", all.y = TRUE)
# Uguale a
merge(x = shipping, y = demographics, by = "name", all.x = TRUE)
I valori predefiniti di all, all.x e all.y sono FALSE nella funzione merge()
Controlla i valori predefiniti degli argomenti con help("merge")
Esegui un left join di shipping con demographics:
merge(demographics, shipping, by = "name", all.x = TRUE)
Esegui un right join di shipping con demographics:
merge(demographics, shipping, by = "name", all.y = TRUE)
Unire i dati con data.table in R