check_data_frame_throw_error: Validate ml_pipeline_builder transform method returns...

Description Usage Arguments Examples

View source: R/utils.R

Description

Helper function that checks if the object returned from a ml_pipeline_builder method is data.frame (if it isn't NULL), and if it isn't, throws an error that is customised with the returning name.

Usage

1
check_data_frame_throw_error(func_return_object, func_name)

Arguments

func_return_object

The object returned from a ml_pipeline_builder method.

func_name

The name of the function that returned the object.

Examples

1
2
3
4
5
6
7
8
## Not run: 
transform_method <- function(df) df
data <- data.frame(y = c(1, 2), x = c(0.1, 0.2))
data_transformed <- transform_method(data)
check_data_frame_throw_error(data_transformed, "transform_method")
# NULL

## End(Not run)

AlexIoannides/pipeliner documentation built on May 5, 2019, 4:52 a.m.