I would like to keep only the complete observations for all the years, how can I proceed?
I have the following example:
structure(list(variable = c(1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5,
5, 5), Year = c(2010, 2011, 2012, 2010, 2012, 2010, 2011, 2012,
2011, 2012, 2010, 2011, 2012)), class = "data.frame", row.names = c(NA,
-13L))
I would like to get:
structure(list(variable = c(1, 1, 1, 3, 3, 3, 5, 5, 5), Year = c(2010,
2011, 2012, 2010, 2011, 2012, 2010, 2011, 2012)), row.names = c(1L,
2L, 3L, 6L, 7L, 8L, 11L, 12L, 13L), class = "data.frame")
The example is simple, but I need to do this for a vast dataset with the idea of building a balanced dashboard. I appreciate any help.