我想使用googleVis annotatedTimeline
方法绘制数据框(计算时间)。
> str(eg)
'data.frame': 10 obs. of 2 variables:
$ dateHour: POSIXct, format: "2016-08-22 00:00:00" "2016-08-22 01:00:00" "2016-08-22 10:00:00" "2016-08-22 11:00:00" ...
$ count : int 2036834 2031814 1828108 1824985 1854810 1932097 1981288 1670501 1805873 1779165
例如
dateHour count
1 2016-08-22 00:00:00 2036834
2 2016-08-22 01:00:00 2031814
3 2016-08-22 10:00:00 1828108
4 2016-08-22 11:00:00 1824985
5 2016-08-22 12:00:00 1854810
6 2016-08-22 13:00:00 1932097
7 2016-08-22 14:00:00 1981288
8 2016-08-22 15:00:00 1670501
9 2016-08-22 16:00:00 1805873
10 2016-08-22 17:00:00 1779165
执行此
时出错> A1 <- gvisAnnotatedTimeLine(eg, datevar = "dateHour", numvar =
> "count",
> titlevar = "title",
> options = list(displayAnnotations=TRUE,
> width=600, height=350)) Error in (function (..., row.names = NULL, check.rows = FALSE,
> check.names = TRUE, :
>
> arguments imply differing number of rows: 10, 0
>
> In addition: Warning message:
>
> In gvisAnnotatedTimeLine(eg, datevar = "dateHour", numvar = "count",
> : AnnotatedTimeline (gvisAnnotatedTimeLine) is Flash based, conisder
> using AnnotationChart (gvisAnnotationChart) instead. For more details
> visit: goo.gl/tkiEV8
我是R的新手。欢迎任何形式的帮助。感谢