Skip to content

Commit 214de7a

Browse files
authored
replace Roxygen template with inline function (#611)
1 parent 630a5f6 commit 214de7a

File tree

10 files changed

+18
-28
lines changed

10 files changed

+18
-28
lines changed

.Rbuildignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
^cran-comments\.md$
1010
^data-raw/.*$
1111
^docs$
12-
^man-roxygen$
1312
^pkgdown$
1413
^r2dii\.plot\.Rproj$
1514
^vignettes/r2dii-plot\.Rmd$

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: r2dii.plot
22
Title: Visualize the Climate Scenario Alignment of a Financial Portfolio
3-
Version: 0.5.1.9005
3+
Version: 0.5.1.9006
44
Authors@R:
55
c(person(given = "Monika",
66
family = "Furdyna",

R/prep_emission_intensity.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
#' * The structure must be like [sda_demo].
55
#' * The column `sector` must have a single value (e.g. "cement").
66
#' * (Optional) If present, the column `label` is used for data labels.
7-
#' @template convert_label
8-
#' @templateVar fun qplot_emission_intensity
9-
#' @templateVar value to_title
7+
#' @param convert_label `r convert_label_docs("qplot_emission_intensity", "to_title")`
108
#' @param span_5yr Logical. Use `TRUE` to restrict the time span to 5 years from
119
#' the start year (the default behavior of `qplot_emission_intensity()`), or use
1210
#' `FALSE` to impose no restriction.

R/prep_techmix.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#' * (Optional) If present, the column `label` is used for data labels.
1010
#' * (Optional) If present, the column `label_tech` is used for technology
1111
#' labels.
12-
#' @template convert_label
13-
#' @templateVar fun qplot_techmix
14-
#' @templateVar value recode_metric_techmix
12+
#' @param convert_label `r convert_label_docs("qplot_techmix", "recode_metric_techmix")`
1513
#' @param span_5yr Logical. Use `TRUE` to restrict the time span to 5 years from
1614
#' the start year (the default behavior of `qplot_techmix()`), or use
1715
#' `FALSE` to impose no restriction.

R/prep_trajectory.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
#' * The following columns must have a single value: `sector`, `technology`,
66
#' `region`, `scenario_source`.
77
#' * (Optional) If present, the column `label` is used for data labels.
8-
#' @template convert_label
9-
#' @templateVar fun qplot_trajectory
10-
#' @templateVar value recode_metric_trajectory
8+
#' @param convert_label `r convert_label_docs("qplot_trajectory", "recode_metric_trajectory")`
119
#' @param span_5yr Logical. Use `TRUE` to restrict the time span to 5 years from
1210
#' the start year (the default behavior of `qplot_trajectory()`), or use
1311
#' `FALSE` to impose no restriction.

R/utils-docs.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
convert_label_docs <- function(func, default_val) {
2+
glue::glue(
3+
"A symbol. The unquoted name of a function to apply to y-axis labels. For example:",
4+
" * To convert labels to uppercase use `convert_label = toupper`.",
5+
" * To get the default behavior of `{func}` use `convert_label = {default_val}`.",
6+
.sep = "\n"
7+
)
8+
}

man-roxygen/convert_label.R

Lines changed: 0 additions & 5 deletions
This file was deleted.

man/prep_emission_intensity.Rd

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

man/prep_techmix.Rd

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

man/prep_trajectory.Rd

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

0 commit comments

Comments
 (0)