Workhorse function for excel_diff_table(). Can be used to diff any pair of dataframes or tibbles. Diff is applied cell by cell, so results will only be meaningful if the shape of the two objects is the same.
Usage
diff_to_table(
df1,
df2,
proportional_threshold = 0.001,
absolute_threshold = NULL,
digits_show = 6,
dfnames = NULL,
excelify_col_names = FALSE
)Arguments
- df1
first dataframe or tibble
- df2
second dataframe or tibble
- proportional_threshold
Sets a threshold of proportional change below which differences should be ignored. For example, a value of 0.1 means any changes less than 10% will not be flagged as having changed.
proportional_thresholdwill override this value and behavior if it is provided. Numeric, defaults to 0.001 (0.1% change).- absolute_threshold
Optional. Sets a threshold of absolute change below which differences should be ignored. For example, a value of 0.1 means any changes less than 0.1 will not be flagged as having changed. If provided, will override
proportional_threshold. Numeric, defaults to NULL.- digits_show
When there is a change in number values, how many digits should be shown in
## ---> ##? Numeric, defaults to 6. Recommend not making this so small that flagged changes don't get printed (e.g., if this is 2 andproportional_thresholdis 0.001, 0.1% changes will get flagged, but only the first two digits will get shown).- dfnames
Character vector with names of the two dataframes to use for table title. Optional.
- excelify_col_names
Should columns be identified by excel letter convention? Defaults to FALSE. Set to TRUE when comparing dataframes extracted from excel sheets.