Changes in R

The ‘Changes in R’ article from the 2012-1 issue.

The R Core Team
2012-06-01

CHANGES IN R VERSION 2.15.1

NEW FEATURES

  • source() now uses withVisible() rather than .Internal(eval.with.vis). This sometimes alters tracebacks slightly.

  • install.packages("pkg_version.tgz") on Mac OS X now has sanity checks that this is actually a binary package (as people have tried it with incorrectly named source packages).

  • splineDesign() and spline.des() in package splines have a new option sparse which can be used for efficient construction of a sparse B-spline design matrix (via Matrix).

  • norm() now allows type = "2" (the ‘spectral’ or 2-norm) as well, mainly for didactical completeness.

  • pmin() and pmax()) now also work when one of the inputs is of length zero and others are not, returning a zero-length vector, analogously to, say, +.

  • colorRamp() (and hence colorRampPalette()) now also works for the boundary case of just one color when the ramp is flat.

  • qqline() has new optional arguments distribution, probs and qtype, following the example of lattice’s panel.qqmathline().

  • .C() gains some protection against the misuse of character vector arguments. (An all too common error is to pass character(N), which initializes the elements to "", and then attempt to edit the strings in-place, sometimes forgetting to terminate them.)

  • Calls to the new function globalVariables() in package utils declare that functions and other objects in a package should be treated as globally defined, so that CMD check will not note them.

  • print(packageDescription(*)) trims the Collate field by default.

  • The included copy of zlib has been updated to version 1.2.7.

  • A new option "show.error.locations" has been added. When set to TRUE, error messages will contain the location of the most recent call containing source reference information. (Other values are supported as well; see ?options.)

  • The NA warning messages from e.g. pchisq() now report the call to the closure and not that of the .Internal.

  • Added Polish translations by Łukasz Daniel.

PERFORMANCE IMPROVEMENTS

  • In package parallel, makeForkCluster() and the multicore-based functions use native byte-order for serialization (deferred from 2.15.0).

  • lm.fit(), lm.wfit(), glm.fit() and lsfit() do less copying of objects, mainly by using .Call() rather than .Fortran().

  • .C() and .Fortran() do less copying: arguments which are raw, logical, integer, real or complex vectors and are unnamed are not copied before the call, and (named or not) are not copied after the call. Lists are no longer copied (they are supposed to be used read-only in the C code).

  • tabulate() makes use of .C(DUP = FALSE) and hence does not copy bin. (Suggested by Tim Hesterberg.) It also avoids making a copy of a factor argument bin.

  • Other functions (often or always) doing less copying include cut(), dist(), the complex case of eigen(), hclust(), image(), kmeans(), loess(), stl() and svd(LINPACK = TRUE).

  • There is less copying when using primitive replacement functions such as names(), attr() and attributes().

DEPRECATED AND DEFUNCT

  • The converters for use with .C() (see ?getCConverterDescriptions) are deprecated: use the .Call() interface instead. There are no known examples (they were never fully documented).

UTILITIES

  • For R CMD check, a few people have reported problems with junctions on Windows (although they were tested on Windows 7, XP and Server 2008 machines and it is unknown under what circumstances the problems occur). Setting the environment variable R_WIN_NO_JUNCTIONS to a non-empty value (e.g. in ~/.R/check.Renviron) will force copies to be used instead.

INSTALLATION

  • R CMD INSTALL with _R_CHECK_INSTALL_DEPENDS_ set to a true value (as done by R CMD check –as-cran) now restricts the packages available when lazy-loading as well as when test-loading (since packages such as ETLUtils and agsemisc had top-level calls to library() for undeclared packages).

    This check is now also available on Windows.

C-LEVEL FACILITIES

  • C entry points mkChar and mkCharCE now check that the length of the string they are passed does not exceed \(2^{31}-1\) bytes: they used to overflow with unpredictable consequences.

  • C entry points R_GetCurrentSrcref and R_GetSrcFilename have been added to the API to allow debuggers access to the source references on the stack.

WINDOWS-SPECIFIC CHANGES

  • Windows-specific changes will now be announced in this file (NEWS). Changes up and including R 2.15.0 remain in the CHANGES file.

  • There are two new environment variables which control the defaults for command-line options.

    If R_WIN_INTERNET2 is set to a non-empty value, it is as if –internet2 was used.

    If R_MAX_MEM_SIZE is set, it gives the default memory limit if –max-mem-size is not specified: invalid values being ignored.

BUG FIXES

  • lsfit() lost the names from the residuals.

  • More cases in which merge() could create a data frame with duplicate column names now give warnings. Cases where names specified in by match multiple columns are errors.

  • Nonsense uses such as seq(1:50, by = 5) (from package plotrix) and seq.int(1:50, by = 5) are now errors.

  • The residuals in the 5-number summary printed by summary() on an "lm" object are now explicitly labelled as weighted residuals when non-constant weights are present. (Wish of PR#14840.)

  • tracemem() reported that all objects were copied by .C() or .Fortran() whereas only some object types were ever copied.

    It also reported and marked as copies some transformations such as rexp(n, x): it no longer does so.

  • The plot() method for class "stepfun" only used the optional xval argument to compute xlim and not the points at which to plot (as documented). (PR#14864)

  • Names containing characters which need to be escaped were not deparsed properly. (PR#14846)

  • Trying to update (recommended) packages in R_HOME/library without write access is now dealt with more gracefully. Further, such package updates may be skipped (with a warning), when a newer installed version is already going to be used from .libPaths(). (PR#14866)

  • hclust() is now fast again (as up to end of 2003), with a different fix for the "median"/"centroid" problem. (PR#4195).

  • get_all_vars() failed when the data came entirely from vectors in the global environment. (PR#14847)

  • R CMD check with _R_CHECK_NO_RECOMMENDED_ set to a true value (as done by the –as-cran option) could issue false errors if there was an indirect dependency on a recommended package.

  • formatC() uses the C entry point str_signif which could write beyond the length allocated for the output string.

  • Missing default argument added to implicit S4 generic for backsolve(). (PR#14883)

  • Some bugs have been fixed in handling load actions that could fail to export assigned items or generate spurious warnings in CMD check on loading.

  • For tiff(type = "windows"), the numbering of per-page files except the last was off by one.

  • On Windows, loading package stats (which is done for a default session) would switch line endings on stdout and stderr from CRLF to LF. This affected Rterm and R CMD BATCH.

  • On Windows, the compatibility function x11() had not kept up with changes to windows(), and issued warnings about bad parameters. (PR#14880)

  • On Windows, the Sys.glob() function did not handle UNC paths as it was designed to try to do. (PR#14884)

  • In package parallel, clusterApply() and similar failed to handle a (pretty pointless) length-1 argument. (PR#14898)

  • Quartz Cocoa display reacted asynchronously to dev.flush() which means that the redraw could be performed after the plot has been already modified by subsequent code. The redraw is now done synchronously in dev.flush() to allow animations without sleep cycles.

  • Source locations reported in traceback() were incorrect when byte-compiled code was on the stack.

  • plogis(x, lower = FALSE, log.p = TRUE) no longer underflows early for large x (e.g. 800).

  • ?Arithmetic’s “1 ^ y and y ^ 0 are 1, always” now also applies for integer vectors y.

  • X11-based pixmap devices like png(type = "Xlib") were trying to set the cursor style, which triggered some warnings and hangs.

  • Code executed by the built-in HTTP server no longer allows other HTTP clients to re-enter R until the current worker evaluation finishes, to prevent cascades.

  • The plot() and Axis() methods for class "table" now respect graphical parameters such as cex.axis. (Reported by Martin Becker.)

  • Under some circumstances package.skeleton() would give out progress reports that could not be translated and so were displayed by question marks. Now they are always in English. (This was seen for CJK locales on Windows, but may have occurred elsewhere.)

  • The evaluator now keeps track of source references outside of functions, e.g. when source() executes a script.

  • The replacement method for window() now works correctly for multiple time series of class "mts". (PR#14925)

  • is.unsorted() gave incorrect results on non-atomic objects such as data frames. (Reported by Matthew Dowle.)

  • The value returned by tools::psnice() for invalid pid values was not always NA as documented.

  • Closing an X11() window while locator() was active could abort the R process.

  • getMethod(f, sig) produced an incorrect error message in some cases when f was not a string.

  • Using a string as a “call” in an error condition with options(showErrorCalls=TRUE) could cause a segfault. (PR#14931)

  • The string "infinity" allowed by C99 was not accepted as a numerical string value by e.g. scan() and as.character(). (PR#14933)

  • In legend(), setting some entries of lwd to NA was inconsistent (depending on the graphics device) in whether it would suppress those lines; now it consistently does so. (PR#14926)

  • by() failed for a zero-row data frame. (Reported by Weiqiang Qian)

  • Yates correction in chisq.test() could be bigger than the terms it corrected, previously leading to an infinite test statistic in some corner cases which are now reported as NaN.

  • xgettext() and related functions sometimes returned items that were not strings for translation. (PR#14935)

  • plot(<lm>, which=5) now correctly labels the factor level combinations for the special case where all \(h_{ii}\) are the same. (PR#14837)

CHANGES IN R VERSION 2.15.0

SIGNIFICANT USER-VISIBLE CHANGES

  • The behaviour of unlink(recursive = TRUE) for a symbolic link to a directory has changed: it now removes the link rather than the directory contents (just as rm -r does).

    On Windows it no longer follows reparse points (including junctions and symbolic links).

NEW FEATURES

  • Environment variable RD2DVI_INPUTENC has been renamed to RD2PDF_INPUTENC.

  • .Deprecated() becomes a bit more flexible, getting an old argument.

  • Even data-only packages without R code need a namespace and so may need to be installed under R 2.14.0 or later.

  • assignInNamespace() has further restrictions on use apart from at top-level, as its help page has warned. Expect it to be disabled from programmatic use in the future.

  • system() and system2() when capturing output report a non-zero status in the new "status" attribute.

  • kronecker() now has an S4 generic in package methods on which packages can set methods. It will be invoked by X %x% Y if either X or Y is an S4 object.

  • pdf() accepts forms like file = "|lpr" in the same way as postscript().

  • pdf() accepts file = NULL. This means that the device does NOT create a PDF file (but it can still be queried, e.g., for font metric info).

  • format() (and hence print()) on "bibentry" objects now uses options("width") to set the output width.

  • legend() gains a text.font argument. (Suggested by Tim Paine, PR#14719.)

  • nchar() and nzchar() no longer accept factors (as integer vectors). (Wish of PR#6899.)

  • summary() behaves slightly differently (or more precisely, its print() method does). For numeric inputs, the number of NAs is printed as an integer and not a real. For dates and datetimes, the number of NAs is included in the printed output (the latter being the wish of PR#14720).

    The "data.frame" method is more consistent with the default method: in particular it now applies zapsmall() to numeric/complex summaries.

  • The number of items retained with options(warn = 0) can be set by options(nwarnings=).

  • A new function assignInMyNamespace() uses the namespace of the function it is called from.

  • attach() allows the default name for an attached file to be overridden.

  • bxp(), the work horse of boxplot(), now uses a more sensible default xlim in the case where at is specified differently from 1:n, see the discussion on R-devel, https://stat.ethz.ch/pipermail/r-devel/2011-November/062586.html.

  • New function paste0(), an efficient version of paste(*, sep=""), to be used in many places for more concise (and slightly more efficient) code.

  • Function setClass() in package methods now returns, invisibly, a generator function for the new class, slightly preferred to calling new(), as explained on the setClass help page.

  • The "dendrogram" method of str() now takes its default for last.str from option str.dendrogram.last.

  • New simple fitted() method for "kmeans" objects.

  • The traceback() function can now be called with an integer argument, to display a current stack trace. (Wish of PR#14770.)

  • setGeneric() calls can be simplified when creating a new generic function by supplying the default method as the def argument. See ?setGeneric.

  • serialize() has a new option xdr = FALSE which will use the native byte-order for binary serializations. In scenarios where only little-endian machines are involved (these days, close to universal) and (un)serialization takes an appreciable amount of time this may speed up noticeably transferring data between systems.

  • The internal (un)serialization code is faster for long vectors, particularly with XDR on some platforms. (Based on a suggested patch by Michael Spiegel.)

  • For consistency, circles with zero radius are omitted by points() and grid.circle(). Previously this was device-dependent, but they were usually invisible.

  • NROW(x) and NCOL(x) now work whenever dim(x) looks appropriate, e.g., also for more generalized matrices.

  • PCRE has been updated to version 8.30.

  • The internal R_Srcref variable is now updated before the browser stops on entering a function. (Suggestion of PR#14818.)

  • There are ‘bare-bones’ functions .colSums(), .rowSums(), .colMeans() and .rowMeans() for use in programming where ultimate speed is required.

  • The function .package_dependencies() from package tools for calculating (recursive) (reverse) dependencies on package databases, which was formerly internal, has been renamed to package_dependencies() and is now exported.

  • There is a new function optimHess() to compute the (approximate) Hessian for an optim() solution if hessian = TRUE was forgotten.

  • .filled.contour() is a ‘bare-bones’ function to add a filled-contour rectangular plot to an already prepared plot region.

  • The stepping in debugging and single-step browsing modes has changed slightly: now left braces at the start of the body are stepped over for if statements as well as for for and while statements. (Wish of PR#14814.)

  • library() no longer warns about a conflict with a function from package:base if the function has the same code as the base one but with a different environment. (An example is Matrix::det().)

  • When deparsing very large language objects, as.character() now inserts newlines after each line of approximately 500 bytes, rather than truncating to the first line.

  • New function rWishart() generates Wishart-distributed random matrices.

  • Packages may now specify actions to be taken when the package is loaded (setLoadActions()).

  • options(max.print = Inf) and similar now give an error (instead of warnings later).

  • The "difftime" replacement method of units tries harder to preserve other attributes of the argument. (Wish of PR#14839.)

  • poly(raw = TRUE) no longer requires more unique points than the degree. (Requested by John Fox.)

PACKAGE parallel

  • There is a new function mcmapply(), a parallel version of mapply(), and a wrapper mcMap(), a parallel version of Map().

  • A default cluster can be registered by the new function setDefaultCluster(): this will be used by default in functions such as parLapply().

  • clusterMap() has a new argument .scheduling to allow the use of load-balancing.

  • There are new load-balancing functions parLapplyLB() and parSapplyLB().

  • makePSOCKCluster() has a new option useXDR = FALSE which can be used to avoid byte-shuffling for serialization when all the nodes are known to be little-endian (or all big-endian).

PACKAGE INSTALLATION

  • Non-ASCII vignettes without a declared encoding are no longer accepted.

  • C/C++ code in packages is now compiled with -NDEBUG to mitigate against the C/C++ function assert being called in production use. Developers can turn this off during package development with PKG_CPPFLAGS = -UNDEBUG.

  • R CMD INSTALL has a new option –dsym which on Mac OS X (Darwin) dumps the symbols alongside the .so file: this is helpful when debugging with valgrind (and especially when installing packages into R.framework). [This can also be enabled by setting the undocumented environment variable PKG_MAKE_DSYM, since R 2.12.0.]

  • R CMD INSTALL will test loading under all installed sub-architectures even for packages without compiled code, unless the flag –no-multiarch is used. (Pure R packages can do things which are architecture-dependent: in the case which prompted this, looking for an icon in a Windows R executable.)

  • There is a new option install.packages(type = "both") which tries source packages if binary packages are not available, on those platforms where the latter is the default.

  • The meaning of install.packages( dependencies = TRUE) has changed: it now means to install the essential dependencies of the named packages plus the Suggests, but only the essential dependencies of dependencies. To get the previous behaviour, specify dependencies as a character vector.

  • R CMD INSTALL –merge-multiarch is now supported on OS X and other Unix-alikes using multiple sub-architectures.

  • R CMD INSTALL –libs-only now by default does a test load on Unix-alikes as well as on Windows: suppress with –no-test-load.

UTILITIES

  • R CMD check now gives a warning rather than a note if it finds inefficiently compressed datasets. With bzip2 and xz compression having been available since R 2.10.0, it only exceptionally makes sense to not use them.

    The environment variable _R_CHECK_COMPACT_DATA2_ is no longer consulted: check is always done if _R_CHECK_COMPACT_DATA_ has a true value (its default).

  • Where multiple sub-architectures are to be tested, R CMD check now runs the examples and tests for all the sub-architectures even if one fails.

  • R CMD check can optionally report timings on various parts of the check: this is controlled by environment variable _R_CHECK_TIMINGS_ documented in ‘Writing R Extensions’. Timings (in the style of R CMD BATCH) are given at the foot of the output files from running each test and the R code in each vignette.

  • There are new options for more rigorous testing by R CMD check selected by environment variables – see the ‘Writing R Extensions’ manual.

  • R CMD check now warns (rather than notes) on undeclared use of other packages in examples and tests: increasingly people are using the metadata in the DESCRIPTION file to compute information about packages, for example reverse dependencies.

  • The defaults for some of the options in R CMD check (described in the ‘R Internals’ manual) have changed: checks for unsafe and .Internal() calls and for partial matching of arguments in R function calls are now done by default.

  • R CMD check has more comprehensive facilities for checking compiled code and so gives fewer reports on entry points linked into .so/.dll files from libraries (including C++ and Fortran runtimes).

    Checking compiled code is now done on FreeBSD (as well as the existing supported platforms of Linux, Mac OS X, Solaris and Windows).

  • R CMD build has more options for –compact-vignettes: see R CMD build –help.

  • R CMD build has a new option –md5 to add an MD5 file (as done by CRAN): this is used by R CMD INSTALL to check the integrity of the distribution.

    If this option is not specified, any existing (and probably stale) MD5 file is removed.

DEPRECATED AND DEFUNCT

  • R CMD Rd2dvi is now defunct: use R CMD Rd2pdf.

  • Options such –max-nsize, –max-vsize and the function mem.limits() are now defunct. (Options –min-nsize and –min-vsize remain available.)

  • Use of library.dynam() without specifying all the first three arguments is now disallowed.

    Use of an argument chname in library.dynam() including the extension .so or .dll (which was never allowed according to the help page) is defunct. This also applies to library.dynam.unload() and to useDynLib directives in NAMESPACE files.

  • The internal functions .readRDS() and .saveRDS() are now defunct.

  • The off-line help() types "postscript" and "ps" are defunct.

  • Sys.putenv(), replaced and deprecated in R 2.5.0, is finally removed.

  • Some functions/objects which have been defunct for five or more years have been removed completely. These include .Alias(), La.chol(), La.chol2inv(), La.eigen(), Machine(), Platform(), Version, codes(), delay(), format.char(), getenv(), httpclient(), loadURL(), machine(), parse.dcf(), printNoClass(), provide(), read.table.url(), restart(), scan.url(), symbol.C(), symbol.For() and unix().

  • The ENCODING argument to .C() is deprecated. It was intended to smooth the transition to multi-byte character strings, but can be replaced by the use of iconv() in the rare cases where it is still needed.

INSTALLATION

  • Building with a positive value of –with-valgrind-instrumentation now also instruments logical, complex and raw vectors.

C-LEVEL FACILITIES

  • Passing R objects other than atomic vectors, functions, lists and environments to .C() is now deprecated and will give a warning. Most cases (especially NULL) are actually coding errors. NULL will be disallowed in future.

    .C() now passes a pairlist as a SEXP to the compiled code. This is as was documented, but pairlists were in reality handled differently as a legacy from the early days of R.

  • call_R and call_S are deprecated. They still exist in the headers and as entry points, but are no longer documented and should not be used for new code.

BUG FIXES

  • str(x, width) now obeys its width argument also for function headers and other objects x where deparse() is applied.

  • The convention for x %/% 0L for integer-mode x has been changed from 0L to NA_integer_. (PR#14754)

  • The exportMethods directive in a NAMESPACE file now exports S4 generics as necessary, as the extensions manual said it does. The manual has also been updated to be a little more informative on this point.

    It is now required that there is an S4 generic (imported or created in the package) when methods are to be exported.

  • Reference methods cannot safely use non-exported entries in the namespace. We now do not do so, and warn in the documentation.

  • The namespace import code was warning when identical S4 generic functions were imported more than once, but should not (reported by Brian Ripley, then Martin Morgan).

  • merge() is no longer allowed (in some ways) to create a data frame with duplicate column names (which confused PR#14786).

  • Fixes for rendering raster images on X11 and Windows devices when the x-axis or y-axis scale is reversed.

  • getAnywhere() found S3 methods as seen from the utils namespace and not from the environment from which it was called.

  • selectMethod(f, sig) would not return inherited group methods when caching was off (as it is by default).

  • dev.copy2pdf(out.type = "cairo") gave an error. (PR#14827)

  • Virtual classes (e.g., class unions) had a NULL prototype even if that was not a legal subclass. See ?setClassUnion.

  • The C prototypes for zdotc and zdotu in R_ext/BLAS.h have been changed to the more modern style rather than that used by f2c. (Patch by Berwin Turlach.)

  • isGeneric() produced an error for primitives that can not have methods.

  • .C() or .Fortran() had a lack-of-protection error if the registration information resulted in an argument being coerced to another type.

  • boxplot(x=x, at=at) with non finite elements in x and non integer at could not generate a warning but failed.

  • heatmap(x, symm=TRUE, RowSideColors=*) no longer draws the colors in reversed order.

  • predict(<ar>) was incorrect in the multivariate case, for p >= 2.

  • print(x, max=m) is now consistent when x is a "Date"; also the “reached ... max.print ..” messages are now consistently using single brackets.

  • Closed the <li> tag in pages generated by Rd2HTML(). (PR#14841.)

  • Axis tick marks could go out of range when a log scale was used. (PR#14833.)

  • Signature objects in methods were not allocated as S4 objects (caused a problem with trace() reported by Martin Morgan).

CHANGES IN R VERSION 2.14.2

NEW FEATURES

  • The internal untar() (as used by default by R CMD INSTALL) now knows about some pax headers which bsdtar (e.g., the default tar for Mac OS >= 10.6) can incorrectly include in tar files, and will skip them with a warning.

  • PCRE has been upgraded to version 8.21: as well as bug fixes and greater Perl compatibility, this adds a JIT pattern compiler, about which PCRE’s news says ‘large performance benefits can be had in many situations’. This is supported on most but not all R platforms.

  • Function compactPDF() in package tools now takes the default for argument gs_quality from environment variable GS_QUALITY: there is a new value "none", the ultimate default, which prevents GhostScript being used in preference to qpdf just because environment variable R_GSCMD is set. If R_GSCMD is unset or set to "", the function will try to find a suitable GhostScript executable.

  • The included version of zlib has been updated to 1.2.6.

  • For consistency with the logLik() method, nobs() for "nls" files now excludes observations with zero weight. (Reported by Berwin Turlach.)

UTILITIES

  • R CMD check now reports by default on licenses not according to the description in ‘Writing R Extensions’.

  • R CMD check has a new option –as-cran to turn on most of the customizations that CRAN uses for its incoming checks.

PACKAGE INSTALLATION

  • R CMD INSTALL will now no longer install certain file types from inst/doc: these are almost certainly mistakes and for some packages are wasting a lot of space. These are Makefile, files generated by running LaTeX, and unless the package uses a vignettes directory, PostScript and image bitmap files.

    Note that only PDF vignettes have ever been supported: some of these files come from DVI/PS output from the Sweave defaults prior to R 2.13.0.

BUG FIXES

  • R configured with –disable-openmp would mistakenly set HAVE_OPENMP (internal) and SUPPORT_OPENMP (in Rconfig.h) even though no OpenMP flags were populated.

  • The getS3method() implementation had an old computation to find an S4 default method.

  • readLines() could overflow a buffer if the last line of the file was not terminated. (PR#14766)

  • R CMD check could miss undocumented S4 objects in packages which used S4 classes but did not Depends: methods in their DESCRIPTION file.

  • The HTML Help Search page had malformed links. (PR#14769)

  • A couple of instances of lack of protection of SEXPs have been squashed. (PR#14772, PR#14773)

  • image(x, useRaster=TRUE) misbehaved on single-column x. (PR#14774)

  • Negative values for options("max.print") or the max argument to print.default() caused crashes. Now the former are ignored and the latter trigger an error. (PR#14779)

  • The text of a function body containing more than 4096 bytes was not properly saved by the parser when entered at the console.

  • Forgetting the #endif tag in an Rd file could cause the parser to go into a loop. (Reported by Hans-Jorg Bibiko.)

  • str(*, ....., strict.width="cut") now also obeys list.len = n. (Reported by Vogel.)

  • Printing of arrays did not have enough protection (C level), e.g., in the context of capture.output(). (Reported by Hervé Pagès and Martin Morgan.)

  • pdf(file = NULL) would produce a spurious file named NA. (PR#14808)

  • list2env() did not check the type of its envir argument. (PR#14807)

  • svg() could segfault if called with a non-existent file path. (PR#14790)

  • make install can install to a path containing + characters. (PR#14798)

  • The edit() function did not respect the options("keep.source") setting. (Reported by Cleridy Lennert.)

  • predict.lm(*, type="terms", terms=*, se.fit=TRUE) did not work. (PR#14817)

  • There is a partial workaround for errors in the TRE regular-expressions engine with named classes and repeat counts of at least 2 in a MBCS locale (PR#14408): these are avoided when TRE is in 8-bit mode (e.g. for useBytes = TRUE and when all the data are ASCII).

  • The C function R_ReplDLLdo1() did not call top-level handlers.

  • The Quartz device was unable to detect window sessions on Mac OS X 10.7 (Lion) and higher and thus it was not used as the default device on the console. Since Lion any application can use window sessions, so Quartz will now be the default device if the user’s window session is active and R is not run via ssh which is at least close to the behavior in prior OS X versions.

  • mclapply() would fail in code assembling the translated error message if some (but not all) cores encountered an error.

  • format.POSIXlt(x) raised an arithmetic exception when x was an invalid object of class "POSIXlt" and parts were empty.

  • installed.packages() has some more protection against package installs going on in parallel.

  • .Primitive() could be mis-used to call .Internal() entry points.

CHANGES IN R VERSION 2.14.1

NEW FEATURES

  • parallel::detectCores() is now able to find the number of physical cores (rather than CPUs) on Sparc Solaris.

    It can also do so on most versions of Windows; however the default remains detectCores(logical = TRUE) on that platform.

  • Reference classes now keep a record of which fields are locked. $lock() with no arguments returns the names of the locked fields.

  • HoltWinters() reports a warning rather than an error for some optimization failures (where the answer might be a reasonable one).

  • tools::dependsOnPkg() now accepts the shorthand dependencies = "all".

  • parallel::clusterExport() now allows specification of an environment from which to export.

  • The quartz() device now does tilde expansion on its file argument.

  • tempfile() on a Unix-alike now takes the process ID into account. This is needed with multicore (and as part of parallel) because the parent and all the children share a session temporary directory, and they can share the C random number stream used to produce the unique part. Further, two children can call tempfile() simultaneously.

  • Option print in Sweave’s RweaveLatex() driver now emulates auto-printing rather than printing (which can differ for an S4 object by calling show() rather than print()).

  • filled.contour() now accepts infinite values: previously it might have generated invalid graphics files (e.g. containing NaN values).

INSTALLATION

  • On 64-bit Linux systems, configure now only sets LIBnn to lib64 if /usr/lib64 exists. This may obviate setting LIBnn explicitly on Debian-derived systems.

    It is still necessary to set LIBnn = lib (or lib32) for 32-bit builds of R on a 64-bit OS on those Linux distributions capable for supporting that concept.

  • configure looks for inconsolata.sty, and if not found adjusts the default R_RD4PDF to not use it (with a warning, since it is needed for high-quality rendering of manuals).

PACKAGE INSTALLATION

  • R CMD INSTALL will now do a test load for all sub-architectures for which code was compiled (rather than just the primary sub-architecture).

UTILITIES

  • When checking examples under more than one sub-architecture, R CMD check now uses a separate directory examples_arch for each sub-architecture, and leaves the output in file pkgname-Ex_arch.Rout. Some packages expect their examples to be run in a clean directory ….

BUG FIXES

  • stack() now gives an error if no vector column is selected, rather than returning a 1-column data frame (contrary to its documentation).

  • summary.mlm() did not handle objects where the formula had been specified by an expression. (Reported by Helios de Rosario Martinez).

  • tools::deparseLatex(dropBraces=TRUE) could drop text as well as braces.

  • colormodel = "grey" (new in R 2.14.0) did not always work in postscript() and pdf().

  • file.append() could return TRUE for failures. (PR#14727)

  • gzcon() connections are no longer subject to garbage collection: it was possible for this to happen when unintended (e.g. when calling load()).

  • nobs() does not count zero-weight observations for glm() fits, for consistency with lm(). This affects the BIC() values reported for such glm() fits. (Spotted by Bill Dunlap.)

  • options(warn = 0) failed to end a (C-level) context with more than 50 accumulated warnings. (Spotted by Jeffrey Horner.)

  • The internal plot.default() code did not do sanity checks on a cex argument, so invalid input could cause problems. (Reported by Ben Bolker.)

  • anyDuplicated(<array>, MARGIN=0) no longer fails. (Reported by Hervé Pagès.)

  • read.dcf() removes trailing blanks: unfortunately on some platforms this included \\xa0 (non-breaking space) which is the trailing byte of a UTF-8 character. It now only considers ASCII space and tab to be ‘blank’.

  • There was a sign error in part of the calculations for the variance returned by KalmanSmooth(). (PR#14738)

  • pbinom(10, 1e6, 0.01, log.p = TRUE) was NaN thanks to the buggy fix to PR#14320 in R 2.11.0. (PR#14739)

  • RweaveLatex() now emulates auto-printing rather than printing, by calling methods::show() when auto-printing would.

  • duplicated() ignored fromLast for a one-column data frame. (PR#14742)

  • source() and related functions did not put the correct timestamp on the source references; srcfilecopy() has gained a new argument timestamp to support this fix. (PR#14750)

  • srcfilecopy() has gained a new argument isFile and now records the working directory, to allow debuggers to find the original source file. (PR#14826)

  • LaTeX conversion of Rd files did not correctly handle preformatted backslashes. (PR#14751)

  • HTML conversion of Rd files did not handle markup within tabular cells properly. (PR#14708)

  • source() on an empty file with keep.source = TRUE tried to read from stdin(), in R 2.14.0 only. (PR#14753)

  • The code to check Rd files in packages would abort if duplicate description sections were present.

Note

This article is converted from a Legacy LaTeX article using the texor package. The pdf version is the official version. To report a problem with the html, refer to CONTRIBUTE on the R Journal homepage.

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Team, "Changes in R", The R Journal, 2012

BibTeX citation

@article{RJ-2012-1-r-changes,
  author = {Team, The R Core},
  title = {Changes in R},
  journal = {The R Journal},
  year = {2012},
  note = {https://rjournal.github.io/},
  volume = {4},
  issue = {1},
  issn = {2073-4859},
  pages = {70-79}
}