For Q35 and Q36, survey respondents were allowed to choose more than one response. Therefore, it is challenging to analyze the data as it is. Therefore, I created a new object for each question in order to make it easier to understand the survey responses. Since this is not within the scope of what you learned, feel free to include the following in your presentation.
# Load dplyr package
library(dplyr) #for use of dplyr functions such as glimpse(), mutate(), and filter()
library(ggplot2) #for use of ggplot2 functions such ggplot()
# Import data
hunger <- read.csv("hunger.csv")
items <- c("Amount of food", "Hours", "Location", "Staff", "Quality of food",
"Nutrition", "Other")
freq1 <- c(14, 10, 16, 18, 10, 5, 2)
items_liked <- data.frame(items, freq1)
items_liked
## items freq1
## 1 Amount of food 14
## 2 Hours 10
## 3 Location 16
## 4 Staff 18
## 5 Quality of food 10
## 6 Nutrition 5
## 7 Other 2
# Relevel the items_liked by freq1
items_liked$items <-
factor(items_liked$items, levels=items_liked[order(desc(items_liked$freq1)), "items"])
items_liked %>%
arrange(freq1) %>%
ggplot(aes(x = items, y = freq1)) +
geom_col()
freq2 <- c(5, 7, 5, 4, 13, 14, 5)
items_tobeImproved <- data.frame(items, freq2)
items_tobeImproved
## items freq2
## 1 Amount of food 5
## 2 Hours 7
## 3 Location 5
## 4 Staff 4
## 5 Quality of food 13
## 6 Nutrition 14
## 7 Other 5
# Relevel the items_tobeImproved by freq2
items_tobeImproved$items <-
factor(items_tobeImproved$items, levels=items_tobeImproved[order(desc(items_tobeImproved$freq2)), "items"])
items_tobeImproved %>%
arrange(freq2) %>%
ggplot(aes(x = items, y = freq2)) +
geom_col()