tests/testthat/test-model_plot.R

context("model_plot")

test_that("model_plot works", {

  y = 1:26
  df = data.frame(ID = 1:26,
                  actual = y + rep(c(-1, 0, 1, 0), 7)[c(-1,-2)],
                  fitted = y,
                  id = letters)
  g = model_plot(df, "ID", "actual", "fitted")

  expect_equal(nrow(g$data), length(y))

  g = model_plot(df, "id", "actual", "fitted",
                 facet_x = "id %in% letters[1:13]",
                 res_bins = 20)

  expect_equal(nrow(g$data), length(y))

})

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.