I like to create a table that has the frequency of several columns in my data frame. I am copying part of my data frame below.
The table is supposed to have frequency (both n and %) of "red" in Color and "F" in Gender.
I think that the dplyr package could do this but I cannot figure it out.
Thank you-
RespondentID Color Gender 1 1503 Red F 2 1653 NA M 3 1982 Red F 4 4862 Red NA 15 4880 Blue M
Updating per comment -- if you want to look at each variable separately, you will need to rearrange the dataframe first. You can accomplish this with
tidyr
: