all.names(expr, functions = TRUE, max.names = -1L, unique = FALSE) all.vars(expr, functions = FALSE, max.names = -1L, unique = TRUE)
expr | a language object, typically a call. (N.B., a function is not a language object: use is.language to check.) |
functions | a logical value. If FALSE do not include the names of functions in function calls in the result. If TRUE do include them. Note that functions also include operators such as "+", "*", etc. |
max.names | an integer value giving the maximum number of names to be returned. The default is -1, meaning there is no limit. |
unique | if TRUE, return a name only once, even if it is used several times in expr. If FALSE, the name is included in the value as many times as it appears in expr. |
all.names(y ~ x1 + x2 + log(x2, base=2)) # [1] "~" "y" "+" "+" "x1" "x2" "log" "x2"all.names(y ~ x1 + x2 + log(x2, base=2), unique=TRUE) # [1] "~" "y" "+" "x1" "x2" "log"
all.vars(y ~ x1 + x2 + log(x2, base=2)) # [1] "y" "x1" "x2"