I have to call the table() function on 10 variables in R. Is there any way of doing it in one shot, without calling them individually like table(v1), table(v2)… table(v10)?
I have to call the table() function on 10 variables in R. Is there
Share
If your variables are arranged as columns in a data.frame, you could use
lapply:Then you get a list with the various tables:
EDIT:
For variables across multiple data.frames, you might try putting them into a list and then using
lapplyagain: