pipe_check: Create a pipeline step that learns what the data looks like

Description Usage Arguments Value

Description

Create a pipeline step that learns what the data looks like

Usage

1
2
3
pipe_check(train, response, on_missing_column = c("error", "add")[1],
  on_extra_column = c("remove", "error")[1],
  on_type_error = c("ignore", "error")[1])

Arguments

train

Data frame containing the train data.

response

The response variable. Will be used as an optional column name. Does not have to exist in the train dataset (useful when it is added in later in the pipeline)

on_missing_column

What to do when a new dataset misses columns. Either "error", which causes an error, or "add", which adds the missing columns with only NA's filled in.

on_extra_column

What to do when a new dataset has extra column.s Either "error", which causes an error, or "remove", which removes the extra columns.

on_type_error

What to do when a new dataset causes warnings or errors on casting columns to new types. Either "error", which causes an error, or "ignore", which ignores warnings but will still allow errors to propagate.

Value

A list of the train dataset and a pipe to be used on new data.


jeroenvdhoven/datapiper documentation built on July 14, 2019, 9:34 p.m.