Chapter 44 Ten Most Common Industry Name

We examine the Top Most Common Industries associated with the Adverse Events and plot them in the bar plot.

AdverseFoodEvents %>%
  group_by(IndustryName) %>%
  summarise(Count = n()) %>%
  arrange(desc(Count)) %>%
  ungroup() %>%
  mutate(IndustryName = reorder(IndustryName,Count)) %>%
  head(10) %>%
  
  ggplot(aes(x = IndustryName,y = Count)) +
  geom_bar(stat='identity',colour="white", fill = fillColor) +
  geom_text(aes(x = IndustryName, y = 1, label = paste0("(",Count,")",sep="")),
            hjust=0, vjust=.5, size = 4, colour = 'black',
            fontface = 'bold') +
  labs(x = 'Industry', 
       y = 'Count', 
       title = 'Industry and Count') +
  coord_flip() + 
  theme_bw()