# wch/r-source

Fetching contributors…
Cannot retrieve contributors at this time
10277 lines (7066 sloc) 371 KB
 Dear Emacs, please make this -*-Text-*- mode! This file covers NEWS from the release of 2.0.0 up to the release of R-2.10.0. See 'NEWS' (or doc/html/NEWS.html or doc/NEWS.Rd) for subsequent changes. ************************************************** * * * 2.9 SERIES NEWS * * * ************************************************** CHANGES IN R VERSION 2.9.2 patched NEW FEATURES o On systems using ICU for collation (including Mac OS X), using Sys.setlocale() to change the LC_COLLATE setting is more likely to change the collation provided by ICU. BUG FIXES o On systems using zipped data and help (Windows) the names of datasets could clash with temporary filenames used when running examples, causing errors. o as.complex() sometimes warned about NAs on coercions and sometimes not (when the C function asComplex was used, e.g. on list elements). (PR#13942) o cat() on an unopened connection could close it twice, and with file() connections segfaulted on some systems. o Printing a list could segfault if the elements are nested too deeply. CHANGES IN R VERSION 2.9.2 NEW FEATURES o install.packages(NULL) now lists packages only once even if they occur in more than one repository (as the latest compatible version of those available will always be downloaded). o approxfun() and approx() now accept a 'rule' of length two, for easy specification of different interpolation rules on left and right. They no longer segfault for invalid zero-length specification of 'yleft, 'yright', or 'f'. o seq_along(x) is now equivalent to seq_len(length(x)) even where length() has an S3/S4 method; previously it (intentionally) always used the default method for length(). o PCRE has been updated to version 7.9 (for bug fixes). o agrep() uses 64-bit ints where available on 32-bit platforms and so may do a better job with complex matches. (E.g. PR#13789, which failed only on 32-bit systems.) DEPRECATED & DEFUNCT o R CMD Rd2txt is deprecated. (It is just a wrapper for R CMD Rdconv -t txt.) o tools::Rd_parse() is deprecated and will be removed in 2.10.0 (which will use only Rd version 2). BUG FIXES o parse_Rd() still did not handle source reference encodings properly. o The C utility function PrintValue no longer attempts to print attributes for CHARSXPs as those attributes are used internally for the CHARSXP cache. This fixes a segfault when calling it on a CHARSXP from C code. o PDF graphics output was producing two instances of anything drawn with the symbol font face. (Report from Baptiste Auguie.) o length(x) <- newval and grep() could cause memory corruption. (PR#13837) o If model.matrix() was given too large a model, it could crash R. (PR#13838, fix found by Olaf Mersmann.) o gzcon() (used by load()) would re-open an open connection, leaking a file descriptor each time. (PR#13841) o The checks for inconsistent inheritance reported by setClass() now detect inconsistent superclasses and give better warning messages. o print.anova() failed to recognize the column labelled P(>|Chi|) from a Poisson/binomial GLM anova as a p-value column in order to format it appropriately (and as a consequence it gave no significance stars). o A missing PROTECT caused rare segfaults during calls to load(). (PR#13880, fix found by Bill Dunlap.) o gsub() in a non-UTF-8 locale with a marked UTF-8 input could in rare circumstances overrun a buffer and so segfault. o R CMD Rdconv --version was not working correctly. o Missing PROTECTs in nlm() caused "random" errors. (PR#13381 by Adam D.I. Kramer, analysis and suggested fix by Bill Dunlap.) o Some extreme cases of pbeta(log.p = TRUE) are more accurate (finite values < -700 rather than -Inf). (PR#13786) pbeta() now reports on more cases where the asymptotic expansions lose accuracy (the underlying TOMS708 C code was ignoring some of these, including the PR#13786 example). o new.env(hash = TRUE, size = NA) now works the way it has been documented to for a long time. o tcltk::tk_choose.files(multi = TRUE) produces better-formatted output with filenames containing spaces. (PR#13875) o R CMD check --use-valgrind did not run valgrind on the package tests. o The tclvalue() and the print() and as.xxx methods for class "tclObj" crashed R with an invalid object -- seen with an object saved from an earlier session. o R CMD BATCH garbled options -d (useful for valgrind, although --debugger=valgrind always worked) o INSTALL with LazyData and Encoding declared in DESCRIPTION might have left options("encoding") set for the rest of the package installation. CHANGES IN R VERSION 2.9.1 NEW FEATURES o New function anyDuplicated(x) returns 0 (= FALSE) or the index of the first duplicated entry of x. o matplot(), matlines() and matpoints() now also obey a 'lend' argument, determining line end styles. (Wish of PR#13619). o bw.SJ(), bw.bcv() and bw.ucv() now gain an optional 'tol' argument allowing more accurate estimates. o new.packages() no longer regards packages with the same name as a member of an installed bundle as 'new' (this is now consistent with the dependency checks in install.packages()). It no longer reports on partially installed bundles (since members can be updated individually if a bundle is unbundled). o old.packages() and hence updates.packages() will look for updates to members of package bundles before updates to the whole bundle: this allow bundles to be split and installations updated. o nlminb() gives better non-convergence messages in some cases. o S3 method dispatch will support S4 class inheritance for S3 methods, for primitives and via UseMethod(), if the argument S3methods=TRUE is given to setClass(). S4 method dispatch will use S3 per-object inheritance if S3Class() is set on the object. See ?Methods and the paper referenced there. o R CMD INSTALL is more tolerant of (malformed) packages with a 'man' directory but no validly named .Rd files. o R CMD check now reports where options are used that cause some of the checks to be skipped. o RSiteSearch has been updated to be consistent with the new layout of the search site itself, which now includes separate options for vignettes, views, and r-sig-mixed-models, as well as changed names for r-help. (Contributed by Jonathan Baron.) o That R CMD check makes use of a /tests/Examples/-Ex.Rout.save file as a reference result is now documented in 'Writing R Extensions'. DEPRECATED & DEFUNCT o print.atomic() (defunct since 1.9.0) has been removed since it caused confusion for an S4 class union "atomic". o png(type="cairo1") is deprecated -- it was only needed for platforms with 1.0 <= cairo < 1.2. BUG FIXES o The ... argument was not handled properly when ... was found in the enclosure of the current function, rather than in the function header itself. (This caused integrate() to fail in certain cases.) o col2rgb("#00000080", TRUE) would return the background colour. (Reported by Hadley Wickham.) o interaction() now ensures that the levels of the result are unique. o packageDescription() and hence sessionInfo() now report the correct package version also for a non-attached loaded namespace of a version different from the default lib.loc. o smoothScatter() now also works when e.g. xlim[2] < xlim[1]. o Invalid use of sprintf() such as sprintf("%S%") now give an error instead of a segmentation fault, as do very unusual cases such as sprintf("%s", tryCatch(stop(), error=identity)). (It was always documented that misuse could crash R in platform-dependent ways.) o parse_Rd() would mishandle braces when they occurred at the start of a line within an R string in an Rd file (reported by Alex Couture-Beil) or when they occurred in an R comment (reported by Mark Bravington). o readNEWS() missed version numbers with more than one digit. o building R --without-x no longer fails (PR#13665) o printCoefmat(cbind(0,1)) now works too (PR#13677) o bw.SJ(c(1:99, 1e6)) now works too. o Rd2txt() could not handle empty descriptions of items in an Rd file (reported by Mark Bravington), and did not wrap long lists of arguments if they were given in a single item. o stars() would do a partial plot when called with plot = FALSE; it now consistently returns the locations of the stars. o Rd2latex() could not handle empty sections. o old.packages() and hence update.packages() would fail on a repository which contained only one package but with multiple versions of that package. o as.character.Rd() added extra braces when displaying two-argument macros. (Report and fix by Manuel Eugster.) o unsplit() was misbehaving in the case of single-column data frames. (Reported by Will Gray.) o as(I(1), "vector") and similar coercions from objects of "unregistered" S3 classes now work. o srcref records produced by parse() and parse_Rd() did not record the encoding of the source file. (Reported by Romain Francois.) o The X11 version of View() was misbehaving in MBCS locales, and PgUp/PgDn now behave better, thanks to a patch from Ei-ji Nakama. o R CMD check looked at the environment variable PDFLATEX, but as from R 2.8.1 R CMD Rd2dvi used R_PDFLATEXCMD in preference, and that was set by R CMD (and not PDFLATEX). Now R CMD check looks at R_PDFLATEXCMD. o sprintf() now signals an error when the result of single format specification would be longer than the limit (8192 bytes); it would return "somewhat random" results or segfault previously. (PR#13667) Further, arguments of type "language" or "symbol" are no longer allowed, as these, e.g., sprintf("%s", quote(list())), typically lead to unexpected results or hard to understand error messages. o The new (in 2.9.0) 'stringsAsFactors' argument to expand.grid() was not working: it now does work but has default TRUE for backwards compatibility. o tcrossprod(<1d-array>, ) now does work when the arguments are of compatible dimensions. o qbinom() now is accurate also in (large size, small prob) cases. (PR#13711) o The calculation of the Spearman p-value in cor.test() is slightly more accurate in some cases. (PR#13574) o The digamma(), trigamma() and psigamma() functions could be inaccurate for values of x around 1e-15 due to cancellation. (PR#13714). o median.default() was altered in 2.8.1 to use sum() rather than mean(), although it was still documented to use mean(). This caused problems for POSIXt objects, for which mean() but not sum() makes sense, so the change has been reverted. o Assigning an extra 0-length column to a data frame by DF$foo <- value gave a corrupt data frame rather than failing. (PR#13724) This also happened for DF[["foo"]] <- value. o R CMD INSTALL no longer gives a spurious warning about old R versions ignoring multiple dependencies, if the conditions are known to be satisfied. o The test for setting dim() allowed a value with two or more NAs to be set on a 0-length object. (PR#13729) Also, it allowed an even number of negative values. o xtfrm(), rank(), sort() and order() did not always make use of custom comparison methods specific to the class of elements being sorted. o Increase NAMED value on 'seq' value in for() loop so loop code cannot modify 'seq' value. o Prevent rectangles of size < 0.5 pixel from disappearing in Quartz when using rastered backend. (PR#13744) o Printing _NA_complex_ had a low-level thinko; patch thanks to Bill Dunlap. o CP1257 encoding for postscript/PDF has been corrected. (PR#13736) o aov() with an error term was evaluating the ... arguments in 2.9.0 whilst checking their names, so could fail by evaluating them in the wrong place. (PR#13733) o The print() method for arima() failed if all coefs were fixed. o R CMD INSTALL --no-latex was not implemented in 2.9.0 (only). o Added a needed PROTECT call in RunFinalizers to handle cases where the routine is called recursively from a GC in a finalizer. o Constructing error messages about unused arguments in calls to closures no longer evaluates the arguments. o qr(x, LAPACK=TRUE) did not coerce integer x to numeric. o qr.coef() misbehaved in the LAPACK case with a matrix RHS, so that solve(qr(x, LAPACK=TRUE)) gave wrong results. (Found by Avraham Adler, PR#13762 by Ravi Varadhan.) CHANGES IN R VERSION 2.9.0 NEW FEATURES o Package 'Matrix' is now a recommended package contained in the basic R distribution. It provides S4 classes and methods for dense and sparse matrices, often by using the numerical libraries Lapack and from the SuiteSparse collection CHOLMOD, CSparse, and SPQR among others. o pdf() and postscript() gain a 'useKerning' argument to place strings using kerning (which had previously been ignored in display but not in strwidth), based in part on an idea and code from Ei-ji Nakama. The default is TRUE. Kerning involving spaces is now ignored (it was previously only used in the computation of string widths). o seq.default() and seq.int() ensure that the result is within the interval [from, to] even when the last value would previously have been slightly out of range because of the allowance for rounding error in computing the number of elements. o boxplot() gains a simple 'matrix' method, enabling boxplot(mat) instead of boxplot(data.frame(mat)). o zip.file.extract() gains an optional 'dir' argument (but use unzip() instead). o source() with 'encoding' specified (and not as "unknown") marks the encoding of character strings in Latin-1 and UTF-8 locales. o parse(text=z) now marks the encoding of character strings in Latin-1 and UTF-8 locales if 'z' is of known encoding (that is all elements are either ASCII or marked as Latin-1 or UTF-8). o sprintf() does stricter error checking on input formats to avoid passing invalid formats to the OS (which have a tendency to crash under such inputs). o expand.grid() gains a 'stringsAsFactors' argument to ask for automatic conversion of character vectors to factors (which happened for many years but was not previously documented). [This did not actually work prior to R 2.9.1.] o bxp() now computes the 'ylim' including the outliers only if 'outline = TRUE'. (Wish of PR#13196) o barplot() gains a 'args.legend' argument. (Wish of PR#13265). o RweaveLatexSetup() now accepts all (and not just some) options passed through from Sweave() o cumsum(x) and cumprod(x) for double precision x now use a long double accumulator where available and so more closely match sum() and prod() in potentially being more accurate. o plot() methods for "stepfun" (and hence "ecdf") gain an 'col' argument, allowing to set all three colors simultaneously. o Iterating over a factor in a for loop now coerces to a character vector (rather than using the integer codes). o data.frame() now recycles columns of list arguments, not just vectors and factors. o plot.ts(plot.type="multiple") now makes use of *.lab and *.axis graphical parameters (wish of PR#13134 and 13135). o Classes can be exported from a name space using the NAMESPACE file directive 'exportClassPattern' which has the same syntax as 'exportPattern'. o strftime() now converts its first argument with as.POSIXlt() and so is no longer an alias for format.POSIXLt. o body<-() now treats list values consistently with other types: they no longer need to be wrapped in a list() call. o option("pdfbrowser") is now set on Windows as well as on Unix-alikes. o object.size() now returns an object of class "object_size" and has a print() method. o [col/row]Sums(), *Means() now have an additional '...' argument, so that they can more easily be turned into generic functions. o Package 'tools' contains dependsOnPkgs() to compute reverse dependencies. o Strict type checking is now turned on: this catches more internal corruptions, and some badly written contributed code. o There are new functions in package 'tcltk', tk_choose.files(), tk_choose.dir() and tk_messageBox(), analogues of functions available on Windows (the last is an analogue of winDialog). o Sys.glob() now does tilde expansion on all platforms. o read.table() and friends gain a 'fileEncoding' argument to make re-encoding of input just a little bit simpler. o grep() gains an 'invert' argument mimicking 'grep -v/--invert'. o strwrap() now allows a separate prefix for the first line. o grep() has a more efficient sibling grepl() that returns a logical vector. o xfig() has new arguments 'defaultFont' and 'textSpecial' contributed by Sebastian Fischmeister. o parse() and parse_Rd() now point to syntax errors in the reported error context, and include the filename and line and column numbers so smart text editors can jump to the error location. o str(<1d-array>) now writes "[1:n(1d)]" instead of the previous less clear "[, 1:n]". o New function testInstalledPackage() in package 'tools' allows the examples (and if they were installed) any package-specific tests to be run on an installed package. testInstalledPackages() can run all the examples and tests in the standard and/or recommended packages. Also testInstalledBasic() can run the basic tests (if installed). o file.copy() now has a 'recursive' argument. o Errors in setOldClass() will cause a previous definition to be restored. o Ambiguities in class inheritance and method selection resulting from duplicates in superclasses are now resolved by requiring (if possible) consistency with all the superclass inheritance. The rules for method selection have been revised to take advantage of the improved ordering. See ?Methods and the reference there related to inheritance. o New function unzip() in package 'utils' to expand or list zip archives. o Replacement functions for class() and oldClass() will unset the S4 bit when the replacement can't be an S4 object; oldClass() will return the S3 class for S4 objects with slot .S3Class. o clip() takes extra steps to avoid the next graphics call resetting the clip region. o New function sample.int() to provide documented access to the internal part of sample() (sampling from seq_len(n)). o New version of withVisible() for better handling of cases like withVisible(eval.parent(....)). Moved to package 'base' with a view to replace .Internal(eval.with.vis) in source() later. o showClass() which is also used to auto-print class definitions, now mentions the package where the class comes from, if there is one. o simulate(obj) now also works for "glm" objects and for weighted fits, thanks in part to contributions from Ben Bolker and Heather Turner. There is now a means to extend the methods available for "glm" objects, as glm families can have an optional 'simulate' component. o S4 classes that inherit from any of the "structure" classes or from "vector" will turn on methods for all the "Ops" group of functions when the package containing the classes is loaded. See class?structure. o A mechanism now allows S4 classes to inherit from object types "environment", "externalptr" and symbol ("name"). See ?setClass. o demo() gains 'echo' and 'ask' arguments, with defaults similar to example(). o library() no longer checks for the packages merged during the re-organization of 1.9.0. o New function poisson.test() in package 'stats' for exact test of rates and rate ratios. o New function isdebugged() indicates whether its argument has the debug flag set or not. o ls.str() [via print method] now also works when some objects in the environment are missing(). o Subsetting S4-objects (without an explicit "[" method) no longer preserves the class in cases like setClass("C", contains="list"); This reverts a "bug fix" activated in R 2.8.0. o .packages() and .find.packages() no longer check the package info for installed packages with dumped metadata, since this was checked when the package was installed. .packages() only considers such packages to be validly installed (any others were installed in a long-obsolete version of R). Both changes speed up searches in libraries of thousands of packages. o boxplot() uses butt line endings for its median line (suggestion of Uwe Ligges, PR#13553). o S4 objects passed to a non-default S3 method will be converted to a valid S3 object with the S3 class. See the section on inheriting from non-S4 classes in ?Classes. o A new class "nonStructure" has been defined; classes that extend a vector class but that should lose their slots under Math or Ops functions should extend this class. See class?nonStructure. o axis.POSIXct() now plots in the timezone marked for its inputs (if any) rather than in the local time. The latter was a deliberate choice, but is easy to select by removing the 'tzone' attribute. (Suggestion of Dan Kelley.) o A new function classesToAM() returns an adjacency matrix representing the inheritance of the classes specified. Allows better human examination of the patterns, e.g. by using the matrix as input to one of the graph packages (see the documentation). o X11options(antialias = "none") now works, for consistency with X11(). o sprintf() now allows zero-length arguments (with a zero-length result). (Suggestion of Bill Dunlap.) o unlink() is now able to remove broken symbolic links on Unix-alikes. o New selectSuperClasses() utility in package 'methods'. o HoltWinters() now allows parameters alpha and beta to be fixed at 0 and hence beta = FALSE and gamma = FALSE are used to specify restricted models. o A new function smoothScatter() has been added to package 'graphics'. It is appropriate for very dense scatter plots and uses density estimation and color to reflect density of plotting. DEPRECATED & DEFUNCT o allGenerics() is defunct. o Use of allocVector(CHARSXP ...) is defunct and gives an error. o The compatibility define for graphics structure NewDevDesc in GraphicsDevice.h has been removed. o Support for versioned installs (R CMD INSTALL --with-package-versions and install.packages(installWithVers = TRUE)) has been removed. Packages installed with versioned names will be ignored. o The numeric and power(0.5) forms of argument to make.link() which were deprecated in 2.4.0 are now defunct: use power() directly. o Conversion to Sd and Ssgm by R CMD Rdconv is now defunct. o Support for R --gui=gnome is now defunct (and package gnomeGUI has been withdrwan as it used a long-obsolete version of GNOME). o R CMD SHLIB on Windows will call the first target (not 'all') in Makevars[.win] in future versions: so make 'all' the first target if you have any. UTILITIES o R CMD build now also uses a Makevars[.win] file for cleaning up src/. o R CMD Rd2dvi and R CMD check are now able to cope with Cyrillic characters in UTF-8 if environment variable _R_CYRILLIC_TEX_ is set to a non-empty value and the latex system has suitable fonts (thanks to a hint from Alexey Shipunov). o New function rtags() in package 'utils' that provides etags-like indexing capabilities for R code files. New front-end script R CMD rtags provides an interface to the rtags() function (see R CMD rtags --help for details). o New environment variable R_TEXI2DVICMD to hold the path (if any) to 'texi2dvi' found at configure time: this now provides the default to option("texi2dvi"). o massage-Examples.pl has been replaced by the R function tools:::massageExamples(). o R CMD REMOVE now uses remove.packages() and hence removes all members of a bundle. o R CMD SHLIB is now an R script and has a new option -n aka --dry-run to show what commands would be run. The same code is used on Unix and Windows. o R CMD Rdconv has new options --package and --version to set the corresponding fields in HTML conversion. o R CMD check runs the package tests with a custom startup file, currently containing 'options(useFancyQuotes = FALSE)'. Those tests are run by an R script: using a tests/Makefile (undocumented) no longer works. o R CMD config now knows about DYLIB_EXT and SHLIB_EXT, for use in configure files. o R CMD BATCH has a new option --no-timing to suppress printing out the session timing. o R CMD Rd2dvi can now work on an installed package. o R CMD check no longer loads package 'tcltk' when checking for code problems, so more problems may be reported. o For R CMD SHLIB on Windows the default 'all' target only makes the DLL, and no longer call targets 'before' and 'after'. Rd CONVERSION o Rd files have an optional \Rdversion{} section, which if missing defaults to 1.0. There is support for version 1.1, a slightly modified version with the following changes: - The warnings for \code{} inside example are suppressed. - Whitespace between arguments in \item and \section is accepted without a warning (see below). -$ is treated literally in text, even for latex conversions. - \ is only an escape before % { } \ . - \R, \dots and \ldots can be followed by {}, and it is recommended that they when not followed by whitespace. - The obsolete interpretation of \Alpha etc is no longer done. o Rd conversion now handles ^ ~ < > | correctly in non-code environments (such as \samp), and # and _ even in latex conversion (but $still needs to be escaped in version 1.0). o Whitespace between first and second arguments is now accepted for \item and \section, e.g. \item{foo} {some value}. Previously arguments after whitespace were silently ignored, and a warning is given for version 1.0 files. o The Rd files created by prompt() and friends are declared to be version 1.1. o \alias now supports the escaping of { as well as of %, and this is recommended. o parse_Rd(), an experimental parser for Rd files, and Rd2txt(), Rd2HTML(), Rd2latex() and Rd2ex(), even more experimental converters, have been added to package 'tools'. o R CMD check runs the package's Rd files through parse_Rd() for a stricter syntax check. This can be suppressed by setting _R_CHECK_RD_PARSE_ to FALSE. o Added markup \verb, which displays like \code, but parses as verbatim text. Currently only supported by parse_Rd() and Rd2HTML(). INSTALLATION o The shell used by the 'R' script and other shell scripts intended to be run directly can be specified at installation time by setting the (precious) configure variable R_SHELL. o libtool has been updated to 2.2.6a. o --with-ICU is now the default: this means that ICU will be used for collation on Mac OS >= 10.4. o make install-tests can be used to install the test files, to allowed an installed version of R to be tested -- see the R-admin manual. This is also supported by the function testInstalledPackages() in package 'tools'. o 'make install' using a parallel make should now work. o 'make check' now always re-makes and re-runs the package examples, which are now collated in the locale's order (and not ASCII order). o configure will now set the default optimization level for gfortran on x86_64 Linux to -O as -O2 has caused problems with gfortran 4.3.x. PACKAGE INSTALLATION o install.packages() is able to infer that repos=NULL was intended from the extension on the file name specified as 'pkgs'. On Mac OS X it now supports local binary packages with .tar.gz extension. Nonetheless .tgz remains the preferred extension and is expected in repositories. It now checks >= version dependencies for dependent packages, and so will install a newer version of a dependency if needed and available on the repositories. The library being installed into is considered when looking for installed packages if it is not already part of .libPaths() (as INSTALL already does). It has a new argument 'Ncpus' to support parallel installs of source packages. o HTML links will be resolved first to the standard packages: this avoids other installed packages diverting help on e.g. qr() and plot() to themselves. The HTML files are only "touched" if they have changed. o A check is done that the R files can be parsed: this both prevents a broken package without lazy-loading from being installed and gives better diagnostics. o install.packages() gains a 'configure.vars' argument, and both this and 'configure.args' get their defaults from options(). o There is a unified R script for INSTALL on both Unix-alike and Windows that takes option names used by either in the past. It adds --no-multiarch to disable building other than the main sub-architecture, and allows multiple instances of --configure-args and --configure-vars (which will be concatenated). New option --install-tests will install any package-specific tests. o Times in the Packaged: and Built: fields are now recorded in UTC, and in most cases in ISO 8601 format. C-LEVEL FACILITIES o A helper function, asCharacterFactor, converts from factors to character vectors. BUG FIXES o The postscript() output for setting text is faster and smaller. o Subsetting a data frame with duplicate column names without selecting columns (e.g. z[i,]) no longer makes the column names unique. This was never documented, but some packages have assumed it. o data.frame() no longer ignores row names on objects if the first name is empty. (PR#13230: this has been the behaviour for a long time, but apparently undocumented.) o deparse(control="S_compatible") now never uses backticks. o X-spline drawing is improved for cases where the control points are located well off the edges of the device. The symptom of this problem is the error "reached MAXNUMPTS". o exists() with mode= "any" will no longer run an active binding's function. o format(c(1 + 2i, NA)) no longer has extraneous space in " NA". o mood.test() could fail in 2.8.x on large samples because of integer overflow. o heatmap() without a dendrogram could fail. (PR#13512) o Checks for missing values will no longer occasionally result in an infinite loop or stack overflow error, depending on the compiler. Active bindings are now always considered to be non-missing. o Rd conversion was not accepting \p (as in \pkg} or (when using Perl 5.10.x) \k (as in \kbd) in any preamble text in a \value{} section, since those are nowadays interpreted by Perl. (PR#13575) o if(as.raw(1)) TRUE now works as expected. (PR#13630) Also, c(as.raw(12), TRUE) or c(raw(3), pi) do. o duplicated(, incomparables = NA) now gives the intended error message. (PR#13632) o name handling of as.data.frame() has been sanitized somewhat o Evaluating an assignment expression with a string on the left hand side no longer destructively changes the string to a symbol in the expression. ************************************************** * * * 2.8 SERIES NEWS * * * ************************************************** CHANGES IN R VERSION 2.8.1 patched NEW FEATURES o R CMD check has a new argument '--install-args' to pass command-line arguments to INSTALL. E.g. --install-args="--docs=normal" on Windows if the HTML Help Workshop is not installed. o R-Forge has been added to R_HOME/etc/repositories, so it will be available interactively in setRepositories(). o The compiled loess() code has been updated to the current version of dloess from Netlib. This includes patches from Ben Tyner which correct some errors when degree = 0 and hence solve PR#13570. INSTALLATION o --with-ICU is now supported (and recommended) on Mac OS X using Apple's supplied port. Note however that the locale category LC_COLLATE cannot be changed whilst R is running on Apple's version of ICU. Configure supports a wider range of ICU versions on other OSes: version 3.0 should suffice, and 3.2, 3.8 and 4.0 have been tested. BUG FIXES o grid-based plots no longer reset the base text size to the default 96dpi in cairo-based bitmap devices. o Rd conversion was incorrectly parsing \\\* and \\\{ (and other cases with an odd number of backslashes greater than one). Text conversion of \code{\ etc} was incorrect (a single backslash stands for itself inside \code). \code{} inside \examples{} is now fixed up (but the warning remains, since it will be handled incorrectly in earlier versions of R). o as.matrix.data.frame() could fail if coercion changed the dimension of one of the columns (as e.g. the coercion of a "Surv" object to a character vector does). o When extracting part of a complex list structure using [[]] with a vector index, the extracted part was not marked for duplication on change. (PR#13411) o Assigning an additional element to a pairlist/language element by x[["foo"]] <- value did not name the additional element. o .Call() and .External() were not accepting "NativeSymbolInfo" and "NativeSymbol" objects as claimed. (Patch from Olaf Mersmann.) o codoc() was missing some default value mismatches with unescaped backslashes, e.g. final="\\" needs to be written as final="\\\\" in the Rd file. The reports on values now give strings in the original quoted format (with \ and " escaped). o The$<- method for pairlists (including language objects) failed to duplicate if NAMED was 2. o read.table(blank.lines.skip = FALSE) gave a final empty row on files with less than 5 lines (PR#13433). o Workaround for a bug in some versions of iconv that was seen with output lines of more than 10,000 bytes and with re-encoding requested on an output connection. o The fullrefman.{dvi,pdf} duplicated part I in part II (at least on some systems). o cbind() could crash with a zero-length input and a list result. o pdf(colormodel = "gray") was setting the stroke colour for fills. o file.show() with multiple files would only show multiple copies of the first one. (PR#13469) o formatC(mode = "character") was documented to work, but did not. (PR#13474) o besselI(x,.., expon.scaled=TRUE) now gives accurate results for x < 1e5 whereas it previously underflowed for x >~= 1500. Further, besselJ(x,..) also computes up to 1e5 (instead of 1e4). o str() was incorrectly warning about its option component 'formatNum' set by strOptions(). o nls(algorithm = "port") did not accept the [factor] notation. (PR#13650) o The relational (aka "comparison") operators are now binary, also in a lower level sense, and an expression as "<"(1) is now erronous. o The 'offset' argument for lm() and glm() is not longer documented to be allowed to be of length 1: this has not been true for a long time. o format.info(x) is now also correct when x has no finite content. o predict.lm() now works correctly when the fit had more than one offset (possibly specified both in the formula and as an argument). This function is called by predict.glm(), so the same isses are corrected there. o besselI(x, nu) with nu a negative integer (a singular case) is now correct. (PR#13556) CHANGES IN R VERSION 2.8.1 NEW FEATURES o sum() now has a method for "difftime" objects (via the Summary group). max(), min() and range() applied to "difftime" object(s) now return a result in the common units of the objects, if there is one. o installed.packages() is now tolerant of malformed DESCRIPTION files in installed packages (it ignores them, with a warning). o qt() now works for 0 < df < 1. o For consistency with matrix() and array(), dimnames(x) <- list() removes the dimnames (as assigning NULL would do). It was previously an error. o nlminb() copies names from 'start' to the parameter vector used (for consistency with optim()). o legend() gains a 'title.col' argument: the title colour was previously set from the first element of 'text.col' (which remains the default). o In an Rd file, use of top-level \itemize{} inside a \value{} block is unnecessary and almost always gave a faulty conversion. Most cases are now detected and corrected, but give a warning as such code will not work correctly in earlier versins of R. Also, use of \code{} inside a code block such as \examples{} will give a erroneous conversion that is now detected and warned against. o Autoflushing of stdout is turned on when Rd processing, so warnings/error are likely to appear in the right place in redirected output (such as that from R CMD check). UTILITIES o R_PDFLATEXCMD is added to the environment variables set by 'R CMD' and is used by R CMD Rd2dvi. R_LATEXCMD, R_PDFLATEXCMD, R_MAKEINDEXCMD and R_DVIPSCMD default to 'latex', 'pdflatex', 'makeindex' and 'dvips' respectively if no suitable executable was found at configure time (since they might well be available at run time, particularly for binary installations of R). This affects R CMD Rd2dvi and help(offline=TRUE). R CMD Rd2dvi now gives an explicit error message if latex (or pdflatex) fails. R CMD Rd2dvi gains a --no-index argument: processing some special characters on PDF indices gave errors which used to be ignored. DEPRECATED & DEFUNCT o R CMD INSTALL --with-package-versions is deprecated (and support has always been incomplete on Windows). So is install.packages(installWithVers = TRUE). o Rd conversion to Sd and Ssgm is now deprecated as we no longer have any means to check the results (and Sd is long obsolete). BUG FIXES o add1.glm() no longer warns if applied to a binomial glm with a factor response. o aggregate.data.frame() now does something sensible with a zero-column 'x' rather than failing with an obscure error message. It gives an explicit error message if called with a zero-row 'x'. o integrate() now accepts integer results from f(): as documented, but only double was accepted. o contrib.url() produced an incorrect URL for the type "mac.binary". o pairwise.wilcox.test() did not pass on the 'paired' argument (caught by Matthias Kohl) o bmp(), jpeg(), and png() on unix with type="cairo" would segfault on closure if the output file could not be opened. o tiff() on unix would not write the output file for the first page when multiple pages were plotted. o str(1 + structure(1, class = "test")) no longer recurses indefinitely. o pf(x, .., ncp, lower.tail=FALSE, log=TRUE) is much more accurate for large x now. o dev2bitmap() failed in 2.8.0 if 'taa' and 'gaa' were both NA. o Under rare circumstances equality tests for character strings could fail to report equality in 2.8.0 in the same way as 2.7.2. (This needed a current encoding of Latin-1 or UTF-8, one string whose encoding was marked as that encoding and one that was marked as "unknown". In that circumstance the two strings are not actually known to be equal, but earlier versions of R assumed that "unknown" meant the current encoding, and this is done once again.) o R CMD config could echo messages from GNU make if called from within a Makefile (as e.g. package Rcpp did), especially from within a parallel make run. o Rounding error could affect window(extend=TRUE) when applied to monthly series. (PR#13272) o Offline help on a Unix-alike now works even if options "latexcmd" and "dvipscmd" contain spaces (e.g. "dvips -Pmy_printer"). Informative error messages are given if running latex or dvips fail. o Using plot.lm() on a "glm" object since 2.7.1 with which=5 caused the Pearson rather than deviance residuals to be used in which=2 or 3 (including in the default case). (Thanks to Effie Greathouse and Greg Snow.) plot.lm() did not report on omitting observations with leverage one if they also had residual exactly zero. This was seen in example(occupationalStatus). o deparse(nlines=) no longer pads short results with blank lines. (PR#13299) o legend(xpd=) now restores 'xpd' correctly. (PR#12756) o The "formula" method for lines() now works if 'subset' is supplied and no 'data' argument (as that for points() did). o Sweave() now takes the defaults for the options 'pdf.version' and 'pdf.encoding' of its RweaveLatex driver from pdf.options(). o prettyNum(x, drop0trailing=TRUE) treated "1.1e20" as "1.1e2" and hence str() did as well, in 2.8.0 only. o dchisq(x, df, ncp) no longer hangs for large x and ncp > 0, and is more accurate in some cases (PR#13309). o installed.packages(lib.loc = D, priority="NA") now also works when D contains a single package. (PR#13332) o legend(...., merge=TRUE) now warns and has no effect in the case where no line segments are drawn. (PR#13340) o transform.data.frame() works better when two or more columns are added. o Deparsing argument lists with non-syntactic names (e.g. that for transform()) now uses backticks rather than double quotes to produce syntactically valid output. o matrix() failed to check for 0-length 'dimnames': it now treats them as NULL (as array did). (PR#13361) o 0^NA is now NA, not Inf, consistent with x^NA, x != 1. o anova.mlm() did not work if T had only one row (including e.g. the case M = ~1). o axis.POSIXct() mislabelled for some time ranges of a few hours (reported by Martin Becker). o mantelhaen.test() with 'exact=FALSE' was not respecting 'alternative'. It now does one-sided tests similarly to prop.test(). o anova.mlm() had trouble with some designs where near-zero rows of the tranformation matrix were not removed (caught by Nils Skutara). o Rd conversion was handling expressions like '\item{foo}{see \eqn{x}}' (with one argument to \eqn immediately followed by a right brace) incorrectly, sometimes giving a spurious warning about 'missing text'. o R CMD INSTALL used the C locale to install the DESCRIPTION file, and so escaped non-ASCII characters in packages with a declared encoding of "latin1" or "UTF-8". (However, the installed DESCRIPTION file was rarely used since the dumped metadata are available.) o xspline() now respects inline par settings. It and grid.xspline() now handle the special case of only two control points, and splines with control points that are located well outside the device (e.g., a zoomed view of a larger curve). (Both cases were giving the error "reached MAXNUMPTS"). o In setClass("C", contains="list"); x <- new("C", 1:3), x[2:3] now remains of class "C". So does rep(x, 2) or rep.int(x, 3). [NOTE: This "feature" has been reverted for R 2.9.0, see above] o median.default() now also works for "numeric"-like vectors. o The pdf() device can now handle the case where an image uses a very large number of colours with different levels of semi-transparency (alpha-values). It used to segfault. (Also PR#13264.) o window() failed to apply a fuzz to 'start' or 'end' and so sometimes warned incorrectly for time series with 'freq' not a power of two (e.g. 12 or 24). o unique.default() now preserves the "tzone" attribute on "POSIXct" objects. o If all the packages had dependency lists of equal lengths, occasionally install.packages() would compute an incorrect sort order. o col(x, as.factor=TRUE) and row(x, as.factor=TRUE) would fail if x had no column (row) names. It was documented incorrectly, and now returns a matrix factor. o setRepositories() failed if "pkgType" was set to "mac.binary.leopard". o formals<-() changed the body of the function if this was a length-one list. o body<-() failed if the function had no arguments. It now warns if discarding elements from a 'value' of type "expression". o qr.coef() failed in the complex case for non-square systems. (PR#13305) o plot.dendrogram(horizontal=TRUE) did not not plot 'edgetext' at the correct locations. (PR#13313) o The starting point for plot.acf(ci.type="ma") was lag 0 when it should have been lag 1. (PR#13071) o There was an obscure bug with srcrefs, which could put the parser into a condition giving "Error: bad value" on any input CHANGES IN R VERSION 2.8.0 SIGNIFICANT USER-VISIBLE CHANGES o var(), cov(), cor(), sd() etc now by default (when 'use' is not specified) return NA in many cases where they signalled an error before. NEW FEATURES o abbreviate() gains an optional argument 'strict' allowing cheap and fast strict abbrevation. o The "lm" methods of add1(), anova() and drop1() warn if they are mis-used on an essentially exact fit. o as.array() is now generic, gains a '...' argument. o New function as.hexmode() for converting integers in hex format. format.hexmode() and as.character.hexmode() gain an 'upper.case' argument. o bitmap() and dev2bitmap() gain support for anti-aliasing. The default type has been changed to 'png16m', which supports anti-aliasing. o Box.test() gains a 'fitdf' argument to adjust the degrees of freedom if applied to residuals. o browseURL() has a new argument 'encodeIfNeeded' to use URLencode() in cases where it seems likely that would be helpful. (Unfortunately, those are hard to guess.) o by() gains a 'simplify' argument, passed to tapply(). o capabilities() gains a new argument "tiff" to report if tiff() is operational. o chol2inv() now treats as a [1 x 1]-matrix. o cov() and cor() have the option 'use = "everything"' as default, and so does var() with its default 'na.rm = FALSE'. This returns NA instead of signalling an error for NA observations. Another new option is 'use = "na.or.complete"' which is the default for var(*, na.rm=FALSE). var(double(0), na.rm= L) now returns NA instead of signalling an error, for both L = TRUE or FALSE, as one consequence of these changes. o data.matrix() now tries harder to convert non-numeric columns, via as.numeric() or as(, "numeric"). o dev.interactive() is able to recognize the standard screen devices if getOption("device") is a function (as well as by name). o dev.new() gains a '...' argument which can be used to pass named arguments which will be used if appropriate to the device selected. o dimnames(x) <- value extends 'value' if it a list and too short, and 'x' is an array. This allows constructions such as dimnames(x)[[1]] <- 1:3 to work whether or not 'x' already has dimnames. o format(), formatC() and prettyNum() gain a new argument 'drop0trailing' which can be used to suppress trailing "0"s. o format() now works for environments; also print(env) and str(env) share the same code for environments. o It is now possible to create and open a text-mode gzfile() connection by explicitly using e.g. open="rt". o New help.request() function for compiling an e-mail to R-help according to "the rules". It is built on the new utility, create.post() on which also bug.report() is based now; both thanks to a contribution by Heather Turner. o help.search() now assumes that non-ASCII items are in latin1 if that makes sense (all known examples on CRAN are). o HoltWinters() and decompose() use a (statistically) more efficient computation for seasonal fits (they used to waste one period). o intToUtf8() and intToBits() now accept numeric vectors, truncating them to integers. o is.unsorted() gains an argument 'strictly'. It now works for classed objects with a >= or > method (as incorrectly documented earlier). o library() no longer warns about the masking objects that are identical(.,.) to those they mask. o lockBinding(), unlockBinding(), lockEnvironment() and makeActiveBinding() now all return invisibly (they always return NULL). o mood.test() now behaves better in the presence of ties. o na.action() now works on fits of classes "lm", "glm", .... o optim(.., method="SANN", .., trace=TRUE) is now customizable via the 'REPORT' control argument, thanks to code proposals by Thomas Petzoldt. o The 'factory-fresh' defaults for options("device") have been changed to refer to the devices as functions in the grDevices namespace and not as names. This makes it more likely that the incorrect (since R 2.5.0) assumption in packages that get(getOption("device"))() will work will catch users of those packages. o pch=16 now has no border (for consistency with 15, 17, 18) and hence is now different from pch=19. o pdf() has new arguments 'useDingbats' (set this to FALSE for use with broken viewers) and 'colormodel'. It now only references the ZapfDingbats font if it is used (for small opaque circles). The default PDF version is now 1.4, since viewers that do not accept that are now rare. Different viewers were rendering consecutive text() calls on a pdf() device in different ways where translucency was involved. The PDF generated has been changed to force each call to be rendered separately (which is the way xpdf or ghostscript was rendering, but Acrobat was forming a transparency group), which is consistent with other graphics devices supporting semi-transparency. o plot.dendrogram() has new arguments (xlim, ylim) which allows zooming into a hiearchical clustering dendrogram. o plot.ecdf() now defaults to pch=19 so as to better convey the left-closed line segments. o plot.histogram() gains an 'ann' argument. (Wish from Ben Bolker.) o plot() now warns when it omits points with leverage one from a plot. o Plotmath now recognizes 'aleph' and 'nabla' (the Adobe Symbol 'gradient' glyph) as symbol names. o polyroot() no longer has a maximum degree. o The alpha/alphamax argument of the 'nls' and 'mle' profile() methods is used to compute confidence limits for univariate t-statistics rather than a confidence region for all the parameters (and not just those being profiled). o quantile.default() allows 'probs' to stray just beyond [0, 1], to allow for computed values. o New functions rawConnection() and rawConnectionValue() allow raw vectors to be treated as connections. o read.dcf() now consistently gives an error for malformed DCF. o read.fwf() no longer passes its default for 'as.is' to read.table(): this allows the latter's default to be used. o readBin(), writeBin(), readChar() and writeChar() now open a connection which was not already open in an appropriate binary mode rather than the default mode. readLines(), cat() and sink() now open a connection which was not already open in an appropriate text mode rather than the default mode. o readCitationFile() (and hence citation) now reads a package's CITATION file in the package's declared encoding (if there is one). o The behaviour of readLines() for incomplete final lines on binary-mode connections has been changed to be like blocking rather than non-blocking text-mode connections. o A new reorder.character() method has been added. This allows use of 'reorder(x, ...)' as a shorthand for 'reorder(factor(x), ...)' when 'x' is a character vector. o round() now computes in long doubles where possible so the results are more likely to be correct to representation error. o rug() now uses axis()'s new arguments from 2.7.2, hence no longer draws an axis line. o save() (optionally, but by default) checks for the existence of objects before opening the file/connection (wish of PR#12543). o segments(), arrows() and rect() allow zero-length coordinates. (Wish of PR#11192) o set.seed(kind=NULL) now takes 'kind' from a saved seed if the workspace has been restored or .Random.seed has been set in some other way. Previously it took the 'currently used' value, which was "default" unless random numbers had been used in the current session. Similarly for the values reported by RNGkind(). (Related to PR#12567.) set.seed() gains a 'normal.kind' argument. o setEPS() and setPS() gain '...' to allow other arguments to be passed to ps.options(), including overriding 'width' and 'height'. o setTimeLimit() function to set limits on the CPU and/or elapsed time for each top-level computation, and setSessionLimit() to set limits for the rest of the session. o splinefun() has a new method = "monoH.FC" for monotone Hermite spline interpolation. o sprintf() optionally supports the %a/%A notation of C99 (if the platform does, including under Windows). o str()'s default method gains a 'formatNum' function argument which is used for formatting numeric vectors. Note that this is very slightly not backward compatible. o The summary() method for class "ecdf" now uses a print() method rather than printing directly. o summary.manova() uses a stabler computation of the test statistics, and gains a 'tol' argument to allow highly correlated responses to be explored (with probable loss of accuracy). Similar changes have been made to anova.mlm() and anova.mlmlist(). o Sweave() now writes concordance information inside a \Sconcordance LaTeX macro, which allows it to be inserted into PDF output. o system.time() now uses lazy evaluation rather than eval/substitute, which results in more natural scoping. (PR#11169) o In table(), 'exclude=NULL' now does something also for factor arguments. A new 'useNA' argument allows you to control whether to add NA levels unconditionally or only when present in data. A new convenience function addNA() gives similar functionality by adding NA levels to individual factors. o unlink() tries the literal pattern if it does not match with wildcards interpreted -- this helps with e.g. unlink("a[b") which previously needed to be unlink("a\\[b"). o update.packages() gains an argument 'oldPkgs', where new.packages() and old.packages() get 'instPkgs'. These allow consideration of only subsets of packages instead of all installed ones. o which(b) is somewhat faster now, notably for named vectors, thanks to a suggestion by Henrik Bengtsson. o New generic function xtfrm() as an auxiliary helper for sort(), order() and rank(). This should return a numeric vector that sorts in the same way as its input. The default method supports any class with ==, > and is.na() methods but specific methods can be much faster. As a side-effect, rank() will now work better on classed objects, although possibly rather slowly. o X11() and capabilities("X11") now catch some X11 I/O errors that previously terminated R. These were rare and have only be seen with a misconfigured X11 setup on some versions of X11. o The handling of nuls in character strings has been changed -- they are no longer allowed, and attempting to create such a string now gives a truncation warning (unless options("warnEscapes") is false). o The user environment and profile files can now be specified via environment variables 'R_ENVIRON_USER' and 'R_PROFILE_USER', respectively. o ?pkg::topic and ?pkg:::topic now find help on 'topic' from package 'pkg' (and not help on :: or :::). o ??topic now does help.search("topic"); variations such as ??pkg::topic or field??topic are also supported. o There is support for using ICU (International Components for Unicode) for collation, enabled by configure option --with-ICU on a Unix-alike and by a setting in MkRules on Windows. Function icuSetCollate() allows the collation rules (including the locale) to be tuned. o If S4 method dispatch is on and S4 objects are found as attributes, show() rather than print() is used to print the S4 attributes. o Starting package tcltk without access to Tk (e.g. no available display) is now a warning rather than an error, as Tcl will still be usable. (On most platforms it was possible to inhibit Tk by not having DISPLAY set, but not on Windows nor Mac OS X builds with --with-aqua.) o Using $on a non-subsettable object (such as a function) is now an error (rather than returning NULL). o Hexadecimal numerical constants (such as 0xab.cdp+12) may now contain a decimal point. o PCRE has been updated to version 7.8 (mainly bug fixes). NEW FEATURES IN PACKAGE 'methods' o S3 classes that are registered by a call to setOldClass() now have the S3 class as a special slot, and therefore so do any S4 classes that contain them. This mechanism is used to support S4 classes that extend S3 classes, to the extent possible. See ?Classes, ?setOldClass, and ?S3Class. The treatment of special pseudo-classes "matrix", "array", and "ts" as S4 classes has also been modified to be more consistent and, within limitations imposed by special treatment of these objects in the base code, to allow other classes to contain them. See class?ts. A general feature added to implement "ts" and also "data.frame" as S4 classes is that an S4 class definition can be supplied to setOldClass() when the S3 class has known attributes of known class. setOldClass() now saves all the S3 inheritance, allowing the calls to be built up in stages, rather than including all the S3 classes in each call. Also allows as(x,"S3") to generate valid S3 inheritance from the stored definition. See ?S3. o S4 methods may now be defined corresponding to "...", by creating a generic function that has "..." as its signature. A method will be selected and called if all the arguments matching "..." are from this class or a subclass. See ?dotsMethods. o New functions S3Part() and S3Class() provide access to the corresponding S3 object and class for S4 classes that extend either an S3 class or a basic R object type. o show() now also shows the class name. INSTALLATION o If sub-architectures are used, a copy of Rscript is installed in${R_HOME}/bin/exec${R_ARCH} (since that in${R_HOME}/bin and /usr/bin might be overwritten in a subsequent installation). PACKAGE INSTALLATION o LazyLoad: yes is now the default, so packages wanting to avoid lazy loading must set 'LazyLoad: no' (or an equivalent value) in the DESCRIPTION file. o R CMD INSTALL will now fail if it finds a non-executable 'configure' script in the package -- this usually indicates a file system with insufficient permissions. If a non-executable 'cleanup' script is found and either --clean or --preclean is used, a warning is given. DEPRECATED & DEFUNCT o Use in packages of the graphics headers Rdevices.h and Rgraphics.h is defunct: they are no longer installed. o options("par.ask.default") is defunct in favour of "device.ask.default". o The 'device-independent' family "symbol" is defunct: use font=5 (base) or fontface=5 (grid) instead. o gammaCody() is defunct. o par("gamma") is defunct. o 'methods' package functions getAccess(), getAllMethods(), getClassName(), getClassPackage(), getExtends(), getProperties(), getPrototype(), getSubclasses, getVirtual(), mlistMetaName(), removeMethodsObject() and seemsS4Object() are defunct. o Use of a non-integer .Random.seed is now an error. (R itself has never generated such values, but user code has, and R >= 2.6.0 has given a warning.) o methods::allGenerics() is deprecated. o In package installation, SaveImage: yes is now ignored, and any use of the field will give a warning. o unserialize() no longer accepts character strings as input. o The C macro 'allocString' has been removed -- use 'mkChar' and variants. o Use of allocVector(CHARSXP ...) is deprecated and gives a warning. UTILITIES o The default for 'stylepath' in Sweave's (default) RweaveLatex driver is now FALSE rather than TRUE if SWEAVE_STYLEPATH_DEFAULT is unset : see ?RweaveLatex. To support this, tools::texi2dvi adds the R 'texmf' directory to the input search path. o R CMD Rd2dvi now previews PDF output (as was documented) if R_PDFVIEWER is set (as it will normally be on a Unix-alike but not on Windows, where the file association is used by default). o R CMD check checks for binary executable files (which should not appear in a source package), using a suitable 'file' if available, else by name. o R CMD check now also uses codetools' checks on the body of S4 methods. C-LEVEL FACILITIES o R_ReadConsole will now be called with a buffer size of 4096 bytes (rather than 1024): maintainers of alternative front-ends should check that they do not have a smaller limit. o Graphics structure NewDevDesc has been renamed to DevDesc. For now there is a compatibility define in GraphicsDevice.h, but it will be removed in R 2.9.0. o PROTECT and UNPROTECT macros now work even with R_NO_REMAP. BUG FIXES o @ now gives an error (and not just a warning) if it is being applied to a non-S4 object. o R CMD appends (not prepends) R's texmf path to TEXINPUTS. o Objects generated by new() from S4 classes should now all satisfy isS4(object). Previously, prototypes not of object type S4 would not be S4 objects. new() applied to basic, non-S4 classes still will (and should) return non-S4 objects. o Functions writing to connections such as writeLines(), writeBin(), writeChar(), save(), dput() and dump() now check more carefully that the connections are opened for writing, including connections that they open themselves. Similarly functions which read such as readLines(), scan(), dcf() and parse() check connections for being open for reading. o Equality comparison of factors with levels now works correctly again. o Repainting of open X11 View() windows is now done whilst an X11 dataentry window is in use. o Indexing of data frames with NA column names and a numeric or logical column index works again even if columns with NA names are selected. o on.exit() has been fixed to use lexical scope in determining where to evaluate the exit action when the on.exit expression appears in a function argument. o rank() now consistently returns a double result for ties.method = "average" and an integer result otherwise. Previously the storage mode depended on 'na.last' and if any NAs were present. o The "lm" methods of add1(), and drop1() now also work on a model fit with na.action = na.exclude. o median(c(x = NA_real_)) no longer has spurious names(). o isoreg(x, y) now returns the correct result also when x has ties, in all cases. o What na.action() does is now correctly documented. o source() with echo=TRUE now behaves like ordinary automatic printing, by using methods::show() for S4 objects. o Several bugs fixed in ? with topics: it previously died trying to construct some error messages; for S4 methods, class "ANY" should be used for omitted arguments and default methods. o trace() should create missing traceable classes in the global environment, not in baseenv() where other classes will not be found. o Class inheritance using explicit coerce= methods via setIs() failed to coerce the argument in method dispatch. With this fixed, a mechanism was needed to prohibit such inheritance when it would break the generic function (e.g., initialize). See ?setIs and ?setGeneric. o RSiteSearch() encodes its query (it seems this is occasionally needed on some platforms, but encoding other fields is harmful). o 'incomparables' in match() was looking up indices in the wrong table. o write.dcf() did not escape "." according to Debian policy (PR#12816). o col2rgb() sometimes opened a graphics device unnecessarily, and col2rgb(NA) did not return a transparent color, as documented. o pdf(family="Japan") [and other CIDfonts] no longer seg.faults when writing "western" text strings. o as.list() applied to an environment now forces promises and returns values. o Promises capturing calls to sys.parent() and friends did not work properly when evaluated via method dispatch for internal S3 generics. o The default "pkgType" option for non-CRAN builds of R on Mac OS X is now correctly "source" as documented. o The default R_LIBS_USER path in AQUA builds now matches the Mac-specifc path used by the Mac GUI: ~/Library/R/x.y/library o splinefun() with natural splines incorrectly evaluated derivatives to the left of the first knot. (PR#13132, fix thanks to Berwin Turlach) o anova(glm(..., y=FALSE)) now works. (PR#13098) o cut.Date(x, "weeks") could fail if x has only one unique value which fell on a week boundary. (PR#13159) ************************************************** * * * 2.7 SERIES NEWS * * * ************************************************** CHANGES IN R VERSION 2.7.2 patched BUG FIXES o within(, { ... }) now also works when '...' removes more than one column. o Attempting to open an X11() device on a non-existent display when one is already open on another display now gives a warning rather than terminating R via a fatal X11 error. (PR#12628) o source() did not respect the setting of options("keep.source") when setting source references. o seek() now clears the pushback on a text-mode connection if used to set a new position. (PR#12640) o quartz() would segfault if asked to create a file for bitmap output which could not be created. This applied also to the type="quartz" versions of bmp(), jpeg(), png() and tiff(). o dnbinom(0, size, mu = ) suffered from cancellation in 2.7.2 only. CHANGES IN R VERSION 2.7.2 NEW FEATURES o sprintf() returns elements of the result in UTF-8 when the format or any character input has a corresponding element declared as UTF-8. Similarly for paste(), elements of the result are in UTF-8 when any input to that element is declared as UTF-8. o axis() has new arguments 'col.ticks' and 'lwd.ticks' to allow the colour and line width of ticks to be set separately from that of the line (e.g. to set one or the other to transparent or zero width). o legend() has a new argument 'box.col' to set the colour of the enclosing box. o legend() gains a 'xpd' argument to make it easier to place a legend in the margins or outer margins. o stripchart() now passes '...' to title() (as well as to plot.default() and axis()). (Wish of PR#12202) o help.search() has new argument 'searchEngine' to go directly to the search form: this is needed by users of Firefox 3.0.x, for x <= 6, to workaround a bug in interpreting the search results pages. BUG FIXES o Plotmath computed the glyph metrics for the wrong character (and perhaps for a non-existent one) if this was a single-byte character with the top bit set. An example was symbol("\300"). o sink() and cat() could divert output to a non-writable connection. o phyper(x, 0,0,0) no longer hangs for huge x and gives 1 for x >= 0. (PR#11813) o plnorm(x, ..., log.p=TRUE) is now correct for x <= 0. (PR#11867) o [, ch] gives an error (again!) when ch is a string not exactly matching the column names, thanks to an oral bug report by Matthew Dowle. o data.frame(x=1:2, y=3:4, row.names=c("a","NA"))[c(2,NA),] has correct row names c("NA","NA.1") again. o The GUI data editor for dataframes did not handle escape characters in entries properly. (PR#11897) o PCRE has been updated to 7.7 (bugfix release). o package.skeleton() wrongly warned about invalid code_files names when these were not in the current directory. o shapiro.test(c(0,0,1)) now has P value >= 0 (instead of barely negative). o assign() now warns if given a character vector of length > 1, rather than silently taking the first element. o rcond() now gives 0 instead of an error. o There was a memory leak in C function ucstoutf8 used by some graphics devices. o Plots of profile.mle() objects (package 'stats4') were misbehaving when the 'which' argument had been used in their calculation. o dnbinom(x, size, mu=*, ..) is now more accurate for very large 'size'. The same applies to pnbinom() and rnbinom(). o axis() was ignoring par() mgp[3] if mgp was set in-line. o Closing an X11 View() or dataentry window via its frame's close control now works better on some window managers. o Calling lapply() was not handling method dispatch correctly for is.numeric(), is.matrix(), is.array(), log() and the Math2 group. This affected data.matrix() which incorrectly regarded "Date" and "POSIXct" objects as numeric, and has been adjusted to do so as exceptions. o package.skeleton() was not looking for non-function objects in its 'environment' argument. o nls() was only finding its 'weights' argument in the case when all the variables in the formula were of the same length and hence that model.frame() could be used. It was silently ignoring 'subset' and 'na.action' except in that case. Now they are ignored only if 'data' is a list and variables taken from 'data' are not all of the same length, in which case a warning is given. o The 'mle' confint() method now takes 'level' into account when setting 'alpha' for the profile. o within() was not handling correctly expressions that produced NULL columns. (PR#11131) o dev.print() and dev.copy2{eps,pdf}() now ensure that the current device is restored as the active device even if an error occurs. (PR#9801) o as.Date() could fail to convert character strings representing days on which midnight did not exist in the current timezone (as happened in parts of Africa on 1960-01-01). o The automatic placement of legend() with 'title' and a reversed 'x' axis was incorrect. (PR#12019) o The use of multiple packages in 'LinkingTo' works again, and now works when the dependent packages are in the library to be installed to (but not in the library path seen by R --vanilla). o bxp() (and hence boxplot) now respects in-line graphical parameters 'xaxp'/'yaxp' as appropriate. (PR#11463) o barplot(log = "y") failed if there were NAs in the 'height' argument. (PR#11585) o pbeta() is more accurate in some cases with extreme values of 'ncp'. (PR#11277). o edit.data.frame() no longer fails if called on a 0-column data frame and no column is created. o pchisq(x, df=0) was always one even for x < 0; similarly for pgamma(x, alpha=0). o add1() and drop1() now return a P-value of NaN in cases with df=0 for test="Chisq" (they gave NaN until pchisq was altered in R 2.6.2). o The default methods of drop1() and add1() now re-evaluate in the object's formula environment, rather than simply in the parent (informal bug report by Werner Stahel). o The undocumented limit of 8191 bytes on comments (from # to the end of the line) in R code has been removed. o qgamma() warns if used with shape < 1e-10, when it may be unreliable. (PR#12324) o Installing a source package was not using the package's declared encoding (if any) as a default encoding for the help.search() database in Meta/hsearch.rds. This could cause packages with a default encoding to have some of their entries rejected by help.search() in a multi-byte locale (such as a UTF-8 locale). o duplicated() and unique() now handle 'incomparables' better, and avoid occasional segfaults (PR#12551). o plot(isoreg(x, y)) now plots the points correctly when 'x' is unssorted. o data.frame(row.names=NULL) once again behaves differently from the default (as documented). 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.) Since sd(na.rm=TRUE) and var(na.rm=TRUE) both call cov(use = "complete.obs"), this applies also to them. 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 Hervé Pagès 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 Hervé Pagès 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.