Home > Back-end >  Grouping boxplot together
Grouping boxplot together

Time:01-04

I have the following data and would like to create a group boxplot. I created a bargraph in excel and would like to create the boxplot in the exact same way using R (enter image description here

As far as a boxplot, you would need more than 1 data point, but if you wanted to do a box plot by Fruit, then you could do something like this:

df %>% 
  pivot_longer(!Fruit) %>% 
  ggplot(aes(x = Fruit, y = value, fill = Fruit))  
  geom_boxplot()

Output

enter image description here

  •  Tags:  
  • Related