diff --git a/R/gen_cube.R b/R/gen_cube.R index 120a14f..bb0b5e7 100644 --- a/R/gen_cube.R +++ b/R/gen_cube.R @@ -35,6 +35,9 @@ #' updated after this date.} #' \item{\code{language}}{Character string. Search terms, returned messages and data #' descriptions in German (`"de"`) or English (`"en"`)?} +#' \item{\code{...}}{Additional parameters for the API call (see respective API documentation). +#' A valid specification of these will not be checked by the function, so wrongful specification +#' may lead to errors.} #' } #' #' @return A [tibble][tibble::tibble()]. Non-data contents of the data cube object are saved in diff --git a/R/gen_logincheck.R b/R/gen_logincheck.R index 361fb73..7aa2778 100644 --- a/R/gen_logincheck.R +++ b/R/gen_logincheck.R @@ -1,8 +1,10 @@ #' gen_logincheck #' #' @description Function to check if a login is possible for a certain database. +#' #' @param database Character string. Indicator if the GENESIS ('genesis'), Zensus 2022 ('zensus') or regionalstatistik.de ('regio') database is called. Only one database can be addressed per function call. Default option is 'genesis'. #' @param verbose Boolean. In case of success, should a message be printed? Defaults to FALSE. +#' @param ... Additional parameters for the API call. These parameters are only affecting the call itself, no further processing. For more details see `vignette("additional_parameter")`. #' #' @return Leads to an informative error message if the login check failed and returns FALSE invisibly. Invisibly returns TRUE otherwise. #' @export @@ -12,8 +14,12 @@ #' gen_logincheck("zensus") #' } #' -gen_logincheck <- function(database, verbose = FALSE) { +gen_logincheck <- function(database, + verbose = FALSE, + ...) { - logincheck_http_error(database, verbose) + logincheck_http_error(database, + verbose, + ...) } diff --git a/R/gen_table.R b/R/gen_table.R index ac738bc..90ed32e 100644 --- a/R/gen_table.R +++ b/R/gen_table.R @@ -38,6 +38,9 @@ #' \item{\code{all_character}}{Boolean. Should all variables be imported as #' 'character' variables? Avoids fuzzy data type conversions if there are #' leading zeros or other special characters. Defaults to TRUE.} +#' \item{\code{...}}{Additional parameters for the API call (see respective API documentation). +#' A valid specification of these will not be checked by the function, so wrongful specification +#' may lead to errors.} #' } #' #' @return A [tibble][tibble::tibble()]. diff --git a/R/utils_httr2.R b/R/utils_httr2.R index 1869753..8633b6b 100644 --- a/R/utils_httr2.R +++ b/R/utils_httr2.R @@ -419,11 +419,13 @@ return_table_object <- function(response, #' #' @param database The user input to 'gen_logincheck' #' @param verbose Boolean. Should the function message in case of success? +#' @param ... Additional parameters (unchecked) #' #' @return Informative error/warning messages + invisibly TRUE/FALSE #' logincheck_http_error <- function(database, - verbose) { + verbose, + ...) { #----------------------------------------------------------------------------- @@ -439,7 +441,8 @@ logincheck_http_error <- function(database, #--------------------------------------------------------------------------- response <- gen_api(endpoint = "helloworld/logincheck", - database = database) + database = database, + ...) logincheck_stop_or_warn(response = response, error = TRUE, @@ -452,9 +455,9 @@ logincheck_http_error <- function(database, databases <- list("genesis", "zensus", "regio") - response_list <- list(response_genesis = gen_api(endpoint = "helloworld/logincheck", database = "genesis"), - response_zensus = gen_api(endpoint = "helloworld/logincheck", database = "zensus"), - response_regio = gen_api(endpoint = "helloworld/logincheck", database = "regio")) + response_list <- list(response_genesis = gen_api(endpoint = "helloworld/logincheck", database = "genesis", ...), + response_zensus = gen_api(endpoint = "helloworld/logincheck", database = "zensus", ...), + response_regio = gen_api(endpoint = "helloworld/logincheck", database = "regio", ...)) purrr::walk2(.x = response_list, .y = databases, @@ -478,7 +481,7 @@ logincheck_http_error <- function(database, if ("genesis" %in% database) { - logincheck_stop_or_warn(response = gen_api(endpoint = "helloworld/logincheck", database = "genesis"), + logincheck_stop_or_warn(response = gen_api(endpoint = "helloworld/logincheck", database = "genesis", ...), error = FALSE, verbose = verbose, database = "genesis") @@ -489,7 +492,7 @@ logincheck_http_error <- function(database, if ("zensus" %in% database) { - logincheck_stop_or_warn(response = gen_api(endpoint = "helloworld/logincheck", database = "zensus"), + logincheck_stop_or_warn(response = gen_api(endpoint = "helloworld/logincheck", database = "zensus", ...), error = FALSE, verbose = verbose, database = "zensus") @@ -500,7 +503,7 @@ logincheck_http_error <- function(database, if ("regio" %in% database) { - logincheck_stop_or_warn(response = gen_api(endpoint = "helloworld/logincheck", database = "regio"), + logincheck_stop_or_warn(response = gen_api(endpoint = "helloworld/logincheck", database = "regio", ...), error = FALSE, verbose = verbose, database = "regio") diff --git a/man/dot-gen_api_core.Rd b/man/dot-gen_api_core.Rd new file mode 100644 index 0000000..214a823 --- /dev/null +++ b/man/dot-gen_api_core.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/gen_api.R +\name{.gen_api_core} +\alias{.gen_api_core} +\title{.gen_api_core} +\usage{ +.gen_api_core(endpoint, database, ...) +} +\arguments{ +\item{endpoint}{Character string. The endpoint of the API that is to be queried.} + +\item{database}{The database the query should be sent to.} + +\item{...}{Further parameters passed on to the final API call.} +} +\description{ +Low-level function to interact with the one of the APIs +} diff --git a/man/gen_alternative_terms.Rd b/man/gen_alternative_terms.Rd index 9585f92..ca2f4ea 100644 --- a/man/gen_alternative_terms.Rd +++ b/man/gen_alternative_terms.Rd @@ -8,6 +8,7 @@ gen_alternative_terms( term = NULL, similarity = TRUE, database = c("all", "genesis", "zensus", "regio"), + pagelength = 500, verbose = TRUE, ... ) @@ -19,6 +20,8 @@ gen_alternative_terms( \item{database}{Character string. Indicator if the GENESIS ('genesis'), Zensus 2022 ('zensus') or regionalstatistik.de ('regio') database is called. Default option is 'all'.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} + \item{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.} \item{...}{Additional parameters for the API call. These parameters are only affecting the call itself, no further processing. For more details see \code{vignette("additional_parameter")}.} diff --git a/man/gen_catalogue.Rd b/man/gen_catalogue.Rd index a55ee36..1205030 100644 --- a/man/gen_catalogue.Rd +++ b/man/gen_catalogue.Rd @@ -11,6 +11,7 @@ gen_catalogue( area = c("all", "public", "user"), detailed = FALSE, sortcriterion = c("code", "content"), + pagelength = 500, error.ignore = FALSE, verbose = TRUE, ... @@ -29,6 +30,8 @@ gen_catalogue( \item{sortcriterion}{Character string. Indicator if the output should be sorted by 'code' or 'content'. This is a parameter of the API call itself. The default is 'code'.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} + \item{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 'FALSE'.} \item{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.} diff --git a/man/gen_cube.Rd b/man/gen_cube.Rd index 766e172..01ae4c2 100644 --- a/man/gen_cube.Rd +++ b/man/gen_cube.Rd @@ -41,6 +41,9 @@ with the keys separated by commas. Use of wildcard (\code{*}) allowed.} updated after this date.} \item{\code{language}}{Character string. Search terms, returned messages and data descriptions in German (\code{"de"}) or English (\code{"en"})?} +\item{\code{...}}{Additional parameters for the API call (see respective API documentation). +A valid specification of these will not be checked by the function, so wrongful specification +may lead to errors.} }} } \value{ diff --git a/man/gen_list_jobs.Rd b/man/gen_list_jobs.Rd index 6899f90..6117924 100644 --- a/man/gen_list_jobs.Rd +++ b/man/gen_list_jobs.Rd @@ -8,16 +8,22 @@ gen_list_jobs( database = c("genesis", "regio"), sortcriterion = c("type", "time", "status", "code"), flat = FALSE, + error.ignore = FALSE, + verbose = TRUE, ... ) } \arguments{ -\item{database}{Character string. Indicator if 'genesis' or 'regionalstatistik.de' database is called. Default option is 'genesis'.} +\item{database}{Character string. Indicator if 'genesis' or 'regionalstatistik.de' database is called.} \item{sortcriterion}{Character string. Indicator if the output should be sorted by 'type','time','status' or 'code'. This is a parameter of the API call itself. The default is 'type'.} \item{flat}{Boolean. Should the function return a list with jobs and metadata ('FALSE') or just a flat data.frame ('TRUE')? Defaults to FALSE.} +\item{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 'FALSE'.} + +\item{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.} + \item{...}{Additional parameters for the API call. These parameters are only affecting the call itself, no further processing. For more details see \code{vignette("additional_parameter")}.} } \value{ diff --git a/man/gen_logincheck.Rd b/man/gen_logincheck.Rd index cc93b1d..b615c0f 100644 --- a/man/gen_logincheck.Rd +++ b/man/gen_logincheck.Rd @@ -4,12 +4,14 @@ \alias{gen_logincheck} \title{gen_logincheck} \usage{ -gen_logincheck(database, verbose = FALSE) +gen_logincheck(database, verbose = FALSE, ...) } \arguments{ \item{database}{Character string. Indicator if the GENESIS ('genesis'), Zensus 2022 ('zensus') or regionalstatistik.de ('regio') database is called. Only one database can be addressed per function call. Default option is 'genesis'.} \item{verbose}{Boolean. In case of success, should a message be printed? Defaults to FALSE.} + +\item{...}{Additional parameters for the API call. These parameters are only affecting the call itself, no further processing. For more details see \code{vignette("additional_parameter")}.} } \value{ Leads to an informative error message if the login check failed and returns FALSE invisibly. Invisibly returns TRUE otherwise. diff --git a/man/gen_modified_data.Rd b/man/gen_modified_data.Rd index de0e4df..301d178 100644 --- a/man/gen_modified_data.Rd +++ b/man/gen_modified_data.Rd @@ -9,6 +9,7 @@ gen_modified_data( database = c("all", "genesis", "zensus", "regio"), type = c("all", "tables", "statistics", "statisticsUpdates"), date = c("now", "week_before", "month_before", "year_before"), + pagelength = 500, verbose = TRUE, ... ) @@ -22,6 +23,8 @@ gen_modified_data( \item{date}{Character string. Specific date that is used as the last update or upload time to include an object in return. Default option is 'now', which uses the current date of your system. Alternative options are 'week_before', using the current date of your system minus 7 days, 'month_before', using the current date of your system minus 4 weeks, and 'year_before', using the current date of your system minus 52 weeks. Additionally, it is possible to fill in a specific date of format 'DD.MM.YYYY'.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} + \item{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.} \item{...}{Additional parameters for the API call. These parameters are only affecting the call itself, no further processing. For more details see \code{vignette("additional_parameter")}.} diff --git a/man/gen_objects2stat.Rd b/man/gen_objects2stat.Rd index 47c1b29..f4d2f90 100644 --- a/man/gen_objects2stat.Rd +++ b/man/gen_objects2stat.Rd @@ -11,6 +11,7 @@ gen_objects2stat( area = c("all", "public", "user"), detailed = FALSE, sortcriterion = c("code", "content"), + pagelength = 500, error.ignore = FALSE, verbose = TRUE, ... @@ -29,6 +30,8 @@ gen_objects2stat( \item{sortcriterion}{Character string. Indicator if the output should be sorted by 'code' or 'content'. This is a parameter of the API call itself. The default is 'code'.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} + \item{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 'FALSE'.} \item{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.} diff --git a/man/gen_objects2var.Rd b/man/gen_objects2var.Rd index 0ef8516..ca04856 100644 --- a/man/gen_objects2var.Rd +++ b/man/gen_objects2var.Rd @@ -11,6 +11,7 @@ gen_objects2var( area = c("all", "public", "user"), detailed = FALSE, sortcriterion = c("code", "content"), + pagelength = 500, error.ignore = FALSE, verbose = TRUE, ... @@ -29,6 +30,8 @@ gen_objects2var( \item{sortcriterion}{Character string. Indicator if the output should be sorted by 'code' or 'content'. This is a parameter of the API call itself. The default is 'code'.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} + \item{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 'FALSE'.} \item{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.} diff --git a/man/gen_search_vars.Rd b/man/gen_search_vars.Rd index 8397e7e..22cfb9c 100644 --- a/man/gen_search_vars.Rd +++ b/man/gen_search_vars.Rd @@ -24,7 +24,7 @@ gen_search_vars( \item{sortcriterion}{Character string. Indicator if the output should be sorted by 'code' or 'content'. This is a parameter of the API call itself. The default is 'code'.} -\item{pagelength}{Integer. Maximum length of results (e.g., number of tables). Defaults to 500.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} \item{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 'FALSE'.} diff --git a/man/gen_table.Rd b/man/gen_table.Rd index 8cb2382..e6f3ee7 100644 --- a/man/gen_table.Rd +++ b/man/gen_table.Rd @@ -44,6 +44,9 @@ descriptions in German (\code{"de"}) or English (\code{"en"})?} \item{\code{all_character}}{Boolean. Should all variables be imported as 'character' variables? Avoids fuzzy data type conversions if there are leading zeros or other special characters. Defaults to TRUE.} +\item{\code{...}}{Additional parameters for the API call (see respective API documentation). +A valid specification of these will not be checked by the function, so wrongful specification +may lead to errors.} }} } \value{ @@ -54,7 +57,7 @@ Download a table with data from GENESIS, Zensus 2022 or regionalstatistik.de dat } \examples{ \dontrun{ -gen_table("21311-0001") +gen_table("21311-0001", database = "genesis") } } diff --git a/man/gen_val2var.Rd b/man/gen_val2var.Rd index dd9291b..9e777e2 100644 --- a/man/gen_val2var.Rd +++ b/man/gen_val2var.Rd @@ -24,7 +24,7 @@ gen_val2var( \item{sortcriterion}{Character string. Indicator if the output should be sorted by 'code' or 'content'. This is a parameter of the API call itself. The default is 'code'.} -\item{pagelength}{Integer. Maximum length of results (e.g., number of tables). Defaults to 500.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} \item{error.ignore}{Boolean. Indicator for values 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', this prevents the function to stop even if a variable has no further explanation (often the case for numerical variables).} diff --git a/man/gen_val2var2stat.Rd b/man/gen_val2var2stat.Rd index 91395fb..8acd1a0 100644 --- a/man/gen_val2var2stat.Rd +++ b/man/gen_val2var2stat.Rd @@ -28,7 +28,7 @@ gen_val2var2stat( \item{sortcriterion}{Character string. Indicator if the output should be sorted by 'code' or 'content'. This is a parameter of the API call itself. The default is 'code'.} -\item{pagelength}{Integer. Maximum length of results (e.g., number of tables). Defaults to 500.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} \item{error.ignore.var}{Boolean. Indicator for variables 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 'FALSE'.} diff --git a/man/gen_var2stat.Rd b/man/gen_var2stat.Rd index bd00dd9..8123222 100644 --- a/man/gen_var2stat.Rd +++ b/man/gen_var2stat.Rd @@ -27,7 +27,7 @@ gen_var2stat( \item{sortcriterion}{Character string. Indicator if the output should be sorted by 'code' or 'content'. This is a parameter of the API call itself. The default is 'code'.} -\item{pagelength}{Integer. Maximum length of results (e.g., number of tables). Defaults to 500.} +\item{pagelength}{Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.} \item{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 'FALSE'.} diff --git a/man/logincheck_http_error.Rd b/man/logincheck_http_error.Rd index 75e1cf1..2957c3d 100644 --- a/man/logincheck_http_error.Rd +++ b/man/logincheck_http_error.Rd @@ -4,12 +4,14 @@ \alias{logincheck_http_error} \title{logincheck_http_error} \usage{ -logincheck_http_error(database, verbose) +logincheck_http_error(database, verbose, ...) } \arguments{ \item{database}{The user input to 'gen_logincheck'} \item{verbose}{Boolean. Should the function message in case of success?} + +\item{...}{Additional parameters (unchecked)} } \value{ Informative error/warning messages + invisibly TRUE/FALSE