get_dists: Get distance from longitude and latitude points

View source: R/get_dists.R

get_distsR Documentation

Get distance from longitude and latitude points

Description

Get distance from longitude and latitude points

Usage

get_dists(lon, lat)

Arguments

lon

chr string indicating name of longitude column in dat_in

lat

chr string indicating name of latitude column in dat_in in dat_in

Details

Used internally in get_elev_prof on objects returned by get_latlon

Value

A vector of distances with the length as the number of rows in dat_in

Author(s)

Daniel Padfield

Examples

## Not run: 
# get activity data
stoken <- httr::config(token = strava_oauth(app_name, app_client_id, app_secret, cache = TRUE))
my_acts <- get_activity_list(stoken)

# get the latest activity
acts_data <- compile_activities(my_acts)[1, ]

# get lat, lon
polyline <- acts_data$map.summary_polyline
latlon <- get_latlon(polyline, key = mykey)

# get distance
get_dists(latlon$lon, latlon$lat)

## End(Not run)

rStrava documentation built on Oct. 23, 2024, 5:06 p.m.

Related to get_dists in rStrava...