Description Usage Arguments Value Examples
Diffs two sets of lines. It returns a data frame with three variables
leftlines from lines1
rightlines from lines2
diffsymbols: = 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
leftline number of lines1, NA means no line in lines1
lines1line from lines1
diffdiff symbol
lines2line from lines2
rightline number of lines2, NA means no line in lines2
distLevensthein 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.