closest_focal_point {sugarbag}R Documentation

For the polygon provided, find the closest focal point in the set provided

Description

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.

Usage

closest_focal_point(centroid, focal_points)

Arguments

centroid

a data frame describing one centroid

focal_points

a data frame of the longitude and latitude values

Value

data frame containing the name and location of the closest focal

Examples

# 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)

[Package sugarbag version 0.1.6 Index]