Skip to contents

This function checks if a script produces any warnings or errors.

Usage

validate_no_warning_errors(filepath, export_to_dataframe = FALSE)

Arguments

filepath

The complete file path of the script to be tested.

export_to_dataframe

A logical value indicating whether to export results to a data frame. Default is FALSE.

Value

A list with warnings, errors, and messages. If export_to_dataframe is TRUE, the result is a list with the warning and error messages. Otherwise, a summary of the results is printed to the console.

Examples

if (FALSE) { # \dontrun{
# Validate a script for warnings and errors
validate_no_warning_errors(filepath = "/path/to/script.R")

# Validate a script and export the results to a dataframe
validate_no_warning_errors(filepath = "/path/to/script.R", export_to_dataframe = TRUE)
} # }