library(readr) onlinefoods <- read_csv(“onlinefoods.csv”) View(onlinefoods)
names(onlinefoods)
ggplot(onlinefoods, aes(x = longitude, fill = Gender)) + geom_histogram(binwidth = 0.01, position = “identity”, alpha = 0.6, color = “black”) + scale_fill_manual(values = c(“Male” = “skyblue”, “Female” = “hotpink”)) + labs(title = “Correlation between Gender and Longitude”, x = “Longitude”, y = “Numbers of People”, fill = “Gender”) #Regardless of distance, more males than females order food online according to this data.
ggplot(df, aes(x = Educational.Qualifications)) + geom_bar(fill = “purple”) + labs(title = “Educational Qualifications”, x = “Education Level”, y = “Students”) + theme_minimal() #Graduate + Post Graduate order online food the most
library(dplyr)
gender_feedback_counts <- onlinefoods %>% group_by(Gender, Feedback) %>% summarise(Count = n())
print(gender_feedback_counts)
gender_feedback_counts\(percent <- round(100 * gender_feedback_counts\)Count / sum(gender_feedback_counts\(Count), 1) gender_feedback_counts\)label <- paste( gender_feedback_counts\(Gender, "-", gender_feedback_counts\)Feedback, “”, gender_feedback_counts$percent, “%” )
pie(gender_feedback_counts\(Count, labels = gender_feedback_counts\)label, col = c(“lightgreen”, “pink”, “seagreen”, “salmon”), main = “Feedback by Gender”) #Mostly positive feedback