According to the help, is.recursive(x) "returns TRUE if x has a recursive (list-like) structure and FALSE otherwise". I am confused why it returns TRUE when x is a function. For example:
is.recursive(mean)
# [1] TRUE
But it does not seem that functions can be recursive in any meaningful sense, particularly since they are not even sub-settable:
mean[[1]]
# Error in mean[[1]] : object of type 'closure' is not subsettable
Is this an oversight in the R source code, or is there a valid reason that functions should be considered recursive?