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. (A function is not a language object. If you are not sure, 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 +, *, and so on. |
max.names | an integer value giving the maximum number of names to return. The default is -1, meaning there is no limit. |
unique | a logical value. If TRUE, return the name only once, even if it is used several times in expr. If FALSE, return the name 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"