Advertisement
jorandradefig

api.R

Mar 9th, 2019
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.71 KB | None | 0 0
  1. rm(list=ls())
  2.  
  3. ########################
  4. # API Scraping
  5. # @jorandradefig
  6. ########################
  7.  
  8. # instalar paquete
  9. install.packages("jsonlite")
  10.  
  11. # cargar el paquete
  12. library(jsonlite)
  13.  
  14. # descargar de github
  15.  
  16. hadley_orgs <- fromJSON("https://api.github.com/users/hadley/orgs")
  17. hadley_repos <- fromJSON("https://api.github.com/users/hadley/repos")
  18. gg_commits <- fromJSON("https://api.github.com/repos/hadley/ggplot2/commits")
  19. gg_issues <- fromJSON("https://api.github.com/repos/hadley/ggplot2/issues")
  20.  
  21. paste(format(gg_issues$user$login), ":", gg_issues$title)
  22.  
  23. # descargar de citibike
  24.  
  25. citibike <- fromJSON("http://citibikenyc.com/stations/json")
  26. stations <- citibike$stationBeanList
  27. colnames(stations)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement