Learn R Programming

pipeliner (version 0.1.1)

check_data_frame_throw_error: Validate ml_pipeline_builder transform method returns data.frame

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

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

Run this code
## 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)

Run the code above in your browser using DataLab