Compare SAS and R Result Tables for Concordance
Source:R/repro_indicators.R
assess_sas_r_concordance.RdCompares two result tables cell by cell and reports how many values agree,
numeric values within tol and other values exactly. This supports the SAS
versus R dual-verification step of a hybrid submission, where the same table
is produced in both languages and the results are reconciled. Returns
evidence with indicator_id = "R-REPRO-009".
Arguments
- r_data, sas_data
The R and SAS result tables, as data.frames or as paths to CSV files (or SAS transport
.xptfiles when 'haven' is installed).- keys
Optional character vector of key columns to order both tables by before comparing. When
NULLthe tables are compared in their given order.- tol
Numeric tolerance for comparing numeric values. Defaults to 1e-8.
- ctx
A run context from
r4subcore::r4sub_run_context(). WhenNULLa default"SAS_R_COMPARISON"context is created.
Examples
a <- data.frame(id = 1:3, val = c(1.0, 2.0, 3.0))
b <- data.frame(id = 1:3, val = c(1.0, 2.0, 3.0))
suppressMessages(assess_sas_r_concordance(a, b))$result
#> [1] "pass"