Joining data tables

No discussion of data manipulation/wrangling is complete without discussing joins. We first saw joins in Chapter 12, Sources of Data, when we were merging an SQL table of artwork information to a table of artist information. We’ll begin this subsection with a closer look on what a join is.

Very often in data analysis, information we need is spread across two or more data sets. In the example in Chapter 12, Sources of Data, we wanted to get the mean age of the artists at the time of the completions of the artwork for all artworks in a table. The critical piece that was missing from that table, though, was the date of birth for that artist. For this we had to join (or, sometimes, called a merge) the two tables. In order ...

Get Data Analysis with R - Second Edition 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.