[R] different types graphs

Jim Lemon jim at bitwrit.com.au
Thu Feb 25 10:47:48 CET 2010

On 02/25/2010 07:48 PM, chinna wrote:
>> library(RODBC)
>> ch<- odbcConnect("durga")
>> sqlQuery(ch, paste("SELECT * from emp"))
>> sqlQuery(ch, ("SELECT * from xyz"))
>          store          revenue       year_y
> 1      bigbazar      787875        2008
> 2      more           87876         2008
>   plot(revenue ~ year_y, data=xyz, pch=16)
> can i get any diffrent types of graphs like pie charts, bar plots.using plot
> commands?
Hi chinna,
You can get all of these and more. What type of plot you want depends 
upon what you want to illustrate:

# scatterplot - sprays all the values out with a
# different color for each store
# barplot - shows you the relative positions of
# the stores in different years
# this example was done with the toy data I posted last time
# pie chart - shows the mean revenue for each store
# over all the years sampled - again the previous toy data

You have to decide on what you want to illustrate unless you are just 
producing PlotArt, a new genre in which the artist produces random plots 
of financial data to emphasize the meaninglessness of the materialistic 
culture in which we pretend that we are happy, but

No, I can't keep a straight face anymore.


More information about the R-help mailing list