diff --git a/NEWS.md b/NEWS.md index 7621f213..570b333a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,8 @@ * `join_adsub_adsl` now sends a warning when the continuous or categorical variables are missing or all `NA`. All `NA` variables can now be kept using `drop_na = FALSE`. In addition, missing levels in the pivoted columns can be dropped with `drop_lvl = TRUE`. * Remove `mini_pivot_wider` function which is no longer used. +* The whisker placeholder `{patient_label}` is now replaced by default by `"patient"` while `{patients_label}` correspond to `"patients"`. + # dunlin 0.1.5 * `empty_rule` is removed now. `rule()` will create a normal `rule` object. diff --git a/R/zzz.R b/R/zzz.R index 8d09c09b..ee3ff626 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,7 +1,10 @@ whisker_env <- NULL .onLoad <- function(libname, pkgname) { - default_whiskers <- c(patient_label = "patients") + default_whiskers <- c( + patients_label = "patients", + patient_label = "patient" + ) whisker_env <<- new.env(parent = globalenv()) add_whisker(default_whiskers) } diff --git a/tests/testthat/test-render_safe.R b/tests/testthat/test-render_safe.R index 9fac2df1..d9ba74f3 100644 --- a/tests/testthat/test-render_safe.R +++ b/tests/testthat/test-render_safe.R @@ -23,9 +23,9 @@ test_that("add_whisker and remove_whisker works", { # render_safe ---- test_that("render_safe works", { - expect_identical(render_safe("patient label is {Patient_label}"), "patient label is Patients") - expect_identical(render_safe("patient label is {patient_label}"), "patient label is patients") - expect_identical(render_safe("patient label is {PATIENT_LABEL}"), "patient label is PATIENTS") + expect_identical(render_safe("patient label is {Patients_label}"), "patient label is Patients") + expect_identical(render_safe("patient label is {patients_label}"), "patient label is patients") + expect_identical(render_safe("patient label is {PATIENTS_LABEL}"), "patient label is PATIENTS") expect_identical(render_safe("patient label is {misspell}"), "patient label is misspell") })