Demonstrating Merges and Joins in R

Herein, we will use the base R merge() function and the dplyr join functions to work out how to merge and join data in R, comparing and contrasting the two functions throughout.

In order to do so, the following steps need to be executed:

  1. Install and load the readr package, which contains functions that read in data much faster than the baseR data read functions:
install.packages("readr") library(readr)
  1. Download the students and students2 datasets from the GitHub repository:
students <- read_csv("https://raw.githubusercontent.com/ TrainingByPackt/R-Programming-Fundamentals/master/lesson3/students.csv") students2 <- read_csv("https://raw.githubusercontent.com/ TrainingByPackt/R-Programming-Fundamentals/master/lesson3/students2.csv") ...

Get R Programming Fundamentals now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.