Skip to content

Commit

Permalink
add message on startup, fix pagelength param
Browse files Browse the repository at this point in the history
  • Loading branch information
yannikbuhl committed Feb 12, 2025
1 parent fdbdbcb commit 9281d00
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 21 deletions.
3 changes: 2 additions & 1 deletion R/gen_alternative_terms.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @param term Character string. Maximum length of 15 characters. Term or word for which you are searching for alternative or related terms. Use of '*' as a placeholder is possible to generate broader search areas.
#' @param similarity Boolean. Indicator if the output of the function should be sorted based on a Levenshtein edit distance based on the \code{adist()} function. Default is 'TRUE'.
#' @param database Character string. Indicator if the GENESIS ('genesis'), Zensus 2022 ('zensus') or regionalstatistik.de ('regio') database is called. Default option is 'all'.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500. Maximum of the databases is 25,000 objects.
#' @param 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.
#' @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")`.
#'
Expand Down Expand Up @@ -66,6 +66,7 @@ gen_alternative_terms <- function(term = NULL,
username = gen_auth_get(database = db)$username,
password = gen_auth_get(database = db)$password,
selection = term,
pagelength = pagelength,
...)

#---------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion R/gen_catalogue.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @param area Character string. Indicator from which area of the database the results are called. In general, 'all' is the appropriate solution. Default option is 'all'. Not used for 'statistics'.
#' @param 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'.
#' @param 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'.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500. Maximum of the databases is 25,000 objects.
#' @param 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'.
#' @param 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.
#' @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")`.
Expand Down Expand Up @@ -93,6 +93,7 @@ gen_catalogue <- function(code = NULL,
selection = code,
sortcriterion = sortcriterion,
area = area,
pagelength = pagelength,
...)

# Test validity of JSON results
Expand Down Expand Up @@ -147,6 +148,7 @@ gen_catalogue <- function(code = NULL,
password = gen_auth_get(database = db)$password,
selection = code,
sortcriterion = sortcriterion,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down Expand Up @@ -198,6 +200,7 @@ gen_catalogue <- function(code = NULL,
selection = code,
area = area,
sortcriterion = sortcriterion,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down
3 changes: 2 additions & 1 deletion R/gen_find.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param 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.
#' @param 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'.
#' @param 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'.
#' @param pagelength Integer. Maximum length of results (e.g., number of tables). Defaults to 500.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500. Maximum of the databases is 25,000 objects.
#' @param 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'.
#' @param 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.
#' @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")`.
Expand Down Expand Up @@ -87,6 +87,7 @@ gen_find <- function(term = NULL,
password = gen_auth_get(database = db)$password,
term = term,
category = category,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down
6 changes: 5 additions & 1 deletion R/gen_modified_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param database Character string. Indicator if the GENESIS ('genesis'), Zensus 2022 ('zensus') or regionalstatistik.de ('regio') database is called. Default option is 'all'.
#' @param type Character string. Specific GENESIS and regionalstatistik.de object types: 'tables', 'statistics', and 'statisticsUpdates'. Specific Zensus 2022 object types: 'tables' and 'statistics'. All types that are specific for one database can be used together through 'all', which is the default.
#' @param 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'.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500. Maximum of the databases is 25,000 objects.
#' @param 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.
#' @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")`.
#'
Expand Down Expand Up @@ -92,6 +92,7 @@ gen_modified_data <- function(code = "",
selection = code,
type = "Neue Tabellen",
date = date,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand All @@ -111,6 +112,7 @@ gen_modified_data <- function(code = "",
selection = code,
type = "Neue Statistiken",
date = date,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand All @@ -133,6 +135,7 @@ gen_modified_data <- function(code = "",
selection = code,
type = "Aktualisierte Statistiken",
date = date,
pagelength = pagelength,
...)

}
Expand All @@ -154,6 +157,7 @@ gen_modified_data <- function(code = "",
selection = code,
type = "all",
date = date,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down
5 changes: 4 additions & 1 deletion R/gen_objects2stat.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @param area Character string. Indicator from which area of the database the results are called. In general, 'all' is the appropriate solution. Default option is 'all'. Not used for 'statistics'.
#' @param 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'.
#' @param 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'.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500. Maximum of the databases is 25,000 objects.
#' @param 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'.
#' @param 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.
#' @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")`.
Expand Down Expand Up @@ -84,6 +84,7 @@ gen_objects2stat <- function(code = NULL,
name = code,
area = area,
sortcriterion = sortcriterion,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down Expand Up @@ -134,6 +135,7 @@ gen_objects2stat <- function(code = NULL,
name = code,
area = area,
sortcriterion = sortcriterion,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down Expand Up @@ -192,6 +194,7 @@ gen_objects2stat <- function(code = NULL,
name = code,
area = area,
sortcriterion = sortcriterion,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down
5 changes: 4 additions & 1 deletion R/gen_objects2var.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @param area Character string. Indicator from which area of the database the results are called. In general, 'all' is the appropriate solution. Default option is 'all'. Not used for 'statistics'.
#' @param 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'.
#' @param 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'.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500.
#' @param pagelength Integer. Maximum length of results or objects (e.g., number of tables). Defaults to 500. Maximum of the databases is 25,000 objects.
#' @param 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'.
#' @param 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.
#' @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")`.
Expand Down Expand Up @@ -84,6 +84,7 @@ gen_objects2var <- function(code = NULL,
name = code,
area = area,
sortcriterion = sortcriterion,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down Expand Up @@ -134,6 +135,7 @@ gen_objects2var <- function(code = NULL,
name = code,
area = area,
sortcriterion = sortcriterion,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down Expand Up @@ -189,6 +191,7 @@ gen_objects2var <- function(code = NULL,
name = code,
area = area,
sortcriterion = sortcriterion,
pagelength = pagelength,
...)

results_json <- test_if_json(results_raw)
Expand Down
Loading

0 comments on commit 9281d00

Please sign in to comment.