check_input_tbl: Check class, existing variables and data types of input...

Description Usage Arguments Value

View source: R/check_input_tbl.R

Description

check_input_tbl is a helper function for various modeling and scoring functions in 'INDperform'. It checks whether the input object is of class tibble (should be if an output of one of the required functions) and if all required variables are included in the tibble with the correct data type. If not, an error message will be returned.

Usage

1
2
3
4
5
6
7
check_input_tbl(
  x,
  tbl_name,
  parent_func = NULL,
  var_to_check = NULL,
  dt_to_check = NULL
)

Arguments

x

An output tibble from one of the INDperform modeling or scoring functions.

tbl_name

The name of 'x' for the error message.

parent_func

The name of the function that generates the output tibble 'x'.

var_to_check

A character vector listing the variables to check for in 'x'.

dt_to_check

A character vector listing the data types of each variable listed in var_to_check (has to be the same order!) to check for.

Value

The function returns the checked input tibble unchanged.


INDperform documentation built on Jan. 11, 2020, 9:08 a.m.