today I came across a question. Normaly every function in R takes arguments within its belonging paranthesis, e.g.
# function definition
f <- function(arg){print(arg)}
# function call
f(arg = 3)
But the built-in function names(), for example, works differently. You would call it like so:
x = 3
names(x) <- "aNumber"
This seems to be special, since the value "aNumber" is not assigned to the function names() as a conventional argument, but rather assigned to the function itself. So my question is how to define such type of functions.
Cheers,
Philipp