get_all_workouts: Makes a request against the 'api/user_id/workouts/' endpoint

Description Usage Arguments Examples

View source: R/queries.R

Description

Lists requested number of workouts for a user, along with some metadata.

Usage

1
2
3
4
5
6
7
8
9
get_all_workouts(
  userid = Sys.getenv("PELOTON_USERID"),
  num_workouts = 20,
  joins = "",
  dictionary = list(numeric = c("v2_total_video_buffering_seconds",
    "v2_total_video_watch_time_seconds")),
  parse_dates = TRUE,
  ...
)

Arguments

userid

userID

num_workouts

num_workouts

joins

additional joins to make on the data (e.g. 'ride' or 'ride.instructor', concatenated as a single string. Results in many additional columns being added to the data.frame)

dictionary

A named list. Maps a data-type to a column name. If NULL then no parsing is done

parse_dates

Whether to try and guess which columns are dates and convert

...

Other arguments passed on to methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
peloton_auth()
get_all_workouts()
get_all_workouts(joins = "ride,ride.instructor")
# if you run into parsing errors, sometimes helpful to manual override
workouts <- get_all_workouts(user_id,
  dictionary = list(
    "numeric" =
      c("v2_total_video_buffering_seconds", "v2_total_video_watch_time_seconds")
  )
)

## End(Not run)

bweiher/pelotonR documentation built on Jan. 9, 2021, 1:36 a.m.