recre_supply | R Documentation |
Sum up the total amount of a specific park attribute supplied to each building polygon. The amount per building depends on the distances between that particular building and all parks; attributes from parks further away are generally reduced, an effect also known as the 'distance decay' (Rossi et al., 2015; Tu et al., 2020).
recre_supply(park_attribute, dist_matrix, c = 1)
park_attribute |
numeric vector. Amount of a specific attribute per park. Length of vector is equal to the number of parks considered. |
dist_matrix |
Matrix containing buildings (rows) and their pairwise distances to each park (columns).
Order of parks (columns) should be identical to the order of parks (elements) in |
c |
Coefficient determining rate of decay in recreation supply with increasing distance. |
The supply S
of the park attribute is calculated based on the following equation:
S = \sum\limits_{i=1}^{n} s_{i} \cdot e^{-cd_{i}}
where
S
= Total supply of a specific park attribute to the building from parks i
;
i = 1,2,3
... n
, n
= total number of parks
s_{i}
= Supply of a specific park attribute from park i
.
A perfect positive linear association is assumed, since the focus is on supply metrics.
d_{i}
= Distance in kilometres from the building to park i
(e.g. Euclidean, Manhattan, etc.).
c
= Coefficient determining rate of decay in supply i
with increasing distance.
A numeric vector of the cumulative supply value per building (row) in the input matrix dist_matrix
.
The length of the vector equals to the number of buildings considered.
Rossi, S. D., Byrne, J. A., & Pickering, C. M. (2015). The role of distance in peri-urban national park use: Who visits them and how far do they travel?. Applied Geography, 63, 77-88.
Tu, X., Huang, G., Wu, J., & Guo, X. (2020). How do travel distance and park size influence urban park visits?. Urban Forestry & Urban Greening, 52, 126689.
## Not run:
data(parks_sgp) # load park polygons
data(buildings_pop_sgp) # load building polygons w population counts
# transform to projected crs
parks_sgp <- sf::st_transform(parks_sgp, sf::st_crs(32648))
buildings_pop_sgp <- sf::st_transform(buildings_pop_sgp, sf::st_crs(32648))
# Calculate pairwise distances between (the centroid of) each building & all parks
d_matrix <- buildings_pop_sgp %>%
st_centroid() %>%
st_distance(parks_sgp) # euclidean distance
m_dist <- m_dist / 1000 # convert distances to km
# run function for a specific park attribute (e.g. area)
recre_supply(park_attribute = parks_sgp$area,
dist_matrix = d_matrix,
c = 0.3) # example value for distance decay coefficient c
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.