ses: Shortest Edit Script

Description Usage Arguments Details Value Examples

View source: R/core.R

Description

Computes shortest edit script to convert a into b by removing elements from a and adding elements from b. Intended primarily for debugging or for other applications that understand that particular format. See http://www.gnu.org/software/diffutils/manual/diffutils.html#Detailed-Normal for how to interpret the symbols.

Usage

1
ses(a, b, max.diffs = gdo("max.diffs"), warn = gdo("warn"))

Arguments

a

character

b

character

max.diffs

integer(1L), number of differences after which we abandon the O(n^2) diff algorithm in favor of a linear one. Set to -1L to always stick to the original algorithm (defaults to 10000L).

warn

TRUE (default) or FALSE whether to warn if we hit 'max.diffs'.

Details

ses will be much faster than any of the diff* methods, particularly for large inputs with limited numbers of differences.

NAs are treated as the string “NA”. Non-character inputs are coerced to character.

Value

character

Examples

1
ses(letters[1:3], letters[2:4])

diffobj documentation built on June 11, 2018, 1:04 a.m.