It seems to be generally considered poor programming practise to use variable names that have functions in base R with the same name.
For example, it is tempting to
There isn't really one. R will not normally search objects (non function objects) when looking for a function:
> mean(1:10)
[1] 5.5
> mean <- 1
> mean(1:10)
[1] 5.5
> rm(mean)
> mean(1:10)
[1] 5.5
The examples shown by @Joris and @Sacha are where poor coding catches you out. One better way to write foo is:
foo <- function(x, fun) {
fun <- match.fun(fun)
fun(x)
}
Which when used gives:
> foo(1:10, mean)
[1] 5.5
> mean <- 1
> foo(1:10, mean)
[1] 5.5
There are situations where this will catch you out, and @Joris's example with na.omit is one, which IIRC, is happening because of the standard, non-standard evaluation used in lm().
Several Answers have also conflated the T vs TRUE issue with the masking of functions issue. As T and TRUE are not functions that is a little outside the scope of @Andrie's Question.