How to join multiple data frames using the merge() function in the R programming language.
R code of this video:
df_1 <- data.frame(ID = 1:5,
x1 = letters[1:5],
x2 = 11:15)
df_2 <- data.frame(ID = c(2, 4, 5,
6, 7, 8),
y1 = LETTERS[10:15],
y2 = 101:106,
y3 = 10:5)
df_merge <- merge(df_1,
df_2,
by = "ID",
all = TRUE)
Follow me on Social Media:
Facebook – Statistics Globe Page: www.facebook.com/statisticsglobecom/
Facebook – R Programming Group for Discussions & Questions: www.facebook.com/groups/statisticsglobe
Facebook – Python Programming Group for Discussions & Questions: www.facebook.com/groups/statisticsglobepython
LinkedIn – Statistics Globe Page: www.linkedin.com/company/statisticsglobe/
LinkedIn – R Programming Group for Discussions & Questions: www.linkedin.com/groups/12555223/
LinkedIn – Python Programming Group for Discussions & Questions: www.linkedin.com/groups/12673534/
Twitter: twitter.com/JoachimSchork
Music by bensound.com
コメント