Description Usage Arguments Examples
View source: R/data_expectations.R
Check if the column names you expect to be in the df, are indeed in there
1 2 | expect_column_names_somewhere_in_data_frame(df, colums_expected,
return_df = TRUE)
|
colums_expected |
a character vector |
return_df |
T/F whether to end function with dataframe input (as in if a check in part of a pipe) |
1 2 3 4 5 | expect_column_names_somewhere_in_data_frame(mtcars, c("mpg", "cyl"))
# [1] "all columns found...OK"
expect_column_names_somewhere_in_data_frame(mtcars, c("mpg", "cyl", "car_name"))
# Error in expect_column_names_somewhere_in_data_frame(mtcars, c("mpg", :
# car_name column not found
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.