On macOS and Windows, installing a binary package from CRAN will generally handle Arrow’s C dependencies for you. However, the macOS CRAN binaries are unfortunately incomplete for this version, so to install 0.14.1, you’ll first need to use Homebrew to get the Arrow C library (brew install apache-arrow), and then from R you can install.packages('arrow', type = 'source'). Brew install gfortran. Brew would complain otherwise that no fortran compiler is installed and R installation would fail. After that, everything is ready already and we can proceed using: brew install R. You need to run this command ﬁrst if you are on a recent OS X: brew tap homebrew/science. Use version 1.10.x until a fix is released. Hdf5r is an R interface to the HDF5 library. It is implemented using R6 classes based on the HDF5-C-API. The package supports all data-types as specified by HDF5 (including references) and provides many convenience functions yet also an extensive selection of the native HDF5-C-API functions. Brewpackages: A list of packages to install via brew. This option is ignored on non-macOS builds. Rbinarypackages: A list of R packages to install as binary packages on linux builds, via Michael Rutter’s cran2deb4ubuntu PPA. These installs will be faster than source installs, but may not always be the most recent version.
This guide covers build environment and configuration topics specific to Rprojects.Please make sure to read our Tutorial and build configuration guides first.
Travis CI support for R is contributed by the community and may be removed oraltered at any time. If you run into any problems, please report them in theR section of our forums and cc @jeroenand @jimhester.
R support in Travis CI is designed to make it easy to test Rpackages. If your R package doesn’t need any system dependenciesbeyond those specified in your
DESCRIPTION file, your
.travis.yml cansimply be
The R environment comes with LaTeX and pandocpre-installed, making it easier to use packages like RMarkdown orknitr
Travis CI supports a number of configuration options for your R package.
Travis CI supports R versions
3.0.3 and above on Ubuntu Precise, Ubuntu Trusty and macOS.Aliases exist for each major release, e.g
3.1 points to
3.1.3. In addition thename
oldrel is aliased to the previous major release and
release is aliased to thelatest minor release.
devel is built off of the R git mirrorof the R SVN trunk (updated hourly).
Matrix builds are supported for R builds, however both instances of
r mustbe in lowercase.
As new minor versions are released, aliases will float and point to the mostcurrent minor release.
You can access the above “channel” string (i.e.
release) as opposed to the concrete version number (i.e
3.2.1) with the environmental variable
The exact R version used for each build is included in the ‘R session information’fold within the build log.
By default, Travis CI will find all R packages listed as dependencies in yourpackage’s
DESCRIPTION file, and install them from CRAN. You can includedependencies on packages in development by listing them in the
Remotes: fieldin your
DESCRIPTION. See the Remotes Vignette for moreinformation on using development remotes in your package.
Most of the time you should not need to specify any additional dependencies inyour
The included TexLive distribution contains only a limited set of defaultpackages. If your vignettes require additional TexLive packages youcan install them using
tlmgr install in the
The best way to figure out what packages you may need is to look at thepackages listed in the LaTeX error message and search for them on CTAN.Packages often have a
Contained in: field that indicates the package groupyou need to install.
If you don’t need LaTeX, tell Travis CI not to install it using
The default pandoc version installed is
2.2. Alternative pandocreleases can be installed by setting the
pandoc_version to thedesired version.
If you don’t need Pandoc, tell Travis CI not to install it using
Use the APT addon to install APT packages.The snippet below installs a prerequisite for the R package
This option is ignored on non-Linux builds.
An alternative is the
You can use the following top-level options to control what options are usedwhen building and checking your package:
warnings_are_errors: This option forces all
R CMD check tobecome build failures (default
true). This is especially helpful when preparingyour package for submission to CRAN, and is recommended for most packages.Set
warnings_are_errors: false if you don’t want
WARNINGS to fail the build.
r_build_args: additional arguments to pass to
R CMD build, as a singlestring. Defaults to empty.
r_check_args: additional arguments to pass to
R CMD check, as a singlestring. Defaults to
A typical Bioconductor package should only need to specify theBioconductor version they want to test against in their
Or if you want to test against the release branch
Travis CI will use the proper R version for that version of Bioconductor andconfigure Bioconductor appropriately for installing dependencies.
If you want Travis CI to use your project-specific packrat package library,rather than the default behaviour of downloading your package dependencies from CRAN, you can add this to your
You can minimise build times by caching your packrat packages with:
cran: CRAN mirror to use for fetching packages. Defaults to
repos: Dictionary of repositories to pass to
CRAN isnot given in the dictionary the value of the
cran option is used.Example:
truethis removes the preinstalled homebrewinstallation on macOS. Useful to test if the package builds on a vanilla macOSmachine, such as the CRAN mac builder.
R-Travis sets the following additional environment variables from the Travisdefaults.
TRAVIS_R_VERSION=3.2.4Set to version chosen by
TRAVIS_R_VERSION_STRINGset to the string provided to
devel. Useful, for example, to deploy only from
on: condition: '$TRAVIS_R_VERSION_STRING = release'.
For most packages you should not need to specify any additional dependencies inyour
.travis.yml. However for rare cases the following fieldsare supported.
Each of the names below is a list of packages you can optionally specify as atop-level entry in your
.travis.yml; entries in these lists will beinstalled before building and testing your package. Note that these lists areprocessed in order, so entries can depend on dependencies in a previous list.
apt_packages: See above
brew_packages: A list of packages to install via
brew. This option isignored on non-macOS builds.
r_binary_packages: A list of R packages to install as binary packages onlinux builds, via Michael Rutter’scran2deb4ubuntu PPA.These installs will be faster than source installs, but may not always bethe most recent version. Specify the name just as you would when installingfrom CRAN. On macOS builds these packages are installed from source.
r_packages: A list of R packages to install via
bioc_packages: A list of Bioconductorpackages to install.
r_github_packages: A list of packages to install directly from GitHub,using
devtools::install_github from thedevtools package. The package nameshere should be of the form
user/repo.If the package is installed in a subdirectory, use
user/repo/subdirectory.An alternative is to add
Remotes section of the
DESCRIPTION file of your package
For some advanced use cases, it makes sense to override the default steps usedfor building R packages. The default rules roughly amount to:
If you’d like to see the full details, seethe source code.
You can find more information on the build config format for R in our Travis CI Build Config Reference.
If your package is in a subdirectory of the repository you need tochange to the subdirectory prior to running the
If your package depends on another repository you can use
r_github_packages in this way:
An alternative is to add the following line to your
Remotes: specifies the source of a development package, so the package still needs to be listed in
LinkingTo:.In the rare case where repo and package name differ,
Remotes: expects the repository name and
Imports: expects the package name (as per the
DESCRIPTION of that imported package).
If your package depends on another repository which holds the package in a subdirectory, you can use
r_github_packages in this way:
An alternative is to add the following line to your
If you’ve already been using r-travis to test your R package, you’reencouraged to switch to using the native support described here. We’ve writtena porting guide to help you modify your
R support for Travis CI was originally based on the r-travis project, andthanks are due to all the contributors. For more information onmoving from r-travis to native support, see the porting guide.