SearchByConcept {MacrobondAPI} | R Documentation |
This method is a shortcut for searching for series mathching a concept (RegionKey
) and a set of regions.
SearchByConcept(regions, concept, failIfMissing=TRUE)
region |
A list of region codes based on the ISO 3166 standard. There is a list of supported codes here: List of region codes. |
concept |
The name of the concept. |
failIfMissing |
A boolean that tells if the function should fail if matching series are not found for all specified regions. |
A list of series names where the list item names are the region codes. The list will be in the same order as the input.
This method is only available if you run Macrobond app 1.23 or later and have a Data Scientist license.
Calling this method is equivalent of doing:
q <- CreateSearchQuery()
setEntityTypeFilter(q, "TimeSeries")
addAttributeValueFilter(q, "RegionKey", concept)
addAttributeValueFilter(q, "Region", regions)
r <- getEntities(Search(q))
One way to find what concepts that exists is to look at a sample series and call getConcepts
.
getConcepts
GetConceptDescription
Search
SearchQuery
SearchResult
# Search for time series defined for the concept "gdp_total" for four countries and then download those series. gdp_names <- SearchByConcept(c("us", "gb", "jp", "cn"), "gdp_total") series <- FetchUnifiedTimeSeriesDefault(gdp_names)