Skip to contents

This class manages a collection of ErrorData objects. It can be used to add new ErrorData objects, and to export the collection of errors to a CSV file.

Public fields

error_data_list

A list of ErrorData objects representing the collection of errors.

user_data

The original data frame where the errors were found.

Methods


Method new()

This method receives a list of ErrorData objects.

Usage

ValidationErrorCollection$new(errors = list(), user_data = NULL)

Arguments

errors

The list of ErrorData objects to be added.

user_data

The user data where the error data came from.


Method add_error()

This method adds an ErrorData object.

Usage

ValidationErrorCollection$add_error(error_data)

Arguments

error_data

The ErrorData object to be added.


Method get_error_details_by_index()

Gets an error by index.

Usage

ValidationErrorCollection$get_error_details_by_index(index)

Arguments

index

The index to specify which error.


Method length()

This method returns the number of ErrorData objects in the list.

Usage

ValidationErrorCollection$length()


Method get_combined_error_data()

This method combines the error details with the user data and returns it as a data frame.

Usage

ValidationErrorCollection$get_combined_error_data()


Method clone()

The objects of this class are cloneable with this method.

Usage

ValidationErrorCollection$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.