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?
please give me suggestions.
--
View this message in context: http://n4.nabble.com/different-types-graphs-tp1568673p1568673.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Here are a few tips to start finding what you need (in R):
apropos("pie")
RSiteSearch("pie")
Try also:
?pie
?barplot
I guess there are hundreds of commands to do every type of graphics, but
you can start there.
The manual "Using R for Data Analysis and Graphics" from JH Maindonald
is also quite good, among many others!
HTH
Ivan
Le 2/25/2010 09:48, chinna a écrit :
>
>> 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?
>
> please give me suggestions.
>
______________________________________________
>
> >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?
>
> please give me suggestions.
try
demo(graphics) for a start
detlef
# scatterplot - sprays all the values out with a
# different color for each store
plot(xyz$year_y,xyz$revenue,type="p",
col=as.numeric(xyz$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
barplot(as.matrix(
reshape(xyz,idvar="Store",timevar="Year",dir="wide")[,2:4])
,beside=TRUE)
legend(8,600000,levels(xyz$Store),fill=c("gray80","gray50","gray20"))
# pie chart - shows the mean revenue for each store
# over all the years sampled - again the previous toy data
pie(by(xyz$Revenue,xyz$Store,mean))
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.
Jim
r-help-...@r-project.org napsal dne 25.02.2010 09:48:04:
>
> >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?
>
> please give me suggestions.
Your installation of R must be broken. I can easily get help pages for
?plot
?pie
?barplot
Regards
Petr