Description Usage Arguments Value Examples
Using the API index name you got from the API Search/Discovery functions or from the API list available on data.gov.in, get the data in a convenient way parsed into a an R-friendly data frame.
1 2 3 4 5 6 7 | get_api_data(
api_index,
results_per_req = "all",
filter_by = c(),
field_select = c(),
sort_by = c()
)
|
api_index |
Index name of the API |
results_per_req |
Integer number of results to get per request ; "all" would get all the results |
filter_by |
A named character vector of field id (not the name) - value(s) pairs ; can take multiple fields as well as multiple comma separated values |
field_select |
A character vector of fields required in the final data frame |
sort_by |
A character vector of fields to sort by in the final data frame |
data.frame containing the queried data
1 2 3 4 5 6 7 8 9 10 | ## Not run:
register_api_key("api_key")
request_data<-get_api_data(api_index="3b01bcb8-0b14-4abf-b6f2-c1bfd384ba69",
results_per_req=10,filter_by=c(state="Punjab,Haryana",
district="Amritsar,Ludhiana"),
field_select=c('state','district','city'),
sort_by=c('state','district','city'))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.