Skip to content

Commit

Permalink
Export categorize_risk function (#793)
Browse files Browse the repository at this point in the history
* export categorize risk function

* update documentation
  • Loading branch information
kalashsinghal authored Jun 4, 2024
1 parent 9e3b51c commit 4ed9a3d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export(.data)
export(aka)
export(as_label)
export(as_name)
export(categorize_risk)
export(document_default_value)
export(document_tilt_profile)
export(emissions_profile)
Expand Down
4 changes: 4 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ risk_category_levels <- function() {
c("high", "medium", "low")
}

#' Categorize a variable into risk categories using low and high thresholds
#'
#' @keywords internal
#' @export
categorize_risk <- function(x, low_threshold, high_threshold, ...) {
case_when(
x > high_threshold ~ "high",
Expand Down
12 changes: 12 additions & 0 deletions man/categorize_risk.Rd

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

0 comments on commit 4ed9a3d

Please sign in to comment.