data(iris)

result <- aggregate(Petal.Width ~ Species, data = iris, FUN = function(x) c(min = min(x), max = max(x)))

print(result)

mean_sepal <- aggregate(Sepal.Width ~ Species, data = iris, mean)

ggplot(mean_sepal, aes(x = Species, y = Sepal.Width, group = 1)) + geom_line() + geom_point() + labs(title = “Trung bình Sepal.Width theo Species”, x = “Species”, y = “Mean Sepal.Width”) + theme_minimal()