Skip to contents

The goal of CatalanHealthAreas is to provide an easy way to get the ABS code (“Àrees Bàsiques de Salut”) of a point in longitude-latitude coordinates. The latest division of Catalonia into ABS can be found in the website of the Health Department of the Government of Catalonia. Other data were publicly released from the Health Department of Catalonia.

Disclaimer: Although care has been taken to ensure that the transformation of the data is faithful, the author takes no responsibility on the possible errors of the package and it is intended for academic use. Any user is advised to check the latest version of the files which appear in the URL above.

Installation

You can install the development version of CatalanHealthAreas like another package of R. Note that in its current design it is difficult that it is released in CRAN due the size requirement. You can install it using the following code

remotes::install_git("https://codeberg.org/joaquimpuig/CatalanHealthAreas");

Example usage

This example shows how to assign an area code to a pair og long-lat coordinates.

library(terra)
#> terra 1.7.78
library(CatalanHealthAreas)
## basic example code
coords_186 <- rbind(c(446728.283,4593529.309)) #coordinates
example_point_186<-vect(coords_186,type="points") #point in terra format
ABS2024_map<-load_ABS_map(2024)
find_ABS_code(ABS2024_map,example_point_186) # ABS code of the point
#> [1] "186"