execute_checks: Execute the checks against a dataset to return a nested list.

View source: R/execute-checks.R

execute_checksR Documentation

Execute the checks against a dataset to return a nested list.

Description

Execute the checks against a dataset to return a nested list.

Usage

execute_checks(ds, checks, origin)

Arguments

ds

The data.frame to be checked. Required.

checks

The list describing the check. Is the output of

origin

The origin of the dataset. Currently supports "csv" and "REDCap". Required. load_checks(). Required.

Examples

# Step 0: define paths.
#   So this package example executes on every machine, temp files are used.

# Replace the two paths for your specific project
path_data    <- system.file("datasets/pt-event-biochemical.rds", package = "trawler")
path_checks  <- system.file("checks/checks-biochemical.yml", package = "trawler")

# Step 1: load the check definitions and the dataset to test
ds_pt_event  <- readr::read_rds(path_data)
checks       <- load_checks(path_checks, origin = "REDCap")

# Step 2: execute the checks and save to an rds file
ds_pt_event |>
  execute_checks(checks, origin = "REDCap")

# Save to disk if needed
# ds_pt_event |>
#   execute_checks(checks, origin = "REDCap") |>
#   readr::write_rds("inst/derived/biochemical.rds")


OuhscBbmc/trawler documentation built on Oct. 8, 2024, 11:44 p.m.