slices <- c(10, 12,4, 16, 8)
lbls <- c("US", "UK", "Australia", "Germany", "France")
barplot(slices, names.arg= lbls, main="Bar Plot of Countries",
col=rainbow(length(slices)))
qplot(
mtcars$cyl,
geom = "bar",
fill = I("red"),
xlab = "Cylinders",
ylab = "Number of Vehicles"
main = "Cylinders in mtcars"
)
Here the full documentation :
https://www.rdocumentation.org/packages/graphics/versions/3.6.2/topics/barplot