Learn R Programming

daff (version 0.2.0)

render_diff: Render a data diff to html

Description

render_diff will show a diff in html. When view is TRUE render_diff will show the result in a browser.

Usage

render_diff(diff, file = tempfile(fileext = ".html"), view = interactive(), fragment = FALSE, pretty = FALSE)

Arguments

diff
object generated with diff_data
file
to write to
view
TRUE or FALSE, if TRUE render_diff will show the diff in the browser (only if R is used interactively)
fragment
if FALSE the generated HTML will be a valid HTML document, otherwise it is a HTML fragment
pretty
if TRUE use fancy utf8 characters to make arrows prettier.

Value

generated html

Examples

Run this code
y <- iris[1:3,]
x <- y

x <- head(x,2) # remove a row
x[1,1] <- 10 # change a value
x$hello <- "world"  # add a column
x$Species <- NULL # remove a column

patch <- diff_data(y, x)
render_diff(patch)

#apply patch
y_patched <- patch_data(y, patch)

Run the code above in your browser using DataLab