tests/testthat/test-tabforest-cran-examples.R

test_that("tabforest Vietnamese labels work without automatic drawing", {
  data("tabforest_demo", package = "R4VN")
  expect_no_error({
    f <- tabforest(
      hypertension,
      predictors = vars(c.age, sex, c.bmi, smoking),
      data = tabforest_demo,
      event = "Yes",
      multi = TRUE,
      lang = "vi",
      labels = c(
        age = "Tu\u1ed5i",
        sex = "Gi\u1edbi t\u00ednh",
        bmi = "Ch\u1ec9 s\u1ed1 kh\u1ed1i c\u01a1 th\u1ec3",
        smoking = "H\u00fat thu\u1ed1c"
      ),
      show = FALSE
    )
  })
  expect_s3_class(f, "r4vn_tabforest")
})

Try the R4VN package in your browser

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

R4VN documentation built on Sept. 30, 2026, 5:13 p.m.