tests/testthat/test-shading.R

context("dyShading")

test_that("shading creation", {
  d <- dygraph(nhtemp, main = "New Haven Temperatures") %>% 
         dyShading(from = "1920-1-1", to = "1930-1-1") %>%
         dyShading(from = "1940-1-1", to = "1950-1-1")   
  expect_equal(length(d$x$shadings), 2)
  expect_equal(length(d$x$shadings[[1]]), 4)
  expect_equal(length(d$x$shadings[[2]]), 4)
})

Try the dygraphs package in your browser

Any scripts or data that you put into this service are public.

dygraphs documentation built on May 2, 2019, 3:34 p.m.