── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ 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(lubridate)library(sf)
Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
library(rmapshaper)
The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
which was just loaded, will retire in October 2023.
Please refer to R-spatial evolution reports for details, especially
https://r-spatial.org/r/2023/05/15/evolution4.html.
It may be desirable to make the sf package available;
package maintainers should consider adding sf to Suggests:.
The sp package is now running under evolution status 2
(status 2 uses the sf package in place of rgdal)
library(raster)
Loading required package: sp
Attaching package: 'raster'
The following object is masked from 'package:dplyr':
select
library(stars)
Loading required package: abind
library(readxl)
4.1.1 Import Data
We first import the Peruvian map:
sf::sf_use_s2(FALSE)
Spherical geometry (s2) switched off
# Map of the administrative regions map_peru <- sf::st_read("../data/raw/shapefile_peru/departamentos/", quiet = T)map_peru <- rmapshaper::ms_simplify(input =as(map_peru, 'Spatial')) |>st_as_sf()
Then, we load the map with the definition of the natural regions:
# Map of the natural regions map_regiones_naturales <- sf::st_read(str_c("../data/raw/shapefile_peru/regiones_naturales/","region natural_geogpsperu_JuanPabloSuyoPomalia.geojson" ),quiet = T)
As the file contains a lot of unecessary details, we simplify the polygons:
natural_region_dep <- natural_region_dep |> labelled::set_variable_labels(region ="Name of the region",share_costa ="Share of coastal areas in the region",share_selva ="Share of forest areas in the region",share_sierra ="Share of highland areas in the region" )
Table 4.1: Variables in the natural_region_dep file
Variable name
Type
Description
region
character
Administrative Name of the Region
share_sierra
numeric
Share of highlands
share_selva
numeric
Share of forest
share_costa
numeric
Share of coast
5 El Niño–Southern Oscillation
Peru is exposed to the El Niño Southern Oscillation (ENSO) phenomenon. This phenomenon is due to irregular cyclical variations in sea surface temperatures and air pressure of the Pacific Ocean. The ENSO phenomenon is composed of two main phases: the warming phase El Niño, characterized by warmer ocean temperatures in the tropical western Pacific, and the cooling phase La Niña, with a cooling of the ocean surface.
The ENSO variations are classified using the Oceanic Niño Index, which computes a three-months average of the sea surface temperature anomalies in the central and eastern tropical Pacific Ocean. We collect this index from the Golden Gate Weather Service. An El Niño (or La Niña) event is defined by a five consecutive three-months periods with an index above 0.5 (or below -0.5 for a La Niña event).