Dear Emacs, please make this -*-Text-*- mode!
**************************************************
* *
* 2.7 SERIES NEWS *
* *
**************************************************
CHANGES IN R VERSION 2.7.1
NEW FEATURES
o tools::texi2dvi() has a new argument 'texinputs' to allow the
TeX and bibtex input paths to be specified (even on MiKTeX).
o dev.copy2pdf() gains an 'out.type' argument to allow it to be
used with cairo_pdf() or quartz(type = "pdf").
o poly() has additional checks against user error (as in PR#11243).
o The Mac OS quartz() device draws contiguous lines much faster.
o A field containing just a sign is no longer regarded as numeric
(it was on all platforms in 2.7.0, but not on most in earlier
versions of R). Similarly, '.' is now always non-numeric.
o CITATION files are now read in Latin-1: quite a few were
failing if used in a multibyte locale such as UTF-8.
o The DESCRIPTION file of a package can specify an 'OS_type' field
as either 'unix' or 'windows' to confine installation to that
OS type.
o HoltWinters() now uses optimize() rather than optim for
one-parameter problems which should be more reliable (PR#11469).
o axis() now respects the setting of par("xpd") when clipping.
o The 'factor' method of format() now preserves names, dims and
dimnames in the same way as for character and numeric inputs.
(PR#11512)
o read.DIF(*, transpose=TRUE) now allows to correctly read DIF files
produced by some versions of Excel.
DEPRECATED & DEFUNCT
o The use of unserialize() on character strings is deprecated:
that was a format used in R < 2.4.0.
o The use of embedded nuls in character strings is deprecated:
They will no longer be allowed in R 2.8.0.
UTILITIES
o R CMD check checks for possible check directories in the
sources -- in mid-2008 there were about 20 examples on CRAN.
o R CMD build tries harder to clean up the inst/doc directory
from the remnants of earlier builds.
It also removes any directories with extension .Rcheck, and
files .DS_Store and ._* (created by tar on Mac OS X under some
circumstances: it now sets environment variables to ask for
such files not to be created by that tar.)
BUG FIXES
o Encoding<- on NA_character_ converted it to "NA".
o Adobe Symbol was missing from the encodings in
tools::charset_to_Unicode.
o diag(matrix(x, 0, 0)) now returns a 0-length vector of the
correct mode, instead of always numeric.
o The parser sometimes accepted invalid quoted strings in a UTF-8
locale.
o plot.default(x, y) now dispatches to Axis() methods whether
y is NULL or not.
o On Mac OS X, the Cocoa Quartz window could close without warning
under certain circumstances (specific autorelease pool flush).
o Plotting symbols with separate border and fill colours (e.g.,
plot(pch = 21)) now works with transparent 'col', but opaque
or semi-transparent 'bg'. Previously, if 'col' was
transparent then 'bg' was ignored and nothing was drawn.
o file.path() did not work correctly in 2.7.0 if the components
had different encodings.
o merge() failed if there were no common columns and one of the
inputs had zero rows.
o expand.grid() failed if an input had length 0.
o match() does again truncate strings at embedded nuls (as newly
documented in 2.7.0).
o Because of a typo, 'pointsize' in png(type="cairo") (and jpeg,
bmp, tiff) devices was being interpreted in pixels not bigpoints.
o is() was wrong for some S3 class objects with class of length
greater than one.
o undoc() / codoc() were not checking all S4 methods in some cases.
o Use of textConnection(NULL, mode="w") could segfault.
o Use of strwidth/height(units="user") (the default) is again an
error before a user coordinate system has been set on the
device, rather than giving nonsensical values (the effect of
r31367).
o Rare string width calculations in package grid were not
interpreting the string encoding correctly.
o hasMethods(f, env) {without specified 'package'} now works better.
o A missing PROTECT could cause segfaults on string
comparisons. (PR#11421)
o str(structure(1, classID = "Pooh")) now works fine.
o A missing PROTECT could cause segfaults in if() if coercion of
the condition was required or a warning was to be given.
o plot(
) now uses a sensible default main title.
o validObject() called with complete=TRUE did not use inherited
validity methods for slot classes.
o Several bugs fixed in as(): the initial method lookup was not
using the table with inherited methods (so inheritance had to
be recomputed each time); coerce() should not be called
directly--it can insert invalid inherited methods; the
constructed as() methods were not retaining the function's
environment.
o influence.measures() now computes the same
Cook's distance approximations as cooks.distance().
o plot(, which=5) uses more correct Cook's distance contours;
(fix to fix to PR#9316).
o pdf() and postscript() were not working correctly in 2.7.0 with
UTF-8 encoded data in a non-UTF-8 MBCS (e.g. EUC-JP on Unix,
CJK locales on Windows).
o conformMethod(), called by setMethod(), now checks better about
argument names in wrong order. Whereas it only warns currently,
it is planned to become an error in the future.
o The predict() method for prcomp() had an incorrect check for
the number of columns of 'newdata' if the columns were not named.
o The axis() function now distinguishes between setting "at" to
NULL or a zero-length vector, treating the latter as a request
for no ticks. This corrects the handling of the "x" parameter
to rug().
o glob2rx("*[*") now produces a correct regular expression.
o The canvas is no longer painted on copy or save in Cocoa Quartz.
o identify() in Quartz can now be terminated by either using popup
menu equivalent (Ctrl-click or second mouse button) or by pressing
the key. The latter was documented but did not work.
o tools:::.check_package_depends() {called from 'R CMD check'} now
also works correctly when directory-name != package-name.
o Source references were sometimes off by a line.
o The quartz() parameter 'antialias' is no longer ignored.
o The Quartz device is now trying hard to remove anti-aliasing
effects for rasterized backends in plots that use adjacent,
borderless rectangles such as image().
o The srcfilecopy() function now adds a timestamp to the object it
creates.
o parse() would lose a token when run on stdin().
o socketConnection() was using internally the class "socket"
and not "sockconn", which caused a conflict with make.socket().
(PR#11515)
o Quartz is now trying harder to find the proper font for a given
family which resolves font issues on Mac OS X 10.4. Full font
names and PostScript names can be used interchangeably. (Note,
however that italic/oblique font faces of Helvetica are not
included in the Mac OS X 10.4 system).
o qf() no longer gives NaN when one of df1 and df2 is large and
the other is infinite (including if both are infinite); it is more
accurate e.g. for qf(1e-18, 2,4).
o qbeta(-1e10, 50, 40, log.p=TRUE) no longer hangs.
o Cocoa Quartz backend autodetection of display DPI was not
correct for screens rotated by 90 or 270 degrees.
o selectMethod("coerce", .) now uses a correct default for
'useInherited', and hence no longer may mess up the method cache.
o show() now also works on "unregistered" S3 class objects.
o formatC(*, format="fg", flag="#") is no longer dropping trailing
zeros.
o read.table(file = stdin()) with invalid input could leave the
connection in an invalid state and hence cause a later
segfault. (PR#11627)
o read.DIF() did not obey the default 'stringsAsFactors = TRUE'.
o The 'noquote' method for c() now works correctly with three or
more arguments.
o symbol() in plotmath expressions works again with non-ASCII
input on devices that use UTF-8 for the symbol font.
CHANGES IN R VERSION 2.7.0
SIGNIFICANT USER-VISIBLE CHANGES
o The default graphics device in non-interactive use is now
pdf() rather than postscript(). [PDF viewers are now
more widely available than PostScript viewers.]
The default width and height for pdf() and bitmap() have been
changed to 7 (inches) to match the screen devices.
o Most users of the X11() device will see a new device that has
different fonts, anti-aliasing of lines and fonts and
supports semi-transparent colours.
o Considerable efforts have been made to make the default output
from graphics devices as similar as possible (and in
particular close to that from postscript/pdf). Many devices
were misinterpreting 'pointsize' in some way, for example as
being in device units (pixels) rather than in points.
o Packages which include graphics devices need to be re-installed
for this version of R, with recently updated versions.
NEW FEATURES
o The apse code used by agrep() has been updated to version
0.16, with various bug fixes.
agrep() now supports multibyte character sets.
o any() and all() avoid coercing zero-length arguments (which
used a surprising amount of memory) since they cannot affect
the answer.
Coercion of other than integer arguments now gives a warning
as this is often a mistake (e.g. writing all(pr) > 0 instead
of all(pr > 0) ).
o as.Date(), as.POSIXct() and as.POSIXlt() now convert numeric
arguments (days or seconds since some epoch) provided the
'origin' argument is specified.
o New function as.octmode() to create objects such as file
permissions.
o as.POSIXlt() is now generic, and it and as.POSIXct() gain a
'...' argument. The character/factor methods now accept a
'format' argument (analogous to that for as.Date).
o New function browseVignettes() lists available vignettes in an
HTML browser with links to PDF, Rnw, and R files.
o There are new capabilities "aqua" (for the AQUA GUI and quartz()
device on Mac OS X) and "cairo" (for cairo-based graphics
devices).
o New function checkNEWS() in package 'tools' that detects common
errors in NEWS file formatting.
o deparse() gains a new argument 'nlines' to limit the number of
lines of output, and this is used internally to make several
functions more efficient.
o deriv() now knows the derivatives of digamma(x), trigamma(x)
and psigamma(x, deriv) (wrt to x).
o dir.create() has a new argument 'mode', used on Unix-alikes
(only) to set the permissions on the created directory.
o Where an array is dropped to a length-one vector by drop() or
[, drop = TRUE], the result now has names if exactly one of
the dimensions was named. (This is compatible with S.)
Previously there were no names.
o The 'incomparables' argument to duplicated(), unique() and
match() is now implemented, and passed to match() from merge().
o dyn.load() gains a 'DLLpath' argument to specify the path for
dependent DLLs: currently only used on Windows.
o The spreadsheet edit() methods (and used by fix()) for data
frames and matrices now warn when classes are discarded.
When editing a data frame, columns of unknown type (that is
not numeric, logical, character or factor) are now converted
to character (instead of numeric).
o file.create() has a new argument 'showWarnings' (default TRUE)
to show an informative warning when creation fails, and
dir.create() warns under more error conditions.
o New higher-order functions Find(), Negate() and Position().
o [dpqr]gamma(*, shape = 0) now work as limits of 'shape -> 0',
corresponding to the point distribution with all mass at 0.
o An informative warning (in addition to the error message) will
be given when the basic, extended or perl mode of grep(),
strsplit() and friends fails to compile the pattern.
o More study is done of perl=TRUE patterns in grep() and friends
when length(x) > 10: this should improve performance on long
vectors.
o grep(), strsplit() and friends with fixed=TRUE or perl=TRUE
work in UTF-8 and preserve the UTF-8 encoding for UTF-8 inputs
where supported.
o help.search() now builds the database about 3x times faster.
o iconv() now accepts "UTF8" on all platforms (many did, but not
e.g. libiconv as used on Windows).
o identity() convenience function to be used for programming.
o In addition to warning when 'pkgs' is not found,
install.packages() now reports if it finds a valid package
with only a case mismatch in the name.
o intToUtf8() now marks the Encoding of its output.
o The function is() now works with S3 inheritance; that is, with
objects having multiple strings in the class attribute.
o Extensions to condition number computation for matrices, notably
complex ones are provided, both in kappa() and the new rcond().
o list.files() gains a 'ignore.case' argument, to allow
case-insensitive matching on some Windows/MacOS file systems.
o ls.str() and lsf.str() have slightly changed arguments and
defaults such that ls.str() {no arguments} works when debugging.
o Under Unix, utils::make.packages.html() can now be used directly
to set up linked HTML help pages, optionally without creating
the package listing and search database (which can be much
faster).
o new.packages() now knows about the front-end package gnomeGUI
(which does not install into a library).
o optim(*, control = list(...)) now warns when '...' contains
unexpected names, instead of silently ignoring them.
o The options "browser" and "editor" may now be set to functions,
just as "pager" already could.
o packageDescription() makes use of installed metadata where
available (for speed, e.g. in make.packages.html()).
o pairwise.t.test() and pairwise.wilcox.test() now more explicitly
allow paired tests. In the former case it is now flagged as an
error if both 'paired' and 'pool.SD' are set TRUE (formerly,
'paired' was silently ignored), and one-sided tests are generated
according to 'alternative' also if 'pool.SD' is TRUE.
o paste() and file.path() are now completely internal, for speed.
(This speeds up make.packages.html(packages=FALSE)
severalfold, for example.)
o paste() now sets the encoding on the result under some
circumstances (see ?paste).
o predict.loess() now works when loess() was fitted with
transformed explanatory variables, e.g, loess(y ~ log(x) + log(z)).
o print()'s new argument 'row.names' allows to suppress
printing rownames.
o print() and str() now also "work" for 'logLik' vectors longer than
one.
o Progress-bar functions txtProgressBar(), tkProgressBar() in
package tcltk and winProgressBar() (Windows only).
o readChar() gains an argument 'useBytes' to allow it to read a
fixed number of bytes in an MBCS locale.
o readNEWS() has been moved to the tools package.
o round() and signif() now do internal argument matching if
supplied with two arguments and at least one is named.
o New function showNonASCII() in package tools to aid detection
of non-ASCII characters in .R and .Rd files.
o The [dpq]signrank() functions now typically use considerably
less memory than previously, thanks to a patch from Ivo
Ugrina.
o spec.ar() now uses frequency(x) when calculating the
frequencies of the estimated spectrum, so that for monthly
series the frequencies are now per year (as for spec.pgram)
rather than per month as before.
o spline() gets an 'xout' argument, analogously to approx().
o sprintf() now does all the conversions needed in a first pass if
length(fmt) == 1, and so can be many times faster if called
with long vector arguments.
o [g]sub(useBytes = FALSE) now sets the encoding on changed
elements of the result when working on an element of known
encoding. (This was previously done only for perl = TRUE.)
o New function Sys.chmod(), a wrapper for 'chmod' on platforms
which support it. (On Windows it handles only the read-only
bit.)
o New function Sys.umask(), a wrapper for 'umask' on platforms
which support it.
o New bindings ttk*() in package tcltk for the 'themed widgets'
of Tk 8.5. The tcltk demos make use of these widgets where
available.
o write.table(d, row.names=FALSE) is faster when 'd' has millions of
rows; in particular for a data frame with automatic row names.
(Suggestion from Martin Morgan.)
o The parser limit on string size has been removed.
o If a NEWS file is present in the root of a source package, it
is installed (analogously to LICENSE, LICENCE and COPYING).
o Rd conversion to 'example' now quotes aliases which contain
spaces.
o The handling of DST on dates outside the range 1902-2037 has
been improved. Dates after 2037 are assumed to have the same
DST rules as currently predicted for the 2030's (rather than
the 1970s), and dates prior to 1902 are assumed to have no DST
and the same offset as in 1902 (if known, otherwise as in the
1970s).
o On platforms where we can detect that mktime sets errno
(e.g. Solaris and the code used on Windows but not Linux nor
Mac OS X), 1969-12-31 23:59:59 GMT is converted from POSIXlt
to POSIXct as -1 and not NA.
o The definition of 'whitespace' used by the parser is slightly
wider: it includes Unicode space characters on Windows and in
UTF-8 locales on machines which use Unicode wide characters.
o The src/extra/intl sources have been updated to those from
gettext 0.17.
o New flag --interactive on Unix-alikes forces the session to be
interactive (as --ess does on Windows).
o x[] <- NULL is always a no-op: previously
type-checking was done on the replacement value and so this
failed, whereas we now assume NULL can be promoted to any
zero-length vector-like object.
Other cases of a zero-length index are done more efficiently.
o There is a new option in Rd markup of \donttest{} to mark
example code that should be run by example() but not tested
(e.g. because it might fail in some locales).
o The error handler in the parser now reports line numbers for
more syntax errors (MBCS and Unicode encoding errors, line
length and context stack overflows, and mis-specified argument
lists to functions).
o The "MethodsList" objects originally used for method selection
are being phased out. New utilities provide simpler
alternatives (see ?findMethods), and direct use of the mangled
names for the objects is now deprecated.
o Creating new S4 class and method definitions in an environment
that could not be identified (as package, namespace or global)
previously generated an error. It now results in creating and
using an artificial package name from the current date/time,
with a warning. See ?getPackageName.
o Unix-alikes now give a warning on startup if locale settings
fail. (The Windows port has long done so.)
o Parsing and scanning of numerical constants is now done by R's
own C code. This ensures cross-platform consistency, and
mitigates the effects of setting LC_NUMERIC (within base R it
only applies to output -- packages may differ).
The format accepted is more general than before and includes
binary exponents in hexadecimal constants: see
?NumericConstants for details.
o Dependence specifications for R or packages in the Depends
field in a DESCRIPTION file can now make use of operators
< > == and != (in addition to <= and >=): such packages will
not be installable nor loadable in R < 2.7.0.
There can be multiple mentions of R or a package in the Depends
field in a DESCRIPTION file: only the first mention will be
used in R < 2.7.0.
GRAPHICS CHANGES
o The default graphics devices in interactive and
non-interactive sessions are now configurable via environment
variables R_INTERACTIVE_DEVICE and R_DEFAULT_DEVICE
respectively.
o New function dev.new() to launch a new copy of the default
graphics device (and taking care if it is "pdf" or
"postscript" not to trample on the file of an already running
copy).
o dev.copy2eps() uses dev.displaylist() to detect screen
devices, rather than list them in the function.
o New function dev.copy2pdf(), the analogue of dev.copy2eps().
o dev.interactive() no longer treats a graphics device as
interactive if it has a display list (but devices can still
register themselves on the list of interactive devices).
o The X11() and windows() graphics devices have a new argument
'title' to set the window title.
o X11() now has the defaults for all of its arguments set by the
new function X11.options(), inter alia replacing options
"gamma", "colortype" and "X11fonts".
o ps.options() now warns on unused option 'append'.
xfig() no longer takes default arguments from ps.options().
(This was not documented prior to 2.6.1 patched.)
pdf() now takes defaults from the new function pdf.options()
rather that from ps.options() (and the latter was not
documented prior to 2.6.1 patched).
The defaults for all arguments other than 'file' in
postscript() and pdf() can now be set by ps.options() or
pdf.options()
o New functions setEPS() and setPS() as wrappers to ps.options()
to set appropriate defaults for figures for inclusion in other
documents and for spooling to a printer respectively.
o The meaning of numeric 'pch' has been extended where MBCSes are
supported. Now negative integer values indicate Unicode
points, integer values in 32-127 represent ASCII characters,
and 128-255 are valid only in single-byte locales.
(Previously what happened with negative pch values was
undocumented: they were replaced by the current setting of
par("pch").)
o Graphics devices can say if they can rotate text well
(e.g. postscript() and pdf() can) and if so the device's
native text becomes the default for contour labels rather than
using Hershey fonts.
o The setting of the line spacing (par("cra")[2]) on the X11() and
windows() devices is now comparable with postscript() etc, and
roughly 20% smaller than before (it used to depend on the
locale for X11). (So is the pictex() device, now 20% larger.)
This affects the margin size in plots, and should result in
better-looking plots.
o There is a per-device setting for whether new frames need
confirmation. This is controlled by either par("ask") or
grid.prompt() and affects all subsequent plots on the device
using base or grid graphics.
o There is a new version of the X11() device based on cairo
graphics which is selected by type "cairo" or "nbcairo", and
is available on machines with cairo installed and preferably
pango (which most machines with gtk+ >= 2.8 will have). This
version supports translucent colours and normally does a
better job of font selection so it has been possible to
display (e.g.) English, Polish, Russian and Japanese text on
a single X11() window. It is the default where available.
There is a companion function, savePlot(), to save the current
plot to a PNG file.
On Unix-alikes, devices jpeg() and png() also accept
type = "cairo", and with that option do not need a running
X server. The meaning of capabilities("jpeg") and
capabilities("png") has changed to reflect this. On MacOS X,
there is a further type = "quartz". The default type is
selected by the new option "bitmapType", and is "quartz" or
"cairo" where available.
Where cairo 1.2 or later is supported, there is a svg() device
to write SVG files, and cairo_pdf() and cairo_ps() devices to
write (possibly bitmap) PDF and postscript files via cairo.
Some features require cairo >= 1.2, and some which are
nominally supported under 1.2 seem to need 1.4 to work well.
o There are new bmp() and tiff() devices.
o New function devSize() to report the size of the current
graphics device surface (in inches or device units). This
gives the same information as par("din"), but independent of
the graphics subsystem.
o New base graphics function clip() to set the clipping region (in
user coordinates).
o New functions grconvertX() and grconvertY() to convert between
coordinate systems in base graphics.
o identify() recycles its 'labels' argument if necessary.
o stripchart() is now a generic function, with default and
formula methods defined. Additional graphics parameters may
be included in the call. Formula handling is now
similar to boxplot().
o strwidth() and strheight() gain 'font' and 'vfont' arguments and
accept in-line pars such as 'family' in the same way as text()
does. (Longstanding wish of PR#776)
o example(ask=TRUE) now applies to grid graphics (e.g. from
lattice) as well as to base graphics.
o Option "device.ask.default" replaces "par.ask.default" now it
applies also to grid.prompt().
o plot.formula() only prompts between plots for interactive
devices (it used to prompt for all devices).
o When plot.default() is called with y=NULL it now calls Axis()
with the 'y' it constructs rather than use the default axis.
DEPRECATED & DEFUNCT
o In package installation, SaveImage: yes is defunct and
lazyloading is attempted instead.
o $ on an atomic vector or S4 object is now defunct.
o Partial matching in [[ is now only performed if explicitly
requested (by exact=FALSE or exact=NA).
o Command-line completion has been moved from package 'rcompgen'
to package 'utils': the former no longer exists as a separate
package in the R distribution.
o The S4 pseudo-classes "single" and double have been removed.
(The S4 class for a REALSXP is "numeric": for back-compatibility
as(x, "double") coerces to "numeric".)
o gpar(gamma=) in the grid package is now defunct.
o Several S4 class definition utilities, get*(), have been said
to be deprecated since R 1.8.0; these are now formally deprecated.
Ditto for removeMethodsObject().
o Use of the graphics headers Rgraphics.h and Rdevices.h is
deprecated, and these will be unavailable in R 2.8.0.
(They are hardly used except in graphics devices, for which
there is an updated API in this version of R.)
o options("par.ask.default") is deprecated in favour of
"device.ask.default".
o The 'device-independent' family "symbol" is deprecated as it was
highly locale- and device-dependent (it only did something
useful in single-byte locales on most devices) and font=5
(base) or fontface=5 (grid) did the job it was intended to do
more reliably.
o gammaCody() is now formally deprecated.
o Two low-level functions using MethodsList metadata objects
(mlistMetaName() and getAllMethods()) are deprecated.
o Setting par(gamma=) is now deprecated, and the windows()
device (the only known example) no longer allows it.
o The C macro 'allocString' will be removed in 2.8.0 -- use
'mkChar', or 'allocVector' directly if really necessary.
INSTALLATION
o Tcl/Tk >= 8.3 (released in 2000) is now required to build
package tcltk.
o configure first tries TCL_INCLUDE_SPEC and TK_INCLUDE_SPEC
when looking for Tcl/Tk headers. (The existing scheme did
not work for the ActiveTcl package on Mac OS X.)
o The Windows build only supports Windows 2000 or later (XP,
Vista, Server 2003 and Server 2008).
o New option --enable-R-static-lib installs libR.a which can
be linked to a front-end via 'R CMD config --ldflags'.
The tests/Embedding examples now work with a static R
library.
o Netscape (which was discontinued in Feb 2008) is no longer
considered when selecting a browser.
o xdg-open (the freedesktop.org interface to
kfmclient/gnome-open/...) is considered as a possible browser,
after real browsers such as firefox, mozilla and opera.
o The search for tclConfig.sh and tkConfig.sh now only looks in
directories with names containing $(LIBnn) in the hope of
finding the version for the appropriate architecture
(e.g. x86_64 or i386).
o libtool has been updated to version 2.2.
o Use of --with-system-zlib, --with-system-bzlib or
--with-system-pcre now requires version >= 1.2.3, 1.0.5, 7.6
respectively, for security.
UTILITIES
o Rdconv now removes empty sections including alias and keyword
entries, with a note.
o Keyword entries are no longer mandatory in Rd files.
o R CMD INSTALL now also installs tangled versions of all vignettes.
o R CMD check now warns if spaces or non-ASCII characters are
used in file paths, since these are not in general portable.
o R CMD check (via massage-examples.pl) now checks all examples
with a 7 inch square device region on A4 paper, for
locale-independence and to be similar to viewing examples on
an on-screen device.
If a package declares an encoding in the DESCRIPTION file,
the examples are assumed to be in that encoding when running
the tests. (This avoids errors in running latin1 examples in a
UTF-8 locale.)
o R CMD check uses pdflatex (if available) to check the typeset
version of the manual, producing PDF rather than DVI. (This
is a better check since the package reference manuals on CRAN
are in PDF.)
o R CMD Rd2dvi gains a --encoding argument to be passed to
R CMD Rdconv, to set the default encoding for conversions.
If this is not supplied and the files are package sources and
the DESCRIPTION file contains an Encoding field, that is used
for the default encoding.
o available.packages() (and hence install.packages() etc) now
supports subdirectories in a repository, and
tools::write_PACKAGES() can now produce PACKAGES files
including subdirectories.
o The default for 'stylepath' in Sweave's (default) RweaveLatex
driver can be set by the environment variable
SWEAVE_STYLEPATH_DEFAULT: see ?RweaveLatex.
C-LEVEL FACILITIES
o Both the Unix and Windows interfaces for embedding now make
use of 'const char *' declarations where appropriate.
o Rprintf() and REprintf() now use 'const char *' for their format
argument -- this should reduce warnings when called from C++.
o There is a new description of the interface for graphics
devices in the 'R Internals' manual, and several new entry
points. The API has been updated to version R_GE_version = 5,
and graphics devices will need to be updated accordingly.
o Graphics devices can now select to be sent text in UTF-8, even
if the current locale is not UTF-8 (and so enable text entered
in UTF-8 to be plotted). This is used by postscript(), pdf()
and the windows() family of devices, as well as the new
cairo-based devices.
o More Lapack routines are available (and declared in R_Ext/Lapack.h),
notably for (reciprocal) condition number estimation of complex
matrices.
o Experimental utility R_has_slot supplementing R_do_slot.
o There is a new public interface to the encoding info stored on
CHARSXPs, getCharCE and mkCharCE using the enumeration type
cetype_t.
o A new header 'R_ext/Visibility.h' contains some definitions for
controlling the visibility of entry points, and how to control
visibility is now documented in 'Writing R Extensions'.
BUG FIXES
o pt(x, df) is now even more accurate in some cases (e.g. 12 instead
of 8 significant digits), when x^2 << df, thanks to a remark from
Ian Smith, related to PR#9945.
o co[rv](use = "complete.obs") now always gives an error if there
are no complete cases: they used to give NA if
method = "pearson" but an error for the other two methods.
(Note that this is pretty arbitrary, but zero-length vectors
always give an error so it is at least consistent.)
cor(use="pair") used to give diagonal 1 even if the variable
was completely missing for the rank methods but NA for the
Pearson method: it now gives NA in all cases.
cor(use="pair") for the rank methods gave a matrix result with
dimensions > 0 even if one of the inputs had 0 columns.
o Supplying edit.row.names = TRUE when editing a matrix without
row names is now an error and not a segfault. (PR#10500)
o The error handler in the parser reported unexpected
& as && and | as ||.
o ps.options(reset = TRUE) had not reset for a long time.
o paste() and file.path() no longer allow NA_character_ for
their 'sep' and 'collapse' arguments.
o by() failed for 1-column matrices and dataframes. (PR#10506)
However, to preserve the old behaviour, the default method
when operating on a vector still passes subsets of the vector
to FUN, and this is now documented.
o Better behaviour of str.default() for non-default
'strict.width' (it was calling str() rather than str.default()
internally); also, more useful handling of options("str").
o wilcox.test(exact=FALSE, conf.int=TRUE) could fail in some
extreme two-sample problems. (Reported by Wolfgang Huber.)
o par(pch=) would accept a multi-byte string but only use the
first byte. This would lead to incorrect results in an MBCS
locale if a non-ASCII character was supplied.
o There are some checks for valid C-style formats in, e.g.
png(filename=). (PR#10571)
o vector() was misinterpreting some double 'length' values, e.g,
NaN and NA_real_ were interpreted as zero. Also, invalid
types of 'length' were interpreted as -1 and hence reported as
negative. (length<- shared the code and hence the same
misinterpretations.)
o A basic class "S4" was added to correspond to the "S4" object
type, so that objects with this type will print, etc. The
class is VIRTUAL, since all actual S4 objects must have a real
class.
o Classes with no slots that contain only VIRTUAL classes are now
VIRTUAL, as was intended but confused by having an empty S4
object as prototype. ## backed out temporarily ##
o format.AsIs() discarded dimnames, causing dataframes with matrix
variables to be printed without using the column names, unlike
what happens in S-PLUS (Tim Hesterberg, PR#10730).
o xspline() and grid::grid.xspline() work in device coordinates
and now correct for anisotropy in the device coordinate
system.
o grid.locator() now indicates to the graphics device that it is
is in 'graphics input' mode (as locator() and identify()
always have). This means that devices can now indicate the
'graphics input' mode by e.g. a change of cursor.
o Locales without encoding specification and non-UTF-8 locales
now work properly on Mac OS X. Note that locales without
encoding specification always use UTF-8 encoding in Mac OS X
(except for specials "POSIX" and "C") - this is different from
other operating systems.
o iconv() now correctly handles to="" and from="" on Mac OS X.
o In diag()'s argument list, drop the explicit default (' = n')
for 'ncol' which is ugly when making diag() generic.
o S4 classes with the same name from different packages were not
recognized because of a bug in caching the new definition.
o jpeg() and png() no longer maintain a display list, as they
are not interactive devices.
o Using attr(x, "names") <- value (instead of the correct
names<-) with 'value' a pairlist (instead of the correct
character vector) worked incorrectly. (PR#10807)
o Using [<- to add a column to a data frame dropped other
attributes whereas [[<- and $<- did not: now all preserve
attributes. (PR#10873)
o File access functions such as file.exists(), file.info(),
dirname() and unlink() now treat an NA filename as a
non-existent file and not the file "NA".
o r(), the random number generators, are now more consistent
in warning when NA's (specifically NaN's) are generated.
o rnorm(n, mu = Inf) now returns rep(Inf, n) instead of NaN;
similar changes are applied to rlnorm(), rexp(), etc.
o [l]choose() now warns when rounding non-integer 'k' instead of
doing so silently. (May help confused users such as PR#10766.)
o gamma() was warning incorrectly for most negative values as being
too near a negative integer. This also affected other
functions making use of its C-level implementation.
o dumpMethod() and dumpMethods() now work again.
o package.skeleton() now also works for code_files with only
metadata (e.g. S4 setClass) definitions; it handles S4 classes and
methods, producing documentation and NAMESPACE exports if requested.
o Some methods package utilities (implicitGeneric(), makeGeneric())
will be more robust in dealing with primitive functions (not a
useful idea to call them with primitives, though)
o Making a MethodsList from a function with no methods table will
return an empty list, rather than cause an error (questionably
a bug, but caused some obscure failures).
o setAs() now catches 2 arguments in the method definition, if
they do not match the arguments of coerce().
o S4 methods with missing arguments in the definition are handled
correctly when non-signature arguments exist, and check for
conflicting local names in the method definition.
o qgamma() and qchisq() could be inaccurate for small p,
e.g. qgamma(1.2e-10, shape = 19) was 2.52 rather than 2.73.
o dbeta(.., ncp) is now more accurate for large ncp, and typically no
longer underflows for give.log = TRUE.
o coerce() is now a proper S4 object and so prints correctly.
o @ now checks it is being applied to an S4 object, and if not
gives a warning (which will become an error in 2.8.0).
o dump() and friends now warn that all S4 objects (even those
based on vectors) are not source()able, with a stronger wording.
o read.dcf(all = TRUE) was leaking connections.
o scan() with a non-default separator could skip nul bytes,
including those entered as \0 with allowEscapes=TRUE. This
was different from the default separator.
o determinant(matrix(,0,0)) now returns a correct "det" result;
also value 1 or 0 depending on 'logarithm', rather than numeric(0).
o Name space 'grDevices' was not unloading its DLL when the
name space was unloaded.
o getNativeSymbolInfo() was unaware of non-registered Fortran
names, because one of the C support routines ignored them.
o load() again reads correctly character strings with embedded nuls.
(This was broken in 2.6.x, but worked in earlier versions.)
**************************************************
* *
* 2.6 SERIES NEWS *
* *
**************************************************
CHANGES IN R VERSION 2.6.2 patched
BUG FIXES
o src/extra/pcre has been updated to PCRE 7.6 (bugfix release).
o unlink(..., recursive=TRUE) no longer crashes on some platforms
if a directory cannot be opened.
o Loading in 2.6.2 a saved workspace could give an unimportant
warning in a non-UTF-8 multibyte locale (in particular a CJK
locale on Windows) which is now suppressed.
o print() methods are more consistent in returning the original
argument invisibly.
o Using the X11 data editor (e.g. via edit(), fix() or View())
could crash if the 'End' key was used and all the columns
would have fitted into the window.
o Creating a new page on an X11() device (by plot.new() or
grid.newpage()) did not flush out the XClearWindow call, so
the X11 window might not be refreshed immediately.
o libtool has been updated to version 1.5.26, which avoids
many spurious configure warnings on Darwin/Mac OS X.
o l10n_info() now recognizes how Darwin/Mac OS X reports
Latin-1 locales (as charset ISO8859-1 rather than ISO-8859-1).
o Checking examples which used grid (e.g. via lattice) without
attaching grid no longer give errors from grid_plot_hook().
o kappa(m, exact=TRUE) no longer wrongly uses 'exact=FALSE' when m
is an 'lm' or 'qr' object because the kappa.tri(x, exact=TRUE)
now works correctly.
o help(topic, offline=TRUE) misbehaved when there were multiple
matches to 'topic'. (PR#10859)
o The 'multilib' changes on Linux broke the use of
sub-architectures without a main architecture.
o source(echo=TRUE) would skip lines consisting entirely of the
letter t. (PR#10923)
o bzip2 has been updated to 1.0.5 (security fix).
CHANGES IN R VERSION 2.6.2
NEW FEATURES
o colnames(DF) is now also fast for large dataframes DF with
automatic row.names. Note that the correct usage is
names(DF). (PR#10470)
o tools::texi2dvi() works around the failure of 'texi2dvi --quiet'
to be quiet in texinfo 4.11.
o On Linux, parallel 32/64-bit installations are supported using
multilib.
BUG FIXES
o A compilation problem on one system where glob was not found
has been corrected. (PR#10468)
o The "profile.nls" method of plot() was losing the x axis labels.
o array() computed the total number of entries in the array before
coercing the dimensions to integer. (Reported by Allen McIntosh.)
o persp() misreported errors in the y parameter. (Reported by Allen
McIntosh.)
o source("clipboard", echo=TRUE) and file("clipboard", open="rt")
gave spurious errors. (Reported by Fernando Saldanha.)
o attributes<-() stripped any existing attributes before checking
that all elements of the right-hand side had names.
o rbinom(n, size, *) gave NaN when 'size > .Machine$integer.max'.
o print.summary.lm() is now consistent in the capitalization of
"R-squared".
o confint() misreported on some rank-deficient lm() models.
(PR#10496) This could also occur in the default method.
o \code{\var{}} was not rendered correctly to latex in Rd
files for non-alphabetic arguments .
o In 2.6.1, curve(*, add=TRUE) used a wrong default 'xlim' when x
coordinates were logged.
o The Java-based search in help.start() now only requires a
JVM >= 1.4 (2.6.1 accidentally required >= 1.5).
o The default method for range() was omitting 'na.rm' for
non-numeric objects such as those of class "Date". (PR#10508)
o cut(x, breaks=) misbehaved on a constant vector of negative
values.
o bxp(), the plotting engine of boxplot(), no longer plots staple
ticks multiple times. (PR#10499)
o The automatic detection of the domain for message translation
was not working correctly for messages in message(), warning()
and stop() in packages other than 'base'.
o The profile.nls() function misbehaved when encountering
non-convergence of the "port" algorithm.
o Under certain rare circumstances in R 2.6.x, log(), round()
and trunc() could alter their arguments in the caller. This
involved passing of empty '...' arguments, and was spotted
when using apply(x, 2, log).
o par() no longer warns unnecessarily when asked to set new=FALSE
on an unused graphics device.
o plot.formula() was not passing on '...' when used with a
one-sided formula.
plot.formula() was not accepting expressions for annotations
passed to title(). (PR#10525)
o pchisq(x, df=0, ncp=L) now returns the correct limit exp(-L/2) for
x=0 and is no longer returning NaN for x > 0, L < 80. (PR#10551)
o Non-ASCII characters were only working correctly in Hershey
fonts if these were specified by the 'vfont' argument to
text() and not if specified as a font family.
o There were several errors in Hershey$allowed, but the help
page listed the allowed combinations correctly.
o text() no longer attempts to use 'vfont' with an expression
for 'labels' (it was documented not to work).
o fisher.test(simulate.p.value = TRUE) gave incorrect answers
in some extremely degenerate problems. (PR#10558)
o src/extra/pcre has been updated to PCRE 7.5 (bugfix release).
o capture.output() completes an incomplete final line of
output when file = NULL. (PR#10534)
o capture.output() now returns invisibly if output is written to
a file/connection.
o format.AsIs() did not remove the "AsIs" class and so could go
into an infinite loop.
o summary.mlm() lost the names of the coefficients when there
was only one.
o Rdconv was not marking examples files with an encoding if
this was known from the package's DESCRIPTION file.
o readChar() from a raw vector was reading a number of bytes,
not characters.
o slotNames() was erroneously treating classes that extend
"character" as strings.
o R no longer ignores SIGPIPE signals even in processes launched
by system(). Instead PR#1959 is handled by a simple error
handler which will give an error message in circumstances
where none was given before.
o The AIC() S4 generic in package stats4 no longer disables
dispatch of S3 methods for AIC().
o The conflicts check in library() excluded all S4 generics, even
where they were unrelated to the function masked. It is now
more selective (although still too generous to S4 generics).
o proc.time() was missing a protect and could misbehave if
provoked by gctorture(). (PR#10600)
o The cut() and hist() methods for dates and datetimes are now
more accurate for intervals of "months" and "years", thanks to
Marc Schwarz.
o url()/download.file() could segfault if the HTTP interaction
involved a redirect to an address starting with '/' on the
same server.
o Memory allocations used in format() and in an internal utility
function could be off by one byte. (PR#10635)
o isoreg(x, y) no longer segfaults when y has NAs.
o split(x, g) always returns a list as documented. (It used to
return NULL for a zero-length 'x'.)
o tapply(x, g, ...) misbehaved if the args were of zero length.
(PR#10644)
o hist.POSIXt(*, xaxt = "n") no longer suppresses the y-axis.
o strptime() crashed under certain locales on Mac OS X.
o gregexpr() no longer segfaults when "" is given as the search
pattern. Thanks to Herve Pages for the bug report.
o matplot(x, *) with default 'pch' did not plot columns from column
number 37 on (because the default pch was NA for those). (PR#10676)
o print.htest() lost output when used within sink(file, split=TRUE).
o Setting par(col.main=) also set par("col") to the same colour.
o Anonymous fifos were broken (again).
CHANGES IN R VERSION 2.6.1
NEW FEATURES
o The "data.frame" and "factor" methods for [[ now support
the 'exact' argument introduced in 2.6.0.
o plot.lm() gains a new argument 'cex.caption' to allow the
size of the captions to be controlled.
o A series of changes make the CHARSXP cache introduced in 2.6.0
faster (and in some cases many times faster) in sessions with
a large number (e.g. a million) of unique character strings,
and also if there are many empty strings.
o embedFonts(), bitmap() and dev2bitmap() explicitly turn off
auto-rotation in Ghostscript when generating PDF.
o The canonical architecture is no longer checked when loading
packages using a non-empty sub-architecture, since it is
possible to (e.g.) build packages for i386-pc-linux-gnu on both
that architecture and on x86_64-unknown-linux-gnu.
o Deparsing will (if option warnIncomplete is set) warn on
strings longer than the parser limit (8192 bytes).
o url() now uses the UserAgent header in http transactions in
the same way as download.file() (making use of option
"HTTPUserAgent").
BUG FIXES
o iconv() is again able to translate character strings with
embedded nuls (such as those in UCS-2).
o new.packages() and update.packages() failed when called on an
empty library, since old.packages() threw an error.
old.packages() now returns NULL (as documented) in that case.
o Builds on Mac OS X 10.4 or higher now allocate enough space
in the binary headers to relocate dependent libraries into the
framework.
o R CMD build now computes the exclusion list on the copy it
makes: this avoids problems if the original sources contain
symbolic links (which are resolved in the copy). Thanks to
Michael Lawrence for diagnosis and patch.
o object.size() had slightly too low a size for objects of type "S4".
o symbol() in plotmath expressions was only accepting valid
character strings, which made it impossible to specify symbols
such as aleph (obtained by symbol("\300")) in a UTF-8 locale.
o An event handling issue caused autorepeat functions to
misbehave with tcltk (notably scrollbars).
o plot(sin, -5, 5) gives ylab 'sin(x)' again, where it resulted
in 'x(x)' in 2.6.0. Further, plot(sin) again plots from
[0,1] also in cases where a previously used coordinate system
differs.
o curve() with unspecified 'from', 'to' and 'xlim' now reuses the
previous x limits, and not slightly larger ones.
o It was intended that R code filenames in packages should start
with an ASCII letter or digits (and R CMD INSTALL uses that),
but the test used in R CMD build ([A-Za-z0-9]) was
locale-specific (and excluded t to y in Estonian, for
example). (PR#10351)
o 'R CMD build' could misbehave when faced with files with CRLF
line endings *and* no line ending on the final line of the
file, removing the last byte of the file.
o DF[i, j] failed in 2.6.0 if j was a logical vector selecting a
single column.
o Unix x11() would fail if a valid 'display' was specified but
DISPLAY was unset. (PR#10379)
o postscript() was not always ignoring .Postscript.Options in
the workspace (where it should not have occurred).
o help.search() would give an error if it found a badly
installed package, even if 'package' was not specified.
o tclServiceMode() (package tcltk) now works under Unix-alikes.
(Although documented, it used only to work under Windows.)
o As Mac OS X 10.5.x comes with incompatible /bin/sh shell, we
force SHELL=/bin/bash (which is ok) in that case. [Only for
2.6.x: another solution is used in 2.7.0.]
o Deliberately using malformed source attributes no longer
causes deparsing/printing of functions to crash R. (PR#10437)
o R CMD check and R CMD INSTALL now work with (some) directory
names containing spaces.
o choose(n, k) gave incorrect values for negative n and small k.
o plot.ts(x,y) could use wrong default labels; fixed thanks to
Antonio, Fabio di Narzo.
o reshape() got column names out of sync with contents in some
cases; found by Antonio, Fabio Di Narzo.
o ar(x) for short 'x' (i.e. length <= 10) could fail because the
default 'order.max' was >= length(x) which is non-sensical.
o Keyboard events in getGraphicsEvent() could cause stack
imbalance errors. (PR#10453)
CHANGES IN R VERSION 2.6.0
SIGNIFICANT USER-VISIBLE CHANGES
o integrate(), nlm(), nlminb(), optim(), optimize() and uniroot()
now have '...' much earlier in their argument list. This
reduces the chances of unintentional partial matching but
means that the later arguments must be named in full.
o The default type for nchar() is now "chars". This is almost
always what was intended, and differs from the previous default
only for non-ASCII strings in a MBCS locale. There is a new
argument 'allowNA', and the default behaviour is now to throw
an error on an invalid multibyte string if type="chars" or
type="width".
o Connections will be closed if there is no R object referring to
them. A warning is issued if this is done, either at garbage
collection or if all the connection slots are in use.
NEW FEATURES
o abs(), sign(), sqrt(), floor(), ceiling(), exp() and the gamma,
trig and hyperbolic trig functions now only accept one
argument even when dispatching to a Math group method (which
may accept more than one argument for other group members).
o abbreviate() gains a 'method' argument with a new option
"both.sides" which can make shorter abbreviations.
o aggregate.data.frame() no longer changes the group variables
into factors, and leaves alone the levels of those which are
factors. (Inter alia grants the wish of PR#9666.)
o The default 'max.names' in all.names() and all.vars() is now
-1 which means unlimited. This fixes PR#9873.
o as.vector() and the default methods of as.character(),
as.complex(), as.double(), as.expression(), as.integer(),
as.logical() and as.raw() no longer duplicate in most cases
where the object is unchanged. (Beware: some code has been
written that invalidly assumes that they do duplicate, often
when using .C/.Fortran(DUP=FALSE).)
o as.complex(), as.double(), as.integer(), as.logical() and
as.raw() are now primitive and internally generic for
efficiency. They no longer dispatch on S3 methods for
as.vector() (which was never documented). as.real() and
as.numeric() remain as alternative names for as.double().
expm1(), log(), log1p(), log2(), log10(), gamma(), lgamma(),
digamma() and trigamma() are now primitive. (Note that logb()
is not.)
The Math2 and Summary groups (round, signif, all, any, max, min,
sum, prod, range) are now primitive.
See under METHODS PACKAGE below for some consequences for S4 methods.
o apropos() now sorts by name and not by position on the search
path.
o attr() gains an 'exact = TRUE' argument to disable partial
matching.
o bxp() now allows 'xlim' to be specified. (PR#9754)
o C(f, SAS) now works in the same way as C(f, treatment), etc.
o chol() is now generic.
o dev2bitmap() has a new option to go via PDF and so allow
semi-transparent colours to be used.
o dev.interactive() regards devices with the displaylist enabled
as interactive, and packages can register the names of their
devices as interactive via deviceIsInteractive().
o download.packages() and available.packages() (and functions
which use them) now support in 'repos' or 'contriburl' either
file: plus a general path (including drives on a UNC path on
Windows) or a file:/// URL in the same way as url().
o dQuote() and sQuote() are more flexible, with rendering
controlled by the new option 'useFancyQuotes'. This includes
the ability to have TeX-style rendering and directional quotes
(the so-called 'smart quotes') on Windows. The default is to
use directional quotes in UTF-8 locales (as before) and in the
Rgui console on Windows (new).
o duplicated() and unique() and their methods in base gain an
additional argument 'fromLast'.
o fifo() no longer has a default 'description' argument.
fifo("") is now implemented, and works in the same way as file("").
o file.edit() and file.show() now tilde-expand file paths on all
interfaces (they used to on some and not others).
o The find() argument is now named 'numeric' and not 'numeric.':
the latter was needed to avoid warnings about name clashes
many years ago, but partial matching was used.
o stats:::.getXlevels() confines attention to factors since some
users expected R to treat unclass() as a numeric
vector.
o grep(), strsplit() and friends now warn if incompatible sets
of options are used, instead of silently using the documented
priority.
o gsub()/sub() with perl = TRUE now preserves attributes from the
argument x on the result.
o is.finite() and is.infinite() are now S3 and S4 generic.
o jpeg(), png(), bmp() (Windows), dev2bitmap() and bitmap() have
a new argument 'units' to specify the units of 'width' and
'height'.
o levels() is now generic (levels<- has been for a long time).
o Loading serialized raw objects with load() is now considerably
faster.
o New primitive nzchar() as a faster alternative to
nchar(x) > 0 (and avoids having to convert to wide chars in
a MBCS locale and hence consider validity).
o The way old.packages() and hence update.packages() handle
packages with different versions in multiple package
repositories has been changed. The first package encountered
was selected, now the one with highest version number.
o optim(method = "L-BFGS-B") now accepts zero-length parameters,
like the other methods. Also, method = "SANN" no longer
attempts to optimize in this case.
o New options 'showWarnCalls' and 'showErrorCalls' to give a
concise traceback on warnings and errors. showErrorCalls=TRUE
is the default for non-interactive sessions. Option
'showNCalls' controls how abbreviated the call sequence is.
o New options 'warnPartialMatchDollar', 'warnPartialMatchArgs'
and 'warnPartialMatchAttr' to help detect the unintended use
of partial matching in $, argument matching and attr()
respectively.
o A device named as a character string in options(device =) is now
looked for in the grDevices name space if it is not visible
from the global environment.
o pmatch(x, y, duplicates.ok = TRUE) now uses hashing and so is
much faster for large x and y when most matches are exact.
o qr() is now generic.
o It is now a warning to have an non-integer object for
.Random.seed: this indicates a user had been playing with it,
and it has always been documented that users should only save
and restore it.
o New higher-order functions Reduce(), Filter() and Map().
o [g]regexpr() gain an 'ignore.case' argument for consistency with
grep(). (This does change the positional matching
of arguments, but no instances of positional matching beyond
the second were found.)
o relist() utility, an S3 generic with several methods, providing
an 'inverse' for unlist(); thanks to a code proposal from
Andrew Clausen.
o require() now returns invisibly.
o The interface to reshape() has been revised, allowing some
simplified forms that did not work before, and somewhat
improved error handling. A new argument 'sep' has been
introduced to replace simple usages of 'split' (the old
features are retained).
o rmultinom() uses a high-precision accumulator where available,
and so is more likely to give the same result on different
platforms (although it is still possible to get different
results, and the result may differ from previous versions of R).
o row() and col() now work on matrix-like objects such as data
frames, not just matrices.
o Rprof() allows smaller values of 'interval' on machines that
support it: for example modern Linux systems support
interval = 0.001.
o sample() now requires its first argument 'x' to be numeric
(in the sense of is.numeric()) as well as of length 1 and >= 1
before it is regarded as shorthand for 1:x.
o sessionInfo() now provides details about package name spaces
that are loaded but not attached. The output of sessionInfo
has been improved to make it easier to read when it is
inadvertently wrapped after being pasted into an email
message.
o setRepositories() has a new argument 'ind' to allow selections
to be made programmatically.
o sprintf() no longer has a output string length limit.
o storage.mode<- is now primitive, and hence makes fewer copies
of an object (none if the mode is unchanged). It is a little
less general than mode<-, which remains available. (See also
the entry under DEFUNCT below.)
o sweep() gains an argument 'check.margin = TRUE' which warns
about mismatched dimensions.
o The mathematical annotation facility (plotmath) now recognises
a symbol() function which forces the font to be a symbol font.
This allows access to all characters in the Adobe Symbol
encoding within plotmath expressions.
o For OSes that cannot unset environment variables, Sys.unsetenv()
sets the value to "", with a warning.
o New function Sys.which(), an interface to 'which' on
Unix-alikes and an emulation on Windows.
o On Unix-alikes, system(, intern = TRUE) reports on very long
lines that may be truncated, giving the line number of the
content being read.
o termplot() has a default for 'ask' that uses dev.interactive().
It allows 'ylim' to be set, or computed to cover all the
plots to be made (the new default) or computed for each plot
(the previous default).
o uniroot(f, *) is slightly faster for non-trivial f() because it
computes f(lower) and f(upper) only once, and it has new optional
arguments 'f.lower' and 'f.upper' by which the caller can pass these.
o unlink() is now internal, using common POSIX code on all platforms.
o unsplit() now works with lists of dataframes.
o The vcov() methods for classes "gls" and "nlme" have migrated to
package 'nlme'.
o vignette() has a new argument 'all' to choose between showing
vignettes in attached packages or in all installed packages.
o New function within(), which is like with(), except that it
returns modified versions back of lists and data frames.
o X11(), postscript() (and hence bitmap()), xfig(), jpeg(), png()
and the Windows devices win.print(), win.metafile() and bmp()
now warn (once at first use) if semi-transparent colours are
used (rather than silently treating them as fully
transparent).
o New function xspline() to provide base graphics support of
X-splines (cf grid.xspline).
o New function xyTable() does the 2D gridding "computations" used by
sunflowerplot().
o Rd conversion to HTML and CHM now makes use of classes, which
are set in the stylesheets. Editing R.css will change the
styles used for \env, \option, \pkg etc. (CHM styles are set
at compilation time.)
o The documented arguments of '%*%' have been changed to be x
and y, to match S and the implicit S4 generic.
o If members of the Ops group (the arithmetic, logical and
comparison operators) and '%*%' are called as functions,
e.g. '>'(x, y), positional matching is always used. (It used
to be the case that positional matching was used for the
default methods, but names would be matched for S3 and S4
methods and in the case of '!' the argument name differed
between S3 and S4 methods.)
o Imports environments of name spaces are named (as
"imports:foo"), and so are known e.g. to environmentName().
o Package 'stats4' uses lazy-loading not SaveImage (which is now
deprecated).
o Installing help for a package now parses the .Rd file only
once, rather than once for each type.
o PCRE has been updated to version 7.2.
o bzip2 has been updated to version 1.0.4.
o gettext has been updated to version 0.16.1.
o There is now a global CHARSXP cache, R_StringHash. CHARSXPs
are no longer duplicated and must not be modified in place.
Developers should strive to only use mkChar (and mkString) for
creating new CHARSXPs and avoid use of allocString. A new
macro, CallocCharBuf, can be used to obtain a temporary char
buffer for manipulating character data. This patch was
written by Seth Falcon.
o The internal equivalents of as.complex, as.double, as.integer
and as.logical used to handle length=1 arguments now accept
character strings (rather than report that this is
'unimplemented').
o Lazy-loading a package is now substantially more efficient (in
memory saved and load time).
o Various performance improvements lead to a 45% reduction
in the startup time without 'methods' (and one-sixth with -
'methods' now takes 75% of the startup time of a default session).
o The [[ subsetting operator now has an argument 'exact' that
allows programmers to disable partial matching (which will in
due course become the default). The default value is exact=NA
which causes a warning to be issued when partial matching
occurs. When exact = TRUE, no partial matching will be
performed. When exact = FALSE, partial matching can occur and
no warning will be issued. This patch was written by Seth
Falcon.
o Many of the C-level warning / error messages (e.g. from
subscripting) have been re-worked to give more detailed
information on either the location or the cause of the
problem.
o The S3 and S4 Math groups have been harmonized. Functions
log1p(), expm1(), log10() and log2() are members of the S3
group, and sign(), log1p(), expm1(), log2(), cummax(),
cummin(), digamma(), trigamma() and trunk() are members of the
S4 group. gammaCody() is no longer in the S3 Math group.
They are now all primitive.
o The initialization of the random-number stream makes use of the
sub-second part of the current time where available.
Initialization of the 1997 Knuth TAOCP generator is now done
in R code, avoiding some C code whose licence status has been
questioned.
o The reporting of syntax errors has been made more user-
friendly.
METHODS PACKAGE
o Packages using 'methods' have to have been installed in R 2.4.0
or later (when various internal representations were changed).
o Internally generic primitives no longer dispatch S4 methods on
S3 objects.
o load() and restoring a workspace attempt to detect and warn on
the loading of pre-2.4.0 S4 objects.
o Making functions primitive changes the semantics of S4
dispatch: these no longer dispatch on classes based on types
but do dispatch whenever the function in the base name space is
called.
This applies to as.complex(), as.integer(), as.logical(),
as.numeric(), as.raw(), expm1(), log(), log1p(), log2(),
log10(), gamma(), lgamma(), digamma() and trigamma(), as
well as the Math2 and Summary groups.
Because all members of the group generics are now primitive,
they are all S4 generic and setting an S4 group generic does
at last apply to all members and not just those already made
S4 generic.
as.double() and as.real() are identical to as.numeric(), and
now remain so even if S4 methods are set on any of them.
Since 'as.numeric' is the traditional name used in S4,
currently methods must be exported from a NAMESPACE for
'as.numeric' only.
o The S4 generic for '!' has been changed to have signature (x)
(was (e1)) to match the documentation and the S3 generic.
setMethod() will fix up methods defined for (e1), with a
warning.
o The "structure" S4 class now has methods that implement the
concept of structures as described in the Blue Book--that
element-by-element functions and operators leave structure
intact unless they change the length. The informal behavior
of R for vectors with attributes was inconsistent.
o The implicitGeneric() function and relatives have been added to
specify how a function in a package should look when methods are
defined for it. This will be used to ensure that generic versions
of functions in R core are consistent. See ?implicitGeneric.
o Error messages generated by some of the functions in the methods
package provide the name of the generic to provide more
contextual information.
o It is now possible to use setGeneric(useAsDefault = FALSE) to
define a new generic with the name of a primitive function
(but having no connection with the primitive).
o showMethods() has a "smart" default for 'inherited' such that
showMethods(, incl = TRUE) becomes a useful short cut.
DEPRECATED & DEFUNCT
o $ on an atomic vector now gives a warning that it is 'invalid'.
It remains deprecated, but may be removed in R >= 2.7.0.
o storage.mode(x) <- "real" and storage.mode(x) <- "single" are
defunct: use instead storage.mode(x) <- "double" and
mode(x) <- "single".
o In package installation, SaveImage: yes is deprecated in
favour of LazyLoad: yes.
o seemsS4Object (methods package) is deprecated in favour of isS4().
o It is planned that [[exact=TRUE]] will become the default in
R 2.7.0.
UTILITIES
o checkS3methods() (invoked by R CMD check) now checks the
arguments of methods for primitive members of the S3 group
generics.
o R CMD check now does a recursive copy on the 'tests' directory.
o R CMD check now warns on non-ASCII .Rd files without an
\encoding field, rather than just on ones that are definitely
not from an ISO-8859 encoding. This agrees with the
long-standing stipulation in 'Writing R Extensions', and
catches some packages with UTF-8 man pages.
o R CMD check now warns on DESCRIPTION files with a non-portable
Encoding field, or with non-ASCII data and no Encoding field.
o R CMD check now loads all the 'Suggests' and 'Enhances'
dependencies to reduce warnings about non-visible objects, and
also emulates standard functions (such as shell()) on
alternative R platforms.
o R CMD check now (by default) attempts to latex the vignettes
rather than just weave and tangle them: this will give a NOTE
if there are latex errors.
o R CMD check computations no longer ignore Rd \usage entries for
functions for extracting or replacing parts of an object, so S3
methods should use the appropriate \method{} markup.
o R CMD check now checks for CR (as well as CRLF) line endings in
C/C++/Fortran source files, and for non-LF line endings in
Makefile[.in] and Makevars[.in] in the package 'src'
directory. R CMD build will correct non-LF line endings in
source files and in the make files mentioned.
o Rdconv now warns about unmatched braces rather than silently
omitting sections containing them. (Suggestion by Bill
Dunlap, PR#9649)
Rdconv now renders (rather than ignores) \var{} inside \code{}
markup in latex conversion.
R CMD Rdconv gains a --encoding argument to set the default
encoding for conversions.
o The list of CRAN mirrors now has a new (manually maintained)
column "OK" which flags mirrors that seem to be OK, only those
are used by chooseCRANmirror(). The now exported function
getCRANmirrors() can be used to get all known mirrors or only
the ones that are OK.
o R CMD SHLIB gains arguments --clean and --preclean to clean up
intermediate files after and before building.
o R CMD config now knows about FC and FCFLAGS (used for F9x
compilation).
o R CMD Rdconv now does a better job of rendering quotes in
titles in HTML, and \sQuote and \dQuote into text on Windows.
C-LEVEL FACILITIES
o New utility function alloc3DArray similar to allocMatrix.
o The entry point R_seemsS4Object in Rinternals.h has not been
needed since R 2.4.0 and has been removed. Use IS_S4_OBJECT
instead.
o Applications embedding R can use R_getEmbeddingDllInfo() to
obtain DllInfo for registering symbols present in the
application itself.
o The instructions for making and using standalone libRmath have
been moved to the R Installation and Administration manual.
o CHAR() now returns (const char *) since CHARSXPs should no
longer be modified in place. This change allows compilers to
warn or error about improper modification. Thanks to Herve
Pages for the suggestion.
o acopy_string is a (provisional) new helper function that
copies character data and returns a pointer to memory
allocated using R_alloc. This can be used to create a copy of
a string stored in a CHARSXP before passing the data on to a
function that modifies its arguments.
o asLogical, asInteger, asReal and asComplex now accept STRSXP
and CHARSXP arguments, and asChar accepts CHARSXP.
o New entry point R_GE_str2col listed in R_ext/GraphicsEngine.h
for external graphics device developers.
o doKeybd and doMouseevent are now exported in GraphicsDevice.h.
o R_alloc now has first argument of type 'size_t' to support
64-bit platforms (e.g. Win64) with a 32-bit 'long' type.
o The type of the last two arguments of getMatrixDimnames (non-API
but mentioned in R-exts.texi and in Rinternals.h) has been
changed to 'const char **' (from char **).
o R_FINITE now always resolves to the function call R_finite in
packages (rather than sometimes substituting isfinite). This
avoids some issues where R headers are called from C++ code
using features tested on the C compiler.
o The advice to include R headers from C++ inside extern "C" {}
has been changed. It is nowadays better *not* to wrap the
headers, as they include other headers which on some OSes
should not be wrapped.
o Rinternals.h no longer includes a substantial set of C headers.
All but ctype.h and errno.h are included by R.h which is supposed
to be used before Rinternals.h.
o Including C system headers can be avoided by defining NO_C_HEADERS
before including R headers. This is intended to be used from
C++ code, and you will need to include C++ equivalents such as
before the R headers.
INSTALLATION
o The 'test-Lapack' test is now part of 'make check'.
o The 'stat' system call is now required, along with 'opendir'
(which had long been used but not tested for). ('make check'
would have failed in earlier versions without these calls.)
o 'evince' is now considered as a possible PDF viewer.
o 'make install-strip' now also strips the DLLs in the standard
packages.
o Perl 5.8.0 (released in July 2002) or later is now required.
(R 2.4.0 and later have in fact required 5.6.1 or later.)
o The C function 'finite' is no longer used: we expect a C99
compiler which will have 'isfinite'. (If that is missing, we
test separately for NaN, Inf and -Inf.)
o A script/executable 'texi2dvi' is now required on Unix-alikes:
it is part of the texinfo distribution.
o Files texinfo.tex and txi-en.tex are no longer supplied in
doc/manual (as the latest versions have an incompatible
licence). You will need to ensure that your texinfo and/or
TeX installations supply them.
o wcstod is now required for MBCS support.
o There are some experimental provisions for building on Cygwin.
PACKAGE INSTALLATION
o The encoding declared in the DESCRIPTION file is now used as
the default encoding for .Rd files.
o A standard for specifying package license information in the
DESCRIPTION License field was introduced, see 'Writing R
Extensions'. In addition, files LICENSE or LICENCE in a package
top-level source directory are now installed (so putting copies
into the 'inst' subdirectory is no longer necessary).
o install.packages() on a Unix-alike now updates
doc/html/packages.html only if packages are installed to
.Library (by that exact name).
o R CMD INSTALL --clean now runs SHLIB --clean to do the clean
up (unless there is a src/Makefile), and this will remove
$(OBJECTS) (which might have been redefined in Makevars).
R CMD INSTALL --preclean cleans up the sources after a
previous installation (as if that had used --clean) before
attempting to install.
R CMD INSTALL will now run R CMD SHLIB in the 'src' directory
if src/Makevars is present, even if there are no source files
with known extensions.
o If there is a file src/Makefile, src/Makevars is now ignored
(it could be included by src/Makefile if desired), and it is
preceded by etc/Makeconf rather than share/make/shlib.mk.
Thus the makefiles read are R_HOME/etc/Makeconf, src/Makefile
in the package and then any personal Makevars files.
o R CMD SHLIB used to support the use of 'OBJS' in Makevars, but
this was changed to 'OBJECTS' in 2001. The undocumented
alternative of 'OBJS' has finally been removed.
o R CMD check no longer issues a warning about no data sets
being present if a lazyload db is found (as determined by the
presence of Rdata.rdb, Rdata.rds, and Rdata.rdx in the 'data'
subdirectory.
BUG FIXES
o charmatch() and pmatch() used to accept non-integer values for
'nomatch' even though the return value was documented to be
integer. Now 'nomatch' is coerced to integer (rather than the
result being coerced to the type of 'nomatch').
o match.call() no longer 'works' outside a function unless
'definition' is supplied. (Under some circumstances it used
to 'work', matching itself.)
o The formula methods of boxplot, cdplot, pairs and spineplot
now attach 'stats' so that model.frame() is visible where
they evaluate it.
o Date-time objects are no longer regarded as numeric by
is.numeric().
o methods("Math") did not work if 'methods' was not attached.
o readChar() read an extra empty item (or more than one) beyond
the end of the source; in some conditions it would terminate
early when reading an item of length 0.
o Added a promise evaluation stack so interrupted promise
evaluations can be restarted.
o R.version[1:10] now nicely prints.
o In the methods package, prototypes are now inherited for the
.Data "slot"; i.e., for classes that contain one of the basic
data types.
o [[i, j]] now works if 'i' is character.
o write.dcf() no longer writes NA fields (PR#9796), and works
correctly on empty descriptions.
o pbeta(x, log.p = TRUE) now has improved accuracy in many cases,
and so have functions depending on it such as pt(), pf() and
pbinom().
o mle() had problems with the L-BFGS-B in the no-parameter case
and consequentially also when profiling 1-parameter models
(fix thanks to Ben Bolker).
o Two bugs fixed in methods that in involve the "..." argument in
the generic function: previously failed to catch methods that
just dropped the "..."; and use of callGeneric() with no arguments
failed in some circumstances when "..." was a formal argument.
o sequence() now behaves more reasonably, although not
back-compatibly for zero or negative input.
o nls() now allows more peculiar but reasonable ways of being called,
e.g., with data=list() or a model without variables.
o match.arg() was not behaving as documented when
several.ok=TRUE (PR#9859), gave spurious warnings when 'arg'
had the wrong length and was incorrectly documented (exact
matches are returned even when there is more than one partial
match).
o The data.frame method for split<-() was broken.
o The test for -D__NO_MATH_INLINES was badly broken and returned
true on all non-glibc platforms and false on all glibc ones
(whether they were broken or not).
o LF was missing after the last prompt when --quiet was used without
--slave. Use --slave when no final LF is desired.
o Fixed bug in initialisation code in 'grid' package for
determining the boundaries of shapes. Problem reported
by Hadley Wickham; symptom was error message:
"Polygon edge not found".
o str() is no longer slow for large POSIXct objects. Its output
is also slightly more compact for such objects; implementation
via new optional argument 'give.head'.
o strsplit(*, fixed=TRUE), potentially iconv() and internal string
formatting is now faster for large strings, thanks to report
PR#9902 by John Brzustowski.
o de.restore() gave a spurious warning for matrices (Ben Bolker)
o plot(fn, xlim=c(a,b)) would not set "from" and "to" properly
when plotting a function. The argument lists to curve() and
plot.function() have been modified slightly as part of the
fix.
o julian() was documented to work with POSIXt origins, but did
not work with POSIXlt ones. (PR#9908)
o Dataset HairEyeColor has been corrected to agree with
Friendly (2000): the change involves the breakdown of the
Brown hair / Brown eye cell by Sex, and only totals over Sex
are given in the original source.
o Trailing spaces are now consistently stripped from \alias{}
entries in .Rd files, and this is now documented. (PR#9915)
o .find.packages(), packageDescription() and sessionInfo()
assumed that attached environments named "package:foo" were
package environments, although misguided users could use such
a name in attach().
o spline() and splinefun() with method = "periodic" could return
incorrect results when length(x) was 2 or 3.
o getS3method() could fail if the method name contained a regexp
metacharacter such as "+".
o help() now uses the name and not the
value of the vector unless it has length exactly one, so
e.g. help(letters) now gives help on 'letters'.
(Related to PR#9927)
o Ranges in chartr() now work better in CJK locales, thanks to
Ei-ji Nakama.
**************************************************
* *
* 2.5 SERIES NEWS *
* *
**************************************************
CHANGES IN R VERSION 2.5.1 patched
INSTALLATION
o doc/manual now includes the texinfo support file epsf.tex which
basic TeX installations often omit.
BUG FIXES
o Attempting to do in-memory serialization of an object requiring
more than 1Gb might have failed.
o Using formals<- on a function whose body was NULL worked
incorrectly. (PR#9758)
o logb() is now strictly a wrapper for log(), so if S4 methods
are set on log(), logb() will also dispatch on them.
o conflicts(where=) did not work correctly. (PR#9760)
o log(x, base) was intended to handle complex 'base' even for
real 'x', but there was a typo in the code to do so.
o Syntax errors would sometimes misreport the error context.
o qt(p, df=1) is now also correct for very small p. (PR#9804)
qt(p, df=2) ditto; also is more accurate for 0 < |p - 0.5| << 1.
qt(*, log.p=TRUE) now is finite and monotone (again!) where possible.
o Several functions including those making use of printCoefmat(),
layout() and sortedXyData() now work correctly with
non-default settings of options("OutDec").
o S4 method dispatch for group generics (and %*%) failed to pass
arguments to methods as promises and so in some circumstances
methods could change their arguments. (Seen for the 'Math'
group with package Matrix.)
o The print() method for "ts" now handles quarterly and monthly
series which do not start at the beginning of a quarter or
month respectively.
o Deserializing raw objects saved using save(..., ascii=TRUE)
now works correctly.
o ISOLatin7 encoding for postscript/PDF has been corrected.
(PR#9845)
o rbind(x,y) and cbind(x,y) did not dispatch properly when x and
y had multiple S3-style classes.
o The workaround for seeking on > 2Gb files did not work correctly
on Unix-alike 32-bit systems. (PR#9883)
o We had identical(NaN, NA_real_) != identical(NA_real_, NaN),
spotted by Petr Savicky.
CHANGES IN R VERSION 2.5.1
NEW FEATURES
o density(1:20, bw = "SJ") now works as bw.SJ() now tries a larger
search interval than the default (lower, upper) if it does not
find a solution within the latter.
o The output of library() (no arguments) is now sorted by library
trees in the order of .libPaths() and not alphabetically.
o R_LIBS_USER and R_LIBS_SITE feature possible expansion of
specifiers for R version specific information as part of the
startup process.
o C-level warning calls now print a more informative context,
as C-level errors have for a while.
o There is a new option "rl_word_breaks" to control the way the
input line is tokenized in the readline-based terminal
interface for object- and file-name completion.
This allows it to be tuned for people who use their space bar
vs those who do not. The default now allows filename-completion
with +-* in the filenames.
o If the srcfile argument to parse() is not NULL, it will be added
to the result as a "srcfile" attribute.
o It is no longer possible to interrupt lazy-loading (which was
only at all likely when lazy-loading environments), which
would leave the object being loaded in an unusable state.
This is a temporary measure: error-recovery when evaluating
promises will be tackled more comprehensively in 2.6.0.
INSTALLATION
o 'make check' will work with --without-iconv, to accommodate
building on AIX where the system iconv conflicts with
libiconv and is not compatible with R's requirements.
o There is support for 'DESTDIR': see the R-admin manual.
o The texinfo manuals are now converted to HTML with a style
sheet: in recent versions of makeinfo the markup such as @file
was being lost in the HTML rendering.
o The use of inlining has been tweaked to avoid warnings from
gcc >= 4.2.0 when compiling in C99 mode (which is the default
from configure).
BUG FIXES
o as.dendrogram() failed on objects of class "dendrogram".
o plot(type ="s") (or "S") with many (hundreds of thousands)
of points could overflow the stack. (PR#9629)
o Coercing an S4 classed object to "matrix" (or other basic class)
failed to unset the S4 bit.
o The 'useS4' argument of print.default() had been broken by an
unrelated change prior to 2.4.1. This allowed print() and
show() to bounce badly constructed S4 objects between
themselves indefinitely.
o Prediction of the seasonal component in HoltWinters() was one
step out at one point in the calculations.
decompose() incorrectly computed the 'random' component for a
multiplicative fit.
o Wildcards work again in unlink() on Unix-alikes (they did not
in 2.5.0).
o When qr() used pivoting, the coefficient names in qr.coef() were
not pivoted to match. (PR#9623)
o UseMethod() could crash R if the first argument was not a
character string.
o R and Rscript on Unix-alikes were not accepting spaces in -e
arguments (even if quoted).
o Hexadecimal integer constants (e.g. 0x10L) were not being parsed
correctly on platforms where the C function atof did not
accept hexadecimal prefixes (as required by C99, but not
implemented in MinGW as used by R on Windows). (PR#9648)
o libRlapack.dylib on Mac OS X had no version information and
sometimes an invalid identification name.
o Rd conversion of \usage treated '\\' as a single backslash in
all but latex: it now acts consistently with the other
verbatim-like environments (it was never 'verbatim' despite
the documentation).
\code{\.} is now rendered as '\.' in all formats, as
documented (it was not the case for latex conversion).
codoc() (and checkDocStyle() and checkDocUsage()) now apply
the same transformations to \usage as Rd conversion does,
so {, % and \\ in strings in usages will now be related
correctly to the help files.
o rbind() failed if the only data frame had 0 rows. (PR#9657)
o [i, j] could sometimes select the wrong column
when j is numeric if there are duplicate column names.
o sample(x, size, replace=TRUE, prob) had a memory leak if
10000 < size <= 100000.
o x <- cbind(1:2); rownames(x) <- factor(c("A",NA)) now longer
segfaults.
o R CMD BATCH no longer assumes Sys.unsetenv() is supported (it
is not on older Solaris systems).
o median() returned a logical result when it was 'NA': it now
returns an NA of appropriate type (e.g. integer or double).
o grep(fixed = TRUE, perl = TRUE) ignored 'fixed', although it
was documented to ignore 'perl'
Same for [g]regexpr and [g]sub.
o getNamespaceExports("base") works again.
o runmed(c(), 1) no longer segfaults.
o qr.coef(QR, b) failed for an LAPACK-produced QR if b was
integer or for an over-determined system.
qr.solve() for an under-determined system produces a
solution with 0 and not NA for columns which are unused.
o segments() was not handling full transparency correctly in PDF.
(PR#9694)
Nor was arrows().
o callGeneric() inside a method with extra arguments {and hence
currently defined via .local()} now works.
o [g]sub(fixed=TRUE, useBytes=FALSE) could substitute in the
wrong place in an MBCS locale.
gregexpr() could give incorrect answers in MBCS locales for
perl = TRUE or fixed = TRUE (unless useBytes = TRUE).
o The legacy quartz() device no longer crashes in locator()
if the user attempts to close the window.
o "CGGStackRestore: gstack underflow" warning is no longer shown
in legacy quartz() device.
o formatC() now limits 'digits' to 50 to avoid problems in
C-level sprintf in some OSes.
o seq.int(x, y, by=z) gave 'x' (and not an error) if
0 > (y-x)/z > -1.
o promptClass() now lists methods, including those for generics in
other attached packages.
o Connection-related functions such as readBin() no longer crash
when supplied with a non-connection object.
o as.character.srcref() didn't handle bad srcref objects cleanly.
o predict.nls() no longer requires 'newdata' to contain exactly
the variable names needed to fit the model: variables used on
the LHS only are no longer required and further variables are
allowed.
o plot.hclust() had a 'out by one' error, and ignored the last
object when computing the window region (and could overrun
arrays).
o deriv() was creating results with double (and not integer) dims.
o The unserialize code (e.g. as called by load()) looked for a
function findPackageEnv() to set a saved package environment.
This was missing, but is now supplied.
o [cr]bind could segfault when creating a list matrix result.
(Reported by Martin Morgan.)
o besselI(x, nu, exp=TRUE) and besselY(x, nu) could give wrong
answers for nu < 0. (Reported by Hiroyuki Kawakatsu.)
o [g]sub could confuse a trailing byte '\' for a backreference
in MBCSs where '\' can occur as a trailing byte (not UTF-8 nor
EUC-JP, but SJIS and the CJK character sets used on Windows).
(PR#9751)
CHANGES IN R VERSION 2.5.0
USER-VISIBLE CHANGES
o apropos(x) and find(x) now both only work for character 'x',
and hence drop all non-standard evaluation behaviour.
o Data frames can have 'automatic' row names which are not
converted to dimnames by as.matrix(). (Consequently, e.g.,
t(.) for such data frames has NULL column names.) This
change leads to memory reductions in several places, but can
break code which assumes character dimnames for data frames
derived from matrices.
No existing R object is regarded as having 'automatic' row
names, and it may be beneficial to recreate such objects via
read.table() or data.frame().
o Using $ on an atomic vector now raises a warning, as does use
on an S4 class for which a method has not been defined.
o The Unix-alike readline terminal interface now does
command-completion for R objects, incorporating the
functionality formerly in package 'rcompletion' by Deepayan
Sarkar. This can be disabled by setting the environment
variable R_COMPLETION=FALSE when starting R (e.g. in
~/.Renviron). (Note that when this is enabled, filename
completion no longer works for file paths containing R
operators such as '+' and '-'.)
NEW FEATURES
o abbreviate() no longer has an 8191 byte limit on the size of
strings it can handle.
o abs(x) now returns integer for integer or logical arguments.
o apropos() has a new argument 'ignore.case' which defaults to
TRUE, potentially matching more than previously, thanks to a
suggestion by Seth Falcon.
o args(), str() and print() now give the argument lists of primitive
functions.
o as.matrix() gains the '...' argument that several packages have
assumed it always had (and S-PLUS has).
o Manipulation of integers as roman numerals via as.roman() in
package utils.
o attr() no longer treats name = NA_character_ as meaning
name = "NA".
o binom.test() now allows a 'fuzz' for calculated integer values
in its x and n arguments.
o boxplot(*, notch = TRUE) now warns when notches are outside
hinges; related to PR#7690.
o New function callCC() providing a downward-only version of
Scheme's call with current continuation.
o capabilities() now has a "profmem" entry indicating whether
R has been compiled with memory profiling.
o colnames<-() and rownames<-() now handle data frames explicitly,
so calling colnames<- on a data frame no longer alters the
representation of the row names.
o commandArgs() has a new 'trailingOnly' argument to be used in
conjunction with --args.
o contour() now passes graphical parameters in '...' to axis()
and box().
o New data set 'crimtab' on Student(1908)'s 3000 criminals.
o cut.default() has a new argument 'ordered_result'.
o .deparseOpts() has two new options: "keepNA" to ensure that
different types (logical, integer, double, character and
complex) of NAs are distinguished, and "S_compatible" to
suppress the use of R-specific features such as 123L and to
deparse integer values of a double vector with a trailing
decimal point.
The 'keepInteger' option now uses the suffix 'L' rather than
as.integer() where possible (unless all entries are NA or
"S_compatible" is also set).
Other deparse options can now be added to "all" (which has not
for some time actually switched on all options).
Integer sequences m:n are now deparsed in that form.
o deparse() and dput() now include "keepInteger" and "keepNA" in
their defaults for the 'control' argument.
o detach() now takes another argument, unload, which indicates
whether or not to unload the package and then only cleans
up the S4 methods if the package successfully unloads.
o There are new constants NA_integer_, NA_real_, NA_complex_ and
NA_character_ to denote NAs of those types, and they will be
used in deparsing in place of as.integer(NA) etc unless
.deparseOpts() includes "S_compatible".
o dev.print() now recognizes 'screen devices' as all those with
an enabled display list, rather than a hard-coded set.
o Objects of class "difftime" are now handled more flexibly. The
units of such objects can now be accessed via a units()
function, which also has a replacement form, and there are
conversion methods to and from numeric, which also allow the
specification of units. Objects of this class can also be
stored in data frames now. A format() method has been added,
and the print method was revised.
o New function environmentName() to give the print name of
environments such as "namespace:base".
This is now used by str().
o New function env.profile() provides R level access to summary
statistics on environments. In a related patch, new.env()
now allows the user to specify an initial size for a hashed
environment.
o file() can read the X11 clipboard selection as "X11_clipboard"
on suitable X11-using systems.
o file("stdin") is now recognized, and refers to the process's
'stdin' file stream whereas stdin() refers to the console.
These may differ, for example for a GUI console, an embedded
application of R or if --file= has been used.
o file_test() is now also available in package utils.
(It is now private in package tools.)
o file.show() gains an 'encoding' argument.
o New functions formatUL() and formatOL() in package utils for
formatting unordered (itemize) and ordered (enumerate) lists.
o The statistics reported when gcinfo(TRUE) are now of the amounts
used (in Mb) and not of the amounts free (which are not really
relevant when there are no hard limits, only gc trigger points).
o New function get_all_vars() to retrieve all the
(untransformed) variables that the default method of
model.frame() would use to create the model frame.
o interaction() has a new argument 'lex.order'.
o initialize() (in methods) now tries to be smarter about
updating the new instance in place, thereby reducing
copying.
o install.packages(dependencies = NA) is a new default, which is
to install essential dependencies when installing from
repositories to a single library. As a result of this change,
update.packages() will install any new dependencies of the
packages it is updating (alongside the package in the same
library tree).
If 'lib' is not specified or is specified of length one and
the chosen location is not a writable directory,
install.packages() offers to create a personal library
directory for you if one does not already exist, and to
install there.
o is.atomic, is.call, is.character, is.complex, is.double (== is.real),
is.environment, is.expression, is.function, is.integer,
is.list, is.logical, is.null, is.object, is.pairlist,
is.recursive, is.single and is.symbol (== is.name) are no
longer internally S3 generic, nor can S4 methods be written
for them.
The "factor" methods of is.integer and is.numeric have been
replaced by internal code.
o Added is.raw() for completeness.
o l10n_info() also reports if the current locale is Latin-1.
o levels<-(), names() and names<-() now dispatch internally for
efficiency and so no longer have S3 default methods.
o .libPaths() now does both tilde and glob expansion.
o Functions lm(), glm() loess(), xtabs() and the default method
of model.frame() coerce their 'formula' argument (if supplied)
to a formula.
o max(), min() and range() now work with character vectors.
o message() has a new argument 'appendLF' to handle messages
with and without newlines. There is a new message class
packageStartupMessage() that can be suppressed separately.
o A new function, method.skeleton() writes a skeleton version of
a call to setMethod() to a file, with correct arguments and
format, given the name of the function and the method signature.
o mode<- and storage.mode<- do slightly less copying.
o nls.control(* , printEval = FALSE, warnOnly = FALSE) are two new
options to help better analyze (non-)convergence of nls(),
thanks to Kate Mullen.
nls() and summary(nls()) now contain more information and also
print information about convergence.
o options(device = ) now accepts a function object as well as
the name of a function.
o pdf() supports new values for 'paper' of "US" (same as
"letter"), "a4r" and "USr" (the latter two meaning rotated to
landscape). postscript() also accepts paper = "US".
o persp() now respects the graphical pars 'cex.axis', 'cex.lab',
'font.axis' and 'font.lab'.
o New faster internal functions pmax.int() and pmin.int() for
inputs which are atomic vectors without classes (called by
pmax/pmin where applicable).
pmin/pmax are now more likely to work with classed objects:
they work with POSIXlt datetimes, for example.
o postscript() now by default writes grey colors (including black
and white) via 'setgray', which gives more widely acceptable
output. There are options to write pure RGB, CMYK or gray via
the new argument 'colormodel'.
o rbind.data.frame() now ignores all zero-row inputs, as well as
zero-column inputs (which it used to do, undocumented). This
is because read.table() can create zero-row data frames with
NULL columns, and those cannot be extended.
o readChar() and writeChar() can now work with a raw vector.
o read.table(), write.table() and allies have been moved to package
utils.
o rgb() now accepts the red, green and blue components in a
single matrix or data frame.
o New utility function RShowDoc() in package 'utils' to find and
display manuals and other documentation files.
o New .row_names_info() utility function finds the number of rows
efficiently for data frames; consequently, dim.data.frame()
has become very fast for large data frames with 'automatic'
row names.
o RSiteSearch() now also allows to search postings of the 'R-devel'
mailing list.
o screeplot() is now (S3) generic with a default method, thanks
to a patch from Gavin Simpson.
o Experimental 'verbose' argument for selectMethod(). Might be
replaced later by a better interface for method selection
inspection.
o Added links to source files to the parsing routines, so that
source() can now echo the original source and comments (rather
than deparsing). This affects example() and Sweave() as well.
o stack() and unstack() have been moved to package utils.
o strptime() now sets the "tzone" attribute on the result if
tz != "".
o str.default() typically prints fewer entries of logical vectors.
o The RweaveLatex driver for Sweave() now supports two new
options: expand=FALSE, to show chunk references in the output,
and concordance=TRUE, to output the concordance between input
and output lines.
o system() now takes the same set of arguments on all platforms,
with those which are not applicable being ignored with a
warning. Unix-alikes gain 'input' and 'wait', and Windows
gains 'ignore.stderr'.
o system.time() and proc.time() now return an object of class
"proc_time" with a print() method that returns a POSIX-like
format with names.
o Sys.getenv() has a new argument 'unset' to allow unset and set
to "" to be distinguished (if the OS does). The results of
Sys.getenv() are now sorted (by name).
o New function Sys.glob(), a wrapper for the POSIX.2 function
glob(3) to do wildcard expansion (on systems which have it,
plus an emulation on Windows).
o Sys.setenv() is a new (and preferred) synonym for Sys.putenv().
The internal C code uses the POSIX-preferred 'setenv' rather
than 'putenv' where the former is available.
o New function Sys.unsetenv() to remove environment variables
(on systems where unsetenv is implemented or putenv can remove
variables, such as on Windows).
o text(), mtext(), strheight(), strwidth(), legend(), axis(),
title(), pie(), grid.text() and textGrob() all attempt to
coerce non-language annotation objects (in the sense of is.object)
to character vectors. This is principally intended to cover
factors and POSIXt and Date objects, and is done via the
new utility function as.graphicsAnnot() in package grDevices.
o tcltk:tk_select.list() now chooses the width to fit the widest item.
o {re,un}tracemem() are now primitives for efficiency and so
migrate from 'utils' to 'base'.
o union(), interect(), setdiff() and setequal() now coerce their
arguments to be vectors (and they were documented only to
apply to vectors).
o uniroot() now works if the zero occurs at one of the ends of
the interval (suggestion of Tamas Papp).
o There is a new function View() for viewing matrix-like
objects in a spreadsheet, which can be left up whilst R is
running.
o New function withVisible() allows R level access to the
visibility flag.
o zip.file.extract() has been moved to package utils.
o A few more cases of subassignment work, e.g. [] <-
and [] <- , with suitable coercion of the LHS.
o There is a warning if \ is used unnecessarily in a string when
being parsed, e.g. "\." where probably "\\." was intended.
("\." is valid, but the same as ".".) Thanks to Bill Dunlap
for the suggestion.
o Introduced the suffix L for integer literals to create
integer rather than numeric values, e.g. 100L, 0x10L, 1e2L.
o Set the parser to give verbose error messages in case of
syntax errors.
o The class "LinearMethodsList" has been extended and will be
used to create list versions of methods, derived from the
methods tables (environments). The older recursive
"MethodsList" class will be deprecated (by the release of
2.5.0 if possible).
o There are more flexible ways to specify the default library
search path. In addition to R_LIBS and .Library, there are
.Library.site (defaults to R_HOME/site-library) and
R_LIBS_USER (defaults to a platform- and version-specific
directory in ~/R). See ?.libPaths for details.
o LAPACK has been updated to version 3.1.0. This should cause
only small changes to the output, but do remember that the sign
of eigenvectors (and principal components) is indeterminate.
o PCRE has been updated to version 7.0.
o Several functions handle row names more efficiently:
- read.table() and read.DIF() make use of integer row names
where appropriate, and avoid at least one copy in assigning
them.
- data.frame() and the standard as.data.frame() methods avoid
generating long dummy row names and then discarding them.
- expand.grid() and merge() generate compact 'automatic' row
names.
- data.matrix() and as.matrix.data.frame() have a new argument
'rownames.force' that by default drops 'automatic' row names.
o [i, j] is substantially more memory-efficient when
only a small part of the data frame is selected, especially
when (part of) a single column is selected.
o Command-line R (and Rterm.exe under Windows) accepts the options
'-f filename', '--file=filename' and '-e expression' to follow
other script interpreters. These imply --no-save unless
--save is specified.
o Invalid bytes in character strings in an MBCS now deparse/print
in the form "\xc1" rather than "", which means they can be
parsed/scanned.
o Printing functions (without source attributes) and expressions
now preserves integers (using the L suffix) and NAs (using
NA_real_ etc where necessary).
o The 'internal' objects .helpForCall, .tryHelp and topicName are
no longer exported from 'utils'.
o The internal regex code has been upgraded to glibc 2.5 (from 2.3.6).
o Text help now attempts to display files which have an \encoding
section in the specified encoding via file.show().
o R now attempts to keep track of character strings which are
known to be in Latin-1 or UTF-8 and print or plot them
appropriately in other locales. This is primarily intended
to make it possible to use data in Western European languages
in both Latin-1 and UTF-8 locales. Currently scan(),
read.table(), readLines(), parse() and source() allow
encodings to be declared, and console input in suitable
locales is also recognized.
New function Encoding() can read or set the declared encodings
for a character vector.
o There have been numerous performance improvements to the data
editor on both Windows and X11. In particular, resizing the
window works much better on X11.
o Packages graphics and grid no longer require grDevices, as
they might be used only with third-party devices.
DEPRECATED & DEFUNCT
o symbol.C() and symbol.For() are defunct, and have been replaced
by wrappers that give a warning.
o Calling a builtin function with an empty argument is now always
an error.
o The autoloading of ts() is defunct.
o The undocumented reserved word GLOBAL.ENV has been removed.
(It was yet another way to get the value of the symbol
.GlobalEnv.)
o The deprecated behaviour of structure() in adding a class when
specifying with "tsp" or "levels" attributes is now defunct.
o unix() is now finally defunct, having been deprecated for
at least seven years.
o Sys.putenv() is now deprecated in favour of Sys.setenv(),
following the POSIX recommendation.
o Building R with --without-iconv is deprecated.
o Using $ on an atomic vector is deprecated (it was previously
valid and documented to return NULL).
o The use of storage.mode<- for other than standard types (and
in particular for value "single") is deprecated: use mode<-
instead.
INSTALLATION
o A suitable iconv (e.g. from glibc or GNU libiconv) is
required. For 2.5.x only you can build R without it by
configuring using --without-iconv.
o There is support again for building on AIX (tested on 5.2 and 5.3)
thanks to Ei-ji Nakama.
o Autoconf 2.60 or later is used to create 'configure'. This
makes a number of small changes, and incorporates the changes
to the detection of a C99-compliant C compiler backported for
2.4.1.
o Detection of a Java development environment was added such that
packages don't need to provide their own Java detection. Newly
added make variables are JAVAC, JAVAH, JAR and JAVA_CPPFLAGS.
R CMD javareconf was updated to look for the corresponding
Java tools as well.
In addition, Java detection honors user-supplied environment
variables JAVA_CPPFLAGS, JAVA_LIBS and JAVA_LD_LIBRARY_PATH.
o Added workaround for reported non-POSIX sh on OSF1. (PR#9375)
o 'make install-strip' now works, stripping the executables and
also the shared libraries and modules on platforms where
'libtool' knows how to do so.
o Building R as a shared library and standalone nmath now
installs pkg-config files 'libR.pc' and 'libRmath.pc' respectively.
o Added test for insufficiently complete implementation of sigaction.
C-LEVEL FACILITIES
o Functions str2type, type2char and type2str are now available in
Rinternals.h.
o Added support for Objective C in R and packages (if available).
o R_ParseVector() has a new 4th argument 'SEXP srcfile' allowing
source references to be attached to the returned expression list.
o Added ptr_R_WriteConsoleEx callback which allows consoles to
distinguish between regular output and errors/warnings.
To ensure backward compatibility it is only used if
ptr_R_WriteConsole is set to NULL.
UTILITIES
o Additional Sweave() internal functions are exported to help
writing new drivers, and RweaveLatexRuncode() is now created
using a helper function (all from a patch submitted by Seth
Falcon).
o The following additional flags are accessible from R CMD config:
OBJC, OBJCFLAGS, JAR, JAVA, JAVAC, JAVAH, JAVA_HOME, JAVA_LIBS
and JAVA_CPPFLAGS.
o R CMD build now takes the package name from the DESCRIPTION
file and not from the directory. (PR#9266)
o checkS3methods() (and hence R CMD check) now checks agreement
with primitive internal generics, and checks for additional
arguments in methods where the generic does not have a '...'
argument.
codoc() now knows the argument lists of primitive functions.
o R CMD INSTALL and R CMD REMOVE now use as the default library
(if -l is not specified) the first library that would be used
if R were run in the current environment (and they run R to
find it).
o There is a new front-end Rscript which can be used for #!
scripts and similar tasks. See help("Rscript") and 'An
Introduction to R' for further details.
o R CMD BATCH (not Windows) no longer prepends
'invisible(options(echo = TRUE))' to the input script. This
was the default unless --slave is specified and the latter is
no longer overridden.
On all OSes it makes use of the -f argument to R, so
file("stdin") can be used from BATCH scripts.
On all OSes it reports proc.time() at the end of the script
unless q() is called with options to inhibit this.
o R CMD INSTALL now prepends the installation directory (if
specified) to the library search path.
o Package installation now re-encodes R files and the NAMESPACE
file if the DESCRIPTION file specifies an encoding, and sets
the encoding used for reading files in preparing for
LazyData. This will help if a package needs to be used in
(say) both latin1 and UTF-8 locales on different systems.
o R CMD check now reports on non-ASCII strings in datasets.
(These are a portability issue, which can be alleviated by
marking their encoding: see 'Writing R Extensions'.)
o Rdiff now converts CRLF endings in the target file, and
converts UTF-8 single quotes in either to ASCII quotes.
o New recommended package 'codetools' by Luke Tierney provides
code-analysis tools. This can optionally be used by 'R CMD
check' to detect problems, especially symbols which are not
visible.
o R CMD config now knows about LIBnn .
o New recommended package 'rcompgen' by Deepayan Sarkar
provides support for command-line completion under the Unix
terminal interface (provided readline is enabled) and the
Windows Rgui and Rterm front ends.
BUG FIXES
o gc() can now report quantities of 'Vcells' in excess of 16Gb on
64-bit systems (rather than reporting NA).
o Assigning class "factor" to an object now requires it has
integer (and not say double) codes.
o structure() ensures that objects with added class "factor" have
integer codes.
o The "formula" and "outer" attributes of datasets 'ChickWeight',
'CO2', 'DNase', 'Indometh', 'Loblolly', 'Orange' and 'Theoph'
now have an empty environment and not the environment used to
dump the datasets in the package.
o Dataset 'Seatbelts' now correctly has class c("mts", "ts").
o str() now labels classes on data frames more coherently.
o Several 'special' primitives and .Internals could return
invisibly if the evaluation of an argument led to the
visibility flag being turned off. These included
as.character(), as.vector(), call(), dim(), dimnames(),
lapply(), rep(), seq() and seq_along(). Others (e.g. dput()
and print.default()) could return visibly when this was not
intended.
o Several primitives such as dim() were not checking the number
of arguments supplied before method dispatch.
o Tracing of primitive functions has been corrected. It should
now be the case that tracing either works or is not allowed
for all primitive functions. (Problems remain if you make a
primitive into a generic when it is being traced. To be fixed
later.)
o max.col() now omits infinite values in determining the
relative tolerance.
o R CMD Sweave and R CMD Stangle now respond to --help and --version
like other utilities.
o .libPaths() adds only existing directories (as it was
documented to, but could add non-directories).
o setIs() and setClassUnion() failed to find some existing
subclasses and produced spurious warnings, now fixed.
o data.frame() ignored 'row.names' for 0-column data frames, and
no longer treats an explicit row.names=NULL differently from
the default value.
o identical() looked at the internal structure of the
'row.names' attribute, and not the value visible at R level.
o abline(reg) now also correctly works with intercept-only lm
models, and abline() warns more when it's called illogically.
o warning() was truncating messages at
getOption("warning.length") - 1 (not as documented), with no
indication. It now appends '[... truncated]'.
o Stangle/Sweave were throwing spurious warnings if options
'result' or 'strip.white' were unset.
o all.equal() was ignoring 'check.attributes' for list and
expression targets, and checking only attributes on raw vectors.
Logical vectors were being compared as if they were numeric,
(with a mean difference being quoted).
o Calculating the number of significant digits in a number was
itself subject to rounding errors for digits >= 16. The
calculation has been changed to err on the side of slightly
too few significant digits (but still at least 15) rather than
far too many. (An example is print(1.001, digits=16).)
o unlink() on Unix-alikes failed for paths containing spaces.
o substr() and friends treated NA 'start' or 'stop' incorrectly.
o merge(x, y, all.y = TRUE) would sometimes incorrectly return
logical columns for columns only in y when there were no
common rows.
o read.table(fn, col.names=) on an empty file returned NULL
columns, rather than logical(0) columns (which is what results
from reading a file with just a header).
o grid.[xy]axis(label=logical(0)) failed.
o expression() was unnecessarily duplicating arguments.
o as.expression() returned a single-element expression
vector, which was not compatible with S: it now copies lists
element-by-element.
o supsmu(periodic = TRUE) could segfault. (PR#9502, detection
and patch by Bill Dunlap.)
o pmax/pmin called with only logical arguments did not coerce to
numeric, although they were documented to do so (as max/min
do).
o methods() did not know that cbind() and rbind() are internally
generic.
o dim(x) <- NULL removed the names of x, but this was always
undocumented. It is not clear that it is desirable but it is
S-compatible and relied on, so is now documented.
o which(x, arr.ind = TRUE) did not return a matrix (as
documented) if 'x' was an array of length 0.
o C-level duplicate() truncated CHARSXPs with embedded nuls.
o Partial matching of attributes was not working as documented
in some cases if there were more than two partial matches or
if "names" was involved.
o data(package=character(0)) was not looking in ./data as
documented.
o summary.mlm() failed if some response names were "" (as can
easily happen if cbind() is used).
o The postscript() and pdf() drivers shared an encoding list
but used slightly different formats. This caused problems if
both were used with the same non-default encoding in the same
session. (PR#9517)
o The data editor was not allowing Inf, NA and NaN to be entered
in numerical columns. It was intended to differentiate
between empty cells and NAs, but did not do so: it now does
so for strings.
o supsmu() could segfault if all cases had non-finite values.
(PR#9519)
o plnorm(x, lower.tail=FALSE) was returning the wrong tail for
x <= 0. (PR#9520)
o which.min() would not report a minimum of +Inf, and
analogously for which.max(). (PR#9522)
o 'R CMD check' could fail with an unhelpful error when checking
Rd files for errors if there was only one file and that had a
serious error. (PR#9459)
o try() has been reimplemented using tryCatch() to solve two
problems with the original implementation: (i) try() would run
non-NULL options("error") expressions for errors within a try, and
(ii) try() would catch user interrupts.
o str(obj) could fail when obj contained a dendrogram.
o Using [, ] <- NULL failed (PR#9565)
o choose(n, k) could return non-integer values for integer n and
small k on some platforms.
o nclass.scott(x) and nclass.FD(x) no longer return NaN when var(x)
or IQR(x) (respectively) is zero.
hist() now allows breaks = 1 (which the above patch will
return), but not breaks = Inf (which gave an obscure error).
o strptime("%j") now also works for the first days of Feb-Dec.
(PR#9577)
o write.table() now recovers better if 'file' is an unopened
connection. (It used to open it for both the column names and
the data.)
o Fixed bug in mosaicplot(sort=) introduced by undocumented
change in R 2.4.1 (changeset r39655).
o contr.treatment(n=0) failed with a spurious error message.
(It remains an error.)
o as.numeric() was incorrectly documented: it is identical to
as.double.
o jitter(rep(-1, 3)) gave NaNs. (PR#9580)
o max.col() was not random for a row of zeroes. (PR#9542)
o ansari.test(conf.int=TRUE, exact=FALSE) failed.
o trace() now works on S3 registered methods, by modifying the
version in the S3 methods table.
o rep(length=1, each=0) segfaulted.
o postscript() could overflow a buffer if used with a long
'command' argument.
o The internal computations to copy complete attribute lists did
not copy the flag marking S4 objects, so the copies no longer
behaved like S4 objects.
o The C code of nlminb() was altering a variable without
duplicating it. (This did not affect nlminb() but would have
if the code was called from a different wrapper.)
o smooth(kind = "3RS3R") (the current default) used .C(DUP =
FALSE) but altered its input argument. (This was masked by
duplication in as.double.)
o The signature for the predefined S4 method for as.character()
was missing '...' .
o readBin() could read beyond the end of the vector
when size-changing was involved.
o The C entry point PrintValue (designed to emulate auto-printing)
would not find show() for use on S4 objects, and did not have
the same search path (for show(), print() and print() methods)
as auto-printing. Also, auto-printing and print() of S4
objects would fail to find 'show' if the methods name space was
loaded but the package was not attached (or otherwise not in
the search path).
o print() (and auto-printing) now recognize S4 objects even when
'methods' is not loaded, and print a short summary rather than
dump the internal structure.
o Sweave and Stangle had problems due to partial matching of code
chunk names when run with split=TRUE.
o install.packages() on a source package now ensures that
R CMD INSTALL sees the same library search path as
install.packages() did when computing dependencies.
o density() now ensures its 'y' values are non-negative. (PR#8876)
o is.finite() and is.infinite() (and many other primitives)
are not internally generic and so do not support S4 methods,
which can no longer be set. (PR#7951)
o nls(algorithm = "port") now accepts a list 'start' argument,
as for the other methods (and as documented).
o Standard errors from the "ar" method of predict() could be
wrong for the last p predictions for models near
non-stationarity. (PR#9614)
**************************************************
* *
* 2.4 SERIES NEWS *
* *
**************************************************
CHANGES IN R VERSION 2.4.1 patched
NEW FEATURES
o The Simplified Chinese translations have been completed.
BUG FIXES
o co.intervals() sometimes failed to cover the largest value.
o tempfile() is now random across sessions as well as within a
session. (On some systems it would give the same hex suffix
at the start of each session.)
o Added infinite recursion test to internal function isMissing.
(PR#9426)
o The "Date" and "POSIXt" methods for cut() were not choosing
the first day of the year for breaks = "years".
(In part, PR#9433.)
o R is now able to deparse/print invalid multibyte strings in
MBCS locales (such as UTF-8) using hex escapes. This means
that e.g. demo(Hershey) works in all such locales.
o optimize() could give incorrect answers in some rare problems
with exact symmetry about the midpoint of the interval
supplied. (PR#9438)
o The residuals from an lm() fit with no coefficients but an
offset were incorrect.
o oneway.test() was expecting a literal formula and did not
accept a variable containing a formula.
o The legacy Quartz device (used by console R) displayed its
window outside the screen estate in some dual-head setups.
Now it will be always displayed in the center of the main
screen.
o read.ftable() was not functional on non-seekable connections
such as URLs.
o Some large memory allocations could cause segfaults or
crashes (e.g. followup to PR#9557).
o Sweave() would drop characters from the end of chunk names
ending in "R". (PR#9567)
o library(), i.e. its internal checkConflicts(), now (again) prints
"The following object(s) are masked .." only once per masked package.
o methods:::cbind(x) {one argument} now works, calling cbind2(x)
when 'x' is an S4 object.
CHANGES IN R VERSION 2.4.1
INSTALLATION
o The extraction of info from Subversion for an SVN checkout now
also works for svn >= 1.4.0. However, on Windows the 'Last
Changed Date' will be in the local timezone, and not in GMT as
previously.
o configure uses code borrowed from autoconf 2.60 to try harder to
ensure that a C99-compliant compiler is used. (It does so by
appending to CC.) This avoids problems with systems such as FC5
which override CFLAGS and thereby lose flags such as -std=gnu99.
NEW FEATURES
o rainbow(), heat.colors(), terrain.colors(), topo.colors() and
cm.colors() all gain an 'alpha' argument to be passed to hsv().
o dput() will give an incorrect representation of the row names
of a data frame with integer row names. This is now corrected
when the object is recreated.
C-LEVEL FACILITIES
o Using STRICT_R_HEADERS applies to more reported clashes with
Windows headers, including Calloc and Realloc. These and
Free need to be prefixed by R_ when STRICT_R_HEADERS is defined.
DEPRECATED & DEFUNCT
o The previously undocumented behaviour of structure() in adding a
class when specifying "tsp" or "levels" attributes is now
deprecated (with a warning).
BUG FIXES
o Fixed warning() to use .dfltWarn intead of .dfltStop for default
handling (PR#9274).
o R would slow down when the product of the length of a vector and
the length of a character vector used to subset it exceeded 2^31.
(PR#9280)
o merge() now allows zero-row data frames.
o add1.lm() had been broken by other changes for weighted fits.
o axis.POSIXct() would sometimes give the wrong labels.
o Help for a method call would fail. (PR#9291)
o gzfile() returned an object of class "file" not "gzfile". (PR#9271)
o load()ing from a connection had a logic bug in when it closed
the connection. (PR#9271)
o The lowess() algorithm is unstable if the MAD of the residuals
becomes (effectively) zero: R now terminates the iterations at
that point. (This may result in quite different answers.)
The 'delta' argument was incorrectly documented. (PR#9264)
o abbreviate() would only work for strings of up to 8191 bytes,
but this was not checked. Now longer strings are errors.
o Drawing X11 rotated text was buggy for VERY small (negative)
angle of rotation. Reported by Ben Bolker. (PR#9301)
o The X11 data editor would crash in an MBCS locale if R was
compiled with FC's CFLAGS that add buffer overflow and
stack-smashing detection.
o rect() was not accepting border=NA in some cases involving
cross-hatching.
o Fixes to S4 group generics to ensure that the correct number of
active arguments are in the signature of the group and all
members. Also a fix to keep the 'groupMembers' slot up to date.
o S4 group generic "Logic" (with '&', '|', but not '!') has been
created, following the green book (apart from '!').
o removeClass() now takes care to remove any subclass references
to the deleted class.
o mle() (in stats4) might not have worked as intended when the
order of parameters in 'start' differed from that in the
log-likelihood. (PR#9313)
o dotchart() now properly restores par() settings after itself.
o system() on Mac OS X was blocking arbitrary signals during the
call although only SIGPROF was meant to be blocked.
o methods cached via callNextMethod() and (sometimes) as() were
being cached as directly specified although in fact they were
inherited. Caused problems in later search for inherited methods.
o str() works properly for method definitions and other S4-classed
function objects.
o JAVA_LIBS are now set correctly on MacOS X.
o Fix null-termination issue suspected of causing crash with Fedora
Extra RPMS (PR#9339, Justin Harrington, analysis and fix from Bill
Dunlap).
o Name spaces restored via a saved session silently failed to cache
their methods because the methods package was not yet
attached. Fixed by attaching methods before restoring data.
o rbind()ing a list to a data frame generated invalid row names,
which were an error in 2.4.0. (PR#9346)
o boxplot.stats(x) now returns the correct minimum instead of an
error for x <- c(1,Inf,Inf,Inf), and hence boxplot(x) "works".
o promptClass() now uses \linkS4class{} instead of
of \link{-class}.
o gc() no longer reports nonsense values for the number of used
Vcells if the true value exceeds 2^31 (and hence over 16Gb of
heap is in use): it now reports NA. (PR#9345)
o rapply() now detects more user errors in supplying arguments. (PR#9349)
o boxplot() was ignoring argument 'boxfill'. (PR#9352)
o plot.lm(which = 6, id.n = 0) did not work. (PR#9333)
o .deparseOpts("delayPromises") was not matching the C code,
returning 64 rather than 32.
o bxp() could use partial matching on 'pars' when finding
defaults for some of its parameters, e.g. a setting of 'cex.axis'
in 'pars' or inline was used to set a default for 'outcex'.
o acf() now allows lag.max = 0 except when type="partial", and
forces the lag 0 autocorrelation to 1. (PR#9360)
o hist(*, include.lowest=., right=., plot=FALSE) does not warn
anymore, (PR#9356) and more.
o Some bugs in caching superclass/subclass relations and in
removing those relations on detach and on removeClass() have
been fixed.
o readBin() could return one too many strings if 'n' was an
over-estimate. (PR#9361)
o A request for an opaque colour in the pdf() device after a
translucent one did not set the transparency back to opaque in
2.4.0.
Semi-transparent background colours were not being plotted on
the pdf() device.
o plot.lm(which=5) in the case of constant leverage re-ordered
the factor levels but not the residuals, so the labelling by
factor level was often incorrect.
o packBits() was not accepting a logical argument. (PR#9374)
o make install was omitting doc/FAQ and doc/RESOURCES.
o A two-sample t.test(x, y, var.equal=TRUE) did not allow one of the
groups to be of size one.
o The "ts" method for print() failed on some corrupted objects
of class "ts", e.g. those without a "tsp" attribute.
o structure() reordered the "class" value given if there was a
"tsp" value specified.
o pairs() now does pass appropriate parts of '...' to the
'diag.panel' argument. (PR#9384)
o plot.lm() was using an incorrect estimate of dispersion for
some GLMs (including family=binomial and family=poisson).
(PR#9316)
o Subsetting operators were setting R_Visible too early, so
assignments in arguments could make the result invisible.
(PR#9263)
o The tk-GUI was displaying a warning due to an extra comma in
the list of manuals (PR#9396)
o packageDescription() now gives an explicit error on a corrupt
DESCRIPTION file.
o There was a scoping issue with tcltk callbacks given as
unevaluated expressions. This has only been partially fixed, a
complete fix probably requires redesign.
o trace() had its return value documented incorrectly and was
sometimes visible when it should not have been.
o pchisq() would sometimes use the wrong tail when calculating
non-central probabilities with lower.tail = FALSE. (PR#9406)
o rm() could remove the wrong objects when passed an expression.
(PR#9399) Now only names are allowed in the '...' argument,
and the incorrect documentation of what happened with
character objects is corrected.
o url() was not supporting 'encoding' except on file:// URLs.
CHANGES IN R VERSION 2.4.0
USER-VISIBLE CHANGES
o The startup message now prints first the version string and
then the copyright notice (to be more similar to R --version).
o save() by default evaluates promise objects. The old behaviour
(to save the promise and its evaluation environment) can be
obtained by setting the new argument 'eval.promises' to FALSE.
(Note that this does not apply to promises embedded in
objects, only to top-level objects.)
o The functions read.csv(), read.csv2(), read.delim(),
read.delim2() now default their 'comment.char' argument to "".
(These functions are designed to read files produced by other
software, which might use the # character inside fields, but
are unlikely to use it for comments.)
o The bindings in the base