Skip to content

Instantly share code, notes, and snippets.

@sebastianrothbucher
Created March 16, 2019 21:28
Show Gist options
  • Save sebastianrothbucher/bbff25cf0956add71fd8a89a02bdd68c to your computer and use it in GitHub Desktop.
Save sebastianrothbucher/bbff25cf0956add71fd8a89a02bdd68c to your computer and use it in GitHub Desktop.
handling JSON in R for quick prototyping
# losely based on https://gist.github.com/gluc/5f780246d57897b57c6b
library(jsonlite)
reposLoL <- fromJSON("https://api.github.com/users/hadley/repos", simplifyDataFrame = FALSE)
reposDf <- data.frame(name=unlist(sapply(reposLoL, function(x) x$name)), url=unlist(sapply(reposLoL, function(x) x$url)))
reposDfAlt <- fromJSON("https://api.github.com/users/hadley/repos", simplifyDataFrame = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment