Rilcon42 Rilcon42 - 1 month ago 25
R Question

Add parameter to dygraph

I am trying to change the digits after the decimal in the dygraph being displayed but I get this error:

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


Code

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

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


Dygraph link to section: here

Answer

Try this:

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

for more options, see http://finzi.psych.upenn.edu/library/dygraphs/html/dyOptions.html