Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brian-bot/githubr
Making it easy to talk to GitHub from R
https://github.com/brian-bot/githubr
Last synced: 9 days ago
JSON representation
Making it easy to talk to GitHub from R
- Host: GitHub
- URL: https://github.com/brian-bot/githubr
- Owner: brian-bot
- License: gpl-3.0
- Created: 2016-02-19T19:49:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-06-18T16:34:22.000Z (over 3 years ago)
- Last Synced: 2024-08-13T07:14:05.941Z (4 months ago)
- Language: R
- Size: 300 KB
- Stars: 19
- Watchers: 3
- Forks: 6
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
- jimsghstars - brian-bot/githubr - Making it easy to talk to GitHub from R (R)
README
## githubr
##### Making it easy to talk to GitHub from R-----
[![Travis-CI Build Status](https://travis-ci.org/brian-bot/githubr.svg?branch=master)](https://travis-ci.org/brian-bot/githubr)##### Installing `githubr`:
Currently, `githubr` is not available via CRAN, but can be installed directly from GitHub using the `devtools` package. A little bit meta, huh?
```r
install.packages("devtools")
require(devtools)
install_github("brian-bot/githubr")
```-----
##### Overview
The purpose is to allow users to:
* Use GitHub as a version control system for analysis code in addition to enterprise software development
* Store code centrally for sourcing into an analysis environment
* Allow easy sharing and forking of code that may be useful for othersCurrent status:
* For access to private repositories and/or to have an increased limit on the number of API calls, users should register a personal access token with the client via the `setGithubToken` function. Personal access tokens can be generated on your [GitHub settings page](https://github.com/settings/tokens). Once you have called `setGithubToken`, the token passed to this function is then used for all subsequent calls to GitHub API for the current R session.
* Currently staying away from downloading files -- sticking with meta-information and ability to directly source files
* `sourceRepoFile` sources code into the global environment, but allows users to pass optional arguments as specified in the `base::source()` function-----
##### Quickstart Guide
```r
## LOAD THE PACKAGE
require(githubr)## USE TOKEN TO AUTHENTICATE FOR YOUR CURRENT SESSION
setGithubToken("myTokenFromGithub12345678")#####
## ACCESSING META-INFORMATION ABOUT A GITHUB REPOSITORY
#####
## FOR HEAD OF MASTER BRANCH OF A GITHUB REPOSITORY
repoHead <- getRepo('brian-bot/githubr')## OR HEAD OF A SPECIFIC BRANCH (dev)
repoBranch <- getRepo('brian-bot/githubr', ref='branch', refName='dev')## OR A SPECIFIC COMMIT
repoCommit <- getRepo('brian-bot/githubr', ref='commit', refName='d3960fdbb8b1a4ef6990d90283d6ec474e424d5d')#####
## VIEW THE SPECIFIC TIMEPOINT ON GITHUB WEBSITE
#####
view(repoHead)#####
## SOURCING A FILE FROM A REPOSITORY
#####
sourceRepoFile(repoDev, "inst/misc/helloWorld.R")```