reports_assertions_tests: Reports, Assertions, and Tests on NORDCAN Datasets and...

reports_assertions_testsR Documentation

Reports, Assertions, and Tests on NORDCAN Datasets and Columns

Description

Functions to create reports, assert, and test NORDCAN datasets and columns using functionality from package dbc.

Usage

report_dataset_is_valid(x, dataset_name)

assert_dataset_is_valid(x, dataset_name)

assert_processed_cancer_record_dataset_is_valid(x)

assert_unprocessed_cancer_record_dataset_is_valid(x)

assert_general_population_size_dataset_is_valid(x)

assert_general_population_death_count_dataset_is_valid(x)

test_dataset_is_valid(x, dataset_name)

report_dataset_columns_are_valid(x, column_names)

assert_dataset_columns_are_valid(x, column_names)

test_dataset_columns_are_valid(x, column_names)

report_column_is_valid(x, column_name)

assert_column_is_valid(x, column_name)

test_column_is_valid(x, column_name)

report_national_population_life_table_is_valid(x)

assert_national_population_life_table_is_valid(x)

report_unprocessed_cancer_death_count_dataset(x)

assert_unprocessed_cancer_death_count_dataset(x)

Arguments

x

⁠[data.frame]⁠ (mandatory, no default)

dataset to report / assert / test on

dataset_name

⁠[character]⁠ (mandatory, no default)

name of a NORDCAN dataset; must be one of the elements of output of nordcancore::nordcan_metadata_dataset_names(); therefore see also ⁠[nordcancore::nordcan_metadata_dataset_names]⁠

column_names

⁠[character]⁠ (mandatory, no default)

names of columns to check

column_name

⁠[character]⁠ (mandatory, no default)

name of column to check

Details

report_ functions produce a data.frame describing whether tests passed, and if not, how they failed. See e.g. ⁠[dbc::expressions_to_report]⁠.

assert_ functions raise an error if any test in the corresponding report did not pass. See e.g. ⁠[dbc::report_to_assertion]⁠.

test_ functions return TRUE if all tests in the corresponding report passed.


CancerRegistryOfNorway/nordcanpreprocessing documentation built on May 2, 2023, 3:38 p.m.