Skip to content

Commit

Permalink
Mention how to handle NA behavior yourself
Browse files Browse the repository at this point in the history
Hints at the fact that this has to be tailored to your specific usage of `case_when()`, making it hard to generalize (like with a `.missing` argument)
  • Loading branch information
DavisVaughan committed Jun 30, 2022
1 parent d203497 commit 44ad4ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/case_when.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
#' `.default` participates in the computation of the common type with the RHS
#' inputs.
#'
#' `NA` values in the LHS conditions are treated like `FALSE`, meaning that
#' the result at those locations will be assigned the `.default` value. To
#' handle missing values in the conditions differently, you must explicitly
#' catch them with another condition before they fall through to the
#' `.default`. This typically involves some variation of `is.na(x) ~ value`
#' tailored to your usage of `case_when()`.
#'
#' If `NULL`, the default, a missing value will be used.
#'
#' @param .ptype An optional prototype declaring the desired output type. If
Expand Down
7 changes: 7 additions & 0 deletions man/case_when.Rd

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

0 comments on commit 44ad4ac

Please sign in to comment.