I have a simple df as below, and I would like to create a summary notation for it. what will be the most effective way to build it? Could anyone guide me on this?
The summary that I would like to build is:
There are 2 students in ELA: G8-01, G9-08; There are 2 students in MATH: G8-09, G9-06; There is 1 student in ART: G9-04.
structure(list(ID = c("G8-01", "G8-09", "G9-08", "G9-04", "G9-05",
"G9-06", "G9-07"), ELA = c("G8-01", NA, "G9-08", NA, NA, NA,
NA), MATH = c(NA, "G8-09", NA, NA, NA, "G9-06", NA), PE = c(NA,
NA, NA, NA, NA, NA, NA), ART = c(NA, NA, NA, "G9-04", NA, NA,
NA)), row.names = c(NA, -7L), class = c("tbl_df", "tbl", "data.frame"))
