From 5d6329891342c4b046bb08f27d3214f8d0bec2f6 Mon Sep 17 00:00:00 2001 From: AQLT Date: Sun, 4 Feb 2024 11:27:21 +0100 Subject: [PATCH 01/11] ga cmd-check update --- .github/workflows/R-CMD-check.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index def292d..3c9cb0e 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -3,10 +3,12 @@ on: branches: - main - master + - develop pull_request: branches: - - main + - develop - master + - develop name: R-CMD-check From a6b06bcc185500bae212fa86b738d50611c17e66 Mon Sep 17 00:00:00 2001 From: AQLT Date: Sun, 4 Feb 2024 15:18:07 +0100 Subject: [PATCH 02/11] v0.1.4 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 26b523e..6abfb6f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rjdqa Type: Package Title: Quality Assessment for Seasonal Adjustment -Version: 0.1.3 +Version: 0.1.4 Authors@R: c( person("Alain", "Quartier-la-Tente", role = c("aut", "cre"), email = "alain.quartier@yahoo.fr", From ba780f54354df8a122841ba3b599cb7708620544 Mon Sep 17 00:00:00 2001 From: AQLT Date: Sun, 4 Feb 2024 16:17:33 +0100 Subject: [PATCH 03/11] ga update --- .github/workflows/pkgdown.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index e89a4a2..0513c8a 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -3,6 +3,8 @@ on: push: branches: [master, develop] + pull_request: + branches: [master, develop] release: types: [published] workflow_dispatch: From 3c1f898161ff848ca8de1d4bce5cd0e9bab4efaa Mon Sep 17 00:00:00 2001 From: AQLT Date: Sun, 4 Feb 2024 22:18:25 +0100 Subject: [PATCH 04/11] single-commit --- .github/workflows/pkgdown.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 0513c8a..025d434 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -46,3 +46,4 @@ jobs: clean: false branch: gh-pages folder: docs + single-commit: true From 35f5d92b090b1a3ca8c520d4dce0e095c63940ec Mon Sep 17 00:00:00 2001 From: AQLT Date: Wed, 28 Feb 2024 13:28:29 +0100 Subject: [PATCH 05/11] correction in `simple_dashboard2` --- NEWS.md | 6 ++++++ R/simple_dashboard2.R | 28 +++++++++++++++++++++------- man/simple_dashboard.Rd | 5 ++++- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index a0b934c..ba9235d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# rjdqa 0.1.4 + +- Fix of minimum versions of dependencies. + +- Correction of the orders of the outliers in `simple_dashboard2()`. + # rjdqa 0.1.3 - deprecated function `sa_dashboard()` removed. diff --git a/R/simple_dashboard2.R b/R/simple_dashboard2.R index c41c814..b25ec5f 100644 --- a/R/simple_dashboard2.R +++ b/R/simple_dashboard2.R @@ -10,6 +10,7 @@ #' By default only the estimate coefficients and the t-statistics are printed #' (`columns_outliers = c("Estimate", "T-stat")`). #' @param n_last_outliers number of last outliers to be printed (by default `n_last_outliers = 4`). +#' @param order_outliers order of the outliers in case of several outliers at the same date. #' #' #' @rdname simple_dashboard @@ -19,7 +20,8 @@ simple_dashboard2 <- function(x, digits = 2, remove_others_contrib = FALSE, digits_outliers = digits, columns_outliers = c("Estimate", "T-stat"), - n_last_outliers = 4) { + n_last_outliers = 4, + order_outliers = c("AO", "LS", "TC", "SO")) { if (inherits(x, "TRAMO_SEATS")) { x <- RJDemetra::jtramoseats(RJDemetra::get_ts(x), RJDemetra::tramoseats_spec(x)) } else if (inherits(x, "X13")) { @@ -68,7 +70,8 @@ simple_dashboard2 <- function(x, digits = 2, ifelse(is_easter, "easter effect", "no easter effect")) # nb outliers - out <- sprintf("%s detected outliers", RJDemetra::get_indicators(x, "preprocessing.model.nout")[[1]]) + nout <- RJDemetra::get_indicators(x, "preprocessing.model.nout")[[1]] + out <- sprintf("%s detected outliers", nout) summary_text <- c(est_span, transform, tde, out, arima_ord) @@ -153,10 +156,14 @@ simple_dashboard2 <- function(x, digits = 2, colnames(decomp_stats)[ncol(qstats)+1] <- " " } - outliers <- do.call(rbind, RJDemetra::get_indicators(x, sprintf("preprocessing.model.out(%i)", seq_len(n_last_outliers)))) - outliers_color <- NULL - if (!is.null(outliers)) { - outliers <- outliers[, columns_outliers, drop = FALSE] + outliers <- outliers_color <- NULL + if (nout > 0) { + outliers <- do.call(rbind, RJDemetra::get_indicators(x, sprintf("preprocessing.model.out(%i)", seq_len(nout)))) + # sort outliers by dates + dates_out <- outliers_to_dates(rownames(outliers)) + dates_out$type <- factor(dates_out$type, levels = order_outliers, ordered = TRUE) + outliers <- outliers[order(dates_out$year, dates_out$period, dates_out$type, decreasing = TRUE), ] + outliers <- outliers[seq_len(n_last_outliers), columns_outliers, drop = FALSE] outliers <- round(outliers, digits_outliers) outliers <- data.frame(rownames(outliers), outliers) @@ -181,7 +188,14 @@ simple_dashboard2 <- function(x, digits = 2, class(res) <- c("simple_dashboard2") res } - +outliers_to_dates <- function(name_out){ + dates_out <- gsub("\\w. \\((.*)\\)", "\\1", name_out) + types <- gsub(" .*", "", name_out) + dates <- do.call(rbind, strsplit(dates_out, "-")) + periods <- as.numeric(as.roman(dates[,1])) + years <- as.numeric(dates[,2]) + data.frame(year = years, period = periods, type = types) +} #' @rdname plot.simple_dashboard #' @export plot.simple_dashboard2 <- function(x, main = "Simple Dashboard with outliers", diff --git a/man/simple_dashboard.Rd b/man/simple_dashboard.Rd index 90fc0b0..b3b4773 100644 --- a/man/simple_dashboard.Rd +++ b/man/simple_dashboard.Rd @@ -19,7 +19,8 @@ simple_dashboard2( remove_others_contrib = FALSE, digits_outliers = digits, columns_outliers = c("Estimate", "T-stat"), - n_last_outliers = 4 + n_last_outliers = 4, + order_outliers = c("AO", "LS", "TC", "SO") ) } \arguments{ @@ -44,6 +45,8 @@ By default only the estimate coefficients and the t-statistics are printed (`columns_outliers = c("Estimate", "T-stat")`).} \item{n_last_outliers}{number of last outliers to be printed (by default `n_last_outliers = 4`).} + +\item{order_outliers}{order of the outliers in case of several outliers at the same date.} } \description{ Functions to compute the data to produce a simple seasonal adjustment dashboard. From fdcd9b4680d80834a7e4ecb74a5733da5abd03ce Mon Sep 17 00:00:00 2001 From: AQLT Date: Wed, 28 Feb 2024 13:30:24 +0100 Subject: [PATCH 06/11] dependencies --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6abfb6f..c9e60fb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,10 +12,10 @@ License: EUPL SystemRequirements: Java (>= 8) Depends: R (>= 3.1.1), - RJDemetra, + RJDemetra (>= 0.2.5), Imports: plotrix, - ggdemetra, + ggdemetra (>= 0.2.5), utils, graphics, stats From d7fb478e8b0ddbe1dd9094617445cdffd054625d Mon Sep 17 00:00:00 2001 From: AQLT Date: Wed, 28 Feb 2024 14:22:21 +0100 Subject: [PATCH 07/11] reconf.sh for github action --- .Rbuildignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rbuildignore b/.Rbuildignore index c721e9f..76e910a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,4 @@ TODO.R ^revdep$ ^pkgdown$ ^\.github$ +^reconf.sh$ From 2909c57f28762f992f4967ebcf72d04a267763d4 Mon Sep 17 00:00:00 2001 From: AQLT Date: Wed, 28 Feb 2024 17:22:19 +0100 Subject: [PATCH 08/11] r-universe install --- README.Rmd | 3 ++- README.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.Rmd b/README.Rmd index f0c9215..1128a49 100644 --- a/README.Rmd +++ b/README.Rmd @@ -40,7 +40,8 @@ install.packages("rjdqa") # Install development version from GitHub # install.packages("devtools") -devtools::install_github("AQLT/rjdqa") +# devtools::install_github("AQLT/rjdqa") +install.packages("rjdqa", repos = c('https://aqlt.r-universe.dev', 'https://cloud.r-project.org')) ``` If you have troubles with the installation of RJDemetra or rjdqa, check the [installation manual](https://github.com/jdemetra/rjdemetra/wiki/Installation-manual). diff --git a/README.md b/README.md index 2ca50e8..d62cc4b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ install.packages("rjdqa") # Install development version from GitHub # install.packages("devtools") -devtools::install_github("AQLT/rjdqa") +# devtools::install_github("AQLT/rjdqa") +install.packages("rjdqa", repos = c('https://aqlt.r-universe.dev', 'https://cloud.r-project.org')) ``` If you have troubles with the installation of RJDemetra or rjdqa, check From e4bc39c3f99289dce884dd236517708337284274 Mon Sep 17 00:00:00 2001 From: AQLT Date: Sun, 3 Mar 2024 14:41:54 +0100 Subject: [PATCH 09/11] arima order correction (bd instead of bq) --- R/simple_dashboard.R | 2 +- R/simple_dashboard2.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/simple_dashboard.R b/R/simple_dashboard.R index 99065f4..cecc024 100644 --- a/R/simple_dashboard.R +++ b/R/simple_dashboard.R @@ -44,7 +44,7 @@ simple_dashboard <- function(x, digits = 2, # Global info on model arima_ord <- sprintf("ARIMA(%s)(%s)", paste(unlist(RJDemetra::get_indicators(x, sprintf("preprocessing.arima.%s", c("p", "d", "q")))), collapse = ","), - paste(unlist(RJDemetra::get_indicators(x, sprintf("preprocessing.arima.%s", c("bp", "bd", "bd")))), collapse = ",")) + paste(unlist(RJDemetra::get_indicators(x, sprintf("preprocessing.arima.%s", c("bp", "bd", "bq")))), collapse = ",")) ntd <- RJDemetra::get_indicators(x, "preprocessing.model.ntd")[[1]] # nombre de JO nmh <- RJDemetra::get_indicators(x, "preprocessing.model.nmh")[[1]] is_easter <- (! is.null(nmh)) && diff --git a/R/simple_dashboard2.R b/R/simple_dashboard2.R index b25ec5f..fcb9c63 100644 --- a/R/simple_dashboard2.R +++ b/R/simple_dashboard2.R @@ -50,7 +50,7 @@ simple_dashboard2 <- function(x, digits = 2, # Global info on model arima_ord <- sprintf("ARIMA(%s)(%s)", paste(unlist(RJDemetra::get_indicators(x, sprintf("preprocessing.arima.%s", c("p", "d", "q")))), collapse = ","), - paste(unlist(RJDemetra::get_indicators(x, sprintf("preprocessing.arima.%s", c("bp", "bd", "bd")))), collapse = ",")) + paste(unlist(RJDemetra::get_indicators(x, sprintf("preprocessing.arima.%s", c("bp", "bd", "bq")))), collapse = ",")) ntd <- RJDemetra::get_indicators(x, "preprocessing.model.ntd")[[1]] # nombre de JO nmh <- RJDemetra::get_indicators(x, "preprocessing.model.nmh")[[1]] is_easter <- (! is.null(nmh)) && @@ -163,7 +163,7 @@ simple_dashboard2 <- function(x, digits = 2, dates_out <- outliers_to_dates(rownames(outliers)) dates_out$type <- factor(dates_out$type, levels = order_outliers, ordered = TRUE) outliers <- outliers[order(dates_out$year, dates_out$period, dates_out$type, decreasing = TRUE), ] - outliers <- outliers[seq_len(n_last_outliers), columns_outliers, drop = FALSE] + outliers <- outliers[seq_len(min(n_last_outliers, nrow(outliers))), columns_outliers, drop = FALSE] outliers <- round(outliers, digits_outliers) outliers <- data.frame(rownames(outliers), outliers) From fe38574cbce3fdb5fc9c12968a44662c787dcb7f Mon Sep 17 00:00:00 2001 From: AQLT Date: Sun, 3 Mar 2024 14:46:34 +0100 Subject: [PATCH 10/11] correction when only one outlier --- R/simple_dashboard2.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/simple_dashboard2.R b/R/simple_dashboard2.R index fcb9c63..5079e6e 100644 --- a/R/simple_dashboard2.R +++ b/R/simple_dashboard2.R @@ -162,7 +162,7 @@ simple_dashboard2 <- function(x, digits = 2, # sort outliers by dates dates_out <- outliers_to_dates(rownames(outliers)) dates_out$type <- factor(dates_out$type, levels = order_outliers, ordered = TRUE) - outliers <- outliers[order(dates_out$year, dates_out$period, dates_out$type, decreasing = TRUE), ] + outliers <- outliers[order(dates_out$year, dates_out$period, dates_out$type, decreasing = TRUE), , drop = FALSE] outliers <- outliers[seq_len(min(n_last_outliers, nrow(outliers))), columns_outliers, drop = FALSE] outliers <- round(outliers, digits_outliers) outliers <- data.frame(rownames(outliers), From 3ad09e4c7291be7edadbb78a6fe7b04b50c224de Mon Sep 17 00:00:00 2001 From: AQLT Date: Tue, 19 Mar 2024 20:34:39 +0100 Subject: [PATCH 11/11] cran comments --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 79a894b..16905a1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .Rhistory .RData .Ruserdata -.DS_Store \ No newline at end of file +.DS_Store +cran-comments.md