diff --git a/DESCRIPTION b/DESCRIPTION index b377626b..82e0d12a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,7 +34,8 @@ Imports: stringr, tibble, tidyr, - tidytext + tidytext, + utils Suggests: testthat (>= 3.0.0) Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index 30c0b21d..6fbad435 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -58,3 +58,4 @@ importFrom(tibble,tibble) importFrom(tidyr,pivot_wider) importFrom(tidytext,reorder_within) importFrom(tidytext,scale_x_reordered) +importFrom(utils,head) diff --git a/R/pacta.executive.summary-package.R b/R/pacta.executive.summary-package.R index c81ee1cb..18ebd3f8 100644 --- a/R/pacta.executive.summary-package.R +++ b/R/pacta.executive.summary-package.R @@ -25,5 +25,6 @@ #' @importFrom tidyr pivot_wider #' @importFrom tidytext reorder_within #' @importFrom tidytext scale_x_reordered +#' @importFrom utils head ## usethis namespace: end NULL diff --git a/R/plot_exposures_survey.R b/R/plot_exposures_survey.R index 64552fc2..b36ea348 100644 --- a/R/plot_exposures_survey.R +++ b/R/plot_exposures_survey.R @@ -15,7 +15,7 @@ #' #' @examples #' data <- toy_data_exposures_survey %>% -#' dplyr::filter(asset_class == "equity", sector == "coal") +#' dplyr::filter(asset_class == "equity", technology == "coal") #' #' plot_exposures_survey(data) plot_exposures_survey <- function(data) { @@ -34,14 +34,14 @@ plot_exposures_survey <- function(data) { aes( x = .data$entity, y = .data$exposure_perc_aum, - fill = .data$sector, + fill = .data$technology, alpha = .data$entity ) ) + geom_bar(stat = "identity") + scale_x_discrete(labels = r2dii.plot::to_title) + scale_y_continuous(expand = expansion(mult = c(0, .1)), labels = scales::percent) + - r2dii.colours::scale_fill_2dii(palette = "pacta", colour_groups = data$sector) + + r2dii.colours::scale_fill_2dii(palette = "pacta", colour_groups = data$technology) + scale_alpha_discrete(range = c(1, 0.7)) + theme_2dii(base_size = 14) + theme( @@ -59,14 +59,14 @@ check_data_exposures_survey <- function(data, env) { stopifnot(is.data.frame(data)) abort_if_missing_names( data, - c("asset_class", "entity", "sector", "exposure_perc_aum") + c("asset_class", "entity", "technology", "exposure_perc_aum") ) abort_if_multiple(data, "asset_class", env) abort_if_invalid_values(data, "entity", c("portfolio", "peers")) abort_if_invalid_values( data, - "sector", - c("coal", "oil_and_gas") + "technology", + c("coal", "oil", "gas") ) stopifnot(is.numeric(data$exposure_perc_aum)) stopifnot((data$exposure_perc_aum <= 1) & (data$exposure_perc_aum >= 0)) diff --git a/R/prep_exposures_survey.R b/R/prep_exposures_survey.R index d951603e..59ee5393 100644 --- a/R/prep_exposures_survey.R +++ b/R/prep_exposures_survey.R @@ -10,8 +10,8 @@ #' @param peers_results_aggregated Data frame that contains pre-wrangled #' aggregate peer group level PACTA results from a PACTA for investors #' analysis. -#' @param sector Character. Must be of length 1 and either `coal` or -#' `oil_and_gas`. +#' @param technology Character. Must be of length 1 and either `coal` or +#' `oil` or `gas`. #' @param asset_class Character. Must be of length 1 and either `equity` or #' `bonds`. #' @@ -19,22 +19,22 @@ #' @export prep_exposures_survey <- function(results_portfolio, peers_results_aggregated, - sector = c("coal", "oil_and_gas"), + technology = c("coal", "oil", "gas"), asset_class = c("equity", "bonds")) { if (is.null(results_portfolio)) { data_out <- use_toy_data("exposures_survey") %>% filter( .data$asset_class == .env$asset_class, - .data$sector == .env$sector + .data$technology == .env$technology ) } else { # validate inputs - sector <- match.arg(sector) + sector <- match.arg(technology) asset_class <- match.arg(asset_class) check_data_prep_exposures_survey( asset_class = asset_class, - sector = sector + technology = technology ) # available portfolio asset classes @@ -44,13 +44,15 @@ prep_exposures_survey <- function(results_portfolio, start_year <- min(results_portfolio$year, na.rm = TRUE) # pick scenario for filtering (no impact on current exposure) - scenario_filter <- "1.5C-Unif" + scenario_filter <- results_portfolio %>% + pull(.data$scenario) %>% + head(1) # combine input data data <- results_portfolio %>% dplyr::bind_rows(peers_results_aggregated) - # keep only asset_class avilable in portfolio + # keep only asset_class available in portfolio data <- data %>% dplyr::filter(.data$asset_class %in% available_asset_classes) @@ -68,18 +70,18 @@ prep_exposures_survey <- function(results_portfolio, data_out <- data %>% dplyr::filter( .data$asset_class == .env$asset_class, - .data$sector == .env$sector + .data$technology == .env$technology ) } data_out } check_data_prep_exposures_survey <- function(asset_class, - sector) { + technology) { if (length(asset_class) != 1) { stop("Argument asset_class must be of length 1. Please check your input.") } - if (length(sector) != 1) { + if (length(technology) != 1) { stop("Argument sector must be of length 1. Please check your input.") } } @@ -95,12 +97,11 @@ wrangle_data_exposures_survey <- function(data) { technology = .data$technology_p4b, entity = replace(.data$entity, .data$entity == "this_portfolio", "portfolio") ) %>% - dplyr::select(c("asset_class", "entity", "ald_sector", "plan_carsten")) %>% + dplyr::select(c("asset_class", "entity", "technology", "plan_carsten")) %>% dplyr::rename( - sector = "ald_sector", exposure_perc_aum = "plan_carsten" ) %>% - dplyr::group_by(.data$asset_class, .data$entity, .data$sector) %>% + dplyr::group_by(.data$asset_class, .data$entity, .data$technology) %>% dplyr::summarise( exposure_perc_aum = sum(.data$exposure_perc_aum, na.rm = TRUE), .groups = "drop" diff --git a/R/render_executive_summary.R b/R/render_executive_summary.R index 5b3d2670..1d06b43a 100644 --- a/R/render_executive_summary.R +++ b/R/render_executive_summary.R @@ -5,8 +5,6 @@ #' @param output_dir Character single, valid filepath to a directory where the output will be saved #' @param exec_summary_dir Character single, valid filepath to a directory that contains the template, e.g. `system.file("extdata", "PA2022CH_en_exec_summary", package = "pacta.executive.summary")` #' @param survey_dir Character single, valid filepath to a directory that contains the survey files for the user -#' @param real_estate_dir Character single, valid filepath to a directory that contains real estate files for the user -#' @param real_estate_flag Logical single, whether or not to render the real estate section #' @param score_card_dir Character single, valid filepath to a directory that contains score card files for the user #' @param file_name Character single, valid filename of the Rmd template file, e.g. "template.Rmd" #' @param investor_name Character single string specifying the investor name diff --git a/data-raw/toy_data_exposures_survey.R b/data-raw/toy_data_exposures_survey.R index e308e8be..d378846b 100644 --- a/data-raw/toy_data_exposures_survey.R +++ b/data-raw/toy_data_exposures_survey.R @@ -1,14 +1,18 @@ # styler: off toy_data_exposures_survey <- tibble::tribble( -~asset_class, ~entity, ~sector, ~exposure_perc_aum, + ~asset_class, ~entity, ~technology, ~exposure_perc_aum, "equity", "portfolio", "coal", 0.01, "equity", "peers", "coal", 0.02, - "equity", "portfolio", "oil_and_gas", 0.03, - "equity", "peers", "oil_and_gas", 0.02, + "equity", "portfolio", "oil", 0.03, + "equity", "peers", "oil", 0.02, + "equity", "portfolio", "gas", 0.05, + "equity", "peers", "gas", 0.04, "bonds", "portfolio", "coal", 0.03, "bonds", "peers", "coal", 0.01, - "bonds", "portfolio", "oil_and_gas", 0.1, - "bonds", "peers", "oil_and_gas", 0.2 + "bonds", "portfolio", "oil", 0.015, + "bonds", "peers", "oil", 0.025, + "bonds", "portfolio", "gas", 0.03, + "bonds", "peers", "gas", 0.25 ) # styler: on diff --git a/data/toy_data_exposures_survey.rda b/data/toy_data_exposures_survey.rda index 94a8f0fb..61ae916b 100644 Binary files a/data/toy_data_exposures_survey.rda and b/data/toy_data_exposures_survey.rda differ diff --git a/inst/extdata/PA2024CH_de_exec_summary/survey-chapter.Rmd b/inst/extdata/PA2024CH_de_exec_summary/survey-chapter.Rmd index 9fa2b39b..217e5c3c 100644 --- a/inst/extdata/PA2024CH_de_exec_summary/survey-chapter.Rmd +++ b/inst/extdata/PA2024CH_de_exec_summary/survey-chapter.Rmd @@ -4,7 +4,7 @@ \section{Umfrage zu Klimamassnahmen} -Dieser Abschnitt bietet Einblicke in die Wirksamkeit von Klimamassnahmen auf institutioneller Ebene. Die Ergebnisse basieren auf der ergänzenden qualitativen Umfrage zu Klimamassnahmen. Die Umfrageergebnisse werden mit den Ergebnissen der Peers und den quantitativen Ergebnissen dieses Portfolios verglichen. Bitte beachten Sie, dass die Antworten der Umfrageteilnehmenden auf eigenen Angaben beruhen und nicht von 2DII, RMI und WP überprüft wurden. +Dieser Abschnitt bietet Einblicke in die Wirksamkeit von Klimamassnahmen auf institutioneller Ebene. Die Ergebnisse basieren auf der ergänzenden qualitativen Umfrage zu Klimamassnahmen. Die Umfrageergebnisse werden mit den Ergebnissen der Peers und den quantitativen Ergebnissen dieses Portfolios verglichen. Bitte beachten Sie, dass die Antworten der Umfrageteilnehmenden auf eigenen Angaben beruhen und nicht von RMI überprüft wurden. \fbox{\begin{minipage}{\textwidth} \textbf{Erläuterungen zu den unten dargestellten Zielscheibendiagrammen:} Die Zielscheibendiagramme sind neue grafische Darstellungen, die Ihre klimarelevanten Massnahmen abbilden. Jeder Kreis steht für eine klimarelevante Massnahme und ist farblich gekennzeichnet, wenn die Massnahme umgesetzt wurde. Der Wirksamkeitsgrad der Massnahmen nimmt vom äusseren zum inneren Ring und mit der Farbintensität zu. Je mehr Kreise vom äusseren zum inneren Kreis farblich markiert sind, desto ambitionierter sind die Klimamassnahmen Ihrer Institution. Weitere Informationen zu den einzelnen in den Kreisen dargestellten Massnahmen finden Sie im Annex. @@ -20,7 +20,7 @@ Auf der linken Seite sehen Sie die Initiativen, an denen Sie beteiligt sind. Je ``` ```{r plots_overview_left, out.width="\\linewidth"} -knitr::include_graphics(file.path(survey_dir, language, "plot_wordcloud.png")) +knitr::include_graphics(file.path(survey_dir, language, "plot_layer_peers_net_zero.png")) ``` ```{=latex} @@ -31,7 +31,7 @@ knitr::include_graphics(file.path(survey_dir, language, "plot_wordcloud.png")) ```{r plots_overview_right, out.width="\\linewidth"} -knitr::include_graphics(file.path(survey_dir, language, "plot_layer_with_peer_info_climate_goals.png")) +knitr::include_graphics(file.path(survey_dir, language, "plot_layer_peers_transition_plan.png")) ``` ```{=latex} @@ -48,43 +48,29 @@ knitr::include_graphics(file.path(survey_dir, language, "plot_layer_with_peer_in Untersuchungen zeigen, dass Engagement eine der effektivsten Methoden zur Verbesserung der Klimaausrichtung von investierten Unternehmen ist. Die nachstehenden Zielscheibendiagramme zeigen Ihre Engagement-Massnahmen für drei klimarelevante Sektoren und ergänzen damit den vorherigen Abschnitt zur Klimaausrichtung. Daneben wird der Anteil der Peers angegeben, die Best Practices umsetzen, d. h. alle Ebenen abdecken. \begin{center} -\begin{minipage}{0.3\textwidth} +\begin{minipage}{0.4\textwidth} ``` ```{r plot_layer_with_peer_info_engagement_left, out.width="\\linewidth"} knitr::include_graphics( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Fossil_Fuels.png") +file.path(survey_dir, language, "plot_layer_engagement.png") ) ``` ```{=latex} \end{minipage}% -\begin{minipage}{0.3\textwidth} +\begin{minipage}{0.4\textwidth} ``` ```{r plot_layer_with_peer_info_engagement_center, out.width="\\linewidth"} knitr::include_graphics( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Power.png") +file.path(survey_dir, language, "plot_layer_voting.png") ) ``` ```{=latex} \end{minipage}% -\begin{minipage}{0.3\textwidth} -``` - - -```{r plot_layer_with_peer_info_engagement_right, out.width="\\linewidth"} -knitr::include_graphics(c( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Automotive.png") -)) -``` - -```{=latex} -\end{minipage}% - -Engagement und Peer-Vergleich je Sektor. Links: Fossile Brennstoffe, Mitte: Automobilindustrie, Rechts: Stromerzeugung. \end{center} @@ -98,102 +84,108 @@ In diesen Grafiken werden die gemeldeten Klimastrategien mit der Exposition gege ``` ```{r plot_exclusion_coal, fig.width=10, fig.height=3.5} -plot_bo_c_survey <- pacta.executive.summary::rasterGrob( +plot_exclusion_coal <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_coal_Corporate_bonds.png" + "plot_layer_exclusion_coal.png" ) ) ) data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "coal", + technology = "coal", asset_class = "bonds") plot_bo_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + + labs(subtitle = "Coal exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) -plot_eq_c_survey <- pacta.executive.summary::rasterGrob( +data_exposures_survey_e <- prep_exposures_survey(results_portfolio, + peers_results_aggregated, + technology = "coal", + asset_class = "equity") + +plot_eq_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Coal exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) + +patchwork::wrap_elements(plot_exclusion_coal) + patchwork::wrap_elements(plot_bo_c_exp) + + patchwork::wrap_elements(plot_eq_c_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) +``` + +```{r plot_exclusion_oil, fig.width=10, fig.height=3.5} + +plot_exclusion_oil <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_coal_Listed_equities.png" + "plot_layer_exclusion_oil.png" ) ) ) -data_exposures_survey_e <- prep_exposures_survey(results_portfolio, +data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "coal", - asset_class = "equity") + technology = "oil", + asset_class = "bonds") -plot_eq_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_bo_o_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + + labs(subtitle = "Oil exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) -patchwork::wrap_elements(plot_bo_c_survey) + patchwork::wrap_elements(plot_bo_c_exp) + - patchwork::wrap_elements(plot_eq_c_survey) + patchwork::wrap_elements(plot_eq_c_exp) + - patchwork::plot_layout(widths = c(1, 1.2, 1, 1.2)) -``` - -```{=latex} +data_exposures_survey_e <- prep_exposures_survey(results_portfolio, + peers_results_aggregated, + technology = "oil", + asset_class = "equity") -Ausschlussstrategien für Kohle, verglichen mit PACTA Exposition in Unternahmensanleihen (links) und Aktien (rechts). +plot_eq_o_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Oil exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) +patchwork::wrap_elements(plot_exclusion_oil) + patchwork::wrap_elements(plot_bo_o_exp) + + patchwork::wrap_elements(plot_eq_o_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) ``` - -```{r plot_exclusion_oil_gas, fig.width=10, fig.height=3.5} -plot_bo_og_survey <- pacta.executive.summary::rasterGrob( +```{r plot_exclusion_gas, fig.width=10, fig.height=3.5} +plot_exclusion_gas <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_oil_Corporate_bonds.png" + "plot_layer_exclusion_gas.png" ) ) ) data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "oil_and_gas", + technology = "gas", asset_class = "bonds") -plot_bo_og_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_bo_g_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + + labs(subtitle = "Gas exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1)) -plot_eq_og_survey <- pacta.executive.summary::rasterGrob( - pacta.executive.summary::readPNG( - file.path( - survey_dir, - language, - "plot_layer_asset_exclusion_oil_Listed_equities.png" - ) - ) -) - data_exposures_survey_e <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "oil_and_gas", + technology = "gas", asset_class = "equity") -plot_eq_og_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_eq_g_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Gas exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1)) -patchwork::wrap_elements(plot_bo_og_survey) + patchwork::wrap_elements(plot_bo_og_exp) + - patchwork::wrap_elements(plot_eq_og_survey) + patchwork::wrap_elements(plot_eq_og_exp) + - patchwork::plot_layout(widths = c(1, 1.2, 1, 1.2)) +patchwork::wrap_elements(plot_exclusion_gas) + patchwork::wrap_elements(plot_bo_g_exp) + + patchwork::wrap_elements(plot_eq_g_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) ``` -Ausschlussstrategien für Öl und Gas, verglichen mit PACTA Exposition in Unternahmensanleihen (links) und Aktien (rechts). - ```{=latex} \end{center} \end{esbox} diff --git a/inst/extdata/PA2024CH_en_exec_summary/survey-chapter.Rmd b/inst/extdata/PA2024CH_en_exec_summary/survey-chapter.Rmd index 404f709b..9470face 100644 --- a/inst/extdata/PA2024CH_en_exec_summary/survey-chapter.Rmd +++ b/inst/extdata/PA2024CH_en_exec_summary/survey-chapter.Rmd @@ -1,26 +1,24 @@ -TO BE REVIEWED FOR COP 2024 - ```{=latex} \section{Climate Action Survey} -This section provides insights in the effectiveness of climate actions on an institutional level. The results base on the complementary qualitative climate action survey. The survey results are compared to peers and the quantitative results of this portfolio. Please note that survey answers were self-reported and not verified by 2DII, RMI, and WP. +This section provides insights in the effectiveness of climate actions on an institutional level. The results base on the complementary qualitative climate action survey. The survey results are compared to peers and the quantitative results of this portfolio. Please note that survey answers were self-reported and not verified by RMI. \fbox{\begin{minipage}{\textwidth} -\textbf{Explanation on dart charts below:} The dart charts are a newly developed chart type that depicts your climate-relevant measures. Each circle represents one climate relevant measure and is colored in case the measure is in place. The level of effectiveness of the measures increases from the outer to the inner ring and with colour intensity. The more circles are filled from the outer to the inner circle, the more ambitious are your institution’s climate actions. For more information on the specific measures shown in the layers, please refer to the Annex. +\textbf{Explanation on dart charts below:} Dart charts are a newly developed chart type that depicts your climate-relevant measures. Each circle represents one climate relevant measure and is colored in case the measure is in place. The level of effectiveness of the measures increases from the outer to the inner ring and with colour intensity. The more circles are filled in, from the outer to the inner circle, the more ambitious are your institution’s climate actions. For more information on the specific measures shown in the layers, please refer to the Annex. \end{minipage} } -\begin{esbox}{Overview}[\engagementImage] +\begin{esbox}{Climate measures contributing to Swiss climate goals}[\engagementImage] -On the left hand side, you find the initiatives you are part of. The larger the font size, the more peers are part of it. In the middle, you see a dart chart indicating your climate strategy. On the right, you can see how many of your peers have all three climate strategies in place, which is considered as best practice. +With the adoption of the Climate and innovation law in June 2023, Switzerland has committed to the goal of achieving net zero emissions by 2050 at the latest. The following two dart charts illustrate the level of ambition you and your peers have with respect to contributing to the Swiss national climate goal of net zero emissions by 2050. We also look into measures surrounding a transition plan which supports achieving net zero emissions. The text besides a dart chart provides a comparison to the share of peers with best practice, i.e., the ones that have all layers filled. \begin{center} \begin{minipage}{0.4\textwidth} ``` ```{r plots_overview_left, out.width="\\linewidth"} -knitr::include_graphics(file.path(survey_dir, language, "plot_wordcloud.png")) +knitr::include_graphics(file.path(survey_dir, language, "plot_layer_peers_net_zero.png")) ``` ```{=latex} @@ -31,7 +29,7 @@ knitr::include_graphics(file.path(survey_dir, language, "plot_wordcloud.png")) ```{r plots_overview_right, out.width="\\linewidth"} -knitr::include_graphics(file.path(survey_dir, language, "plot_layer_with_peer_info_climate_goals.png")) +knitr::include_graphics(file.path(survey_dir, language, "plot_layer_peers_transition_plan.png")) ``` ```{=latex} @@ -39,161 +37,151 @@ knitr::include_graphics(file.path(survey_dir, language, "plot_layer_with_peer_in \end{minipage}% \end{center} -(Left) Initiatives you (dark blue) and your peers (light blue) are part of. (Right) Your climate strategy badge compared and peer comparison. - \end{esbox} -\begin{esbox}{Investee engagement per sector}[\engagementImage] +\begin{esbox}{Engagement strategies within listed equity}[\engagementImage] -Research shows that engagement is one of the most effective ways to improve climate goal alignment of companies invested through equity and bonds. Therefore, the engagement dart charts below show your engagement measures for three climate crucial sectors and thereby complement the previous alignment section. The text besides provides a comparison to the share of peers with best practice, i.e., the ones that have all layers covered. +Research shows that engagement is one of the most effective ways to improve climate goal alignment of companies one is invested in. The dart charts below show your engagement measures, either carried out bilaterally or via exercising voting rights. The charts assess to what extent, based on evidence, your engagement is following the practices which are the most effective in achieving improvements in the climate performance of investee companies and funds. \begin{center} -\begin{minipage}{0.3\textwidth} +\begin{minipage}{0.4\textwidth} ``` ```{r plot_layer_with_peer_info_engagement_left, out.width="\\linewidth"} knitr::include_graphics( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Fossil_Fuels.png") +file.path(survey_dir, language, "plot_layer_engagement.png") ) ``` ```{=latex} \end{minipage}% -\begin{minipage}{0.3\textwidth} +\begin{minipage}{0.4\textwidth} ``` ```{r plot_layer_with_peer_info_engagement_center, out.width="\\linewidth"} knitr::include_graphics( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Power.png") +file.path(survey_dir, language, "plot_layer_voting.png") ) ``` -```{=latex} -\end{minipage}% -\begin{minipage}{0.3\textwidth} -``` - - -```{r plot_layer_with_peer_info_engagement_right, out.width="\\linewidth"} -knitr::include_graphics(c( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Automotive.png") -)) -``` - ```{=latex} \end{minipage}% -Engagement badges and peer comparison per sector. Left: Fossil Fuels, Middle: Automotive, Right: Power. - \end{center} \end{esbox} -\begin{esbox}{Negative screening vs. fossil fuel PACTA exposure}[\engagementImage] +\begin{esbox}{Use of exclusion policies within bonds and equity vs. fossil fuel PACTA exposure}[\engagementImage] -These charts compare the reported climate-aligned strategies to the exposure to coal mining and oil \& gas extraction. If exclusion strategies are applied at an institutional level, it is expected that exposure in these technologies will be zero or very low compared to the total portfolios peers. +These charts compare the reported climate-aligned strategies to the exposure to coal mining and oil and gas extraction. If exclusion strategies are applied at an institutional level, it is expected that percentage exposure in these technologies will be zero or very low compared to the total percentage exposure of peers' portfolios. \begin{center} ``` ```{r plot_exclusion_coal, fig.width=10, fig.height=3.5} -plot_bo_c_survey <- pacta.executive.summary::rasterGrob( +plot_exclusion_coal <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_coal_Corporate_bonds.png" + "plot_layer_exclusion_coal.png" ) ) ) data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "coal", + technology = "coal", asset_class = "bonds") plot_bo_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + + labs(subtitle = "Coal exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) + +data_exposures_survey_e <- prep_exposures_survey(results_portfolio, + peers_results_aggregated, + technology = "coal", + asset_class = "equity") + +plot_eq_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Coal exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) -plot_eq_c_survey <- pacta.executive.summary::rasterGrob( +patchwork::wrap_elements(plot_exclusion_coal) + patchwork::wrap_elements(plot_bo_c_exp) + + patchwork::wrap_elements(plot_eq_c_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) +``` + +```{r plot_exclusion_oil, fig.width=10, fig.height=3.5} + +plot_exclusion_oil <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_coal_Listed_equities.png" + "plot_layer_exclusion_oil.png" ) ) ) -data_exposures_survey_e <- prep_exposures_survey(results_portfolio, +data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "coal", - asset_class = "equity") + technology = "oil", + asset_class = "bonds") -plot_eq_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_bo_o_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + + labs(subtitle = "Oil exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) -patchwork::wrap_elements(plot_bo_c_survey) + patchwork::wrap_elements(plot_bo_c_exp) + - patchwork::wrap_elements(plot_eq_c_survey) + patchwork::wrap_elements(plot_eq_c_exp) + - patchwork::plot_layout(widths = c(1, 1.2, 1, 1.2)) -``` - -```{=latex} +data_exposures_survey_e <- prep_exposures_survey(results_portfolio, + peers_results_aggregated, + technology = "oil", + asset_class = "equity") -Coal exclusion badges compared to PACTA exposure for Corporate bonds (Left) and Listed equity (Right). +plot_eq_o_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Oil exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) +patchwork::wrap_elements(plot_exclusion_oil) + patchwork::wrap_elements(plot_bo_o_exp) + + patchwork::wrap_elements(plot_eq_o_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) ``` - -```{r plot_exclusion_oil_gas, fig.width=10, fig.height=3.5} -plot_bo_og_survey <- pacta.executive.summary::rasterGrob( +```{r plot_exclusion_gas, fig.width=10, fig.height=3.5} +plot_exclusion_gas <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_oil_Corporate_bonds.png" + "plot_layer_exclusion_gas.png" ) ) ) data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "oil_and_gas", + technology = "gas", asset_class = "bonds") -plot_bo_og_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_bo_g_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + + labs(subtitle = "Gas exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1)) -plot_eq_og_survey <- pacta.executive.summary::rasterGrob( - pacta.executive.summary::readPNG( - file.path( - survey_dir, - language, - "plot_layer_asset_exclusion_oil_Listed_equities.png" - ) - ) -) - data_exposures_survey_e <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "oil_and_gas", + technology = "gas", asset_class = "equity") -plot_eq_og_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_eq_g_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Gas exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1)) -patchwork::wrap_elements(plot_bo_og_survey) + patchwork::wrap_elements(plot_bo_og_exp) + - patchwork::wrap_elements(plot_eq_og_survey) + patchwork::wrap_elements(plot_eq_og_exp) + - patchwork::plot_layout(widths = c(1, 1.2, 1, 1.2)) +patchwork::wrap_elements(plot_exclusion_gas) + patchwork::wrap_elements(plot_bo_g_exp) + + patchwork::wrap_elements(plot_eq_g_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) ``` -Oil and gas exclusion badges compared to PACTA exposure for Corporate bonds (Left) and Listed equity (Right). - ```{=latex} \end{center} \end{esbox} diff --git a/inst/extdata/PA2024CH_fr_exec_summary/survey-chapter.Rmd b/inst/extdata/PA2024CH_fr_exec_summary/survey-chapter.Rmd index 02e2950f..6307973e 100644 --- a/inst/extdata/PA2024CH_fr_exec_summary/survey-chapter.Rmd +++ b/inst/extdata/PA2024CH_fr_exec_summary/survey-chapter.Rmd @@ -4,7 +4,7 @@ \section{Enquête sur l’action climatique} -Cette section offre un aperçu de l'efficacité des actions climatiques au niveau institutionnel. Les résultats sont basés sur l'enquête qualitative complémentaire sur l'action climatique. Les résultats de l'enquête sont comparés aux pairs et aux résultats quantitatifs de ce portefeuille. Veuillez noter que les réponses à l'enquête ont été autodéclarées et non vérifiées par 2DII, RMI et WP. +Cette section offre un aperçu de l'efficacité des actions climatiques au niveau institutionnel. Les résultats sont basés sur l'enquête qualitative complémentaire sur l'action climatique. Les résultats de l'enquête sont comparés aux pairs et aux résultats quantitatifs de ce portefeuille. Veuillez noter que les réponses à l'enquête ont été autodéclarées et non vérifiées par RMI. \fbox{\begin{minipage}{\textwidth} \textbf{Explication sur les graphiques à fléchettes ci-dessous:} Les graphiques à fléchettes sont un type de graphique nouvellement développé qui représente vos mesures pertinentes pour le climat. Chaque cercle représente une mesure pertinente pour le climat et est coloré si la mesure est en place. Le niveau d'efficacité des mesures augmente en allant de l'extérieur vers l'intérieur des anneaux et avec l'intensité de la couleur. Plus les cercles sont remplis en allant du cercle extérieur jusqu’au cercle intérieur, plus les actions climatiques de votre institution sont ambitieuses. Pour obtenir de plus amples informations sur les mesures spécifiques indiquées dans les différentes strates, veuillez consulter l‘annexe. @@ -20,7 +20,7 @@ Sur le côté gauche, vous trouvez les initiatives dont vous faites partie. Plus ``` ```{r plots_overview_left, out.width="\\linewidth"} -knitr::include_graphics(file.path(survey_dir, language, "plot_wordcloud.png")) +knitr::include_graphics(file.path(survey_dir, language, "plot_layer_peers_net_zero.png")) ``` ```{=latex} @@ -31,7 +31,7 @@ knitr::include_graphics(file.path(survey_dir, language, "plot_wordcloud.png")) ```{r plots_overview_right, out.width="\\linewidth"} -knitr::include_graphics(file.path(survey_dir, language, "plot_layer_with_peer_info_climate_goals.png")) +knitr::include_graphics(file.path(survey_dir, language, "plot_layer_peers_transition_plan.png")) ``` ```{=latex} @@ -48,43 +48,28 @@ knitr::include_graphics(file.path(survey_dir, language, "plot_layer_with_peer_in Les recherches indiquent que l'engagement constitue l'un des moyens les plus efficaces pour améliorer l'alignement des entreprises bénéficiant d’investissements sur les objectifs climatiques par le biais d'actions et d'obligations. Par conséquent, les graphiques à fléchettes relatifs à l'engagement ci-dessous présentent vos mesures d'engagement pour trois secteurs cruciaux pour le climat et complètent ainsi la section précédente sur l'alignement. Le texte fournit en outre une comparaison avec la proportion de pairs appliquant les meilleures pratiques, c'est-à-dire celles qui couvrent toutes les strates. \begin{center} -\begin{minipage}{0.3\textwidth} +\begin{minipage}{0.4\textwidth} ``` ```{r plot_layer_with_peer_info_engagement_left, out.width="\\linewidth"} knitr::include_graphics( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Fossil_Fuels.png") +file.path(survey_dir, language, "plot_layer_engagement.png") ) ``` ```{=latex} \end{minipage}% -\begin{minipage}{0.3\textwidth} +\begin{minipage}{0.4\textwidth} ``` - ```{r plot_layer_with_peer_info_engagement_center, out.width="\\linewidth"} knitr::include_graphics( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Power.png") +file.path(survey_dir, language, "plot_layer_voting.png") ) ``` ```{=latex} \end{minipage}% -\begin{minipage}{0.3\textwidth} -``` - - -```{r plot_layer_with_peer_info_engagement_right, out.width="\\linewidth"} -knitr::include_graphics(c( -file.path(survey_dir, language, "plot_layer_with_peer_info_engagement_Automotive.png") -)) -``` - -```{=latex} -\end{minipage}% - -Badges d'engagement et comparaison avec les pairs par secteur. Gauche: Combustibles Fossiles, Milieu: Automobile, Droite: Electricité. \end{center} @@ -98,105 +83,110 @@ Ces graphiques comparent les stratégies déclarées comme étant alignées sur ``` ```{r plot_exclusion_coal, fig.width=10, fig.height=3.5} -plot_bo_c_survey <- pacta.executive.summary::rasterGrob( +plot_exclusion_coal <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_coal_Corporate_bonds.png" + "plot_layer_exclusion_coal.png" ) ) ) data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "coal", + technology = "coal", asset_class = "bonds") plot_bo_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + + labs(subtitle = "Coal exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) -plot_eq_c_survey <- pacta.executive.summary::rasterGrob( +data_exposures_survey_e <- prep_exposures_survey(results_portfolio, + peers_results_aggregated, + technology = "coal", + asset_class = "equity") + +plot_eq_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Coal exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) + +patchwork::wrap_elements(plot_exclusion_coal) + patchwork::wrap_elements(plot_bo_c_exp) + + patchwork::wrap_elements(plot_eq_c_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) +``` + +```{r plot_exclusion_oil, fig.width=10, fig.height=3.5} + +plot_exclusion_oil <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_coal_Listed_equities.png" + "plot_layer_exclusion_oil.png" ) ) ) -data_exposures_survey_e <- prep_exposures_survey(results_portfolio, +data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "coal", - asset_class = "equity") + technology = "oil", + asset_class = "bonds") -plot_eq_c_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_bo_o_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + + labs(subtitle = "Oil exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) -patchwork::wrap_elements(plot_bo_c_survey) + patchwork::wrap_elements(plot_bo_c_exp) + - patchwork::wrap_elements(plot_eq_c_survey) + patchwork::wrap_elements(plot_eq_c_exp) + - patchwork::plot_layout(widths = c(1, 1.2, 1, 1.2)) -``` - -```{=latex} +data_exposures_survey_e <- prep_exposures_survey(results_portfolio, + peers_results_aggregated, + technology = "oil", + asset_class = "equity") -Badges d'exclusion pour le charbon comparé à l'exposure PACTA pour les obligations d'entreprise (Gauche) et actions (Droite). +plot_eq_o_exp <- (patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Oil exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1))) +patchwork::wrap_elements(plot_exclusion_oil) + patchwork::wrap_elements(plot_bo_o_exp) + + patchwork::wrap_elements(plot_eq_o_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) ``` - -```{r plot_exclusion_oil_gas, fig.width=10, fig.height=3.5} -plot_bo_og_survey <- pacta.executive.summary::rasterGrob( +```{r plot_exclusion_gas, fig.width=10, fig.height=3.5} +plot_exclusion_gas <- pacta.executive.summary::rasterGrob( pacta.executive.summary::readPNG( file.path( survey_dir, language, - "plot_layer_asset_exclusion_oil_Corporate_bonds.png" + "plot_layer_exclusion_gas.png" ) ) ) data_exposures_survey_b <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "oil_and_gas", + technology = "gas", asset_class = "bonds") -plot_bo_og_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_bo_g_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_b) + + labs(subtitle = "Gas exposure - bonds\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1)) -plot_eq_og_survey <- pacta.executive.summary::rasterGrob( - pacta.executive.summary::readPNG( - file.path( - survey_dir, - language, - "plot_layer_asset_exclusion_oil_Listed_equities.png" - ) - ) -) - data_exposures_survey_e <- prep_exposures_survey(results_portfolio, peers_results_aggregated, - sector = "oil_and_gas", + technology = "gas", asset_class = "equity") -plot_eq_og_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + - labs(subtitle = "Sectoral exposure\n(as % of AUM)")) + patchwork::plot_spacer() + +plot_eq_g_exp <- patchwork::plot_spacer() + (plot_exposures_survey(data_exposures_survey_e) + + labs(subtitle = "Gas exposure - equity\n(as % of AUM)")) + patchwork::plot_spacer() + patchwork::plot_layout(nrow = 3, heights = c(0.1, 1, 0.1)) -patchwork::wrap_elements(plot_bo_og_survey) + patchwork::wrap_elements(plot_bo_og_exp) + - patchwork::wrap_elements(plot_eq_og_survey) + patchwork::wrap_elements(plot_eq_og_exp) + - patchwork::plot_layout(widths = c(1, 1.2, 1, 1.2)) +patchwork::wrap_elements(plot_exclusion_gas) + patchwork::wrap_elements(plot_bo_g_exp) + + patchwork::wrap_elements(plot_eq_g_exp) + + patchwork::plot_layout(widths = c(1.2, 1, 1)) ``` -Badges d'exclusion pour le pétrole et le gaz comparé à l'exposure PACTA pour les obligations d'entreprise (Gauche) et actions (Droite). - ```{=latex} \end{center} \end{esbox} \newpage ``` - diff --git a/man/plot_exposures_survey.Rd b/man/plot_exposures_survey.Rd index 09af1707..8f95abaa 100644 --- a/man/plot_exposures_survey.Rd +++ b/man/plot_exposures_survey.Rd @@ -27,7 +27,7 @@ Create a bar plot showing exposure to a sector } \examples{ data <- toy_data_exposures_survey \%>\% - dplyr::filter(asset_class == "equity", sector == "coal") + dplyr::filter(asset_class == "equity", technology == "coal") plot_exposures_survey(data) } diff --git a/man/prep_exposures_survey.Rd b/man/prep_exposures_survey.Rd index d6f78e0f..62204b5e 100644 --- a/man/prep_exposures_survey.Rd +++ b/man/prep_exposures_survey.Rd @@ -7,7 +7,7 @@ prep_exposures_survey( results_portfolio, peers_results_aggregated, - sector = c("coal", "oil_and_gas"), + technology = c("coal", "oil", "gas"), asset_class = c("equity", "bonds") ) } @@ -19,8 +19,8 @@ level PACTA results from a PACTA for investors analysis.} aggregate peer group level PACTA results from a PACTA for investors analysis.} -\item{sector}{Character. Must be of length 1 and either \code{coal} or -\code{oil_and_gas}.} +\item{technology}{Character. Must be of length 1 and either \code{coal} or +\code{oil} or \code{gas}.} \item{asset_class}{Character. Must be of length 1 and either \code{equity} or \code{bonds}.} diff --git a/man/render_executive_summary.Rd b/man/render_executive_summary.Rd index 28a5ba47..652e660b 100644 --- a/man/render_executive_summary.Rd +++ b/man/render_executive_summary.Rd @@ -49,10 +49,6 @@ render_executive_summary( \item{currency_exchange_value}{Numeric single numeric value specifying the exchange rate from USD into the desired display currency, e.g. \code{1.03}} \item{log_dir}{Character single, valid filepath to a directory that will contain the log file} - -\item{real_estate_dir}{Character single, valid filepath to a directory that contains real estate files for the user} - -\item{real_estate_flag}{Logical single, whether or not to render the real estate section} } \value{ a pdf document written to output_dir diff --git a/man/scenario_thresholds.Rd b/man/scenario_thresholds.Rd index fd618cb1..4a9c62ef 100644 --- a/man/scenario_thresholds.Rd +++ b/man/scenario_thresholds.Rd @@ -5,7 +5,7 @@ \alias{scenario_thresholds} \title{Scenario names mapped to temperature thresholds} \format{ -An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 3 rows and 3 columns. +An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 6 rows and 3 columns. } \usage{ scenario_thresholds diff --git a/man/toy_data_exposures_survey.Rd b/man/toy_data_exposures_survey.Rd index 00279528..ec543c27 100644 --- a/man/toy_data_exposures_survey.Rd +++ b/man/toy_data_exposures_survey.Rd @@ -5,7 +5,7 @@ \alias{toy_data_exposures_survey} \title{An example output data of \code{prep_exposures_survey()}} \format{ -An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 8 rows and 4 columns. +An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 12 rows and 4 columns. } \usage{ toy_data_exposures_survey diff --git a/tests/testthat/_snaps/plot_exposures_survey.md b/tests/testthat/_snaps/plot_exposures_survey.md index f6b8b77f..a8caa529 100644 --- a/tests/testthat/_snaps/plot_exposures_survey.md +++ b/tests/testthat/_snaps/plot_exposures_survey.md @@ -5,7 +5,7 @@ # with missing crucial columns errors gracefully `data` must have all the expected names. - x Missing names: asset_class, entity, exposure_perc_aum, sector. + x Missing names: asset_class, entity, exposure_perc_aum, technology. # with multiple values for `asset_class` errors gracefully @@ -19,10 +19,10 @@ portfolio, peers. x You passed: bad. -# with wrong values of `sector` errors gracefully +# with wrong values of `technology` errors gracefully - Each value of `"sector"` must be one of these: - coal, oil_and_gas. + Each value of `"technology"` must be one of these: + coal, oil, gas. x You passed: bad. # with non-numeric values of `exposure_perc_aum` errors gracefully diff --git a/tests/testthat/test-plot_exposures_survey.R b/tests/testthat/test-plot_exposures_survey.R index 5c966a78..7e36cdbf 100644 --- a/tests/testthat/test-plot_exposures_survey.R +++ b/tests/testthat/test-plot_exposures_survey.R @@ -4,7 +4,7 @@ toy_data_exposures_survey_ex <- function() { toy_data_exposures_survey %>% dplyr::filter( asset_class == "equity", - sector == "coal" + technology == "coal" ) } @@ -29,10 +29,10 @@ test_that("with wrong values of `entity` errors gracefully", { expect_snapshot_error(plot_exposures_survey(data_wrong)) }) -test_that("with wrong values of `sector` errors gracefully", { +test_that("with wrong values of `technology` errors gracefully", { data_wrong <- toy_data_exposures_survey_ex() - data_wrong$sector <- as.character(data_wrong$sector) - data_wrong$sector[1] <- "bad" + data_wrong$technology <- as.character(data_wrong$technology) + data_wrong$technology[1] <- "bad" expect_snapshot_error(plot_exposures_survey(data_wrong)) })