data_diff: Diff two dataframes

Description Usage Arguments Value Examples

Description

Compare two dataframes using daff package.

Usage

1
2
data_diff(old.df, new.df, output = c("view", "data.frame"),
  file = tempfile(fileext = ".html"))

Arguments

old.df

Old dataframe

new.df

New dataframe (to evaluate changes compared to old.df).

output

character. view shows data diff as HTML (see render_diff). data.frame returns a data.frame (useful for knitting, see examples).

file

Character. Path to save diff results in a HTML file (optional).

Value

A difference object. See diff_data. Also, optionally, an HTML file or data.frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
old <- iris
new <- old
new[1, 2] <- 3.8
new <- new[- 4, ]
data_diff(old, new)

## Diff two Excel files
# (or any two files that can be imported by \pkg{rio}) 
## Not run: 
library(rio)
old <- import("old.xls")
new <- import("new.xls")
data_diff(old, new)

# Including output in Rmarkdown document:
kable(data_diff(old, new, output = "data.frame"))

## End(Not run)

Pakillo/pacotools documentation built on May 7, 2019, 11:56 p.m.