I'm computing the maximum of each of a collection of vectors, and some of these vectors are empty. For my purposes, max(some.empty.vector) returning -Inf is okay; it is expected, and valid for the further calculations I need to do.
However, I'm getting a warning message, "no non-missing arguments to max". How can I tell R that max(some.empty.vector) is not a problem, so there's no need for the warning? I don't want to just ignore the warning message, since there might be warnings coming from other functions, which I wouldn't want to lose track of.
I looked for other questions referring to this error message, and they all appear to be originating from taking the min or max of a vector which is empty unexpectedly, so the problem is the input data, which should not be empty. I'm in a different situation, I have some vectors which I know are empty, and they should be empty, so I can't suppress the warning by ensuring those vectors are nonempty.