i'm trying calculate w/w growth rates entirely in r. use excel, or preprocess ruby, that's not point. data.frame example date gpv type 1 2013-04-01 12900 office 2 2013-04-02 16232 office 3 2013-04-03 10035 office i want factored 'type' , need wrap date type column weeks. , calculate week on week growth. i think need ddply group week - custom function determines if date in given week or not? then, after that, use diff , find growth b/w weeks divided previous week. then i'll plot week/week growths, or use data.frame export it. this closed had same useful ideas. update: answer ggplot: all same below, use instead of plot ggplot(data.frame(week=seq(length(gr)), gr), aes(x=week,y=gr*100)) + geom_point() + geom_smooth(method='loess') + coord_cartesian(xlim = c(.95, 10.05)) + scale_x_discrete() + ggtitle('week on week growth rate, apr 1') + ylab('growth rate %') (old, correct answer using plot) w...
Comments
Post a Comment