#------------------#
#### Librairies ####
#------------------#
library(sf)
library(dplyr)
library(plyr)
#--------------------------------------#
#### Read the Ecoregions shapefiles ####
#--------------------------------------#
#----------- Terrestrial Ecoregions of the World
#Download link: https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-the-world
#Import raw data
terrestrial <- sf::st_read("data/raw/ecoregions/terrestrial/wwf_terr_ecos.shp") %>%
sf::st_make_valid() %>%  #Correct invalid geometries
dplyr::mutate_at(c("ECO_NAME", "REALM", "BIOME"), as.factor)    #Change some variable to factor
