Packages needed (maybe)

Screener Qs

summary(as.factor(df$TimeOnSocial)) -> TimeOnSocial
TimeOnSocial_perc <- df %>%
    count(TimeOnSocial) %>%
    mutate(percent = n / sum(n),
           error = sqrt((percent * (1-percent))/n))
barplot(sort(TimeOnSocial, decreasing = T), xlab="Time on Social Media", cex.names=.5,horiz=F,las=1)

ggplot(TimeOnSocial_perc, aes(TimeOnSocial, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Time on Social Media")

summary(as.factor(df$FreqSociMedia)) -> FreqSociMedia
FreqSociMedia_perc <- df %>%
    count(FreqSociMedia) %>%
    mutate(percent = n / sum(n),
           error = sqrt((percent * (1-percent))/n))
barplot(sort(FreqSociMedia, decreasing = T), xlab="Freq of sharing food-related content", cex.names=.5,horiz=F,las=1)

ggplot(FreqSociMedia_perc, aes(FreqSociMedia, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Freq of sharing food-related content")+
    theme(text = element_text(size=10),
        axis.text.x = element_text(angle=60, hjust=1)) 

summary(as.factor(df$FoodFollow)) -> FoodFollow
FoodFollow_perc <- df %>%
    count(FoodFollow) %>%
    mutate(percent = n / sum(n),
           error = sqrt((percent * (1-percent))/n))

barplot(sort(FoodFollow, decreasing = T), xlab="Do you follow food blogs or food social media accounts?", cex.names=.8,horiz=F,las=1)

ggplot(FoodFollow_perc, aes(FoodFollow, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Do you follow food blogs or food social media accounts?")

Demographics

hist(df$Age)

summary(as.factor(df$Gender)) -> b
barplot(b, xlab="Gender", cex.names=.8,horiz=F,las=1)

summary(as.factor(df$Race)) -> b
barplot(sort(b, decreasing = T), xlab="Race", cex.names=.8,horiz=F,las=1)

summary(as.factor(df$Income)) -> b
barplot(sort(b, decreasing = T), xlab=, cex.names=.4,horiz=F,las=2)

Social Media

barplot(sort(hoursOnSoc, decreasing = T), xlab="Hours On Social Media", cex.names=.8,horiz=F,las=1)

ggplot(hoursOnSoc_perc, aes(hoursOnSoc, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Hours On Social Media")

barplot(sort(PropMediaFood, decreasing = T), xlab="Proportion of time on social media engaging with food", cex.names=.8,horiz=F,las=1)

ggplot(PropMediaFood_perc, aes(PropMediaFood, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Proportion of time on social media engaging with food")

barplot(sort(FreqFoodPosts, decreasing = T), xlab="How often do you post pictures of food ", cex.names=.5,horiz=F,las=1)

ggplot(FreqFoodPosts_perc, aes(FreqFoodPosts, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("How often do you post pictures of food ")

barplot(sort(FamFrienProportion, decreasing = T), xlab="Proportion of posts to friends and family only ", cex.names=.5,horiz=F,las=1)

ggplot(FamFrienProportion_perc, aes(FamFrienProportion, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Proportion of posts to friends and family only")

barplot(sort(PropMealHomeCooked, decreasing = T), xlab="Proportion of meals eaten at home are home cooked ", cex.names=.5,horiz=F,las=1)

colnames(PropMealHomeCooked_perc)[1] <- "propHome"
ggplot(PropMealHomeCooked_perc, aes(propHome, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Proportion of meals eaten at home are home cooked ")

barplot(sort(PropHomeMealNew, decreasing = T), xlab="Of the meals cooked at home, what proportion have you never cooked before", cex.names=.5,horiz=F,las=1)

colnames(PropHomeMealNew_perc)[1] <- "propNew"
ggplot(PropHomeMealNew_perc, aes(propNew, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error)) + xlab("Of the meals cooked at home, what proportion have you never cooked before")

barplot(sort(CommentOnlineRecipe, decreasing = T), xlab="How often do you comment on recipes you see online?", cex.names=.5,horiz=F,las=1)

ggplot(CommentOnlineRecipe_perc, aes(InteractWithContent_1, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("How often do you comment on recipes you see online")

barplot(sort(RateOnlineRecipe, decreasing = T), xlab="How often do you rate on recipes you see online?", cex.names=.5,horiz=F,las=1)

ggplot(RateOnlineRecipe_perc, aes(InteractWithContent_2, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("How often do you rate on recipes you see online")

barplot(sort(ImportAverageRating, decreasing = T), xlab="How important is the average rating of a recipe you see online?", cex.names=.5,horiz=F,las=1)

ggplot(ImportAverageRating_perc, aes(ImportAverageRating, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("How important is the average rating of a recipe you see online?")+
    theme(text = element_text(size=10),
        axis.text.x = element_text(angle=60, hjust=1)) 

barplot(sort(InfluenceComments, decreasing = T), xlab="How much do comments influence if and how you make a recipe?", cex.names=.5,horiz=F,las=1)

ggplot(InfluenceComments_perc, aes(InfluenceComments, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("How much do comments influence if and how you make a recipe")+
    theme(text = element_text(size=10),
        axis.text.x = element_text(angle=60, hjust=1)) 

barplot(sort(RecipeFollowingMetho, decreasing = T), xlab="What's your preferred method for following recipes?", cex.names=.5,horiz=F,las=1)

ggplot(RecipeFollowingMetho_perc, aes(RecipeFollowingMetho, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("What's your preferred method for following recipes")

barplot(sort(FavFoodMediaPlatf, decreasing = T), xlab="What's your preferred method for following recipes?", cex.names=.7,horiz=F,las=1)

ggplot(FavFoodMediaPlatf_perc, aes(FavFoodMediaPlatf, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("What's your preferred method for following recipes")

ggplot(df_age_by_media, aes(x= FavFoodMediaPlatf,  group=age_bin)) + 
    geom_bar(aes(y = ..prop.., fill = factor(..x..)), stat="count") +
    geom_text(aes( label = scales::percent(..prop..),
                   y= ..prop.. ), stat= "count", vjust = -.8) +
    facet_grid(~age_bin) +
    scale_y_continuous(labels = scales::percent)+ theme(legend.position = "none") + xlab("Media preferences for food content by age")+
    theme(text = element_text(size=30),
        axis.text.x = element_text(angle=60, hjust=1)) 

Family and Friends

barplot(sort(friendsorfamily, decreasing = T), xlab="Do you share food pictures and recipes more with your friends or family?", cex.names=.4,horiz=F,las=1)

ggplot(friendsorfamily_perc, aes(friendsorfamily, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Do you share food pictures and recipes more with your friends or family?")+
    theme(text = element_text(size=10),
        axis.text.x = element_text(angle=60, hjust=1)) 

barplot(sort(AskRecipeFrieandFam, decreasing = T), xlab="How often do you ask friends and family for recipes?", cex.names=.5,horiz=F,las=1)

ggplot(AskRecipeFrieandFam_perc, aes(AskRecipeFrieandFam, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("How often do you ask friends and family for recipes?")

barplot(sort(Freqrecipeshare, decreasing = T), xlab="How often do you send your friends and family recipes?", cex.names=.6,horiz=F,las=1)

ggplot(Freqrecipeshare_perc, aes(Freqrecipeshare, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("How often do you send your friends and family recipes?")

#most common method of sharing 
table(df$RecipeSent)
## 
##                               Email                   Email,Handwritten 
##                                  19                                   1 
##      Email,Handwritten,Social Media                  Email,Social Media 
##                                   1                                   3 
##                          Email,Text Email,Text,Handwritten,Social Media 
##                                   6                                   3 
##             Email,Text,Social Media                         Handwritten 
##                                   8                                   2 
##                               Other                        Social Media 
##                                   2                                  34 
##                                Text                    Text,Handwritten 
##                                  35                                   4 
##              Text,Handwritten,Other       Text,Handwritten,Social Media 
##                                   1                                   4 
##                   Text,Social Media             Text,Social Media,Other 
##                                  23                                   1
barplot(sort(propOriginal, decreasing = T), xlab="Of the recipes you share, what proportion are your originial recipes versus ones you found online?", cex.names=.4,horiz=F,las=1)

ggplot(propOriginal_perc, aes(propOriginal, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Of the recipes you share, what proportion are your originial recipes versus ones you found online")+
    theme(text = element_text(size=10),
        axis.text.x = element_text(angle=60, hjust=1)) 

barplot(sort(CurrentTrends, decreasing = T), xlab="Do you follow current trends in food?", cex.names=.6,horiz=F,las=1)

ggplot(CurrentTrends_perc, aes(CurrentTrends, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("Do you follow current trends in food?")

barplot(sort(CultureOrigin, decreasing = T), xlab="How important is it for you to know the origin or a recipe?", cex.names=.5,horiz=F,las=1)

ggplot(CultureOrigin_perc, aes(CultureOrigin, percent)) + 
    geom_col(position = "dodge") +
    geom_errorbar(aes(ymin = percent - error, ymax = percent + error),
                  position = position_dodge(0.9)) + xlab("How important is it for you to know the origin or a recipe?")+
    theme(text = element_text(size=10),
        axis.text.x = element_text(angle=60, hjust=1))