get_centroid: Find central point for list of lat/long coordinates

Description Usage Arguments Examples

View source: R/get_centroid.R

Description

Find central point for list of lat/long coordinates

Usage

1
get_centroid(lat, lng, coord.unit = c("degrees", "radians"))

Arguments

lat

A quoted string indicating what named value in the bounding box represents latitude. If NULL, will be inferred from bounding box names.

lng

A quoted string indicating what named value in the bounding box represents longitude. If NULL, will be inferred from bounding box names.

coord.unit

The unit latitude and longitude are stored in.

Examples

1
2
3
4
5
df <- data.frame(
  lat = c(44.05771, 44.18475),
  lng = c(-73.99212, -73.81515)
)
get_centroid(df$lat, df$lng)

Example output

      lat       lng 
 44.12126 -73.90373 

spacey documentation built on March 15, 2020, 1:07 a.m.