fmap_plot | R Documentation |
Function for plotting Fresnel Maps, or thematic maps that visualise spatial data to the level of equal-area concentric circular zones (or annuli).
fmap_plot(
ncircles,
radius_inner = NULL,
radius_outer = NULL,
geo_points,
lat = NULL,
lon = NULL,
geo_centre = NULL,
geo_centres = NULL,
id_var = NULL,
sum = NULL,
mean = NULL,
median = NULL,
count = F
)
ncircles |
Number of concentric circular zones of equal area (i.e. Fresnel circles) including the inner circle and annuli |
radius_inner |
Radius of innermost Fresnel circle in metres |
radius_outer |
Radius of outermost Fresnel circle in metres |
geo_points |
A spatial dataset of points to aggregate |
lat |
Latitude of the centre of the Fresnel Map |
lon |
Longitude of the centre of the Fresnel Map |
geo_centre |
A spatial dataset containing the coordinates of the centre of the Fresnel Map |
geo_centres |
A spatial dataset containing the coordinates of the centres of each separate Fresnel Map |
id_var |
Variable from geo_centres containing the location ID |
sum |
Variable from geo_points for calculating sum |
mean |
Variable from geo_points for calculating mean |
median |
Variable from geo_points for calculating median |
count |
Count the number of points from geo_points. Input TRUE to count points. Defaults to FALSE |
A Fresnel Map based on aggregations of points-based data and visualised using tmap.
library(sf)
library(dplyr)
# Load the sf datasets of cholera deaths and Soho pumps
data(cholera_deaths, soho_pumps)
# Filter the Broad Street Pump from the Soho pumps dataset
bstreet_pump <- soho_pumps %>% filter(soho.pump == "Broad Street")
# The Fresnel Map based on the Broad Street Pump
fmap_plot(radius_inner = 125, ncircles = 8, geo_centre = bstreet_pump, geo_points = cholera_deaths, sum = "cholera.deaths")
# Map of multiple Fresnel Maps based on each Soho pump
fmap_plot(radius_inner = 125, ncircles = 2, geo_centres = soho_pumps, id_var = "soho.pump", geo_points = cholera_deaths, sum = "cholera.deaths")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.