Function to search through the databases GENESIS, Zensus 2022 and regionalstatistik.de. It is similar in usage as the search function on the GENESIS main page (https://www-genesis.destatis.de/genesis/online). In the search query, "UND" (German word for 'and', also written "und" or "&") as well as "ODER" (German word for 'or', also written "oder" or "|") can be included and logically combined. Furthermore, wildcards are possible by including "*". If more then one word is included in the term string, 'and' is used automatically to combine the different words. Important note: Time-series are treated as cubes in GENESIS and regionalstatistik.de, they are not longer distinguished. If you want to find a specific object with a clear code with this find function, you need to specify the object type or search for all object types.
Arguments
- term
A character string with no maximum character length, but a word limit of five words.
- database
Character string. Indicator if the GENESIS ('genesis'), Zensus 2022 ('zensus') or regionalstatistik.de ('regio') database is called. Default option is 'all'.
- category
Character string. Specify specific GENESIS/regionalstatistik.de object types ('tables', 'statistics' and 'cubes') and specific Zensus 2022 object types ('tables' and 'statistics'). All types that are specific for one database can be used together. Default option is to use all types that are possible for the specific database.
- detailed
Boolean. Indicator if the function should return the detailed output of the iteration including all object-related information or only a shortened output including only code and object title. Default option is 'FALSE'.
- ordering
A logical. Indicator if the function should return the output of the iteration ordered first based on the fact if the searched term is appearing in the title of the object and secondly on an estimator of the number of variables in this object. Default option is 'TRUE'.
- pagelength
Integer. Maximum length of results (e.g., number of tables). Defaults to 500.
- error.ignore
Boolean. Indicator if the function should stop if an error occurs or no object for the request is found or if it should produce a token as response. Default option is 'TRUE'.
- verbose
Boolean. Indicator if the output of the function should include detailed messages and warnings. Default option is 'TRUE'. Set the parameter to 'FALSE' to suppress additional messages and warnings.
- ...
Additional parameters for the API call. These parameters are only affecting the call itself, no further processing. For more details see
vignette("additional_parameter")
.
Value
A list with all recalled elements from the API. Based on the 'detailed' parameter it contains more or less information, but always includes the code of the object, the title, and the type of the object. This is done to facilitate further processing with the data. Attributes are added to the data.frame describing the search configuration for the returned output.
Examples
if (FALSE) { # \dontrun{
# Find objects related to "bus" in GENESIS
object <- gen_find(term = "bus")
# Find tables related to "bus" in GENESIS and return a unordered detailed output
object <- gen_find(term = "bus", detailed = TRUE, ordering = FALSE)
# Find tables related to "Autos" or "Corona" in GENESIS and return a unordered detailed output
object <- gen_find(term = "autos ODER corona", detailed = TRUE, ordering = FALSE)
#' # Find tables related to "Autos" and "Corona" in GENESIS and return a unordered detailed output
object <- gen_find(term = "autos UND corona", detailed = TRUE, ordering = FALSE)
} # }