EVOLUTION-MANAGER
Edit File: extract-Diff-method.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: Subsetting Methods for Diff Objects</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,numeric,missing,missing-method {diffobj}"><tr><td>[,Diff,numeric,missing,missing-method {diffobj}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Subsetting Methods for Diff Objects</h2> <h3>Description</h3> <p>Methods to subset the character representation of the diff output. The subsetting bears no link to the line numbers in the diffs, only to the actual displayed diff. </p> <h3>Usage</h3> <pre> ## S4 method for signature 'Diff,numeric,missing,missing' x[i] ## S4 method for signature 'Diff' head(x, n, ...) ## S4 method for signature 'Diff' tail(x, n, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p><code>Diff</code> object</p> </td></tr> <tr valign="top"><td><code>i</code></td> <td> <p>subsetting index, must be numeric</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>integer(1L), the size for the resulting object</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>unused, for compatibility with generics</p> </td></tr> </table> <h3>Details</h3> <p><code>[</code> only supports numeric indices, and returns without error if you specify out of bound indices. If you apply multiple subsetting methods they will be applied in the following order irrespective of what order you actually specify them in: <code>[</code>, then <code>head</code>, then <code>tail</code>. If you use the same subsetting method multiple times on the same object, the last call will define the outcome. </p> <p>These methods are implemented by storing the chosen indices in the <code>Diff</code> object and using them to subset the <code>as.character</code> output. This mechanism explains the seemingly odd behavior documented above. </p> <h3>Value</h3> <p><code>Diff</code> object with subsetting indices recorded for use by <code>show</code> ## 'pager="off"' for CRAN compliance; you may omit in normal use diff <- diffChr(letters, LETTERS, format="raw", pager="off") diff[5:15] head(diff, 5) tail(diff, 5) head(head(diff, 5), 8) ## note not 'typical' behavior </p> <hr /><div style="text-align: center;">[Package <em>diffobj</em> version 0.3.5 <a href="00Index.html">Index</a>]</div> </body></html>