Helper function to determine whether a supplied data frame is a specific orgsurveyr-data-formats defined in the package. Either returns a boolean or throws a stop.

check_df_format(df, format = NULL, dev_mode = FALSE)

Arguments

df

query data frame

format

format to test - see orgsurveyr-data-formats

dev_mode

stop if test is false. Default is FALSE

Value

string of data frame type

Examples

data(tg_org_indiv_df) check_df_format(tg_org_indiv_df, 'indiv_df')
#> [1] TRUE
data(tg_org_indiv_tall_df) check_df_format(tg_org_indiv_tall_df, 'indiv_tall_df')
#> [1] TRUE
data(tg_org_summarised_df) check_df_format(tg_org_summarised_df, 'org_tall_df')
#> [1] TRUE
data(mtcars) check_df_format(mtcars, 'indiv_df')
#> [1] FALSE