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

Update series name 'WEO' to 'WEO:2019-10' and 'WEOAGG' to 'WEOAGG:2019-10'.

parent 85f2992d
Pipeline #188522 passed with stage
in 9 minutes and 19 seconds
Package: rdbnomics
Type: Package
Title: Download DBnomics Data
Version: 0.6.3
Version: 0.6.4
Authors@R: c(person("Sebastien", "Galais", role = c("cre", "ctb"),
email = "s915.stem@gmail.com"),
person("Thomas", "Brand", role = c("aut"),
......
# rdbnomics 0.6.4
* Update series name WEO to WEO:2019-10.
# rdbnomics 0.6.3
* New badge in README.
......
......@@ -14,7 +14,7 @@
#' library(magrittr)
#' library(ggplot2)
#'
#' rdb("IMF", "WEO", query = "France current account balance percent") %>%
#' rdb("IMF", "WEO:2019-10", query = "France current account balance percent") %>%
#' ggplot(aes(x = period, y = value, color = series_name)) +
#' geom_line(size = 1.2) +
#' geom_point(size = 2) +
......
......@@ -116,10 +116,10 @@
#'
#'
#' ## By query
#' # Fetch one series from dataset 'WEO by countries' (WEO) from IMF :
#' df1 <- rdb("IMF", "WEO", query = "France current account balance percent")
#' # Fetch series from dataset 'WEO by countries' (WEO) from IMF :
#' df2 <- rdb("IMF", "WEO", query = "current account balance percent")
#' # Fetch one series from dataset 'WEO by countries (2019-10 release)' (WEO:2019-10) from IMF :
#' df1 <- rdb("IMF", "WEO:2019-10", query = "France current account balance percent")
#' # Fetch series from dataset 'WEO by countries (2019-10 release)' (WEO:2019-10) from IMF :
#' df2 <- rdb("IMF", "WEO:2019-10", query = "current account balance percent")
#'
#'
#' ## By api_link
......@@ -174,7 +174,7 @@
#' ## Apply filter(s) to the series
#' # One filter
#' df1 <- rdb(
#' ids = c("IMF/WEO/ABW.BCA.us_dollars", "IMF/WEO/ABW.BCA_NGDPD.pcent_gdp"),
#' ids = c("IMF/WEO:2019-10/ABW.BCA.us_dollars", "IMF/WEO:2019-10/ABW.BCA_NGDPD.pcent_gdp"),
#' filters = list(
#' code = "interpolate",
#' parameters = list(frequency = "daily", method = "spline")
......@@ -183,7 +183,7 @@
#'
#' # Two filters
#' df1 <- rdb(
#' ids = c("IMF/WEO/ABW.BCA.us_dollars", "IMF/WEO/ABW.BCA_NGDPD.pcent_gdp"),
#' ids = c("IMF/WEO:2019-10/ABW.BCA.us_dollars", "IMF/WEO:2019-10/ABW.BCA_NGDPD.pcent_gdp"),
#' filters = list(
#' list(
#' code = "interpolate",
......
......@@ -102,7 +102,7 @@
#' ## Apply filter(s) to the series
#' # One filter
#' df3 <- rdb_by_api_link(
#' "https://api.db.nomics.world/v22/series/IMF/WEO/ABW.BCA?observations=1",
#' "https://api.db.nomics.world/v22/series/IMF/WEO:2019-10/ABW.BCA?observations=1",
#' filters = list(
#' code = "interpolate",
#' parameters = list(frequency = "daily", method = "spline")
......@@ -111,7 +111,7 @@
#'
#' # Two filters
#' df3 <- rdb_by_api_link(
#' "https://api.db.nomics.world/v22/series/IMF/WEO/ABW.BCA?observations=1",
#' "https://api.db.nomics.world/v22/series/IMF/WEO:2019-10/ABW.BCA?observations=1",
#' filters = list(
#' list(
#' code = "interpolate",
......
......@@ -38,9 +38,9 @@
#' \code{data.table}s.
#' @examples
#' \dontrun{
#' rdb_dimensions(provider_code = "IMF", dataset_code = "WEO")
#' rdb_dimensions(provider_code = "IMF", dataset_code = "WEO:2019-10")
#'
#' rdb_dimensions(provider_code = "IMF", dataset_code = "WEO", simplify = TRUE)
#' rdb_dimensions(provider_code = "IMF", dataset_code = "WEO:2019-10", simplify = TRUE)
#'
#' rdb_dimensions(provider_code = "IMF")
#'
......@@ -50,12 +50,12 @@
#' options(rdbnomics.progress_bar_dimensions = FALSE)
#'
#' rdb_dimensions(
#' provider_code = "IMF", dataset_code = "WEO",
#' provider_code = "IMF", dataset_code = "WEO:2019-10",
#' use_readLines = TRUE
#' )
#'
#' rdb_dimensions(
#' provider_code = "IMF", dataset_code = "WEO",
#' provider_code = "IMF", dataset_code = "WEO:2019-10",
#' curl_config = list(proxy = "<proxy>", proxyport = <port>)
#' )
#' }
......
......@@ -48,29 +48,29 @@
#' @return A nested named list of \code{data.table}s or a \code{data.table}.
#' @examples
#' \dontrun{
#' rdb_series(provider_code = "IMF", dataset_code = "WEO")
#' rdb_series(provider_code = "IMF", dataset_code = "WEO:2019-10")
#'
#' ## With dimensions
#' rdb_series("IMF", "WEO", dimensions = list(`weo-country` = "AGO"))
#' rdb_series("IMF", "WEO", dimensions = list(`weo-subject` = "NGDP_RPCH"), simplify = TRUE)
#' rdb_series("IMF", "WEO:2019-10", dimensions = list(`weo-country` = "AGO"))
#' rdb_series("IMF", "WEO:2019-10", dimensions = list(`weo-subject` = "NGDP_RPCH"), simplify = TRUE)
#'
#' ## With query
#' rdb_series("IMF", "WEO", query = "ARE")
#' rdb_series("IMF", c("WEO", "WEOAGG"), query = "NGDP_RPCH")
#' rdb_series("IMF", "WEO:2019-10", query = "ARE")
#' rdb_series("IMF", c("WEO:2019-10", "WEOAGG:2019-10"), query = "NGDP_RPCH")
#'
#' rdb_series(provider_code = "IMF", verbose = TRUE)
#'
#' options(rdbnomics.progress_bar_series = TRUE)
#' rdb_series(provider_code = "IMF", dataset_code = "WEO")
#' rdb_series(provider_code = "IMF", dataset_code = "WEO:2019-10")
#' options(rdbnomics.progress_bar_series = FALSE)
#'
#' rdb_series(
#' provider_code = "IMF", dataset_code = "WEO",
#' provider_code = "IMF", dataset_code = "WEO:2019-10",
#' use_readLines = TRUE
#' )
#'
#' rdb_series(
#' provider_code = "IMF", dataset_code = "WEO",
#' provider_code = "IMF", dataset_code = "WEO:2019-10",
#' curl_config = list(proxy = "<proxy>", proxyport = <port>)
#' )
#' }
......
No preview for this file type
......@@ -23,7 +23,7 @@ when reproducing the vignette examples.
library(magrittr)
library(ggplot2)
rdb("IMF", "WEO", query = "France current account balance percent") \%>\%
rdb("IMF", "WEO:2019-10", query = "France current account balance percent") \%>\%
ggplot(aes(x = period, y = value, color = series_name)) +
geom_line(size = 1.2) +
geom_point(size = 2) +
......
......@@ -151,10 +151,10 @@ df4 <- rdb("IMF", "BOP", mask = "A.FR.BCA_BP6_EUR+IA_BP6_EUR")
## By query
# Fetch one series from dataset 'WEO by countries' (WEO) from IMF :
df1 <- rdb("IMF", "WEO", query = "France current account balance percent")
# Fetch series from dataset 'WEO by countries' (WEO) from IMF :
df2 <- rdb("IMF", "WEO", query = "current account balance percent")
# Fetch one series from dataset 'WEO by countries (2019-10 release)' (WEO:2019-10) from IMF :
df1 <- rdb("IMF", "WEO:2019-10", query = "France current account balance percent")
# Fetch series from dataset 'WEO by countries (2019-10 release)' (WEO:2019-10) from IMF :
df2 <- rdb("IMF", "WEO:2019-10", query = "current account balance percent")
## By api_link
......@@ -209,7 +209,7 @@ df1 <- rdb(ids = "AMECO/ZUTN/EA19.1.0.0.0.ZUTN", use_readLines = TRUE)
## Apply filter(s) to the series
# One filter
df1 <- rdb(
ids = c("IMF/WEO/ABW.BCA.us_dollars", "IMF/WEO/ABW.BCA_NGDPD.pcent_gdp"),
ids = c("IMF/WEO:2019-10/ABW.BCA.us_dollars", "IMF/WEO:2019-10/ABW.BCA_NGDPD.pcent_gdp"),
filters = list(
code = "interpolate",
parameters = list(frequency = "daily", method = "spline")
......@@ -218,7 +218,7 @@ df1 <- rdb(
# Two filters
df1 <- rdb(
ids = c("IMF/WEO/ABW.BCA.us_dollars", "IMF/WEO/ABW.BCA_NGDPD.pcent_gdp"),
ids = c("IMF/WEO:2019-10/ABW.BCA.us_dollars", "IMF/WEO:2019-10/ABW.BCA_NGDPD.pcent_gdp"),
filters = list(
list(
code = "interpolate",
......
......@@ -122,7 +122,7 @@ df2 <- rdb_by_api_link(
## Apply filter(s) to the series
# One filter
df3 <- rdb_by_api_link(
"https://api.db.nomics.world/v22/series/IMF/WEO/ABW.BCA?observations=1",
"https://api.db.nomics.world/v22/series/IMF/WEO:2019-10/ABW.BCA?observations=1",
filters = list(
code = "interpolate",
parameters = list(frequency = "daily", method = "spline")
......@@ -131,7 +131,7 @@ df3 <- rdb_by_api_link(
# Two filters
df3 <- rdb_by_api_link(
"https://api.db.nomics.world/v22/series/IMF/WEO/ABW.BCA?observations=1",
"https://api.db.nomics.world/v22/series/IMF/WEO:2019-10/ABW.BCA?observations=1",
filters = list(
list(
code = "interpolate",
......
......@@ -62,9 +62,9 @@ containing the dimensions of datasets for providers from
}
\examples{
\dontrun{
rdb_dimensions(provider_code = "IMF", dataset_code = "WEO")
rdb_dimensions(provider_code = "IMF", dataset_code = "WEO:2019-10")
rdb_dimensions(provider_code = "IMF", dataset_code = "WEO", simplify = TRUE)
rdb_dimensions(provider_code = "IMF", dataset_code = "WEO:2019-10", simplify = TRUE)
rdb_dimensions(provider_code = "IMF")
......@@ -74,12 +74,12 @@ rdb_dimensions()
options(rdbnomics.progress_bar_dimensions = FALSE)
rdb_dimensions(
provider_code = "IMF", dataset_code = "WEO",
provider_code = "IMF", dataset_code = "WEO:2019-10",
use_readLines = TRUE
)
rdb_dimensions(
provider_code = "IMF", dataset_code = "WEO",
provider_code = "IMF", dataset_code = "WEO:2019-10",
curl_config = list(proxy = "<proxy>", proxyport = <port>)
)
}
......
......@@ -78,29 +78,29 @@ containing the series of datasets for providers from
}
\examples{
\dontrun{
rdb_series(provider_code = "IMF", dataset_code = "WEO")
rdb_series(provider_code = "IMF", dataset_code = "WEO:2019-10")
## With dimensions
rdb_series("IMF", "WEO", dimensions = list(`weo-country` = "AGO"))
rdb_series("IMF", "WEO", dimensions = list(`weo-subject` = "NGDP_RPCH"), simplify = TRUE)
rdb_series("IMF", "WEO:2019-10", dimensions = list(`weo-country` = "AGO"))
rdb_series("IMF", "WEO:2019-10", dimensions = list(`weo-subject` = "NGDP_RPCH"), simplify = TRUE)
## With query
rdb_series("IMF", "WEO", query = "ARE")
rdb_series("IMF", c("WEO", "WEOAGG"), query = "NGDP_RPCH")
rdb_series("IMF", "WEO:2019-10", query = "ARE")
rdb_series("IMF", c("WEO:2019-10", "WEOAGG:2019-10"), query = "NGDP_RPCH")
rdb_series(provider_code = "IMF", verbose = TRUE)
options(rdbnomics.progress_bar_series = TRUE)
rdb_series(provider_code = "IMF", dataset_code = "WEO")
rdb_series(provider_code = "IMF", dataset_code = "WEO:2019-10")
options(rdbnomics.progress_bar_series = FALSE)
rdb_series(
provider_code = "IMF", dataset_code = "WEO",
provider_code = "IMF", dataset_code = "WEO:2019-10",
use_readLines = TRUE
)
rdb_series(
provider_code = "IMF", dataset_code = "WEO",
provider_code = "IMF", dataset_code = "WEO:2019-10",
curl_config = list(proxy = "<proxy>", proxyport = <port>)
)
}
......
......@@ -619,9 +619,9 @@ mtext(
# Fetch time series with a `query`
The query is a Google-like search that will filter/select time series from a provider's dataset.
## Fetch one series from dataset 'WEO by countries' (WEO) of IMF
## Fetch one series from dataset 'WEO by countries (2019-10 release)' (WEO:2019-10) of IMF
```{r, eval = FALSE}
df <- rdb("IMF", "WEO", query = "France current account balance percent")
df <- rdb("IMF", "WEO:2019-10", query = "France current account balance percent")
df <- df[!is.na(value))]
```
```{r, eval = TRUE, echo = FALSE}
......@@ -665,9 +665,9 @@ mtext(
)
```
## Fetch series from dataset 'WEO by countries' (WEO) of IMF
## Fetch series from dataset 'WEO by countries (2019-10 release)' (WEO:2019-10) of IMF
```{r, eval = FALSE}
df <- rdb("IMF", "WEO", query = "current account balance percent")
df <- rdb("IMF", "WEO:2019-10", query = "current account balance percent")
df <- df[!is.na(value))]
```
```{r, eval = TRUE, echo = FALSE}
......@@ -940,29 +940,35 @@ interesting and especially useful to specify dimensions for a particular
dataset to download only the series you want to analyse. With
the function `rdb_dimensions`, you can download these dimensions and their
meanings.
For example, for the dataset **WEO** of the **IMF**, you may use:
For example, for the dataset **WEO:2019-10** of the **IMF**, you may use:
```{r, eval = FALSE}
rdb_dimensions(provider_code = "IMF", dataset_code = "WEO")
rdb_dimensions(provider_code = "IMF", dataset_code = "WEO:2019-10")
```
The result is a nested named list (its names are **IMF**, **WEO** and the
The result is a nested named list (its names are **IMF**, **WEO:2019-10** and the
dimensions names) with a `data.table` at the end of each branch:
```{r, eval = TRUE, echo = FALSE}
DT <- rdbnomics:::rdbnomics_df020
DT <- DT$IMF$WEO
DT <- paste0("Number of dimensions for IMF/WEO : ", length(DT))
DT <- DT$IMF$`WEO:2019-10`
DT <- paste0("Number of dimensions for IMF/WEO:2019-10 : ", length(DT))
cat(DT, sep = "\n")
```
```{r, eval = TRUE, echo = FALSE}
DT <- rdbnomics:::rdbnomics_df020
DT <- DT$IMF$WEO[[1]]
DT <- DT$IMF$`WEO:2019-10`[[1]]
display_table(DT)
```
```{r, eval = TRUE, echo = FALSE}
DT <- rdbnomics:::rdbnomics_df020
DT <- DT$IMF$WEO[[2]]
DT <- DT$IMF$`WEO:2019-10`[[2]]
display_table(DT)
```
```{r, eval = TRUE, echo = FALSE}
DT <- rdbnomics:::rdbnomics_df020
DT <- DT$IMF$`WEO:2019-10`[[3]]
display_table(DT)
```
......@@ -970,7 +976,7 @@ In the event that you only request the dimensions for one dataset for one
provider, if you define `simplify = TRUE`, then the result will be a named list
`data.table` not a nested named list.
```{r, eval = FALSE}
rdb_dimensions(provider_code = "IMF", dataset_code = "WEO", simplify = TRUE)
rdb_dimensions(provider_code = "IMF", dataset_code = "WEO:2019-10", simplify = TRUE)
```
```{r, eval = TRUE, echo = FALSE}
str(rdbnomics:::rdbnomics_df021)
......@@ -1024,9 +1030,9 @@ You can download the list of series, and especially their codes, of a dataset's
provider by using the function `rdb_series`. The result is a nested named list
with a `data.table` at the end of each branch. If you define `simplify = TRUE`,
then the result will be a `data.table` not a nested named list.
For example, for the **IMF** provider and the dataset **WEO**, the command is (onyl first 100):
For example, for the **IMF** provider and the dataset **WEO:2019-10**, the command is (only first 100):
```{r, eval = FALSE}
rdb_series(provider_code = "IMF", dataset_code = "WEO", simplify = TRUE)
rdb_series(provider_code = "IMF", dataset_code = "WEO:2019-10", simplify = TRUE)
```
```{r, eval = TRUE, echo = FALSE}
DT <- rdbnomics:::rdbnomics_df023
......@@ -1037,11 +1043,11 @@ display_table(DT)
Like the function `rdb()`, you can add features to `rdb_series()`. You can ask for
the series with specific `dimensions`:
```{r, eval = FALSE}
rdb_series(provider_code = "IMF", dataset_code = "WEO", dimensions = list(`weo-subject` = "NGDP_RPCH"), simplify = TRUE)
rdb_series(provider_code = "IMF", dataset_code = "WEO:2019-10", dimensions = list(`weo-subject` = "NGDP_RPCH"), simplify = TRUE)
```
or with a `query`:
```{r, eval = FALSE}
rdb_series(provider_code = "IMF", dataset_code = c("WEO", "WEOAGG"), query = "NGDP_RPCH")
rdb_series(provider_code = "IMF", dataset_code = c("WEO:2019-10", "WEOAGG:2019-10"), query = "NGDP_RPCH")
```
<b><font color='red'>&#9888;</font></b> We ask the user to use this function parsimoniously because there are a huge amount
......
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