Rev 82611 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/tools/man/Rdiff.Rd% Part of the R package, https://www.R-project.org% Copyright 2010-2022 R Core Team% Distributed under GPL 2 or later\name{Rdiff}\alias{Rdiff}\title{Difference R Output Files}\description{Given two \R output files, compute differences ignoring headers,footers and some other differences.}\usage{Rdiff(from, to, useDiff = FALSE, forEx = FALSE,nullPointers = TRUE, Log = FALSE)}\arguments{\item{from, to}{filepaths to be compared}\item{useDiff}{should \command{diff} be used to compare results?Overridden to false if the command is not available.}\item{forEx}{logical: extra pruning for \file{-Ex.Rout} files toexclude the header.}\item{nullPointers}{logical: should the displayed addresses ofpointers be set to \code{0x00000000} before comparison?}\item{Log}{logical: should the returned value include a log ofdifferences found?}}\details{The \R startup banner and any timing information from \command{R CMDBATCH} are removed from both files, together with lines aboutloading packages. UTF-8 fancy quotes (see \code{\link{sQuote}}) andon Windows, Windows' so-called \sQuote{smart quotes}, are mapped toa simple quote. Addresses of environments, compiled bytecode andother exotic types expressed as hex addresses(e.g., \code{<environment: 0x12345678>}) are mapped to\code{0x00000000}. The files are then compared line-by-line. Ifthere are the same number of lines and \code{useDiff} is false, asimple \command{diff -b} -like display of differences is printed(which ignores trailing spaces and differences in numbers ofconsecutive spaces), otherwise \command{diff -bw} is called on theedited files. (This tries to ignore all differences in whitespace:note that flag \option{-w} is not required by POSIX but is supportedby GNU, Solaris and FreeBSD versions -- macOS uses an old GNU version.)%% Unreliable with 2022-07 gsub changes.%% This can compare uncompressed PDF files, ignoring differences in%% creation and modification dates. However, non-ASCII text may not be%% handled in UTF-8 locales, and it does not check if the PDF files really%% are uncompressed. Using \code{useDiff = TRUE} is likely to be more%% successful if a \command{diff} command is available.There is limited support for comparing PDF files produced by\code{pdf(compress = FALSE)}, mainly for use in \command{make check}-- this requires a \command{diff} command and \code{useDiff = TRUE}.Mainly for use in examples and tests, text from marker\samp{> ## IGNORE_RDIFF_BEGIN} up to (but not including)\samp{> ## IGNORE_RDIFF_END} is ignored.}\value{If \code{Log} is true, a list with components \code{status} (seebelow) and \code{out}, a character vector of descriptions ofdifferences, possibly of zero length.Otherwise, a status indicator (invisibly), \code{0L} if and only if nodifferences were found.}\seealso{The shell script run as \command{R CMD Rdiff}, which uses\code{useDiff = TRUE}.}\keyword{utilities}