R Warning in min & max – no non-missing arguments returning Inf (2 Examples)

In this R tutorial you’ll learn how to handle the warning message in min & max – “no non-missing arguments; returning Inf”.

Example 1: Replicating the Warning in min & max : no non-missing arguments; returning Inf

min(integer(0))                     # Empty input vector leads to warning
# [1] Inf
# Warning message:
# In min(integer(0)) : no non-missing arguments to min; returning Inf

Example 2: Solving the Warning in min & max : no non-missing arguments; returning Inf

min(1:10)                           # Proper vector does not lead to warning
# [1] 1

Further Resources & Related Articles

In addition, you might read the other articles of my homepage. I have published several tutorials already:

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top