Skip to content

Commit 1c040b6

Browse files
authored
Release/0.3.0 cran update (#449)
* Update examples to `dontrun` for CRAN * Update documentation * reformat NEWS.md and update wordlist * Add .onLoad to ensure that CRAN checks don't yuse more than 2 CPUs
1 parent a068675 commit 1c040b6

11 files changed

+31
-4
lines changed

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# r2dii.analysis 0.3.0
22

3-
# `target_sda` now uses final year of scenario as convergence target when `by_company = TRUE` (#445).
4-
# `target_market_share` gains argument `increasing_or_decreasing` (#426).
3+
* `target_sda` now uses final year of scenario as convergence target when `by_company = TRUE` (#445).
4+
* `target_market_share` gains argument `increasing_or_decreasing` (#426).
55

66
# r2dii.analysis 0.2.1
77

R/join_ald_scenario.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#' @export
1212
#'
1313
#' @examples
14+
#' \dontrun{
1415
#' installed <- requireNamespace("r2dii.data", quietly = TRUE) &&
1516
#' requireNamespace("r2dii.match", quietly = TRUE) &&
1617
#' packageVersion("r2dii.match") >= "0.1.0"
@@ -38,6 +39,7 @@
3839
#' region_isos = region_isos_demo
3940
#' )
4041
#' }
42+
#' }
4143
join_ald_scenario <- function(data,
4244
ald,
4345
scenario,

R/r2dii.analysis-package.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#' @keywords internal
22
"_PACKAGE"
33

4+
.onLoad <- function(libname, pkgname) {
5+
# CRAN OMP THREAD LIMIT
6+
# logic for setting OMP_THREAD_LIMIT form https://stackoverflow.com/a/77323812
7+
# check modified from testthat's on_cran function
8+
if (!interactive() && isFALSE(as.logical(Sys.getenv("NOT_CRAN", "false")))) {
9+
Sys.setenv("OMP_THREAD_LIMIT" = 2)
10+
}
11+
}
12+
413
# The following block is used by usethis to automatically manage
514
# roxygen namespace tags. Modify with care!
615
## usethis namespace: start

R/summarize_weighted_production.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#' `summarize_weighted_percent_change()`, respectively.
2828
#'
2929
#' @examples
30+
#' \dontrun{
3031
#' installed <- requireNamespace("r2dii.data", quietly = TRUE) &&
3132
#' requireNamespace("r2dii.match", quietly = TRUE) &&
3233
#' packageVersion("r2dii.match") >= "0.1.0"
@@ -55,6 +56,7 @@
5556
#'
5657
#' summarize_weighted_percent_change(master, use_credit_limit = TRUE)
5758
#' }
59+
#' }
5860
summarize_weighted_production <- function(data, ..., use_credit_limit = FALSE) {
5961
summarize_weighted_production_(data, ..., use_credit_limit = use_credit_limit, with_targets = FALSE)
6062
}

R/target_market_share.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#' @family functions to calculate scenario targets
3434
#'
3535
#' @examples
36+
#' \dontrun{
3637
#' installed <- requireNamespace("r2dii.data", quietly = TRUE) &&
3738
#' requireNamespace("r2dii.match", quietly = TRUE) &&
3839
#' packageVersion("r2dii.match") >= "0.1.0"
@@ -74,6 +75,7 @@
7475
#' weight_production = FALSE
7576
#' )
7677
#' }
78+
#' }
7779
target_market_share <- function(data,
7880
abcd,
7981
scenario,

R/target_sda.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#' @family functions to calculate scenario targets
3434
#'
3535
#' @examples
36+
#' \dontrun{
3637
#' installed <- requireNamespace("r2dii.match", quietly = TRUE) &&
3738
#' requireNamespace("r2dii.data", quietly = TRUE) &&
3839
#' packageVersion("r2dii.match") >= "0.1.0"
@@ -65,7 +66,7 @@
6566
#' by_company = TRUE
6667
#' )
6768
#' }
68-
#'
69+
#' }
6970
target_sda <- function(data,
7071
abcd,
7172
co2_intensity_scenario,

inst/WORDLIST

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Codecov
66
Decarbonization
77
IKI
88
Lifecycle
9+
Metaprogramming
910
ORCID
1011
PACTA
1112
PACTA’
@@ -14,13 +15,15 @@ SDA
1415
Sectoral
1516
WRI
1617
WWF
18+
abcd
1719
ald
1820
decarbonization
1921
dev
2022
dfrac
2123
dii
2224
dplyr
2325
eval
26+
favour
2427
frac
2528
funder
2629
funders
@@ -34,6 +37,7 @@ roadmaps
3437
rstudio
3538
sectoral
3639
smsp
40+
summarise
3741
tibble
3842
tidyverse
3943
tmsr

man/join_ald_scenario.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/summarize_weighted_production.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/target_market_share.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)