tests/testthat/test-12-plots.R

if (interactive()) library(testthat)


test_that("plotting functions return plot objects", {
  p <- survey_plot_question(membersurvey, "Q2")
  expect_s3_class(p, "ggplot")

  p <- survey_plot_yes_no(membersurvey, "Q2")
  expect_s3_class(p, "ggplot")

  p <- survey_plot_satisfaction(membersurvey, "Q14")
  expect_s3_class(p, "ggplot")
})

Try the surveydata package in your browser

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

surveydata documentation built on March 31, 2023, 10:35 p.m.