devtools
is to make package development easier by providing R functions that simplify common tasks.devtools
does every thing it can to make it less so. In fact, devtools
comes with a small guarantee: if you get an angry e-mail from an R-core member because of a bug in devtools
, forward me the email and your address and I'll mail you a card with a handwritten apology.devtools
is opinionated about package development. It requires that you use roxygen2
for documentation and testthat
for testing. Not everyone would agree with this approach, and they are by no means perfect. But they have evolved out of the experience of writing over 30 R packages.devtools
gets in your way. Either send an email to the rdevtools mailing list or file an issue at the GitHub repository.devtools
at https://github.com/hadley/devtools. To install it:devtools
from CRAN with install.packages('devtools')
.devtools
functions accept a path as an argument, e.g. load_all('path/to/path/mypkg')
. If you don't specify a path, devtools
will look in the current working directory - this is recommended practice.load_all()
simulates installing and reloading your package,loading R code in R/
, compiled shared objects in src/
and datafiles in data/
. During development you usually want to access all functions so load_all()
ignores the package NAMESPACE
.load_all()
will automatically create a DESCRIPTION
if needed.document()
updates documentation, file collation andNAMESPACE
.test()
reloads your code, then runs all testthat
tests.install()
reinstalls the package, detaches the currently loaded version then reloads the new version with library()
. Reloading a package is notguaranteed to work: see the documentation to unload()
for caveats.build()
builds a package file from package sources. You canuse it to build a binary version of your package.install_*
functions install an R package:install_github()
from github,install_bitbucket()
from bitbucket, install_url()
from an arbitrary url andinstall_local()
from a local file on disk. install_version()
installs a specified version from cran.check()
updates the documentation, then builds and checks the package. build_win()
builds a package using win-builder, allowing you to easily check your package on windows.run_examples()
will run all examples to make sure they work.This is useful because example checking is the last step of R CMD check
.check_man()
runs most of the documentation checking componentsof R CMD check
release()
makes sure everything is ok with your package(including asking you a number of questions), then builds anduploads to CRAN. It also drafts an email to let the CRANmaintainers know that you've uploaded a new package..Rprofile
:?devtools
browse()
ingtraceback()
devtools
in interactive sessions.Rprofile
) to customise the default behaviour when creating packages and drafting emails:devtools.name
: your name, used to sign emailsdevtools.desc.author
: your R author string, in the form of 'Hadley Wickham <[email protected]> [aut, cre]'
. Used when creating default DESCRIPTION
files.devtools.desc.license
: a default license used when creating new packagesName | Description |
build | Build package. |
build_vignettes | Build package vignettes. |
check_cran | Check a package from CRAN. |
build_github_devtools | Build the development version of devtools from GitHub. |
bash | Open bash shell in package directory. |
check_man | Check documentation, as R CMD check does. |
check_failures | Parses R CMD check log file for ERRORs, WARNINGs and NOTEs |
check_dep_version | Check that the version of an imported package satisfies the requirements |
clean_source | Sources an R file in a clean environment. |
clean_dll | Remove compiled objects from /src/ directory |
devtools | Package development tools for R. |
in_dir | Deprecated Functions |
dev_meta | Return devtools metadata environment |
dev_help | Read the in-development help for a package loaded with devtools. |
compile_dll | Compile a .dll/.so from source. |
create | Creates a new package, following all devtools package conventions. |
dev_example | Run a examples for an in-development function. |
dev_packages | Return a vector of names of packages loaded by devtools |
clean_vignettes | Clean built vignettes. |
check | Build and check a package, cleaning up automatically on success. |
compiler_flags | Default compiler flags used by devtools. |
create_description | Create a default DESCRIPTION file for a package. |
eval_clean | Evaluate code in a clean R session. |
dr_github | Diagnose potential GitHub issues |
devtest | Return the path to one of the packages in the devtools test dir |
dr_devtools | Diagnose potential devtools issues |
imports_env | Return imports environment for a package |
document | Use roxygen to document a package. |
has_tests | Was devtools installed with tests? |
install_bioc | Install a package from a Bioconductor repository |
find_topic | Find the rd file that documents a topic. |
inst | Get the installation path of a package |
dev_mode | Activate and deactivate development mode. |
infrastructure | Add useful infrastructure to a package. |
github_pat | Retrieve Github personal access token. |
install_svn | Install a package from a SVN repository |
github_pull | GitHub references |
has_devel | Check if you have a development environment installed. |
install_cran | Attempts to install a package from CRAN. |
install_deps | Install package dependencies if needed. |
install_local | Install a package from a local file |
help | Drop-in replacements for help and ? functions |
install | Install a local development package. |
load_imports | Load all of the imports for a package |
install_github | Attempts to install a package directly from GitHub. |
install_git | Install a package from a git repository |
load_data | Load data. |
lint | Lint all source files in a package. |
install_version | Install specified version of a CRAN package. |
install_url | Install a package from a url |
package_file | Find file in a package. |
install_bitbucket | Install a package directly from bitbucket |
r_env_vars | Environment variables to set when calling R |
missing_s3 | Find missing s3 exports. |
load_all | Load complete package. |
parse_ns_file | Parses the NAMESPACE file for a package |
load_code | Load R code. |
release_checks | Custom devtools release checks. |
loaded_packages | Return a vector of names of attached packages |
ns_env | Return the namespace environment for a package. |
release | Release package to CRAN. |
setup_rtools | Find rtools. |
reload | Unload and reload package. |
parse_deps | Parse package dependency strings. |
on_path | Test if an object is on the path. |
revdep_email | Experimental email notification system. |
system_output | Run a system command and capture the output. |
show_news | Show package news |
submit_cran | Submit a package to CRAN. |
unload | Unload a package |
system_check | Run a system command and check if it succeeds. |
source_url | Run a script through some protocols such as http, https, ftp, etc. |
is.package | Is the object a package? |
uninstall | Uninstall a local development package. |
load_dll | Load a compiled DLL |
pkg_env | Return package environment |
RCMD | Run R CMD xxx from within R |
build_win | Build windows binary package. |
use_git | Initialise a git repository. |
use_data | Use data in a package. |
use_news_md | Use NEWS.md |
use_github | Connect a local repo with GitHub. |
use_readme_rmd | Create README files. |
update_packages | Update packages that are missing or out-of-date. |
as.package | Coerce input to a package. |
use_package | Use specified package. |
with_debug | Temporarily set debugging compilation flags. |
wd | Set working directory. |
path | Get/set the PATH variable. |
revdep | Reverse dependency tools. |
package_deps | Find all dependencies of a CRAN or dev package. |
run_pkg_hook | Run user and package hooks. |
run_examples | Run all examples in a package. |
session_info | Print session information |
revdep_check_save_summary | Run R CMD check on all downstream dependencies. |
source_gist | Run a script on gist |
spell_check | Spell checking |
system.file | Replacement version of system.file |
test | Execute all test_that tests in a package. |
use_git_hook | Add a git hook. |
use_github_links | Add GitHub links to DESCRIPTION. |
use_data_raw | Use>No Results! |
Encoding | UTF-8 |
URL | https://github.com/hadley/devtools |
BugReports | https://github.com/hadley/devtools/issues |
License | GPL (>= 2) |
VignetteBuilder | knitr |
RoxygenNote | 5.0.1 |
NeedsCompilation | yes |
Packaged | 2016-12-05 14:53:59 UTC; hornik |
Repository | CRAN |
Date/Publication | 2016-12-05 18:28:47 |
suggests | BiocInstaller , bitops , covr , crayon , curl (>= 0.9) , evaluate , gmailr (> 0.7.0) , hunspell (>= 1.2) , knitr , lintr (>= 0.2.1) , MASS , Rcpp (>= 0.10.0) , rmarkdown , roxygen2 (>= 5.0.0) , rversions , testthat (>= 0.7) |
imports | digest , git2r (>= 0.11.0) , httr (>= 0.4) , jsonlite , memoise (>= 1.0.0) , methods , rstudioapi (>= 0.2.0) , stats , tools , utils , whisker , withr |
depends | R (>= 3.0.2) |
Contributors | RStudio, Winston Chang, R Core team, Hadley Wickham |
[![Rdoc](http://www.rdocumentation.org/badges/version/devtools)](http://www.rdocumentation.org/packages/devtools)
I m attempting to install devtools on a Mac using R version 3.0.1. Is there a reason I can not install it?
|
supercilous answer 'yes' :-) If you look at the cran page Depends: R (≥ 3.0.2) So: Install 3.0.2 or later if you have permission |
Thank you tbates. I am a bit of a novice. I'll see if that works. |