all.names
Find All Names in an Expression

Description

Gets the name objects from a language object.

Usage

all.names(expr, functions = TRUE, max.names = -1L, unique = FALSE)
all.vars(expr, functions = FALSE, max.names = -1L, unique = TRUE)

Arguments

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.

Details

all.vars and all.names differ only in the default values of the functions and unique arguments.
Value
returns a character vector containing the names in expr
See Also
expression, terms.
Examples
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"

Package base version 6.1.1-7
Package Index