Combining multiple datasets

I have to combine the datasets provided under as a task for school. I have tried doing so, but getting multiple NA values when I merge them. Can I get any pointers for getting me closer there?


StoreAttributes <- fread("")
county_crime <- fread("")
county_demographics <- fread("")
county_employments <- fread("")
weekly_sales <- fread("")
weekly_weather <- fread("")


  1. the data have compatible dimensions and shared order, and thus can be bound rowwise or columns wise (depending on which makes sense)
  2. or the data have matchable keys, and joins can be performed.
  3. or finally if none of the above are true, there is no meaningful way to merge them.

What is the scenario for your case assessed through this lens ?

the data have matchable keys, and joins can be performed

You can code up data.table based joins with the information in this guide :
R data.table Joins. Master operations between data.tables | by Scott Lyden | Analytics Vidhya | Medium
You might find it easier to use tidytable syntax though, if you are willing to add it as an extra dependency.
See here :
Join two data.tables together — left_join. • tidytable (

The official documentation provides sufficient examples and the syntax is straightforward:
Introduction to data.table • data.table (
Creates a join data.table — J • data.table (
Merge two data.tables — merge • data.table (

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.