ASEAN Climate Finance

Author

Pinandito Wisambudi

Data Preparation

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)
library(readr)
library(readxl)
library(here)
here() starts at /Users/pinanditowisambudi/Sustainable Finance Class
library(ggplot2)
library(esquisse)
ASEAN_Climate_Finance <- here("Final data", "ASEAN Climate Finance.xlsx") %>% read_excel()
ASEAN_Climate_Finance
# A tibble: 6 × 7
  Country   Climate Finance Need…¹ Public Finance (Bill…² Climate finance gap …³
  <chr>                      <dbl>                  <dbl>                  <dbl>
1 Indonesia                  28                     9.52                   18.5 
2 Vietnam                    24.7                  10.1                    14.6 
3 Cambodia                    7.77                  0.414                   7.36
4 Lao PDR                     4.76                  0                       4.76
5 Philippi…                   4.13                  2.89                    1.24
6 Thailand                    0                     0.404                   0   
# ℹ abbreviated names: ¹​`Climate Finance Needs (Billion USD)`,
#   ²​`Public Finance (Billion USD)`, ³​`Climate finance gap (Billion USD)`
# ℹ 3 more variables: `Percentage covered` <dbl>,
#   `Public budget (Billion USD)` <dbl>,
#   `Percentage from State Public Budget` <dbl>
GCF_ASEAN <- here("Final data", "GCF ASEAN.xlsx") %>% read_excel()

GCF_ASEAN
# A tibble: 47 × 11
   `Ref #` Modality `Project Name`           Entity Countries BM    Sector Theme
   <chr>   <chr>    <chr>                    <chr>  <chr>     <chr> <chr>  <chr>
 1 FP151   PAP      Global Subnational Clim… IUCN   Cambodia  B.27  Priva… Miti…
 2 FP152   PAP      Global Subnational Clim… PCA    Cambodia  B.27  Priva… Miti…
 3 FP076   PAP      Climate-Friendly Agribu… ADB    Cambodia  B.19  Public Cros…
 4 FP199   PAP      Public-Social-Private P… FAO    Cambodia  B.35  Public Adap…
 5 FP228   PAP      Cambodian Climate Finan… KDB    Cambodia  B.38  Priva… Cros…
 6 FP156   PAP      ASEAN Catalytic Green F… ADB    Cambodia  B.28  Public Miti…
 7 FP215   PAP      Community Resilience Pa… ADB    Cambodia  B.37  Public Adap…
 8 FP194   PAP      Programme for Energy Ef… AFD    Indonesia B.34  Public Cros…
 9 FP151   PAP      Global Subnational Clim… IUCN   Indonesia B.27  Priva… Miti…
10 FP152   PAP      Global Subnational Clim… PCA    Indonesia B.27  Priva… Miti…
# ℹ 37 more rows
# ℹ 3 more variables: `Project Size` <chr>, `ESS Category` <chr>,
#   `FA Financing` <dbl>
colnames (ASEAN_Climate_Finance) [1] <- "Country"
colnames (ASEAN_Climate_Finance) [2] <- "climate_finance_need" 
colnames (ASEAN_Climate_Finance) [3] <- "public_climate_finance"
colnames (ASEAN_Climate_Finance) [4] <- "climate_finance_gap" 
colnames (ASEAN_Climate_Finance) [5] <- "public_climate_finance_percentage" 
colnames (ASEAN_Climate_Finance) [6] <- "public_budget"
colnames (ASEAN_Climate_Finance) [7] <- "public_budget_percentage" 
# Create a stacked bar chart
ggplot(data = ASEAN_Climate_Finance) +
  geom_bar(aes(x = Country, y = climate_finance_need, fill = "Climate Finance Gap"), stat = "identity") +
  geom_bar(aes(x = Country, y = public_climate_finance, fill = "Public Finance"), stat = "identity") +
  scale_fill_manual(values = c("Public Finance" = "red4", "Climate Finance Gap" = "indianred1")) +
  labs(title = "Climate Finance by Country",
       x = "Country",
       y = "Finance (Billion USD)",
       fill = "") +
  theme_minimal()

colnames (GCF_ASEAN) [5] <- "Country"
colnames (GCF_ASEAN) [7] <- "Sector" 
colnames (GCF_ASEAN) [8] <- "Theme"
colnames (GCF_ASEAN) [11] <- "GCF_financing" 
# Sum the financing by theme
Theme_GCF_ASEAN <- aggregate(GCF_financing ~ Theme, data = GCF_ASEAN, FUN = sum)

# Calculate percentages
Theme_GCF_ASEAN$Percentage <- with(Theme_GCF_ASEAN, GCF_financing / sum(GCF_financing) * 100)

Theme_GCF_ASEAN
          Theme GCF_financing Percentage
1    Adaptation     195082428   14.99122
2 Cross-cutting     371884162   28.57765
3    Mitigation     734344406   56.43112
# Sum the financing by theme
Country_GCF_ASEAN <- aggregate(GCF_financing ~ Country, data = GCF_ASEAN, FUN = sum)

# Calculate percentages
Country_GCF_ASEAN$Percentage <- with(Country_GCF_ASEAN, GCF_financing / sum(GCF_financing) * 100)

Country_GCF_ASEAN
      Country GCF_financing Percentage
1    Cambodia     212443644 16.3253554
2   Indonesia     503944597 38.7259155
3     Lao PDR     186327857 14.3184725
4    Malaysia      60000000  4.6107349
5     Myanmar       4109756  0.3158166
6 Philippines     129609046  9.9598825
7    Thailand      58847728  4.5221879
8     Vietnam     146028367 11.2216348
# Create a pie chart using ggplot2
ggplot(data = Theme_GCF_ASEAN, aes(x = "", y = GCF_financing, fill = Theme)) +
  geom_bar(stat = "identity", width = 1) +
  coord_polar(theta = "y") +  # Convert bar chart to pie chart
  geom_text(aes(label = sprintf("%.1f%%", Percentage)), position = position_stack(vjust = 0.5)) +
  theme_void() +  # Remove extra chart elements like axes
  labs(fill = "Finance Theme", title = "Distribution of Finance by Theme") +
  scale_fill_brewer(palette = "Set5")  # Use a nice color palette
Warning: Unknown palette: "Set5"

# Create a pie chart using ggplot2
ggplot(data = Country_GCF_ASEAN, aes(x = "", y = GCF_financing, fill = Country)) +
  geom_bar(stat = "identity", width = 1) +
  coord_polar(theta = "y") +  # Convert bar chart to pie chart
  geom_text(aes(label = sprintf("%.1f%%", Percentage)), position = position_stack(vjust = 0.5)) +
  theme_void() +  # Remove extra chart elements like axes
  labs(fill = "Finance Theme", title = "Distribution of Finance by Country") +
  scale_fill_brewer(palette = "Blues")  # Use a nice color palette

# Assuming Country_GCF_ASEAN is already loaded and contains columns GCF_financing and Percentage

# Reorder the Country factor levels by Percentage
Country_GCF_ASEAN$Country <- factor(Country_GCF_ASEAN$Country, 
                                    levels = Country_GCF_ASEAN$Country[order(Country_GCF_ASEAN$Percentage, decreasing = FALSE)])

# Create a pie chart using ggplot2 with reordered countries
ggplot(data = Country_GCF_ASEAN, aes(x = "", y = GCF_financing, fill = Country)) +
  geom_bar(stat = "identity", width = 1) +
  coord_polar(theta = "y") +  # Convert bar chart to pie chart
  geom_text(aes(label = sprintf("%.1f%%", Percentage)), position = position_stack(vjust = 0.5)) +
  theme_void() +  # Remove extra chart elements like axes
  labs(fill = "Country", title = "Distribution of GCF Financing by Country") +
  scale_fill_brewer(palette = "Blues")  # Use a nice color palette

# Load necessary libraries
library(dplyr)
library(tidyr)

# Assume 'data' is your data frame containing the project information
# Group the data by 'Countries' and 'Theme', then sum the financing amounts
financing_by_theme_country <- GCF_ASEAN %>%
  group_by(Country, Theme) %>%
  summarise(Total_Financing = sum(GCF_financing, na.rm = TRUE)) %>%
  pivot_wider(names_from = Theme, values_from = Total_Financing, values_fill = list(Total_Financing = 0))
`summarise()` has grouped output by 'Country'. You can override using the
`.groups` argument.
# Print the table
print(financing_by_theme_country)
# A tibble: 8 × 4
# Groups:   Country [8]
  Country     Adaptation `Cross-cutting` Mitigation
  <chr>            <dbl>           <dbl>      <dbl>
1 Cambodia     53374838.       94959050   64109756.
2 Indonesia    24495798.      101294635. 378154164.
3 Lao PDR      52120941.       57799344.  76407571.
4 Malaysia            0               0   60000000 
5 Myanmar             0               0    4109756.
6 Philippines  17351983.       46993905.  65263158.
7 Thailand     17533500        41314228.         0 
8 Vietnam      30205367        29523000   86300000 
# Load necessary libraries
library(ggplot2)
library(dplyr)
library(tidyr)

# Assume 'data' is your data frame containing the project information
# Prepare the data
financing_data <- GCF_ASEAN %>%
  group_by(Country, Theme) %>%
  summarise(Total_Financing = sum(GCF_financing, na.rm = TRUE)) %>%
  pivot_wider(names_from = Theme, values_from = Total_Financing, values_fill = list(Total_Financing = 0))
`summarise()` has grouped output by 'Country'. You can override using the
`.groups` argument.
# Calculate the proportion of each theme within each country
financing_data <- financing_data %>%
  mutate(Total = `Adaptation` + `Cross-cutting` + `Mitigation`) %>%
  mutate_at(vars(`Adaptation`, `Cross-cutting`, `Mitigation`), ~ . / Total)

# Gather the data for plotting
financing_data_long <- financing_data %>%
  pivot_longer(cols = `Adaptation`:`Mitigation`, names_to = "Theme", values_to = "Proportion")

# Create a stacked bar chart
ggplot(financing_data_long, aes(x = Country, y = Proportion, fill = Theme)) +
  geom_bar(stat = "identity") +
  labs(title = "Proportion of Financing by Theme for Each Country",
       y = "Proportion") +
  theme_minimal() +
  scale_fill_brewer(palette = "Set5")
Warning: Unknown palette: "Set5"

  theme(axis.text.x = element_text(angle = 45, hjust = 1))
List of 1
 $ axis.text.x:List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : num 1
  ..$ vjust        : NULL
  ..$ angle        : num 45
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi FALSE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 - attr(*, "class")= chr [1:2] "theme" "gg"
 - attr(*, "complete")= logi FALSE
 - attr(*, "validate")= logi TRUE
# Create a bar chart of GCF Financing by Country
ggplot(data = Country_GCF_ASEAN, aes(x = Country, y = GCF_financing, fill = Country)) +
  geom_bar(stat = "identity", color = "navy") +  # Use identity stat for pre-summarized data
  scale_fill_brewer(palette = "Blues") +  # Apply a color palette
  labs(title = "GCF Financing by Country", 
       x = "Country", 
       y = "GCF Financing (USD)", 
       fill = "Country") +
  theme_minimal() +  # Apply a minimal theme
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Rotate x-axis labels for better readability

# Create a bar chart of GCF Financing by Country with values in millions USD
ggplot(data = Country_GCF_ASEAN, aes(x = Country, y = GCF_financing / 1e6, fill = Country)) +
  geom_bar(stat = "identity", color = "navy") +  # Use identity stat for pre-summarized data
  scale_fill_brewer(palette = "Blues") +  # Apply a color palette
  labs(title = "GCF Financing by Country", 
       x = "Country", 
       y = "GCF Financing (Million USD)",  # Updated label
       fill = "Country") +
  theme_minimal() +  # Apply a minimal theme
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Rotate x-axis labels for better readability

ASEAN_emissions <- here("Final data", "total-ghg-emissions.xlsx") %>% read_excel()

ASEAN_emissions
# A tibble: 10 × 4
   Entity      Code   Year `Annual greenhouse gas emissions in CO2 equivalents`
   <chr>       <chr> <dbl>                                                <dbl>
 1 Brunei      BRN    2022                                             16811834
 2 Cambodia    KHM    2022                                             71423050
 3 Indonesia   IDN    2022                                           2127215600
 4 Lao PDR     LAO    2022                                             67288190
 5 Malaysia    MYS    2022                                            484118800
 6 Myanmar     MMR    2022                                            229034660
 7 Philippines PHL    2022                                            278720830
 8 Singapore   SGP    2022                                             60272492
 9 Thailand    THA    2022                                            422101900
10 Vietnam     VNM    2022                                            619503700