get_metadata_values | R Documentation |
Get all values for a specific variable
get_metadata_values(
operation = NULL,
variable = NULL,
value = NULL,
det = 0,
lang = "ES",
page = 0,
classification = NULL,
validate = TRUE,
verbose = FALSE,
hierarchy = NULL,
filter = NULL
)
operation |
(string): code of the operation. Provide code to get all
the values for the given operation. To obtain a list of
available operations see |
variable |
(int): id of a variable. To obtain a list of
available variables see |
value |
(int): id of a value. If an id value is specified, the children
of the value are requested. To obtain a list of
available values for a variable use |
det |
(int): level of detail. Valid values: 0, 1 or 2. |
lang |
(string): language of the retrieved data. Set to 'ES' for Spanish or set to 'EN' for English. |
page |
(int): page number. The retrieved result of the query is paginated (page=0 retrieves all pages). |
classification |
(int): id of a classification. To obtain a list of available
classifications see |
validate |
(logical): validate input parameters. A FALSE value means fewer API calls. |
verbose |
(logical): print additional information, including the URL to call the API service. |
hierarchy |
(int): depth of the hierarchy tree. |
filter |
(list): list of variables and values. When we request the hierarchy tree
there is the possibility of filtering using metadata information about the variables and their values
that define the series.
The format is
|
Data frame with information of the available values for the variable specified in the function
# Get the values of the variable "115"
df <- get_metadata_values(variable = 115)
head(df)
# Get the values of a variable for a specific operation
df <- get_metadata_values(operation = "IPC", variable = 115, validate = FALSE)
head(df)
# Get the children of a value (provinces of Galicia)
# Variable: Autonomous communities (id=70)
# Value: Galicia (id=9008)
df <- get_metadata_values(variable = 70, value = 9008)
head(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.