EVOLUTION-MANAGER
Edit File: diff_myers.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Diff two character vectors</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for diff_myers {diffobj}"><tr><td>diff_myers {diffobj}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Diff two character vectors</h2> <h3>Description</h3> <p>Implementation of Myer's Diff algorithm with linear space refinement originally implemented by Mike B. Allen as part of <a href="http://www.ioplex.com/~miallen/libmba/">libmba</a> version 0.9.1. This implementation is a heavily modified version of the original C code and is not compatible with the <code>libmba</code> library. The C code is simplified by using fixed size arrays instead of variable ones for tracking the longest reaching paths and for recording the shortest edit scripts. Additionally all error handling and memory allocation calls have been moved to the internal R functions designed to handle those things. A failover result is provided in the case where max diffs allowed is exceeded. Ability to provide custom comparison functions is removed. </p> <h3>Usage</h3> <pre> diff_myers(a, b, max.diffs = -1L, warn = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>a</code></td> <td> <p>character</p> </td></tr> <tr valign="top"><td><code>b</code></td> <td> <p>character</p> </td></tr> <tr valign="top"><td><code>max.diffs</code></td> <td> <p>integer(1L) how many differences before giving up; set to -1 to allow as many as there are up to the maximum allowed (~INT_MAX/4).</p> </td></tr> <tr valign="top"><td><code>warn</code></td> <td> <p>TRUE or FALSE, whether to warn if we hit 'max.diffs'.</p> </td></tr> </table> <h3>Details</h3> <p>The result format indicates operations required to convert <code>a</code> into <code>b</code> in a precursor format to the GNU diff shortest edit script. The operations are “Match” (do nothing), “Insert” (insert one or more values of <code>b</code> into <code>a</code>), and “Delete” (remove one or more values from <code>a</code>). The <code>length</code> slot dictates how many values to advance along, insert into, or delete from <code>a</code>. The <code>offset</code> slot changes meaning depending on the operation. For “Match” and “Delete”, it is the starting index of that operation in <code>a</code>. For “Insert”, it is the starting index in <code>b</code> of the values to insert into <code>a</code>; the index in <code>a</code> to insert at is implicit in previous operations. </p> <h3>Value</h3> <p>MyersMbaSes object </p> <hr /><div style="text-align: center;">[Package <em>diffobj</em> version 0.3.5 <a href="00Index.html">Index</a>]</div> </body></html>