Relative Content

Tag Archive for rdataframedplyrdata-manipulationdata-munging

How to join two data frames based on a condition in R?

Our weather station recorded daily weather data (about 7 rows/observations) per week. We collected disease data once per week (one observation/row per week). How can I join the last row of the weather_df with disease_df while keeping other cells blank? I’ve tried using left_join, but it incorrectly adds one value from disease_df to all days of the week instead of recording the disease data at the end of the week.