Skip to content

Commit

Permalink
skip_if_not_installed("gam")
Browse files Browse the repository at this point in the history
  • Loading branch information
larmarange committed Nov 30, 2022
1 parent fbf37b9 commit e41e5c7
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/testthat/test-add_coefficients_type.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ test_that("model_get_coefficients_type() works with geepack::geeglm", {


test_that("model_get_coefficients_type() works with gam::gam", {
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
res <- mod %>% model_get_coefficients_type()
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_contrasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ test_that("tidy_add_contrasts() works with geepack::geeglm", {


test_that("tidy_add_contrasts() works with gam::gam", {
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
expect_error(mod %>% tidy_and_attach() %>% tidy_add_contrasts(), NA)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_estimate_to_reference_rows.R
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ test_that("tidy_add_estimate_to_reference_rows() works with geepack::geeglm", {


test_that("tidy_add_estimate_to_reference_rows() works with gam::gam", {
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
expect_error(mod %>% tidy_and_attach() %>% tidy_add_estimate_to_reference_rows(), NA)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_n.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ test_that("tidy_add_n() works with geepack::geeglm", {


test_that("tidy_add_n() works with gam::gam", {
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
expect_error(mod %>% tidy_and_attach() %>% tidy_add_n(), NA)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_term_labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ test_that("tidy_add_term_labels() works with geepack::geeglm", {


test_that("tidy_add_term_labels() works with gam::gam", {
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
expect_error(mod %>% tidy_and_attach() %>% tidy_add_term_labels(), NA)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_variable_labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ test_that("tidy_add_variable_labels() works with geepack::geeglm", {


test_that("tidy_add_variable_labels() works with gam::gam", {
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
expect_error(mod %>% tidy_and_attach() %>% tidy_add_variable_labels(), NA)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-identify_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ test_that("model_identify_variables() works with geepack::geeglm", {


test_that("model_identify_variables() works with gam::gam", {
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
res <- mod %>% model_identify_variables()
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-model_get_n.R
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ test_that("model_get_n() works with geepack::geeglm", {


test_that("model_get_n() works with gam::gam", {
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
expect_error(res <- mod %>% model_get_n(), NA)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tidy_plus_plus.R
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ test_that("tidy_plus_plus() works with geepack::geeglm", {

test_that("tidy_plus_plus() works with gam::gam", {
skip_on_cran()
skip_if_not_installed("gam")
data(kyphosis, package = "gam")
mod <- gam::gam(Kyphosis ~ gam::s(Age, 4) + Number, family = binomial, data = kyphosis)
expect_error(
Expand Down

0 comments on commit e41e5c7

Please sign in to comment.