Learn R Programming

rStrava (version 1.0.0)

athl_fun: Get data for an athlete

Description

Get data for an athlete by web scraping, does not require authentication.

Usage

athl_fun(athl_num, trace = TRUE)

Arguments

athl_num

numeric vector of athlete id(s) used by Strava

trace

logical indicating if output is returned to console

Value

A list for each athlete, where each element is an additional list with elements for the units of measurement, location, current month data, monthly data, year-to-date data, and an all-time summary. The list elements are named using the athlete id numbers. NA will be returned if the data for an athlete could not be accessed.

Details

The athlete id is assigned to the user during registration with Strava and this must be known to use the function. Some users may have privacy settings that prevent public access to account information (NA will be returned). The function scrapes data from https://www.strava.com/athletes/ with the appended athlete id, e.g., https://www.strava.com/athletes/2837007. Opening the URL in a web browser can verify if the data can be scraped. Logging in to the Strava account on the website may also be required before using this function.

Examples

Run this code
# NOT RUN {
## single athlete
athl_fun(2837007)

## multiple athletes
athl_fun(c(2837007, 2527465))
# }

Run the code above in your browser using DataLab