hasName is a convenient way to test for one or more names
in an R object.
One or more character values to look for.
hasName(x, name) is defined to be equivalent to
name %in% names(x), though it will evaluate slightly more
quickly. It is intended to replace the common idiom
!is.null(x$name). The latter can be unreliable due to partial
name matching; see the example below.
A logical vector of the same length as
TRUE if the corresponding entry is in
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.