max_na_rm: A re-coding of the max function which returns NA if all...

View source: R/max_na_rm.R

max_na_rmR Documentation

A re-coding of the max function which returns NA if all values are NA

Description

A re-coding of the max function which returns NA if all values are NA. Normally max(na.rm=TRUE) will return -Inf if all values are NA.

Usage

max_na_rm(x)

Arguments

x

numeric vector

Value

numeric vector of length 1

Examples

max_na_rm(c(1:2, NA))
max_na_rm(c(NA, NA))


uclalawcovid19behindbars/behindbarstools documentation built on April 22, 2022, 4:08 a.m.