Export#
# CSV
write.csv(output_dataset, file.path(output_dir, "social_vulnerability_index_logrono_2021.csv"), row.names = FALSE)
# GeoJSON
st_write(output_dataset_geom, file.path(output_dir, "social_vulnerability_index_logrono_2021.geojson"), delete_dsn=TRUE)
# Shapefile
# Need to manually rename these fields, otherwise we get a shapefile creation error
names(output_dataset_geom)[names(output_dataset_geom) == 'early_childhood_boy'] <- 'erly_cld_b'
names(output_dataset_geom)[names(output_dataset_geom) == 'early_childhood_girl'] <- 'erly_cld_g'
names(output_dataset_geom)[names(output_dataset_geom) == 'age_middle_to_oldest_old_male'] <- 'age_old_m'
names(output_dataset_geom)[names(output_dataset_geom) == 'age_middle_to_oldest_old_female'] <- 'age_old_f'
st_write(output_dataset_geom, file.path(output_dir, "social_vulnerability_index_logrono_2021.shp"), append = FALSE)
Deleting source `../../3_outputs/Spain/Logrono/2021/social_vulnerability_index_logrono_2021.geojson' using driver `GeoJSON'
Writing layer `social_vulnerability_index_logrono_2021' to data source
`../../3_outputs/Spain/Logrono/2021/social_vulnerability_index_logrono_2021.geojson' using driver `GeoJSON'
Writing 343 features with 38 fields and geometry type Multi Polygon.
Warning message in abbreviate_shapefile_names(obj):
“Field names abbreviated for ESRI Shapefile driver”
Deleting layer `social_vulnerability_index_logrono_2021' using driver `ESRI Shapefile'
Writing layer `social_vulnerability_index_logrono_2021' to data source
`../../3_outputs/Spain/Logrono/2021/social_vulnerability_index_logrono_2021.shp' using driver `ESRI Shapefile'
Writing 343 features with 38 fields and geometry type Multi Polygon.
END
Social Vulnerability Logroño - Calculate Vulnerability#
Environment#
R Libraries#
The relvant R libraries are imported in to the kernal:
Output directory#
Set the GUID#
Load Data#
Import the data#
Prepare Data#
Combine data into a single indicator dataset#
Weight the indicator datas#
Process social vulnerability scores#
Calculate domain scores#
Calculate dimension scores#
Need to collate the domains into the dimensions
Calculate vulnerability score#
Correlations#
Add geometry#