safe_min {tabbycat} | R Documentation |
Calculate min
but suppress the warning when all values are missing
Description
This function is a drop-in replacement for min
, 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.
Usage
safe_min(x, na.rm = FALSE)
Arguments
x |
A numerical vector. |
na.rm |
A boolean indicating whether to remove NAs. |
Value
The min of x
or NA when values are missing.
[Package tabbycat version 0.18.0 Index]