[R] Help with barplot

matgopa1@umbc.edu matgopa1 at umbc.edu
Fri Feb 24 07:36:29 CET 2006


Hello all,

I need to create a horizontal barplot with the following data:

City          Median

Springfield     34
Worcester     66
Fitchburg     65
Lowell       63
Quincy       62
Boston       36
Cambridge    54
Waltham      42
Medford      52
Pittsfield     65
Rensselaer     60
Schenectady     56
Glens Falls     64

The code below produces the bars for the Median, but how or where do I
specify the corresponding city name on the y-axis for the bars.

x<-data.frame(City=ozone.ne.trim$City,Median=ozone.ne.trim$Median)
with (x,
      barplot(Median,horiz=TRUE))

Please help.
Mathangi




More information about the R-help mailing list