View source: R/helpers-assert.R
| assertcols | R Documentation |
Low-level helpers for validating columns and keys or comparing schemas.
assertcols(data, cols)
commonnames(x, y)
duplicatedkeys(data, by)
assertkey(data, by)
data, x, y |
A |
cols |
Column names or selectors, as accepted by the verbs. |
by |
Character vector of column names identifying groups or join keys. |
assertcols() and assertkey() return data invisibly or signal an
error; commonnames() returns the shared column names; duplicatedkeys()
returns the key combinations that occur more than once.
commonnames(mtcars, iris)
assertcols(mtcars, c("mpg", "hp"))
duplicatedkeys(data.frame(id = c(1, 1, 2)), "id")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.