tests/testthat/test-scatter_plot.R

context("scatter_plot")


test_that("scatter_plot works", {

  g = scatter_plot(mtcars, "cyl", "wt")
  # expect_error(print(g), NA)
  expect_equal(nrow(g$data), 32)

  g = scatter_plot(mtcars, "as.character(cyl)", "wt", "'a'")
  # expect_error(print(g), NA)
  expect_equal(nrow(g$data), 32)

  g = scatter_plot(mtcars, "as.character(cyl)", "wt", "am")
  # expect_error(print(g), NA)
  expect_equal(nrow(g$data), 32)

})

Try the ezplot package in your browser

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

ezplot documentation built on Nov. 26, 2023, 5:07 p.m.