tests/testthat/test-roxytest-testexamples-04-show.R

# Generated by roxytest: do not edit by hand!

# File R/"04-show.R": @testexamples

test_that("Function br_show_forest() @ L48", {
  
  m <- br_pipeline(mtcars,
    y = "mpg",
    x = colnames(mtcars)[2:4],
    x2 = "vs",
    method = "gaussian"
  )
  br_show_forest(m)
  br_show_forest(m, clean = TRUE, drop = 3)
  br_show_forest(m, clean = FALSE)
  assert_s3_class(br_show_forest(m), "forestplot")
})


test_that("Function br_show_forest_ggstats() @ L284", {
  
  if (rlang::is_installed("ggstats")) {
    m <- br_pipeline(mtcars,
      y = "mpg",
      x = colnames(mtcars)[2:4],
      x2 = "vs",
      method = "gaussian"
    )
    br_show_forest_ggstats(m)
  }
  
  expect_true(TRUE)
})


test_that("Function br_show_forest_ggstatsplot() @ L333", {
  
  if (rlang::is_installed("ggstats")) {
    m <- br_pipeline(mtcars,
      y = "mpg",
      x = colnames(mtcars)[2:4],
      x2 = "vs",
      method = "gaussian"
    )
    br_show_forest_ggstatsplot(m)
  }
  
  expect_true(TRUE)
})


test_that("Function br_show_fitted_line() @ L373", {
  
  if (rlang::is_installed("visreg")) {
    m <- br_pipeline(mtcars,
      y = "mpg",
      x = colnames(mtcars)[2:4],
      x2 = "vs",
      method = "gaussian"
    )
  
    if (interactive()) {
      br_show_fitted_line(m)
    }
    br_show_fitted_line(m, xvar = "cyl")
  }
  
  expect_true(TRUE)
})


test_that("Function br_show_fitted_line_2d() @ L412", {
  
  if (rlang::is_installed("visreg")) {
    m <- br_pipeline(mtcars,
      y = "mpg",
      x = colnames(mtcars)[2:4],
      x2 = "vs",
      method = "gaussian"
    )
  
    br_show_fitted_line_2d(m, xvar = "cyl", yvar = "mpg")
  }
  
  expect_true(TRUE)
})


test_that("Function br_show_table() @ L452", {
  
  m <- br_pipeline(mtcars,
    y = "mpg",
    x = colnames(mtcars)[2:4],
    x2 = "vs",
    method = "gaussian"
  )
  
  br_show_table(m)
  br_show_table(m, export = TRUE)
  if (interactive()) {
    br_show_table(m, export = TRUE, args_table_export = list(format = "html"))
  }
  expect_true(TRUE)
})


test_that("Function br_show_table_gt() @ L489", {
  
  if (rlang::is_installed("gtsummary")) {
    m <- br_pipeline(mtcars,
      y = "mpg",
      x = colnames(mtcars)[2:4],
      x2 = "vs",
      method = "gaussian"
    )
    br_show_table_gt(m)
  }
  
  expect_true(TRUE)
})

Try the bregr package in your browser

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

bregr documentation built on June 28, 2025, 5:06 p.m.