expect_column_names_somewhere_in_data_frame: Check if the column names you expect to be in the df, are...

Description Usage Arguments Examples

View source: R/data_expectations.R

Description

Check if the column names you expect to be in the df, are indeed in there

Usage

1
2
expect_column_names_somewhere_in_data_frame(df, colums_expected,
  return_df = TRUE)

Arguments

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)

Examples

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

dgarmat/dgfunctionpack documentation built on May 17, 2020, 9:58 p.m.