has_name | R Documentation |
This function returns a logical value that indicates if a data
frame or another named object contains an element with a specific
name. Note that has_name()
only works with vectors. For instance,
environments need the specialised function env_has()
.
has_name(x, name)
x |
A data frame or another named object |
name |
Element name(s) to check |
Unnamed objects are treated as if all names are empty strings. NA
input gives FALSE
as output.
A logical vector of the same length as name
has_name(iris, "Species")
has_name(mtcars, "gears")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.