add_to_report: Add an element to the report object

View source: R/utils.R

add_to_reportR Documentation

Add an element to the report object

Description

Add an element to the report object

Usage

add_to_report(x, key, value = NULL)

Arguments

x

A data frame or linelist

key

The name of the cleaning operation

value

The object to add to the report object

Value

The input report object with an additional element

Examples

# scan through the data
scan_res <- scan_data(data = readRDS(system.file("extdata", "test_df.RDS",
                                                 package = "cleanepi")))

# Perform data cleaning
cleaned_data <- clean_data(
  data   = readRDS(system.file("extdata", "test_df.RDS",
                               package = "cleanepi")),
  params = list(
    to_numeric = list(target_columns = "sex", lang = "en"),
    dictionary = NULL
  )
)

# add the data scanning result to the report
cleaned_data <- add_to_report(x     = cleaned_data,
                              key   = "scanning_result",
                              value = scan_res)


cleanepi documentation built on June 22, 2024, 9:48 a.m.