f = function(x){
x
}
f() # Throws error: x is missing
g = function(x){
letters[x]
}
g(1) # Returns the first element of letters
g() # Doesn't throw error, returns ALL elements of letters
Hadley Wickham pointed out that g(x) is doing helpfully letters[], which is different from letters[NULL].
This burned me a few months back.
Hadley Wickham pointed out that
g(x)
is doing helpfullyletters[]
, which is different fromletters[NULL]
.ಠ_ಠ