I have a dataframe df, which has variables component1_done, component2_done and so on. I want to table each, for example, as:
proportions(table(df$component1_done))
proportions(table(df$component2_done))
proportions(table(df$component3_done))
proportions(table(df$component4_done))
proportions(table(df$component5_done))
proportions(table(df$component6_done))
How can I do the same using a loop? In other words, how can I refer to df$component"i"_done in a loop?
Thanks!