has_names | R Documentation |
Check whether an object has certain names
has_names(x, which) x %has_names% which
x |
object to test |
which |
name |
## Not run: library(assertthat) li <- list(a = 1, b = 2) assert_that(li %has_names% "a") # TRUE assert_that(li %has_names% "c") # Error: li is missing 1 name from "c": "c" assert_that(li %has_names% letters) # Error: li is missing 24 names from letters: "c", "d", "e", ... ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.