Tools to make an R developer's life easier
template.Rproj
is now correctly installed and the function
use_rstudio
works as it should. (#595, @hmalmedal)use_rcpp
will now create the file src/.gitignore
with the
correct wildcards. (@hmalmedal)create()
create()
no longer generates man/
directory - roxygen2 now does
this automatically. It also no longer generates an package-level doc
template. If you want this, use use_package_doc()
. It also makes a dummy
namespace so that you can build & reload without running document()
first.use_data()
makes it easy to include data in a package, either
in data/
(for exported datasets) or in R/sysdata.rda
(for internal
data). (#542)use_data_raw()
creates data-raw/
directory for reproducible
generation of data/
files (#541).use_package()
allows you to set dependencies (#559).use_package_doc()
sets up an Roxygen template for package-level
docs.use_rcpp()
sets up a package to use Rcpp.use_travis()
now figures out your github username and repo so it can
construct the markdown for the build image. (#546)use_vignette()
creates a draft vignette using Rmarkdown (#572).add_rstudio_project()
to use_rstudio()
, add_travis()
to
use_travis()
, add_build_ignore()
to use_build_ignore()
, and
add_test_infrastructure()
to use_testthat()
(old functions are
aliased to new)release()
by defining a function
release_questions()
in your package. Your release_questions()
should
return a character vector of questions to ask (#451).release()
uses new CRAN submission process, as implemented by
submit_cran()
(#430).install_*
now use the same code and store much useful metadata.
Currently only session_info()
takes advantage of this information,
but it will allow the development of future tools like generic update
functions.build_vignettes = TRUE
to
force building and to install all suggested packages (#573).install_bitbucket()
has been bought into alignment with install_github()
:
this means you can now specify repos with the compact username/repo@ref
syntax. The username
is now deprecated.install_git()
has been simplified and many of the arguments have changed
names for consistency with metadata for other package installs.install_github()
has been considerably improved:
username
is deprecated - please include the user in the repo name:
rstudio/shiny
, hadley/devtools
etc.dependencies = TRUE
is no longer forced (regression in 1.5)
(@krlmlr, #462).auth_user
, branch
, pull
and password
have
all been removed.host
argument which allows you to install packages from github
enterprise (#410, #506).ref = github_pull(...)
(@krlmlr, #509). To install the latest release, use "user/repo@*release"
or ref = github_release()
(@krlmlr, #350).install_gitorious()
has been bought into alignment with install_github()
:
this means you can now specify repos with the compact username/repo@ref
syntax. You must now always supply user (project) name and repo.install_svn()
lets you install an R package from a subversion repository
(assuming you have subversion installed).decompress()
and hence install_url()
now work when the downloaded
file decompresses without additional top-level directory (#537).LC_ALL=C
- this no longer seems
necessary (#507).build(binary = TRUE)
creates an even-more-temporary package library
avoid conflicts (#557).check_dir()
no longer fails on UNC paths (#522).check_devtools()
also checks for dependencies on development versions
of packages (#534).load_all()
no longer fails on partial loading of a package containing
S4 or RC classes (#577).find_rtools()
is now run on package load, not package
attach.help()
, ?
, and system.file()
are now made available when a package is
loaded with load_all()
, even if the devtools package isn't attached.httr
0.3 required (@krlmlr, #466).load_all()
no longer gives an error when objects listed as exports are
missing.library.dynam.unload()
.loaded_packages()
now returns package name and path it was loaded from.
(#486)parenvs()
function has been removed from devtools, because is now in the
pryr package.missing_s3()
uses a better heuristic for determining if a function
is a S3 method (#393).session_info()
provides useful information about your R session.
It's a little more focussed than sessionInfo()
and includes where
packages where installed from (#526).rstudioapi
package moved from suggests to imports, since it's always
needed (it's job is to figure out if rstudio is available, #458)utils::unzip()
that throws error if command
fails and doesn't print unneeded messages on non-Windows platforms (#540).write.dcf()
that doesn't butcher whitespace and
fieldnames.fresh
argument to test()
has been removed - this is best done by
the editor since it can run the tests in a completely clean environment
by starting a new R session.Four new functions make it easier to add useful infrastructure to packages:
add_test_infrastructure()
will create test infrastructure for a new package.
It is called automatically from test()
if no test directories are
found, the session is interactive and you agree.add_rstudio_project()
adds an Rstudio project file to your package.
create()
gains an rstudio
argument which will automatically create
an Rstudio project in the package directory. It defaults to TRUE
:
if you don't use Rstudio, just delete the file.add_travis()
adds a basic travis template to your package. .travis.yml
is automatically added to .Rbuildignore
to avoid including it in the built
package.add_build_ignore()
makes it easy to add files to .Rbuildignore
,
correctly escaping special charactersTwo dependencies were incremented:
document()
requires at least roxygen2 version 3.0.0.build_win()
now builds R-release and R-devel by default (@krlmlr, #438).
It also gains parameter args
, which is passed on to build()
(@krlmlr, #421).check_doc()
now runs document()
automatically.install()
gains thread
argument which allows you to install multiple
packages in parallel (@mllg, #401). threads
argument to check_cran()
now defaults to getOption("Ncpus")
install_deps(deps = T)
no longer installs all dependencies of
dependencies (#369).install_github()
now prefers personal access tokens supplied to
auth_token
rather than passwords (#418, @jeroenooms).install_github()
now defaults to dependencies = TRUE
so you definitely
get all the packages you need to build from source.system.file()
so that when the function
is called from the R console, it will have special behavior for packages
loaded with devtools.help
and ?
, which will search
devtools-loaded packages as well as normally-loaded packages.check_devtools()
no longer called by check()
because the relevant
functionality is now included in R CMD CHECK
and it was causing
false positives (#446).install_deps(TRUE)
now includes packages listed in VignetteBuilder
(#396)build()
no longer checks for pdflatex
when building vignettes, as
many modern vignettes don't need it (#398). It also uses
--no-build-vignettes
for >3.0.0 compatibility (#391).release()
does a better job of opening your email client if you're inside
of Rstudio (#433).check()
now correctly reports the location of the R CMD check
output when called with a custom check_dir
. (Thanks to @brentonk)check_cran()
records check times for each package tested.DESCRIPTION
file created by create_description()
.
(Thanks to @ncarchedi, #428)install_github()
that prevented installing a pull request by
supplying repo = "username/repo#pull"
. (#388)install_github
. (Thanks to Kirill Müller, #405)install_github()
now removes blank lines found in a package DESCRIPTION
file, protecting users from the vague error: contains a blank line
error.
(#394)with_options()
now works, instead of throwing an error (Thanks to
@krlmlr, #434)wd()
when path
was ommitted. (#374)dev_help()
that prevented it from working when not using
Rstudio.source_gist()
respects new github policy by sending user agent
(hadley/devtools)install_github()
now takes repo names of the form
[username/]repo[/subdir][@ref|#pull]
-
this is now the recommended form to specify username, subdir, ref and/or
pull for install_github. (Thanks to Kirill Müller, #376)install()
now respects the global option keep.source.pkgs
.install()
gains a build_vignettes
which defaults to TRUE, and ensures
that vignettes are built even when doing a local install. It does this
by forcing local = FALSE
if the package has vignettes, so R CMD build
can follow the usual process. (#344)install_github()
now takes repo names of the form username/repo
-
this is now the recommended form for install_github if your username is
not hadley ;)install_github()
now adds details on the source of the installed package
(e.g. repository, SHA1, etc.) to the package DESCRIPTION file. (Thanks to JJ
Allaire)install_version()
to new meta data structure on CRAN.
(Thanks to Kornelius Rohmeyer)install_version()
works with version numbers that
contain hyphens. (Thanks to Kornelius Rohmeyer)install_deps()
is now exported, making it easier to install the dependencies
of a package.build(binary = TRUE)
now no longer installs the package as a side-effect.
(#335)build_github_devtools()
is a new function which makes it easy for Windows
users to upgrade to the development version of devtools.create_description()
does a better job of combining defaults and user
specified options. (#332)install()
also installs the dependencies that do not have the required
versions; besides, the argument dependencies
now works like
install.packages()
(in previous versions, it was essentially
c("Depends", "Imports", "LinkingTo")
) (thanks, Yihui Xie, #355)check()
and check_cran()
gain new check_dir
argument to control where
checking takes place (#337)check_devtools()
no longer incorrectly complains about a vignettes/
directorygetOption("unzip")
(#326)dev_help
will now use the Rstudio help pane, if you're using a recent
version of Rstudio (#322)source_url()
(and source_gist()
) accept SHA1 prefixes.source_gist()
uses the github api to reliably locate the raw gist.
Additionally it now only attempts to source files with .R
or .r
extensions, and gains a quiet
argument. (#348)