Skip to content

Instantly share code, notes, and snippets.

@berkorbay
Created January 19, 2020 13:51
Show Gist options
  • Save berkorbay/79295d8018ae0879bad592b6b89f0a6c to your computer and use it in GitHub Desktop.
Save berkorbay/79295d8018ae0879bad592b6b89f0a6c to your computer and use it in GitHub Desktop.
İBB Açık Veri APIsini kullanarak İSPARK lokasyonlarını bir data frame'e indirip tibble'a dönüştürme kodu
## Paketler yüklü değilse install.packages kullanın
## install.packages(c("tidyverse","jsonlite"),repos="https://cran.r-project.org")
library(tidyverse)
library(jsonlite)
ispark_query_url <- "https://data.ibb.gov.tr/api/3/action/datastore_search_sql?sql=SELECT%20*%20from%20%22c3eb0d72-1ce4-4983-a3a8-6b0b4b19fcb9%22"
raw_value <- fromJSON(ispark_query_url)
raw_df <- raw_value$result$records %>% rename_all(~gsub("^_","",.)) %>% rename_all(~gsub(" |\\(|\\)|/","_",.)) %>% tbl_df()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment