An R package for assessing heat vulnerability across Spanish municipalities by integrating demographic data with spatial boundaries.
devtools::install_github("cczablan1/hvspkg")library(hvspkg)
# Join population to municipalities
muni <- join_population_to_municipalities(
example_municipalities,
example_population
)
#> Joined 10 municipalities; 0 have no matching population record.
# Create hvi_municipalities object
hvi_muni <- new_hvi_municipalities(muni)
print(hvi_muni)
#> Heat Vulnerability Municipalities
#> Municipalities : 10
#> Provinces : 4
#> CRS : EPSG:4326
#> Vulnerable pop : 14020
summary(hvi_muni)
#> Heat Vulnerability Municipalities - Summary
#> -------------------------------------------
#> Total municipalities : 10
#> Provinces covered : 4
#> Total population : 88370
#> Total vulnerable pop : 14020
#> Mean vulnerable pop : 1402
# Compute and plot the heat vulnerability index
hvi <- compute_hvi_score(hvi_muni)
print(hvi)
#> Heat Vulnerability Index
#> Municipalities: 10
#> Score range : [ 0 , 1 ]
#> Mean score : 0.413
plot(hvi)- Municipality boundaries: IGN via ArcGIS Living Atlas
- Population by age and sex: INE
- Province codes: INE
