Description Usage Arguments Value Examples
fetch_data
is the main function from this package to load the entire data set from the Government of India API.
1 2 |
res_id |
a string, JSON data resource id |
filter |
a named vector, specifying equality constrainsts of the form "variable" = "condition" |
select |
a vector, specifying variables/fields to be selected |
sort |
a named vector, specifying sort order in the form "variable" = "order" |
field_type_correction |
boolean, whether to apply field type correction. All data fields are downloaded as character and then corrected (if at all) based on accompanying metadata |
max_obs |
an integer, specifying maximum no of observations to fetch (will be rounded UP to the nearest 100) |
list a list of 2 elements - data from the Government of India API, and metadata, additional information about the fields
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
### fetch a dataset using it's resource id and your personal API key
# Basic Use:
fetch_data(res_id = "60a68cec-7d1a-4e0e-a7eb-73ee1c7f29b7")
# Advanced Use, specifying additional parameters
fetch_data(res_id = "60a68cec-7d1a-4e0e-a7eb-73ee1c7f29b7"
filter = c("state" = "Maharashtra"),
select = c("s_no_","constituency","state"),
sort = c("s_no_" = "asc","constituency" = "desc"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.