A package for mountainbikers who use strava to log their rides and want to explore and visualise their rides data.
This package combines several tools :
Strava API is well documented here
mountainbikeR
uses object oriented programming, implemented as R6 class ( you can read mo here).
You should first create a personnal app in strava following this guide.
mountainbiker_initializer
You should initialise a mountainbikeR object using your strava credentials using mountainbiker_initializer$new()
.
In the example bellow, strava credentials are stored in ~/.Renviron
(see here).
my_mbr <- mountainbiker_initializer$new(
my_app_name = Sys.getenv("STRAVA_APP_NAME")
, my_client_id = Sys.getenv("STRAVA_CLIENT_ID_")
, my_client_secret = Sys.getenv("STRAVA_CLIENT_SECRET")
, my_app_scope = "read,read_all,activity:read_all"
, cache = FALSE
)
mountainbikeR
Datasetsstream_type
contains types of streamsworkout_types
contains types of workoutusethis::create_package("../mountainbikeR/")
Create github repository, add readme and GPL3.0 slicense and R gitignore
In Rstudio, add git support in the project properties, after Rstudio restart, in terminal :
# Remove the local .gitignore
rm .gitignore
# initiate the upstream tracking of the project on the GitHub repo
git remote add origin https://github.com/longwei66/mountainbikeR
# pull all files from the GitHub repo (typically just readme, license, gitignore)
git pull origin master
# set up GitHub repo to track changes on local machine
git push -u origin master
usethis::use_testthat()
usethis::use_data_raw()
devtools::document()
devtools::test()
devtools::check()
devtools::load_all()
https://jef.works/blog/2019/02/17/automate-testing-of-your-R-package/
https://docs.travis-ci.com/user/languages/r/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.