README.md

mountainbiker - when R meets mountainbike and strava

Build Status

What is mountainbikeR

A package for mountainbikers who use strava to log their rides and want to explore and visualise their rides data.

Objective

This package combines several tools :

Main functions

Getting & cleaning dat a from strava api

Documentation

Strava API is well documented here

Principles

mountainbikeR uses object oriented programming, implemented as R6 class ( you can read mo here).

Prerequisites

You should first create a personnal app in strava following this guide.

Initialization : 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 Datasets

Log - Setup Devops

Create package structure

usethis::create_package("../mountainbikeR/")

Set-up repo on github (or gitlab)

Create github repository, add readme and GPL3.0 slicense and R gitignore

Add git in the Rstudio

In Rstudio, add git support in the project properties, after Rstudio restart, in terminal :

Sync the github repo with local project

# 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

Set-up the test environement

usethis::use_testthat()

Set-up the raw data environment

usethis::use_data_raw()

Make the package

devtools::document()
devtools::test()
devtools::check()
devtools::load_all()

Add continuous integration

https://jef.works/blog/2019/02/17/automate-testing-of-your-R-package/

https://docs.travis-ci.com/user/languages/r/



longwei66/mountainbikeR documentation built on April 16, 2020, 6:23 p.m.