check_for_differences: Check two Dataframes for Differences

Description Usage Arguments Value Examples

View source: R/check_for_differences.R

Description

Check two Dataframes for Differences

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
############################################################################
### 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)


## End(Not run)

KWB-R/kwb.endnote documentation built on July 8, 2021, 4:18 p.m.