Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add patient labels #126

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
whisker_env <- NULL

.onLoad <- function(libname, pkgname) {
default_whiskers <- c(patient_label = "patients")
default_whiskers <- c(
BFalquet marked this conversation as resolved.
Show resolved Hide resolved
patients_label = "patients",
patient_label = "patient"
)
whisker_env <<- new.env(parent = globalenv())
add_whisker(default_whiskers)
}
6 changes: 3 additions & 3 deletions tests/testthat/test-render_safe.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})

Expand Down
Loading