Commit 02bc63b4 authored by Sébastien Galais's avatar Sébastien Galais
Browse files

Correction of rdb() examples (dimensions) and correction of timestamp formats...

Correction of rdb() examples (dimensions) and correction of timestamp formats for the column indexed_at.
parent b60c01c4
Pipeline #176664 passed with stage
in 7 minutes and 20 seconds
Package: rdbnomics
Type: Package
Title: Download DBnomics Data
Version: 0.6.2
Version: 0.6.3
Authors@R: c(person("Sebastien", "Galais", role = c("cre", "ctb"),
email = "s915.stem@gmail.com"),
person("Thomas", "Brand", role = c("aut"),
......@@ -24,4 +24,4 @@ Suggests:
rmarkdown,
tinytest
VignetteBuilder: knitr
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
# rdbnomics 0.6.3
* New badge in README.
* Correction of .gitlab-ci.yml with pkg-config.
* Correction of `rdb()` examples in the doc and README.
# rdbnomics 0.6.2
* Remove **ggplot2**, **DT** and **dplyr** vignette dependencies.
......
......@@ -78,12 +78,12 @@
#' # Fetch one value of one dimension from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
#' df1 <- rdb("AMECO", "ZUTN", dimensions = list(geo = "ea12"))
#' # or
#' df1 <- rdb("AMECO", "ZUTN", dimensions = '{"geo": ["ea12"]}')
#' df1 <- rdb("AMECO", "ZUTN", dimensions = '{"geo":["ea12"]}')
#'
#' # Fetch two values of one dimension from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
#' df2 <- rdb("AMECO", "ZUTN", dimensions = list(geo = c("ea12", "dnk")))
#' # or
#' df2 <- rdb("AMECO", "ZUTN", dimensions = '{"geo": ["ea12", "dnk"]}')
#' df2 <- rdb("AMECO", "ZUTN", dimensions = '{"geo":["ea12","dnk"]}')
#'
#' # Fetch several values of several dimensions from dataset 'Doing business' (DB) of World Bank:
#' dim <- list(
......@@ -93,8 +93,8 @@
#' df3 <- rdb("WB", "DB", dimensions = dim)
#' # or
#' dim <- paste0(
#' '{"country": ["DZ", "PE"],',
#' '"indicator": ["ENF.CONT.COEN.COST.ZS", "IC.REG.COST.PC.FE.ZS"]}'
#' '{"country":["DZ","PE"],',
#' '"indicator":["ENF.CONT.COEN.COST.ZS","IC.REG.COST.PC.FE.ZS"]}'
#' )
#' df3 <- rdb("WB", "DB", dimensions = dim)
#'
......
......@@ -388,13 +388,13 @@ transform_date_timestamp <- function(DT) {
check_argument(timezone, "character")
from_timestamp <- c(
"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$",
"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]+Z$",
# "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$",
"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.?[0-9]*Z$",
"^[0-9]{4}-[0-9]{2}-[0-9]{2}[[:blank:]]+[0-9]{2}:[0-9]{2}:[0-9]{2}$"
)
to_timestamp <- c(
"%Y-%m-%dT%H:%M:%SZ",
# "%Y-%m-%dT%H:%M:%SZ",
"%Y-%m-%dT%H:%M:%OSZ",
"%Y-%m-%d %H:%M:%S"
)
......
......@@ -75,17 +75,17 @@ df4 <- rdb("IMF", "BOP", "A.FR.BCA_BP6_EUR")
# Fetch one value of one dimension from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
df1 <- rdb("AMECO", "ZUTN", dimensions = list(geo = "ea12"))
# or
df1 <- rdb("AMECO", "ZUTN", dimensions = '{"geo": ["ea12"]}')
df1 <- rdb("AMECO", "ZUTN", dimensions = '{"geo":["ea12"]}')
# Fetch two values of one dimension from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
df2 <- rdb("AMECO", "ZUTN", dimensions = list(geo = c("ea12", "dnk")))
# or
df2 <- rdb("AMECO", "ZUTN", dimensions = '{"geo": ["ea12", "dnk"]}')
df2 <- rdb("AMECO", "ZUTN", dimensions = '{"geo":["ea12","dnk"]}')
# Fetch several values of several dimensions from dataset 'Doing business' (DB) of World Bank:
df3 <- rdb("WB", "DB", dimensions = list(country = c("DZ", "PE"), indicator = c("ENF.CONT.COEN.COST.ZS", "IC.REG.COST.PC.FE.ZS")))
# or
df3 <- rdb("WB", "DB", dimensions = '{"country": ["DZ", "PE"], "indicator": ["ENF.CONT.COEN.COST.ZS", "IC.REG.COST.PC.FE.ZS"]}')
df3 <- rdb("WB", "DB", dimensions = '{"country":["DZ","PE"],"indicator":["ENF.CONT.COEN.COST.ZS","IC.REG.COST.PC.FE.ZS"]}')
```
### Fetch time series with a `query`:
......
......@@ -113,12 +113,12 @@ df3 <- rdb(ids = c("AMECO/ZUTN/EA19.1.0.0.0.ZUTN", "IMF/BOP/A.FR.BCA_BP6_EUR"))
# Fetch one value of one dimension from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
df1 <- rdb("AMECO", "ZUTN", dimensions = list(geo = "ea12"))
# or
df1 <- rdb("AMECO", "ZUTN", dimensions = '{"geo": ["ea12"]}')
df1 <- rdb("AMECO", "ZUTN", dimensions = '{"geo":["ea12"]}')
# Fetch two values of one dimension from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
df2 <- rdb("AMECO", "ZUTN", dimensions = list(geo = c("ea12", "dnk")))
# or
df2 <- rdb("AMECO", "ZUTN", dimensions = '{"geo": ["ea12", "dnk"]}')
df2 <- rdb("AMECO", "ZUTN", dimensions = '{"geo":["ea12","dnk"]}')
# Fetch several values of several dimensions from dataset 'Doing business' (DB) of World Bank:
dim <- list(
......@@ -128,8 +128,8 @@ dim <- list(
df3 <- rdb("WB", "DB", dimensions = dim)
# or
dim <- paste0(
'{"country": ["DZ", "PE"],',
'"indicator": ["ENF.CONT.COEN.COST.ZS", "IC.REG.COST.PC.FE.ZS"]}'
'{"country":["DZ","PE"],',
'"indicator":["ENF.CONT.COEN.COST.ZS","IC.REG.COST.PC.FE.ZS"]}'
)
df3 <- rdb("WB", "DB", dimensions = dim)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment