Description Usage Arguments Value Examples
Diffs two sets of lines. It returns a data frame with three variables
left
lines from lines1
right
lines from lines2
diff
symbols: =
lines are identical, |
lines are similar, >
line exists only in lines2
, and <
line exists only in lines1
1 | diffLines(lines1, lines2)
|
lines1 |
character: vector for first set of lines |
lines2 |
character: vector for second set of lines |
a data frame with several variables
left
line number of lines1
, NA
means no line in lines1
lines1
line from lines1
diff
diff symbol
lines2
line from lines2
right
line number of lines2
, NA
means no line in lines2
dist
Levensthein distance between the line from lines1
and lines2
1 2 3 4 5 | old <- c('png("helloworld.png")', 'plot(c(0,1), c(0,1), type="n")',
'text(0.25, 0.25, "Hello World!")', 'dev.off()')
d <- diffLines(readLines(system.file("helloworld.R", package="extpro")), old)
cat("\n", sprintf("%-60s %1s %-60s\n", d$lines1, d$diff, d$lines2))
cat("\n", sprintf("%3.0f %1s %3.0f %3.0f\n", d$left, d$diff, d$right, d$dist))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.