I'd like to add background shading where values in a time series are NA, without needing to specify the date range. The basic shading option in dygraphs works like this:
library(dygraphs)
dygraph(nhtemp, main = "New Haven Temperatures") %>%
dyShading(from = "1920-1-1", to = "1930-1-1") %>%
dyShading(from = "1940-1-1", to = "1950-1-1")
I would like to add background shading for ~50 regions of a time series that are missing, and so it wouldn't be feasible to do it manually. As a simple example, how could I tell dygraphs to add background shading for the missing values in this time series without specifying the date range?
nhtemp2 <- nhtemp
nhtemp2[10:20] <- NA
dygraph(nhtemp2, main = "New Haven Temperatures")
