Counting weekday in a survey

@ramrod97, I understand it's not ranking data. Thus, calculating the mean rank for each day as in my plot above does not make sense. Rather, you can just count how often each day was selected.

In the code below, I explicitely used intermediate steps (rather than piping it all together with >%>) so that you can follow along more easily.

library("dplyr")
library("tidyr")
library("ggplot2")
Testy <- structure(list(ID = 14:19, 
                        Q5.1 = c("Wednesday", "Monday", "Thursday", "Tuesday",
                                 "Tuesday", "Wednesday"),
                        Q5.2 = c("Thursday", "Thursday", "Friday", "Thursday",
                                 "Wednesday", "Friday"),
                        Q5.3 = c(NA, "Friday", NA, NA, "Thursday", NA)),
                   class = "data.frame", row.names = c(NA, -6L))

Testy_long_format <- pivot_longer(Testy, cols = -ID, values_to = "day", values_drop_na = TRUE)
Testy_long_format$day <- factor(Testy_long_format$day,
                                levels = c("Monday", "Tuesday", "Wednesday",
                                           "Thursday", "Friday"))
Testy_summarized <- count(Testy_long_format, day)
# Alternative to count(): group_by(Testy_long_format, day) %>% summarize(n = n())

ggplot(Testy_summarized, aes(x = day, y = n)) +
    geom_col()

If you have further questions, please make sure to format your code blocks appropriately such that they can be read and copied more easily: FAQ: How to format your code.