-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path01_create_pkg.R
69 lines (59 loc) · 2.45 KB
/
01_create_pkg.R
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
61
62
63
64
65
66
67
68
69
## ********************
## Create the R package
## ********************
## To get started, install R from https://cran.r-project.org/
## and RStudio Desktop https://rstudio.com/products/rstudio/download/#download
## You can install both of them for free.
## Next, open RStudio as the code that will run benefits from running inside
## RStudio for interactivity purposes.
## Next, you might need to install several R packages that you can install with
## the following code:
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
remotes::install_cran(
c(
"available",
"BiocManager",
"devtools",
"knitr",
"pkgdown",
"RefManageR",
"rmarkdown",
"rstudioapi",
"sessioninfo",
"styler",
"usethis"
)
)
if (!requireNamespace("BiocStyle", quietly = TRUE)) {
BiocManager::install("BiocStyle")
}
remotes::install_github("lcolladotor/biocthis")
## Here's a very quick summary of why these packages are useful:
## * available: to check the name of your package
## * BiocManager: to install Bioconductor packages
## * BiocStyle: for styling your vignette and linking to other packages
## * devtools: to develop R packages
## * knitr: for making your vignette
## * pkgdown: for creating beautiful documentation websites
## * RefManageR: for citing utilities in your package vignette
## * rmarkdown: for making the README.md and processing your vignette
## * remotes: for installing R packages from several locations
## * rstudioapi: for navigating across files in RStudio
## * sessioninfo: for detailed R session information useful to you and your users
## * usethis: for creating templates that will jump start your R package work
## Package names have some properties. You can also use:
available::available("spatialLIBD")
## to check that your package name is not taken and that it doesn't have
## a meaning that you might not be aware of.
usethis::create_package("spatialLIBD")
## This opens a new window in RStudio
## Note: If you create packages frequently, check the help file for
## usethis::use_description() for more information on how to set some R author
## defaults.
## Add package development files from biocthis
biocthis::use_bioc_pkg_templates()
## Move to the next step: setting up Git and GitHub for your package
rstudioapi::navigateToFile(usethis::proj_path("dev", "02_git_github_setup.R"))
## This template was made using https://lcolladotor.github.io/biocthis/