tests/testthat/testplotwin.R

# Test plotwin function #
test_that("plotwin 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 <- plotwin(dataset = testdata[[1]]$Dataset, cw = 0.95)
  
  # Test that plotwin produces a ggplot object
  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.