multiple Density plot using R -


i thinking plotting multiple density plots on single graph.my situation this: have query result has 3 different columns

customerid  group  avgvisitsperday 1             grp1        10 2             grp1        20 3             grp2        30 4             grp3        40 5             grp2        15 6             grp2         5 

i have around 50,000 rows of data. want plot 3 density plots 3 different colors represent 3 distint groups , average visits on single graph..i feel density plot ideal represent distribution..any ideas or thoughts on this, please feel free comment. have been able 1 density plot using r not able group wise.. please help!

i'd recommend ggplot2 package:

ggplot(df, aes(x=avgvisitsperday, color=group)) + stat_density(fill=na) 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -