Abstract
The ‘R Changes: 2.9.1-2.10.0 Patched’ article from the 2009-2 issue.The PCRE library has been updated to version 8.00.
R CMD INSTALL has new options –no-R,
–no-libs, –no-data, –no-help,
–no-demo, –no-exec, and –no-inst
to suppress installation of the specified part of the package. These are
intended for special purposes (e.g. building a database of help pages
without fully installing all packages).
The documented line-length limit of 4095 bytes when reading from
the console now also applies also to parse(file="") (which
previously had a limit of around 1024 bytes).
A Bioconductor mirror can be set for use by
setRepositories() via the option
"BioC_mirror", e.g. the European mirror can be selected by
options(BioC_mirror="http://bioconductor.
statistik.tu-dortmund.de")
Double-clicking in a tk_select.list() list box now
selects the item and closes the list box (as happens on the Windows
select.list() widget).
configure will be able to find a usable libtiff in some rare circumstances where it did not previously (where libtiff needed to be linked explicitly against -ljpeg).
Making refman.pdf works around a problem with the
indexing with hyperref 6.79d and later.
extended argument is deprecated in
strsplit(), grep(), grepl(),
sub(), gsub(), regexpr() and
gregexpr() (not just the value
extended = FALSE) and will be removed in R 2.11.0.trigamma(x) and other psigamma(x, n)
calls are now accurate for very large abs(x).
(PR#14020)
[g]sub(perl=FALSE, fixed=FALSE) could use excessive
stack space when used with a very long vector containing some non-ASCII
strings.
The default method of weighted.mean(na.rm = TRUE)
did not omit weights for NA observations in 2.10.0.
(PR#14032)
[g]regexpr(pattern, fixed = TRUE) returned match
positions in bytes (not characters) in an MBCS locale if
pattern was a single byte.
[g]sub(fixed = TRUE) with a single-byte pattern could
conceivably have matched part of a multibyte character in a non-UTF-8
MBCS.
findLineNum() and setBreakpoint() would
sometimes fail if the specified file was not in the current
directory.
Package tcltk’s demo(tkdensity) was broken in 2.9.0
when demo() was changed to set
par(ask = TRUE).
gsub() with backrefs could fail on extremely long
strings (hundreds of thousands of characters) due to integer overflow in
a length calculation.
abline(*, untf=TRUE) now uses a better x-grid in
log-scale, e.g., for plot(c(1,300), c(1,300),
log="xy") ; abline(4,1, untf=TRUE).
detach/unloadNamespace() arrange to flush the
package’s lazyload cache of R objects once the package/namespace is no
longer needed.
There have been small fixes to the rendering of help, e.g.
\command is now rendered verbatim (so e.g. –
is not interpreted, PR#14045).
Also, there are many small changes to help files where the new converters were not rendering them in the same way as before.
available.packages() would fail when run on a
repository with no packages meeting the filtering conditions.
(PR#14042)
rep(x, times, each = 2) gave invalid results when
the times argument is a vector longer than x.
Reported by Bill Dunlap.
An error when unloadNamespace() attempted to run the
.onUnload() function gave an error in the reporting
function and so was not reported properly.
Text help rendering did not handle very long input lines properly.
promptMethods() generated signature documentation
improperly.
pgamma(x, a, lower.tail=FALSE) and
qgamma(..) are now considerably more accurate in some
regions for very small a. qgamma() now
correctly returns 0 instead of NaN in similar extreme cases, and
qgamma() no longer warns in the case of small
a, see (PR#12324).
unname() now also removes names from a zero length
vector.
Printing results from ls.str() no longer evaluates
unevaluated calls.
complete.cases() failed on a 0-column data frame
argument. (Underlies PR#14066.)
It could return nonsensical results if no input determined the number of cases (seen in the no-segfault tests).
An error in nls() with a long formula could cause a
segfault. (PR#14059)
qchisq(p, df, ncp, lower.tail = FALSE) with
ncp >= 80 was inaccurate for small p (as the help page
said): it is now less inaccurate. (In part, PR#13999.)
For ncp less than but close to 80, pchisq() and
qchisq() are more accurate for probablilities very close to
1 (a series expansion was truncated slightly too early).
pchisq(x, df, ncp) can no longer return values just
larger than one for large values of ncp.
intToUtf8() could fail when asked to produce 10Mb or
more strings, something it was never intended to do: unfortunately
Windows crashed R (other OSes reported a lack of resources).
(PR#14068)
chisq.test() could fail when given argument
x or y which deparsed to more than one line.
(Reported by Laurent Gauthier.)
S4 methods are uncached whenever the name space containing them
is unloaded (by unloadNamespace() as well as by
detach(unload = TRUE)).
The internal record-keeping by dyn.load
/dyn.unload was incomplete, which could crash R if a DLL
that registered .External routines had earlier been unloaded.
bessel[JY](x, nu) with nu a negative integer (a
singular case) is now correct, analogously to besselI(),
see PR#13556, below.
tools::file_path_as_absolute() doubled the file
separator when applied to a file such as /vmunix or (on
Windows) d:/afile in a directory for which
getwd() would return a path with a trailing separator
(largely cosmetic, as reasonable file systems handle such a path
correctly). (Perhaps what was meant by PR#14078.)
unsplit(drop = TRUE) applied to a data frame failed
to pass drop to the computation of row names.
(PR#14084)
The "difftime" method of mean() ignored
its na.rm argument.
tcltk::tk_select.list() is now more likely to remove
the widget immediately after selection is complete.
Adding/subtracting a "difftime" object to/from a
"POSIXt" or "Date" object works again (it was
broken by the addition of Ops.difftime).
Conversion to latex of an Rd file with no aliases
failed.
wilcox.test(*, conf.int = TRUE) has
achieved.level corrected and, for
exact = FALSE, now gives an “estimate” which does not
depend on the alternative used.
help.search() failed when the package argument was
specified. (PR#14113)
configure will be able to find a usable libtiff in some rare circumstances where it did not previously (where libtiff needed to be linked explicitly against -ljpeg).
cairo >= 1.2 is now required (1.2.0 was released in July 2006) for cairo-based graphics devices (which remain optional).
A suitable iconv() is now required: support for
configure option –without-iconv has been withdrawn (it was
deprecated in R 2.5.0).
Perl is no longer “essential”. R can be built without it, but
scripts R CMD build, check, Rprof
and Sd2d require it.
A system function is now essential (a working
Sys.glob() has been assumed since R 2.9.0 at
least).
C99 support for MBCS is now required, and configure option
–disable-mbcs has been withdrawn.
Having a version of tar capable of automagically detecting
compressed archives is useful for utils::untar(), and so
gtar (a common name for GNU tar) is preferred to tar: set environment
variable TAR to specify a particular tar
command.
extended argument is deprecated in
strsplit(), grep(), grepl(),
sub(), gsub(), regexpr() and
gregexpr() (not just the value
extended = FALSE) and will be removed in R 2.11.0.Package help is now converted from Rd by the R-based converters that were first introduced in 2.9.0. This means
- Packages that were installed by R-devel after 2009-08-09 should not be used with earlier versions of R, and most aspects of package help (including the runnable examples) will be missing if they are so used.
- Text, HTML and latex help and examples for packages installed under
the new system are converted on-demand from stored parsed
Rd files. (Conversions stored in packages installed under R
< 2.10.0 are used if no parsed Rd files are found. It is
recommended that such packages be re-installed.)
HTML help is now generated dynamically using an HTTP server running in the R process and listening on the loopback interface.
- Those worried about security implications of such a server can
disable it by setting the environment variable
R_DISABLE_HTTPD to a non-empty value. This disables
help.start() and HTML help (so text help is shown
instead).
- The Java/Javascript search engine has been replaced by an HTML
interface to help.search(). help.start() no
longer has an argument searchEngine as it is no longer
needed.
- The HTML help can now locate cross-references of the form
\link[pkg]{foo} and \link[pkg:foo]{bar} where
foo is an alias in the package, rather than the documented
(basename of a) filename (since the documentation has been much
ignored).
polygon(), pdf() and
postscript() now have a parameter fillOddEven
(default FALSE), which controls the mode used for polygon
fills of self-intersecting shapes.
New debugonce() function; further,
getOption("deparse.max.lines") is now observed when
debugging, from a code suggestion by John Brzustowski.
(PR#13647/8)
plot() methods for "stepfun" and hence
"ecdf" no longer plot points by default for n \(>=\) 1000.
{[g]sub(*, perl=TRUE)} now also supports
'\E' in order to *end* \U and \L
case changes, thanks to a patch from Bill Dunlap.
factor(), ‘levels<-‘(), etc, now
ensure that the resulting factor levels are unique (as was always the
implied intention). Factors with duplicated levels are still
constructible by low-level means, but are now declared illegal.
New print() (S3) method for class "function", also
used for auto-printing. Further, .Primitive functions now print and
auto-print identically. The new method is based on code suggestions by
Romain François.
The print() and toLatex() methods for
class "sessionInfo" now show the locale in a nicer format and have
arguments to suppress locale information.
In addition to previously only round(), there are
other ‘Math’ group (S3) methods for "difftime", such as
floor(), signif(), abs(),
etc.
For completeness, old.packages() and
available.packages() allow type to be
specified (you could always specify available or
contriburl).
available.packages() by default only returns
information on the latest versions of packages whose version
requirements are satisified by the currently running R.
tools::write_PACKAGES() has a new argument
latestOnly, which defaults to TRUE when only
the latest versions in the repository will be listed in the
index.
getOption() has a new argument default
that is returned if the specified option is not set. This simplifies
querying a value and checking whether it is NULL or
not.
parse() now warns if the requested encoding is not
supported.
The "table" method of as.data.frame()
gains a stringsAsFactors argument to allow the classifying
factors to be returned as character vectors rather than the default
factor type.
If model.frame.default() encounters a character
variable where xlev indicates a factor, it now converts the
variable to a factor (with a warning).
curve() now returns a list containing the points
that were drawn.
spineplot() now accepts axes = FALSE,
for consistency with other functions called by
plot.factor().
The Kendall and Spearman methods of cor.test() can
optionally use continuity correction when not computing exact p-values.
(The Kendall case is the wish of PR#13691.)
R now keeps track of line numbers during execution for code
sourced with options(keep.source = TRUE). The source
reference is displayed by debugging functions such as
traceback(), browser(),
recover(), and dump.frames(), and is stored as
an attribute on each element returned by sys.calls(). \[Experimental\]
More functions now have an implicit (S4) generic definition.
quantile.default() now disallows factors (wish of
PR#13631) and its help documents what numeric-like properties its input
need to have to work correctly.
weighted.mean() is now generic and has
"Date", "POSIXct" and "POSIXlt"
methods.
Naming subscripts (e.g. x[i=1, j=2]) in
"data.frame" methods for [ and [[
now gives a warning. (Names are ignored in the default method, but could
have odd semantics for other methods, and do for the
"data.frame" ones.)
as.data.frame() has an "aovproj"
method. (Wish of PR#13505)
as.character(x) for numeric x no longer produces
strings such as "0.30", i.e., with trailing zeros. This
change also renders levels construction in factor() more
consistent.
codocClasses(), which checks consistency of the
documentation of S4 class slots, now does so in considerably more cases.
The documentation of inherited slots (from superclasses) is now
optional. This affects R CMD check <pkg> when the
package defines S4 classes.
codoc() now also checks S4 methods for
code/documentation mismatches.
for(), while(), and
repeat() loops now always return NULL as their
(invisible) value. This change was needed to address a reference
counting bug without creating performance penalties for some common use
cases.
The print() method for ls.str() results
now obeys an optional digits argument.
The method argument of glm() now allows
user-contributed methods.
More general reorder.default() replaces
functionality of reorder.factor() and
reorder.character().
The function aspell() has been added to provide an
interface to the Aspell spell-checker.
Filters RdTextFilter() and
SweaveTeXFilter() have been added to the tools package to
provide support for aspell() or other spell
checkers.
xtabs() with the new option
sparse = TRUE now returns a sparse Matrix, using package
Matrix.
contr.sum() etc gain an argument sparse
which allows sparse matrices to be returned.
contrasts() also gains a sparse argument
which it passes to the actual contrast function if that has a formal
argument sparse.
contrasts(f, .) <- val now also works when
val is a sparse Matrix. It is planned that
model.matrix() will work with such factors f
in the future.
readNEWS() will recognize a UTF-8 byte-order mark
(BOM) in the NEWS file. However, it is safer to use only
ASCII code there because not all editors recognize BOMs.
New utility function inheritedSlotNames() for S4
class programming.
tabulate() now allows NAs to pass
through (and be ignored).
If debug() is called on an S3 generic function then
all methods are debugged as well.
Outlier symbols drawn by boxplot() now obey the
outlwd argument. Reported by Jurgen Kluge.
svd(x) and eigen(x) now behave
analogously to qr(x) in accepting logical matrices
x.
File NEWS is now in UTF-8, and has a BOM (often
invisible) on the first line, and Emacs local variables set for UTF-8 at
the end. RShowDoc("NEWS") should display this correctly,
given suitable fonts.
terms.formula(simplify = TRUE) now does not deparse
the LHS and so preserves non-standard responses such as
‘a: b‘ (requested by Sundar Dorai-Raj).
New function news() for building and querying R or
package news information.
z^n for integer n and complex z is more accurate now
if \(|n| <= 65536\).
factor(NULL) now returns the same as
factor(character(0)) instead of an error, and
table(NULL) consequently does analogously.
as.data.frame.vector() (and its copies) is slightly
faster by avoiding a copy if there are no names (following a suggestion
of Tim Hesterberg).
writeLines(), writeBin() and
writeChar() have a new argument useBytes. If
false, character strings with marked encodings are translated to the
current locale (as before) but if true they are written
byte-by-byte.
iconv() has a new argument mark which
can be used (by experts) to suppress the declaration of
encodings.
DESCRIPTION ‘LinkingTo’ specs are now recognized as
installation dependencies, and included in package management
computations.
Standardized DESCRIPTION ‘License’ specs are now
available for package management computations.
"\uxxxx" and "\Uxxxxxxxx" escapes can
now be parsed to a UTF-8 encoded string even in non-UTF-8 locales (this
has been implemented on Windows since R 2.7.0). The semantics have been
changed slightly: a string containing such escapes is always stored in
UTF-8 (and hence is suitable for portably including Unicode text in
packages).
New as.raw() method for "tclObj"
objects (wish of PR#13578).
Rd.sty now makes a better job of setting email
addresses, including using a monospaced font.
textConnection() gains an encoding
argument to determine how input strings with marked encodings will be
handled.
R CMD Rd2pdf is available as a shortcut for
R CMD Rd2dvi –pdf.
R CMD check now checks links where a package is
specified (\link[pkg]{file} or
\link[pkg:file]{topic}), if the package is available. It
notes if the package is not available, as in many cases this is an error
in the link.
identical() gains three logical arguments, which
allow for even more differentiation, notably -0 and
0.
legend() now can specify the border
color of filled boxes, thanks to a patch from Frederic Schutz.
Indexing with a vector index to [[]] has now been
extended to all recursive types.
Pairlists may now be assigned as elements of lists. (Lists could
always be created with pairlist elements, but [[<-
didn’t support assigning them.)
The parser now supports C-preprocessor-like #line
directives, so error messages and source references may refer to the
original file rather than an intermediate one.
New functions findLineNum() and
setBreakpoint() work with the source references to find the
location of source lines and set breakpoints (using
trace()) at those lines.
Namespace importing is more careful about warning on masked generics, thanks to a patch by Yohan Chalabi.
detach() now has an argument
character.only with the same meaning as for
library() or require().
available.packages() gains a filters
argument for specifying the filtering operations performed on the
packages found in the repositories. A new built-in
license/FOSS filter only retains packages for which
installation can proceed solely based on packages which can be verified
as Free or Open Source Software (FOSS) employing the available license
specifications.
In registering an S3 class by a call to
setOldClass(), the data part (e.g., the object type)
required for the class can be included as one of the superclasses in the
Classes argument.
The argument f to showMethods() can be
an expression evaluating to a generic function, allowing methods to be
shown for non-exported generics and other nonstandard cases.
sprintf() now supports %o for octal
conversions.
New function Sys.readlink() for information about
symbolic links, including if a file is a symbolic link.
Package tools has new functions
checkRdaFiles() and resaveRdaFiles() to report
on the format of .rda/.RData data files, and
to re-save them in a different compressed format, including choosing the
most compact format available.
A new INSTALL option, –resave-data, makes
use of this.
File ~/.R/config is used in preference to
~/.Rconfig, and these are now documented in ‘R Installation
and Administration’.
Logic operations with complex numbers now work, as they were always documented to, and as in S.
arrows() and segments() allow one of
x1 or y1 to be omitted to simplify the
specification of vertical or horizontal lines (suggestion of Tim
Hesterberg).
approxfun() is faster by avoiding repeated
NA checks (diagnosis and patch by Karline Soetaert &
Thomas Petzoldt).
There are the beginnings of a Nynorsk translation by Karl Ove Hufthammer.
stripchart() allows par bg to be passed
in for the background colour for pch = 21 (wish of
PR#13984).
New generic function .DollarNames() to enable class
authors to customize completion after the $ extractor.
load(), save(), dput() and
dump() now open a not-yet-open connection in the
appropriate mode (as other functions using connections directly already
did).
A different regular expression engine is used for basic and extended regexps and is also for approximate matching. This is based on the TRE library of Ville Laurikari, a modifed copy of which is included in the R sources.
This is often faster, especially in a MBCS locale.
Some known differences are that it is less tolerant of invalid inputs
in MBCS locales, and in its interpretation of undefined (extended)
regexps such as "^*". Also, the interpretation of ranges
such as \[W-z\] in caseless matching
is no longer to map the range to lower case.
This engine may in future be used in ‘literal’ mode for
fixed = TRUE, and there is a compile-time option in
src/main/grep.c to do so.
The use of repeated boundary regexps in gsub() and
gregexpr() as warned about in the help page does not work
in this engine (it did in the previous one since 2005).
Extended (and basic) regexps now support same set of options as
for fixed = TRUE and perl = TRUE, including
useBytes and support for UTF-8-encoded strings in non-UTF-8
locales.
agrep() now has full support for MBCS locales with a
modest speed penalty. This enables help.search() to use
approximate matching character-wise rather than byte-wise.
[g]sub use a single-pass algorithm instead of
matching twice and so is usually faster.
The perl = TRUE versions now work correctly in a
non-UTF-8 MBCS locale, by translating the inputs to UTF-8.
useBytes = TRUE now inhibits the translation of
inputs with marked encodings.
strsplit() gains a useBytes
argument.
The algorithm used by strsplit() has been reordered
to batch by elements of split: this can be much faster for
fixed = FALSE (as multiple compilation of regexps is
avoided).
The help pages, including ?regexp, have been updated
and should be consulted for details of the new implementations.
Rd file changesA new dynamic HTML help system is used by default, and may be
controlled using tools::startDynamicHelp(). With this
enabled, HTML help pages will be generated on request, resolving links
by searching through the current .libPaths(). The user may
set options("help.ports") to control which IP port is used
by the server.
help.start() no longer sets
options(htmlhelp = TRUE) (it used to on Unix but not on
Windows). Nor does it on Unix reset the "browser" option if
given an argument of that name.
Arguments update and remote are now
available on all platforms: the default is update = FALSE
since the http server will update the package index at first
use.
help() has a new argument help_type
(with default set by the option of that name) to supersede
offline, htmlhelp and chmhelp
(although for now they still work if help_type is unset).
There is a new type, "PDF" to allow offline PDF (rather
than PostScript).
A function offline_help_helper() will be used if this
exists in the workspace or further down the search path, otherwise the
function of that name in the ‘utils’ name space is used.
Plain text help is now used as the fallback for HTML help (as it always was for Compiled HTML help on Windows).
It is possible to ask for static HTML pages to be prebuilt via
the configure option –enable-prebuilt-html. This may be
useful for those who wish to make HTML help available outside R, e.g. on
a local web site.
An experimental tag \Sexpr has been added to
Rd files, to evaluate expressions at build, install, or
render time. Currently install time and render time evaluation are
supported.
Tags \if, \ifelse and \out
have been added to allow format-specific (or more general, using
\Sexpr) conditional text in man pages.
The parse_Rd() parser has been made more tolerant of
coding errors in Rd files: now all syntax errors are
reported as warnings, and an attempt is made to continue
parsing.
parse_Rd() now has an argument fragment
(default FALSE) to accept small fragments of
Rd files (so that \Sexpr can output Rd code
which is then parsed).
parse_Rd() now always converts its input to UTF-8.
The Rd2* rendering functions have a new parameter,
outputEncoding, which controls how their output is
encoded.
parse_Rd() no longer includes the newline as part of
a "%"-style comment.
There have been various bug fixes and code reorganization in the Rd renderers Rd2HTML, Rd2latex, Rd2txt, and Rd2ex.
All example files are now created with either ASCII or UTF-8 encoding, and the encoding is only marked in the file if there is any non-UTF-8 code (previously it was marked if the help file had non-ASCII contents, possibly in other sections).
print.Rd() now adds necessary escape characters so
that printing and re-parsing an Rd object should produce an equivalent
object.
parse_Rd() was incorrectly handling multiple
backslashes in R code strings, converting 4n+3 backslashes to 2n+1
instead of 2n+2.
parse_Rd() now recognizes the tag within a quoted
string in R-like text.
parse_Rd() now treats the argument of
as LaTeX-like, rather than verbatim.
New function untar() to list or unpack tar archives,
possibly compressed. This uses either an external tar
command or an internal implementation.
New function tar() to create (possibly compressed)
tar archives.
New functions memCompress() and
memDecompress() for in-memory compression and
decompression.
bzfile() has a compress argument to
select the amount of effort put into compression when writing.
New function xzfile() for use with xz-compressed
files. (This can also read files compressed by some versions of
‘lzma’.)
gzfile() looks at the file header and so can now
also read bzip2-ed files and xz-compressed files.
There are the new options of
save(compress = "bzip2") and "xz" to use bzip2 or xz
compression (which will be slower, but can give substantially smaller
files). Argument compression_level gives finer control over the
space/time tradeoffs.
load() can read such saves (but only as from this
version of R).
R CMD INSTALL/check and writePACKAGES
(tools) accept a wider range of compressed tar archives.
Precisely how wide depends on the capabilities of the host system’s
tar command: they almost always include
.tar.bz2 archives, and with modern versions of tar other
forms of compression such as lzma and xz, and arbitrary
extensions.
R CMD INSTALL has a new option
–data-compress to control the compression used when
lazy-loading data. New possibilities are
–data-compress=bzip2 which will give ca 15% better
compression at the expense of slower installation times, and
–data-compress=xz, often giving even better compression on
large datasets at the expense of much longer installation times. (The
latter is used for the recommended packages: it is particularly
effective for survival.)
file() for open = "", "r"
or "rt" will automagically detect compressed files (from
gzip, bzip2 or xz). This means that compressed files can be specified by
file name (rather than via a gzfile() connection) to
read.table(), readlines(), scan()
and so on.
data() can handle compressed text files with
extensions .{txt,tab,csv}.{gz,bz2,xz} .
png(type="cairo1") is defunct: the value is no
longer recognized.
tools::Rd_parse() is defunct (as this version of R
uses only Rd version 2).
Use of ~/.Rconf (which was deprecated in favour of
~/.Rconfig in 2004) has finally been removed.
Bundles of packages are deprecated. See ‘Writing R Extensions’ for the steps needed to unbundle a bundle.
help() arguments offline,
htmlhelp and chmhelp are deprecated in favour
of help_type.
clearNames() (stats) is deprecated for
unname().
Basic regular expressions (extended = FALSE) are
deprecated in strsplit, grep and friends. There is a precise POSIX
standard for them, but it is not what recent RE engines implement, and
it seems that in almost all cases package authors intended
fixed = TRUE when using
extended = FALSE.
methods::trySilent() is deprecated for
try(*, silent=TRUE) or - more efficiently and flexibly -
something like tryCatch(*, error = function(e) e).
index.search() is deprecated: there are no longer
directories of types other than ‘help’.
There is some makefile support for adding/updating translations
in packages: see po/README and ‘Writing R Extensions’.
There is support for the use of ‘dngettext’ for C-level translations in packages: see ‘Writing R Extensions’.
trigamma(x) and other psigamma(x, n)
calls are now accurate for very large abs(x).
(PR#14020)
[g]sub() could use excessive stack space when used
with a very long vector of non-ASCII data.
The default method of weighted.mean(na.rm = TRUE)
did not omit weights for NA observations in 2.10.0.
(PR#14032)
Assigning an extra 0-length column to a data frame by
DF[, "foo"] <- value now works in most cases (by filling
with NAs) or fails. (It used to give a corrupt data
frame.)
validObject() avoids an error during evaluation in
the case of various incorrect slot definitions.
n:m now returns a result of type "integer" in a few
more boundary cases.
The zap.ind argument to printCoefmat()
did not usually work as other code attempted to ensure that non-zero
values had a non-zero representation.
printCoefmat() formatted groups of columns together,
not just the cs.ind group but also the zap.ind
group and a residual group. It now formats all columns except the cs.ind
group separately (and zaps the zap.ind group
column-by-column). The main effect will be see in the output from
print.anova, as this grouped SS-like columns in the zap.ind
group.
R_ReplDLLinit() initializes the top-level jump so
that some embedded applications on Windows no longer crash on
error.
identical() failed to take the encoding of character
strings into account, so identical byte patterns are not necessarily
identical strings, and similarly Latin-1 and UTF-8 versions of the same
string differ in byte pattern.
methods(f) used to warn unnecessarily for an S4
generic f which had been created based on an existing S3
generic.
The check for consistent ordering of superclasses was not ignoring all conditional relations (the symptom was usually spurious warnings for classes extending "array").
Trying to assign into a raw vector with an index vector
containing NAs could cause a segfault. Reported by Hervé
Pagès.
Rscript could segfault if (by user error) its filename argument was missing. Reported by Martin Morgan.
getAnywhere() (and functions that use it, including
argument completion in the console) did not handle special built-in
functions. Reported by Romain François.
order() was missing a PROTECT() call
and so could segfault when called on character data under certain (rare)
circumstances involving marked non-native encodings.
prettyNum(z, drop0trailing=TRUE) did not work
correctly when z was a complex vector. Consequently,
str(z, ...) also did not. (PR#13985)
make distclean removed too many files in etc/ if
builddir = srcdir.
R CMD replaced TEXINPUTS rather than
appending to it (as documented and intended).
help.start() no longer fails on unix when "browser"
is a function.
pbeta(x, *, log.p = TRUE) is sometimes more
accurate, e.g., for very small x.
Unserializing a pre-2.8 workspace containing pure ASCII character objects with a LATIN1 or UTF-8 encoding would corrupt the CHARSXP cache.
Sys.setlocale() to change the LC_COLLATE setting is more
likely to change the collation provided by ICU.Names of datasets could clash with temporary filenames used when running examples, causing errors.
as.complex() sometimes warned about NAs
on coercions and sometimes not (when the C function asComplex was used,
e.g. on list elements). (PR#13942)
cat() on an unopened connection could close it
twice, and file() connections segfaulted on some
systems.
Printing a list could segfault if the elements are nested too deeply.
install.packages(NULL) now lists packages only once
even if they occur in more than one repository (as the latest compatible
version of those available will always be downloaded).
approxfun() and approx() now accept a
rule of length two, for easy specification of different
interpolation rules on left and right.
They no longer segfault for invalid zero-length specification of
yleft, yright, or f.
seq_along(x) is now equivalent to
seq_len(length(x)) even where length() has an
S3/S4 method; previously it (intentionally) always used the default
method for length().
PCRE has been updated to version 7.9 (for bug fixes).
agrep() uses 64-bit ints where available on 32-bit
platforms and so may do a better job with complex matches. (E.g.
PR#13789, which failed only on 32-bit systems.)
R CMD Rd2txt is deprecated, and will be removed in
2.10.0. (It is just a wrapper for
R CMD Rdconv -t txt.)
tools::Rd_parse() is deprecated and will be removed
in 2.10.0 (which will use only Rd version 2).
parse_Rd() still did not handle source reference
encodings properly.
The C utility function PrintValue no longer attempts to print attributes for CHARSXPs as those attributes are used internally for the CHARSXP cache. This fixes a segfault when calling it on a CHARSXP from C code.
PDF graphics output was producing two instances of anything drawn with the symbol font face. (Report from Baptiste Auguié.)
length(x) <- newval and grep() could
cause memory corruption. (PR#13837)
If model.matrix() was given too large a model, it
could crash R. (PR#13838, fix found by Olaf Mersmann.)
gzcon() (used by load()) would re-open
an open connection, leaking a file descriptor each time.
(PR#13841)
The checks for inconsistent inheritance reported by
setClass() now detect inconsistent superclasses and give
better warning messages.
print.anova() failed to recognize the column
labelled P(>|Chi|) from a Poisson/binomial GLM anova as
a p-value column in order to format it appropriately (and as a
consequence it gave no significance stars).
A missing PROTECT caused rare segfaults during calls to
load(). (PR#13880, fix found by Bill Dunlap.)
gsub() in a non-UTF-8 locale with a marked UTF-8
input could in rare circumstances overrun a buffer and so
segfault.
R CMD Rdconv –version was not working
correctly.
Missing PROTECTs in nlm() caused "random" errors.
(PR#13381 by Adam D.I. Kramer, analysis and suggested fix by Bill
Dunlap.)
Some extreme cases of pbeta(log.p = TRUE) are more
accurate (finite values < -700 rather than -Inf). (PR#13786)
pbeta() now reports on more cases where the asymptotic
expansions lose accuracy (the underlying TOMS708 C code was ignoring
some of these, including the PR#13786 example).
new.env(hash = TRUE, size = NA) now works the way it
has been documented to for a long time.
tcltk::tk_choose.files(multi = TRUE) produces
better-formatted output with filenames containing spaces.
(PR#13875)
R CMD check –use-valgrind did not run valgrind on
the package tests.
The tclvalue() and the print() and
as.xxx methods for class "tclObj" crashed R
with an invalid object – seen with an object saved from an earlier
session.
R CMD BATCH garbled options -d
<debugger> (useful for valgrind, although
–debugger=valgrind always worked)
INSTALL with LazyData and Encoding declared in
DESCRIPTION might have left
options("encoding") set for the rest of the package
installation.
New function anyDuplicated(x) returns 0
(= FALSE) or the index of the first duplicated entry of
x.
matplot(), matlines() and
matpoints() now also obey a lend argument,
determining line end styles. (Wish of PR#13619).
bw.SJ(), bw.bcv() and
bw.ucv() now gain an optional tol argument
allowing more accurate estimates.
new.packages() no longer regards packages with the
same name as a member of an installed bundle as ‘new’ (this is now
consistent with the dependency checks in
install.packages()).
It no longer reports on partially installed bundles (since members can be updated individually if a bundle is unbundled).
old.packages() and hence
updates.packages() will look for updates to members of
package bundles before updates to the whole bundle: this allow bundles
to be split and installations updated.
nlminb() gives better non-convergence messages in
some cases.
S3 method dispatch will support S4 class inheritance for S3
methods, for primitives and via UseMethod(), if the
argument S3methods=TRUE is given to
setClass(). S4 method dispatch will use S3 per-object
inheritance if S3Class() is set on the object. See
?Methods and the paper referenced there.
R CMD INSTALL is more tolerant of (malformed)
packages with a ‘man’ directory but no validly named .Rd
files.
R CMD check now reports where options are used that
cause some of the checks to be skipped.
RSiteSearch has been updated to be consistent with
the new layout of the search site itself, which now includes separate
options for vignettes, views, and r-sig-mixed-models, as well as changed
names for r-help. (Contributed by Jonathan Baron.)
That R CMD check makes use of a
<pkg>/tests/Examples/<pkg>-Ex.Rout.save file as
a reference result is now documented in ‘Writing R Extensions’.
print.atomic() (defunct since 1.9.0) has been
removed since it caused confusion for an S4 class union
"atomic".
png(type="cairo1") is deprecated – it was only
needed for platforms with 1.0 \(<=\)
cairo \(<\) 1.2.
The ... argument was not handled properly when
... was found in the enclosure of the current function,
rather than in the function header itself. (This caused
integrate() to fail in certain cases.)
interaction() now ensures that the levels of the
result are unique.
packageDescription() and hence
sessionInfo() now report the correct package version also
for a non-attached loaded namespace of a version different from the
default lib.loc.
smoothScatter() now also works when
e.g. xlim[2] < xlim[1].
parse_Rd() would mishandle braces when they occurred
at the start of a line within an R string in an Rd file
(reported by Alex Couture-Beil) or when they occurred in an R comment
(reported by Mark Bravington).
readNEWS() missed version numbers with more than one
digit.
building R –without-x no longer fails
(PR#13665)
printCoefmat(cbind(0,1)) now works too
(PR#13677)
bw.SJ(c(1:99, 1e6)) now works too.
Rd2txt() could not handle empty descriptions of
items in an Rd file (reported by Mark Bravington), and did
not wrap long lists of arguments if they were given in a single
item.
stars() would do a partial plot when called with
plot = FALSE; it now consistently returns the locations of
the stars.
Rd2latex() could not handle empty sections.
old.packages() and hence
update.packages() would fail on a repository which
contained only one package but with multiple versions of that
package.
as.character.Rd() added extra braces when displaying
two-argument macros. (Report and fix by Manuel Eugster.)
unsplit() was misbehaving in the case of
single-column data frames. (Reported by Will Gray.)
as(I(1), "vector") and similar coercions from
objects of "unregistered" S3 classes now work.
srcref records produced by parse() and
parse_Rd() did not record the encoding of the source file.
(Reported by Romain François.)
The X11 version of View() was misbehaving in MBCS
locales, and PgUp/PgDn now behave better, thanks to a patch from Ei-ji
Nakama.
R CMD check looked at the environment variable
PDFLATEX, but as from R 2.8.1 R CMD Rd2dvi
used R_PDFLATEXCMD in preference, and that was set by
R CMD (and not PDFLATEX). Now
R CMD check looks at R_PDFLATEXCMD.
The new (in 2.9.0) stringsAsFactors argument to
expand.grid() was not working: it now does work but has
default TRUE for backwards compatibility.
tcrossprod(<1d-array>, <matrix>) now
does work when the arguments are of compatible dimensions.
qbinom() now is accurate also in (large size, small
prob) cases. (PR#13711)
The calculation of the Spearman p-value in
cor.test() is slightly more accurate in some cases.
(PR#13574)
The digamma(), trigamma() and
psigamma() functions could be inaccurate for values of x
around 1e-15 due to cancellation. (PR#13714).
median.default() was altered in 2.8.1 to use
sum() rather than mean(), although it was
still documented to use mean(). This caused problems for
POSIXt objects, for which mean() but not sum()
makes sense, so the change has been reverted.
Assigning an extra 0-length column to a data frame by
DF$foo <- value gave a corrupt data frame rather than
failing. (PR#13724) This also happened for
DF[["foo"]] <- value.
R CMD INSTALL no longer gives a spurious warning
about old R versions ignoring multiple dependencies, if the conditions
are known to be satisfied.
The test for setting dim() allowed a value with two
or more NAs to be set on a 0-length object. (PR#13729)
Also, it allowed an even number of negative values.
xtfrm(), rank(), sort()
and order() did not always make use of custom comparison
methods specific to the class of elements being sorted.
Increase NAMED value on seq value in
for() loop so loop code cannot modify seq
value.
Prevent rectangles of size < 0.5 pixel from disappearing in Quartz when using rastered backend. (PR#13744)
Printing _NA_complex_ had a low-level thinko; patch
thanks to Bill Dunlap.
CP1257 encoding for postscript/PDF has been corrected. (PR#13736)
aov() with an error term was evaluating the ...
arguments in 2.9.0 whilst checking their names, so could fail by
evaluating them in the wrong place. (PR#13733)
The print() method for arima() failed
if all coefs were fixed.
R CMD INSTALL –no-latex was not implemented in 2.9.0
(only).
Added a needed PROTECT call in RunFinalizers to
handle cases where the routine is called recursively from a GC in a
finalizer.
Constructing error messages about unused arguments in calls to closures no longer evaluates the arguments.
qr(x, LAPACK=TRUE) did not coerce integer x to
numeric.
qr.coef() misbehaved in the LAPACK case with a
matrix RHS, so that solve(qr(x, LAPACK=TRUE)) gave wrong
results. (Found by Avraham Adler, PR#13762 by Ravi Varadhan.)