I'm working on a data-set, in which I would like to run the same analysis (table + graph) on 15 different options. Now I know I could write this code 15 times, for each option. But I was wondering whether I could do this through a for loop in order to reduce repetitive coding.
When I try to make a subset of the main data set based upon QueueDesc matches the p I keep running into Error in aggregate.data.frame(lhs, mf[-1L], FUN = FUN, ...) : no rows to aggregate. However, when I run the same subset but then with df_detail <- subset(df, QueueDesc == "(NL) CS (88503)") I do not experience any issues.
To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one: