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
configobject created using thestrava_oauthfunction- id
character 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" (seconds), "latlng", "distance" (meters), "altitude" (meters), "velocity_smooth" (meters per second), "heartrate" (bpm), "cadence" (rpm), "watts", "temp" (degrees Celsius), "moving" (boolean), or "grade_smooth" (percent)
- 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
resolutionis not equal to "all". Accepted values are "distance" or "time". If omitted, no merging is performed.
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
if (FALSE) { # \dontrun{
# 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'))
} # }