tests/testthat/test-gg_injprev_polar.R

test_that("gg_injprev_polar works", {
  gg1 <- gg_injprev_polar(injd, by = "monthly", var_type_injury = "injury_type",
                   title = NULL)
  expect_s3_class(gg1, class = c("gg", "ggplot"))

  gg2 <- gg_injprev_polar(injd, by = "monthly",
                   title = "Polar area diagram\ninjured and available (healthy) players per month")
  expect_s3_class(gg2, class = c("gg", "ggplot"))

  gg3 <- gg_injprev_polar(injd, by = "season", var_type_injury = "injury_type",
                          title = "Polar area diagram\ninjured and available (healthy) players per month")
  expect_s3_class(gg3, class = c("gg", "ggplot"))

  gg4 <- gg_injprev_polar(injd, by = "season",
                          title = "Polar area diagram\ninjured and available (healthy) players per month")
  expect_s3_class(gg4, class = c("gg", "ggplot"))
})

Try the injurytools package in your browser

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

injurytools documentation built on Nov. 15, 2023, 1:06 a.m.