Untitled conversation
Jump to turn (7)
- User{r}
chocolate %>% filter(!is.na(rating)) %>% # father_education column with NA values are not plotted mutate(country_of_bean_origin = fct_reorder(company_manufacturer, rating, na.rm =TRUE)) %>% ggplot(aes(rating, company_manufacturer)) + geom_boxplot(fill="#56B4E9")+ ggtitle('Father Education Level Vs. Student GPA')+ theme(plot.title = element_text(hjust = 0.5)) #centering title - Assistant
This code is creating a boxplot to compare the ratings of chocolate based on the country of bean origin. The code first filters out any rows where the rating is missing. Then, it reorders the "company_manufacturer" variable based on the rating. The code then uses ggplot to create the boxplot, with the rating on the x-axis and the company_manufacturer on the y-axis. The fill color of the boxplot is set to "#56B4E9". The code also adds a title to the plot and centers it.