I want to merge two rows in my dataset and create new columns according to the requirement.
Here's the dataset:
I want to merge the two rows of same area_name and date_reported and form some new columns for new_cases and old_cases.
library(dplyr)
df %>% group_by(area_name, date_reported) %>% summarise(date_reported = date_reported,
area_name = area_name, area_code = area_code, newcase= , oldcase= )
View(df)
