2016-05-22 83 views
0

我想显示在dygraph小数点后更改数字,但我得到这个错误:添加参数dygraph

Error in dygraph(indoConc, { : object 'digitsAfterDecimal' not found 

代码

library(dygraphs) 
lungDeaths <- cbind(mdeaths, fdeaths) 
dygraph(lungDeaths) 

indoConc <- Indometh[Indometh$Subject == 1, c("time", "conc")] 
dygraph(indoConc,{digitsAfterDecimal:1}) 

Dygraph链接部分:here

回答

0

另一种方法是设置sigFigs选项,因为尾随零将不会与digitsAfterDecimal一起显示,这取决于您的数据。

dygraph(indoConc) %>% 
dyOptions(sigFigs=1) 

而且,好像你是在混淆Java脚本与R.用于dygraphs这里将R代码的链接dygraphs对R包文档:https://cran.r-project.org/web/packages/dygraphs/dygraphs.pdf