Description Usage Arguments Details Examples
Asserts That Columns are in Data Frame
1 | assert_cols_in(d, cols, ...)
|
d |
data.frame |
cols |
character vector of columns to check for |
... |
name of columns to check for |
Column names can be provided either as a character vector (in parameter cols) or as the names of columns to check for (without quotations). Do not mix the types.
1 2 3 4 5 6 7 8 | assert_cols_in(iris, c("Petal.Width", "Petal.Length")) # cols in, will do nothing
assert_cols_in(iris, Petal.Width, Petal.Length)
## Not run:
assert_cols_in(iris, c("x", "y")) # cols not in, will assert error
assert_cols_in(iris, x, y)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.