verify_input_data: Checks the input format for create_scenario

View source: R/verify_input_data.R

verify_input_dataR Documentation

Checks the input format for create_scenario

Description

This function is called by create_scenario to check input dataframes to make sure they're compatible with scenarioMaker.

It checks for the following:

* myData is a data frame

* myData is not empty

* myData has all of the columns in columnNames

* the columns named in factorName are factors

Usage

verify_input_data(myData, columnNames, factorNames, stopOnFail = TRUE)

Arguments

myData

object to be checked for correct format

columnNames

column names that must be in myData

factorNames

columns in myData that must be factors

stopOnFail

Default = TRUE When TRUE, function STOPS (bombs out) when dataframe fails a test and prints message about why. When FALSE, function simply returns FALSE.

Value

Bolean. TRUE if input is in correct format, FALSE if input is in incorrect form and stopOnFail=FALSE. If stopOnFail=TRUE, then this will bomb out and return nothing


battleVerse/scenarioMaker documentation built on July 16, 2024, 4:21 a.m.