stRoke/tests/testthat/test-index_plot.R

28 lines
977 B
R
Raw Normal View History

2023-01-11 12:54:08 +01:00
test_that("index_plot() works!", {
2023-01-12 13:44:29 +01:00
expect_type(index_plot(stRoke::score[score$event == "A",]), "list")
expect_true(inherits(index_plot(stRoke::score[score$event ==
"A",]), "ggplot"))
expect_type(index_plot(stRoke::score[score$event == "A",],
sub_plot = "_per"), "list")
2023-01-11 12:54:08 +01:00
2023-01-12 13:44:29 +01:00
expect_true(inherits(index_plot(stRoke::score[score$event ==
"A",], sub_plot = "_per"),
"ggplot"))
expect_error(index_plot(
stRoke::score[score$event == "A",],
sub_plot = "_per",
facet.by = c("id", "event")
))
2023-01-11 12:54:08 +01:00
2023-01-12 13:44:29 +01:00
expect_type(index_plot(stRoke::score,
sub_plot = "_per",
facet.by = "event"),
"list")
expect_true(inherits(
index_plot(stRoke::score[score$event == "A",],
2023-01-11 12:54:08 +01:00
sub_plot = "_per",
2023-01-12 13:44:29 +01:00
facet.by = "event"),
"ggplot"
))
})