Created
January 19, 2020 18:52
-
-
Save berkorbay/493e82b3d48245317c57a5d0c334492e to your computer and use it in GitHub Desktop.
İBB Açık Veri Portalı'ndan veri çekme R fonksiyonu
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
## İlgili veri setinde önizleme'ye tıklayın çıkan url adresinde "/resource/"tan sonraki kodu kopyalayın (data_id) | |
ibb_data_pull <- function(data_id="e1e2b771-b4de-49d3-b779-17b4bba10fb7"){ | |
ibb_query_url <- paste0("https://data.ibb.gov.tr/api/3/action/datastore_search_sql?sql=SELECT%20*%20from%20%22",data_id,"%22") | |
json_query_response <- jsonlite::fromJSON(ibb_query_url) | |
return_df <- json_query_response$result$records %>% rename_all(~gsub("^_","",.)) %>% rename_all(~gsub(" |\\(|\\)|/","_",.)) %>% tbl_df() | |
return(return_df) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment