render_diff | R Documentation |
Converts a diff_data object to HTML code, and opens the resulting HTML code
in a browser window if view==TRUE
and R is running interactively.
render_diff(
diff,
file = tempfile(fileext = ".html"),
view = interactive(),
fragment = FALSE,
pretty = TRUE,
title,
summary = !fragment,
use.DataTables = !fragment
)
diff |
|
file |
|
view |
|
fragment |
|
pretty |
|
title |
|
summary |
|
use.DataTables |
|
generated html
data_diff
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, title="compare x and y", pretty = TRUE)
#apply patch
y_patched <- patch_data(y, patch)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.