Learn R Programming

container (version 1.0.5)

has_name: Check for Name

Description

Check for Name

Usage

has_name(x, name)

# S3 method for Container has_name(x, name)

# S3 method for dict.table has_name(x, name)

Value

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.

Arguments

x

any R object.

name

character the name to be found.

See Also

has()

Examples

Run this code

co = container(a = 1, 2, f = mean)
has_name(co, "a")    # TRUE
has_name(co, "f")    # TRUE
has_name(co, "2")    # FALSE

dit = dict.table(a = 1:2, b = 3:4)
has_name(dit, "a")   # TRUE
has_name(dit, "x")   # FALSE

Run the code above in your browser using DataLab