Using leaflet to create geographical mappings. NHS geographies as example.
-
Code as:
02-geoplot-approach.R
. -
ICB boundary downloaded from ONS Open Geography Geoportal. Others, such as Regions or Local Authorities, can also be sourced.
-
Additional ICB information (for hover, colour-coding, labels, filtering) can be defined in
ICS_master.xlsx
. In this case, as an example, we sourced some additional population projection information and practice number information from NHS England allocations. -
Trust file
trusts_master.xlsx
should contain latitute and longitude. This can be geocoded from postcodes (provided in reference files, namelyetr.csv
andect.csv
), by using a library such aspostcodesioR
. -
Further trust information (for hover, colour-coding, labels, filtering) can be defined as additional columns in the same file.
*(will render from https://nhsengland.github.io/leaflet-geomaps-NHS/). If seeing readme, click to website or follow links below.
Output of simple cloropleth of ICB boundaries
<iframe src="Output/ICS_2023-06-28-2.html" height="600px" width="100%" style="border:none;"></iframe>Output of cloropleth of ICB boundaries colour-coded for population
<iframe src="Output/ICS_pop_2023-06-28-2.html" height="600px" width="100%" style="border:none;"></iframe> <iframe src="Output/AOPv02-cloro-ICS_Trust_2023-06-28-2.html" height="600px" width="100%" style="border:none;"></iframe> <iframe src="Output/AOPv02-circles-cloro-ICS_Trust_2023-06-28-2.html" height="600px" width="100%" style="border:none;"></iframe>