-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_to_submit_to_CRAN.R
36 lines (26 loc) · 1.23 KB
/
prepare_to_submit_to_CRAN.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
# This code can be used to do the checks to the R package before submit to CRAN
# install the packages and load them
install.packages("devtools")
install.packages("usethis")
install.packages("covr")
library(devtools)
library(covr)
# check that there are no errors, warnings or notes
devtools::check()
# Check package coverage
covr::package_coverage()
# Run tests
devtools::test()
# Check spelling - No typo
spelling::spell_check_package()
# check your package on several platforms
# rhub::check_for_cran()
# If you would like to add comments to CRAN team
# Creates cran-comments.md, a template for your communications with CRAN when submitting a package.
usethis::use_cran_comments(open = rlang::is_interactive())
# If you are submitting a new version to CRAN, Upgrade version number using this command or you can do it manually
usethis::use_version(which = c("patch", "minor", "major", "dev")[1])
# When you are happy with the package and want to submit it to CRAN, you can do this manually by converting the package source directory into a single bundled file and submit this file to CRAN (https://xmpalantir.wu.ac.at/cransubmit/)
devtools::build()
# Or if you decide to do the release automatically then you can run this command
# devtools::release()