Skip to contents

Get the elementwise maximum of parttime vectors

Usage

# S3 method for partial_time
pmax(..., na.rm = FALSE)

Arguments

...

numeric or character arguments (see Note).

na.rm

a logical indicating whether missing values should be removed.

Value

A partial_time vector with length equal to the maximum length of the vectors provided where each value is the maximum of the recycled values of each vector argument.

Examples

pmax(
  parttime(c("2019", "2018", "2019-02", "2018",    "2010")),
  parttime(c("2020", NA,     "2019-03", "2018-01", "2010"))
)
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> <partial_time<YMDhms+tz>[5]> 
#> [1] "2020"                "0000-00-00 00:00:00" "0000-00-00 00:00:00"
#> [4] "0000-00-00 00:00:00" "2010"