View source: R/get_activity_streams.R
get_activity_streams | R Documentation |
Retrieve streams for activities, and convert to a dataframe.
get_activity_streams(act_data, ...)
## S3 method for class 'list'
get_activity_streams(
act_data,
stoken,
acts = NULL,
id = NULL,
types = NULL,
resolution = "high",
series_type = "distance",
...
)
## S3 method for class 'actframe'
get_activity_streams(
act_data,
stoken,
types = NULL,
resolution = "high",
series_type = "distance",
...
)
act_data |
an |
... |
arguments passed to or from other methods |
stoken |
A |
acts |
numeric indicating which activities to compile starting with most recent, defaults to all |
id |
optional character vector to specify the id(s) of the activity/activities to plot, |
types |
list indicating which streams to get for each activity, defaults to all available, see details. |
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 |
Each activity has a value for every column present across all activities, with NAs populating missing values.
For the types
argument, the default is type = NULL
which will retrieve all available stream types. The available stream types can be any of time
, latlng
, distance
, altitude
, velocity_smooth
, heartrate
, cadence
, watts
, temp
, moving
, or grade_smooth
. To retrieve only a subset of the types, pass a list argument with the appropriate character strings to type
, e.g., type = list("time", "latlng", "distance")
.
Invalid HTTP requests (404 or 400 code) may sometimes occur for activities with incomplete data, e.g., stationary activities with no distance information. In such cases, changing the 'series_type' and 'resolution' arguments may be needed, e.g., 'series_type = "time"' and 'resolution = "medium"'.
A stream frame object (strframe
that includes a data frame for the stream data along with the units
Lorenzo Gaborini
## 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.