tests/testthat/testplotdelta.R

# Test plotdelta function #
test_that("plotdelta produces a graph", {
  
  data(Mass, envir = environment())
  data(MassClimate, envir = environment())
  
  testdata <- slidingwin(xvar = list(MassClimate$Temp), cdate = MassClimate$Date, bdate = Mass$Date, 
                         baseline = lm(Mass ~ 1, data = Mass), range = c(3, 2), 
                         type = "relative", stat = "max", func = "lin", cmissing = FALSE)
  
  
  test <- plotdelta(dataset = testdata[[1]]$Dataset)
  
  # Test that plotdelta creates a ggplot item
  expect_true(attr(test, "class")[1] == "gg")
  
})

Try the climwin package in your browser

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

climwin documentation built on July 1, 2020, 7:04 p.m.