Learn R Programming

rStrava (version 1.3.1)

get_dists: Get distance from longitude and latitude points

Description

Get distance from longitude and latitude points

Usage

get_dists(lon, lat)

Value

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

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

Author

Daniel Padfield

Details

Used internally in get_elev_prof on objects returned by get_latlon

Examples

Run this code
if (FALSE) {
# 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)
}

Run the code above in your browser using DataLab