R/browse.R

Defines functions browse

Documented in browse

#' Open a gist on GitHub
#' 
#' @export
#' @param gist A gist object or something that can be coerced to a gist object.
#' @param what One of html (default), json, forks, commits, or comments. 

browse <- function(gist, what="html"){
  gist <- as.gist(gist)
  url <- switch(
    what, 
    html = "html_url", json = "url", forks = "forks_url", 
    commits = "commits_url", comments = "comments_url"
  )
  utils::browseURL(gist[[url]])
}

Try the gistr package in your browser

Any scripts or data that you put into this service are public.

gistr documentation built on July 29, 2020, 9:07 a.m.