max_mis: A function to safely take the maximum of a vector that could include only NAs.
Description
When computing the maximum on arbitrary subsets of data, some
of which may only have missing values, it may be necessary to take the maximum
of a vector of NAs. This replaces the behavior that returns Inf or-Inf and
replaces it with simply returning an NA.
Usage
max_mis(x)
Value
A vector with the maximum value or with an NA of the proper type
Arguments
x
A vector of data that a maximum can be taken of.
Author
Jared E. Knowles
Details
This function only returns valid results for vectors with a mix of
NA and numeric values.