Generates a detailed comparison report of two data frames
Value
a named list with elements:
col_summary_simple
: summary statistics for columnscol_summary_by_col
: summary statistics by columnrow_summary
: summary statistics for rowsall_pivoted
: comparison data displayed where each value indf1
is shown directly to the left of itsdf2
counterpart (a pivoted view) with comparison annotation columnsall_tb
: comparison data displayed where each row indf1
is shown directly above itsdf2
counterpart (a top-bottom view) with comparison annotation columnsall_lr
: comparison data displayed where each column indf1
is shown to the left of itsdf2
counterpart (a left-right view) with comparison annotation columnsall_tb_change_indices
: a named list where the names are the data columns inall_tb
and the elements are numeric vectors of the row indices that changed betweendf1
anddf2
in a columnall_lr_change_indices
: a named list where the names are the data columns inall_lr
and the elements are numeric vectors of the row indices that changed betweendf1
anddf2
in a columnid_cols
: the columns indf1
anddf2
that form a unique row IDcc_out
: a name list with four elements:same
: a logical indicating whether the column names indf1
anddf2
are the sameboth
: a character vector of column names that are in bothdf1
anddf2
df1_only
: character vector of column names that are indf1
but notdf2
df2_only
: character vector of column names that are indf2
but notdf1
df1
: the raw data fromdf1
df2
: the raw data fromdf2
Examples
id_cols <- c("id1", "id2")
comparison <- get_comparison(compareDFx::df1, compareDFx::df2, id_cols)
#> Warning: ID duplicates detected, recommend fixing these and re-running `get_comparison()`
#> Warning: ID columns contain `NA`, recommend fixing these and re-running `get_comparison()`
#> df1 and df2 have different columns therefore no records are recorded as 'matched'