When working with data frames, a common operation is to calculate the minimum/maximum of columns. When a column contains missing values, the result is NA:

min(c(NA_real_, 1.2))
# NA

min(NA_real_)
# NA

I usually need to remove the missing values:

min(c(NA_real_, 1.2), na.rm = TRUE)
# 1.2

In some rare cases, columns might contain only missing values. The result seems counterintuitive to me:

min(NA_real_, na.rm = TRUE)
# Inf
# Warning message:
# In min(numeric(0)) : no non-missing arguments to min; returning Inf

min(numeric(0))
# Inf
# Warning message:
# In min(numeric(0)) : no non-missing arguments to min; returning Inf

max(numeric(0))
# -Inf
# Warning message:
# In max(numeric(0)) : no non-missing arguments to max; returning -Inf

The behaviour is documented, see

?min

This leads to:

x <- numeric(0)

min(x) > max(x)
# [1] TRUE
# Warning messages:
# 1: In min(numeric(0)) : no non-missing arguments to min; returning Inf
# 2: In max(numeric(0)) : no non-missing arguments to max; returning -Inf

This is almost poetry...

Since it's time for New Year resolution, it might help to know that even when being nothing, the minimum is higher than the maximum.. Don't give up, enjoy the ride....

https://sketchplanations.com/anchors-and-tugboats

sketchplanation anchor tugboat

Make a promise. Show up. Do the work. Repeat.