In this example, we’ll use the Gender column from our final analysis dataframe.

gender_percentages <- prop.table(ftable(analysis_data$Gender)) * 100

Code transaltion: we make a variable called gender_percentages. To fill the varialbe, we take the Gender column from the analysis_data dataframe and make a frequency table with the ftable() command. we turn that frequency table into a proportion table with the prop.table() command. Then, we multiply the values in the proportion table by 100 to get percentages. *Key tip: if your categorical demographic has a lot of categories, keep in mind when reading the output that the end of the number lines up vertically with the end of the name of the category in the line above.