data(iris)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
iris %>%
  group_by(Species) %>%
  summarise(
    mean_petal_length = mean(Petal.Length),
    sd_petal_length   = sd(Petal.Length),
    max_petal_length  = max(Petal.Length)
  )
## # A tibble: 3 × 4
##   Species    mean_petal_length sd_petal_length max_petal_length
##   <fct>                  <dbl>           <dbl>            <dbl>
## 1 setosa                  1.46           0.174              1.9
## 2 versicolor              4.26           0.470              5.1
## 3 virginica               5.55           0.552              6.9
library(ggplot2)

ggplot(iris, aes(x = Species, y = Sepal.Width, fill = Species)) +
  geom_violin() +
  labs(
    title = "Violin plot của Sepal.Width theo Species",
    x = "Species",
    y = "Sepal.Width"
  ) +
  theme_minimal()