Query a data set using GET and a query URL
get_dataset.Rd
This function provides a method for generating and sending a URL based data query to the EES API. As a minimum, it requires the dataset_id and indicators flags to be provided.
Note that the GET command is very limited on the level of logic it can process. For example there is no way of using GET to make a query that combines different filters with AND logic. So if you give GET a set of filter items to search on, it can only return all rows containing any of those items.
Usage
get_dataset(
dataset_id,
indicators,
time_periods = NULL,
geographic_levels = NULL,
locations = NULL,
filter_items = NULL,
dataset_version = NULL,
ees_environment = NULL,
api_version = NULL,
page = NULL,
page_size = 10000,
parse = TRUE,
verbose = FALSE
)
Arguments
- dataset_id
ID of data set to be connected to. This is required if the endpoint is one of "get-summary", "get-meta", "get-csv", "get-data" or "post-data"
- indicators
Indicators required as a string or vector of strings (required)
- time_periods
Time periods required as a string ("period|code") or vector of strings
- geographic_levels
Geographic levels required as a string or vector of strings
- locations
Location code required as a string or vector of strings
- filter_items
Filter items required as a string or vector of strings
- dataset_version
Version of data set to be connected to
- ees_environment
EES ees_environment to connect to: "dev", "test", "preprod" or "prod"
- api_version
EES API version
- page
Page number of query results to return
- page_size
Number of results to return in a single query
- parse
Logical flag to activate parsing of the results. Default: TRUE
- verbose
Run with additional contextual messaging. Logical, default = FALSE
Examples
get_dataset(
example_id(),
geographic_levels = c("NAT"),
filter_items = example_id("filter_item"),
indicators = example_id("indicator")
)
#> code period geographic_level nat_name nat_code establishment_type
#> 1 AY 2023/2024 NAT England E92000001 Primary schools
#> 2 AY 2022/2023 NAT England E92000001 Primary schools
#> 3 AY 2021/2022 NAT England E92000001 Primary schools
#> count_absent_sessions
#> 1 27819920
#> 2 32350550
#> 3 30023935