{"id":24775684,"url":"https://github.com/inseefr/jdcruncher","last_synced_at":"2025-10-12T00:31:28.784Z","repository":{"id":47451075,"uuid":"110690521","full_name":"InseeFr/JDCruncheR","owner":"InseeFr","description":"Interface entre le cruncher JDemetra+ et R et création de bilans qualité","archived":false,"fork":false,"pushed_at":"2025-07-24T15:12:20.000Z","size":5871,"stargazers_count":5,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-08T15:28:18.259Z","etag":null,"topics":["extension","jdemetra","jwsacruncher","quality-assessment","r","r-package"],"latest_commit_sha":null,"homepage":"https://inseefr.github.io/JDCruncheR","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InseeFr.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-11-14T12:59:02.000Z","updated_at":"2025-07-24T12:55:12.000Z","dependencies_parsed_at":"2024-01-26T12:12:01.763Z","dependency_job_id":"33dada24-fc6b-42ca-9127-ca50e8ef0a71","html_url":"https://github.com/InseeFr/JDCruncheR","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/InseeFr/JDCruncheR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FJDCruncheR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FJDCruncheR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FJDCruncheR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FJDCruncheR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InseeFr","download_url":"https://codeload.github.com/InseeFr/JDCruncheR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InseeFr%2FJDCruncheR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279009509,"owners_count":26084609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extension","jdemetra","jwsacruncher","quality-assessment","r","r-package"],"created_at":"2025-01-29T06:55:17.797Z","updated_at":"2025-10-12T00:31:28.778Z","avatar_url":"https://github.com/InseeFr.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n    collapse = TRUE,\n    comment = \"#\u003e\",\n    fig.align = \"center\",\n    fig.path = \"README-\"\n)\n```\n\n# **{JDCruncheR}** \u003ca href=\"https://inseefr.github.io/JDCruncheR/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"150\" style=\"float:right; height:150px;\"/\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/JDCruncheR)](https://cran.r-project.org/package=JDCruncheR)\n[![Linting code](https://github.com/InseeFr/JDCruncheR/actions/workflows/lint.yaml/badge.svg)](https://github.com/InseeFr/JDCruncheR/actions/workflows/lint.yaml)\n[![R-CMD-check](https://github.com/InseeFr/JDCruncheR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/InseeFr/JDCruncheR/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\n\n\u003cdiv align = center\u003e\n  \n## [🇫🇷 README en français](#présentation) | [🇬🇧 README in english](#overview)\n\n\u003cdiv align = left\u003e\n\n### Présentation\n\nLe but premier du package **{JDCruncheR}** est de fournir un accès rapide et facile au cruncher (`JWSACruncher`) depuis R. Le cruncher est un outil de mise à jour des workspaces de JDemetra+ sans avoir à ouvrir la GUI (Graphical User Interface). La dernière version peut être téléchargée ici : https://github.com/jdemetra/jwsacruncher/releases. Pour plus d'information, vous pouvez visiter la page [wiki](https://github.com/jdemetra/jwsacruncher/wiki).\n\nAvec **{JDCruncheR}**, vous pouvez aussi générer des *bilans qualité* utilisant l'output du cruncher. Ce bilan est un résumé des diagnostiques de la désaisonnalisation. Il peut être utilisé pour repérer les séries les plus problématiques qui nécessitent une analyse plus fine. Cela est très utile lorsqu'on a beaucoup de séries à désaisonnaliser.\n\n### Installation\n\n**🎉 {JDCruncheR} est maintenant disponible sur le CRAN ! 🎉**\n\nPour installer, il suffit de lancer la ligne de code suivante :\n\n```{r fr-CRAN-installation, eval = FALSE}\ninstall.packages(\"JDCruncheR\")\n```\n\nPour obtenir la version en cours de développement depuis GitHub :\n\n```{r fr-gh-devel-installation, eval = FALSE}\n# Si le package remotes n'est pas installé\n# install.packages(\"remotes\")\n\n# Installer la version en cours de développement depuis GitHub\nremotes::install_github(\"InseeFr/JDCruncheR\")\n```\n\n### Usage\n\n#### Chargement du package\n\n```{r fr-loading-JDCruncheR, eval = TRUE}\nlibrary(\"JDCruncheR\")\n```\n\n#### Changer les seuils des tests statistiques\n\nLes seuils des tests du bilan qualité sont personnalisables.\nPour cela, il faut modifier l'option `\"jdc_thresholds\"`.\n\nPour récupérer les valeurs des tests par défault, il faut appeler la fonction `get_thresholds()` :\n\n```{r fr-get-threshold, eval = TRUE}\nget_thresholds(\"m7\", default = TRUE)\nget_thresholds(default = TRUE)\n```\n\nPour changer la valeur de l'option, on peut utiliser la fonction `set_thresholds()` :\n\n```{r fr-set-threshold, eval = TRUE}\n# Fixer les seuils à une certaine valeur\nset_thresholds(test_name = \"m7\", thresholds = c(Good = 0.8, Bad = 1.4, Severe = Inf))\nget_thresholds(test_name = \"m7\", default = FALSE)\n\n# Remettre tous les seuils à leur valeur par défaut\nset_thresholds()\nget_thresholds(test_name = \"m7\", default = FALSE)\n```\n\n#### Changer les notes des modalités `Good`, `Uncertain`, `Bad` et `Severe`\n\nLe mécanisme est le même que pour les seuils des tests statistiques avec la valeur `\"grade\"` :\n\nPour récupérer la valeur par défault des notes, il faut appeler la fonction `get_thresholds()` :\n\n```{r fr-get-grade, eval = TRUE}\nget_thresholds(\"grade\", default = TRUE)\n```\n\nPour changer la valeur de la note, on peut utiliser la fonction `set_thresholds()` :\n\n```{r fr-set-grade, eval = TRUE}\n# Fixer les notes à une certaine valeur\nset_thresholds(test_name = \"grade\", thresholds = c(Good = 0, Uncertain = 0.1, Bad = 1, Severe = 10))\nget_thresholds(test_name = \"grade\", default = FALSE)\n```\n\n#### Calculer un bilan qualité\n\nPar exemple, en partant d'une matrice `demetra_m.csv` :\n\n|        | n   | start      | end        | mean | skewness |     | kurtosis |     | lb2  |     | p | d | q | bp | bd | bq | m7  | q   | q.m2 |\n|--------|-----|------------|------------|------|----------|-----|----------|-----|------|-----|---|---|---|----|----|----|-----|-----|------|\n| France | 88  | 2012-10-01 | 2020-01-01 | 0.6  | 0.0      | 0.9 | 2.9      | 0.8 | 36.1 | 0.0 | 0 | 1 | 1 | 0  | 1  | 1  | 0.2 | 0.5 | 2.0  |\n| Spain  | 78  | 2015-10-01 | 2022-03-01 | 0.4  | -0.4     | 0.0 | 4.6      | 0.0 | 17.3 | 0.7 | 0 | 0 | 1 | 0  | 1  | 1  | 0.8 | 1.5 | 1.3  |\n| Greece | 112 | 2010-10-01 | 2020-01-01 | 0.5  | -0.3     | 0.0 | 3.7      | 0.0 | 46.9 | 0.0 | 3 | 1 | 1 | 0  | 1  | 1  | 0.3 | 0.4 | 0.8  |\n\nOn peut générer un bilan qualité :\n\n```{r fr-set-demetra_m, eval = TRUE, echo = FALSE}\ndemetra_m \u003c- data.frame(\n    X = c(\"France\", \"Spain\", \"Greece\"), \n    n = c(88L, 78L, 112L), \n    start = c(\"2012-10-01\", \"2015-10-01\", \"2010-10-01\"), \n    end = c(\"2020-01-01\", \"2022-03-01\", \"2020-01-01\"), \n    mean = c(0.608599, 0.418266, 0.51853), \n    skewness = c(0.014553, -0.414881, -0.336935), \n    X.1 = c(0.9093, 0.0011, 0.0083), \n    kurtosis = c(2.931535, 4.628171, 3.739243), \n    X.2 = c(0.7886, 0, 0.0038), \n    lb2 = c(36.14241, 17.263369, 46.853219), \n    X.3 = c(0.0293, 0.7487, 4e-04), \n    p = c(0L, 0L, 3L), \n    d = c(1L, 0L, 1L), \n    q = c(1L, 1L, 1L), \n    bp = c(0L, 0L, 0L), \n    bd = c(1L, 1L, 1L), \n    bq = c(1L, 1L, 1L), \n    m7 = c(0.239737242, 0.785293416, 0.309003156), \n    q.1 = c(0.510868052, 1.524804319, 1.131292538), \n    q.m2 = c(2.00493169, 1.342476763, 0.816821294), \n    stringsAsFactors = FALSE\n)\n```\n\n```{r fr-extract_QR, eval = TRUE, warning = FALSE}\nBQ \u003c- extract_QR(x = demetra_m)\nprint(BQ$modalities)\n```\n\n#### Calculer un score\n\nIl est possible maintenant de calculer un score à partir du bilan qualité\n\n```{r fr-compute_score, eval = TRUE, warning = FALSE}\nBQ_score \u003c- compute_score(\n    x = BQ,\n    score_pond = c(\n        oos_mean = 15L, \n        residuals_kurtosis = 15L, \n        residuals_homoskedasticity = 5L, \n        residuals_skewness = 5L, \n        m7 = 5L, \n        q_m2 = 5L\n    )\n)\nextract_score(x = BQ_score)\n```\n\n#### Exporter un bilan qualité\n\nEnfin il est possible d'exporter un bilan qualité via la fonction `export_xlsx`.\n\n### Autres informations\n\nPour plus d'informations sur l'installation et la configuration du package **{JDCruncheR}**, vous pouvez visiter la page [wiki](https://github.com/jdemetra/jwsacruncher/wiki)\n\nPour une description plus complète des packages R pour JDemetra+ voir le document de travail Insee [Les packages R pour JDemetra+ : une aide à la désaisonnalisation](https://www.insee.fr/fr/statistiques/5019786)\n\n\n### Overview\n\nThe primary objective of the **{JDCruncheR}** package is to provide a quick and easy access to the JDemetra+ cruncher (`JWSACruncher`) from R. The cruncher is a tool for updating JDemetra+ workspaces, without having to open the graphical user interface. The latest version can be downloaded here: \u003chttps://github.com/jdemetra/jwsacruncher/releases\u003e. For more information, please refer to the [wiki page](https://github.com/jdemetra/jwsacruncher/wiki).\n\nWith **{JDCruncheR}**, you can also generate a *quality report* based on the cruncher's output. This report is a formatted summary of the seasonal adjustment process master diagnostics and parameters. It can be used to spot the most problematic series which will require a finer analysis. This is most useful when dealing with a large number of series.\n\n### Installation\n\n**🎉 {JDCruncheR} is now available on CRAN! 🎉**\n\nTo install it, you have to launch the following command line:\n\n```{r en-CRAN-installation, eval = FALSE}\ninstall.packages(\"JDCruncheR\")\n```\n\nTo get the current development version from GitHub:\n\n```{r en-gh-devel-installation, eval = FALSE}\n# If remotes packages is not installed\n# install.packages(\"remotes\")\n\n# Install development version from GitHub\nremotes::install_github(\"InseeFr/JDCruncheR\")\n```\n\n### Usage\n\n#### Loading the package\n\n```{r en-loading-JDCruncheR, eval = TRUE}\nlibrary(\"JDCruncheR\")\n```\n\n#### Changing statistical test thresholds\n\nThe thresholds of the QR tests can be customised\nYou have to modify the option `\"jdc_thresholds\"`.\n\nTo get the (default or not) values of the thresholds of the tests, you can call the fonction `get_thresholds()` :\n\n```{r en-get-threshold, eval = TRUE}\nget_thresholds(\"m7\")\nget_thresholds(default = TRUE)\n```\n\nTo change the value of the option, you can use the fonction `set_thresholds()`:\n\n```{r en-set-threshold, eval = TRUE}\n# Set threshold to imposed value\nset_thresholds(test_name = \"m7\", thresholds = c(Good = 0.8, Bad = 1.4, Severe = Inf))\nget_thresholds(test_name = \"m7\", default = FALSE)\n\n# Reset all thresholds to default\nset_thresholds()\nget_thresholds(test_name = \"m7\", default = FALSE)\n```\n\n#### Changing the scores for the `Good`, `Uncertain`, `Bad` and `Severe` modalities\n\nThe mechanism is the same as for the statistical test thresholds with the `\"grade\"` value:\n\nTo retrieve the default grade value, call the `get_thresholds()` function:\n\n```{r en-get-grade, eval = TRUE}\nget_thresholds(\"grade\", default = TRUE)\n```\n\nTo change the value of the grade, you can use the `set_thresholds()` function:\n\n```{r en-set-grade, eval = TRUE}\n# Set grades to a certain value\nset_thresholds(test_name = \"grade\", thresholds = c(Good = 0, Uncertain = 0.1, Bad = 1, Severe = 10))\nget_thresholds(test_name = \"grade\", default = FALSE)\n```\n\n#### Calculate a quality report\n\nFor example, starting from a matrix `demetra_m.csv` :\n\n|        | n   | start      | end        | mean | skewness |     | kurtosis |     | lb2  |     | p | d | q | bp | bd | bq | m7  | q   | q.m2 |\n|--------|-----|------------|------------|------|----------|-----|----------|-----|------|-----|---|---|---|----|----|----|-----|-----|------|\n| France | 88  | 2012-10-01 | 2020-01-01 | 0.6  | 0.0      | 0.9 | 2.9      | 0.8 | 36.1 | 0.0 | 0 | 1 | 1 | 0  | 1  | 1  | 0.2 | 0.5 | 2.0  |\n| Spain  | 78  | 2015-10-01 | 2022-03-01 | 0.4  | -0.4     | 0.0 | 4.6      | 0.0 | 17.3 | 0.7 | 0 | 0 | 1 | 0  | 1  | 1  | 0.8 | 1.5 | 1.3  |\n| Greece | 112 | 2010-10-01 | 2020-01-01 | 0.5  | -0.3     | 0.0 | 3.7      | 0.0 | 46.9 | 0.0 | 3 | 1 | 1 | 0  | 1  | 1  | 0.3 | 0.4 | 0.8  |\n\nA quality report can be generated:\n\n```{r en-set-demetra_m, eval = TRUE, echo = FALSE}\ndemetra_m \u003c- data.frame(\n    X = c(\"France\", \"Spain\", \"Greece\"), \n    n = c(88L, 78L, 112L), \n    start = c(\"2012-10-01\", \"2015-10-01\", \"2010-10-01\"), \n    end = c(\"2020-01-01\", \"2022-03-01\", \"2020-01-01\"), \n    mean = c(0.608599, 0.418266, 0.51853), \n    skewness = c(0.014553, -0.414881, -0.336935), \n    X.1 = c(0.9093, 0.0011, 0.0083), \n    kurtosis = c(2.931535, 4.628171, 3.739243), \n    X.2 = c(0.7886, 0, 0.0038), \n    lb2 = c(36.14241, 17.263369, 46.853219), \n    X.3 = c(0.0293, 0.7487, 4e-04), \n    p = c(0L, 0L, 3L), \n    d = c(1L, 0L, 1L), \n    q = c(1L, 1L, 1L), \n    bp = c(0L, 0L, 0L), \n    bd = c(1L, 1L, 1L), \n    bq = c(1L, 1L, 1L), \n    m7 = c(0.239737242, 0.785293416, 0.309003156), \n    q.1 = c(0.510868052, 1.524804319, 1.131292538), \n    q.m2 = c(2.00493169, 1.342476763, 0.816821294), \n    stringsAsFactors = FALSE\n)\n```\n\n```{r en-extract_QR, eval = TRUE, warning = FALSE}\nBQ \u003c- extract_QR(x = demetra_m)\nprint(BQ$modalities)\n```\n\n#### Calculate a score\n\nIt is now possible to calculate a score from the quality report:\n\n```{r en-compute_score, eval = TRUE, warning = FALSE}\nBQ_score \u003c- compute_score(\n    x = BQ,\n    score_pond = c(\n        oos_mean = 15L, \n        residuals_kurtosis = 15L, \n        residuals_homoskedasticity = 5L, \n        residuals_skewness = 5L, \n        m7 = 5L, \n        q_m2 = 5L\n    )\n)\nextract_score(x = BQ_score)\n```\n\n#### Exporting a quality report\n\nFinally, you can export a quality report using the `export_xlsx` function.\n\n### Other informations\n\nFor more informations on installing and configuring the **{JDCruncheR}** package, you can visit the [wiki](https://github.com/jdemetra/jwsacruncher/wiki) page.\n\nFor a more comprehensive description of the R packages for JDemetra+ check the Insee working paper [R Tools for JDemetra+: Seasonal adjustment made easier](https://www.insee.fr/en/statistiques/5019812)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finseefr%2Fjdcruncher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finseefr%2Fjdcruncher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finseefr%2Fjdcruncher/lists"}