绘制条图
Use the barplot function. The first argument is a vector of bar heights:
> barplot(c(height1, height2, height3))so it’s common to add some simple adornments: a title, labels for the bars,
and a label for the y-axis:
> barplot(heights,
+ main="Mean Temp. by Month",
+ names.arg=c("May", "Jun", "Jul", "Aug", "Sep"),
+ ylab="Temp (deg. F)")
The barchart function in the lattice package is another way to produce a bar chart.