-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME.Rmd
50 lines (34 loc) · 1.11 KB
/
README.Rmd
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# diffr
<!-- badges: start -->
[](https://github.com/muschellij2/diffr/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The goal of `diffr` is an R package for creating code differences in JavaScript based on:
https://github.com/danvk/codediff.js
[](https://travis-ci.org/muschellij2/diffr)
```{r}
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)
```
```{r eval = FALSE}
diffr(file1, file2, before = "f1", after = "f2")
```
```{r, echo = FALSE}
knitr::include_graphics("man/img/diffr-example.png")
```