Check two Dataframes for Differences

check_for_differences(df_x, df_y, dbg = TRUE)

Arguments

df_x

data frame as retrieved by create_references_df() or clean_references_df()

df_y

data frame as retrieved by create_references_df() or clean_references_df()

dbg

should dbg messages be printed (default: TRUE)

Value

a dataframe containing only the differences between df_x and df_y

Examples

if (FALSE) { ############################################################################ ### Option 1 ### Check differences between two different versions of "KWB_documents.xml" ############################################################################ old_xml <- extdata_file("2020-05-25_KWB-documents.xml") new_xml <- extdata_file("2020-06-17_KWB-documents.xml") old_list <- kwb.endnote::create_endnote_list(old_xml) new_list <- kwb.endnote::create_endnote_list(new_xml) old_df <- kwb.endnote::create_references_df(old_list) new_df <- kwb.endnote::create_references_df(new_list) diffs_df_oldnew <- check_for_differences(old_df, new_df) head(diffs_df_oldnew) ############################################################################ ### Option 2: ### Check differences between "as-is" import and "collapsing" fields ############################################################################ endnote_list <- create_endnote_list() refs_df <- create_references_df(endnote_list) refs_df_collapse <- create_references_df(endnote_list, collapse = TRUE) diffs_df <- check_for_differences(refs_df, refs_df_collapse) head(diffs_df) }