Skip to content

Commit 5f89c55

Browse files
authored
add outputs data dictionary (#576)
2 parents 2600736 + 5cd6ab9 commit 5f89c55

14 files changed

+126
-3
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
^pkgdown$
1414
^r2dii\.plot\.Rproj$
1515
^vignettes/r2dii-plot\.Rmd$
16+
^data-raw$

DESCRIPTION

Lines changed: 2 additions & 2 deletions
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.4.0.9004
3+
Version: 0.4.0.9006
44
Authors@R:
55
c(person(given = "Monika",
66
family = "Furdyna",
@@ -32,7 +32,7 @@ URL: https://github.com/RMI-PACTA/r2dii.plot,
3232
https://rmi-pacta.github.io/r2dii.plot/
3333
BugReports: https://github.com/RMI-PACTA/r2dii.plot/issues
3434
Depends:
35-
R (>= 3.4)
35+
R (>= 3.5)
3636
Imports:
3737
dplyr,
3838
ggplot2,

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# r2dii.plot (development version)
22

3+
* `data_dictionary` dataset added to define the columns in each dataset used or exported by the functions in this package
4+
35
# r2dii.plot 0.4.0
46

57
## Breaking changes

R/data_dictionary.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#' Data Dictionary
2+
#'
3+
#' A table of column names and descriptions of data frames used or exported by
4+
#' the functions in this package.
5+
#'
6+
#' @family data dictionary
7+
#'
8+
#' @format ## `data_dictionary`
9+
#' \describe{
10+
#' \item{dataset}{Name of the dataset}
11+
#' \item{column}{Name of the column}
12+
#' \item{typeof}{Type of the column}
13+
#' \item{definition}{Definition of the column}
14+
#' }
15+
#'
16+
#' @examples
17+
#' data_dictionary
18+
19+
"data_dictionary"

_pkgdown.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ reference:
4848
contents: to_title
4949
- title: Datasets
5050
contents: has_concept("datasets")
51-
51+
- title: Data dictionary
52+
contents: has_concept("data dictionary")

data-raw/build_data_dictionary.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
library(readr)
2+
library(usethis)
3+
4+
paths <- list.files("data-raw/data_dictionary", full.names = TRUE)
5+
6+
out <- readr::read_csv(file = paths, show_col_types = FALSE)
7+
data_dictionary <- out[order(out$dataset, out$column), , drop = FALSE]
8+
9+
usethis::use_data(data_dictionary, overwrite = TRUE)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dataset,column,typeof,definition
2+
prep_emission_intensity_output,sector,character,The sector of the technology
3+
prep_emission_intensity_output,year,double,The year of the data
4+
prep_emission_intensity_output,region,character,The region for which the analysis has been run. Indicates which production assets have been considered and which scenario region is used
5+
prep_emission_intensity_output,scenario_source,character,The publication the scenario data is based on
6+
prep_emission_intensity_output,emission_factor_metric,character,"Indicates if the emission intensity related values refer to the projected activities of the underlying counterparty, to the economy wide benchmark, or to allocated levels of activity based on the scenarios"
7+
prep_emission_intensity_output,emission_factor_value,double,The physical emission intensity level of the given 'emission_factor_metric'
8+
prep_emission_intensity_output,label,character,"Same as 'emission_factor_metric', formatted for display in plot"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
dataset,column,typeof,definition
2+
prep_techmix_output,sector,character,The sector of the technology
3+
prep_techmix_output,technology,character,The technology
4+
prep_techmix_output,year,integer,The year of the data
5+
prep_techmix_output,region,character,The region for which the analysis has been run. Indicates which production assets have been considered and which scenario region is used
6+
prep_techmix_output,scenario_source,character,The publication the scenario data is based on
7+
prep_techmix_output,metric,character,"Indicates if the production-related values refer to the projected activities of the underlying counterparty, to the economy wide benchmark, or to allocated levels of activity based on the scenarios"
8+
prep_techmix_output,production,double,"The production level of the given 'metric'"
9+
prep_techmix_output,technology_share,double,"The share of the given 'technology' relative to all technologies of the corresponding 'sector' in terms of 'production', for the given combination of 'group_id', 'region', 'year' and 'metric'"
10+
prep_techmix_output,scope,character,"Indicates if the targets for the given technology have been calculated based on the TMSR (technology) or the SMSP (sector). High-carbon technologies that need to decrease have their targets calculated on the technology level, whereas low-carbon technologies that need to increase have them calculated on the sector level"
11+
prep_techmix_output,percentage_of_initial_production_by_scope,double,Relative change compared to the start value (by scope). Used for displaying the change in activity over time on a common scale
12+
prep_techmix_output,label,character,"Same as 'metric', formatted for display in plot"
13+
prep_techmix_output,label_tech,character,"Same as 'technology', formatted for display in plot"
14+
prep_techmix_output,value,double,"Same as 'technology_share', formatted for display in plot"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
dataset,column,typeof,definition
2+
prep_trajectory_output,sector,character,The sector of the technology
3+
prep_trajectory_output,technology,character,The technology
4+
prep_trajectory_output,year,integer,The year of the data
5+
prep_trajectory_output,region,character,The region for which the analysis has been run. Indicates which production assets have been considered and which scenario region is used
6+
prep_trajectory_output,scenario_source,character,The publication the scenario data is based on
7+
prep_trajectory_output,metric,character,"Indicates if the production-related values refer to the projected activities of the underlying counterparty, to the economy wide benchmark, or to allocated levels of activity based on the scenarios"
8+
prep_trajectory_output,production,double,"The production level of the given 'metric'"
9+
prep_trajectory_output,technology_share,double,"The share of the given 'technology' relative to all technologies of the corresponding 'sector' in terms of 'production', for the given combination of 'group_id', 'region', 'year' and 'metric'"
10+
prep_trajectory_output,scope,character,"Indicates if the targets for the given technology have been calculated based on the TMSR (technology) or the SMSP (sector). High-carbon technologies that need to decrease have their targets calculated on the technology level, whereas low-carbon technologies that need to increase have them calculated on the sector level"
11+
prep_trajectory_output,percentage_of_initial_production_by_scope,double,Relative change compared to the start value (by scope). Used for displaying the change in activity over time on a common scale
12+
prep_trajectory_output,label,character,"Same as 'metric', formatted for display in plot"
13+
prep_trajectory_output,value,double,"Same as 'percentage_of_initial_production_by_scope', for display in plot"

data/data_dictionary.rda

511 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)