1% Generated by roxygen2: do not edit by hand 2% Please edit documentation in R/subset.R 3\name{[,Diff,numeric,missing,missing-method} 4\alias{[,Diff,numeric,missing,missing-method} 5\alias{head,Diff-method} 6\alias{tail,Diff-method} 7\title{Subsetting Methods for Diff Objects} 8\usage{ 9\S4method{[}{Diff,numeric,missing,missing}(x, i) 10 11\S4method{head}{Diff}(x, n, ...) 12 13\S4method{tail}{Diff}(x, n, ...) 14} 15\arguments{ 16\item{x}{\code{Diff} object} 17 18\item{i}{subsetting index, must be numeric} 19 20\item{n}{integer(1L), the size for the resulting object} 21 22\item{...}{unused, for compatibility with generics} 23} 24\value{ 25\code{Diff} object with subsetting indices recorded for use by 26 \code{show} 27## `pager="off"` for CRAN compliance; you may omit in normal use 28diff <- diffChr(letters, LETTERS, format="raw", pager="off") 29diff[5:15] 30head(diff, 5) 31tail(diff, 5) 32head(head(diff, 5), 8) ## note not 'typical' behavior 33} 34\description{ 35Methods to subset the character representation of the diff output. The 36subsetting bears no link to the line numbers in the diffs, only to the actual 37displayed diff. 38} 39\details{ 40\code{[} only supports numeric indices, and returns without error if you 41specify out of bound indices. If you apply multiple subsetting methods they 42will be applied in the following order irrespective of what order you 43actually specify them in: \code{[}, then \code{head}, then \code{tail}. 44If you use the same subsetting method multiple times on the same object, 45the last call will define the outcome. 46 47These methods are implemented by storing the chosen indices in the 48\code{Diff} object and using them to subset the \code{as.character} output. 49This mechanism explains the seemingly odd behavior documented above. 50} 51