MyNixOS website logo
Description

Wrangling 'JDemetra+ 3.x' Workspace.

R Interface to 'JDemetra+ 3.x'(<https://github.com/jdemetra>). It offers several functions to manipulate 'JDemetra+' workspaces, which can be read by the software and can store several seasonal adjusted series along with user-defined calendars or regression variables.

{rjd3workspace}

CRANstatus Mentioned in Awesome OfficialStatistics

R-CMD-check lint

GH Pagesbuilt

{rjd3workspace} offers several functions to wrangle JDemetra+ v3.x workspaces.

Seasonal adjustment with X-12ARIMA can be done with the package {rjd3x13} and with TRAMO-SEATS with the package {rjd3tramoseats}.

Installation

{rjd3workspace} relies on the {rJava} package

Running rjd3 packages requires Java 21 or higher. How to set up such a configuration in R is explained here

Latest release

To get the current stable version (from the latest release):

  • From GitHub:
# install.packages("remotes")
remotes::install_github("rjdverse/rjd3workspace@*release")
install.packages("rjd3workspace", repos = c("https://rjdverse.r-universe.dev", "https://cloud.r-project.org"))

Development version

You can install the development version of {rjd3workspace} from GitHub with:

# install.packages("remotes")
remotes::install_github("rjdverse/rjd3workspace")

Usage

library("rjd3workspace")

dir <- tempdir()

y <- rjd3toolkit::ABS$X0.2.09.10.M
jws <- jws_new()
jsap1 <- jws_sap_new(jws, "sa1")
add_sa_item(jsap1, name = "x13", x = rjd3x13::x13(y))
add_sa_item(jsap1, name = "tramo", x = rjd3tramoseats::tramoseats(y))
save_workspace(jws, file.path(dir, "ws.xml"))

jws <- jws_open(file = file.path(dir, "ws.xml"))
jws_compute(jws) # to compute the models
jsap1 <- jws_sap(jws, idx = 1) # first SAProcessing
jsa1 <- jsap_sai(jsap1, idx = 1) # first SAItem
sai_name(jsa1)
#> [1] "x13"
mod1 <- read_sai(jsa1)

Create SA-item with path

# install.packages("remotes")
# remotes::install_github("rjdverse/rjd3providers")

dir <- tempdir()

xlsx_file <- file.path(system.file("extdata", package = "rjd3providers"), "Insee.xlsx")
ts1 <- rjd3providers::spreadsheet_series(file = xlsx_file, sheet = 1L, series = 3L)

y <- ts1$data
jws <- jws_new()
jsap1 <- jws_sap_new(jws, "sa1")
add_sa_item(jsap1, name = "x13", x = rjd3x13::x13(y))
set_ts(jsap = jsap1, idx = 1L, y = ts1)
add_sa_item(jsap1, name = "tramo", x = rjd3tramoseats::tramoseats(y))
set_ts(jsap = jsap1, idx = 2L, y = ts1)

save_workspace(jws, file.path(dir, "ws.xml"))

jws <- jws_open(file = file.path(dir, "ws.xml"))
jws_compute(jws) # to compute the models
jsap1 <- jws_sap(jws, idx = 1) # first SAProcessing
jsa1 <- jsap_sai(jsap1, idx = 1) # first SAItem
sai_name(jsa1)
#> [1] "x13"
mod1 <- read_sai(jsa1)

Change path of an SA-ITEM

xlsx_path <- normalizePath("data/IPI_nace4.xlsx", mustWork = TRUE)
csv_path <- normalizePath("data/IPI_nace4.csv", mustWork = TRUE)
ws_path <- normalizePath("WS/ws_industrie.xml", mustWork = TRUE)

jws <- .jws_open(file = ws_path)

# Update all the second SA-Processing with a new path
spreadsheet_update_path(
    jws = jws,
    new_path = xlsx_path,
    idx_sap = 2L
)

txt_update_path(
    jws = jws,
    new_path = csv_path,
    idx_sap = 1L
)

save_workspace(jws = jws, file = ws_path, replace = TRUE)

Package Maintenance and contributing

Any contribution is welcome and should be done through pull requests and/or issues. pull requests should include updated tests and updated documentation. If functionality is changed, docstrings should be added or updated.

Licensing

The code of this project is licensed under the European Union Public Licence (EUPL).

Metadata

Version

3.7.1

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows