From 2b16cd30cb5f320e7c352fc290052a2ddab6ddcb Mon Sep 17 00:00:00 2001
From: Tom Callaway This document is copyright © 1998–2015 by Kurt
+ This document is copyright © 1998–2016 by Kurt
Hornik.
This document is free software; you can redistribute it and/or modify it
@@ -391,14 +392,14 @@ Next: Notation, Previous: 1.3 Citing this document
In publications, please refer to this FAQ as Hornik
-(2015), “The R FAQ”, and give the above,
+(2016), “The R FAQ”, and give the above,
official URL:
The current released version is 3.2.3. Based on this
-‘major.minor.patchlevel’ numbering scheme, there are two development
-versions of R, a patched version of the current release (‘r-patched’)
-and one working towards the next minor or eventually major (‘r-devel’)
-releases of R, respectively. Version r-patched is for bug fixes mostly.
-New features are typically introduced in r-devel.
+ R uses a ‘major.minor.patchlevel’ numbering scheme. Based on this,
+there are the current release version of R (‘r-release’) as well as two
+development versions of R, a patched version of the current release
+(‘r-patched’) and one working towards the next minor or eventually major
+(‘r-devel’) releases of R, respectively. New features are typically
+introduced in r-devel, while r-patched is for bug fixes mostly.
+ See https://CRAN.R-project.org/sources.html for the current
+versions of r-release, r-patched and r-devel.
where YEAR is the release year of the version of R used and can
+determined as Citation strings (or BibTeX entries) for R and R packages can also be
obtained by Frequently Asked Questions on R
-Version 3.2.2015-12-04
+Version 2016-06-06
Kurt Hornik
+
Table of Contents
@@ -249,6 +249,7 @@ p {
@@ -333,7 +334,7 @@ Next: Obtaining this
1.1 Legalese
-@Misc{,
author = {Kurt Hornik},
title = {{R} {FAQ}},
- year = {2015},
+ year = {2016},
url = {https://CRAN.R-project.org/doc/FAQ/R-FAQ.html}
}
2.3 What is the current version of R?
-
@@ -927,11 +931,13 @@ Next: Wh
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
- year = 2015,
+ year = YEAR,
url = {https://www.R-project.org}
}
-
+R.version$year
.
+citation()
.
Since March 2016, “old” material is made available from a central +CRAN archive server (https://CRAN-archive.R-project.org/). +
Please always use the URL of the master site when referring to CRAN.
@@ -1233,9 +1242,7 @@ the programming process.See http://statweb.stanford.edu/~jmc4/papers/96.7.ps for further information on the “Evolution of the S Language”.
-There is a huge amount of user-contributed code for S, available at the -S Repository at CMU. -
+Jeff Horner is working on the R/Apache Integration Project which embeds @@ -2075,12 +2082,12 @@ Next:
The Omega Project for Statistical
+ The Omega Project for Statistical
Computing provides a variety of open-source software for statistical
applications, with special emphasis on web-based software, Java, the
Java virtual machine, and distributed computing. A CRAN style
-R package repository is available via http://www.omegahat.org/R/.
-See http://www.omegahat.org/ for information on most R packages
+R package repository is available via http://www.omegahat.net/R/.
+See http://www.omegahat.net/ for information on most R packages
available from the Omega project.
@@ -2565,6 +2572,8 @@ Next: R Programming, Previ
The only numbers that can be represented exactly in R’s numeric type -are integers and fractions whose denominator is a power of 2. Other -numbers have to be rounded to (typically) 53 binary digits accuracy. As a -result, two floating point numbers will not reliably be equal unless they -have been computed by the same algorithm, and not always even then. For -example +
The only numbers that can be represented exactly in R’s numeric type are +integers and fractions whose denominator is a power of 2. All other +numbers are internally rounded to (typically) 53 binary digits accuracy. +As a result, two floating point numbers will not reliably be equal +unless they have been computed by the same algorithm, and not always +even then. For example
R> a <- sqrt(2) @@ -3477,6 +3486,8 @@ R> a * a == 2 [1] FALSE R> a * a - 2 [1] 4.440892e-16 +R> print(a * a, digits = 18) +[1] 2.00000000000000044
The function all.equal()
compares two objects using a numeric
@@ -3484,17 +3495,32 @@ tolerance of .Machine$double.eps ^ 0.5
. If you want much greater
accuracy than this you will need to consider error propagation
carefully.
A discussion with many easily followed examples is in Appendix G +“Computational Precision and Floating Point Arithmetic”, pages +753–771 of Statistical Analysis and Data Display: An Intermediate +Course with Examples in R, Richard M. Heiberger and Burt Holland +(Springer 2015, second edition). This appendix is a free download from +http://link.springer.com/content/pdf/bbm%3A978-1-4939-2122-5%2F1.pdf. +
For more information, see e.g. David Goldberg (1991), “What Every Computer Scientist Should Know About Floating-Point Arithmetic”, ACM Computing Surveys, 23/1, 5–48, also available via http://www.validlab.com/goldberg/paper.pdf.
-To quote from “The Elements of Programming Style” by Kernighan and -Plauger: +
Here is another example, this time using addition:
--+10.0 times 0.1 is hardly ever 1.0. -
R> .3 + .6 == .9 +[1] FALSE +R> .3 + .6 - .9 +[1] -1.110223e-16 +R> print(matrix(c(.3, .6, .9, .3 + .6)), digits = 18) + [,1] +[1,] 0.299999999999999989 +[2,] 0.599999999999999978 +[3,] 0.900000000000000022 +[4,] 0.899999999999999911 +
-Previous: Why is R apparently not releasing memory?, Up: R Miscellanea [Contents]
+Next: How can I get CRAN package binaries for outdated versions of R?, Previous: Why is R apparently not releasing memory?, Up: R Miscellanea [Contents]options(download.file.method = "wininet", url.method = "wininet") (Windows) -options(download.file.method = "libcurl", url.method = "libcurl") (Linux and OS X) +options(download.file.method = "wininet", url.method = "wininet") +(Windows) +options(download.file.method = "libcurl", url.method = "libcurl") +(Linux and OS X)
(Method "wininet"
is the default on Windows as from R 3.2.2.)
@@ -3924,7 +3952,28 @@ OS X. It is possible that system versions of "libcurl"
,
"libcurl"
with HTTPS support is required except on
Windows.
+Previous: How can I enable secure https downloads in R?, Up: R Miscellanea [Contents]
+Since March 2016, Windows and OS X binaries of CRAN packages for old
+versions of R (released more than 5 years ago) are made available from a
+central CRAN archive server instead of the CRAN mirrors. To get
+these, one should set the CRAN “mirror” element of the repos
+option accordingly, by something like
+
local({r <- getOption("repos") + r["CRAN"] <- "http://CRAN-archive.R-project.org" + options(repos = r) + }) +
(see ?options
for more information).
+
This manual is for R, version 3.2.3 (2015-12-10). +
This manual is for R, version 3.3.1 (2016-06-21).
-Copyright © 2001–2015 R Core Team +
Copyright © 2001–2016 R Core Team
Permission is granted to make and distribute verbatim copies of this @@ -1029,13 +1026,13 @@ specified on the
make install
command line (at least forlibdir
. The C header files can be installed to the value ofrincludedir
: note that as the headers are not installed into a subdirectory you probably want something like -rincludedir=/usr/local/include/R-3.2.3
. +rincludedir=/usr/local/include/R-3.3.1
.If you want the R home to be something other than libdir/R, use rhome: for example
-make install rhome=/usr/local/lib64/R-3.2.3 +make install rhome=/usr/local/lib64/R-3.3.1will use a version-specific R home on a non-Debian Linux 64-bit @@ -1207,8 +1204,8 @@ architecture which is run.
Sub-architectures are also used on Windows, but by selecting executables within the appropriate bin directory, R_HOME/bin/i386 or R_HOME/bin/x64. For -backwards compatibility with R < 2.12.0, there are executables -R_HOME/bin/R.exe or R_HOME/bin/Rscript.exe: +backwards compatibility there are executables +R_HOME/bin/R.exe and R_HOME/bin/Rscript.exe: these will run an executable from one of the subdirectories, which one being taken first from the @@ -1231,12 +1228,12 @@ Previous: Sub-architec
2.6.1 Multilib
-On Linux9, there is an alternative mechanism for mixing 32-bit and 64-bit -libraries known as multilib. If a Linux distribution supports -multilib, then parallel builds of R may be installed in the -sub-directories lib (32-bit) and lib64 (64-bit). The -build to be run may then be selected using the
setarch
-command. For example, a 32-bit build may be run by +For some Linux distributions9, there is an alternative mechanism for mixing +32-bit and 64-bit libraries known as multilib. If the Linux +distribution supports multilib, then parallel builds of R may be +installed in the sub-directories lib (32-bit) and lib64 +(64-bit). The build to be run may then be selected using the +
setarch
command. For example, a 32-bit build may be run bysetarch i686 R @@ -1253,8 +1250,8 @@ sessions in which packages are to be installed, even if that is the only version of R installed (since this tells the package installation code the architecture needed). -At present there is a potential problem with packages using Java, as -the post-install for a ‘i686’ RPM on ‘x86_64’ Linux +
There is a potential problem with packages using Java, as the +post-install for a ‘i686’ RPM on ‘x86_64’ Linux reconfigures Java and will find the ‘x86_64’ Java. If you know where a 32-bit Java is installed you may be able to run (as root)
@@ -1288,10 +1285,9 @@ to R or intended for specialist uses by the R developers.One that may be useful when working on R itself is the option --disable-byte-compiled-packages, which ensures that the base -and recommended packages are lazyloaded but not byte-compiled. -(Alternatively the (make or environment) variable -
R_NO_BASE_COMPILE
can be set to a non-empty value for the duration -of the build.) +and recommended packages are not byte-compiled. (Alternatively the +(make or environment) variableR_NO_BASE_COMPILE
can be set to a +non-empty value for the duration of the build.)Option --with-internal-tzcode makes use of R’s own code and copy of the Olson database for managing timezones. This will be @@ -1319,8 +1315,8 @@ Previous: Other Options, U
2.7.1 OpenMP Support
By default
configure
searches for suitable -options11 for OpenMP support for the C, C++98, FORTRAN -77 and Fortran compilers. +options11 for OpenMP support for the C, C++98, FORTRAN 77 and +Fortran compilers.Only the C result is currently used for R itself, and only if
MAIN_LD
/DYLIB_LD
were not specified. This can be @@ -1342,10 +1338,10 @@ SHLIB_OPENMP_FFLAGSSetting to an empty value will disable OpenMP for that compiler (and configuring with --disable-openmp will disable all detection of -OpenMP). Note that the
configure
detection test is to compile -and link a standalone OpenMP program, which is not the same as compiling -a shared object and loading it into the C program of R’s executable. -Note that overridden values are not tested. +OpenMP). Theconfigure
detection test is to compile and link +a standalone OpenMP program, which is not the same as compiling a shared +object and loading it into the C program of R’s executable. Note +that overridden values are not tested.
@@ -1356,7 +1352,8 @@ Previous: Other Options, U2.8 Testing an Installation
-Full testing is possible only if the test files have been installed with +
Full post-installation testing is possible only if the test files have +been installed with
-make install-tests @@ -1421,10 +1418,6 @@ bytestInstalledBasic("internet")(On Windows that runs the tests using whichever of internal or WinInet -internet functions has been selected for that session: to test both run -this twice selecting both options using
setInternet2
.) -These tests work best if
@@ -1459,10 +1452,12 @@ from CRAN to run on 32- or 64-bit Windows (XP or later) on ‘ix86’ and ‘x86_64’ CPUs.diff
(in Rtools*.exe for Windows users) is in the path.Your file system must allow long file names (as is likely except -perhaps for some network-mounted systems). +perhaps for some network-mounted systems). If it doesn’t also support +conversion to short name equivalents (a.k.a. DOS 8.3 names), then R +must be installed in a path that does not contain spaces.
Installation is via the installer -R-3.2.3-win.exe. Just double-click on the icon and +R-3.3.1-win.exe. Just double-click on the icon and follow the instructions. When installing on a 64-bit version of Windows the options will include 32- or 64-bit versions of R (and the default is to install both). You can uninstall R from the Control Panel. @@ -1571,12 +1566,12 @@ Next: Building the c
You need to collect the following sets of files:
-
- Get the R source code tarball R-3.2.3.tar.gz from +
- Get the R source code tarball R-3.3.1.tar.gz from CRAN. Open a command window (or another shell) at directory R_HOME, and run
-tar -xf R-3.2.3.tar.gz +tar -xf R-3.3.1.tar.gzto create the source tree in R_HOME. Beware: do use @@ -1585,11 +1580,11 @@ If you are using an account with administrative privileges you may get a lot of messages which can be suppressed by
-- -tar --no-same-owner -xf R-3.2.3.tar.gz +tar --no-same-owner -xf R-3.3.1.tar.gzor perhaps better, set the environment variable
TAR_OPTIONS
to the ++or perhaps better, set the environment variable
TAR_OPTIONS
to the value ‘--no-same-owner --no-same-permissions’.It is also possible to obtain the source code using Subversion; see @@ -1609,14 +1604,15 @@ automatically by running in R_HOME/src/gnuwin32
- The binary distributions of external software. Download
--https://www.stats.ox.ac.uk/pub/Rtools/goodies/multilib/local320.zip +https://www.stats.ox.ac.uk/pub/Rtools/goodies/multilib/local323.zipcreate an empty directory, say c:/R/extsoft, and unpack it in +
(or a more recent version if appropriate), create an empty directory, +say c:/R/extsoft, and unpack it in that directory by e.g.
-unzip local320.zip -d c:/R/extsoft +unzip local323.zip -d c:/R/extsoft- Make a local copy of the configuration rules by @@ -1637,11 +1633,11 @@ cairo-based devices.
The following additional item is normally installed by -Rtools31.exe. If instead you choose to do a completely manual +Rtools*.exe. If instead you choose to do a completely manual build you will also need
-
- The Tcl/Tk support files are contained in Rtools31.exe and +
- The Tcl/Tk support files are contained in Rtools*.exe and available as .zip files from https://www.stats.ox.ac.uk/pub/Rtools. Please make sure you install the right version: there is a 32-bit version and a 64-bit @@ -1929,7 +1925,7 @@ source tree) in src/gnuwin32/installer run installation (in double quotes if it contains spaces or backslashes).
Both methods create an executable with a standard name such as -R-3.2.3-win.exe, so please rename it to indicate that +R-3.3.1-win.exe, so please rename it to indicate that it is customized. If you intend to distribute a customized installer please do check that license requirements are met – note that the installer will state that the contents are distributed under GPL @@ -1992,21 +1988,21 @@ make msi
which will result in a file with a name like -R-3.2.3-win32.msi. This can be double-clicked to be +R-3.3.1-win32.msi. This can be double-clicked to be installed, but those who need it will know what to do with it (usually by running
msiexec /i
with additional options). Properties that users might want to set from themsiexec
command line include ‘ALLUSERS’, ‘INSTALLDIR’ (something like -c:\Program Files\R\R-3.2.3) and ‘RMENU’ (the path +c:\Program Files\R\R-3.3.1) and ‘RMENU’ (the path to the ‘R’ folder on the start menu) and ‘STARTDIR’ (the starting directory for R shortcuts, defaulting to something like c:\Users\name\Documents\R).The MSI installer can be built both from a 32-bit build of R -(R-3.2.3-win32.msi) and from a 64-bit build of R -(R-3.2.3-win64.msi, optionally including 32-bit files +(R-3.3.1-win32.msi) and from a 64-bit build of R +(R-3.3.1-win64.msi, optionally including 32-bit files by setting the macro
HOME32
, when the name is -R-3.2.3-win.msi). Unlike the main installer, a 64-bit +R-3.3.1-win.msi). Unlike the main installer, a 64-bit MSI installer can only be run on 64-bit Windows.Thanks to David del Campo (Dept of Statistics, University of Oxford) @@ -2086,19 +2082,12 @@ Next: Running R, Previous: The front page of a CRAN site has a link ‘Download R for OS -X’. Click on that, then download the file R-3.2.3.pkg +X’. Click on that, then download the file R-3.3.1.pkg and install it. This runs on OS X 10.9 and later (Mavericks, Yosemite, -El Capitan13, …). -
-There may be14 a -separate installer package R-3.2.3-snowleopard.pkg, -which runs on OS X 10.6 and later (Snow Leopard, Lion, Mountain Lion, -Mavericks, Yosemite, …); it is a 64-bit (‘x86_64’) build -which should run on all Macs from mid-2008 on. +El Capitan, …).
Installers for R-patched and R-devel are usually available from -https://r.research.att.com, including a -R-3-2-branch-snowleopard-signed.pkg build for R-patched. +https://r.research.att.com.
For some older versions of the OS you can in principle (it is little tested) install R from the sources. @@ -2165,11 +2154,12 @@ its user manual is currently part of the OS X FAQ at can be viewed from R.APP’s ‘Help’ menu.
-You can run command-line R from a Terminal15 so these -can be typed as commands like any other Unix-alike: see the next chapter -of this manual. There are some small differences which may surprise -users of R on other platforms, notably the default location of the -personal library directory (under ~/Library/R, +
You can run command-line R and
@@ -2177,21 +2167,15 @@ other output to stderr are highlighted in bold. preferences are stored, so if it fails when launched for the very first time, try it again (the first attempt will store some preferences). -Rscript
from a +Terminal13 so these can be +typed as commands like any other Unix-alike: see the next chapter of +this manual. There are some small differences which may surprise users +of R on other platforms, notably the default location of the personal +library directory (under ~/Library/R, e.g. ~/Library/R/3.3/library), and that warnings, messages and other output to stderr are highlighted in bold.Users of R.APP under Mavericks and later need to be aware of the ‘App -Nap’ feature +
Users of R.APP need to be aware of the ‘App Nap’ feature (https://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_9.html) which can cause R tasks to appear to run very slowly when not -producing output in the console. Here are three ways to avoid it: +producing output in the console. Here are ways to avoid it:
- Ensure that the console is completely visible (or at least the activity indicator at the top right corner is visible). -
- Call ‘Get Info’ on the application (e.g. from Finder). This may -have two tick boxes in the ‘General’ panel: click the one named ‘Prevent -App Nap’ if it is not already ticked. (This only available for builds -made prior to Mavericks.) -
- In a Terminal, run
defaults write org.R-project.R NSAppSleepDisabled -bool YES @@ -2224,7 +2208,7 @@ links to R and Rscript in /usr/bin or /usr/local/bin should also be removed.If you want to get rid of R more completely using a Terminal, simply -run (use /usr/local/bin on El Capitan): +run (use /usr/local/bin as from El Capitan):
sudo rm -rf /Library/Frameworks/R.framework /Applications/R.app \ @@ -2252,6 +2236,8 @@ pkgutil --files org.r-project.x86_64.texinfoThese are paths relative to /, the root of the file system.
+ +
@@ -2271,7 +2257,7 @@ versions are installed under-A version of R can be run directly from the command-line as e.g.
-/Library/Frameworks/R.framework/Versions/3.2/Resources/bin/R +/Library/Frameworks/R.framework/Versions/3.3/Resources/bin/RHowever, R.APP will always run the ‘current’ version, that is the last @@ -2421,7 +2407,7 @@ package installed there.
R comes with a single library, R_HOME/library which is the value of the R object ‘.Library’ containing the standard and -recommended16 packages. +recommended14 packages. Both sites and users can create others and make use of them (or not) in an R session. At the lowest level ‘.libPaths()’ can be used to add paths to the collection of libraries or to report the current @@ -2432,7 +2418,7 @@ collection.
R will automatically make use of a site-specific library R_HOME/site-library if this exists (it does not in a vanilla R installation). This location can be overridden by -setting17 ‘.Library.site’ in +setting15 ‘.Library.site’ in R_HOME/etc/Rprofile.site, or (not recommended) by setting the @@ -2473,6 +2459,8 @@ Next: Updating packages
+ • Byte-compilation: @@ -2495,7 +2483,7 @@ absolute path to a valid temporary directory, not containing spaces. • External software: + For most users it suffices to call ‘install.packages(pkgname)’ or its GUI equivalent if the intention is to install a CRAN package and internet access is -available.18 On most systems ‘install.packages()’ +available.16 On most systems ‘install.packages()’ will allow packages to be selected from a list box (typically with several thousand items).
@@ -2543,7 +2531,7 @@ name given is a single .tar.gz file.-
install.packages
can look in several repositories, specified as a character vector by the argumentrepos
: these can include a -CRAN mirror, Bioconductor, Omegahat, R-forge, rforge.net, +CRAN mirror, Bioconductor, R-forge, rforge.net, local archives, local files, …). FunctionsetRepositories()
can select amongst those repositories that the R installation is aware of. @@ -2593,13 +2581,16 @@ directory of a bundled distribution of Gtk2 from the path: it should work to have both 32- and 64-bit Gtk+ bin directories in the path on a 64-bit version of R.
R CMD INSTALL
works in Windows to install source packages. No -additional tools are needed if the package does not contain compiled -code, andinstall.packages(type="source")
will work for such -packages (and for those with compiled code if the tools (see The Windows toolset) are in the path). We have seen occasional permission -problems after unpacking source packages on some systems: these have -been circumvented by setting the environment variable -R_INSTALL_TAR
to ‘tar.exe’. +
R CMD INSTALL
works in Windows to install source packages. +No additional tools are needed if the package does not contain +compiled code, andinstall.packages(type="source")
will work +for such packages (and for those with compiled code if the tools (see +The Windows toolset) are on the path, and the variables +BINPREF
andBINPREF64
are set properly; see the +discussion below). We have seen occasional permission problems after +unpacking source packages on some systems: these have been +circumvented by setting the environment variableR_INSTALL_TAR
+to ‘tar.exe’.If you have only a source package that is known to work with current @@ -2614,7 +2605,7 @@ of the running
-R
succeeded, whether or not the other architecture was successfully installed. The exceptions are packages with a non-empty configure.win script or which make use of src/Makefile.win. If configure.win does something -appropriate to both architectures use19 option +appropriate to both architectures use17 option --force-biarch: otherwiseR CMD INSTALL --merge-multiarch
can be applied to a source tarball to merge separate 32- and 64-bit installs. (This can only be applied to a tarball, and @@ -2627,14 +2618,22 @@ sources on Windows without any additional tools.There is provision to make use of a system-wide library of installed -external software by setting the
make
variable -LOCAL_SOFT
, to give an equivalent of /usr/local on a -Unix-alike. This can be set in src/gnuwin/MkRules.local when -R is built from sources (see the comments in -src/gnuwin/MkRules.dist), or in file20 etc/i386/Makeconf or etc/x64/Makeconf for an -installed version of R. The version used by CRAN can be -installed as described in Building from source. + + +Packages with compiled code may need to have paths to the compilers +set explicitly, and there is provision to make use of a system-wide +library of installed external software. The compiler paths are set +using the
make
variablesBINPREF
(and in some cases +BINPREF64
). The library location is set usingmake
+variableLOCAL_SOFT
, to give an equivalent of /usr/local +on a Unix-alike. All of these can be set in +src/gnuwin32/MkRules.local when R is built from sources (see +the comments in src/gnuwin32/MkRules.dist), or in +file18 +etc/i386/Makeconf or etc/x64/Makeconf for an installed +version of R. In the latter case onlyBINPREF
is used, with +the 64 bit path used in etc/x64/Makeconf. The version used by +CRAN can be installed as described in Building from source.
@@ -2665,11 +2664,7 @@ source versions of packages without compiled C/C++/Fortran code and offer to do so for those with, ifmake
is available.Note that most binary packages including compiled code are tied to a -particular series (e.g. R 3.2.x or 3.1.x) of R. -
-You should not attempt to mix-and-match binary packages built for the -‘Snow Leopard’ and ‘Mavericks’ CRAN distributions: doing so is -likely to lead to crashes or failures to load. +particular series (e.g. R 3.2.x or 3.3.x) of R.
Installing source packages which do not contain compiled code should work with no additional tools. For others you will need the @@ -2678,7 +2673,7 @@ used to build R: see OS X.
Package rJava and those which depend on it need a Java runtime installed and several packages need X11 installed, including those using -Tk. For Mountain Lion and later see OS X and Java (OS X). +Tk. See OS X and Java (OS X).
Tcl/Tk extensions
BWidget
andTktable
are part of the Tcl/Tk contained in the R installer. These are required by a number @@ -2694,13 +2689,14 @@ appropriate version at the time of writing wasThe default compilers specified in /Library/Frameworks/R.framework/Resources/etc/Makeconf depend on the version of OS X under which R was installed, and are appropriate -to the latest version of the command-line tools for that version -of OS X. The settings can be changed, either by editing that file or in -a file such as ~/.R/Makevars (see the next section). Entries -which may need to be changed include ‘CC’, ‘CXX’, ‘FC’, -‘F77’, ‘FLIBS’ and the corresponding flags, and perhaps -‘CXXCPP’, ‘DYLIB_LD’, ‘MAIN_LD’, ‘SHLIB_CXXLD’, -‘SHLIB_FCLD’ and ‘SHLIB_LD’. +for the latest version of the ‘Command Line Tools’ for that version of +OS X and the recommended version of Fortran (see OS X). The +settings can be changed, either by editing that file or in a file such +as ~/.R/Makevars (see the next section). Entries which may need +to be changed include ‘CC’, ‘CXX’, ‘FC’, ‘F77’, +‘FLIBS’ and the corresponding flags, and perhaps ‘CXXCPP’, +‘DYLIB_LD’, ‘MAIN_LD’, ‘SHLIB_CXXLD’, ‘SHLIB_FCLD’ +and ‘SHLIB_LD’.
So for example you could select
clang
for both C and C++ with extensive checking by having in ~/.R/Makevars @@ -2711,11 +2707,6 @@ CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversionand for a version of
gfortran-4.2
we needed ---FLIBS=-lgfortran -
@@ -2828,7 +2819,7 @@ with a source tarball.-Previous: Multiple sub-architectures, Up: Installing packages [Contents][Index]
+Next: External software, Previous: Multiple sub-architectures, Up: Installing packages [Contents][Index]6.3.5 Byte-compilation
@@ -2839,8 +2830,7 @@ INSTALL with option --byte-compile or byinstall.packages(type = "source", INSTALL_opts = "--byte-compile")
. -Not all contributed packages work correctly when byte-compiled (for -example because they interfere with the sealing of namespaces). For +
Not all contributed packages work correctly when byte-compiled. For most packages (especially those which make extensive use of compiled code) the speed-up is small. Unless a package is used frequently the time spent in byte-compilation can outweigh the time saved in execution: @@ -2851,6 +2841,69 @@ package. ‘ByteCompile’ field in the DESCRIPTION file.
+ +++ ++Previous: Byte-compilation, Up: Installing packages [Contents][Index]
+6.3.6 External software
+ +Some R packages contain compiled code which links to external +software libraries. Unless the external library is statically linked +(which is done as much as possible for binary packages on Windows and OS +X), the libraries have to be found when the package is loaded and not +just when it is installed. How this should be done depends on the OS +(and in some cases the version). +
+For Unix-alikes except OS X the primary mechanism is the
+ld.so
+cache controlled byldconfig
: external dynamic libraries +recorded in that cache will be found. Standard library locations will +be covered by the cache, and well-designed software will add its +locations (as for example openmpi does on Fedora). The secondary +mechanism is to consult the environment variableLD_LIBRARY_PATH
. +Now the R script controls that variable, and sets it to the +concatenation ofR_LD_LIBRARY_PATH
,R_JAVA_LD_LIBRARY_PATH
+and the environment value ofLD_LIBRARY_PATH
. The first two have +defaults which are normally set when R is installed (but can be +overridden in the environment) soLD_LIBRARY_PATH
is the best +choice for a user to set. +On OS X the primary mechanism is to embed the absolute path to dependent +dynamic libraries into an object when it is compiled. Few R packages +arrange to do so, but it can be edited19 via
+install_name_tool
— +that only deals with direct dependencies and those would also need to be +compiled to include the absolute paths of their dependencies. If the +choice of absolute path is to be deferred to load time, how they are +resolved is described inman dyld
: the role of +LD_LIBRARY_PATH
is replaced on OS X byDYLD_LIBRARY_PATH
and +latterlyDYLD_FALLBACK_LIBRARY_PATH
. RunningR CMD otool +-L
on the package shared object will show where (if anywhere) its +dependencies are resolved.DYLD_FALLBACK_LIBRARY_PATH
is preferred +(and it is that which is manipulated by the R script), but as from +10.11 (‘El Capitan’) the default behaviour had been changed for security +reasons to discard these environment variables when invoking a shell +script (and R is a shell script). That makes the only portable +option to setR_LD_LIBRARY_PATH
in the environment, something like +++ +export R_LD_LIBRARY_PATH="`R RHOME`/lib:/opt/local/lib" +The precise rules for where Windows looks for DLLs are complex and +depend on the version of Windows. But for present purposes the main +solution is to put the directories containing the DLLs the package +links to (and any those DLLs link to) on the
+PATH
. 64-bit +versions of Windows will ignore 32-bit DLLs from 64-bit R and +vice versa. +The danger with any of the methods which involve setting environment +variables is of inadvertently masking a system library. This is less +for
+DYLD_FALLBACK_LIBRARY_PATH
and for appending to +PATH
on Windows (as it should already contain the system library +paths). +
-@@ -2915,8 +2968,7 @@ can be removed by lib = file.path("path", "to", "library"))
Finally, in most installations one can just remove the package directory -from the library. +
Finally, one can just remove the package directory from the library.
@@ -2932,11 +2984,12 @@ Next: CheUtilities such as
install.packages
can be pointed at any CRAN-style repository, and R users may want to set up their own. The ‘base’ of a repository is a URL such as -http://www.omegahat.org/R/: this must be an URL scheme that -download.packages
supports (which also includes ‘ftp://’ and -‘file://’ and on most systems ‘https://’). Under that base -URL there should be directory trees for one or more of the following -types of package distributions: +http://www.stats.ox.ac.uk/pub/RWin: this must be an URL scheme +thatdownload.packages
supports (which also includes +‘ftp://’ and ‘file://’ and (from R 3.3.0 and perhaps +earlier) ‘https://’). Under that base URL there should be +directory trees for one or more of the following types of package +distributions:
"source"
: located at src/contrib and containing @@ -2953,11 +3006,6 @@ R versions x.y.z and containing .zip files for Windows. bin/macosx/mavericks/contrib/3.y for the CRAN build for ‘Mavericks’ (and later) for R versions 3.y.z, containing .tgz files. - -"mac.binary"
: located at -bin/macosx/contrib/3.y for a CRAN build for -‘Snow Leopard’ (and later) for R versions 3.y.z, containing -.tgz files.Each terminal directory must also contain a PACKAGES file. This @@ -3147,7 +3195,7 @@ Next: Locales under Wi
7.1.1 Locales under Unix-alikes
-Modern Linux uses the XPG21 locale specifications which have the form +
Modern Linux uses the XPG20 locale specifications which have the form ‘en_GB’, ‘en_GB.UTF-8’, ‘aa_ER.UTF-8@saaho’, ‘de_AT.iso885915@euro’, the components being in the order listed above. (See
man locale
andlocale -a
for more @@ -3220,7 +3268,7 @@ This can be overridden first by the setting of the environment variable -LANGUAGE
and then22 +LANGUAGE
and then21 by the environment variablesLC_ALL
,LC_MESSAGES
andLANG
. (The last three are normally used to set the locale and so should not be needed, but the first is only used to select the language @@ -3234,7 +3282,7 @@ language to Spanish.)It is usually possible to change the language once R is running via (not Windows)
@@ -3273,7 +3321,7 @@ to a generic German one (‘de’) for an Austrian user. H specific translation catalogue exists but does not contain a translation, the less specific catalogues are consulted. For example, R has catalogues for ‘en_GB’ that translate the Americanisms -(e.g., ‘gray’) in the standard messages into English.24 Two other examples: there are catalogues +(e.g., ‘gray’) in the standard messages into English.23 Two other examples: there are catalogues for ‘es’, which is Spanish as written in Spain and these will by default also be used in Spanish-speaking Latin American countries, and also for ‘pt_BR’, which are used for Brazilian locales but not for @@ -3289,7 +3337,7 @@ error messages with pairs of single quotes translated to Unicode directional quotes.Sys.setlocale("LC_MESSAGES", "new_locale")
, or by setting an environment variable such as -LANGUAGE
, provided23 the language you are changing to can be output in +LANGUAGE
, provided22 the language you are changing to can be output in the current character set. But this is OS-specific, and has been known to stop working on an OS upgrade.If no suitable translation catalogue is found or a particular message is -not translated in any suitable catalogue, ‘English’25 is used. +not translated in any suitable catalogue, ‘English’24 is used.
See https://developer.r-project.org/Translations30.html for how to prepare and install translation catalogues. @@ -3311,8 +3359,8 @@ but for some (e.g., ‘x86_64’ Linux and OS X >= 10.6) 64-bit is.
All current versions of R use 32-bit integers and -ISO/IEC 6055926 double-precision reals, and so compute to -the same precision27 and with the same limits on the sizes of +ISO/IEC 6055925 double-precision reals, and so compute to +the same precision26 and with the same limits on the sizes of numerical quantities. The principal difference is in the size of the pointers.
@@ -3334,7 +3382,7 @@ address space (around 300Mb) or when the total size of objects in use is around one third (around 1Gb).- Only 64-bit builds support ‘long vectors’, those with 2^{31} or -more elements (each of which needs 16GB of storage for a numeric +more elements (which needs at least 16GB of storage for each numeric vector).
- Most 32-bit OSes by default limit file sizes to 2GB (and this may also @@ -3353,9 +3401,9 @@ was 15-20%.) ‘x86_64’ vs ‘ix86’, the 64-bit CPU has features (such as SSE2 instructions) which are guaranteed to be present but are optional on the 32-bit CPU, and also has more general-purpose registers. -This means that on chips like a desktop Intel Core 2 Duo the vanilla -64-bit version of R has been around 10% faster on both Linux and OS -X. (Laptop CPUs are usually relatively slower in 64-bit mode.) +This means that on chips like a desktop Intel i7 the vanilla 64-bit +version of R has been around 10% faster on both Linux and OS X. +(Laptop CPUs are usually relatively slower in 64-bit mode.)
So, for speed you may want to use a 32-bit build (especially on a @@ -3379,7 +3427,7 @@ Next: 9 The standalone Rmath library
The routines supporting the distribution and -special28 functions in R +special27 functions in R and a few others are declared in C header file Rmath.h. These can be compiled into a standalone library for linking to other applications. (Note that they are not a separate library when R is @@ -3391,7 +3439,7 @@ is the current working directory (in the build directory tree on a Unix-alike if that is separate from the sources).
Rmath.h contains ‘R_VERSION_STRING’, which is a character -string containing the current R version, for example
"3.2.0"
. +string containing the current R version, for example"3.3.0"
.There is full access to R’s handling of
NaN
,Inf
and-Inf
via special versions of the macros and functions @@ -3484,7 +3532,7 @@ test the process (viamake test
). Note that you will probably not be able to run it unless you add the directory containing libRmath.so to theLD_LIBRARY_PATH
environment variable -(libRmath.dylib,DYLD_LIBRARY_PATH
on OS X). +(libRmath.dylib,DYLD_FALLBACK_LIBRARY_PATH
on OS X).The targets
@@ -3521,7 +3569,7 @@ Previous: Unix-ali9.2 Windows
-You need to set up29 almost all the +
You need to set up28 almost all the tools to make R and then run (in a Unix-like shell)
@@ -3548,7 +3596,7 @@ make -f Makefile.win-make -f Makefile.win shared implibTo use the routines in your own C or C++ programs using MinGW, include +
To use the routines in your own C or C++ programs using MinGW-w64, include
#define MATHLIB_STANDALONE @@ -3561,7 +3609,7 @@ order, so the result depends on which files are present. You should be able to force static or dynamic linking via-@@ -3571,7 +3619,7 @@ is dynamically linked, and test-static.exe, which is statically linked).-Wl,-Bstatic -lRmath -Wl,dynamic +-Wl,-Bstatic -lRmath -Wl,Bdynamic -Wl,-Bdynamic -lRmathIt is possible to link to Rmath.dll using other compilers, either -directly or via an import library: if you make a MinGW import library as +directly or via an import library: if you make a MinGW-w64 import library as above, you will create a file Rmath.def which can be used (possibly after editing) to create an import library for other systems such as Visual C++. @@ -3585,7 +3633,7 @@ such as Visual C++.
to ensure that the constants like
@@ -3628,45 +3676,69 @@ Next: Useful lNA_REAL
are linked correctly. -(Auto-import will probably work with MinGW, but it is better to be +(Auto-import will probably work with MinGW-w64, but it is better to be sure. This is likely to also work with VC++, Borland and similar compilers.)A.1 Essential programs and libraries
You need a means of compiling C and FORTRAN 90 (see Using FORTRAN). Your C compiler should be -ISO/IEC 6005930, POSIX 1003.1 and C99-compliant.31 R tries to choose suitable flags for +ISO/IEC 6005929, POSIX 1003.1 and C99-compliant.30 R tries to choose suitable flags for the C compilers it knows about, but you may have to set
CC
orCFLAGS
suitably. For many versions ofgcc
withglibc
this means including --std=gnu9932. If the compiler is detected as -gcc
4.x
, -std=gnu99 will be appended to -CC
unless it conflicts with a setting ofCFLAGS
. (Note -that options essential to run the compiler even for linking, such as -those to set the architecture, should be specified as part ofCC
-rather than inCFLAGS
.) +-std=gnu9931. (Note that options essential to +run the compiler even for linking, such as those to set the +architecture, should be specified as part ofCC
rather than in +CFLAGS
.)Unless you do not want to view graphs on-screen (or use OS X) you need ‘X11’ installed, including its headers and client libraries. For -recent Fedora distributions it means (at least) RPMs ‘libX11’, -‘libX11-devel’, ‘libXt’ and ‘libXt-devel’. On Debian we -recommend the meta-package ‘xorg-dev’. If you really do not want -these you will need to explicitly configure R without X11, using ---with-x=no. +recent Fedora/RedHat distributions it means (at least) RPMs +‘libX11’, ‘libX11-devel’, ‘libXt’ and ‘libXt-devel’. +On Debian/Ubuntu we recommend the meta-package ‘xorg-dev’. If you +really do not want these you will need to explicitly configure R +without X11, using --with-x=no.
The command-line editing (and command completion) depends on the -GNU
readline
library: version 4.2 or later is needed -for all the features to be enabled. Otherwise you will need to -configure with --with-readline=no (or equivalent). +GNUreadline
library (including its headers): version +4.2 or later is needed for all the features to be enabled. Otherwise +you will need to configure with --with-readline=no (or +equivalent).A suitably comprehensive
-iconv
function is essential. The R usage requiresiconv
to be able to translate between"latin1"
and"UTF-8"
, to recognize""
(as the current encoding) and"ASCII"
, and to translate to and from the Unicode wide-character formats"UCS-[24][BL]E"
— this is true -by default forglibc
33 but not of most commercial Unixes. However, you +by default forglibc
32 but not of most commercial Unixes. However, you can make use of GNUlibiconv
(as used on OS X: see https://www.gnu.org/software/libiconv/).The OS needs to have enough support34 for wide-character +
The OS needs to have enough support33 for wide-character types: this is checked at configuration. A small number of POSIX -functions35 are essential, and others36 will be used if available. +functions34 are essential, and others35 will be used if available. +
+Installations of
+zlib
(version 1.2.5 or later),libbz2
+(version 1.0.6 or later: called bzip2-libs/bzip2-devel or +libbz2-1.0/libbz2-dev by some Linux distributions), +liblzma
36 version 5.0.3 or +later are required. +PCRE37 (version 8.32 or later, although versions 8.10–8.31 will +be accepted with a deprecation warning) is required (or just its library +and headers if packaged separately). PCRE must be built with UTF-8 +support (not the default, and checked by
configure
) and +support for Unicode properties is assumed by some R packages. JIT +support is desirable for the best performance: support for this and +Unicode properties can be checked at run-time by calling +pcre_config()
. If building PCRE for use with R a suitable +configure
command might be +++/configure --enable-utf --enable-unicode-properties --enable-jit --disable-cpp +The --enable-jit flag is supported for most common CPUs. +
+Library
libcurl
(version 7.28.0 or later) is required. +Information onlibcurl
is found from thecurl-config
+script: if that is missing or needs to be overridden38 there are macros to do so described in file +config.site.A
+ +tar
program is needed to unpack the sources and packages -(including the recommended packages). A version37 that can +(including the recommended packages). A version39 that can automagically detect compressed archives is preferred for use withuntar()
: the configure script looks forgtar
andgnutar
before @@ -3686,10 +3758,15 @@ make PDF versions of the manuals you will also need file texinfo.tex installed (which is part of the GNU texinfo distribution but is often made part of the TeX package in re-distributions) as well as -texi2dvi
.38 +texi2dvi
.40 Further, the versions oftexi2dvi
and texinfo.tex need to be compatible: we have seen problems with older TeX distributions.If you want to build from the R Subversion repository then +
texi2any
is highly recommended as it is used to create files +which are in the tarball but not stored in the Subversion repository. +The PDF documentation (including doc/NEWS.pdf) and building vignettes needs
- - -pdftex
andpdflatex
. We require @@ -3704,19 +3781,13 @@ kept up-to-date. A number of standard LaTeX packages are required may need to change R’s defaults: see Making the manuals). Note that package hyperref (currently) requires packages kvoptions, ltxcmds and refcount. For distributions -based on TeXLive the simplest approach may be to install collections +based on TeX Live the simplest approach may be to install collections collection-latex, collection-fontsrecommended, collection-latexrecommended, collection-fontsextra and collection-latexextra (assuming they are not installed by default): Fedora uses names like texlive-collection-fontsextra and Debian/Ubuntu like texlive-fonts-extra.If you want to build from the R Subversion repository then -
texi2any
is highly recommended as it is used to create files -in the tarball but not under Subversion. -The essential programs should be in your
PATH
at the timeconfigure
is run: this will capture the full paths. @@ -3745,18 +3816,18 @@ earliest version we have tested. (For Fedora users we believe the ‘pangocairo’ package is installed (and if not, ‘cairo’) and if additional flags are needed for the ‘cairo-xlib’ package, then if suitable code can be compiled. These tests will fail if -pkg-config
is not installed39, and are likely to fail ifcairo
was built +pkg-config
is not installed41, and are likely to fail ifcairo
was built statically (unusual). Most systems withGtk+
2.8 or later installed will have suitable librariesFor the best font experience with these devices you need suitable fonts installed: Linux users will want the
-urw-fonts
package. On platforms which have it available, themsttcorefonts
-package40 provides +package42 provides TrueType versions of Monotype fonts such as Arial and Times New Roman. Another useful set of fonts is the ‘liberation’ TrueType fonts available at -https://fedorahosted.org/liberation-fonts/,41 which cover the Latin, Greek and Cyrillic alphabets +https://fedorahosted.org/liberation-fonts/,43 which cover the Latin, Greek and Cyrillic alphabets plus a fair range of signs. These share metrics with Arial, Times New Roman and Courier New, and contain fonts rather similar to the first two (https://en.wikipedia.org/wiki/Liberation_fonts). Then there @@ -3783,17 +3854,6 @@ needed). Recent versions allow several other libraries to be linked intolibtiff
such aslzma
,jbig
andjpeg12
, and these may need also to be present.If you have them installed (including the appropriate headers and of -suitable versions), system versions of
zlib
(version 1.2.5 or -later),,libbz2
(version 1.0.6 or later: called -bzip2-libs/bzip2-devel or libbz2-1.0/libbz2-dev -by some Linux distributions) and PCRE (version 8.10 or later, preferably -8.32 or later42): will be used, -otherwise versions in the R sources will be compiled in. The -external versions can be avoided by configure options ---without-system-zlib, --without-system-bzlib and ---without-system-pcre. -Option --with-system-tre is also available: it needs a recent version of TRE. (The current sources are in the
-git
repository at https://github.com/laurikari/tre/, but at the time of writing @@ -3832,15 +3892,6 @@ oricu4c
. It will be used by default where available: should a very old or broken version of ICU be found this can be suppressed by --without-ICU.If
libcurl
version 7.28.0 or later is available (including its -development files), it will be linked in to support -curlGetHeaders
and the"libcurl"
methods of -download.file
andurl
. This is recommended as it gives -access to ‘https://’ and ‘ftps://’ URLs. Information on -libcurl
is found from thecurl-config
script: if that -is missing or needs to be overridden43 -there are macros described in file config.site. -The
-bitmap
anddev2bitmap
devices and functionembedFonts()
use ghostscript (http://www.ghostscript.com/). This should either be in your @@ -3890,7 +3941,7 @@ the Tcl and Tk libraries and for finding the tcl.h and versions of Tcl/Tk installed, specifying the paths to the correct config files may be necessary to avoid confusion between them.Versions of Tcl/Tk up to 8.5.18 and 8.6.4 have been tested (including +
Versions of Tcl/Tk up to 8.5.19 and 8.6.4 have been tested (including most versions of 8.4.x, but not recently).
Note that the tk.h header includes44 X11 headers, so you will need X11 and its @@ -3921,16 +3972,17 @@ a sub-architecture-specific version). A typical setting for ‘x86_64’ Linux is
--JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-4.b16.fc21.x86_64/jre +JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-1.b15.fc22.x86_64/jre R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/amd64/serverNote that this unfortunately depends on the exact version of the JRE/JDK +
Unfortunately this depends on the exact version of the JRE/JDK installed, and so may need updating if the Java installation is updated. This can be done by running
R CMD javareconf
which updates -settings in both etc/Makeconf and +settings in both R_HOME/etc/Makeconf and R_HOME/etc/ldpaths. SeeR CMD javareconf --help
for -details. +details: note that this needs to be done by the account owning the R +installation.Another way of overriding those settings is to set the environment variable @@ -3943,7 +3995,7 @@ Java-using packages. For example
It may be possible to avoid this by specifying an invariant link as the -path. For example, on that system any of +path when configuring. For example, on that system any of
-JAVA_HOME=/usr/lib/jvm/java @@ -4048,9 +4100,9 @@ position-independent code), and that is not checked.Some enhanced BLASes are compiler-system-specific (
sunperf
on Solaris45,libessl
on IBM, -Accelerate
on OS X). The correct incantation for -these is usually found via --with-blas with no value on -the appropriate platforms. +Accelerate
on OS X). The correct incantation for these is often +found via --with-blas with no value on the appropriate +platforms.Some of the external BLASes are multi-threaded. One issue is that R profiling (which uses the
SIGPROF
signal) may cause @@ -4535,7 +4587,8 @@ anything.) The system headers forvalgrind
can be requested by option --with-system-valgrind-headers: they will be used if present (on Linux they may be in a separate package such as valgrind-devel). Note though that there is no guarantee that the -code in R will be compatible with futurevalgrind
headers. +code in R will be compatible with very old48 or futurevalgrind
+headers.If you need to re-configure R with different options you may need to run
make clean
or evenmake distclean
before doing so. @@ -4784,7 +4837,7 @@ is to search forepcf90
,g77
,f77
,xlf
,frt
,pgf77
,cf77
,fort77
,fl32
, -af77
(in that order)48, and use whichever is found first; if none is found, +af77
(in that order)49, and use whichever is found first; if none is found, R cannot be compiled. However, ifCC
isgcc
, the matching FORTRAN compiler (g77
forgcc
3 andgfortran
for @@ -4813,7 +4866,7 @@ pointer. This is checked during the configuration process.Some of the FORTRAN code makes use of
COMPLEX*16
variables, which is a Fortran 90 extension. This is checked for at configure -time49, but you may need to avoid +time50, but you may need to avoid compiler flags asserting FORTRAN 77 compliance.Compiling the version of LAPACK in the R sources also requires some @@ -5038,9 +5091,11 @@ Windows: _WIN32, _WIN64
- • FreeBSD: • Cygwin: + - • OpenBSD: • New platforms: + + • Cygwin: + @@ -5066,7 +5121,7 @@ selection issues, they are more amenable than the issues with • New platforms: When X11 was designed, most displays were around 75dpi, whereas today they are of the order of 100dpi or more. If you find that X11() -is reporting50 missing font sizes, especially larger ones, it is likely +is reporting51 missing font sizes, especially larger ones, it is likely that you are not using scalable fonts and have not installed the 100dpi versions of the X11 fonts. The names and details differ by system, but will likely have something like Fedora’s @@ -5188,7 +5243,7 @@ significant performance improvements on recent CPUs (especially for the best possible performance on the machine on which R is being installed: if the compilation is for a site-wide installation, it may still be desirable to use something like --mtume=core2.51 It is also possible to increase the +-mtume=core2.52 It is also possible to increase the optimization levels to -O3: however for many versions of the compilers this has caused problems in at least one CRAN package. @@ -5276,7 +5331,7 @@ project (http://libcxx.llvm.org/) has also R packages only the variant using
libcxxabi
was successful.Most builds of
clang
have no OpenMP support. Builds of -version 3.7.0 or later may.52 +version 3.7.0 or later may.53
@@ -5387,42 +5442,39 @@ Next: Solaris, Previous: C.3 OS X -To build R you need to have installed Apple’s ‘Command Line Tools’ -(on some versions installing Xcode suffices). You also need -
readline
(or to configure using --without-readline), and -a Fortran compiler. Those and other binary components are available -from https://r.research.att.com/libs. +The instructions here are for ‘x86_64’ builds on 10.9 +(Mavericks) or later. In principle54 R can be +built for 10.6 to 10.8 but these has not been tested recently.
-An X sub-system is required unless configuring using ---without-x: see https://xquartz.macosforge.org/. (Note -that XQuartz will likely need to be re-installed after an OS upgrade.) -To build R you need Apple’s ‘Command Line Tools’: these can be +
To build R you need Apple’s ‘Command Line Tools’: these can be (re-)installed by
-xcode-select --install
. (If you have a fresh OS installation, running e.g.make
in a terminal will offer the installation of the command-line tools. If you have installed Xcode, this provides the command-line tools. The tools will need to be reinstalled when OS X is upgraded, as upgrading partially removes them.)The instructions here are for ‘x86_64’ builds on 10.6 (Snow -Leopard) or later. In principle R can be built for 10.4.x, 10.5.x -and for PowerPC or 32-bit Intel Macs but these has not been tested -recently. +
You need
+readline
55 and a Fortran compiler. Those and other binary +components are available from https://r.research.att.com/libs: +you are likely to needpcre
andxz
(recent OS X provides +libraries but not headers for these). +An X sub-system is required unless configuring using +--without-x: see https://xquartz.macosforge.org/.
To use the
quartz()
graphics device you need to configure with --with-aqua (which is the default):quartz()
then becomes the default device when running R at the console and X11 would only be used for the command-line-R data editor/viewer and one -version of Tcl/Tk. (This needs an Objective-C compiler53 which can compile the source code of +version of Tcl/Tk. (This needs an Objective-C compiler56 which can compile the source code ofquartz()
.)Use --without-aqua if you want a standard Unix-alike build: apart from disabling
-quartz()
and the ability to use the build with R.APP, it also changes the default location of the personal -library (see?.libPaths
). Also use ---disable-R-framework to install in the standard layout. +library (see?.libPaths
).Various compilers can be used. The current CRAN ‘Mavericks’ -distribution of R is built using +
Various compilers can be used. The current CRAN distribution +of R is built using
CC=clang @@ -5439,46 +5491,7 @@ FCFLAGS=$F77FLAGSwith
-clang
andclang++
from the ‘Command Line Tools’ and the Fortran compiler from -https://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2.54 Apple’s builds ofclang
-currently have no OpenMP support. -The CRAN ‘Snow Leopard’ distribution of R was built using -
--
- -gcc
-from an Xcode distribution prior to version 5. This is a version of gcc -4.2.1 with an LLVM backend. - -gfortran
-from -http://cran.r-project.org/bin/macosx/tools/gfortran-4.2.3.pkg. -Note that this installs into /usr/local/bin, so make sure that is -on your path. Other compilers from -http://r.research.att.com/tools/ can also be used. - -clang
-from the Xcode distribution, to compile the Objective-C parts of the -quartz()
device. -To use these, have in config.site something like -
--- -CC="llvm-gcc-4.2" -CXX="llvm-g++-4.2" -F77="gfortran-4.2 -arch x86_64" -FC=$F77 -OBJC="clang" -Full names help to ensure that the intended compilers are used. In -particular
-gcc
is a copy ofllvm-gcc-4.2
for Xcode < -5 but ofclang
in Xcode 5. The recommended Fortran compiler -defaults to 32-bit, so-arch x86_64
is needed. (For a 32-bit -build, use-arch i386
for all compiler commands.) -The OpenMP support in this version of
gcc
is problematic, so -the CRAN build is configured with --disable-openmp. +https://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2.57Other builds of
gfortran
are available: see https://gcc.gnu.org/wiki/GFortranBinaries and @@ -5489,20 +5502,14 @@ or path in a personal or site Makevars file (see http://llvm.org/releases/. In particular, these include support for the ‘Address Sanitizer’ (not included by Apple until -Xcode 7) and for OpenMP55 in version 3.7.0 and later. +Xcode 7) and for OpenMP58 in version 3.7.0 and later.Pre-compiled versions of many of the Useful libraries and programs are available from https://r.research.att.com/libs/. You will -most likely want at least
-pcre
,xz
,jpeg
-andreadline
(and perhapstiff
). -pkg-config
is not provided by Apple and useful for many packages: -it will also be used if present when configuring theX11()
-device. -Recent versions of OS X ship with
zlib
version 1.2.8 and -bzlib
version 1.0.6, sufficient for the default -configure
checks. Mavericks has a recent enough version of -libcurl
: Snow Leopard does not. +most likely want at leastjpeg
andtiff
. +pkg-config
is not provided by Apple and used for many packages: +it will also be used if present when configuring theX11()
and +bitmap devices.Support for
cairo
(withoutPango
) can be enabled in two ways: both needpkg-config
available. XQuartz shipscairo
@@ -5527,18 +5534,17 @@ Otherwise the binary libraries atto provide potentially higher-performance versions of the BLAS -and LAPACK routines. (Use of
Accelerate
with ---with-lapack does not work on Snow Leopard: it may work there -without.)56 +and LAPACK routines.59Looking at the top of /Library/Frameworks/R.framework/Resources/etc/Makeconf will show the compilers and configuration options used for the -CRAN binary package for R: at the time of writing +CRAN binary package for R: at the time of writing the +non-default options
----enable-memory-profiling +--enable-memory-profiling --enable-R-frameworkwas used for ‘Mavericks’. +
were used.
Configure option --with-internal-tzcode is the default on OS X, as the system implementation of time zones does not work correctly for @@ -5564,152 +5570,29 @@ versions. and may need to re-install XQuartz and Java (this has been needed for some upgrades but not others).
+-
-• Mavericks and later: + - • El Capitan: • Lion and Mountain Lion: + - • Tcl/Tk headers and libraries: • Snow Leopard: + - • Java (OS X): • El Capitan: + - • Frameworks: - • Tcl/Tk headers and libraries: - - • Java (OS X): - - • Frameworks: - • Building R.app: + • Building R.app:
- --- --Next: Lion and Mountain Lion, Previous: OS X, Up: OS X [Contents][Index]
-C.3.1 Mavericks and later
- -For these versions Apple makes available compilers based on -
-clang
, and C++ headers and runtime are from LLVM’s -‘libc++’ project, as part of the ‘Command Line Tools’ (sometimes -called ‘Command Line Developer Tools’) and of Xcode (you only need one -or the other). -These tools can be (re-)installed by
-xcode-select --install
. -(If you have a fresh installation of Mavericks or later, running e.g. -make
in a terminal will offer the installation of the -command-line tools, or perhaps use the versions from Xcode. However, -after an OS update, you are advised to re-install them.) -To use the compilers from the command-line tools with the recommended -Fortran compiler, have in config.site something like -
--- -CC=clang -CXX=clang++ -F77=gfortran-4.8 -FC=$F77 -OBJC=clang -More recent and complete distributions of
- -clang
are usually -available from http://llvm.org/releases/. In particular, these -include support for the ‘Address Sanitizer’ (not included by Apple until -Xcode 7) and for OpenMP in versions 3.7.0 and later. -See the comments under Mountain Lion about X11 and GTK. -
-If you upgrade the OS you should re-install any of XQuartz, the ‘Command -Line Tools’ and Java which you have installed. (Upgrading may partially -remove previous versions which can be confusing.) -
-There are some warnings using the recommended
- -gfortran
build -under Yosemite. -
- --- --Next: Snow Leopard, Previous: Mavericks and later, Up: OS X [Contents][Index]
-C.3.2 Lion and Mountain Lion
- -‘Command-line Tools for Xcode’ used to be part of the Apple Developer -Tools (‘Xcode’) but for these versions needs to be installed separately. -They can be downloaded from -http://developer.apple.com/devcenter/mac/ (you will need to -register there: that allows you to download older versions available for -your OS) or from within some versions of Xcode you can install the -command-line tools from the ‘Downloads’ pane in the -‘Preferences’. -
-The X11 system used with Mountain Lion is XQuartz (see above): Lion -included an X11 system. -
-To build the graphics devices depending on cairographics, the XQuartz -path for
-pkg-config
files needs to be known to -pkg-config
whenconfigure
is run: this usually means -adding it to thePKG_CONFIG_PATH
environment variable, e.g. --- -export PKG_CONFIG_PATH= \ - /opt/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig -or putting -
-- -PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig -in config.site. -
-For some pre-compiled software, for example the GTK framework, -/opt/X11/include may need to be added to the include paths. -
-If you install the command-line tools for Xcode 4.6.3 you will get the -compilers used for the CRAN binary distribution: those for Xcode 5 can -be installed afterwards. -
- -
- --- --Next: El Capitan, Previous: Lion and Mountain Lion, Up: OS X [Contents][Index]
-C.3.3 Snow Leopard
- -A quirk on Snow Leopard is that the X11 libraries are not in the default -linking path, so something like ‘LIBS=-L/usr/X11/lib’ may be -required in config.site, or you can use the
-configure
-options --x-includes=/usr/X11/include ---x-libraries=/usr/X11/lib . -The CRAN binaries were built using Xcode 4.2, a version -available only to subscribing developers. It is believed that 3.2.6 (the -last public free version for Snow Leopard) will work. -
--Next: Tcl/Tk headers and libraries, Previous: Snow Leopard, Up: OS X [Contents][Index]
+Next: Tcl/Tk headers and libraries, Previous: OS X, Up: OS X [Contents][Index]C.3.4 El Capitan
+C.3.1 El Capitan
- -El Capitan was released at the end of September 2015, and experience to -date is with systems which have been updated from Yosemite or earlier. -Upgraded systems need the Command Line Tools reinstalled. -
There are problems resulting from the new-to-El-Capitan restriction that only Apple is allowed to install software under /usr: this affects inter alia
-MacTeX
andXQuartz
. For @@ -5728,7 +5611,6 @@ includes /usr/X11R6, /usr/texbin, /usr/bin/Ralthough the linked versions under /usr/X11 will be found (if the link is present).
@@ -5736,7 +5618,7 @@ link is present). Next: Java (OS X), Previous: El Capitan, Up: OS X [Contents][Index]-C.3.5 Tcl/Tk headers and libraries
+C.3.2 Tcl/Tk headers and libraries
If you plan to use the
tcltk
package for R, you need to install a distribution of Tcl/Tk. There are two alternatives. If you @@ -5751,17 +5633,16 @@ This may need--with-tcl-config=/usr/local/lib/tclConfig.sh --with-tk-config=/usr/local/lib/tkConfig.shNote that this requires a fully-updated X11 installation (XQuartz for -Mountain Lion and later). +
Note that this requires a matching XQuartz installation.
There is also a native (‘Aqua’) version of Tcl/Tk which produces widgets in the native OS X style: this will not work with R.APP because of conflicts over the OS X menu, but for those only using command-line R this provides a much more intuitive interface to Tk for experienced Mac users. Most versions of OS X come with Aqua Tcl/Tk libraries, but these -are not recent versions of Tcl/Tk (8.5.9 in Mountain Lion and later). -It is better to install Tcl/Tk 8.6.x from the sources or a binary -distribution from +are not at all recent versions of Tcl/Tk (8.5.9 in El Capitan, which is +not even the latest patched version in that series). It is better to +install Tcl/Tk 8.6.x from the sources or a binary distribution from https://www.activestate.com/activetcl/downloads. Configure R with
@@ -5786,20 +5667,19 @@ tclvalue(.Tcl("tk windowingsystem")) # "x11" or "aqua& Next: Frameworks, Previous: Tcl/Tk headers and libraries, Up: OS X [Contents][Index]-C.3.6 Java
+C.3.3 Java
-The situation with Java support on OS X is messy.57 +
The situation with Java support on OS X is messy.60
-Snow Leopard and Lion shipped with a Java 6 runtime (JRE). Mountain -Lion and later do not come with an installed JRE, and an OS X upgrade -removes one if already installed: it is intended to be installed at -first use. Check if a JRE is installed by running
java +
OS X no longer comes with an installed Java runtime (JRE), and an OS X +upgrade removes one if already installed: it is intended to be installed +at first use. Check if a JRE is installed by running
-java -version
in aTerminal
window: if Java is not installed this should prompt you to install it. You can also install directly the latest Java from Oracle (currently from http://www.oracle.com/technetwork/java/javase/downloads/index.html).You may need to install what Apple calls ‘legacy Java’58 to suppress pop-up messages +
You may need to install what Apple calls ‘legacy Java’61 to suppress pop-up messages even if you have a current version installed.
To see what compatible versions of Java are currently installed, run @@ -5824,7 +5704,7 @@ JAVA_LIBS="-framework JavaVM"
The Oracle JDK can be specified explicitly by something like
--JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home +JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home JAVA_CPPFLAGS="-I/${JAVA_HOME}/include -I/${JAVA_HOME}/include/darwin" JAVA_LD_LIBRARY_PATH="${JAVA_HOME}/jre/lib/server" JAVA_LIBS="-L/${JAVA_HOME}/jre/lib/server -ljvm" @@ -5842,17 +5722,17 @@ to1
to install many of the Java-using packages. Next: Building R.app, Previous: Java (OS X), Up: OS X [Contents][Index]C.3.7 Frameworks
+C.3.4 Frameworks
The CRAN build of R is installed as a framework, which is -selected by the default option +selected by the option
./configure --enable-R-framework(This is intended to be used with an Apple toolchain: other compilers may -not support frameworks correctly.) +not support frameworks correctly. It was the default prior to R 3.3.0.)
It is only needed if you want to build R for use with the R.APP console, and implies --enable-R-shlib to build R as a @@ -5860,7 +5740,8 @@ dynamic library. This option configures R to be built and installed as a framework called R.framework. The default installation path for R.framework is /Library/Frameworks but this can be changed at configure time by specifying the flag ---enable-R-framework[=DIR] or at install time as +--enable-R-framework[=DIR] (or --prefix) or at +install time via
-make prefix=/where/you/want/R.framework/to/go install @@ -5878,7 +5759,7 @@ topkg-config
). Previous: Frameworks, Up: OS X [Contents][Index]C.3.8 Building R.app
+C.3.5 Building R.app
Note that building the R.APP GUI console is a separate project, using Xcode. Before compiling R.APP make sure the current version of R @@ -5936,9 +5817,7 @@ found in /usr/xpg4/bin and /usr/xpg6/bin.
A large selection of Open Source software can be installed from https://www.opencsw.org, by default installed under /opt/csw. Solaris 10 ships with
bzlib
version 1.0.6 -(sufficient for the default --with-system-bzlib) but -zlib
version 1.2.3 (too old for --with-system-zlib): -OpenCSW has 1.2.8. +(sufficient) butzlib
version 1.2.3 (too old): OpenCSW has 1.2.8.You will need GNU
-libiconv
andreadline
: the Solaris version oficonv
is not sufficiently powerful. @@ -5968,7 +5847,7 @@ option --with-internal-tzcode is recommended, and required if you find time-zone abbreviations being given odd values (as has been seen on 64-bit builds without it).When using the Oracle compilers59 do not specify -fast, as this +
When using the Oracle compilers62 do not specify -fast, as this disables IEEE arithmetic and
make check
will fail.It has been reported that some Solaris installations need @@ -6177,7 +6056,7 @@ FC="/opt/csw/gcc4/bin/gfortran -m32" LDFLAGS="-L/opt/csw/gcc4/lib -L/opt/csw/lib -L/usr/local/lib"
(-L/opt/csw/lib
is needed since TeXLive was built using
+
(-L/opt/csw/lib
is needed since TeX Live was built using
32-bit gcc
, and we need /opt/csw/lib in
R_LD_LIBRARY_PATH
.)
-Next: Cygwin, Previous: AIX, Up: Platform notes [Contents][Index]
+Next: OpenBSD, Previous: AIX, Up: Platform notes [Contents][Index]MAIN_LDFLAGS=-Wl,--export-dynamic --
for R releases up to 3.2.2. -
Use of ICU for collation and the configure
option
--with-internal-tzcode are desirable workarounds.
+Next: Cygwin, Previous: FreeBSD, Up: Platform notes [Contents][Index]
+-Next: New platforms, Previous: FreeBSD, Up: Platform notes [Contents][Index]
+Next: New platforms, Previous: OpenBSD, Up: Platform notes [Contents][Index]The Cygwin emulation layer on Windows can be treated as a Unix-alike OS. -This is unsupported, but experiments have been conducted and a few -workarounds added. Cygwin has not been tested for R 3.0.0 or later. +
The 32-bit version has never worked well enough to pass R’s
+make check
, and residual support from earlier experiments was
+removed in R 3.3.0.
The 64-bit version is completely unsupported. The 32-bit version has
-never worked well enough to pass R’s make check
.
-
R requires C99 complex type support, which is available as from
-Cygwin 1.7.8 (March 2011). However, the (then) implementation of
-cacos
gave incorrect results, so we undefine HAVE_CACOS
-in src/main/complex.c on that platform. It has been reported
-that some C99 long double mathematical functions are missing, so
-configuring with --disable-long-double was required.
-
Only building as a shared library can possibly work,60 so use e.g. -
-./configure --disable-nls --enable-R-shlib FLIBS=-lgfortran -make -
Enabling NLS does work if required, although adding ---with-included-gettext is preferable. You will see many -warnings about the use of auto-import. Setting ‘FLIBS’ explicitly -seems needed currently as the auto-detection gives an incorrect value. -
-You will need the tetex-extra Cygwin package to build -NEWS.pdf and the vignettes. -
-Note that this gives you a command-line application using readline
-for command editing. The ‘X11’ graphics device will work if a
-suitable X server is running, and the standard Unix-alike ways of
-installing source packages work. There was a bug in the
-/usr/lib/tkConfig.sh script in the version we looked at, which
-needs to have
-
TK_LIB_SPEC='-ltk84' -
The overhead of using shell scripts makes this noticeably slower than a -native build of R on Windows. -
-Even when R could be built, not all the tests passed: there were -incorrect results from wide-character regular expressions code and from -sourcing CR-delimited files. -
-Do not use Cygwin’s BLAS library: it is known to give incorrect results. +
The 64-bit version is completely unsupported.
We have collected most of the necessary tools (unfortunately not all, -due to license or size limitations) into an executable installer -named62 Rtools31.exe, -available from https://CRAN.R-project.org/bin/windows/Rtools/. You -should download and run it, choosing the default “Package authoring +due to license or size limitations) into an executable installer named +Rtools*.exe, available from +https://CRAN.R-project.org/bin/windows/Rtools/. You should +download and run it, choosing the default “Package authoring installation” to build add-on packages, or the “full installation” if you intend to build R.
@@ -6574,7 +6409,7 @@ use filepaths containing spaces: you can always use the short formsIt is essential that the directory containing the command line tools comes first or second in the path: there are typically like-named -tools63 in other directories, and they will not +tools64 in other directories, and they will not work. The ordering of the other directories is less important, but if in doubt, use the order above.
@@ -6625,7 +6460,7 @@ Manager.The Rtools*.exe installer does not include any version of LaTeX.
-It is also possible to use the TeXLive distribution from +
It is also possible to use the TeX Live distribution from https://www.tug.org/texlive/.
@@ -6643,7 +6478,7 @@ Next: The command linTo make the installer package (R-3.2.3-win.exe) we +
To make the installer package (R-3.3.1-win.exe) we
currently require the Unicode version of Inno Setup 5.3.7 or later from
http://jrsoftware.org/. This is not included in
Rtools*.exe.
@@ -6703,13 +6538,13 @@ Next: Useful addi
Technically you need more than just a compiler so the set of tools is
referred to as a ‘toolchain’.
The preferred toolchain is part of The preferred toolchain is part of This toolchain uses multilib: that is there is a single front-end
such as There is a version of the The file xzutils.zip contains the program Rtools31.exe
: this uses a beta
+Rtools*.exe
: this uses a beta
version of gcc 4.6.3
and version 2.0.1 of the MinGW-w64
project’s runtime.
gcc.exe
for each of the compilers and 32-bit (the
-default) and 64-bit compilation are selected by the flags64 -m32 and -m64
+default) and 64-bit compilation are selected by the flags65 -m32 and -m64
respectively. The tools are all 32-bit Windows executables and should
be able to run on any current version of Windows—however you do need a
64-bit version of Windows to build 64-bit R as the build process runs
@@ -6750,7 +6585,7 @@ to the qpdf
installation in file MkRules.local.
file
command that identifies the
type of files, and is used by Rcmd check
if available. The
-binary distribution is included in Rtools31.exe.
+binary distribution is included in Rtools*.exe.
xz
which can
be used to (de)compress files with that form of compression.
@@ -6889,7 +6724,7 @@ Next: Environment
O
-Obtaining R: Obtaining R
+OpenBSD: FreeBSD OpenBSD: OpenBSD OS X: Installing R under Unix-alikes OS X: Installing R under OS X
@@ -6983,6 +6818,8 @@ Previous: Concept index, U
OS X: OS X Index Entry Section
+B
+BINPREF
: Windows packages BINPREF64
: Windows packages BLAS_LIBS
: BLAS
@@ -7122,140 +6959,141 @@ sub-architecture is to be installed.C
with possible values ‘i386’, ‘x64’, ‘32’ and ‘64’.
mainly on RedHat and Fedora, whose layout is described -here.
+mainly on RedHat and Fedora, whose +layout is described here.
How to prepare such a directory is described in file src/extra/tzone/Notes in the R sources.
for example, -fopenmp, -xopenmp or
--qopenmp. This includes for 2015 versions of clang
-and the Intel C compiler.
clang
3.7.x and the
+Intel C compiler.
Suitable distributions include Strawberry Perl, http://strawberryperl.com/ and ActivePerl, https://www.activestate.com/activeperl.
for R 3.2.1 and earlier, the installer will
-attempt unsuccessfully to install R
and Rscript
in
-/usr/bin.
The installer as puts links to R
and
+Rscript
in /usr/bin (Mavericks, Yosemite) or
+/usr/local/bin (El Capitan and later). If these are missing, you
+can run directly the versions in
+/Library/Frameworks/R.framework/Resources/.
There was for R 3.2.1 but not for R 3.2.2.
-The installer as
-from R 3.2.2 puts links to R
and Rscript
in
-/usr/bin (Mavericks, Yosemite) or /usr/local/bin (El
-Capitan and later). If these are missing, you can run directly the
-versions in /Library/Frameworks/R.framework/Resources/.
unless they were excluded in the build.
-its binding is locked once the startup files have been read, so users cannot easily change it.
-If a proxy needs to be set, see
?download.file
.
for a small number of CRAN packages where this is known to be safe and is needed by the autobuilder this is the default. Look at the source of tools:::.install_packages for the list. It can also be specified in the package’s DESCRIPTION file.
+or by adding it in a file such as +etc/i386/Makevars.site, which does not exist by default.
+They need to have been +created using -headerpad_max_install_names, which is the +default for an R package.
or by adding it in -a file such as etc/i386/Makevars.site, which does not exist by -default.
-‘X/Open Portability Guide’, which has had several versions.
-On some systems setting
LC_ALL
or LC_MESSAGES
to ‘C’ disables LANGUAGE
.
If you try changing from French to Russian except in a UTF-8 locale, you will most likely find messages change to English.
-the language written in England: some people living in the USA appropriate this name for their language.
-with Americanisms.
-also known as IEEE 754
-at least when storing quantities: the on-FPU precision is allowed to vary
-e.g. Bessel, beta and gamma functions
-including copying MkRules.dist to MkRule.local and selecting the architecture.
-also known as IEEE 754
-Note
that C11 compilers need not be C99-compliant: R requires support for
double complex
and variable-length arrays which are optional in
C11 but is mandatory in C99.
-std=c99 excludes POSIX functionality, but config.h will turn on all GNU extensions to include the POSIX functionality. The default mode for GCC -5 is -std=gnu11.
-However, it is possible to break
the default behaviour of glibc
by re-specifying the gconv
modules to be loaded.
specifically, the C99
functionality of headers wchar.h and wctype.h, types
wctans_t
and mbstate_t
and functions mbrtowc
,
mbstowcs
, wcrtomb
, wcscoll
, wcstombs
,
wctrans
, wctype
, and iswctype
.
including the opendir
, readdir
,
closedir
, popen
, stat
, glob
, access
,
getcwd
and chdir
system calls, and either putenv
or
setenv
.
such as
realpath
, symlink
.
most often distributed as part of xz
:
+possible names in Linux distributions include
+xz-devel
/xz-libs
and liblzma-dev
.
sometimes known as PCRE1, and not PCRE2 which started at +version 10.0.
+for +example to specify static linking with a build which has both shared and +static libraries.
+Such as
GNU tar
1.15 or later, bsdtar
(from
https://github.com/libarchive/libarchive/, as used by FreeBSD and OS
X 10.6 and later) or tar
from the Heirloom Toolchest
(http://heirloom.sourceforge.net/tools.html).
texi2dvi
is normally a shell
script. Some versions (including that from texinfo 5.2 and 6.0)
-need to be run under bash
rather than a Bourne shell.
bash
rather than a Bourne shell,
+especially on Solaris. Some of the issues which have been observed with
+broken versions of texi2dvi
can be circumvented by setting the
+environment variable R_TEXI2DVICMD
to the value emulation
.
+If necessary the path to
pkg-config
can be specified by setting PKGCONF
in
config.site, on the configure
command line or in the
environment.
also known as ttf-mscorefonts-installer
in the
Debian/Ubuntu world: see also
https://en.wikipedia.org/wiki/Core_fonts_for_the_Web.
ttf-liberation
in Debian/Ubuntu.
sometimes known as PCRE1, and not PCRE2, which
-started at version 10.0. PCRE must be built with UTF-8 support (not the
-default, and checked by configure
) and support for Unicode
-properties is assumed by some R packages. JIT support is desirable
-for the best performance: support for this and Unicode properties can be
-checked at run-time by calling pcre_config()
.
for example to specify -static linking with a build which has both shared and static libraries.
This is true even for the ‘Aqua’ version of Tk on OS X, but distributions of that include a @@ -7270,61 +7108,66 @@ versions.
We have measured 15–20% on ‘i686’ Linux and around 10% on ‘x86_64’ Linux.
We believe that +versions 3.4.0 to 3.10.1 are compatible.
+On HP-UX fort77
is the
POSIX compliant FORTRAN compiler, and comes after
g77
.
as well as its equivalence to the Rcomplex
structure defined in R_ext/Complex.h.
for example, X11 font at size 14 could not
be loaded
.
or -mtune=corei7
for Intel Core
i3/15/17 with gcc >= 4.6.0
.
This also needs the OpenMP runtime, which is usually distributed separately, e.g. at http://llvm.org/releases.
-It will be necessary to
+install later versions of software such as libcurl
.
Apple provides a partial emulation of
+GNU readline 4.2 based on the NetBSD editline
library. That is
+not recommended but for the time being R’s installation scripts will
+make use of it.
These
days that is defined by Apple’s implementation of clang
, so it is
strongly recommended to use that.
This
is a tarball which needs to be unpacked in the Terminal by e.g.
sudo tar -zxf gfortran-4.8.2-darwin13.tar.bz2 -C /
. It does
not run on Core 2 Duo Macs.
This also needs the OpenMP runtime, which is distributed separately at that site.
-It is reported that for some non-Apple toolchains
-CPPFLAGS
needed to contain -D__ACCELERATE__
.
It is reported that for some non-Apple
+toolchains CPPFLAGS
needed to contain -D__ACCELERATE__
.
For more details see http://www.macstrategy.com/article.php?3.
-e.g.
Java For OS X 2015-001
from
https://support.apple.com/kb/DL1572.
including gcc
for
Sparc from Oracle.
Windows -DLLs need to have all links resolved at build time and so cannot resolve -against R.bin.
-For
example, the Cygwin version of make 3.81
fails to work
correctly.
for R 3.0.0 and later.
-such as sort
, find
and perhaps
make
.
these flags apply to the compilers: some of the tools use different flags. 32-bit builds are the default.
diff --git a/R-data.html b/R-data.html index 53f6521..8cfe7c5 100644 --- a/R-data.html +++ b/R-data.html @@ -1,8 +1,8 @@ - - +This is a guide to importing and exporting data to and from R.
-This manual is for R, version 3.2.3 (2015-12-10). +
This manual is for R, version 3.3.1 (2016-06-21).
-Copyright © 2000–2015 R Core Team +
Copyright © 2000–2016 R Core Team
Permission is granted to make and distribute verbatim copies of this @@ -372,13 +371,13 @@ here.
There are packages to allow functionality developed in languages such as
- +Java
,perl
andpython
to be directly integrated with R code, making the use of facilities in these languages even -more appropriate. (See the rJava package from CRAN and -the SJava, RSPerl and RSPython packages from the -Omegahat project, http://www.omegahat.org.) +more appropriate. (See the rJava package from CRAN +and the SJava, RSPerl and RSPython packages from the +Omegahat project, http://www.omegahat.net.)It is also worth remembering that R like S comes from the Unix tradition of small re-usable tools, and it can be rewarding to use tools @@ -428,8 +427,7 @@ on their computers for that purpose). However, this is not always possible, and Importing from other statistical systems discusses what facilities are available to access such files directly from R. For Excel spreadsheets, the available methods are summarized in -Reading Excel spreadsheets. For ODS spreadsheets from Open -Office, see the Omegahat package1 ROpenOffice. +Reading Excel spreadsheets.
In a few cases, data have been stored in a binary form for compactness and speed of access. One application of this that we have seen several @@ -471,7 +469,7 @@ intro.dat: UTF-8 Unicode (with BOM) text
Modern Unix-alike systems, including OS X, are likely to produce UTF-8 files. Windows may produce what it calls ‘Unicode’ files -(
UCS-2LE
or just possiblyUTF-16LE
2). Otherwise most files will be in a +(UCS-2LE
or just possiblyUTF-16LE
1). Otherwise most files will be in a 8-bit encoding unless from a Chinese/Japanese/Korean locale (which have a wide range of encodings in common use). It is not possible to automatically detect with certainty which 8-bit encoding (although @@ -622,7 +620,7 @@ andwrite.table
has afileEncoding
argument to make th easier.The hard part is to know what file encoding to use. For use on Windows, -it is best to use what Windows calls ‘Unicode’3, that is
"UTF-16LE"
. Using UTF-8 is a good way +it is best to use what Windows calls ‘Unicode’2, that is"UTF-16LE"
. Using UTF-8 is a good way to make portable files that will not easily be confused with any other encoding, but even OS X applications (where UTF-8 is the system encoding) may not recognize them, and Windows applications are most @@ -685,12 +683,9 @@ graphical displays, mathematics and so on.although it does not require it.
The XML package provides general facilities for reading and -writing XML documents within R. A description of the -facilities of the XML package is outside the scope of this -document: see the package’s Web page at -http://www.omegahat.org/RSXML for details and examples. Package -StatDataML on CRAN is one example building on -XML. +writing XML documents within R. +Package StatDataML on CRAN is one example building +on XML.
NB: XML is available as a binary package for Windows, normally from the ‘CRAN extras’ repository (which is selected by default on @@ -856,7 +851,7 @@ indicate missing cases in a regular layout. columns as character vectors and then tries to select a suitable class for each variable in the data frame. It tries in turn
logical
,integer
,numeric
andcomplex
, moving on if any -entry is not missing and cannot be converted.4 +entry is not missing and cannot be converted.3 If all of these fail, the variable is converted to a factor.Arguments
-colClasses
andas.is
provide greater control. @@ -1490,7 +1485,7 @@ Next: R interface packa IBM’s DB2; Microsoft SQL Server on Windows) and academic and small-system databases (such as -MySQL5, PostgreSQL, Microsoft +MySQL4, PostgreSQL, Microsoft Access, …), the former marked out by much greater emphasis on data security features. The line is blurring, with MySQL and PostgreSQL having more and more high-end features, and free ‘express’ versions @@ -3014,7 +3009,7 @@ Previous: FunctiIndex Entry Section - A + AWK: Introduction awk: Introduction B @@ -3163,23 +3158,19 @@ Previous: Functi Binary files: Binary files Footnotes
(1)
-Currently not available from -that repository but as a source package for download from -http://www.omegahat.org/ROpenOffice/.
-(2)
the distinction is subtle, https://en.wikipedia.org/wiki/UTF-16/UCS-2, and the use of surrogate pairs is very rare.
-(3)
+(2)
Even then, Windows applications may expect a Byte Order Mark which the implementation of
-iconv
used by R may or may not add depending on the platform.(4)
+(3)
This is normally fast as looking at the first entry rules out most of the possibilities.
-(5)
+(4)
and forks, notably MariaDB.
diff --git a/R-exts.html b/R-exts.html index 1ea4b62..309ee06 100644 --- a/R-exts.html +++ b/R-exts.html @@ -1,8 +1,8 @@ - - +Writing R Extensions @@ -51,9 +51,8 @@ pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} -span.nocodebreak {white-space: nowrap} span.nolinebreak {white-space: nowrap} -span.roman {font-family: serif; font-weight: normal} +span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} body { @@ -432,9 +431,9 @@ Next: Acknowledgements R add-on packages, writing R documentation, R’s system and foreign language interfaces, and the R API.This manual is for R, version 3.2.3 (2015-12-10). +
This manual is for R, version 3.3.1 (2016-06-21).
-Copyright © 1999–2015 R Core Team +
Copyright © 1999–2016 R Core Team
Permission is granted to make and distribute verbatim copies of this @@ -680,11 +679,11 @@ section on Package namespaces. -
The optional files configure and cleanup are (Bourne -shell) script files which are, respectively, executed before and -(provided that option --clean was given) after installation on -Unix-alikes, see Configure and cleanup. The analogues on Windows -are configure.win and cleanup.win. +
The optional files configure and cleanup are (Bourne) +shell scripts which are, respectively, executed before and (if option +--clean was given) after installation on Unix-alikes, see +Configure and cleanup. The analogues on Windows are +configure.win and cleanup.win.
For the conventions for files NEWS and ChangeLog in the GNU project see @@ -1008,7 +1007,7 @@ see Package types.
One can add subject classifications for the content of the package using the fields ‘Classification/ACM’ or ‘Classification/ACM-2012’ (using the Computing Classification System of the Association for -Computing Machinery, http://www.acm.org/class/; the former refers +Computing Machinery, http://www.acm.org/about/class/; the former refers to the 1998 version), ‘Classification/JEL’ (the Journal of Economic Literature Classification System, https://www.aeaweb.org/econlit/jelCodes.php, or @@ -1030,14 +1029,19 @@ language subtags which in essence are 2-letter ISO 639-1 639-3 (https://en.wikipedia.org/wiki/ISO_639-3) language codes.
-As of R 3.2.0, an ‘RdMacros’ field can be used to hold a -comma-separated list of packages from which the current package will import -Rd macro definitions. These will be imported after the system macros, -in the order listed in the ‘RdMacros’ field, before any macro -definitions in the current package are loaded. Macro definitions in -individual .Rd files in the man directory are loaded -last, and are local to later parts of that file. In case of any -duplicates, the last loaded definition will be used8 +
An ‘RdMacros’ field can be used to hold a comma-separated list of +packages from which the current package will import Rd macro +definitions. These will be imported after the system macros, in the +order listed in the ‘RdMacros’ field, before any macro definitions +in the current package are loaded. Macro definitions in individual +.Rd files in the man directory are loaded last, and are +local to later parts of that file. In case of duplicates, the last +loaded definition will be used8 Both
R CMD +Rd2pdf
andR CMD Rdconv
have an optional flag +--RdMacros=pkglist. The option is also a comma-separated list +of package names, and has priority over the value given in +DESCRIPTION. Packages using Rd macros should depend on +R 3.2.0 or later.Note: There should be no ‘Built’ or ‘Packaged’ fields, as these are @@ -1372,6 +1376,12 @@ visible (and if it is, it need not be the one from that namespace: give an error if the suggested package is not available, simply use e.g.
+rgl::plot3d
.Note that the recommendation to use suggested packages conditionally in +tests does also apply to packages used to manage test suites: a +notorious example was testthat which in version 1.0.0 contained +illegal C++ code and hence could not be installed on standards-compliant +platforms. +
As noted above, packages in ‘Enhances’ must be used conditionally and hence objects within them should always be accessed via
::
. @@ -1850,7 +1860,7 @@ Next: Checkin comments later on about the Windows port of R.If your package needs some system-dependent configuration before -installation you can include an executable (Bourne shell) script +installation you can include an executable (Bourne24) shell script configure in your package which (if present) is executed by
-R CMD INSTALL
before any other action is performed. This can be a script created by the Autoconf mechanism, but may also be a script @@ -2016,8 +2026,7 @@ set the value of theLD_LIBRARY_PATH
(or equivalent) environment variable, but that the secondary object is automatically resolved. Another example is when a package installs support files that are required at run time, and their location is substituted into an R -data structure at installation time. (This happens with the Java Archive -files in the Omegahat SJava package.) +data structure at installation time. @@ -2133,7 +2142,7 @@ these should be settable by users (sites) through appropriate personal (site-wide) Makevars files. See Customizing package compilation in R Installation and Administration,There are some macros24 which are set whilst configuring the +
There are some macros25 which are set whilst configuring the building of R itself and are stored in R_HOME/etcR_ARCH/Makeconf. That makefile is included as a Makefile after Makevars[.win], and the macros @@ -2155,7 +2164,7 @@ need to be included in
@@ -2170,8 +2179,10 @@ point to an external LAPACK library, or may be empty if an external BLAS library also contains LAPACK.PKG_LIBS
. Beware that if it is empty then the R executable will contain all the double-precision and double-complex BLAS routines, but no single-precision nor complex routines. IfBLAS_LIBS
is included, thenFLIBS
also needs -to be25 included following it, as most BLAS +to be26 included following it, as most BLAS libraries are written at least partially in FORTRAN.[
libRlapack
includes all the double-precision LAPACK routines -current in 2003: a list of which routines are included is in file -src/modules/lapack/README.] +which were current in 2003: a list of which routines are included is in +file src/modules/lapack/README. Note that an external LAPACK/BLAS +library need not do so, as some were ‘deprecated’ (and not compiled by +default) in LAPACK 3.6.0 in late 2015.]For portability, the macros
BLAS_LIBS
andFLIBS
should always be included afterLAPACK_LIBS
(and in that order). @@ -2248,13 +2259,19 @@ all: $(SHLIB) $(SHLIB): mylibs mylibs: - (cd subdir; make) + (cd subdir; $(MAKE)) -Be careful to create all the necessary dependencies, as there is a no +
Be careful to create all the necessary dependencies, as there is no guarantee that the dependencies of
+all
will be run in a particular order (and some of the CRAN build machines use -multiple CPUs and parallel makes). +multiple CPUs and parallel makes). In particular, +++ +all: mylibs +does not suffice.
Note that on Windows it is required that Makevars[.win] does create a DLL: this is needed as it is the only reliable way to ensure @@ -2353,7 +2370,7 @@ Next: Using pthreads, Pre
There is some support for packages which wish to use -OpenMP26. The +OpenMP27. The
make
macros@@ -2367,8 +2384,8 @@ SHLIB_OPENMP_FFLAGS Include the appropriate macro inPKG_CFLAGS
,PKG_CPPFLAGS
and so on, and also inPKG_LIBS
. C/C++ code that needs to be conditioned on the use of OpenMP can be used inside#ifdef -_OPENMP
: note that some toolchains used for R (including most of -those usingclang
27) have no OpenMP support at all, not even +_OPENMP: note that some toolchains used for R (including many of +those usingclang
28) have no OpenMP support at all, not even omp.h.For example, a package with C code written for OpenMP should have in @@ -2408,7 +2425,7 @@ have recent versions. OS X currently uses Apple builds of the Windows and earlier Apple OS X implementations have substantial overheads and are only beneficial if quite substantial tasks are run in parallel. Also, on Windows new threads are started with the -default28 FPU control +default29 FPU control word, so computations done on OpenMP threads will not make use of extended-precision arithmetic which is the default for the main process.
@@ -2429,7 +2446,7 @@ assumption that the R process is entitled to use them all are both dubious assumptions. The best way to limit resources is to limit the overall number of threads available to OpenMP in the R process: this can be done via environment variableOMP_THREAD_LIMIT
, where -implemented.29 Alternatively, the +implemented.30 Alternatively, the number of threads per region can be limited by the environment variableOMP_NUM_THREADS
or API callomp_set_num_threads
, or, better, for the regions in your code as part of their @@ -2478,17 +2495,17 @@ versions of OpenBSD used a different library name).POSIX threads are not normally used on Windows, which has its own native concepts of threads. However, there are two projects implementing
pthreads
on top of Windows,pthreads-w32
and -winpthreads
(a recent part of the MinGW-w64 project). +winpthreads
(part of the MinGW-w64 project).Whether Windows toolchains implement
pthreads
is up to the -toolchain provider: the currently recommended toolchain does by default -provide it. Amake
variableSHLIB_PTHREAD_FLAGS
is -available: this should be included in bothPKG_CPPFLAGS
(or the -Fortran or F9x equivalents) andPKG_LIBS
. +toolchain provider. Amake
variable +SHLIB_PTHREAD_FLAGS
is available: this should be included in both +PKG_CPPFLAGS
(or the Fortran or F9x equivalents) and +PKG_LIBS
.The presence of a working
pthreads
implementation cannot be unambiguously determined without testing for yourself: however, that -‘_REENTRANT’ is defined30 in C/C++ code is a good indication. +‘_REENTRANT’ is defined31 in C/C++ code is a good indication.See also the comments on thread-safety and performance under OpenMP: on all known R platforms OpenMP is implemented via @@ -2706,7 +2723,7 @@ Next: Using C++11 c and passes them to the compiler specified by ‘F77’. On most but not all platforms that compiler will accept Fortran 90/95 code: some platforms have a separate Fortran 90/95 compiler and a few (by now quite -rare31) platforms have no Fortran +rare32) platforms have no Fortran 90/95 support.
This means that portable packages need to be written in correct @@ -2767,11 +2784,18 @@ support for the C++98 standard (the widely used
+g++
deviates considerably from the standard). Some compilers have a concept of ‘C++03’ (‘essentially a bug fix’) or ‘C++ Technical Report 1’ (TR1), an optional addition to the ‘C++03’ revision which was published in 2007. -A revised standard was published in 2011 and compilers with fairly +A revised standard was published in 2011 and compilers with pretty much complete implementations are becoming available. C++11 added all of the C99 features which are not otherwise implemented in C++, and C++ -compilers commonly accept C99 extensions to C++98. A minor update to -C++11 (sometimes known as C++14) was approved in August 2014. +compilers commonly accept C99 extensions to C++98. A minor update to +C++11 (often known as C++14) was approved in August 2014. +What standard a C++ compiler aims to support can be hard to determine. +As from version 6 (to be released in 2016),
g++
will default +to C++14: earlier versions aim to support C++03 with many extensions +(including support for TR1).clang
with its +native33libcxx
headers and library +includes many C++11 features, and does not support TR1.Since version 3.1.0, R has provided support for C++11 in packages in addition to C++98. This support is not uniform across platforms as it @@ -2815,7 +2839,7 @@ value). Hence this environment variable should be defined when invoking
Further control over compilation of C++11 code can be obtained by specifying the macros ‘CXX1X’ and ‘CXX1XSTD’ when R is -configured32, or in a personal or site Makevars file. +configured34, or in a personal or site Makevars file. See Customizing package compilation in R Installation and Administration. If C++11 support is not available then these macros are both empty. Otherwise, ‘CXX1X’ defaults to the same value as the C++ @@ -2846,10 +2870,10 @@ known problems mixing C++11 with Fortran.) essential that it selects the correct compiler, via something like
-@@ -2890,7 +2914,7 @@ If you needCXX1X=`"${R_HOME}/bin/R" CMD config CXX11X` -CXX1XSTD=`"${R_HOME}/bin/R" CMD config CXX11XSTD` +CXX1X=`"${R_HOME}/bin/R" CMD config CXX1X` +CXX1XSTD=`"${R_HOME}/bin/R" CMD config CXX1XSTD` CXX="$(CXX1X) $(CXX1XSTD)" -CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXX11XFLAGS` +CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXX1XFLAGS` AC_LANG(C++)R_LIBS
set (to find packages in a non-standard library) you can set it in the environment: also you can use the check and build environment files (as specified by the environment variablesR_CHECK_ENVIRON
andR_BUILD_ENVIRON
; if unset, -files33 ~/.R/check.Renviron and +files35 ~/.R/check.Renviron and ~/.R/build.Renviron are used) to set environment variables when using these utilities. @@ -2943,7 +2967,7 @@ operating system platforms. (Unix-alikes only).The files are checked for binary executables, using a suitable version -of file
if available34. (There may be +offile
if available36. (There may be rare false positives.)The DESCRIPTION file is checked for completeness, and some of its @@ -3027,7 +3051,7 @@ sections of Rd files are documented in the corresponding The data directory is checked for non-ASCII characters and for the use of reasonable levels of compression. - C, C++ and FORTRAN source and header files35 are + C, C++ and FORTRAN source and header files37 are tested for portable (LF-only) line endings. If there is a Makefile or Makefile.in or Makevars or Makevars.in file under the src directory, it is checked @@ -3038,7 +3062,7 @@ for portable line endings and the correct use of ‘$(BLAS_LIBS)stdout/stderr instead of the console. Note that the latter might give false positives in that the symbols might be pulled in with external libraries and could never -be called. Windows36 users +be called. Windows38 users should note that the Fortran and C++ runtime libraries are examples of such external libraries. @@ -3085,7 +3109,7 @@ recorded in the log file). (If the vignette sources are in the deprecated location inst/doc, do mark such target output files to not be installed in .Rinstignore.) - If there is an error37 in executing the R code in vignette foo.ext, a log +
If there is an error39 in executing the R code in vignette foo.ext, a log file foo.ext.log is created in the check directory. The vignette PDFs are re-made in a copy of the package sources in the vign_test subdirectory of the check directory, so for further @@ -3114,7 +3138,7 @@ a set of these customizations similar to those used by CRAN can be selected by the option --as-cran (which works best if Internet access is available). Some Windows users may need to set environment variable
R_WIN_NO_JUNCTIONS
to a non-empty -value. The test of cyclic declarations38in DESCRIPTION files needs +value. The test of cyclic declarations40in DESCRIPTION files needs repositories (including CRAN) set: do this in ~/.Rprofile, by e.g.@@ -3137,8 +3161,8 @@ environment of a function for later use.+Complete checking of a package which contains a file README.md needs
pandoc
installed: see http://johnmacfarlane.net/pandoc/installing.html. This -should be reasonably current: CRAN used version 1.12.4.1 to -process these files at the time of writing +should be reasonably current: at the time of writing CRAN used +version 1.12.4.2 to process these files.You do need to ensure that the package is checked in a suitable locale if it contains non-ASCII characters. Such packages are likely @@ -3165,7 +3189,7 @@ as R_HOME/etc/i386/Renviron.site. to check the primary sub-architecture, and then to use something like
@@ -3213,10 +3237,10 @@ usingR --arch=x86_64 CMD check --extra-arch
or (Windows)/path/to/R/bin/x64/Rcmd check --extra-arch
to run for each -additional sub-architecture just the checks39 which differ by sub-architecture. (This +additional sub-architecture just the checks41 which differ by sub-architecture. (This approach is required for packages which are installed byR CMD INSTALL --merge-multiarch
.)R CMD check
prior to invoking the final build procedure. of exclude patterns in file .Rbuildignore in the top-level source directory. These patterns should be Perl-like regular expressions (see the help forregexp
in R for the precise details), one per -line, to be matched case-insensitively40 against the file and directory names relative to the +line, to be matched case-insensitively42 against the file and directory names relative to the top-level package source directory. In addition, directories from -source control systems41 or fromeclipse
42, directories with names ending .Rcheck or -Old or old and files GNUMakefile43, Read-and-delete-me +source control systems43 or fromeclipse
44, directories with names ending .Rcheck or +Old or old and files GNUMakefile45, Read-and-delete-me or with base names starting with ‘.#’, or starting and ending with ‘#’, or ending in ‘~’, ‘.bak’ or ‘.swp’, are excluded by default. In addition, those files in the R, @@ -3408,7 +3432,7 @@ components intended to be installed.Sweave vignette sources are normally given the file extension .Rnw or .Rtex, but for historical reasons -extensions44 .Snw and +extensions46 .Snw and .Stex are also recognized. Sweave allows the integration of LaTeX documents: see the
-Sweave
help page in R and theSweave
vignette in package utils for details on the @@ -3426,13 +3450,13 @@ re-make the vignettes (such as LaTeX style files, BibTeX input files and files for any figures not created by running the code in the vignette) must be in the vignette source directory.
R CMD build
will automatically45 create the +
R CMD build
will automatically47 create the (PDF or HTML versions of the) vignettes in inst/doc for distribution with the package sources. By including the vignette outputs in the package sources it is not necessary that these can be re-built at install time, i.e., the package author can use private R packages, screen snapshots and LaTeX extensions which are only -available on his machine.46 +available on his machine.48By default
@@ -3686,7 +3710,7 @@ from other packages will cause these other packages to be loaded as well (unless they have already been loaded), but they will not be placed on the search path by these implicit loads. Thus code in the package can only depend on objects in its own namespace and its imports -(including the base namespace) being visible48. +(including the base namespace) being visible50.R CMD build
will runSweave
on all Sweave vignette source files in vignettes. If Makefile is found @@ -3445,7 +3469,7 @@ creation of PDF/HTML files and cleaning up afterwards (includ afterSweave
), i.e., delete all files that shall not appear in the final package archive. Note that if themake
step runs R it needs to be careful to respect the environment values ofR_LIBS
-andR_HOME
47. +andR_HOME
49. Finally, if there is a Makefile and it has a ‘clean:’ target,make clean
is run.Namespaces are sealed once they are loaded. Sealing means that imports and exports cannot be changed and that internal variable @@ -3785,6 +3809,18 @@ package foo are to be imported. Using
+importFrom
selectively rather thanimport
is good practice and recommended notably when importing from packages with more than a dozen exports.To import every symbol from a package but for a few exceptions, +pass the
+except
argument toimport
. The directive +++ +import(foo, except=c(bar, baz)) +imports every symbol from foo except
bar
and +baz
. The value ofexcept
should evaluate to something +coercible to a character vector, after substituting each symbol for +its corresponding string. +It is possible to export variables from a namespace which it has imported from other namespaces: this has to be done explicitly and not via
exportPattern
. @@ -3864,7 +3900,7 @@ detached, and unloaded. Seehelp(".onLoad")
for more detSince loading and attaching are distinct operations, separate hooks are provided for each. These hook functions are called
@@ -3909,14 +3945,14 @@ Next: An example, Previous: <.onLoad
and -.onAttach
. They both take arguments49libname
and +.onAttach
. They both take arguments51libname
andpkgname
; they should be defined in the namespace but not exported.A NAMESPACE file can contain one or more
useDynLib
directives which allows shared objects that need to be -loaded.50 The directive +loaded.52 The directive-useDynLib(foo)registers the shared object
foo
51 for loading withlibrary.dynam
. +registers the shared object
foo
53 for loading withlibrary.dynam
. Loading of registered object(s) occurs after the package code has been loaded and before running the load hook function. Packages that would only need a load hook function to load a shared object can use the @@ -4074,8 +4110,6 @@ existing package. For example, package@@ -4161,7 +4195,7 @@ Previous: An example, Up: Some additional steps are needed for packages which make use of formal (S4-style) classes and methods (unless these are purely used internally). The package should have-Depends: methods
in its -DESCRIPTION file52 andimport(methods)
or +DESCRIPTION file54 andimport(methods)
orimportFrom(methods, ...)
plus any classes and methods which are to be exported need to be declared in the NAMESPACE file. For example, the stats4 package has @@ -4188,7 +4222,7 @@ export(AIC, BIC, nobs)All S4 classes to be used outside the package need to be listed in an
@@ -4216,7 +4250,7 @@ functions, andexportClasses
directive. Alternatively, they can be specified -usingexportClassPattern
53 in the same style as +usingexportClassPattern
55 in the same style as forexportPattern
. To export methods for generics from other packages anexportMethods
directive can be used.undoc
in package tools will not repIf a package uses S4 classes and methods exported from another package, but does not import the entire namespace of the other -package54, it needs +package56, it needs to import the classes and methods explicitly, with directives
@@ -4302,7 +4336,7 @@ not allowed under Windows which are mentioned above. (akax11()
) which although emulated on Windows may not be available on a Unix-alike (and is not the preferred screen device on OS X). It is rarely necessary for package code or examples to open a new -device, but if essential,55 usedev.new()
. +device, but if essential,57 usedev.new()
.Use
@@ -4318,14 +4352,14 @@ actions are needed).R CMD build
to make the release .tar.gz file.If your package has a Makevars or Makefile file, make sure that you use only portable make features. Such files should be -LF-terminated56 (including the final +LF-terminated58 (including the final line of the file) and not make use of GNU extensions. (The POSIX specification is available at http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html; anything not documented there should be regarded as an extension to be avoided.) Commonly misused GNU extensions are conditional inclusions ( ifeq
and the like),${shell ...}
and${wildcard -...}
, and the use of+=
57 and:=
. Also, the use of$<
other than in +...}, and the use of+=
59 and:=
. Also, the use of$<
other than in implicit rules is a GNU extension, as is the$^
macro. Unfortunately makefiles which use GNU extensions often run on other platforms but do not have the intended results. @@ -4336,7 +4370,7 @@ platforms but do not have the intended results.PKG_CPPFLAGS = `gsl-config --cflags`which works in all versions of
make
known58 to be used with +which works in all versions of
make
known60 to be used with R.If you really must require GNU make, declare it in the DESCRIPTION @@ -4346,6 +4380,11 @@ file by
SystemRequirements: GNU makeand ensure that you use the value of environment variable
MAKE
+(and not justmake
) in your scripts. (On some platforms GNU +make is available under a name such asgmake
, and there +SystemRequirements
is used to setMAKE
.) +If you only need GNU make for parts of the package which are rarely needed (for example to create bibliography files under vignettes), use a file called GNUmakefile rather than @@ -4356,12 +4395,12 @@ use GNU extensions in files Makevars.win or Makefile.win
Bash extensions also need to be avoided in shell scripts, including expressions in Makefiles (which are passed to the shell for processing). -Some R platforms use strict59 Bourne shells: the R toolset on Windows and some -Unix-alike OSes use ash
-(https://en.wikipedia.org/wiki/Almquist_shell), a rather -minimal shell with few builtins. Beware of assuming that all the POSIX -command-line utilities are available, especially on Windows where only a -minimal set is provided for use with R. +Some R platforms use strict61 +Bourne shells: the R toolset on Windows and some Unix-alike OSes use +ash
(https://en.wikipedia.org/wiki/Almquist_shell), +a rather minimal shell with few builtins. Beware of assuming that all +the POSIX command-line utilities are available, especially on Windows +where only a minimal set is provided for use with R. (See The command line tools in R Installation and Administration.) One particular issue is the use ofecho
, for which two behaviours are allowed @@ -4401,7 +4440,7 @@ on some R platforms (including 64-bit Windows), but 64-bit on most modern Unix and Linux platforms. It is rather unlikely that the use oflong
in C code has been thought through: if you need a longer type thanint
you should use a configure test for a C99 type such -asint_fast64_t
(and failing that,long long
60) and typedef your own type +asint_fast64_t
(and failing that,long long
62) and typedef your own type to belong
orlong long
, or use another suitable type (such assize_t
). @@ -4415,7 +4454,7 @@ and are not required to be implemented by the C99 standard). in C on all R platforms.Under no circumstances should your compiled code ever call abort
-orexit
61: these terminate the user’s R process, quite possibly +orexit
63: these terminate the user’s R process, quite possibly including all his unsaved work. One usage that could callabort
is theassert
macro in C or C++ functions, which should never be active in production code. The normal way to ensure that is to define @@ -4434,7 +4473,7 @@ calls may come from external software and may never be called, but package authors are often mistaken about that.Compiled code should not call the system random number generators such -as rand
,drand48
andrandom
62, but rather use the +asrand
,drand48
andrandom
64, but rather use the interfaces to R’s RNGs described in Random numbers. In particular, if more than one package initializes the system RNG (e.g. viasrand
), they will interfere with each other. @@ -4466,7 +4505,7 @@ sometimes against the copy compiled into R and sometimes against the system dynamic library. The only safe solution is to rename the entry points in the copy in the package. We have even seen problems with entry point namemyprintf
, which is a system entry -point63 on some Linux systems. +point65 on some Linux systems.Conflicts between symbols in DLLs are handled in very platform-specific ways. Good ways to avoid trouble are to make as many symbols as @@ -4497,14 +4536,14 @@ work as intended. For alternatives, see Suggested in batch mode when checking. So they should behave appropriately in both scenarios, conditioning by interactive()
the parts which need an operator or observer. For instance, progress -bars64 are only appropriate in +bars66 are only appropriate in interactive use, as is displaying help pages or callingView()
(see below).Be careful with the order of entries in macros such as PKG_LIBS
. Some linkers will re-order the entries, and behaviour can differ between dynamic and static libraries. Generally -L options should -precede65 the libraries (typically +precede67 the libraries (typically specified by -l options) to be found from those directories, and libraries are searched once in the order they are specified. Not all linkers allow a space after -L . @@ -4512,14 +4551,18 @@ all linkers allow a space after -L .The ar
utility is often used in makefiles to make static libraries. Its modifieru
is defined by POSIX but is disabled in GNUar
on some recent Linux distributions which use -‘deterministic mode’. The safe way to make a static library is to first +‘deterministic mode’. The safest way to make a static library is to first remove any existing file of that name then usear -cr
and thenranlib
if needed (which is system-dependent: on most -systems66ar
always -maintains a symbol table). +systems68ar
always +maintains a symbol table). The POSIX standard says options should be +preceded by a hyphen (as in -cr), although most OSes accept +them without. +Note that on some systemsar -cr
must have at least one file +specified.Some people have a need to set a locale. Locale names are not portable, -and e.g. ‘fr_FR.utf8’ is common used on Linux but not accepted on +and e.g. ‘fr_FR.utf8’ is commonly used on Linux but not accepted on either Solaris or OS X. ‘fr_FR.UTF-8’ is more portable, being accepted on recent Linux, AIX, FreeBSD, OS X and Solaris (at least). However, some Linux distributions micro-package, so locales defined by @@ -4560,7 +4603,7 @@ for routine use. Most R platforms use ‘ix86’ or but not all of their FPU instructions. Thus the achieved precision can depend on the compiler version and optimization flags—our experience is that 32-bit builds tend to be less precise than 64-bit ones. But not -all platforms use those CPUs, and not all67 which use them configure them to +all platforms use those CPUs, and not all69 which use them configure them to allow the use of extended precision. In particular, ARM CPUs do not (currently) have extended precision nor long doubles, and long double was 64-bit on HP/PA Linux. @@ -4569,7 +4612,7 @@ was 64-bit on HP/PA Linux. build R with --disable-long-double and use appropriate compiler flags (such as -ffloat-store and -fexcess-precision=standard for gcc
, depending on the -CPU type68) to +CPU type70) to mitigate the effects of extended-precision calculations.Tests which involve random inputs or non-deterministic algorithms should @@ -4609,7 +4652,7 @@ done for the R reference manual at excessively high resolution. These are often best re-generated (for example
Sweave
defaults to 300 ppi, and 100–150 is more appropriate for a package manual). These tools include Adobe Acrobat -(not Reader), Apple’s Preview69 and Ghostscript (which +(not Reader), Apple’s Preview71 and Ghostscript (which converts PDF to PDF by@@ -4688,7 +4731,7 @@ possible to mark the encoding used in the DESCRIPTION file and inFirst, consider carefully if you really need non-ASCII text. Many users of R will only be able to view correctly text in their native language group (e.g. Western European, Eastern European, -Simplified Chinese) and ASCII.70. Other characters may not be rendered at all, +Simplified Chinese) and ASCII.72. Other characters may not be rendered at all, rendered incorrectly, or cause your R code to give an error. For .Rd documentation, marking the encoding and including ASCII transliterations is likely to do a reasonable job. The @@ -4718,7 +4761,7 @@ this, make sure you have ‘R (>= 2.10)’ (or later) in
R sessions running in non-UTF-8 locales will if possible re-encode such strings for display (and this is done by
+RGui
on Windows, for example). Suitable fonts will need to be selected or made -available71 both for the console/terminal and graphics devices such as +available73 both for the console/terminal and graphics devices such as ‘X11()’ and ‘windows()’. Using ‘postscript’ or ‘pdf’ will choose a default 8-bit encoding depending on the language of the UTF-8 locale, and your users would need to be told how @@ -4756,6 +4799,15 @@ functions at http://www.cplusplus. http://en.cppreference.com/w/ and compare what is defined in the various standards.Both the compiler and OS (via system header files, which differ +by architecture even for nominally the same OS) affect the compilability +of C/C++ code. Compilers from the GCC,
clang
, Intel and +Solaris Studio suites are routinely used with R, and both +clang
and Solaris have more than one implementation of C++ +headers and library. The range of possibilities makes comprehensive +empirical checking impossible, and regrettably compilers are patchy at +best on warning about non-standard code. +
- Mathematical functions such as
sqrt
are defined in C++ for floating-point arguments. It is legitimate in C++ to overload these @@ -4763,13 +4815,21 @@ with versions for typesfloat
,double
,long doub and possibly more. This means that calling
sqrt
on an integer type may have ‘overloading ambiguity’ as it could be promoted to any of the supported floating-point types: this is commonly seen on Solaris, -but forpow
also seen on OS X. (C++11 requires additional -overloads for integer types.) +but forpow
also seen on OS X. (C++98 has an overload for +std::pow(<double>, <int>)
, but this may not be visible from the +main namespace. C++11 requires additional overloads for integer types, +and ambiguous overloads are more common in C++11 (and later) compiler +modes.)A not-uncommonly-seen problem is to mistakenly call
+floor(x/y)
orceil(x/y)
forint
argumentsx
andy
. Sincex/y
does integer division, the result is anint
and -‘overloading ambiguity’ may be reported. +‘overloading ambiguity’ may be reported. Some people have (pointlessly) +calledfloor
andceil
on integer arguments, which may have +an ‘overloading ambiguity’. +A surprising common misuse is things like
pow(10, -3)
: this +should be the constant1e-3
.- Function
fabs
is defined only for floating-point types, except in C++11 which has overloads forstd::fabs
in <cmath> for @@ -4777,7 +4837,7 @@ integer types. Functionabs
is defined in C99’s <stdlib.h> forint
and in C++98’s <cstdlib> for integer types, overloaded in <cmath> for floating-point types. C++11 has additional overloads forstd::abs
in <cmath> for -integer types. The effect of callingabs
for a floating-point +integer types. The effect of callingabs
with a floating-point type is implementation-specific: it may truncate to an integer.- Functions/macros such as
isnan
,isinf
andisfinite
@@ -4787,10 +4847,21 @@ way to make use of these functions which works with all C++ compilers currently in use on R platforms: use R’s versions such asISNAN
andR_FINITE
instead. +If you must use them in C++11, beware that some +compilers74 provide both +
+std::isnan
and::isnan
, so using +++ +using namespace std; +may cause ‘overloading ambiguity’ and you must use
std::isnan
+etc explicitly. +It is an error (and make little sense, although has been seen) to call these functions for integer arguments.
-- The GNU compilers have a large number of non-portable extensions. For +
- The GNU compilers support a large number of non-portable extensions. For example,
INFINITY
(which is in C99 but not C++98), for which R provides the portableR_PosInf
(andR_NegInf
for-INFINITY
). AndNAN
is just one NaN value: in R code @@ -4801,17 +4872,22 @@ available. https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html and https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Extensions.html. -- Including C headers in C++ code is not portable. Including the C -header math.h in C++ code often causes conflicts with -cmath which may be included by other headers. This is -particularly problematic with C++11 compilers, as functions like -
sqrt
andisnan
are defined fordouble
arguments in -math.h and for a range of types includingdouble
in -cmath. +- Including C-style headers in C++ code is not portable. Including the +legacy header75 math.h in C++ code may conflict with cmath which +may be included by other headers. This is particularly problematic with +C++11 compilers, as functions like
sqrt
andisnan
are +defined fordouble
arguments in math.h and for a range of +types includingdouble
in cmath. Similar issues have been +seen for stdlib.h and cstdlib. Historically, including +the C++ version first was a sufficient workaround but for some 2016 +compilers only one can be included.- Variable-length arrays are C99, not supported by C++98 nor by the C++ compilers in use with R on some platforms. +
- The
restrict
qualifier is C99/C11 but not part of C++11 and not +supported by some C++ compilers used with R. +- Be careful to include the headers which define the functions you use. Some compilers/OSes include other system headers in their headers which are not required by the standards, and so code may compile on such @@ -4819,7 +4895,11 @@ systems and not on others. (A prominent example is the C++11 header
<random>
which is indirectly included by<algorithm>
byg++
. Another frequent issue is the C header<time.h>
which is included by other headers on Linux and Windows but not OS X nor -Solaris.) +Solaris.) Another common issue is thatmalloc
,calloc
, +realloc
andfree
are defined by C99 in the header +stdlib.h and (in thestd::
namespace) by C++ header +cstdlib. Some earlier implementations used a header +malloc.h, but that is not portable and does not exist on OS X.- For C++ code, be careful to specify namespaces where needed. Many functions are defined by the standards to be in the
std
@@ -4839,7 +4919,9 @@ The most common issue involves the names of the Intel CPU registers such asCS
,DS
,ES
,FS
,GS
andSS
(and more with longer abbreviations) defined on i586/x64 Solaris in <sys/regset.h> and often included indirectly by <stdlib.h> -and other core headers. +and other core headers. Further examples areERR
,zero
+andI
(which is defined in Solaris’ <complex.h> as a +compiler intrinsic for the imaginary unit).typedef
s in OS headers can conflict with those in the package: an example isindex_t
defined in <sys/types.h> on Solaris. @@ -5226,7 +5308,7 @@ bibentry(bibtype = "Manual",Note the way that information that may need to be updated is picked up from object
meta
, a parsed version of the DESCRIPTION -file72 – it is +file76 – it is tempting to hardcode such information, but it normally then gets outdated. See?bibentry
for further details of the information which can be provided. @@ -5444,7 +5526,7 @@ header is mandatory.Information is given within a series of sections with standard names (and user-defined sections are also allowed). Unless otherwise -specified73 these should occur only once in an Rd +specified77 these should occur only once in an Rd file (in any order), and the processing software will retain only the first occurrence of a standard section in the file, with a warning.
@@ -5520,7 +5602,7 @@ particular, functions) are given in this subsection.
\name{name}
- -
@@ -5709,7 +5791,7 @@ formname typically74 is the basename of +
name typically78 is the basename of the Rd file containing the documentation. It is the “name” of the Rd object represented by the file and has to be unique in a package. To avoid problems with indexing the package manual, it may not @@ -5529,7 +5611,7 @@ with the HTML help system it should not contain ‘ (LaTeX special characters are allowed, but may not be collated correctly in the index.) There can only be one
\name
entry in a file, and it must not contain any markup. Entries in the package manual -will be in alphabetic75 order +will be in alphabetic79 order of the\name
entries.for each component of the list returned. Optional text may -precede76 this +precede80 this list (see for example the help for
rle
). Note that\value
is implicitly a\describe
environment, so that environment should not be used for listing components, just individual\item{}{}
@@ -5804,18 +5886,18 @@ info).Finally, there is
@@ -6179,7 +6261,7 @@ a hyperlink in HTML and PDF conversion. Displayed using Web. The argument is handled as ‘verbatim’ text (with percent and braces escaped by backslash), and rendered as a hyperlink in HTML and PDF conversion. Linefeeds are removed, and as from R 3.2.0 leading -and trailing whitespace77 is removed. See Specifying URLs. +and trailing whitespace81 is removed. See Specifying URLs.\donttest
, used (at the beginning of a separate line) to mark code that should be run byexample()
but not by -R CMD check
(by default: as from R 3.2.0 the option ---run-donttest can be used). This should be needed only -occasionally but can be used for code which might fail in circumstances -that are hard to test for, for example in some locales. (Use -e.g.capabilities()
ornzchar(Sys.which("someprogram"))
to -test for features needed in the examples wherever possible, and you can -also usetry()
ortryCatch()
. Useinteractive()
to -condition examples which need someone to interact with.) Note that code -included in\donttest
must be correct R code, and any packages -used should be declared in the DESCRIPTION file. It is good -practice to include a comment in the\donttest
section explaining -why it is needed. +R CMD check
(by default: the option --run-donttest can +be used). This should be needed only occasionally but can be used for +code which might fail in circumstances that are hard to test for, for +example in some locales. (Use e.g.capabilities()
or +nzchar(Sys.which("someprogram"))
to test for features needed in +the examples wherever possible, and you can also usetry()
or +tryCatch()
. Useinteractive()
to condition examples which +need someone to interact with.) Note that code included in +\donttest
must be correct R code, and any packages used should +be declared in the DESCRIPTION file. It is good practice to +include a comment in the\donttest
section explaining why it is +needed.Displayed using
@@ -6202,7 +6284,7 @@ them.typewriter
font where possible.\var{metasyntactic_variable}
Indicate a metasyntactic variable. In some cases this will be rendered -distinctly, e.g. in italic, but not in all78. LaTeX-like. +distinctly, e.g. in italic, but not in all82. LaTeX-like.
\env{environment_variable}
@@ -6344,7 +6426,7 @@ given above. bar.html respectively. These are rarely needed, perhaps to refer to not-yet-installed packages (but there the HTML help system will resolve the link at run time) or in the normally undesirable event -that more than one package offers help on a topic79 (in +that more than one package offers help on a topic83 (in which case the present package has precedence so this is only needed to refer to other packages). They are currently only used in HTML help (and ignored for hyperlinks in LaTeX conversions of help pages), and @@ -6447,8 +6529,8 @@ logo in both HTML (using the simple form) and LaTeX (using th expert form), the following could be used: -\if{html}{\figure{logo.jpg}{Our logo}} -\if{latex}{\figure{logo.jpg}{options: width=0.5in}} +\if{html}{\figure{Rlogo.svg}{options: width=100 alt="R logo"}} +\if{latex}{\figure{Rlogo.pdf}{options: width=0.5in}}The files containing the figures should be stored in the directory @@ -6474,7 +6556,7 @@ Next: Indices, Previous: …’, and
\ldots
-for ellipsis dots in ordinary text.80 These can be followed by +for ellipsis dots in ordinary text.84 These can be followed by{}
, and should be unless followed by whitespace.After an unescaped ‘%’, you can put your own comments regarding the @@ -6485,7 +6567,7 @@ of the “help” invisible.
You can produce a backslash (‘\’) by escaping it by another backslash. (Note that
-\cr
is used for generating line breaks.)The “comment” character ‘%’ and unpaired braces81 +
The “comment” character ‘%’ and unpaired braces85 almost always need to be escaped by ‘\’, and ‘\\’ can be used for backslash and needs to be when there two or more adjacent backslashes). In R-like code quoted strings are handled slightly @@ -6856,7 +6938,7 @@ in finding non-ASCII bytes in the files.)
For convenience, encoding names ‘latin1’ and ‘latin2’ are always recognized: these and ‘UTF-8’ are likely to work fairly widely. However, this does not mean that all characters in UTF-8 will -be recognized, and the coverage of non-Latin characters82 is fairly low. Using LaTeX +be recognized, and the coverage of non-Latin characters86 is fairly low. Using LaTeX
@@ -7066,12 +7148,12 @@ Next: Profil -inputenx
(see?Rd2pdf
in R) will give greater coverage of UTF-8.It is possible to profile R code on Windows and most83 Unix-alike versions of +
It is possible to profile R code on Windows and most87 Unix-alike versions of R.
The command
Rprof
is used to control profiling, and its help page can be consulted for full details. Profiling works by recording -at fixed intervals84 (by default every 20 msecs) +at fixed intervals88 (by default every 20 msecs) which line in which R function is being used, and recording the results in a file (default Rprof.out in the working directory). Then the functionsummaryRprof
or the command-line utility @@ -7109,6 +7191,7 @@ Total run time: 22.52 seconds. Total seconds: time spent in function and callees. Self seconds: time spent in function alone.+% total % self total seconds self seconds name 100.0 25.22 0.2 0.04 "boot" @@ -7126,6 +7209,7 @@ Self seconds: time spent in function alone. 12.3 3.10 2.7 0.68 "assign" ...+% self % total self seconds total seconds name 5.7 1.44 7.5 1.88 "inherits" @@ -7681,7 +7765,7 @@ Browse[1]>At the browser prompt one can enter any R expression, so for example
ls()
lists the objects in the current frame, and entering the -name of an object will85 print it. The following commands are +name of an object will89 print it. The following commands are also accepted@@ -8159,7 +8243,7 @@ Next: Using Address
4.3.2 Using valgrind
If you have access to Linux on a common CPU type or supported versions -of OS X86 you can use +of OS X90 you can use
@@ -8235,7 +8319,7 @@ C code can be inspected (see Inspecting R objectvalgrind
(http://www.valgrind.org/, pronounced to rhyme with ‘tinned’) to check for possible problems. To run some examples undervalgrind
use something like @@ -8188,9 +8272,9 @@ in the use of memory allocated from the R heap. Theconfigure
option is --with-valgrind-instrumentation=level, where level is 0, 1 or 2. Level 0 is the default and does not add any anything. -Level 1 will detect some uses87 of uninitialised memory and has little impact on speed +Level 1 will detect some uses91 of uninitialised memory and has little impact on speed (compared to level 0). Level 2 will detect many other memory-use -bugs88 but make R much slower when running under +bugs92 but make R much slower when running undervalgrind
. Using this in conjunction withgctorture
can be even more effective (and even slower).
valgrind
is good at spotting the use of uninitialized values: use option --track-origins=yes to show where these originated from. What it cannot detect is the misuse of arrays allocated on the -stack: this includes C automatic variables and some89 +stack: this includes C automatic variables and some93 Fortran arrays.It is possible to run all the examples, tests and vignettes covered by @@ -8277,8 +8361,8 @@ Next: Us
AddressSanitizer
(‘ASan’) is a tool with similar aims to the memory checker invalgrind
. It is available with suitable -builds90 ofgcc
andclang
on common -Linux and OS X platforms. See +builds94 ofgcc
andclang
on common Linux +and OS X platforms. See http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation, http://clang.llvm.org/docs/AddressSanitizer.html and https://code.google.com/p/address-sanitizer/. @@ -8301,8 +8385,8 @@ detect misuse of stack and global variables but not the use of uninitialized memory.Recent versions return symbolic addresses for the location of the error -provided
llvm-symbolizer
91 is on the path: if it is available but not -on the path or has been renamed92, one can use an +providedllvm-symbolizer
95 is on the path: if it is available but not +on the path or has been renamed96, one can use an environment variable, e.g.@@ -8310,7 +8394,7 @@ environment variable, e.g.An alternative is to pipe the output through -
@@ -8326,10 +8410,10 @@ CFLAGS="-fno-omit-frame-pointer -g -O2 -Wall -pedantic -mtune=native" into the R executable. However this check can be enabled on a per-package basis by using a ~/.R/Makevars file likeasan_symbolize.py
93 and perhaps +asan_symbolize.py
97 and perhaps then (for compiled C++ code)c++filt
. (On OS X, you may need to rundsymutil
to get line-number reports.)-CC = gcc-4.9 -std=gnu99 -fsanitize=address -fno-omit-frame-pointer -CXX = g++-4.9 -fsanitize=address -fno-omit-frame-pointer -F77 = gfortran-4.9 -fsanitize=address -FC = gfortran-4.9 -fsanitize=address +CC = gcc -std=gnu99 -fsanitize=address -fno-omit-frame-pointer +CXX = g++ -fsanitize=address -fno-omit-frame-pointer +F77 = gfortran -fsanitize=address +FC = gfortran -fsanitize=address(Note that
-fsanitize=address
has to be part of the compiler specification to ensure it is used for linking. These settings will not @@ -8423,20 +8507,19 @@ packages are attempts to coerce aNaN
or infinity to type might beNA_INTEGER
.‘UBSanitizer’ is a tool for C/C++ source code selected by --fsanitize=undefined in suitable builds of
clang
, and -GCC as from 4.9.0. Its (main) runtime library is linked into each -package’s DLL, so it is less often needed to be included in -MAIN_LDFLAGS
. +-fsanitize=undefined in suitable builds98 ofclang
and GCC. Its (main) runtime library is +linked into each package’s DLL, so it is less often needed to be +included inMAIN_LDFLAGS
.Some versions have greatly increased compilation times on a few -files94. +files99.
This sanitizer can be combined with the Address Sanitizer by -fsanitize=undefined,address (where both are supported).
Finer control of what is checked can be achieved by other options: for
clang
see -http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation.95 +http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation.100 The current set forclang
is (on a single line):-fsanitize=alignment,bool,bounds,enum,float-cast-overflow, @@ -8472,14 +8555,17 @@ that would need to be linked byclang++
, notclang
: yo could try building R with something like-MAIN_LD="clang++ -fsanitize=undefined" -R_OPENMP_CFLAGS="-fopenmp=libomp"or add
-lclang_rt.asan_cxx-x86_64
96 or similar toLD_FLAGS
). +and perhaps for
clang
3.7.x +++R_OPENMP_CFLAGS="-fopenmp=libomp" +or add
-lclang_rt.asan_cxx-x86_64
101 or similar toLD_FLAGS
).See https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html (or the manual for your version of GCC, installed or via https://gcc.gnu.org/onlinedocs/) for the options supported by -GCC: 5.2.0 supports +GCC: 5.3 supports
-fsanitize=alignment,bool,bounds,enum,float-cast-overflow, integer-divide-by-zero,non-null-attribute,null,object-size, @@ -8495,6 +8581,12 @@ desirable for R uses). At the time of writing theobject-size
andvptr
checks produced many warnings on GCC’s own C++ headers, so should be disabled. +GCC 6 will add +
++-fsanitize=bounds-strict +an extension of
bounds
to ‘flexible array member-like arrays’. +Other useful flags include
@@ -8553,7 +8645,7 @@ Next: Fortran- -‘Dr. Memory’ from http://www.drmemory.org/ is a memory checker for (currently) 32-bit Windows, Linux and OS X with similar aims to -
valgrind
. It works with unmodified executables97 +valgrind
. It works with unmodified executables102 and detects memory access errors, uninitialized reads and memory leaks.
@@ -8986,7 +9078,7 @@ can be used with other languages which can generate C interfaces, for example C++ (see Interfacing C++ code).The first argument to each function is a character string specifying the -symbol name as known98 to C or +symbol name as known103 to C or FORTRAN, that is the function or subroutine name. (That the symbol is loaded can be tested by, for example,
is.loaded("cg")
. Use the name you pass to.C
or.Fortran
rather than the translated @@ -9110,7 +9202,7 @@ elements of the C array are copied to create new elements of a character vector. This means that the contents of the character strings of thechar **
array can be changed, including to\0
to shorten the string, but the strings cannot be lengthened. It is -possible99 to allocate a new string via +possible104 to allocate a new string viaR_alloc
and replace an entry in thechar **
array by the new string. However, when character vectors are used other than in a read-only way, the.Call
interface is much to be preferred. @@ -9384,7 +9476,7 @@ static R_CMethodDef cMethods[] = {One can also specify whether each argument is used simply as input, or as output, or as both input and output. The style field in the description of a method is used for this. The purpose is to -allow100 R to transfer values +allow105 R to transfer values more efficiently across the R-C/FORTRAN interface by avoiding copying values when it is not necessary. Typically, one omits this information in the registration data. @@ -9436,8 +9528,6 @@ methods can contain as.integer(m), as.integer(n))$p
@@ -9566,9 +9656,9 @@ needs to declare them as a comma-separated list in the field that the include directories in the installed linked-to packages are added to the include paths for C and C++ code. - • Speed considerations: It must specify101 +
It must specify106 ‘Imports’ or ‘Depends’ of those packages, for they have to be -loaded102 prior to this one +loaded107 prior to this one (so the path to their compiled code has been registered).
@@ -9786,6 +9876,7 @@ Copyright (C) 2012 The R Foundation for Statistical Computing ... Type "q()" to quit R.+R> dyn.load(paste("X", .Platform$dynlib.ext, sep = "")) constructor Y R> .C("X_main") @@ -9808,13 +9899,27 @@ possible. Examples have been seen where merely loading a DLL that contained calls to C++ I/O upset R’s own C I/O (for example by resetting buffers on open files). -Most R header files can be included within C++ programs, and they +
Most R header files can be included within C++ programs but they should not be included within an
+extern "C"
block (as -they include C++ system headers). It may not be possible to include -some R headers as they in turn include C header files that may cause -conflicts—if this happens, define ‘NO_C_HEADERS’ before including -the R headers, and include C++ versions (such as ‘cmath’) of the -appropriate headers yourself before the R headers. +they include system headers108). It may not be possible +to include some R headers as they in turn include system header files +that may cause conflicts—if this happens, try defining +‘NO_C_HEADERS’ before including the R headers, and include C++ +versions (such as ‘cmath’ and ‘cstdlib’) of the appropriate +headers yourself before the R headers. (Headers R.h and +Rmath.h support ‘NO_C_HEADERS’: the legacy header S.h +does not. Header Rinternals.h does as from R 3.3.0.) +By default header Rmath.h includes math.h or cmath. +Header R.h includes +
+++ +limits.h math.h stddef.h stdio.h stdlib.h string.h +or their C++ equivalents directly or indirectly, and either +stddef.h or cstddef needs to be included before R.h +if ‘NO_C_HEADERS’ is defined.
@@ -9916,7 +10021,7 @@ PKG_LIBS=-L"$(PKGB_PATH)$(R_ARCH)" -lpackBThis will work for installation, but very likely not when package
packB
is loaded, as the path to package packB’s lib -directory is not in theld.so
103 search path. You can arrange to +directory is not in theld.so
109 search path. You can arrange to put it there before R is launched by setting (on some platforms)LD_RUN_PATH
orLD_LIBRARY_PATH
or adding to theld.so
cache (seeman ldconfig
). On platforms that @@ -10088,7 +10193,7 @@ the arguments can be extracted.In each case the R objects are available for manipulation via a set of functions and macros defined in the header file -Rinternals.h or some S-compatibility macros104 defined +Rinternals.h or some S-compatibility macros110 defined in Rdefines.h. See Interface functions .Call and .External for details on
@@ -10107,7 +10212,7 @@ interfaces as read-only..Call
and.External
.To handle R objects from within C code we use the macros and functions that have been used to implement the core parts of R. A -public105 subset of these is defined in the header file +public111 subset of these is defined in the header file Rinternals.h in the directory R_INCLUDE_DIR (default R_HOME/include) that should be available on any R installation. @@ -10119,7 +10224,7 @@ make use of the source code for inspirational examples.
It is necessary to know something about how R objects are handled in C code. All the R objects you will deal with will be handled with -the type SEXP106, which is a +the type SEXP112, which is a pointer to a structure with typedef
SEXPREC
. Think of this structure as a variant type that can handle all the usual types of R objects, that is vectors of various modes, functions, @@ -10369,7 +10474,7 @@ object, you can change the type by usingProtection is needed as a new object is created; the object formerly pointed to by the
SEXP
is still protected but now -unused.107 +unused.113All the coercion functions do their own error-checking, and generate
NA
s with a warning or stop with an error as appropriate. @@ -10463,6 +10568,7 @@ considerably faster to store the result and index that. SET_VECTOR_ELT(dimnames, 1, getAttrib(y, R_NamesSymbol)); setAttrib(ans, R_DimNamesSymbol, dimnames);+UNPROTECT(3); return ans; } @@ -10593,6 +10699,7 @@ SEXP getListElement(SEXP list, const char *str) { SEXP elmt = R_NilValue, names = getAttrib(list, R_NamesSymbol);+for (int i = 0; i < length(list); i++) if(strcmp(CHAR(STRING_ELT(names, i)), str) == 0) { elmt = VECTOR_ELT(list, i); @@ -10699,7 +10806,7 @@ creates a new binding or changes the value of an existing binding in the specified environment frame; it is the analogue ofassign(symbol, value, envir = rho, inherits = FALSE)
, but unlikeassign
,defineVar
does not make a copy of the object -value
.108setVar
searches for an existing +value
.114setVar
searches for an existing binding forsymbol
inrho
or its enclosing environments. If a binding is found, its value is changed tovalue
. Otherwise, a new binding with the specified value is created in the global @@ -11293,6 +11400,7 @@ The C code is return ans; }+double feval(double x, SEXP f, SEXP rho) { // a version with (too) much PROTECT()ion .. "better safe than sorry" @@ -11304,18 +11412,21 @@ The C code is return(REAL(eval(f, rho))[0]); }+SEXP zero(SEXP f, SEXP guesses, SEXP stol, SEXP rho) { double x0 = REAL(guesses)[0], x1 = REAL(guesses)[1], tol = REAL(stol)[0]; double f0, f1, fc, xc;+if(tol <= 0.0) error("non-positive tol value"); f0 = feval(x0, f, rho); f1 = feval(x1, f, rho); if(f0 == 0.0) return mkans(x0); if(f1 == 0.0) return mkans(x1); if(f0*f1 > 0.0) error("x[0] and x[1] have the same sign");+for(;;) { xc = 0.5*(x0+x1); if(fabs(x0-x1) < tol) return mkans(xc); @@ -11400,16 +11511,19 @@ SEXP numeric_deriv(SEXP args) double tt, xx, delta, eps = sqrt(DOUBLE_EPS), *rgr, *rans; int i, start;+expr = CADR(args); if(!isString(theta = CADDR(args))) error("theta should be of type character"); if(!isEnvironment(rho = CADDDR(args))) error("rho should be an environment");+ans = PROTECT(coerceVector(eval(expr, rho), REALSXP)); gradient = PROTECT(allocMatrix(REALSXP, LENGTH(ans), LENGTH(theta))); rgr = REAL(gradient); rans = REAL(ans);+for(i = 0, start = 0; i < LENGTH(theta); i++, start += LENGTH(ans)) { par = PROTECT(findVar(installChar(STRING_ELT(theta, i)), rho)); tt = REAL(par)[0]; @@ -11423,6 +11537,7 @@ SEXP numeric_deriv(SEXP args) UNPROTECT(2); /* par, ans1 */ }+dimnames = PROTECT(allocVector(VECSXP, 2)); SET_VECTOR_ELT(dimnames, 1, theta); dimnamesgets(gradient, dimnames); @@ -11478,7 +11593,7 @@ corresponding to thei
’th element of theSTRSXP
theta
. Here,STRING_ELT(theta, i)
accesses thei
’th element of theSTRSXP
theta
. MacroCHAR()
extracts the actual character -representation109 of it: it returns a pointer. We then +representation115 of it: it returns a pointer. We then install the name and usefindVar
to find its value.@@ -11540,7 +11655,7 @@ Next: user and evaluate it. The previous section covered evaluation, but the expression will be entered as text and needs to be parsed first. A small part of R’s parse interface is declared in header file -R_ext/Parse.h110. +R_ext/Parse.h116.An example of the usage can be found in the (example) Windows package windlgs included in the R source tree. The essential part is @@ -11839,8 +11954,9 @@ obtained by defining ‘USE_RINTERNALS’ before including that your code compiles without ‘USE_RINTERNALS’ defined, as this provides a stricter test that the accessors have been used correctly. Note too that the use of ‘USE_RINTERNALS’ when the header is -included in C++ code is not supported: doing so uses C99 features which -are not necessarily in C++. +included in C++ code is not supported: doing so may use C99 features +which are not necessarily supported by the C++ compiler. Nor is use +with Rdefines.h supported.
@@ -11980,19 +12096,8 @@ be changed with considerable notice. there that can be included too, but many of the features they contain should be regarded as undocumented and unstable. -An alternative is to include the header file S.h, which may be -useful when porting code from S. This includes rather less than -R.h, and has some extra compatibility definitions (for example -the
-S_complex
type from S). -The defines used for compatibility with S sometimes causes -conflicts (notably with Windows headers), and the known -problematic defines can be removed by defining
STRICT_R_HEADERS
. -Most of these header files, including all those included by R.h, -can be used from C++ code. Some others need to be included within an -
extern "C"
declaration, and for clarity this is advisable for all -R header files. +can be used from C++ code.-Note: Because R re-maps many of its external names to avoid clashes with @@ -12000,7 +12105,7 @@ user code, it is essential to include the appropriate header files when using these entry points.
This remapping can cause problems111, and can be eliminated by defining
R_NO_REMAP
and +This remapping can cause problems117, and can be eliminated by defining
R_NO_REMAP
and prepending ‘Rf_’ to all the function names used from Rinternals.h and R_ext/Error.h. These problems can usually be avoided by including other headers (such as system headers @@ -12803,16 +12908,23 @@ accurately even for small x, i.e., 0 < x < 0.5.Computes
-cos(pi * x)
(wherepi
is 3.14159...), accurately, notably for half integer x.This might be provided by your platform112, in which case it is not included in Rmath.h, but is -in math.h which Rmath.h includes. +
This might be provided by your platform118, in which case it is not included in Rmath.h, but is +in math.h which Rmath.h includes. (Ensure that +neither math.h nor cmath is included before +Rmath.h or define +
++#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 +before the first inclusion.)
- Function: double sinpi (double x)
Computes
-sin(pi * x)
accurately, notably for (half) integer x.This might be provided by your platform, in which case it is not included -in Rmath.h, but is in math.h which Rmath.h includes. +
This might be provided by your platform, in which case it is not +included in Rmath.h, but is in math.h which Rmath.h +includes (but see the comments for
cospi
).@@ -12820,13 +12932,14 @@ in Rmath.h, but is in math.h which Rmath.h
Computes
tan(pi * x)
accurately, notably for (half) integer x.This might be provided by your platform, in which case it is not included -in Rmath.h, but is in math.h which Rmath.h includes. +in Rmath.h, but is in math.h which Rmath.h includes +(but see the comments for
cospi
).
- Function: double logspace_add (double logx, double logy)
- Function: double logspace_sub (double logx, double logy)
-- Function: double logspace_sum (double* logx, int n)
+- Function: double logspace_sum (const double* logx, int n)
Compute the log of a sum or difference from logs of terms, i.e., “x + y” as
log (exp(logx) + exp(logy))
and “x - y” aslog (exp(logx) - exp(logy))
, @@ -13141,16 +13254,21 @@ The following is declared in header file Rinternals.h.
- Function: void R_orderVector (int* indx, int n, SEXP arglist, Rboolean nalast, Rboolean decreasing)
+- Function: void R_orderVector1 (int* indx, int n, SEXP x, Rboolean nalast, Rboolean decreasing)
- -
This corresponds to R’s
order(..., na.last, decreasing)
. +-
R_orderVector()
corresponds to R’sorder(..., na.last, decreasing)
. More specifically,indx <- order(x, y, na.last, decreasing)
corresponds toR_orderVector(indx, n, Rf_lang2(x, y), nalast, decreasing)
and for three vectors,Rf_lang3(x,y,z)
is used as arglist.Note that
R_orderVector()
assumes the vectorindx
-to be allocated to length >= n. On return,indx[]
-contains a permutation of0:(n-1)
, i.e., 0-based C indices (and not -1-based R indices, as R’sorder()
). +Both
+R_orderVector
andR_orderVector1
assume the vector +indx
to be allocated to length >= n. On return, +indx[]
contains a permutation of0:(n-1)
, i.e., 0-based C +indices (and not 1-based R indices, as R’sorder()
). +When ordering only one vector,
R_orderVector1
is faster and +corresponds (but is 0-based) to R’sindx <- order(x, na.last, +decreasing)
. It was added in R 3.3.0.All other sort routines are declared in header file @@ -13227,6 +13345,7 @@ See R’s help page
?max.col
.@@ -13371,14 +13496,10 @@ the code is indeed being used with R.
- Function: int findInterval (double* xt, int n, double x, Rboolean rightmost_closed, Rboolean all_inside, int ilo, int* mflag)
+- Function: int findInterval2(double* xt, int n, double x, Rboolean rightmost_closed, Rboolean all_inside, Rboolean left_open, int ilo, int* mflag)
Given the ordered vector xt of length n, return the interval or index of x in
+xt[]
, typically max(i; 1 <= i <= n & xt[i] <= x) where we use 1-indexing as in R and FORTRAN (but not C). If @@ -13241,6 +13360,12 @@ outside the xt[] range. On return,*mflag
eq result offindInterval()
and x is a value of a sequence which is increasing or decreasing for subsequent calls.
findInterval2()
is a generalization offindInterval()
, +with an extraRboolean
argument left_open. Setting +left_open = TRUE
basically replaces all left-closed right-open +intervals t) by left-open ones t], see the help page +of R functionfindInterval
for details. +There is also an
F77_CALL(interv)()
version offindInterval()
with the same arguments, but all pointers.Header file Rconfig.h (included by R.h) is used to define platform-specific macros that are mainly for use in other header files. The macro
WORDS_BIGENDIAN
is defined on -big-endian113 +big-endian119 systems (e.g. most OSes on Sparc and PowerPC hardware) and not on -little-endian systems (such asi686
andx86_64
on all -OSes, and Linux on Alpha and Itanium). It can be useful when -manipulating binary files. The macroSUPPORT_OPENMP
is defined -on suitable systems and can be used in conjunction with the -SUPPORT_OPENMP_*
macros in packages that want to make use of -OpenMP. +little-endian systems (nowadays all the commoner R platforms). It +can be useful when manipulating binary files.Header file Rversion.h (not included by R.h) defines a macro
R_VERSION
giving the version number encoded as an @@ -13399,8 +13520,8 @@ header file Rversion.h for their format. Note that the minor version includes the patchlevel (as in ‘2.2’).Packages which use
alloca
need to ensure it is defined: as it is -neither C99 nor POSIX there is no standard way to do so. As from R -3.2.2 one can use +part of neither C nor POSIX there is no standard way to do so. As +from R 3.2.2 one can use@@ -4510,8 +4513,8 @@ Default: -1.#include <Rconfig.h> // for HAVE_ALLOCA_H @@ -13429,11 +13550,11 @@ Next: Controlling vis6.14 Inlining C functions
-The C99 keyword
inline
should be recognized by all compilers now -used to build R. Portable code which might be used with earlier -versions of R can be written using the macroR_INLINE
(defined -in file Rconfig.h included by R.h), as for example from -package cluster +The C99 keyword
inline
should be recognized by all compilers +nowadays used to build R. Portable code which might be used with +earlier versions of R can be written using the macroR_INLINE
+(defined in file Rconfig.h included by R.h), as for +example from package cluster#include <R.h> @@ -13863,7 +13984,7 @@ Next: Embedding R8.1 Embedding R under Unix-alikes
-R can be built as a shared library114 if configured with --enable-R-shlib. This +
R can be built as a shared library120 if configured with --enable-R-shlib. This shared library can be used to run R from alternative front-end programs. We will assume this has been done for the rest of this section. Also, it can be built as a static library if configured with @@ -13930,7 +14051,7 @@ and R does look there for system components.)
The other senses in which this example is too simple are that all the internal defaults are used and that control is handed over to the -R main loop. There are a number of small examples115 in the +R main loop. There are a number of small examples121 in the tests/Embedding directory. These make use of
-Rf_initEmbeddedR
in src/main/Rembedded.c, and essentially use @@ -14435,7 +14556,7 @@ extern uintptr_t R_CStackStart; /* Initial stack address */ defined in R, so your code needs to defineHAVE_UINTPTR_T
appropriately.These will be set116 when
Rf_initialize_R
is called, to values appropriate to the +These will be set122 when
Rf_initialize_R
is called, to values appropriate to the main thread. Stack-checking can be disabled by settingR_CStackLimit = (uintptr_t)-1
immediately afterRf_initialize_R
is called, but it is better to if possible set @@ -14505,9 +14626,9 @@ R graphics window.Recent versions have usage restrictions.
-- Another (D)COM server,
RDCOMServer
, is available from -http://www.omegahat.org/. Its philosophy is discussed in -http://www.omegahat.org/RDCOMServer/Docs/Paradigm.html and is +- Another (D)COM server,
RDCOMServer
, may be available from Omegahat, +http://www.omegahat.net/. Its philosophy is discussed in +http://www.omegahat.net/RDCOMServer/Docs/Paradigm.html and is very different from the purpose of this section.
@@ -14700,7 +14821,7 @@ andselect.list()
. It would be possible to replace all of these, but it seems easier to allow GraphApp to handle most of them.It is possible to run R in a GUI in a single thread (as -RGui.exe shows) but it will normally be easier117 to +RGui.exe shows) but it will normally be easier123 to use multiple threads.
Note that R’s own front ends use a stack size of 10Mb, whereas MinGW @@ -14979,6 +15100,7 @@ Next: Concept index, Previ
F FALSE
:Mathematical constants + findInterval
:Utility functions findInterval2(double*
:Utility functions findVar
:Finding and setting variables FLIBS
:Using Makevars @@ -15124,6 +15246,7 @@ Next: Concept index, Previ fmax2
:Numerical Utilities R_max_col
:Utility functions R_NegInf
:Missing and IEEE values + R_orderVector
:Utility functions R_orderVector1
:Utility functions R_PACKAGE_DIR
:Configure and cleanup R_PACKAGE_NAME
:Configure and cleanup @@ -15535,8 +15658,8 @@ required by CRAN, so checked by R_ParseVector
:Parsing R code from C R CMD check
But it is checked for Open Source packages by
R CMD check --as-cran
.(8)
-Duplicate -definitions may trigger a warning: see User-defined macros.
+Duplicate definitions may +trigger a warning: see User-defined macros.
(9)
even one wrapped in
\donttest
.(10)
@@ -15605,339 +15728,367 @@ output with the option --timings (and note that case are advised to use .rda as a common error is to refer to abc.RData as abc.Rdata!(24)
+The script +should only assume a POSIX-compliant
+/bin/sh
– see +http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html. +In particularbash
extensions must not be used, and not all +R platforms have abash
command, let alone one at +/bin/bash. All known shells used with R support the use of +backticks, but not all support ‘$(cmd)’.(25)
in POSIX parlance: GNU
-make
calls these ‘make variables’.(25)
+(26)
at least on Unix-alikes: the Windows build currently resolves such dependencies to a static FORTRAN library when Rblas.dll is built.
-(26)
+(27)
http://www.openmp.org/, https://en.wikipedia.org/wiki/OpenMP, https://computing.llnl.gov/tutorials/openMP/
-(27)
-Some builds of
clang
3.7 -have support for OpenMP 3.1(28)
-Windows default, not MinGW-w64 default.
+Some builds of
clang
+3.7.0 have support for OpenMP 3.1 (this is built by default as from +3.8.0), but even if the compiler has, thelibomp
library may not +be installed. At the time of writing Apple builds ofclang
+for OS X had no support.(29)
+Windows default, not MinGW-w64 default.
+(30)
Which it was at the time of writing with GCC, Solaris Studio, Intel and Clang 3.7.x compilers.
-(30)
-some Windows toolchains have the -typo ‘_REENTRANCE’ instead.
(31)
+some Windows toolchains had the +typo ‘_REENTRANCE’ instead.
+(32)
Cygwin used
-g77
up to 2011, and some pre-built versions of R for Unix OSes still do.(32)
+(33)
+Some distributions, notably Debian, have supplied a +build of
+clang
withg++
’s headers and library. +Conversely, Apple’s command namedg++
is based on +clang
usinglibcxx
.(34)
For details of these and related macros, see file config.site in the R sources.
-(33)
+(35)
On systems which use sub-architectures, architecture-specific versions such as ~/.R/check.Renviron.i386 take precedence.
-(34)
+(36)
A suitable
-file.exe
is part of the Windows toolset: it checks forgfile
if a suitablefile
is not found: the latter is available in the OpenCSW collection for Solaris at http://www.opencsw.org. The source repository is ftp://ftp.astron.com/pub/file/.(35)
+(37)
An exception is made for subdirectories with names starting ‘win’ or ‘Win’.
-(36)
+(38)
on most other platforms such runtime libraries are dynamic, but static libraries are currently used on Windows because the toolchain is not a standard part of the OS.
-(37)
+(39)
or if option --use-valgrind is used or environment variable
-_R_CHECK_ALWAYS_LOG_VIGNETTE_OUTPUT_
is set to a true value or if there are differences from a target output file(38)
+(40)
For example, in early 2014 gdata declared ‘Imports: gtools’ and gtools declared ‘Imports: gdata’.
-(39)
+(41)
loading, examples, tests, running vignette code
-(40)
+(42)
on all platforms from R 3.1.0.
-(41)
+(43)
called CVS or .svn or .arch-ids or .bzr or .git (but not files called .git) or .hg.
-(42)
+(44)
called .metadata.
-(43)
+(45)
which is an error: GNU make uses GNUmakefile.
-(44)
+(46)
and to avoid problems with case-insensitive file systems, lower-case versions of all these extensions.
-(45)
+(47)
unless inhibited by using ‘BuildVignettes: no’ in the DESCRIPTION file.
-(46)
+(48)
provided the conditions of the package’s license are met: many, including CRAN, see the omission of source components as incompatible with an Open Source license.
-(47)
+(49)
-
R_HOME/bin
is prepended to thePATH
so that references toR
orRscript
in the Makefile do make use of the currently running version of R.(48)
+(50)
Note that lazy-loaded datasets are not in the package’s namespace so need to be accessed via
-::
, e.g.survival::survexp.us
.(49)
+(51)
they will be called with two unnamed arguments, in that order.
-(50)
+(52)
NB: this will only be read in all versions of R if the package contains R code in a R directory.
-(51)
+(53)
Note that this is the basename of the shared object, and the appropriate extension (.so or .dll) will be added.
-(52)
+(54)
This was necessary at least prior to R 3.0.2 as the methods package looked for its own R code on the search path.
-(53)
+(55)
This defaults to the same pattern as
-exportPattern
: use something likeexportClassPattern("^$")
to override this.(54)
+(56)
if it does, there will be opaque warnings about replacing imports if the classes/methods are also imported.
-(55)
+(57)
People use
-dev.new()
to open a device at a particular size: that is not portable but usingdev.new(noRStudioGD = TRUE)
helps.(56)
+(58)
Solaris
-make
does not accept CRLF-terminated Makefiles; Solaris warns about and some othermake
s ignore incomplete final lines.(57)
+(59)
This was apparently introduced in SunOS 4, and is available elsewhere provided it is surrounded by spaces.
-(58)
+(60)
GNU make, BSD make formerly in FreeBSD and OS X, AT&T make as implemented on Solaris,
-pmake
in FreeBSD, ‘Distributed Make’ (dmake
), part of Solaris Studio and available in other versions.(59)
+(61)
For example,
-test
options -a and -e are not portable, and not supported -in the AT&T Bourne shell used on Solaris, even though they are in the -POSIX standard.(60)
+in the AT&T Bourne shell used on Solaris 10/11, even though they are in +the 2008 POSIX standard. Nor does Solaris support ‘$(cmd)’. +(62)
but note that
-long long
is not a standard C++ type, and C++ compilers set up for strict checking will reject it.(61)
+(63)
or where supported the variants
-_Exit
and_exit
.(62)
+(64)
This and
-srandom
are in any case not portable. They are in POSIX but not in the C99 standard, and not available on Windows.(63)
+(65)
in libselinux.
-(64)
+(66)
except perhaps the simplest kind as used by
-download.file()
in non-interactive use.(65)
+(67)
Whereas the GNU linker reorders so -L options are processed first, the Solaris one does not.
-(66)
+(68)
some versions of OS X did not.
-(67)
+(69)
Not doing so is the default on Windows, overridden for the R executables. It is also the default on some Solaris compilers.
-(68)
+(70)
These are not needed for the default compiler settings on ‘x86_64’ but are likely to be needed on ‘ix86’.
-(69)
+(71)
Select ‘Save as’, and select ‘Reduce file size’ from the ‘Quartz filter’ menu’: this can be accessed in other ways, for example by Automator.
-(70)
+(72)
except perhaps some special characters such as backslash and hash which may be taken over for currency symbols.
-(71)
+(73)
Typically on a Unix-alike this is done by telling
-fontconfig
where to find suitable fonts to select glyphs from.(72)
+(74)
+E.g.
+gcc 5.3
in C++11 mode.(75)
+which often is the same as the header included by +the C compiler, but some compilers have wrappers for some of the C +headers.
+(76)
this object is available since R 2.8.0, so the ‘Depends’ field in the DESCRIPTION file should contain something at least as restrictive as ‘R (>= 2.8’.
-(73)
+(77)
e.g.
-\alias
,\keyword
and\note
sections.(74)
+(78)
There can be exceptions: for example Rd files are not allowed to start with a dot, and have to be uniquely named on a case-insensitive file system.
-(75)
+(79)
in the current locale, and with special treatment for LaTeX special characters and with any ‘pkgname-package’ topic moved to the top of the list.
-(76)
+(80)
Text between or after list items is discouraged.
-(77)
+(81)
as defined by the R function
-trimws
.(78)
+(82)
Currently it is rendered differently only in HTML conversions, and LaTeX conversion outside ‘\usage’ and ‘\examples’ environments.
-(79)
+(83)
a common example in CRAN packages is
-\link[mgcv]{gam}
.(80)
+(84)
There is only a fine distinction between
-\dots
and\ldots
. It is technically incorrect to use\ldots
in code blocks andtools::checkRd
will warn about this—on the other hand the current converters treat them the same way in code blocks, and elsewhere apart from the small distinction between the two in LaTeX.(81)
+(85)
See the examples section in the file Paren.Rd for an example.
-(82)
+(86)
R 2.9.0 added support for UTF-8 Cyrillic characters in LaTeX, but on some OSes this will need Cyrillic support added to LaTeX, so environment variable
-_R_CYRILLIC_TEX_
may need to be set to a non-empty value to enable this.(83)
+(87)
R has to be built to enable this, but the option --enable-R-profiling is the default.
-(84)
+(88)
For Unix-alikes these are intervals of CPU time, and for Windows of elapsed time.
-(85)
+(89)
With the exceptions of the commands listed below: an object of such a name can be printed via an explicit call to
-(86)
+(90)
at the time of writing mainly for 10.9 with some support for 10.8, none for the current 10.10.
-(87)
+(91)
Those in some numeric, logical, integer, raw, complex vectors and in memory allocated by
-R_alloc
.(88)
+(92)
including using the data sections of R vectors after they are freed.
-(89)
+(93)
small fixed-size arrays by default in
-gfortran
, for example.(90)
+(94)
currently only on ‘ix86’/‘x86_64’ Linux -and OS X (including the builds in Xcode 7 beta but not earlier Apple -releases). On some platforms, e.g. Fedora, the runtime library, -libasan, needs to be installed separately. OS X users can install -a suitable
-clang
from the sources, -http://llvm.org/releases/ or possibly distributions such as -MacPorts or Homebrew.(91)
+and OS X (including the builds in Xcode 7 but not earlier Apple +releases). On some platforms the runtime library, libasan, needs +to be installed separately, and for checking C++ you may also need +libubsan. +(95)
part of the LLVM project and in distributed in
-llvm
RPMs and.deb
s on Linux. It is not currently shipped by Apple.(92)
+(96)
as Ubuntu does.
-(93)
+(97)
installed on some Linux systems as
-asan_symbolize
, and obtainable from https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/asan/scripts/asan_symbolize.py: it makes use ofllvm-symbolizer
if available.(94)
+(98)
+On some +platforms the runtime library, libubsan, needs to be installed +separately.
+(99)
e.g. src/main/dotcode.c and parts of the -Matrix sources with
-clang
3.7.0).(95)
+Matrix sources withclang
3.7.0 amd later. +(100)
or the user manual for your version of
-clang
, e.g. http://llvm.org/releases/3.6.2/tools/docs/UsersManual.html.(96)
+(101)
This includes the C++ UBSAN handlers, despite its name.
-(97)
+(102)
but works better if inlining and frame pointer optimizations are disabled.
-(98)
+(103)
possibly after some platform-specific translation, e.g. adding leading or trailing underscores.
-(99)
+(104)
Note that this is then not checked for over-runs by option
-CBoundsCheck = TRUE
.(100)
+(105)
but this is not currently done.
-(101)
+(106)
whether or not ‘LinkingTo’ is used.
-(102)
+(107)
so there needs to be a corresponding
-import
orimportFrom
entry in the NAMESPACE file.(103)
+(108)
+Even including C system headers in +such a block has caused compilation errors.
+(109)
-
dyld
on OS X, andDYLD_LIBRARY_PATHS
below.(104)
+(110)
That is, similar to those defined in S version 4 from the 1990s: these are -not kept up to date and are not recommended for new projects.
-(105)
+not kept up to date and are not recommended for new projects. Prior to +R 3.3.0 it was not compatible with definingR_NO_REMAP
. +(111)
see The R API: note that these are not all part of the API.
-(106)
+(112)
SEXP is an acronym for Simple EXPression, common in LISP-like language syntaxes.
-(107)
+(113)
If no coercion was required,
-coerceVector
would have passed the old object through unchanged.(108)
+(114)
You can assign a copy of the object in the environment frame
-rho
usingdefineVar(symbol, duplicate(value), rho)
).(109)
+(115)
see Character encoding issues for why this might not be what is required.
-(110)
+(116)
This is only guaranteed to show the current interface: it is liable to change.
-(111)
+(117)
Known problems are redefining
-LENGTH
,error
,length
,vector
andwarning
(112)
+(118)
It is an optional C11 extension.
-(113)
+(119)
https://en.wikipedia.org/wiki/Endianness.
-(114)
+(120)
In the parlance of OS X this is a dynamic library, and is the normal way to build R on that platform.
-(115)
+(121)
but these are not part of the automated test procedures and so little tested.
-(116)
+(122)
at least on platforms where the values are available, that is having
-getrlimit
and on Linux or havingsysctl
supportingKERN_USRSTACK
, including FreeBSD and OS X.(117)
+(123)
An attempt to use only threads in the late 1990s failed to work correctly under Windows 95, the predominant version of Windows at that time.
diff --git a/R-intro.html b/R-intro.html index fbf480d..34dacf4 100644 --- a/R-intro.html +++ b/R-intro.html @@ -1,6 +1,6 @@ - - +An Introduction to R @@ -59,9 +59,8 @@ pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} -span.nocodebreak {white-space: nowrap} span.nolinebreak {white-space: nowrap} -span.roman {font-family: serif; font-weight: normal} +span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} body { @@ -404,13 +403,13 @@ analysis, classification, clustering, ...).This manual provides information on data types, programming elements, statistical modelling and graphics.
-This manual is for R, version 3.2.3 (2015-12-10). +
This manual is for R, version 3.3.1 (2016-06-21).
Copyright © 1990 W. N. Venables
Copyright © 1992 W. N. Venables & D. M. Smith
Copyright © 1997 R. Gentleman & R. Ihaka
Copyright © 1997, 1998 M. Maechler
-Copyright © 1999–2015 R Core Team +Copyright © 1999–2016 R Core TeamPermission is granted to make and distribute verbatim copies of this @@ -7425,8 +7424,8 @@ are designed to complement textbooks. Some (the recommended packages) are distributed with every binary distribution of R. Most are available for download from CRAN (https://CRAN.R-project.org/ and its mirrors) and other -repositories such as Bioconductor (https://www.bioconductor.org/) -and Omegahat (http://www.omegahat.org/). The R FAQ +repositories such as Bioconductor (https://www.bioconductor.org/). +and Omegahat (http://www.omegahat.net/). The R FAQ contains a list of CRAN packages current at the time of release, but the collection of available packages changes very frequently.
@@ -8604,15 +8603,15 @@ used by the inbuilt command line editor: this used to happen on OS X. file README.Rterm for command-line editing underRterm.exe
. -When using R with readline capabilities, the functions -described below are available, as well as others (probably) documented -in
man readline
orinfo readline
on your system. +When using R with GNU28 readline capabilities, the functions described +below are available, as well as others (probably) documented in +
man readline
orinfo readline
on your system.Many of these use either Control or Meta characters. Control characters, such as Control-m, are obtained by holding the CTRL down while you press the m key, and are written as C-m below. Meta characters, such as Meta-b, are typed by -holding down META28 and pressing b, and written as M-b +holding down META29 and pressing b, and written as M-b in the following. If your terminal does not have a META key enabled, you can still type Meta characters using two-character sequences starting with ESC. Thus, to enter M-b, you could @@ -8620,6 +8619,9 @@ type ESCb. The ESC charact allowed on terminals with real Meta keys. Note that case is significant for Meta characters.
+Some but not all versions30 of readline +will recognize resizing of the terminal window so this is best avoided. +
C.2 Editing actions
@@ -8654,7 +8656,8 @@ re-submitted.Go to the next command (forwards in the history).
- C-r text
-Find the last command with the text string in it. +
- @@ -9589,9 +9592,17 @@ on most 64-bit versions of Windows. ‘Emacs Speaks Statistics’ package; see the URL http://ESS.R-project.org
Find the last command with the text string in it. This can be +cancelled by
C-g
(and on some versions of R byC-c
).(28)
+It is possible to build R using an +emulation of GNU readline, such as one based on NetBSD’s +editline, it which case only a subset of the capabilities may +be provided.
+(29)
On a PC keyboard this is usually the Alt key, occasionally the ‘Windows’ key. On a Mac keyboard normally no meta key is available.
+(30)
+In particular, not versions 6.3 or +later: this is worked around as from R 3.4.0.
diff --git a/R-ints.html b/R-ints.html index 2abe19c..fe9053a 100644 --- a/R-ints.html +++ b/R-ints.html @@ -1,8 +1,8 @@ - - +R Internals @@ -51,9 +51,8 @@ pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} -span.nocodebreak {white-space: nowrap} span.nolinebreak {white-space: nowrap} -span.roman {font-family: serif; font-weight: normal} +span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} body { @@ -288,9 +287,9 @@ Next: R Internal StrucThis is a guide to the internal structures of R and coding standards for the core team working on R itself.
-This manual is for R, version 3.2.3 (2015-12-10). +
This manual is for R, version 3.3.1 (2016-06-21).
-Copyright © 1999–2015 R Core Team +
Copyright © 1999–2016 R Core Team
Permission is granted to make and distribute verbatim copies of this @@ -877,7 +876,7 @@ enclosure.
There are additional places that ‘variables’ can be looked up, called ‘user databases’ in comments in the code. These seem undocumented in the R sources, but apparently refer to the RObjectTable package -at http://www.omegahat.org/RObjectTables/. +at http://www.omegahat.net/RObjectTables/.
@@ -961,7 +960,7 @@ Next: Hash table, Previous: <Namespaces are environments associated with packages (and once again the base package is special and will be considered separately). A -package
pkg
with a namespace defines two environments +packagepkg
defines two environmentsnamespace:pkg
andpackage:pkg
: it ispackage:pkg
that can beattach
ed and form part of the search path. @@ -1867,21 +1866,21 @@ Next: Mechanics of1.12.3 S4 methods
-Details of methods are stored in S4 objects of class -
-"MethodsList"
. They have a non-syntactic name of the form -.__M__generic:package
for all methods defined in the -current environment for the named generic derived from a specific -package (which might be.GlobalEnv
). -There is also environment
-.__T__generic:package
which -has names the signatures of the methods defined, and values the -corresponding method functions. This is often referred to as a ‘methods -table’. -When a package without a namespace is attached these objects become -visible on the search path.
library
calls -methods:::cacheMetaData
to update the internal tables. +Details of the methods are stored in environments (typically hidden in the +respective namespace) with a non-syntactic name of the form +
+.__T__generic:package
containing objects of class +MethodDefinition
for all methods defined in the current environment +for the named generic derived from a specific package (which might be.GlobalEnv
). +This is sometimes referred to as a ‘methods table’.For example, +
++length(nM <- asNamespace("Matrix") ) # 941 for Matrix 1.2-6 + length(meth <- grep("^[.]__T__", names(nM), value=TRUE))# 107 generics with methods + length(meth.Ops <- nM$`.__T__Ops:base‘) # 71 methods for the ’Ops' (group)generic + head(sort(names(meth.Ops))) ## "abIndex#abIndex" ... "ANY#ddiMatrix" "ANY#ldiMatrix" "ANY#Matrix" +During an R session there is an environment associated with each non-primitive generic containing objects
.AllMTable
,.Generic
,.Methods
,.MTable
,.SigArgs
and @@ -1895,8 +1894,8 @@ directiveexportMethods
will export all the methods defined in the namespace for a specified generic: the code also adds to the list of generics any that are exported directly. For generics which are listed viaexportMethods
or exported themselves, the -corresponding"MethodsList"
and environment are exported and so -will appear (as hidden objects) in the package environment. +corresponding environment is exported and so +will appear (as hidden object) in the package environment.Methods for primitives which are internally S4 generic (see below) are always exported, whether mentioned in the NAMESPACE file or not. @@ -1910,7 +1909,7 @@ methods defined on generics in other packages. Since methods for a generic could be imported from several different packages, the methods tables are merged.
-When a package with a namespace is attached +
When a package is attached
@@ -1939,7 +1938,7 @@ space there will be two functions calledmethods:::cacheMetaData
is called to update the internal tables: only the visible methods will be cached.myfn
on the search paths, and which will be called depends on which search path is in use. This is starkest for functions in the base namespace, where the original will be found ahead of the newly created function from any -other package with a namespace. +other package.Primitive functions are treated quite differently, for efficiency reasons: this results in different semantics.
setGeneric
is @@ -2527,6 +2526,7 @@ following groups of functions:abs sign sqrt floor ceiling+exp expm1 log2 log10 log1p cos sin tan @@ -2535,10 +2535,13 @@ cosh sinh tanh acosh asinh atanh cospi sinpi tanpi+gamma lgamma digamma trigamma+cumsum cumprod cummax cummin+Im Re Arg Conj ModIf set to a non-empty value, a space-separated list of repositories to -use to determine known packages. Default: empty, when the CRAN, -Omegahat and Bioconductor repositories known to R is used. +use to determine known packages. Default: empty, when the CRAN +and Bioconductor repositories known to R is used.
_R_CHECK_SRC_MINUS_W_IMPLICIT_
@@ -4617,13 +4620,15 @@ Default: false (but true for CRAN submission checks).By default the output from running the R code in the vignettes is -kept only if there is an error. +kept only if there is an error. As from R 3.2.4 this also applies to +the build_vignettes.log log from the re-building of vignettes. Default: false.
- -
_R_CHECK_CLEAN_VIGN_TEST_
Should the vign_test directory be removed if the test is successful? +
Should the vign_test directory be removed if the test is +successful? Default: true.
_R_CHECK_REPLACING_IMPORTS_
@@ -4633,7 +4638,7 @@ Default: true. from auto-generated NAMESPACE files in other packages, but most often from importing the whole of a namespace rather than usingimportFrom
. -Default: false (but true for CRAN submission checks). +Default: true._R_CHECK_UNSAFE_CALLS_
@@ -4835,6 +4840,14 @@ suggests and enhances. Default: true (and true for CRAN submission checks). +- +
_R_CHECK_CODE_USAGE_WITH_ONLY_BASE_ATTACHED_
+ +If set, check code usage (via codetools) with only the base +package attached. +Default: true. +
+- @@ -5346,6 +5359,7 @@ Next: Concept index, Previ
_R_CHECK_EXIT_ON_FIRST_ERROR_
_R_CHECK_CODE_ATTACH_
:Tools _R_CHECK_CODE_DATA_INTO_GLOBALENV_
:Tools + _R_CHECK_CODE_USAGE_VIA_NAMESPACES_
:Tools _R_CHECK_CODE_USAGE_WITH_ONLY_BASE_ATTACHED_
:Tools _R_CHECK_CODOC_S4_METHODS_
:Tools _R_CHECK_COMPACT_DATA_
:Tools diff --git a/R-lang.html b/R-lang.html index f72546c..d4b14ef 100644 --- a/R-lang.html +++ b/R-lang.html @@ -1,8 +1,8 @@ - - + _R_CHECK_CRAN_INCOMING_
:Tools R Language Definition @@ -51,9 +51,8 @@ pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} -span.nocodebreak {white-space: nowrap} span.nolinebreak {white-space: nowrap} -span.roman {font-family: serif; font-weight: normal} +span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} body { @@ -342,9 +341,9 @@ Next: Introduction [ parsing, object oriented programming, computing on the language, and so forth. -This manual is for R, version 3.2.3 (2015-12-10). +
This manual is for R, version 3.3.1 (2016-06-21).
-Copyright © 2000–2015 R Core Team +
Copyright © 2000–2016 R Core Team
Permission is granted to make and distribute verbatim copies of this @@ -1780,10 +1779,8 @@ Next: repeat, Previous: 3 They are
for
,while
andrepeat
. The two built-in constructs,next
and -break
, provide additional control over the evaluation. Each of -the three statements returns the value of the last statement that was -evaluated. It is possible, although uncommon, to assign the result of -one of these statements to a symbol. R provides other functions for +break
, provide additional control over the evaluation. +R provides other functions for implicit looping such astapply
,apply
, andlapply
. In addition many operations, especially arithmetic ones, are vectorized so you may not need to use a loop. diff --git a/R.spec b/R.spec index e4a75a1..f2d797b 100644 --- a/R.spec +++ b/R.spec @@ -81,8 +81,8 @@ %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: R -Version: 3.3.0 -Release: 10%{?dist} +Version: 3.3.1 +Release: 1%{?dist} Summary: A language for data analysis and graphics URL: http://www.r-project.org Source0: ftp://cran.r-project.org/pub/R/src/base/R-3/R-%{version}.tar.gz @@ -256,7 +256,7 @@ Provides: R-Matrix = 1.2.6 Obsoletes: R-Matrix < 0.999375-7 Provides: R-methods = %{version} Provides: R-mgcv = 1.8.12 -Provides: R-nlme = 3.1.127 +Provides: R-nlme = 3.1.128 Provides: R-nnet = 7.3.12 Provides: R-parallel = %{version} Provides: R-rpart = 4.1.10 @@ -264,7 +264,7 @@ Provides: R-spatial = 7.3.11 Provides: R-splines = %{version} Provides: R-stats = %{version} Provides: R-stats4 = %{version} -Provides: R-survival = 2.39.2 +Provides: R-survival = 2.39.4 Provides: R-tcltk = %{version} Provides: R-tools = %{version} Provides: R-utils = %{version} @@ -1006,6 +1006,7 @@ R CMD javareconf \ %{_libdir}/R/library/nlme/html/ %{_libdir}/R/library/nlme/INDEX %{_libdir}/R/library/nlme/libs/ +%{_libdir}/R/library/nlme/LICENCE %{_libdir}/R/library/nlme/Meta/ %{_libdir}/R/library/nlme/mlbook/ %{_libdir}/R/library/nlme/NAMESPACE @@ -1136,6 +1137,9 @@ R CMD javareconf \ %{_libdir}/libRmath.a %changelog +* Tue Jul 5 2016 Tom Callaway- 3.3.1-1 +- update to 3.3.1 + * Sat Jun 11 2016 Tom Callaway - 3.3.0-10 - fix CAPABILITIES pathing diff --git a/sources b/sources index 2f8e0c1..2d59225 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5a7506c8813432d1621c9725e86baf7a R-3.3.0.tar.gz +f50a659738b73036e2f5635adbd229c5 R-3.3.1.tar.gz