View source: R/closest_focal_point.R
closest_focal_point | R Documentation |
For one row of an sf data frame, calculate the distance to the closest focal point. Return the name of the focal point, and the angle between focal point and centroid.
closest_focal_point(centroid, focal_points)
centroid |
a data frame describing one centroid |
focal_points |
a data frame of the longitude and latitude values |
data frame containing the name and location of the closest focal
# Create a set of polygon centroids
centroids <- create_centroids(tas_sa2, "sa2_5dig_2016")
# Find the closest capital city for the first centroid
closest_focal_point(centroids[1, ], capital_cities)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.