如何在R中复制每月循环图 [英] How to replicate a Monthly Cycle Chart in R

查看:109
本文介绍了如何在R中复制每月循环图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用R和任何使它看起来不错的包来输出一个类似于此页面上显示的图表(右侧)的图表。




I'd like to output a chart similar to the one represented on this page (on the right) using R and any package that would make it look good:

http://processtrends.com/pg_charts_monthly_cycle_chart.htm

Anyone up to the challenge? :)

Thanks!

解决方案

The stats package in R base already has a function to do this. Here is my one-liner and the output that it produces

monthplot(redata, labels = month.abb, ylab = 'Listings')

Building on this an example of using monthplot for a weekly cycle plot is here (gives full R code and source data): http://figshare.com/figures/index.php/OpenURL_Router_Data:_Total_Requests_by_Weekday

monthplot(ts(sdf$values, frequency = 7, start=c(12,5)), labels = dow, ylab = "No. requests / day", xlab = "Weekday") 

which gives this weekly cycle plot: Example of monthplot to create a graph showing a weekly cycle http://figshare.com/figures/images/a/a7/Total_requests_by_weekday_01_Apr_to_31_Jul_2011.jpeg

这篇关于如何在R中复制每月循环图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆