We will continue to work with the same data as in the previous set of exercises. By now, you should (hopefully) have saved them as an .rds
file and, hence, be able to easily load them (in case they are not already/still in your current R
workspace/working environment).
corona_survey <- readRDS("./data/corona_survey.rds")
base R
, print a simple table with the frequencies of the variable education_cat
. Also include the counts for missing values.
useNA = "always"
.
base R
functions to get the proportions for the variable sex
rounded to four decimal places.
table()
into two other functions: One for creating the proportion table and another one for rounding the decimal places.
dplyr
package to get the frequencies and proportions for the sex
variable (without worrying about the number of decimal places this time).
summarytools
package to display the counts and percentages for the categories in the age_cat
variable. The output should not include information about the totals.