Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
具有数字x轴的R中的动态图_R_Dygraphs - Fatal编程技术网

具有数字x轴的R中的动态图

具有数字x轴的R中的动态图,r,dygraphs,R,Dygraphs,我的问题是关于这个问题的。看到动态图表现在支持数字x轴,我尝试用数字x轴测试数据,但它给出了一个错误。我使用的代码是 dygraph(as.data.frame(x = 1:10, y = runif(10))) %>% dyAxis("y", valueRange = c(0, 1.5)) %>% dyEvent(2, label = "test") %>% dyAnnotation(5, text = "A") Error in as.POSIXlt.cha

我的问题是关于这个问题的。看到动态图表现在支持数字x轴,我尝试用数字x轴测试数据,但它给出了一个错误。我使用的代码是

 dygraph(as.data.frame(x = 1:10, y = runif(10))) %>%
  dyAxis("y", valueRange = c(0, 1.5)) %>%
  dyEvent(2, label = "test") %>%
  dyAnnotation(5, text = "A")

Error in as.POSIXlt.character(x, tz, ...) : 
  character string is not in a standard unambiguous format

你非常接近;将as.data.frame替换为data.frame

 dygraph(data.frame(x = 1:10, y = runif(10))) %>%
  dyAxis("y", valueRange = c(0, 1.5)) %>%
  dyEvent(2, label = "test") %>%
  dyAnnotation(5, text = "A")

它对我有用,但我有一个空图!你能用任何带有数字x轴的数据集进行测试并告诉我它是否有效吗?我刚刚运行了你的示例(带有数字x),我得到了图形,但它是空的;可能仍然存在问题。我尝试了您的解决方案,但错误仍然存在:重新安装git_hub版本devtools::install_github(c(“ramnathv/htmlwidgets”,“rstudio/dygraps”))