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 indf1is shown directly to the left of itsdf2counterpart (a pivoted view) with comparison annotation columnsall_tb: comparison data displayed where each row indf1is shown directly above itsdf2counterpart (a top-bottom view) with comparison annotation columnsall_lr: comparison data displayed where each column indf1is shown to the left of itsdf2counterpart (a left-right view) with comparison annotation columnsall_tb_change_indices: a named list where the names are the data columns inall_tband the elements are numeric vectors of the row indices that changed betweendf1anddf2in a columnall_lr_change_indices: a named list where the names are the data columns inall_lrand the elements are numeric vectors of the row indices that changed betweendf1anddf2in a columnid_cols: the columns indf1anddf2that form a unique row IDcc_out: a name list with four elements:same: a logical indicating whether the column names indf1anddf2are the sameboth: a character vector of column names that are in bothdf1anddf2df1_only: character vector of column names that are indf1but notdf2df2_only: character vector of column names that are indf2but notdf1
df1: the raw data fromdf1df2: 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'
