IEA Net-Zero Emissions by 2050 Roadmap scenario projection data
The projected Solar PV electricity generation by country and region.
If you are going to be joining datasets, what variables will you use to join those datasets? I will be using countries to join the dataset
What data do you need to pivot from wide format to long format? What data types should each variable be (dates, numeric, character, factor)? Character.
Step 2: Data cleaning
library(tidyverse)
Warning: package 'dplyr' was built under R version 4.2.3
Warning: package 'stringr' was built under R version 4.2.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.0
✔ 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(readxl)library(here)
here() starts at /Users/jiayiding/Desktop/Joy/Johns Hopkins University/Spring 2024/Sustainable Finance:Application and Methods/Sustainable Finance final project
library(ggplot2)library(patchwork)
Warning: package 'patchwork' was built under R version 4.2.3
Warning: The `x` argument of `as_tibble.matrix()` must have unique column names if
`.name_repair` is omitted as of tibble 2.0.0.
ℹ Using compatibility `.name_repair`.
# A tibble: 112 × 4
country_name scenario year value
<chr> <chr> <int> <dbl>
1 World "Historical" 2010 32.0
2 World "Historical" 2021 1023.
3 World "Historical" 2022 1291.
4 World "Stated\r\nPolicies" 2030 5405.
5 World "Stated\r\nPolicies" 2050 17220.
6 World "Announced\r\nPledges" 2030 6390.
7 World "Announced\r\nPledges" 2050 24297.
8 North America "Historical" 2010 3.35
9 North America "Historical" 2021 167.
10 North America "Historical" 2022 203.
# ℹ 102 more rows