Skip to content

Commit

Permalink
WS
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Sep 10, 2023
1 parent c044118 commit 3a4bf66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/adorn_ns.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ adorn_ns <- function(dat, position = "rear", ns = attr(dat, "core"), format_func
if (!is.data.frame(dat)) {
stop("adorn_ns() must be called on a data.frame or list of data.frames")
}

rlang::arg_match0(position, c("front", "rear"))

if (is.null(ns)) {
stop("argument \"ns\" cannot be null; if not calling adorn_ns() on a data.frame of class \"tabyl\", pass your own value for ns")
}
Expand Down
2 changes: 1 addition & 1 deletion R/adorn_pct_formatting.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ adorn_pct_formatting <- function(dat, digits = 1, rounding = "half to even", aff
stop("adorn_pct_formatting() must be called on a data.frame or list of data.frames")
}
rlang::arg_match0(rounding, c("half to even", "half up"))

original <- dat # used below to record original instances of NA and NaN

numeric_cols <- which(vapply(dat, is.numeric, logical(1)))
Expand Down
4 changes: 2 additions & 2 deletions R/adorn_title.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ adorn_title <- function(dat, placement = "top", row_name, col_name) {
if (!is.data.frame(dat)) {
stop("\"dat\" must be a data.frame")
}

rlang::arg_match0(placement, c("top", "combined"))

if (inherits(dat, "tabyl")) {
if (attr(dat, "tabyl_type") == "one_way") {
warning("adorn_title is meant for two-way tabyls, calling it on a one-way tabyl may not yield a meaningful result")
Expand Down

0 comments on commit 3a4bf66

Please sign in to comment.