I want to have a mean for each year for both the countries. But I am unable to formulate a code. Please help
I was trying the following code but it does not work.
Mean <- dt %>%
group_by(year) %>%
summarise(Average=mean, na.rm = TRUE))
Following is the input
structure(list(year = c(2010, 2010, 2010, 2010, 2012, 2012),
India = c(56, 53, 52, 0, 29, 30), Nepal = c(35, 6, 7, 12,
34, 55)), row.names = c(NA, 6L), class = "data.frame")