Skip to content

Commit df9b87b

Browse files
committed
Add maps for all countries
1 parent f93b60b commit df9b87b

15 files changed

+32373
-13
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ importFrom(tibble,tibble)
8787
importFrom(tibble,tribble)
8888
importFrom(tidyr,drop_na)
8989
importFrom(tidyr,pivot_wider)
90+
importFrom(tidyselect,all_of)
9091
importFrom(tidyselect,matches)
9192
importFrom(tiltIndicator,example_data_factory)
9293
importFrom(tiltIndicatorAfter,profile_emissions)

R/bar_plot_emission_profile.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ prepare_bar_plot_emission_profile <- function(data, grouping_emission, mode, sce
7272
group_by(.data[[risk_category]], .data$grouping_emission) |>
7373
summarise(total_mode = sum(.data[[mode]])) |>
7474
group_by(.data$grouping_emission) |>
75-
mutate(proportion = total_mode / sum(total_mode))
75+
mutate(proportion = .data$total_mode / sum(.data$total_mode))
7676

7777
data
7878
}

R/bar_plot_emission_profile_financial.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
#'
1818
#' @examples
1919
#' grouping_emission <- c("all", "unit", "isic_4digit")
20-
#' bar_plot_emission_profile_financial(financial, grouping_emission, "equal_weight", risk_category = "emission_category")
20+
#' bar_plot_emission_profile_financial(financial, grouping_emission,
21+
#' "equal_weight",
22+
#' risk_category = "emission_category"
23+
#' )
2124
bar_plot_emission_profile_financial <- function(data,
2225
grouping_emission = grouping_emission(),
2326
mode = c(

R/map_region_risk.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
#' map_region_risk(without_financial, country_code = "DE", benchmark = "unit")
2424
#' })
2525
map_region_risk <- function(data,
26-
# TODO: plot for other countries
27-
country_code = c("DE"),
26+
country_code = c("DE", "AT", "FR", "NL", "ES"),
2827
grouping_emission = grouping_emission(),
2928
mode = modes(),
3029
scenario = scenarios(),

R/prepare_geo_data.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#' @noRd
99
#'
1010
prepare_geo_data <- function(data,
11-
country_code = c("DE"),
11+
country_code = c("DE", "AT", "FR", "NL", "ES"),
1212
grouping_emission = grouping_emission(),
1313
mode = modes(),
1414
scenario = scenarios(),
@@ -46,8 +46,7 @@ prepare_geo_data <- function(data,
4646

4747
# merge to have zip codes with NUTS file
4848
shp_1 <- shp_1 |>
49-
inner_join(nuts_de, by = "geo") |>
50-
mutate(postcode = as.character(postcode))
49+
inner_join(nuts_all, by = "geo")
5150

5251
# merge shapefile with financial data
5352
geo <- data |>
@@ -92,7 +91,7 @@ aggregate_geo <- function(geo, mode, risk_category) {
9291
group_by(.data$postcode, .data[[risk_category]]) |>
9392
summarise(total_mode = sum(.data[[mode]])) |>
9493
group_by(.data$postcode) |>
95-
mutate(proportion = total_mode / sum(total_mode)) |>
94+
mutate(proportion = .data$total_mode / sum(.data$total_mode)) |>
9695
ungroup()
9796

9897
# Pivot

R/sysdata.rda

68.5 KB
Binary file not shown.

R/tiltPlot-package.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#' @importFrom tibble tribble
7575
#' @importFrom tidyr drop_na
7676
#' @importFrom tidyr pivot_wider
77+
#' @importFrom tidyselect all_of
7778
#' @importFrom tidyselect matches
7879
#' @importFrom tiltIndicator example_data_factory
7980
#' @importFrom tiltIndicatorAfter profile_emissions

0 commit comments

Comments
 (0)