-
Notifications
You must be signed in to change notification settings - Fork 2
/
02-make-a-package.Rmd
60 lines (43 loc) · 1005 Bytes
/
02-make-a-package.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
```{r echo = FALSE}
knitr::opts_chunk$set(
comment = "#>",
warning = FALSE,
message = FALSE
)
```
# Make a package {#make-a-package}
Let's start making a package!
## in RStudio
![img1](img/1_newproject.png)
![img1](img/2_createproject.png)
![img1](img/3_rpackage.png)
![img1](img/4_final.png)
## on your command line {#cli}
Using the `devtools` package:
```r
devtools::create("foo")
```
Or, with the `mason` package:
install first:
```r
devtools::install_github("metacran/mason")
devtools::install_github("metacran/mason.rpkg")
devtools::install_github("metacran/mason.github")
```
Create a package
```r
mason::mason('github')
```
See <https://github.com/metacran/mason> for details
## usethis {#usethis}
Optionally, you can use the `usethis` package <https://github.com/r-lib/usethis>
to help in package creation/maintainance.
```r
use_mit_license("My Name")
use_package("MASS", "Suggests")
use_dev_package("callr")
use_readme_md()
use_news_md()
use_test("my-test")
use_git()
```