-
Notifications
You must be signed in to change notification settings - Fork 119
/
.helper_functions
47 lines (47 loc) · 1.54 KB
/
.helper_functions
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
covr_shiny_app:
cov <- covr::package_coverage()
covr::shine(cov)
covr_zero_coverage:
zero <- function(...) {
# check out the link below to work most efficiently
# https://codecov.io/github/ggobi/ggally/features/suggestions?ref=dev
cov <- covr::package_coverage(...)
covr::zero_coverage(cov)
}
zero()
lintr_package:
# remove line in "linters:" above
devtools::lint()
# fix errors,
# repeat until no errors
lintr_code_to_create_lintr:
library(magrittr)
library(dplyr)
lintr::lint_package() %>%
as.data.frame %>%
group_by(linter) %>%
tally(sort = TRUE) %$%
sprintf("linters: with_defaults(\n %s\n NULL\n )\n",
paste0(linter, " = NULL, # ", n, collapse="\n ")) %>%
cat()
test_package:
tp <- function(package = "./", ...) {
devtools::document(package)
devtools::test(package, ...)
}
tp()
test_file:
tf <- function(file = "gg-plots", package = "./", spacer = "-") {
devtools::load_all(package)
testthat::test_file(file.path(package, "tests", "testthat", paste0("test", spacer, file, ".R")))
}
tf("zzz_ggpairs")
knit_vignettes:
devtools::document(); packagedocs::build_vignettes()
build_win:
devtools::build_win(version = c("R-release", "R-devel"))
reverse_depends:
# revdepcheck::revdep_reset()
revdepcheck::revdep_check(num_workers = 4, timeout = as.difftime(30, units = "mins"), quiet = FALSE)
reverse_depends_email:
devtools:::revdep_email(date = "Nov 4th alongside ggplot2's release", version = "1.3.0", author = "Barret", draft = TRUE, only_problems = FALSE)