4 Data wrangling
4.0.1 Why won’t my datasets join properly?
Double check that your join function refers to the right column names.
Double check that you are loading in two dataframes rather than vectors as the objects intended to be joined.
Check out this helpful guide to tidyverse joins.
4.0.2 Where is my new joined dataframe? I saw the output in the console, but now it’s gone.
Be sure to assign the new dataframe to a new object name. For example:
joineddata <- left_join(olddata1, olddata2)
Be sure that the data joins work when the code is run in the order it is written in the script. Although you can run individual lines of code out of order, when you go to knit the script R will run through the lines sequentially. This means if an object that is the input to a function on line 10 isn’t made until line 15, this will be a problem.