Check for Name
has_name(x, name)
# S3 method for Container
has_name(x, name)
# S3 method for dict.table
has_name(x, name)
any R
object.
character
the name to be found.
TRUE
if name is in x
and otherwise FALSE
.
For dict.table
TRUE
if the dict.table objects has the given
column name, otherwise FALSE
.
co = container(a = 1, 2, f = mean)
has_name(co, "a") # TRUE
#> [1] TRUE
has_name(co, "f") # TRUE
#> [1] TRUE
has_name(co, "2") # FALSE
#> [1] FALSE
dit = dict.table(a = 1:2, b = 3:4)
has_name(dit, "a") # TRUE
#> [1] TRUE
has_name(dit, "x") # FALSE
#> [1] FALSE