Learn R Programming

spacey (version 0.1.1)

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

Description

Find central point for list of lat/long coordinates

Usage

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

Run this code
# NOT RUN {
df <- data.frame(
  lat = c(44.05771, 44.18475),
  lng = c(-73.99212, -73.81515)
)
get_centroid(df$lat, df$lng)
# }

Run the code above in your browser using DataLab