Skip to content

Commit

Permalink
lil updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Feb 14, 2024
1 parent bc449d2 commit a896032
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions R/import-standalone-checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,28 @@ check_scalar_logical <- function(x, allow_empty = FALSE,
)
}

#' Check String
#'
#' @inheritParams check_class
#' @keywords internal
#' @noRd
check_string <- function(x, allow_empty = FALSE,
message = "The {.arg {arg_name}} argument must be a string,
not {.obj_type_friendly {x}}.",
arg_name = rlang::caller_arg(x), call = parent.frame()) {
check_class(
x = x, class = "character", allow_empty = allow_empty,
message = message, arg_name = arg_name,
call = call
)

check_scalar(
x = x, allow_empty = allow_empty,
message = message, arg_name = arg_name,
call = call
)
}

#' Check Argument not Missing
#'
#' @inheritParams check_class
Expand Down
2 changes: 1 addition & 1 deletion R/tbl_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
#' by = trt,
#' label = list(age = "Patient Age"),
#' statistic = list(all_continuous() ~ "{mean} ({sd})"),
#' digits = list(age ~ c(0, 1))
#' digits = list(age = c(0, 1))
#' )
#'
#' # Example 3 ----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion man/tbl_summary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a896032

Please sign in to comment.