forked from hadley/adv-r
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package-quick-reference.rmd
41 lines (25 loc) · 1004 Bytes
/
Package-quick-reference.rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
title: Package dev quick ref
layout: default
---
# Quick reference sheet for package process
In progress
All devtools package functions take a package path as the first argument. If it is omitted it assumes the package is in the current working directory - developing the package in this way is best practice.
## Create a new package
* With no R files: `create("mypackage")`
* With R files: copy in to a directory which contains a DESCRIPTION file and a directory called `R/` and then run `load_all()`
## Development workflow
* Re-loading the package during development: `load_all()` (this loads dependent packages, data, R code and compiled src code)
* Converting roxygen comments to Rd files: `document()`
* Check that in-development documentation looks ok: `dev_help("topic")`
## Deploying
* Locally
* On github
* On CRAN
### Building the package for all users of the system
Change to the path of the package
```{r, eval = FALSE}
document()
install()
```
Check the error messages!