knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of diffr
is an R package for creating code differences in JavaScript based on:
https://github.com/danvk/codediff.js
library(diffr) file1 = tempfile() writeLines("hello, world!\n", con = file1) file2 = tempfile() writeLines(paste0( "hello world?\nI don't get it\n", paste0(sample(letters, 65, replace = TRUE), collapse = "")), con = file2)
diffr(file1, file2, before = "f1", after = "f2")
knitr::include_graphics("man/img/diffr-example.png")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.