From abe070c16f383b6fd740db6ea053306881c0e0f9 Mon Sep 17 00:00:00 2001 From: Jackson Hoffart Date: Tue, 30 Jan 2024 10:22:43 +0100 Subject: [PATCH] update knit and modernize the README --- README.Rmd | 5 +-- README.md | 116 ++++++++++++++++++++++++++--------------------------- 2 files changed, 59 insertions(+), 62 deletions(-) diff --git a/README.Rmd b/README.Rmd index 2defc0c9..034d39a3 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,7 +17,6 @@ knitr::opts_chunk$set( [![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html) [![CRAN status](https://www.r-pkg.org/badges/version/r2dii.analysis)](https://CRAN.R-project.org/package=r2dii.analysis) -[![Codecov test coverage](https://codecov.io/gh/rmi-pacta/r2dii.analysis/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rmi-pacta/r2dii.analysis?branch=main) [![Codecov test coverage](https://codecov.io/gh/RMI-PACTA/r2dii.analysis/branch/main/graph/badge.svg)](https://app.codecov.io/gh/RMI-PACTA/r2dii.analysis?branch=main) [![R-CMD-check](https://github.com/RMI-PACTA/r2dii.analysis/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RMI-PACTA/r2dii.analysis/actions/workflows/R-CMD-check.yaml) @@ -41,8 +40,8 @@ install.packages("r2dii.analysis") Or install the development version of r2dii.analysis from GitHub with: ```r -# install.packages("devtools") -devtools::install_github("RMI-PACTA/r2dii.analysis") +# install.packages("pak") +pak::pak("RMI-PACTA/r2dii.analysis") ``` ## Example diff --git a/README.md b/README.md index c604a263..08f81f54 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lif [![CRAN status](https://www.r-pkg.org/badges/version/r2dii.analysis)](https://CRAN.R-project.org/package=r2dii.analysis) [![Codecov test -coverage](https://codecov.io/gh/rmi-pacta/r2dii.analysis/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rmi-pacta/r2dii.analysis?branch=main) -[![Codecov test coverage](https://codecov.io/gh/RMI-PACTA/r2dii.analysis/branch/main/graph/badge.svg)](https://app.codecov.io/gh/RMI-PACTA/r2dii.analysis?branch=main) [![R-CMD-check](https://github.com/RMI-PACTA/r2dii.analysis/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RMI-PACTA/r2dii.analysis/actions/workflows/R-CMD-check.yaml) @@ -35,8 +33,8 @@ install.packages("r2dii.analysis") Or install the development version of r2dii.analysis from GitHub with: ``` r -# install.packages("devtools") -devtools::install_github("RMI-PACTA/r2dii.analysis") +# install.packages("pak") +pak::pak("RMI-PACTA/r2dii.analysis") ``` ## Example @@ -73,20 +71,20 @@ matched %>% region_isos = region_isos_demo ) #> Warning: Removing rows in abcd where `emission_factor` is NA -#> # A tibble: 96 × 6 +#> # A tibble: 220 × 6 #> sector year region scenario_source emission_factor_metric #> -#> 1 steel 2021 advanced economies demo_2020 projected -#> 2 steel 2021 global demo_2020 projected -#> 3 steel 2022 advanced economies demo_2020 projected -#> 4 steel 2022 global demo_2020 projected -#> 5 steel 2024 advanced economies demo_2020 projected -#> 6 steel 2024 global demo_2020 projected -#> 7 steel 2025 advanced economies demo_2020 projected -#> 8 steel 2025 global demo_2020 projected -#> 9 steel 2027 advanced economies demo_2020 projected -#> 10 steel 2027 global demo_2020 projected -#> # ℹ 86 more rows +#> 1 cement 2020 advanced economies demo_2020 projected +#> 2 cement 2020 developing asia demo_2020 projected +#> 3 cement 2020 global demo_2020 projected +#> 4 cement 2021 advanced economies demo_2020 projected +#> 5 cement 2021 developing asia demo_2020 projected +#> 6 cement 2021 global demo_2020 projected +#> 7 cement 2022 advanced economies demo_2020 projected +#> 8 cement 2022 developing asia demo_2020 projected +#> 9 cement 2022 global demo_2020 projected +#> 10 cement 2023 advanced economies demo_2020 projected +#> # ℹ 210 more rows #> # ℹ 1 more variable: emission_factor_value ``` @@ -100,20 +98,20 @@ matched %>% scenario = scenario_demo_2020, region_isos = region_isos_demo ) -#> # A tibble: 1,232 × 10 +#> # A tibble: 792 × 10 #> sector technology year region scenario_source metric production -#> -#> 1 automotive electric 2020 global demo_2020 projected 3664. -#> 2 automotive electric 2020 global demo_2020 target_cps 3664. -#> 3 automotive electric 2020 global demo_2020 target_sds 3664. -#> 4 automotive electric 2020 global demo_2020 target_sps 3664. -#> 5 automotive electric 2021 global demo_2020 projected 8472. -#> 6 automotive electric 2021 global demo_2020 target_cps 3845. -#> 7 automotive electric 2021 global demo_2020 target_sds 4766. -#> 8 automotive electric 2021 global demo_2020 target_sps 3894. -#> 9 automotive electric 2022 global demo_2020 projected 8436. -#> 10 automotive electric 2022 global demo_2020 target_cps 4023. -#> # ℹ 1,222 more rows +#> +#> 1 automotive electric 2020 global demo_2020 projected 324592. +#> 2 automotive electric 2020 global demo_2020 target_cps 324592. +#> 3 automotive electric 2020 global demo_2020 target_sds 324592. +#> 4 automotive electric 2020 global demo_2020 target_sps 324592. +#> 5 automotive electric 2021 global demo_2020 projected 339656. +#> 6 automotive electric 2021 global demo_2020 target_cps 329191. +#> 7 automotive electric 2021 global demo_2020 target_sds 352505. +#> 8 automotive electric 2021 global demo_2020 target_sps 330435. +#> 9 automotive electric 2022 global demo_2020 projected 354720. +#> 10 automotive electric 2022 global demo_2020 target_cps 333693. +#> # ℹ 782 more rows #> # ℹ 3 more variables: technology_share , scope , #> # percentage_of_initial_production_by_scope ``` @@ -132,20 +130,20 @@ matched %>% #> This will result in company-level results, weighted by the portfolio #> loan size, which is rarely useful. Did you mean to set one of these #> arguments to `FALSE`? -#> # A tibble: 3,200 × 11 +#> # A tibble: 12,140 × 11 #> sector technology year region scenario_source name_abcd metric production -#> -#> 1 automoti… electric 2020 global demo_2020 large au… proje… 713. -#> 2 automoti… electric 2020 global demo_2020 large au… targe… 713. -#> 3 automoti… electric 2020 global demo_2020 large au… targe… 713. -#> 4 automoti… electric 2020 global demo_2020 large au… targe… 713. -#> 5 automoti… electric 2020 global demo_2020 large au… proje… 535. -#> 6 automoti… electric 2020 global demo_2020 large au… targe… 535. -#> 7 automoti… electric 2020 global demo_2020 large au… targe… 535. -#> 8 automoti… electric 2020 global demo_2020 large au… targe… 535. -#> 9 automoti… electric 2020 global demo_2020 large au… proje… 690. -#> 10 automoti… electric 2020 global demo_2020 large au… targe… 690. -#> # ℹ 3,190 more rows +#> +#> 1 automoti… electric 2020 global demo_2020 Bernardi… proje… 324592. +#> 2 automoti… electric 2020 global demo_2020 Bernardi… targe… 324592. +#> 3 automoti… electric 2020 global demo_2020 Bernardi… targe… 324592. +#> 4 automoti… electric 2020 global demo_2020 Bernardi… targe… 324592. +#> 5 automoti… electric 2021 global demo_2020 Bernardi… proje… 339656. +#> 6 automoti… electric 2021 global demo_2020 Bernardi… targe… 329191. +#> 7 automoti… electric 2021 global demo_2020 Bernardi… targe… 352505. +#> 8 automoti… electric 2021 global demo_2020 Bernardi… targe… 330435. +#> 9 automoti… electric 2022 global demo_2020 Bernardi… proje… 354720. +#> 10 automoti… electric 2022 global demo_2020 Bernardi… targe… 333693. +#> # ℹ 12,130 more rows #> # ℹ 3 more variables: technology_share , scope , #> # percentage_of_initial_production_by_scope ``` @@ -174,9 +172,9 @@ loanbook_joined_to_abcd_scenario <- matched %>% # portfolio level loanbook_joined_to_abcd_scenario %>% summarize_weighted_production(scenario, tmsr, smsp, region) -#> # A tibble: 558 × 9 +#> # A tibble: 306 × 9 #> sector_abcd technology year scenario tmsr smsp region -#> +#> #> 1 automotive electric 2020 cps 1 0 global #> 2 automotive electric 2020 sds 1 0 global #> 3 automotive electric 2020 sps 1 0 global @@ -187,27 +185,27 @@ loanbook_joined_to_abcd_scenario %>% #> 8 automotive electric 2022 sds 1.32 0.0131 global #> 9 automotive electric 2022 sps 1.29 0.00273 global #> 10 automotive electric 2023 cps 1.35 0.00316 global -#> # ℹ 548 more rows +#> # ℹ 296 more rows #> # ℹ 2 more variables: weighted_production , #> # weighted_technology_share # company level loanbook_joined_to_abcd_scenario %>% summarize_weighted_production(scenario, tmsr, smsp, region, name_abcd) -#> # A tibble: 1,953 × 10 -#> sector_abcd technology year scenario tmsr smsp region name_abcd -#> -#> 1 automotive electric 2020 cps 1 0 global large automotive co… -#> 2 automotive electric 2020 cps 1 0 global large automotive co… -#> 3 automotive electric 2020 cps 1 0 global large automotive co… -#> 4 automotive electric 2020 cps 1 0 global large hdv company t… -#> 5 automotive electric 2020 sds 1 0 global large automotive co… -#> 6 automotive electric 2020 sds 1 0 global large automotive co… -#> 7 automotive electric 2020 sds 1 0 global large automotive co… -#> 8 automotive electric 2020 sds 1 0 global large hdv company t… -#> 9 automotive electric 2020 sps 1 0 global large automotive co… -#> 10 automotive electric 2020 sps 1 0 global large automotive co… -#> # ℹ 1,943 more rows +#> # A tibble: 4,005 × 10 +#> sector_abcd technology year scenario tmsr smsp region name_abcd +#> +#> 1 automotive electric 2020 cps 1 0 global Bernardi, Bernard… +#> 2 automotive electric 2020 sds 1 0 global Bernardi, Bernard… +#> 3 automotive electric 2020 sps 1 0 global Bernardi, Bernard… +#> 4 automotive electric 2021 cps 1.12 0.00108 global Bernardi, Bernard… +#> 5 automotive electric 2021 sds 1.16 0.00653 global Bernardi, Bernard… +#> 6 automotive electric 2021 sps 1.14 0.00137 global Bernardi, Bernard… +#> 7 automotive electric 2022 cps 1.24 0.00213 global Bernardi, Bernard… +#> 8 automotive electric 2022 sds 1.32 0.0131 global Bernardi, Bernard… +#> 9 automotive electric 2022 sps 1.29 0.00273 global Bernardi, Bernard… +#> 10 automotive electric 2023 cps 1.35 0.00316 global Bernardi, Bernard… +#> # ℹ 3,995 more rows #> # ℹ 2 more variables: weighted_production , #> # weighted_technology_share ```