Anyone help me to build histogram of this dataset?
dat2 <- data.frame(mean_setosa, mean_versicolor, mean_virginica)
Thank you!
You could use barplot
:
d <- aggregate(Petal.Length~Species, data = iris, FUN = mean)
Species Petal.Length
1 setosa 1.462
2 versicolor 4.260
3 virginica 5.552
barplot(Petal.Length~Species, data = d)
Using the ggplot2
graphical package, you can do:
library(ggplot2)
ggplot(d, aes(x = Species, y = Petal.Length))+
geom_col()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.