Calculates the concentration, which is the sum of all observations within a circle of a certain radius.
concentration(
sub,
full,
value,
lon_sub = lon,
lat_sub = lat,
lon_full = lon,
lat_full = lat,
radius = 200,
display_progress = TRUE
)
data.frame of target points to calculate concentration risk for, including at least columns for longitude and latitude.
data.frame containing reference points, where the function finds locations within a radius from the target points. Should include at least columns for longitude, latitude, and the value of interest to summarize.
column name with value of interest to summarize in full
.
column name in sub
for longitude
(default is lon
).
column name in sub
for latitude
(default is lat
).
column name in full
for longitude in full
(default is lon
).
column name in full
for latitude in full
(default is lat
).
numeric. Radius of the circle in meters (default is 200).
boolean indicating whether to show progress bar (TRUE/FALSE). Defaults to TRUE.
A data.frame equal to sub
including an additional
column concentration
.
df <- data.frame(location = c("p1", "p2"), lon = c(6.561561, 6.561398),
lat = c(53.21369, 53.21326))
concentration(df, Groningen, value = amount, radius = 100)
#> location lon lat concentration
#> 1 p1 6.561561 53.21369 775
#> 2 p2 6.561398 53.21326 2271