Since the Industrial Revolution, fossil fuels have become the dominant energy source for most countries across the world. The interactive map below shows the share of energy that comes from fossil fuels globally. Fossil fuel combustion accounts for three-quarters of global greenhouse gas emissions. A rapid transition to low-carbon energy sources, such as renewables, is crucial to mitigate air pollution.
Code
library(ggplot2)library(plotly)library(rnaturalearth)library(sf)library(dplyr)library(readr)library(leaflet)# Adjust the path for cross-platform compatibility and assuming the script is run in an environment similar to RStudiodata_path <-"C:/Users/puxin/OneDrive/Documents/03_data_processed/fossil-fuels-share-energy (1).csv"# For cross-platform compatibility, especially in a non-Windows environment, consider using file.path() or adjusting as necessary.energy_data <-read_csv(data_path)# Prepare the filtered datafiltered_data <- energy_data %>%filter(Year ==2022) %>%select(code, FossilFuelPercentage =`FossilFuelPercentage`) # Ensure column name matches# Get the map data in sf formatworld_map_data <- rnaturalearth::ne_countries(returnclass ="sf")# Merge the data with the map datamerged_data <- world_map_data %>%left_join(filtered_data, by =c("iso_a3"="code"))# Prepare a color palettepal <-colorNumeric(palette ="YlOrRd", domain = merged_data$FossilFuelPercentage, na.color ="white")# Create the leaflet mapleaflet(merged_data) %>%addProviderTiles(providers$CartoDB.Positron) %>%addPolygons(fillColor =~pal(FossilFuelPercentage),color ="#BDBDC3", weight =1, opacity =1,fillOpacity =0.7, smoothFactor =0.5,highlightOptions =highlightOptions(weight =3, color ="#666", bringToFront =TRUE ),popup =~paste("<strong>Country:</strong>", name, "<br/>","<strong>Fossil Fuel Percentage:</strong>", FossilFuelPercentage, "%" ) ) %>%addLegend(position ="topright", pal = pal, values =~FossilFuelPercentage,labFormat =labelFormat(suffix ="%") ) %>%addControl("<h4>Share of primary energy consumption from fossil fuels 2022</h4> <br/>Source: Energy Institute - Statistical Review of World Energy (2023)", position ="bottomleft", className ="map-source" )
In 2022, global investment in energy transition technologies hit a record USD 1.3 trillion. Yet, to meet the 1.5°C scenario outlined in IRENA’s 2023 World Energy Transitions Outlook, investments must quadruple annually. Renewable energy investments also reached a new high of USD 0.5 trillion, but this is less than a third of the yearly investment required.
This report aims to provide policymakers with insights into investment trends by answering the following questions, enabling them to use market instruments to develop and adapt policies that expand the global transition to renewable energy.
Investment Trends: What are the trends in investment by technology, sector, region, source of finance, and financial instrument?
Financing Gaps: What are the financing gaps in the deployment of renewable energy technologies, and how can these gaps be addressed through informed policy making?
Capital Markets Innovation: How can the use of innovative capital markets instruments open up important additional avenues for investors, thereby enhancing the flow of funds towards the energy transition?
Data Source and Methodology
To do this analysis, I use data from five data sets.
Energy Institute - Statistical Review of World Energy (2023): This dataset provides a comprehensive review of global energy statistics, focusing on primary energy sources before their transformation into electricity or other energy forms. Energy Institute
World Bank Open Data: This resource offers a wealth of information on global development indicators, including GDP per capita in current US dollars. World Bank
Global Carbon Budget (2023): This dataset focuses on per capita CO₂ emissions for the year 2022, excluding land-use changes but including emissions from fossil fuels and industry. Global Carbon Budget
IMF Climate Change Dashboard (Green Bonds): This dashboard highlights the growing sector of green bonds, financial instruments designed to support climate and environmental projects. IMF(Green Bonds)
IRENA Statistics Data (Finance and Investment): This dashboard sheds light on global trends in renewable energy investment, offering a overview of how funds are allocated across different renewable technologies and regions. IRENA
Private Investment
Between 2013 and 2020, the private sector funded about 75% of the world’s renewable energy investments, largely favoring established technologies due to a preference for lower-risk and financially lucrative opportunities. This trend is evident with 83% of solar PV investments in 2020 being privately financed, in contrast to hydropower, which rely predominantly on public finance, only 3% of its funding from private investors.
Code
library(readxl)library(dplyr)library(ggplot2)library(plotly)library(tidyr)data_path <-"C://Users//puxin//OneDrive//Documents//00_data_raw//2023_IRENA-CPI_RE_Investment_Trends.xlsx"df <-read_excel(data_path)df_source_private <- df %>%filter(Category =="Source", Product =="Private") %>%group_by(Year) %>%summarise(PrivateInvestment =sum(`Investment in USD billion`), .groups ='drop')df_source_total <- df %>%filter(Category =="Source") %>%group_by(Year) %>%summarise(TotalInvestment =sum(`Investment in USD billion`), .groups ='drop')# Join the data frames to calculate the proportion correctlydf_source_proportion <- df_source_private %>%left_join(df_source_total, by ="Year") %>%mutate(Proportion = PrivateInvestment / TotalInvestment)df_technology <- df %>%filter(Category =="Technology") %>%group_by(Year, Product) %>%summarise(TotalInvestment =sum(`Investment in USD billion`), .groups ='drop') %>%group_by(Year) %>%mutate(Proportion = TotalInvestment /sum(TotalInvestment))# Prepare the colors for the stacked bar chartunique_products <-unique(df_technology$Product)colors <- RColorBrewer::brewer.pal(min(length(unique_products), 8), "Set3")# Starting Plotly object with region investment barsfig <-plot_ly()# Adding bars for each 'Product' within 'Region'for (i inseq_along(unique_products)) { product_data <- df_technology %>%filter(Product == unique_products[i]) fig <- fig %>%add_bars(data = product_data, x =~Year, y =~Proportion, name = unique_products[i], marker =list(color = colors[i]), offsetgroup = i)}# Adding Private Investment proportion linefig <- fig %>%add_lines(data = df_source_proportion, x =~Year, y =~Proportion, name ='Private Investment in Source', line =list(color ='blue')) %>%add_markers(data = df_source_proportion, x =~Year, y =~Proportion, name ='Private Investment in Source', marker =list(color ='red'))# Adjusting layout for clarityfig <- fig %>%layout(title ='Proportion of Investments by Technology and Source Over Years',barmode ='stack',xaxis =list(title ='Year'),yaxis =list(title ='Proportion', tickformat =',.2%'),legend =list(title =list(text ='Investment Type')),annotations =list(list(text ='Bars: Investment Proportions by Technology within Regions<br>Line & Dots: Private Investment Proportion in Source',x =0.5,xref ='paper',yref ='paper',y =-0.22,showarrow =FALSE,font =list(size =12) ) ))# Display the interactive plotfig
Private capital also tends to flow to countries with lower real or perceived risks, or into frontier markets only when effective risk mitigation facilities are provided, while a large portion of the world’s population remains underserved.
Code
library(readxl)library(dplyr)library(ggplot2)library(plotly)library(tidyr)data_path <-"C://Users//puxin//OneDrive//Documents//00_data_raw//2023_IRENA-CPI_RE_Investment_Trends.xlsx"df <-read_excel(data_path)df_source_private <- df %>%filter(Category =="Source", Product =="Private") %>%group_by(Year) %>%summarise(PrivateInvestment =sum(`Investment in USD billion`), .groups ='drop')df_source_total <- df %>%filter(Category =="Source") %>%group_by(Year) %>%summarise(TotalInvestment =sum(`Investment in USD billion`), .groups ='drop')# Join the data frames to calculate the proportion correctlydf_source_proportion <- df_source_private %>%left_join(df_source_total, by ="Year") %>%mutate(Proportion = PrivateInvestment / TotalInvestment)# Assuming df has already been loaded and prepareddf_region_technology <- df %>%filter(Category =="Region") %>%group_by(Year, Product) %>%summarise(TotalInvestment =sum(`Investment in USD billion`), .groups ='drop') %>%group_by(Year) %>%mutate(Proportion = TotalInvestment /sum(TotalInvestment))# Prepare the colors for the stacked bar chartunique_products <-unique(df_region_technology$Product)colors <- RColorBrewer::brewer.pal(min(length(unique_products), 8), "Set3")# Starting Plotly object with region investment barsfig <-plot_ly()# Adding bars for each 'Product' within 'Region'for (i inseq_along(unique_products)) { product_data <- df_region_technology %>%filter(Product == unique_products[i]) fig <- fig %>%add_bars(data = product_data, x =~Year, y =~Proportion, name = unique_products[i], marker =list(color = colors[i]), offsetgroup = i)}# Adding Private Investment proportion linefig <- fig %>%add_lines(data = df_source_proportion, x =~Year, y =~Proportion, name ='Private Investment in Source', line =list(color ='blue')) %>%add_markers(data = df_source_proportion, x =~Year, y =~Proportion, name ='Private Investment in Source', marker =list(color ='red'))# Adjusting layout for clarityfig <- fig %>%layout(title ='Proportion of Investments by Region and Source Over Years',barmode ='stack',xaxis =list(title ='Year'),yaxis =list(title ='Proportion', tickformat =',.2%'),legend =list(title =list(text ='Investment Type')),annotations =list(list(text ='Bars: Investment Proportions by Technology within Regions<br>Line & Dots: Private Investment Proportion in Source',x =0.5,xref ='paper',yref ='paper',y =-0.22,showarrow =FALSE,font =list(size =12) ) ))# Display the interactive plotfig
Generally speaking, this means that the lowest income populations often pay the most for essential energy, hindering poverty alleviation and socio-economic progress. This necessitates a much stronger role for public financing in these contexts and not fully relying on private capital which may keep widening the disparities.
Public Investment
Globally, the public sector provided less than one-third of renewable energy investment in 2020. State-owned financial institutions and national DFIs were the main sources that year. Multilateral DFIs provided 9% of public finance – accounted for about half of international flows coming from the public sector. Commitments from bilateral DFIs in 2020 fell 70% compared to 2019.
Code
library(readxl)library(dplyr)library(plotly)library(DT)# Load the datadata_path <-"C://Users//puxin//OneDrive//Documents//00_data_raw//IRENA_RE_Public_Investment_2022.xlsx"df <-read_excel(data_path)# Summarize the investment amount by agencyagency_summary <- df %>%group_by(Agency) %>%summarise(TotalAmount =sum(`Amount (2020 USD million)`), .groups ='drop') %>%arrange(desc(TotalAmount))# Keep only the top ten agencies and group the rest as 'Others'top_agencies <- agency_summary %>%slice(1:10) %>%mutate(units ="2020 USD million") # Add the "units" column for top 10 agenciesothers_sum <-sum(agency_summary$TotalAmount[-(1:10)])top_agencies <-bind_rows(top_agencies, tibble(Agency ="Others", TotalAmount = others_sum, units ="2020 USD million"))# Assuming you want to display the datatable with the 'units' informationdatatable(top_agencies,options =list(pageLength =15, autoWidth =TRUE),rownames =FALSE) %>%formatCurrency(c('TotalAmount'), currency ='USD', interval =3, mark =',') %>%formatStyle('TotalAmount', fontWeight ='bold')
Code
# For the pie chart, since 'units' is the same for all categories, it doesn't need to be directly included in the plot# If you want to display it, consider adding it to the hover informationfig2 <-plot_ly(top_agencies, labels =~Agency, values =~TotalAmount, type ='pie', textinfo ='none',hoverinfo ='label+percent+name', insidetextorientation ='radial',hovertemplate =paste("<b>%{label}</b><br>Total: %{value} (%{percent})<br>Units: 2020 USD million")) %>%layout(title ='Proportion of Investments by Agency (Top 10 and Others)',showlegend =TRUE)# Display the plotfig2
Due to limited public funds, governments have usually prioritized using available resources to make renewable energy projects more attractive to private investors by improving their risk-return profiles.
Sovereign guarantees have been commonly used to address credit risks, but they may affecting its credit rating and ability to finance essential infrastructure by increasing a country’s contingent liabilities.
This is particularly problematic for emerging economies already facing significant debt and inflation post-COVID-19. As these countries struggle to secure affordable capital or offer sovereign guarantees, there’s a pressing need for innovative financial instruments that enable energy transition without straining their economies.
Innovating Market Instruments: The Case of Green Bonds
Innovative capital-market instruments, such as green bonds, can open up crucial additional avenues through which investors can invest in renewables. Given the strong preference of institutional investors for indirect investments, ideally via listed and rated instruments, green bonds act as a bridge between such providers of capital and renewable energy assets.
According to the Climate Bond Initiative (CBI), the green bonds market has experienced a spectacular growth in the recent past, increasing from USD 36.6 billion worth of issuances in 2014 to USD nearly 500 billion in 2022.
Visual analysis:
The size of each point in the scatter plot below represents the total amount of green bonds issued by the country. The analysis reveals several key insights:
European Nations: European nations, despite high GDP per capita, issue fewer green bonds, likely due to smaller financial markets.
China: China leads in green bond issuance but also has high per capita carbon emissions, indicating a need for sustainable financial investment.
United States: The United States is noted for its high GDP per capita and carbon emissions per capita, yet it ranks seventh in green bond issuance. This suggests that, despite its substantial economic and environmental footprint, the U.S. possesses untapped potential in the green bond market.
Code
library(readr)library(dplyr)library(plotly)# Load the datadata_path <-"C:/Users/puxin/OneDrive/Documents/03_data_processed/Final project sovereign data with CO2.csv"df <-read_csv(data_path)# Filter for 2022 and select the top ten countries based on cumulative_bn_usddf_2022_top10 <- df %>%filter(Year ==2022) %>%arrange(desc(cumulative_bn_usd)) %>%slice(1:10)# Calculate a sizeref for better size scaling of markersmax_cumulative_bn_usd <-max(df_2022_top10$cumulative_bn_usd, na.rm =TRUE)sizeref_value <- max_cumulative_bn_usd /100# Adjust 100 based on desired max marker size appearancefig <-plot_ly(data = df_2022_top10, x =~log(GDP_Per_Capita), y =~log(Annual_carbon_emissions_percapita),type ='scatter', mode ='markers',marker =list(size =~cumulative_bn_usd, sizeref = sizeref_value, color =~cumulative_bn_usd, # Color by cumulative_bn_usd to add varietycolorscale ='Viridis', # Use the 'Viridis' colorscale for visibilityshowscale =TRUE# Show color scale ),text =~country, hoverinfo ='text+x+y') %>%layout(title ='Top 10 Cumulative Green Bond Investment Countries 2022 (USD Billion)',xaxis =list(title ='GDP per capita current US$ (log scale) '),yaxis =list(title ='Per capita CO₂ emissions (log scale)'),plot_bgcolor ='rgba(0,0,0,0)', # Set plot background color to transparent or light colorpaper_bgcolor ='rgba(0,0,0,0)', # Set paper background color to transparent or light colorhovermode ='closest')# Display the plotfig
Conclusion
The report finds that investments have become further concentrated in specific mature technologies and uses, and in a small number of developed countries/regions. It underscores the need to direct public funds to regions and countries that have considerable untapped potential but find it difficult to attract investment. Funding must be focused on supporting energy transition infrastructure development, as well as enabling policy frameworks to drive investment and address persistent socio-economic gaps.
Source Code
---title: "Renewable Energy Financing: Trends, Challenges, and Innovations"author: "Xingyu Pu"format: html: code-fold: true code-tools: true toc: true toc-depth: 2editor_options: chunk_output_type: console---{fig-alt="Description of the image."}## MotivationSince the Industrial Revolution, fossil fuels have become the dominant energy source for most countries across the world. The interactive map below shows the share of energy that comes from fossil fuels globally. Fossil fuel combustion accounts for three-quarters of [global greenhouse gas emissions](pollution.https://ourworldindata.org/co2-and-greenhouse-gas-emissions). A rapid transition to low-carbon energy sources, such as renewables, is crucial to mitigate air pollution.```{r R-Code-1, echo=TRUE, message=FALSE, warning=FALSE}library(ggplot2)library(plotly)library(rnaturalearth)library(sf)library(dplyr)library(readr)library(leaflet)# Adjust the path for cross-platform compatibility and assuming the script is run in an environment similar to RStudiodata_path <- "C:/Users/puxin/OneDrive/Documents/03_data_processed/fossil-fuels-share-energy (1).csv"# For cross-platform compatibility, especially in a non-Windows environment, consider using file.path() or adjusting as necessary.energy_data <- read_csv(data_path)# Prepare the filtered datafiltered_data <- energy_data %>% filter(Year == 2022) %>% select(code, FossilFuelPercentage = `FossilFuelPercentage`) # Ensure column name matches# Get the map data in sf formatworld_map_data <- rnaturalearth::ne_countries(returnclass = "sf")# Merge the data with the map datamerged_data <- world_map_data %>% left_join(filtered_data, by = c("iso_a3" = "code"))# Prepare a color palettepal <- colorNumeric(palette = "YlOrRd", domain = merged_data$FossilFuelPercentage, na.color = "white")# Create the leaflet mapleaflet(merged_data) %>% addProviderTiles(providers$CartoDB.Positron) %>% addPolygons( fillColor = ~pal(FossilFuelPercentage), color = "#BDBDC3", weight = 1, opacity = 1, fillOpacity = 0.7, smoothFactor = 0.5, highlightOptions = highlightOptions( weight = 3, color = "#666", bringToFront = TRUE ), popup = ~paste( "<strong>Country:</strong>", name, "<br/>", "<strong>Fossil Fuel Percentage:</strong>", FossilFuelPercentage, "%" ) ) %>% addLegend( position = "topright", pal = pal, values = ~FossilFuelPercentage, labFormat = labelFormat(suffix = "%") ) %>% addControl( "<h4>Share of primary energy consumption from fossil fuels 2022</h4> <br/>Source: Energy Institute - Statistical Review of World Energy (2023)", position = "bottomleft", className = "map-source" )```In 2022, global investment in energy transition technologies hit a record USD 1.3 trillion. Yet, to meet the 1.5°C scenario outlined in [IRENA's 2023 World Energy Transitions Outlook](https://www.irena.org/Publications/2023/Jun/World-Energy-Transitions-Outlook-2023), investments must quadruple annually. Renewable energy investments also reached a new high of USD 0.5 trillion, but this is less than a third of the yearly investment required.This report aims to provide policymakers with insights into investment trends by answering the following questions, enabling them to use market instruments to develop and adapt policies that expand the global transition to renewable energy.**Investment Trends:** What are the trends in investment by technology, sector, region, source of finance, and financial instrument?**Financing Gaps:** What are the financing gaps in the deployment of renewable energy technologies, and how can these gaps be addressed through informed policy making?**Capital Markets Innovation:** How can the use of innovative capital markets instruments open up important additional avenues for investors, thereby enhancing the flow of funds towards the energy transition?## Data Source and MethodologyTo do this analysis, I use data from five data sets.**Energy Institute - Statistical Review of World Energy (2023)**: This dataset provides a comprehensive review of global energy statistics, focusing on primary energy sources before their transformation into electricity or other energy forms. [Energy Institute](https://www.energyinst.org/statistical-review)**World Bank Open Data**: This resource offers a wealth of information on global development indicators, including GDP per capita in current US dollars. [World Bank](https://data.worldbank.org/indicator/NY.GDP.PCAP.CD)**Global Carbon Budget (2023)**: This dataset focuses on per capita CO₂ emissions for the year 2022, excluding land-use changes but including emissions from fossil fuels and industry. [Global Carbon Budget](https://ourworldindata.org/grapher/co-emissions-per-capita#sources-and-processing)**IMF Climate Change Dashboard (Green Bonds)**: This dashboard highlights the growing sector of green bonds, financial instruments designed to support climate and environmental projects. [IMF(Green Bonds)](https://climatedata.imf.org/datasets/8e2772e0b65f4e33a80183ce9583d062_0/about)**IRENA Statistics Data (Finance and Investment)**: This dashboard sheds light on global trends in renewable energy investment, offering a overview of how funds are allocated across different renewable technologies and regions. [IRENA](https://climatedata.imf.org/datasets/8e2772e0b65f4e33a80183ce9583d062_0/about)## Private InvestmentBetween 2013 and 2020, the private sector funded about 75% of the world’s renewable energy investments, largely favoring established technologies due to a preference for lower-risk and financially lucrative opportunities. This trend is evident with 83% of solar PV investments in 2020 being privately financed, in contrast to hydropower, which rely predominantly on public finance, only 3% of its funding from private investors.```{r R Code, echo=TRUE, message=FALSE, warning=FALSE}library(readxl)library(dplyr)library(ggplot2)library(plotly)library(tidyr)data_path <- "C://Users//puxin//OneDrive//Documents//00_data_raw//2023_IRENA-CPI_RE_Investment_Trends.xlsx"df <- read_excel(data_path)df_source_private <- df %>% filter(Category == "Source", Product == "Private") %>% group_by(Year) %>% summarise(PrivateInvestment = sum(`Investment in USD billion`), .groups = 'drop')df_source_total <- df %>% filter(Category == "Source") %>% group_by(Year) %>% summarise(TotalInvestment = sum(`Investment in USD billion`), .groups = 'drop')# Join the data frames to calculate the proportion correctlydf_source_proportion <- df_source_private %>% left_join(df_source_total, by = "Year") %>% mutate(Proportion = PrivateInvestment / TotalInvestment)df_technology <- df %>% filter(Category == "Technology") %>% group_by(Year, Product) %>% summarise(TotalInvestment = sum(`Investment in USD billion`), .groups = 'drop') %>% group_by(Year) %>% mutate(Proportion = TotalInvestment / sum(TotalInvestment))# Prepare the colors for the stacked bar chartunique_products <- unique(df_technology$Product)colors <- RColorBrewer::brewer.pal(min(length(unique_products), 8), "Set3")# Starting Plotly object with region investment barsfig <- plot_ly()# Adding bars for each 'Product' within 'Region'for (i in seq_along(unique_products)) { product_data <- df_technology %>% filter(Product == unique_products[i]) fig <- fig %>% add_bars(data = product_data, x = ~Year, y = ~Proportion, name = unique_products[i], marker = list(color = colors[i]), offsetgroup = i)}# Adding Private Investment proportion linefig <- fig %>% add_lines(data = df_source_proportion, x = ~Year, y = ~Proportion, name = 'Private Investment in Source', line = list(color = 'blue')) %>% add_markers(data = df_source_proportion, x = ~Year, y = ~Proportion, name = 'Private Investment in Source', marker = list(color = 'red'))# Adjusting layout for clarityfig <- fig %>% layout(title = 'Proportion of Investments by Technology and Source Over Years', barmode = 'stack', xaxis = list(title = 'Year'), yaxis = list(title = 'Proportion', tickformat = ',.2%'), legend = list(title = list(text = 'Investment Type')), annotations = list( list( text = 'Bars: Investment Proportions by Technology within Regions<br>Line & Dots: Private Investment Proportion in Source', x = 0.5, xref = 'paper', yref = 'paper', y = -0.22, showarrow = FALSE, font = list(size = 12) ) ))# Display the interactive plotfig```Private capital also tends to flow to countries with lower real or perceived risks, or into frontier markets only when effective risk mitigation facilities are provided, while a large portion of the world’s population remains underserved.```{r R-Code, echo=TRUE, message=FALSE, warning=FALSE}library(readxl)library(dplyr)library(ggplot2)library(plotly)library(tidyr)data_path <- "C://Users//puxin//OneDrive//Documents//00_data_raw//2023_IRENA-CPI_RE_Investment_Trends.xlsx"df <- read_excel(data_path)df_source_private <- df %>% filter(Category == "Source", Product == "Private") %>% group_by(Year) %>% summarise(PrivateInvestment = sum(`Investment in USD billion`), .groups = 'drop')df_source_total <- df %>% filter(Category == "Source") %>% group_by(Year) %>% summarise(TotalInvestment = sum(`Investment in USD billion`), .groups = 'drop')# Join the data frames to calculate the proportion correctlydf_source_proportion <- df_source_private %>% left_join(df_source_total, by = "Year") %>% mutate(Proportion = PrivateInvestment / TotalInvestment)# Assuming df has already been loaded and prepareddf_region_technology <- df %>% filter(Category == "Region") %>% group_by(Year, Product) %>% summarise(TotalInvestment = sum(`Investment in USD billion`), .groups = 'drop') %>% group_by(Year) %>% mutate(Proportion = TotalInvestment / sum(TotalInvestment))# Prepare the colors for the stacked bar chartunique_products <- unique(df_region_technology$Product)colors <- RColorBrewer::brewer.pal(min(length(unique_products), 8), "Set3")# Starting Plotly object with region investment barsfig <- plot_ly()# Adding bars for each 'Product' within 'Region'for (i in seq_along(unique_products)) { product_data <- df_region_technology %>% filter(Product == unique_products[i]) fig <- fig %>% add_bars(data = product_data, x = ~Year, y = ~Proportion, name = unique_products[i], marker = list(color = colors[i]), offsetgroup = i)}# Adding Private Investment proportion linefig <- fig %>% add_lines(data = df_source_proportion, x = ~Year, y = ~Proportion, name = 'Private Investment in Source', line = list(color = 'blue')) %>% add_markers(data = df_source_proportion, x = ~Year, y = ~Proportion, name = 'Private Investment in Source', marker = list(color = 'red'))# Adjusting layout for clarityfig <- fig %>% layout(title = 'Proportion of Investments by Region and Source Over Years', barmode = 'stack', xaxis = list(title = 'Year'), yaxis = list(title = 'Proportion', tickformat = ',.2%'), legend = list(title = list(text = 'Investment Type')), annotations = list( list( text = 'Bars: Investment Proportions by Technology within Regions<br>Line & Dots: Private Investment Proportion in Source', x = 0.5, xref = 'paper', yref = 'paper', y = -0.22, showarrow = FALSE, font = list(size = 12) ) ))# Display the interactive plotfig```Generally speaking, this means that the lowest income populations often pay the most for essential energy, hindering poverty alleviation and socio-economic progress. This necessitates a much stronger role for public financing in these contexts and not fully relying on private capital which may keep widening the disparities.## Public InvestmentGlobally, the public sector provided less than one-third of renewable energy investment in 2020. State-owned financial institutions and national DFIs were the main sources that year. Multilateral DFIs provided 9% of public finance – accounted for about half of international flows coming from the public sector. Commitments from bilateral DFIs in 2020 fell 70% compared to 2019.```{r , echo=TRUE, message=FALSE, warning=FALSE}library(readxl)library(dplyr)library(plotly)library(DT)# Load the datadata_path <- "C://Users//puxin//OneDrive//Documents//00_data_raw//IRENA_RE_Public_Investment_2022.xlsx"df <- read_excel(data_path)# Summarize the investment amount by agencyagency_summary <- df %>% group_by(Agency) %>% summarise(TotalAmount = sum(`Amount (2020 USD million)`), .groups = 'drop') %>% arrange(desc(TotalAmount))# Keep only the top ten agencies and group the rest as 'Others'top_agencies <- agency_summary %>% slice(1:10) %>% mutate(units = "2020 USD million") # Add the "units" column for top 10 agenciesothers_sum <- sum(agency_summary$TotalAmount[-(1:10)])top_agencies <- bind_rows(top_agencies, tibble(Agency = "Others", TotalAmount = others_sum, units = "2020 USD million"))# Assuming you want to display the datatable with the 'units' informationdatatable(top_agencies, options = list(pageLength = 15, autoWidth = TRUE), rownames = FALSE) %>% formatCurrency(c('TotalAmount'), currency = 'USD', interval = 3, mark = ',') %>% formatStyle('TotalAmount', fontWeight = 'bold')# For the pie chart, since 'units' is the same for all categories, it doesn't need to be directly included in the plot# If you want to display it, consider adding it to the hover informationfig2 <- plot_ly(top_agencies, labels = ~Agency, values = ~TotalAmount, type = 'pie', textinfo = 'none', hoverinfo = 'label+percent+name', insidetextorientation = 'radial', hovertemplate = paste("<b>%{label}</b><br>Total: %{value} (%{percent})<br>Units: 2020 USD million")) %>% layout(title = 'Proportion of Investments by Agency (Top 10 and Others)', showlegend = TRUE)# Display the plotfig2```Due to limited public funds, governments have usually prioritized using available resources to make renewable energy projects more attractive to private investors by improving their risk-return profiles. Sovereign guarantees have been commonly used to address credit risks, but they may affecting its credit rating and ability to finance essential infrastructure by increasing a country's contingent liabilities.This is particularly problematic for emerging economies already facing significant debt and inflation post-COVID-19. As these countries struggle to secure affordable capital or offer sovereign guarantees, there's a pressing need for innovative financial instruments that enable energy transition without straining their economies.## Innovating Market Instruments: The Case of Green BondsInnovative capital-market instruments, such as green bonds, can open up crucial additional avenues through which investors can invest in renewables. Given the strong preference of institutional investors for indirect investments, ideally via listed and rated instruments, green bonds act as a bridge between such providers of capital and renewable energy assets.According to the [Climate Bond Initiative (CBI)](https://www.climatebonds.net/market/data/), the green bonds market has experienced a spectacular growth in the recent past, increasing from USD 36.6 billion worth of issuances in 2014 to USD nearly 500 billion in 2022.**Visual analysis:**The size of each point in the scatter plot below represents the total amount of green bonds issued by the country. The analysis reveals several key insights:**European Nations:** European nations, despite high GDP per capita, issue fewer green bonds, likely due to smaller financial markets.**China:** China leads in green bond issuance but also has high per capita carbon emissions, indicating a need for sustainable financial investment.**United States:** The United States is noted for its high GDP per capita and carbon emissions per capita, yet it ranks seventh in green bond issuance. This suggests that, despite its substantial economic and environmental footprint, the U.S. possesses untapped potential in the green bond market.```{r,R-Code-2, echo=TRUE, message=FALSE, warning=FALSE}library(readr)library(dplyr)library(plotly)# Load the datadata_path <- "C:/Users/puxin/OneDrive/Documents/03_data_processed/Final project sovereign data with CO2.csv"df <- read_csv(data_path)# Filter for 2022 and select the top ten countries based on cumulative_bn_usddf_2022_top10 <- df %>% filter(Year == 2022) %>% arrange(desc(cumulative_bn_usd)) %>% slice(1:10)# Calculate a sizeref for better size scaling of markersmax_cumulative_bn_usd <- max(df_2022_top10$cumulative_bn_usd, na.rm = TRUE)sizeref_value <- max_cumulative_bn_usd / 100 # Adjust 100 based on desired max marker size appearancefig <- plot_ly(data = df_2022_top10, x = ~log(GDP_Per_Capita), y = ~log(Annual_carbon_emissions_percapita), type = 'scatter', mode = 'markers', marker = list( size = ~cumulative_bn_usd, sizeref = sizeref_value, color = ~cumulative_bn_usd, # Color by cumulative_bn_usd to add variety colorscale = 'Viridis', # Use the 'Viridis' colorscale for visibility showscale = TRUE # Show color scale ), text = ~country, hoverinfo = 'text+x+y') %>% layout(title = 'Top 10 Cumulative Green Bond Investment Countries 2022 (USD Billion)', xaxis = list(title = 'GDP per capita current US$ (log scale) '), yaxis = list(title = 'Per capita CO₂ emissions (log scale)'), plot_bgcolor = 'rgba(0,0,0,0)', # Set plot background color to transparent or light color paper_bgcolor = 'rgba(0,0,0,0)', # Set paper background color to transparent or light color hovermode = 'closest')# Display the plotfig```## ConclusionThe report finds that investments have become further concentrated in specific mature technologies and uses, and in a small number of developed countries/regions. It underscores the need to direct public funds to regions and countries that have considerable untapped potential but find it difficult to attract investment. Funding must be focused on supporting energy transition infrastructure development, as well as enabling policy frameworks to drive investment and address persistent socio-economic gaps.