-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpackaging.R
95 lines (72 loc) · 3.05 KB
/
packaging.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#=============================================================================
# Put together the package
#=============================================================================
# WORKFLOW: UPDATE EXISTING PACKAGE
# 1) Modify package content and documentation.
# 2) Increase package number in "use_description" below.
# 3) Go through this script and carefully answer "no" if a "use_*" function
# asks to overwrite the existing files. Don't skip that function call.
# devtools::load_all()
library(usethis)
# Sketch of description file
use_description(
fields = list(
Title = "Confidence Intervals",
Version = "1.0.3",
Description = "Calculates classic and/or bootstrap confidence intervals for many parameters such as the population mean, variance, interquartile range (IQR), median absolute deviation (MAD), skewness, kurtosis, Cramer's V, odds ratio, R-squared, quantiles (incl. median), proportions, different types of correlation measures, difference in means, quantiles and medians. Many of the classic confidence intervals are described in Smithson, M. (2003, ISBN: 978-0761924999). Bootstrap confidence intervals are calculated with the R package 'boot'. Both one- and two-sided intervals are supported.",
`Authors@R` = "person('Michael', 'Mayer', email = '[email protected]', role = c('aut', 'cre'))",
Depends = "R (>= 3.1.0)",
LazyData = NULL
),
roxygen = TRUE
)
use_package("stats", "Imports")
use_package("boot", "Imports")
use_gpl_license(2)
# Your files that do not belong to the package itself (others are added by "use_* function")
use_build_ignore(c("^packaging.R$", "[.]Rproj$", "^backlog$",
"^cran-comments.md$", "^logo.png$"), escape = FALSE)
# If your code uses the pipe operator %>%
# use_pipe()
# If your package contains data. Google how to document
# use_data()
# Add short docu in Markdown (without running R code)
use_readme_md()
# Longer docu in RMarkdown (with running R code). Often quite similar to readme.
use_vignette("confintr")
# If you want to add unit tests
use_testthat()
# use_test("test-cor.R")
# On top of NEWS.md, describe changes made to the package
use_news_md()
# Add logo
use_logo("logo.png")
use_github_links() # use this if this project is on github
# If package goes to CRAN: infos (check results etc.) for CRAN
use_cran_comments()
# Github actions
use_github_action("check-standard")
use_github_action("test-coverage")
use_github_action("pkgdown")
# Revdep
use_revdep()
#=============================================================================
# Finish package building (can use fresh session)
#=============================================================================
library(devtools)
document()
test()
check(manual = TRUE, cran = TRUE, vignettes = FALSE)
build()
# build(binary = TRUE)
install()
# Run only if package is public(!) and should go to CRAN
if (FALSE) {
check_win_devel()
check_rhub()
# Takes long
revdepcheck::revdep_check(num_workers = 4L)
# Wait until above checks are passed without relevant notes/warnings
# then submit to CRAN
release()
}