Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

R 3.1.2 (codename “Pumpkin Helmet“) was released last week. You can get the latest binaries version from here. (or the .tar.gz source code from here). The full list of new features and bug fixes is provided below.

### Upgrading to R 3.1.2 on Windows

If you are using Windows you can easily upgrade to the latest version of R using the installr package. Simply run the following code:

 # installing/loading the latest installr package: install.packages("installr"); library(installr) #load / install+load installr   updateR() # updating R.

Running “updateR()” will detect if there is a new R version available, and if so it will download+install it (etc.).

I try to keep the installr package updated and useful, so if you have any suggestions or remarks on the package – you are invited to leave a comment below.

If you use the global library system (as I do), you can run the following in the new version of R:

 source("http://www.r-statistics.com/wp-content/uploads/2010/04/upgrading-R-on-windows.r.txt") New.R.RunMe()

### CHANGES IN R 3.1.2:

David smith mentioned in his post some of the main changes, writing:

[…] improvements for the log-Normal distribution function, improved axis controls for histograms, a fix to the nlminb optimizer which was causing rare crashes on Windows (and traced to a bug in the gcc compiler), and some compatibility updates for the Yosemite release of OS X on Macs.

And here is also the full list:

#### NEW FEATURES

• embedFonts() now defaults to format = "ps2write" for ‘.ps’ and ‘.eps’ files. This is available in Ghostscript 9.x (since 2010) whereas the previous default, format = "pswrite", was removed in Ghostscript 9.10.
• For consistency with [dpqr]norm(), [dp]lnorm(sdlog = 0) model a point mass at exp(mulog) rather than return NaN (for an error).
• capabilities() now reports if ICU is compiled in for use for collation (it is only actually used if a suitable locale is set for collation, and never for a C locale).
• (OS X only.) Package tcltk checks when loaded if it is linked against the CRAN X11-based Tcl/Tk and if so that the Tcl/Tk component and the X11 libraries are installed. This allows more informative error messages to be given advising the installation of the missing component or of XQuartz.The X11() device and X11-based versions of the data editor and viewer (invoked by edit() and View() for data frames and matrices from command-line R) check that the X11 libraries are installed and if not advises installing XQuartz.
• icuSetCollate() allows locale = "default", and locale = "none" to use OS services rather than ICU for collation.Environment variable R_ICU_LOCALE can be used to set the default ICU locale, in case the one derived from the OS locale is inappropriate (this is currently necessary on Windows).
• New function icuGetCollate() to report on the ICU collation locale in use (if any).
• utils::URLencode() was updated to use unreserved and reserved characters from RFC 3986, http://tools.ietf.org/html/rfc3986, instead of RFC 1738.
• unique(warnings()) and c(warnings()) are now supported.
• The Bioconductor ‘version’ used by setRepositories() now defaults to 3.0. (It can be set at runtime via environment variable R_BIOC_VERSION.)

#### INSTALLATION and INCLUDED SOFTWARE

• The configure script reports on the more important capabilities/options which will not be compiled in.More types of external BLAS are recognized by name in that report.
• When building R as a shared library, the -L${R_HOME}/lib${R_ARCH} flag is placed earlier in the link commands used during installation and when packages are installed: this helps ensure that the current build has priority if an R shared library has already been installed by e.g. install-libR in a library mentioned in LDFLAGS (and not in ‘your system’s library directory’ as documented). (Wish of PR#15790.)
• LaTeX package upquote is no longer required for R‘s use of inconsolata.
• (Windows only) If both 32 and 64 bit versions of R are installed, the ‘bin/R.exe’ and ‘bin/Rscript.exe’ executables now run 64 bit R. (To run 32 bit R, overwrite these files with copies of ‘bin/i386/Rfe.exe’.)

#### UTILITIES

• Running R CMD check with _R_CHECK_DEPENDS_ONLY_ true now makes the VignetteBuilder packages available even if they are listed in Suggests, since they are needed to recognise and process non-Sweave vignettes.
• R CMD check now reports empty importFrom declarations in a ‘NAMESPACE’ file, as these are common errors (writing importFrom(Pkg) where import(Pkg) was intended).
• R CMD check now by default checks code usage directly on the package namespace without loading and attaching the package and its suggests and enhances. For good practice with packages in the Suggests field, see §1.1.3.1 of ‘Writing R Extensions’. For use of lazy-data objects in the package’s own code, see ?data.

#### BUG FIXES

• dmultinom() did not handle non-finite probabilities correctly.
• prettyNum(x, zero.print=*) now also works when x contains NAs.
• A longstanding bug exhibited by nlminb() on Windows was traced to a compiler bug in gcc 4.6.3; a workaround has been put in place. (PR#15244 and PR#15914).
• Rendering of command in HTML versions of help pages has been improved: this is particularly evident on the help page for INSTALL.
• as.hexmode(x) and as.octmode(x) now behave correctly for some numeric x, e.g., c(NA, 1) or c(1, pi).
• drop1() failed if the scope argument had no variables to drop. (PR#15935)
• edit() (and hence fix()) failed if an object had a non-character attribute named "source" (an attribute that had been used in R prior to version 2.14.0).
• callGeneric() could fail if the generic had ... as a formal argument. (PR#15937).
• Forking in package parallel called C entry point exit in the child. This was unsafe (_exit should have been called), and could flush stdin of the main R process (seen most often on Solaris).As good practice, stdout is now flushed before forking a child.
• R objects such as list(ab = 1) now print correctly.
• getAnywhere("C_pbinom") now returns correctly a single object (rather than unlisting it).
• The confint() method for nls() fits failed it these has specified parameter limits despite using an algorithm other than "port". (PR#15960)
• Subclassing an S4 class failed if the class required arguments to the generator, through its initialize() method.
• removeSource() did not properly handle expressions containing arguments that were supplied as missing, e.g. x[i,]. (PR#15957)
• as.environment(list()) now works, and as.list() of such an environment is now the same as list().
• Several tcltk functions failed when run in unusual environments. (PR#15970)
• options(list()) now works (trivially). (PR#15979)
• merge(<dendrogram>, ..) now works correctly for two ‘independent’ dendrograms (PR#15648), and still compatibly via adjust = "auto" e.g. for two branches of an existing dendrogram.
• The plot method for "hclust" objects gets an optional argument check; When that is true (the default) it checks more carefully for valid input.
• (Windows only) If a user chose to install 64 bit R but not 32 bit R, the ‘bin/R’ and ‘bin/Rscript’ executables failed to run. (PR#15981)
• Various possible buffer overruns have been prevented, and missed memory protection added. (PR#15990)
• Rscript no longer passes --args to R when there are no extra (“user”) arguments.
• objects like getClass("refClass")@prototype now print() and str() without error.
• identical() now also looks at the S4 bit.
• hist(x, breaks) is more robust in adding a small fuzz to few breaks when some are very large. (PR#15988)
• sub() and gsub() did not handle regular expressions like "s{2,}" properly if the text contained NA or non-ascii elements in a UTF-8 locale. Part of this was due to a bug in the TRE library. (PR#16009)
• RShowDoc("NEWS") now displays the PDF version.
• Matrices and arrays with last dimension zero did not print at all or incompletely. (PR#16012)
• plot.histogram() and hence hist() now respect the xaxs, yaxs and lab graphics parameters. (PR#16021)
• bw.SJ(x) and other bw.*() no longer segfault when x contains non-finite values. (PR#16024)
• R CMD Rd2pdf unintentionally ignored its –os option.
• The internal method of download.file() was not reporting file sizes and progress correctly on files larger than 2GB (inherited from libxml2). This is corrected for 64-bit builds (32-bit platforms may not support such files, but where possible will be supported in future versions of R).
• Work around a bug in OS X Yosemite where key environment variables may be duplicated causing issues in subprocesses. The duplicates are now removed on R startup (via Rprofile). (PR#16042)
• Adjust X11 auto-launch detection in DISPLAY on OS X to recognize latest XQuartz.