tests/testthat/testsummary.zoonWorkflow.R

context("summary.zoonWorkflow")

test_that("summary.zoonWorkflow tests", {
  skip_on_cran()

  set.seed(1)
  expect_is(
    summary(workflow(
      occurrence = UKAnophelesPlumbeus,
      covariate = UKAir,
      process = Background(n = 70),
      model = LogisticRegression,
      output = SameTimePlaceMap
    )),
    class = "character"
  )

  set.seed(1)
  expect_is(
    summary(workflow(
      occurrence = UKAnophelesPlumbeus,
      covariate = Chain(UKAir, UKAir, UKAir, UKAir, UKAir, UKAir),
      process = Background(n = 70),
      model = LogisticRegression,
      output = SameTimePlaceMap
    )),
    class = "character"
  )

  set.seed(1)
  expect_is(
    summary(workflow(
      occurrence = UKAnophelesPlumbeus,
      covariate = list(UKAir, UKAir),
      process = Background(n = 70),
      model = LogisticRegression,
      output = SameTimePlaceMap
    )),
    class = "character"
  )

  set.seed(1)
  expect_is(
    summary(workflow(
      occurrence = UKAnophelesPlumbeus,
      covariate = UKAir,
      process = Background(n = 70),
      model = LogisticRegression,
      output = SameTimePlaceMap
    )),
    class = "character"
  )

  set.seed(1)
  expect_is(
    summary(workflow(
      occurrence = UKAnophelesPlumbeus,
      covariate = UKAir,
      process = list(Background(n = 70), NoProcess),
      model = LogisticRegression,
      output = SameTimePlaceMap
    )),
    class = "character"
  )

  set.seed(1)
  expect_is(
    summary(workflow(
      occurrence = UKAnophelesPlumbeus,
      covariate = UKAir,
      process = Background(n = 70),
      model = list(Domain, LogisticRegression),
      output = SameTimePlaceMap
    )),
    class = "character"
  )

  set.seed(1)
  expect_is(
    summary(workflow(
      occurrence = UKAnophelesPlumbeus,
      covariate = UKAir,
      process = BackgroundAndCrossvalid,
      model = Domain,
      output = list(
        SameTimePlaceMap,
        PerformanceMeasures
      )
    )),
    class = "character"
  )
})

Try the zoon package in your browser

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

zoon documentation built on Jan. 23, 2018, 5:21 p.m.