r - 如何在 R 中复制月度周期图

标签 r plot ggplot2

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

http://processtrends.com/pg_charts_monthly_cycle_chart.htm

有人敢挑战吗? :)

谢谢!

最佳答案

stats R base 中的包已经有一个功能可以做到这一点。这是我的单行和它产生的输出

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

enter image description here

在此基础上,使用月图绘制每周周期图的示例在这里(提供完整的 R 代码和源数据):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") 

这给出了这个每周周期图:
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 - 如何在 R 中复制月度周期图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5826703/

相关文章:

r - 在 r 中创建带有时间刻度和标签的线图

r - 如何使带有 geom_jitter 的散点图可重现?

r - ggplot barplot 根据两个类别的行的最大值进行排序

r - 如何在 ggplot2 的 geom_text() 中解析 LaTeX 数学公式

r - data.frame 和 matrix 对象的不同子集方法之间的时间差

r - dplyr 变异 : create column using first occurrence of another column

r - 如何将经度从0-360转换为-180-180

R - 改变列表结构

r - 将绘图保存在 data.table 列表列中

jQuery Flot 图表按日期排序