The R Project SVN R

Rev

Rev 68948 | Rev 82585 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
54635 ripley 1
% File src/library/tools/man/Rdiff.Rd
68948 ripley 2
% Part of the R package, https://www.R-project.org
72658 ripley 3
% Copyright 2010-2017 R Core Team
54635 ripley 4
% Distributed under GPL 2 or later
5
 
47761 ripley 6
\name{Rdiff}
56186 murdoch 7
\alias{Rdiff}
50080 murdoch 8
\title{Difference R Output Files}
47761 ripley 9
\description{
10
  Given two \R output files, compute differences ignoring headers,
56350 murdoch 11
  footers and some other differences.
47761 ripley 12
}
13
\usage{
62172 hornik 14
Rdiff(from, to, useDiff = FALSE, forEx = FALSE,
15
      nullPointers = TRUE, Log = FALSE)
47761 ripley 16
}
17
\arguments{
18
  \item{from, to}{filepaths to be compared}
50468 ripley 19
  \item{useDiff}{should \command{diff} always be used to compare
20
    results?}
21
  \item{forEx}{logical: extra pruning for \file{-Ex.Rout} files to
22
    exclude the header.}
57257 ripley 23
  \item{nullPointers}{logical: should the displayed addresses of
61433 ripley 24
    pointers be set to \code{0x00000000} before comparison?}
57257 ripley 25
  \item{Log}{logical: should the returned value include a log of
26
    differences found?}
47761 ripley 27
}
28
\details{
62407 ripley 29
 
57257 ripley 30
  The \R startup banner and any timing information from \command{R CMD
62386 ripley 31
    BATCH} are removed from both files, together with lines about
32
  loading packages.  UTF-8 fancy quotes (see \code{\link{sQuote}}) and
33
  on Windows, Windows' so-called \sQuote{smart quotes}, are mapped to
34
  a simple quote.  Addresses of environments, compiled bytecode and
35
  other exotic types expressed as hex addresses
66444 hornik 36
  (e.g., \code{<environment: 0x12345678>}) are mapped to
62386 ripley 37
  \code{0x00000000}.  The files are then compared line-by-line.  If
38
  there are the same number of lines and \code{useDiff} is false, a
62407 ripley 39
  simple \command{diff -b} -like display of differences is printed
40
  (which ignores trailing spaces and differences in numbers of
41
  consecutive spaces), otherwise \command{diff -bw} is called on the
42
  edited files.  (This tries to ignore all differences in whitespace:
43
  note that flag \option{-w} is not required by POSIX but is supported
44
  by GNU, Solaris and FreeBSD versions.)
56951 ripley 45
 
62386 ripley 46
  This can compare uncompressed PDF files, ignoring differences in
47
  creation and modification dates.
72658 ripley 48
 
49
  Mainly for use in examples, text from marker
50
  \samp{> ## IGNORE_RDIFF_BEGIN} up to (but not including)
51
  \samp{> ## IGNORE_RDIFF_END} is ignored.
47761 ripley 52
}
53
\value{
54626 ripley 54
  If \code{Log} is true, a list with components \code{status} (see
55
  below) and \code{out}, a character vector of descriptions of
56
  differences, possibly of zero length.
57
 
58
  Otherwise, a status indicator, \code{0L} if and only if no differences
59
  were found.
47761 ripley 60
}
61
 
62
\seealso{
63
  The shell script run as \command{R CMD Rdiff}.
64
}
65
 
66
\keyword{utilities}
67