tests/testthat/test-response_var.R

test_that("can extract response from linear model", {
  mod <- lm(mpg ~ wt, data = mtcars)
  expect_identical(response_var(mod), quote(mpg))
})

test_that("can extract response from loess model", {
  mod <- loess(mpg ~ wt, data = mtcars)
  expect_identical(response_var(mod), quote(mpg))
})
hadley/modelr documentation built on Nov. 4, 2023, 3:20 a.m.