safe_max | R Documentation |
max
but suppress the warning when all values are missingThis function is a drop-in replacement for max
, which is used in
cat_summarise
. It suppresses the warning when all values are NA and
na.rm is TRUE, and returns NA instead of -Inf.
safe_max(x, na.rm = FALSE)
x |
A numerical vector. |
na.rm |
A boolean indicating whether to remove NAs. |
The max of x
or NA when values are missing.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.