Skip to content

Instantly share code, notes, and snippets.

View r-leyshon's full-sized avatar

Richard Leyshon r-leyshon

  • Office for National Statistics Data Science Campus
  • Wales, United Kingdom
View GitHub Profile
@gadenbuie
gadenbuie / render_toc.R
Last active July 3, 2023 15:13
Generate Manual Table of Contents in (R)Markdown Documents
#' Render Table of Contents
#'
#' A simple function to extract headers from an RMarkdown or Markdown document
#' and build a table of contents. Returns a markdown list with links to the
#' headers using
#' [pandoc header identifiers](http://pandoc.org/MANUAL.html#header-identifiers).
#'
#' WARNING: This function only works with hash-tag headers.
#'
#' Because this function returns only the markdown list, the header for the
@mGalarnyk
mGalarnyk / R_Github_Api.R
Last active September 7, 2021 14:55
Reading Data From GitHub API Using R. This code was originally for the John Hopkins Data Science Specialization. Blog on it https://medium.com/@GalarnykMichael/accessing-data-from-github-api-using-r-3633fb62cb08#.toufbbjgd
#install.packages("jsonlite")
library(jsonlite)
#install.packages("httpuv")
library(httpuv)
#install.packages("httr")
library(httr)
# Can be github, linkedin etc depending on application
oauth_endpoints("github")