Learn R Programming

rStrava (version 1.0.0)

get_activity_streams: Retrieve streams for activities, and convert to a dataframe

Description

Retrieve streams for activities, and convert to a dataframe.

Usage

get_activity_streams(act_data, ...)

# S3 method for list get_activity_streams(act_data, stoken, acts = NULL, types = NULL, resolution = "high", series_type = "distance", ...)

# S3 method for actframe get_activity_streams(act_data, stoken, acts = NULL, types = NULL, resolution = "high", series_type = "distance", ...)

Arguments

act_data

an list object returned by get_activity_list or a data.frame returned by compile_activities

...

arguments passed to or from other methods

stoken

A config object created using the strava_oauth function

acts

numeric indicating which activities to compile starting with most recent, defaults to all

types

list indicating which streams (lat/lng/time/...) to get for each activity, defaults to all available

resolution

chr string for the data resolution to retrieve, can be "low", "medium", "high", defaults to all

series_type

chr string for merging the data if resolution is not equal to "all". Accepted values are "distance" (default) or "time".

Value

A stream frame object (strframe that includes a data frame for the stream data along with the units

Details

Each activity has a value for every column present across all activities, with NAs populating missing values.

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
stoken <- httr::config(token = strava_oauth(app_name, app_client_id, app_secret, cache = TRUE))

my_acts <- get_activity_list(stoken) 

strms_data <- get_activity_streams(my_acts, stoken, acts = 1:2)

# }

Run the code above in your browser using DataLab