Skip to contents

Data Import

Read clinical data files as stored. Type conversion is opt-in via convert_types, because coercing a two-valued numeric to logical breaks 0/1 event and censoring flags.

read_clinical_data()
Read and prepare a clinical dataset in one step

Data Type Conversion

Automatically infer and convert column types, and read back which rule fired on which column.

r_data_types()
Automatically infer and convert data types
type_conversion_report()
Read the per-column type-conversion report

Variable Labels

Extract, look up, register and override variable labels, and declare the code-to-text mappings for coded variables

label_map()
Build a lookup map of data labels
get_label()
Look up the label for a single variable
get_labels()
Look up labels for multiple variables at once
add_labels()
Add or update labels in a label map
apply_label_overrides()
Apply label overrides from a YAML file
apply_value_labels()
Declare value labels for coded variables from a YAML file
strip_level_prefix()
Strip a leading code prefix from level text
level_map()
Report what stripping a code prefix would do to a dataset's levels
clean_labels()
Apply label overrides from a YAML file (deprecated)

Data Documentation

Build data dictionaries, summarise variables, and compare dataset versions

data_dictionary()
Build a data dictionary from a labeled dataset
dataset_schema()
Column-level schema of a dataset
proc_contents()
Describe a dataset's variables, in the style of SAS PROC CONTENTS
proc_means()
Summarise numeric variables, in the style of SAS PROC MEANS
proc_univariate()
Summarise and test numeric variables, in the style of SAS PROC UNIVARIATE
proc_freq()
Frequency tables, in the style of SAS PROC FREQ
followup_check()
Check recorded follow-up before a time-related analysis
compare_datasets()
Compare two versions of a dataset

Dataset Versioning

Track and verify dataset integrity with SHA-256 checksums

update_manifest()
Create or update a dataset manifest file
verify_manifest()
Verify all datasets listed in a manifest

Data Generation

Generate labeled sample and synthetic datasets

generate_survival_data()
Generate Synthetic Cardiac Surgery Survival Data
sample_data()
Generate a sample dataset for testing

SAS Macro Canonicalization

Inventory a legacy SAS macro library and resolve name collisions

sas_triage()
Triage a directory of legacy SAS macro files
sas_macro_defs()
Extract every macro definition from a SAS file
sas_macro_signature()
Parse the documentation header of a legacy SAS macro file
write_macro_manifest()
Write the canonical macro manifest
write_collision_report()
Write the macro name-collision report

SAS Parity

Compare an R result against its SAS reference under derived tolerances

parity_tolerance()
Tolerance classes for SAS parity comparison
compare_parity()
Compare one R quantity against its SAS reference
parity_headline()
Summarise a parity table as one reviewer-facing claim

Study Setup

Initialize a study for reproducible analysis, and audit whether it is ready

study_setup()
Set up study identity and directories
study_update_identity()
Record a verified study identity
study_declare()
Declare the packages a study needs
study_need()
Install a package a study needs, or say how
register_data()
Register a study dataset
study_status()
Audit a study's reproducibility readiness
study_checklist()
Render a study audit as a markdown checklist
preflight_report()
Audit the analysis environment before running an analysis

Study Checkpoints

Snapshot a study’s code at each checkpoint, record its documents by checksum, and record its closure

study_checkpoint()
Record a study checkpoint
study_checkpoint_push()
Push pending study checkpoints
study_close() study_reopen()
Close or reopen a study

Study Manifest and Data Contract

Locate a study from its _study.yml, resolve its paths, and read and reconcile its built dataset

study_config()
Read the study manifest
study_abbreviations()
The abbreviation list a study's labels use
add_abbreviation()
Add a phrase to a study's abbreviation list
study_root()
Locate the study root
sas_path()
Build a path under the study root
built_path()
Path to the study's built dataset
built_manifest()
Record the state of the built dataset
study_dir()
Resolve a directory in the study layout
read_built()
Read the study's built dataset
review_built()
Review a rebuilt study dataset before registering it
check_data_updates()
Check a study for published dataset updates
review_data_update()
Review one published dataset release
adopt_data_update()
Adopt one published dataset release
cohort_counts()
Count the analysable cohort
assert_cohort()
Assert the cohort matches a job-level expectation

Provenance

Record what produced a filed result, in a JSON sidecar beside it

provenance_data()
Snapshot a registered data file for provenance
provenance_artifact()
Snapshot an input artifact for provenance
capture_provenance()
Capture an explicit job provenance payload
publish_provenance()
Publish captured provenance beside a completed output
record_provenance()
Capture and publish provenance for an existing output
provenance_path()
Name the provenance sidecar for an output

Caching

Compute expensive results once and reload them only while their inputs are unchanged

cache_fit()
Cache an expensive computation, strictly

Analysis Taxonomy

The two-letter prefix system inherited from the CORR analysis binder

hvti_taxonomy()
Analysis prefix taxonomy
hvti_non_prefixes()
Second fields that are not analysis prefixes
hvti_prefix_folds()
Legacy prefixes folded into a taxonomy prefix

Corpus Inventory

Sweep the job corpus by filename – which studies ran which job types

job_files()
Inventory the job files under one or more corpus roots
job_census() print(<hvti_job_census>)
Roll a job-file inventory up to studies and prefixes

Candidate Pool Preparation

Getting a covariate list out of a SAS job and into a model without changing the model on the way. Each of these exists because of a failure that was silent: a comment swallowing a variable name, a mean-imputed binary being dummy-coded, a screen spending its step budget on five forms of one concept, a rank-deficient design from two names for the same thing.

sas_variable_block()
Read a variable list out of a SAS job
covariate_audit()
Audit what would happen to each covariate in a model
imputed_levels()
Levels of a column that are not clean integers
covariates_to_numeric()
Apply what covariate_audit() reports
pool_collinear_pairs()
Candidate pairs carrying the same information under unrelated names
concept_of()
The concept a candidate variable belongs to
concept_map()
Map a candidate pool to concepts
prune_to_one_form()
Prune a candidate pool to one form per concept
selection_crowding()
Concepts represented more than once among selected covariates
POOL_AFFIXES POOL_PLAIN_SUFFIX POOL_MIN_STEM
Affix conventions for grouping a SAS candidate pool into concepts

Package Utilities

hvtiRutilities-package
hvtiRutilities: Utilities to work with SAS data in R.
hvtiRutilities.news()
Display the NEWS file
r_dir_impurities()
Report top-level executable code in an R directory