validate_input_df: Validate Input DataFrame

View source: R/validate_input_df.R

validate_input_dfR Documentation

Validate Input DataFrame

Description

Validates the input dataframe has the correct type, correct required column names, that the distribution is valid, that the column types are correct, and that the column values are greater than or equal to 0 when they are numeric.

Usage

validate_input_df(input_df, distribution)

Arguments

input_df

Dataframe containing option_name (str) and various other columns depending on the distribution type. See vignette for more details.

distribution

String of the distribution name

Value

Bool TRUE if all checks pass.

Examples

input_df <- tibble::tibble(
   option_name = c("A", "B"),
   sum_clicks = c(1000, 1000),
   sum_conversions = c(100, 120)
)
validate_input_df(input_df, "conversion_rate")


grizbayr documentation built on Oct. 9, 2023, 5:10 p.m.