Skip to content

Instantly share code, notes, and snippets.

View osmancansiz's full-sized avatar
:octocat:
Working

Osman Cansız osmancansiz

:octocat:
Working
View GitHub Profile
@berkorbay
berkorbay / ibb_open_data_ispark_query.R
Created January 19, 2020 13:51
İ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()