Learn R Programming

rStrava (version 1.0.0)

get_streams: Retrieve a Strava data stream for a single activity

Description

Retrieve a Strava data stream for a single activity. Internally called by get_activity_streams.

Usage

get_streams(stoken, id, request = "activities", types = NULL,
  resolution = NULL, series_type = NULL)

Arguments

stoken

A config object created using the strava_oauth function

id

numeric for id of the request

request

chr string defining the stream type, must be "activities", "segment_efforts", "segments"

types

list of chr strings with any combination of "time", "latlng", "distance", "altitude", "velocity_smooth", "heartrate", "cadence", "watts", "temp", "moving", or "grade_smooth"

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

Data from an API request.

Details

Requires authentication stoken using the strava_oauth function and a user-created API on the strava website. From the API documentation, 'streams' is the Strava term for the raw data associated with an activity.

Examples

Run this code
# NOT RUN {
# create authentication token
# requires user created app name, id, and secret from Strava website
stoken <- httr::config(token = strava_oauth(app_name, app_client_id, 
	app_secret, cache = TRUE))

get_streams(stoken, id = 351217692, types = list('distance', 'latlng'))
# }

Run the code above in your browser using DataLab