1. Installation
# Install from GitHub (CRAN submission planned)
# install.packages("pak")
pak::pak("R4SUB/r4subcore")
2. Create a Run Context
library(r4subcore)
ctx <- r4sub_run_context(
study_id = "STUDY001",
environment = "PROD"
)
ctx$run_id # Unique identifier for this assessment
3. Ingest Validation Results
# Parse Pinnacle21 output
p21_data <- read.csv("pinnacle21_report.csv")
evidence <- p21_to_evidence(
p21_data,
ctx = ctx,
source_version = "P21-3.1"
)
# View summary
evidence_summary(evidence)
4. Score and Analyze
# Aggregate by indicator
scores <- aggregate_indicator_score(
evidence,
by = "indicator_id",
method = "weighted"
)
# View worst performers
head(scores[order(scores$score), ])