column_in_dataframe: Test If A Column Is Found in A Data Frame

Description Usage Arguments Value Examples

Description

A function that check if column is one of df's columns and returns an error message if not.

Usage

1
column_in_dataframe(df, column, error_message = NULL, call_ = F)

Arguments

df

List/Data frame

column

Character: A column name

error_message

Character: user-defined error message

call_

Logical: logical, indicating if the call should become part of the error message. See call. in stop

Value

Error message if test fails

Examples

1
2
3
4
5
6
test_df <- data.frame(a = 1:10, b = 11:20)
column_in_dataframe(test_df, 'a')
## Not run: 
column_in_dataframe(test_df, 'c')

## End(Not run)

statech/CommonPlots documentation built on May 6, 2019, 1:32 a.m.