Tools to Make Developing R Packages Easier
Collection of package development tools.
The package is available for download from CRAN. However, you need to make sure you're set up to develop packages. This is platform specific: On Windows, download and install Rtools. On the Mac, make sure you have Xcode installed. To install the BSDA package, type the following at the R prompt. 2018-6-11 R包安装函数'install.packages'函数详解 今天解决解决了一个R包安装的问题,并且硬着头皮把install.packages和download.file的说明从头到位看了一遍,应该再也没有一个R包安装能为难到我了。 问题实例 问题描述 能够用浏览器访问镜像站点,但是在.
- R/pulkrob.chisq.R defines the following functions: generalhoslem source: R/pulkrob.chisq.R rdrr.io Find an R package R language docs Run R in your browser R Notebooks.
- 2020-9-5 Hit the button: Download R for (Mac) OS X Install the PKG file that came in the download. This website might help to go ahead and download home-brew / install home brew as well.
- 2015-5-18 Mac下R语言环境搭建 博主在数据分析的时候一直用的python(MATLAB太重了),最近跟其他搞学术的人合作,需要用一下R语言,所以也打算顺便学习一下R。R语言简介 R语言是用于统计分析,图形表示和报告的编程语言和软件环境。R语言由Ross Ihaka和Robert Gentleman在新西兰奥克兰大学创建,目前由R语言开发.
Readme
The aim of devtools is to make package development easier by providing Rfunctions that simplify and expedite common tasks. RPackages is a book based around this workflow.
Installation
Cheatsheet
Usage
All devtools functions accept a path as an argument, e.g.
load_all('path/to/mypkg')
. If you don't specify a path, devtools willlook in the current working directory - this is a recommended practice.Frequent development tasks:
load_all()
simulates installing and reloading your package, loading R codeinR/
, compiled shared objects insrc/
and data files indata/
. Duringdevelopment you would usually want to access all functions (even un-exportedinternal ones) soload_all()
works as if all functions were exported in thepackageNAMESPACE
.document()
updates generated documentation inman/
, file collation andNAMESPACE
.test()
reloads your code withload_all()
, then runs alltestthat
tests.test_coverage()
runs test coverage on your package withcovr. This makes it easy to see what parts of yourpackage could use more tests!
Building and installing:
install()
reinstalls the package, detaches the currently loaded versionthen reloads the new version withlibrary()
. Reloading a package is notguaranteed to work: see the documentation forunload()
for caveats.build()
builds a package file from package sources. You can use it to builda binary version of your package.install_*
functions install an R package:install_github()
from GitHubinstall_gitlab()
from GitLabinstall_bitbucket()
from Bitbucketinstall_url()
from an arbitrary urlinstall_git()
andinstall_svn()
from an arbitrary git or SVN repositoryinstall_local()
from a local file on diskinstall_version()
from a specific version on CRAN
update_packages()
updates a package to the latest version. This worksboth on packages installed from CRAN as well as those installed from any oftheinstall_*
functions.
Check and release:
check()
updates the documentation, then builds and checks the package locally.check_win()
checks a package usingwin-builder, andcheck_rhub()
checks a package usingr-hub. This allows you to easily checkyour package on all systems CRAN uses before submission.release()
makes sure everything is ok with your package (including askingyou a number of questions), then builds and uploads to CRAN.
Learning more
R package development can be intimidating, however there are now a number ofvaluable resources to help!
- R Packages is a book that gives a comprehensive treatment of all common partsof package development and uses devtools throughout.
- The first edition is available at https://r-pkgs.org/, but note thatit has grown somewhat out of sync with the current version of devtools.
- A second edition is under development and is evolving to reflect thecurrent state of devtools. It is available at https://r-pkgs.org.
- The Whole Game andPackage structure chaptersmake great places to start.
- RStudio community - packagedevelopmentis a great place to ask specific questions related to package development.
- rOpenSci packages hasextensive documentation on best practices for R packages looking to becontributed to rOpenSci, but also very useful general recommendationsfor package authors.
- There are a number of fantastic blog posts on writing your first package, including
- Writing RExtensions isthe exhaustive, canonical reference for writing R packages, maintained bythe R core developers.
Conscious uncoupling
devtools started off as a lean-and-mean package to facilitate local packagedevelopment, but over the years it accumulated more and more functionality.devtools has undergone a consciousuncouplingto split out functionality into smaller, more tightly focussed packages. Thisincludes:
- testthat: Writing and running tests(i.e.
test()
). - roxygen2: Function and package documentation(i.e.
document()
). - remotes: Installing packages (i.e.
install_github()
). - pkgbuild: Building binary packages(including checking if build tools are available) (i.e.
build()
). - pkgload: Simulating package loading (i.e.
load_all()
). - rcmdcheck: Running R CMD check andreporting the results (i.e.
check()
). - revdepcheck: Running R CMD check onall reverse dependencies, and figuring out what's changed since the last CRANrelease (i.e.
revdep_check()
). - sessioninfo: R session info (i.e.
session_info()
). - usethis: Automating package setup (i.e.
use_test()
).
Generally, you would not need to worry about these different packages, becausedevtools installs all of them automatically. You will need to care, however, ifyou're filing a bug because reporting it at the correct place will lead to aspeedier resolution.
You may also need to care if you are trying to use some devtools functionalityin your own package or deployed application. Generally in these cases itis better to depend on the particular package directly rather than depend on devtools,e.g. use
sessioninfo::session_info()
rather than devtools::session_info()
,or remotes::install_github()
vs devtools::install_github()
.However for day to day development we recommend you continue to use
library(devtools)
to quickly load all needed development tools, just likelibrary(tidyverse)
quickly loads all the tools necessary for data explorationand visualization.Code of conduct
Please note that the devtools project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Functions in devtools
Name | Description | |
bash | Open bash shell in package directory. | |
build_vignettes | Build package vignettes. | |
check_man | Check documentation, as R CMD check does. | |
build_manual | Create package pdf manual | |
check | Build and check a package, cleaning up automatically on success. | |
as.package | Coerce input to a package. | |
check_rhub | Run CRAN checks for package on R-hub | |
check_win | Build windows binary package. | |
devtools | Package development tools for R. | |
devtools-deprecated | Deprecated Functions | |
document | Use roxygen to document a package. | |
clean_vignettes | Clean built vignettes. | |
git_checks | Git checks. | |
r_env_vars | Environment variables to set when calling R | |
create | Create a package | |
dev_mode | Activate and deactivate development mode. | |
save_all | Save all documents in an active IDE session. | |
is.package | Is the object a package? | |
dev_packages | Return a vector of names of packages loaded by devtools | |
reexports | Objects exported from other packages | |
show_news | Show package news | |
lint | Lint all source files in a package. | |
missing_s3 | Find missing s3 exports. | |
load_all | Load complete package. | |
github_pat | Retrieve GitHub personal access token. | |
loaded_packages | Return a vector of names of attached packages | |
revdep | Reverse dependency tools. | |
spell_check | Spell checking | |
dev_sitrep | Report package development situation | |
run_examples | Run all examples in a package. | |
has_tests | Was devtools installed with tests? | |
devtest | Return the path to one of the packages in the devtools test dir | |
package_file | Find file in a package. | |
install | Install a local development package. | |
install_deps | Install package dependencies if needed. | |
submit_cran | Submit a package to CRAN. | |
reload | Unload and reload package. | |
wd | Set working directory. | |
remote-reexports | Functions re-exported from the remotes package | |
source_url | Run a script through some protocols such as http, https, ftp, etc. | |
source_gist | Run a script on gist | |
release | Release package to CRAN. | |
release_checks | Custom devtools release checks. | |
test | Execute test_that tests in a package. | |
uninstall | Uninstall a local development package. | |
build | Build package | |
build_rmd | Build a Rmarkdown files package | |
build_site | Execute pkgdown build_site in a package | |
check_failures | Parses R CMD check log file for ERRORs, WARNINGs and NOTEs | |
No Results! |
Generalhoslem Package R Download Mac Download
Vignettes of devtools
Name | ||
dependencies.Rmd | ||
No Results! |
Last month downloads
Details
License | GPL (>= 2) |
URL | https://devtools.r-lib.org/, https://github.com/r-lib/devtools |
BugReports | https://github.com/r-lib/devtools/issues |
VignetteBuilder | knitr |
Encoding | UTF-8 |
Language | en-US |
RoxygenNote | 7.1.1 |
NeedsCompilation | no |
Packaged | 2020-09-17 19:11:59 UTC; jhester |
Repository | CRAN |
Date/Publication | 2020-09-18 07:20:11 UTC |
suggests | BiocManager (>= 1.30.10) , curl (>= 4.3) , digest (>= 0.6.25) , foghorn (>= 1.3.1) , gmailr (>= 1.0.0) , knitr (>= 1.29) , lintr (>= 2.0.1) , MASS , mockery (>= 0.4.2) , pingr (>= 2.0.1) , pkgdown (>= 1.6.1) , rhub (>= 1.1.1) , rmarkdown (>= 2.3) , spelling (>= 2.1) |
imports | callr (>= 3.4.4) , cli (>= 2.0.2) , covr (>= 3.5.1) , desc (>= 1.2.0) , DT (>= 0.15) , ellipsis (>= 0.3.1) , httr (>= 1.4.2) , jsonlite (>= 1.7.1) , memoise (>= 1.1.0) , pkgbuild (>= 1.1.0) , pkgload (>= 1.1.0) , rcmdcheck (>= 1.3.3) , remotes (>= 2.2.0) , rlang (>= 0.4.7) , roxygen2 (>= 7.1.1) , rstudioapi (>= 0.11) , rversions (>= 2.0.2) , sessioninfo (>= 1.1.1) , stats , testthat (>= 2.3.2) , tools , utils , withr (>= 2.2.0) |
depends | R (>= 3.0.2) , usethis (>= 1.6.3) |
Contributors | RStudio, Hadley Wickham, Winston Chang, R Core team |
Include our badge in your README
Generalhoslem Package R Download Mac Free
[![Rdoc](http://www.rdocumentation.org/badges/version/devtools)](http://www.rdocumentation.org/packages/devtools)