Misspecifying a parameter in min()/max() does not throw an error or warning. Why?
16:47 28 May 2026

A: min(c(1,NA,2),na.rm=T) results in 1

B: min(c(1,NA,2),na.mr=T) results in NA

C: min(c(1,NA,2),carrots='blue') results in NA

So, B and C do not throw a warning or error despite me trying to set parameters that do not exist.

D: colSums(cbind(1,2),na.mr=T) results in:

"Error in colSums(cbind(1, 2), na.mr = T) : unused argument (na.mr = T)"

which seems like a useful behaviour.

I've made mistake B yesterday and it took me a while to find that tiny typo, which had huge consequences. Why aren't these base functions warning you when you are trying to set a non-existent parameter?

r