0

我已包含数据集,请查看

>temp
   date_time     value1 value2
1 2018-07-01   0.12   0.13
2 2018-07-02   0.24   0.15
3 2018-07-03   0.33   0.16
4 2018-07-04   0.40   0.18
5 2018-07-05   0.48   0.19
6 2018-07-06   0.67   0.20
>str(temp)
'data.frame':   6 obs. of  3 variables:
 $ date_time: Date, format: "2018-07-01" "2018-07-02" ...
 $ value1   : num  0.12 0.24 0.33 0.4 0.48 0.67
 $ value2   : num  0.13 0.15 0.16 0.18 0.19 0.2

 dygraph(temp, main = "value1 vs value2") %>%
      dySeries(temp$value1, drawPoints = TRUE, pointShape = "square", color = "blue") %>%dySeries(temp$value2, stepPlot = TRUE, fillGraph = TRUE, color = "red")

我收到以下错误,如下所示:

Error in dygraph(temp, main = "value1 vs value2") : 
  Unsupported type passed to argument 'data'.

谁能告诉我如何在同一个 Dygraph 中绘制两个变量 value1 和 value2,时间序列日期沿 x 轴..?? 或者,如果不可能的话,任何人都可以使用 plotly 来建议这个......?

4

0 回答 0