Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
Merge branch 'main' into dev

# Conflicts:
#	.Rbuildignore
#	DESCRIPTION
#	NEWS.md
#	R/data.R
#	R/gen_alternative_terms.R
#	R/gen_api.R
#	R/gen_auth.R
#	R/gen_catalogue.R
#	R/gen_cube.R
#	R/gen_find.R
#	R/gen_list_jobs.R
#	R/gen_meta_data.R
#	R/gen_modified_data.R
#	R/gen_objects2stat.R
#	R/gen_objects2var.R
#	R/gen_table.R
#	R/gen_var2-val2.R
#	R/utils.R
#	R/zzz.R
#	cran-comments.md
#	man/evas_list.Rd
#	man/gen_alternative_terms.Rd
#	man/gen_auth_save.Rd
#	man/gen_catalogue.Rd
#	man/gen_cube.Rd
#	man/gen_find.Rd
#	man/gen_list_jobs.Rd
#	man/gen_metadata.Rd
#	man/gen_metadata_cube.Rd
#	man/gen_metadata_stats.Rd
#	man/gen_metadata_tab.Rd
#	man/gen_metadata_val.Rd
#	man/gen_metadata_var.Rd
#	man/gen_modified_data.Rd
#	man/gen_objects2stat.Rd
#	man/gen_objects2var.Rd
#	man/gen_search_vars.Rd
#	man/gen_table.Rd
#	man/gen_val2var.Rd
#	man/gen_val2var2stat.Rd
#	man/gen_var2stat.Rd
  • Loading branch information
yannikbuhl committed Jul 21, 2024
2 parents 016c85c + 4ec7d47 commit f669442
Show file tree
Hide file tree
Showing 39 changed files with 1,349 additions and 72 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
^pkgdown$
^codecov\.yml$
^cran-comments\.md$
<<<<<<< HEAD
=======
^CRAN-SUBMISSION$
>>>>>>> main
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [dev]
branches: [main, dev]
pull_request:
branches: [dev]
branches: [main, dev]

name: R-CMD-check

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [dev]
branches: [main, dev]
pull_request:
branches: [dev]
branches: [main, dev]
release:
types: [published]
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [dev]
branches: [main, dev]
pull_request:
branches: [dev]
branches: [main, dev]

name: test-coverage

Expand Down
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.1.0
Date: 2023-06-28 10:04:36 UTC
SHA: e4b477312427801d3b3cf03fdce906e6c1163b14
13 changes: 10 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Package: restatis
Title: R Wrapper to Access a Wide Range of Germany's Federal Statistical System Databases Based on the GENESIS Web Service RESTful API of the German Federal Statistical Office (Statistisches Bundesamt/Destatis)
Title: R Wrapper to Access a Wide Range of Germany's Federal Statistical System
Databases Based on the GENESIS Web Service RESTful API of the German Federal
Statistical Office (Statistisches Bundesamt/Destatis)
Version: 0.2.0
Authors@R: c(
person("Yannik", "Buhl", , "[email protected]", role = c("aut", "cre")),
Expand All @@ -8,22 +10,25 @@ Authors@R: c(
person("Dorian", "Le Jeune", role = "aut"),
person("Long", "Nguyen", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-8878-7386")),
person("Johannes", "Ritter", role = "aut")
person("Johannes", "Ritter", , "[email protected]", role = "aut")
)
Description: A RESTful API wrapper for accessing the GENESIS database of
the German Federal Statistical Office (Destatis) as well as its Census
Database and the database of Germany's regional statistics. Supports data
search functions, credential management, result caching, and handling
remote background jobs for large datasets.
License: MIT + file LICENSE
URL: https://correlaid.github.io/restatis/
URL: https://correlaid.github.io/restatis/,
https://github.com/CorrelAid/restatis
BugReports: https://github.com/CorrelAid/restatis/issues
Depends:
R (>= 2.10)
Imports:
askpass,
httr2,
memoise,
readr,
stats,
tibble,
vctrs,
purrr
Expand All @@ -34,6 +39,8 @@ Suggests:
rmarkdown,
testthat (>= 3.0.0),
rvest
usethis,
withr
VignetteBuilder:
knitr
Config/testthat/edition: 3
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ export(gen_logincheck)
export(gen_metadata)
export(gen_metadata_cube)
export(gen_metadata_statistic)
export(gen_metadata_stats)
export(gen_metadata_tab)
export(gen_metadata_table)
export(gen_metadata_val)
export(gen_metadata_value)
export(gen_metadata_var)
export(gen_metadata_variable)
export(gen_modified_data)
export(gen_objects2stat)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
* Massively improved the handling of 'jobs' (e.g., adding gen_download_job())
* Added some helper functions such as gen_logincheck()
* Rewrote functions in the background

# restatis 0.1.0

* Initial CRAN submission.
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' List of EVAS codes
#' List of EVAS Codes
#'
#' @format ## `evas_list`
#' A data frame with 1132 rows and 3 columns:
Expand Down
1 change: 0 additions & 1 deletion R/gen_alternative_terms.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ gen_alternative_terms <- function(term = NULL,
database = c("all", "genesis", "zensus", "regio"),
verbose = TRUE,
...) {

caller <- as.character(match.call()[1])

gen_fun <- test_database_function(database,
Expand Down
5 changes: 2 additions & 3 deletions R/gen_auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
#' The usethis package includes a helper function for editing .Renviron files
#' from an R session with [usethis::edit_r_environ()].
#'
#' @return Path to the RDS file in which credentials are saved, invisibly.
#'
#' @export
#'
#' @examples
#' \dontrun{
#' gen_auth_save("zensus")
#' }
#'
#'
gen_auth_save <- function(database = c("all", "genesis", "zensus", "regio")) {

if (missing(database)) stop("You have to specify a value for parameter 'database'.",
Expand Down Expand Up @@ -94,7 +95,6 @@ gen_auth_save <- function(database = c("all", "genesis", "zensus", "regio")) {
#' gen_auth_get("all")
#' }
#'
#'
gen_auth_get <- function(database = c("all", "genesis", "zensus", "regio")) {

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -335,4 +335,3 @@ gen_auth_path <- function(...) {
return(file.path(tools::R_user_dir("restatis", "config"), ...))

}

4 changes: 2 additions & 2 deletions R/gen_catalogue.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' # Scroll through objects under the topic "12*"
#' # which is "Bevoelkerung" in GENESIS from all categories and
#' # with a detailed output
#' object <- gen_catalogue(code = "12*", detailed = T)
#' object <- gen_catalogue(code = "12*", detailed = TRUE)
#'
#' # Search tables under the topic "12*" which is "Bevölkerung"
#' # without a detailed output
Expand All @@ -36,7 +36,6 @@ gen_catalogue <- function(code = NULL,
error.ignore = FALSE,
verbose = TRUE,
...) {

caller <- as.character(match.call()[1])

gen_fun <- test_database_function(database,
Expand Down Expand Up @@ -314,4 +313,5 @@ gen_catalogue <- function(code = NULL,

return(res)


}
6 changes: 3 additions & 3 deletions R/gen_cube.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#' descriptions in German (`"de"`) or English (`"en"`)?}
#' }
#'
#' @return A [tibble][tibble::tibble()]. Non-data contents of the data cube object are saved in
#' the `metadata` [attribute][base::attr()] of the data frame.
#'
#' @export
#'
#' @examples
Expand All @@ -45,9 +48,7 @@
#' }
#'
gen_cube <- function(name, ...) {

gen_cube_(name, ...)

}

#-------------------------------------------------------------------------------
Expand All @@ -72,7 +73,6 @@ gen_cube_ <- function(name,
classifyingkey3 = NULL,
stand = NULL,
language = Sys.getenv("GENESIS_LANG")) {

area <- match.arg(area)
database <- match.arg(database)

Expand Down
3 changes: 1 addition & 2 deletions R/gen_find.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' gen_find
#' General Search for Objects Through GENESIS
#'
#' @description 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.
Expand Down Expand Up @@ -39,7 +39,6 @@ gen_find <- function(term = NULL,
error.ignore = TRUE,
verbose = TRUE,
...) {

caller <- as.character(match.call()[1])

gen_fun <- test_database_function(database,
Expand Down
24 changes: 24 additions & 0 deletions R/gen_list_jobs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#' Search for Current Jobs of Your User Account
#'
#' @description Function to list all current jobs connected to the given user.
#'
#' @param selection Filter the list of jobs for matching codes.
#' @param sortcriterion Allows to sort the resulting list of jobs by their Code ("content"), the time of completion ("time") or status ("status")
#' @param ... Additional parameter of the GENESIS API call. These parameters are only affecting the GENESIS API call itself, no further processing.
#'
#' @return A list of all current jobs connected to the given user.
#' @export
#'
gen_list_jobs <- function(selection = NULL,
sortcriterion = c("content", "time", "status"),
...) {
results_raw <- gen_api("catalogue/jobs",
selection = selection,
sortcriterion = sortcriterion,
...
)

results_json <- test_if_json(results_raw)

return(results_json)
}
Loading

0 comments on commit f669442

Please sign in to comment.