Last active
February 9, 2018 00:21
-
-
Save cecilialee/ae5cbd3f3ff5a773e4d219da041ad229 to your computer and use it in GitHub Desktop.
Use morph.io API in R with httr. Then convert the content to a dataframe with jsonlite. Turn it to tibble for easier analysis. #r #httr #jsonlite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(httr) | |
library(jsonlite) | |
resp <- GET("https://api.morph.io/cecilialee/morph-scraper/data.json", | |
query = list("query" = "select * from 'data'", | |
"key" = "Kiu/NDU9OrgwJCJ1X/+2")) # fake API | |
dshk <- content(resp, as = "text") | |
dshk_df <- fromJSON(dshk) | |
# library(tidyverse) | |
# dshk_tbl <- as.tibble(dshk_df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment