{"id":32203588,"url":"https://github.com/ropensci/jagstargets","last_synced_at":"2026-02-19T07:31:12.122Z","repository":{"id":41951609,"uuid":"321076424","full_name":"ropensci/jagstargets","owner":"ropensci","description":"Reproducible Bayesian data analysis pipelines with targets and JAGS","archived":false,"fork":false,"pushed_at":"2024-12-03T12:25:13.000Z","size":628,"stargazers_count":11,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-22T06:04:15.115Z","etag":null,"topics":["bayesian","high-performance-computing","jags","make","r","r-targetopia","reproducibility","rjags","rstats","rstats-package","statistics","targets"],"latest_commit_sha":null,"homepage":"https://docs.ropensci.org/jagstargets","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/ropensci.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","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":"codemeta.json","zenodo":".zenodo.json"}},"created_at":"2020-12-13T13:52:27.000Z","updated_at":"2025-06-30T15:49:00.000Z","dependencies_parsed_at":"2023-02-03T06:01:30.070Z","dependency_job_id":"2e92d384-f7a6-4ef3-9491-b2cbcc359626","html_url":"https://github.com/ropensci/jagstargets","commit_stats":{"total_commits":223,"total_committers":7,"mean_commits":"31.857142857142858","dds":"0.026905829596412523","last_synced_commit":"12f440151c234dce6fe35a5a895be3ea47c5fb60"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ropensci/jagstargets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fjagstargets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fjagstargets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fjagstargets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fjagstargets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ropensci","download_url":"https://codeload.github.com/ropensci/jagstargets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fjagstargets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29606818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bayesian","high-performance-computing","jags","make","r","r-targetopia","reproducibility","rjags","rstats","rstats-package","statistics","targets"],"created_at":"2025-10-22T04:43:05.473Z","updated_at":"2026-02-19T07:31:12.104Z","avatar_url":"https://github.com/ropensci.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# jagstargets \u003cimg src='man/figures/logo.png' align=\"right\" height=\"139\"/\u003e\n\n[![JOSS](https://joss.theoj.org/papers/759f48d9ae7bc57e318e2d0ecc00569e/status.svg)](https://joss.theoj.org/papers/10.21105/joss.03877)\n[![ropensci](https://badges.ropensci.org/425_status.svg)](https://github.com/ropensci/software-review/issues/425)\n[![DOI](https://zenodo.org/badge/321076424.svg)](https://zenodo.org/badge/latestdoi/321076424)\n[![R Targetopia](https://img.shields.io/badge/R_Targetopia-member-blue?style=flat\u0026labelColor=gray)](https://wlandau.github.io/targetopia/)\n[![cran](https://www.r-pkg.org/badges/version/jagstargets)](https://cran.r-project.org/package=jagstargets)\n[![status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![check](https://github.com/ropensci/jagstargets/workflows/check/badge.svg)](https://github.com/ropensci/jagstargets/actions?query=workflow%3Acheck)\n[![codecov](https://codecov.io/gh/ropensci/jagstargets/branch/main/graph/badge.svg?token=3T5DlLwUVl)](https://app.codecov.io/gh/ropensci/gittargets)\n[![lint](https://github.com/ropensci/jagstargets/workflows/lint/badge.svg)](https://github.com/ropensci/jagstargets/actions?query=workflow%3Alint)\n\nBayesian data analysis usually incurs long runtimes and cumbersome custom code, and the process of prototyping and deploying custom [JAGS](https://mcmc-jags.sourceforge.io) models can become a daunting software engineering challenge. To ease this burden, the `jagstargets` R package creates [JAGS](https://mcmc-jags.sourceforge.io) pipelines that are concise, efficient, scalable, and tailored to the needs of Bayesian statisticians. Leveraging [`targets`](https://docs.ropensci.org/targets/), `jagstargets` pipelines automatically parallelize the computation and skip expensive steps when the results are already up to date. Minimal custom user-side code is required, and there is no need to manually configure branching, so `jagstargets` is easier to use than [`targets`](https://docs.ropensci.org/targets/) and [`R2jags`](https://CRAN.R-project.org/package=R2jags) directly.\n\n## Prerequisites\n\n1. The [prerequisites of the `targets` R package](https://docs.ropensci.org/targets/#prerequisites).\n1. Basic familiarity with [`targets`](https://docs.ropensci.org/targets/): watch minutes 7 through 40 of [this video](https://youtu.be/Gqn7Xn4d5NI?t=439), then read [this chapter](https://books.ropensci.org/targets/walkthrough.html) of the [user manual](https://books.ropensci.org/targets/).\n1. Familiarity with Bayesian Statistics and [JAGS](https://mcmc-jags.sourceforge.io/). Prior knowledge of [`rjags`](https://cran.r-project.org/package=rjags) or [`R2jags`](https://cran.r-project.org/package=R2jags) helps.\n\n## How to get started\n\nRead the `jagstargets` [introductory vignette](https://docs.ropensci.org/jagstargets/articles/introduction.html), and then use \u003chttps://docs.ropensci.org/jagstargets/\u003e as a reference while constructing your own workflows. If you need to analyze large collections of simulated datasets, please consult the [simulation vignette](https://docs.ropensci.org/jagstargets/articles/simulation.html).\n\n## Installation\n\n`jagstargets` requires the user to install [JAGS](https://mcmc-jags.sourceforge.io/), [`rjags`](https://CRAN.R-project.org/package=rjags), and [`R2jags`](https://CRAN.R-project.org/package=R2jags) beforehand. You can install JAGS from \u003chttps://mcmc-jags.sourceforge.io/\u003e, and you can install the rest from CRAN.\n\n```{r, eval = FALSE}\ninstall.packages(c(\"rjags\", \"R2jags\"))\n```\n\nThen, install the latest release from CRAN.\n\n```{r, eval = FALSE}\ninstall.packages(\"jagstargets\")\n```\n\nAlternatively, install the GitHub development version to access the latest features and patches.\n\n```{r, eval = FALSE}\ninstall.packages(\"remotes\")\nremotes::install_github(\"ropensci/jagstargets\")\n```\n\n## Usage\n\nBegin with one or more models: for example, the simple regression model below with response variable $y$ and covariate $x$.\n\n\u003ccenter\u003e\n\u003cimg src=\"./man/figures/model.gif\"\u003e\n\u003c/center\u003e\n\nNext, write a JAGS model file for each model like the `model.jags` file below.\n\n```jags\nmodel {\n  for (i in 1:n) {\n    y[i] ~ dnorm(x[i] * beta, 1)\n  }\n  beta ~ dnorm(0, 1)\n}\n```\n\nTo begin a reproducible analysis pipeline with this model, write a [`_targets.R` file](https://books.ropensci.org/targets/walkthrough.html) that loads your packages, defines a function to generate JAGS data, and lists a pipeline of targets. The target list can call target factories like [`tar_jags()`](https://docs.ropensci.org/jagstargets/reference/tar_jags.html) as well as ordinary targets with [`tar_target()`](https://docs.ropensci.org/targets/reference/tar_target.html). The following minimal example is simple enough to contain entirely within the `_targets.R` file, but for larger projects, you may wish to store functions in separate files as in the [`targets-stan`](https://github.com/wlandau/targets-stan) example.\n\n```{r, eval = FALSE}\n# _targets.R\nlibrary(targets)\nlibrary(jagstargets)\n\ngenerate_data \u003c- function() {\n  true_beta \u003c- stats::rnorm(n = 1, mean = 0, sd = 1)\n  x \u003c- seq(from = -1, to = 1, length.out = n)\n  y \u003c- stats::rnorm(n, x * true_beta, 1)\n  out \u003c- list(n = n, x = x, y = y, true_beta = true_beta)\n}\n\nlist(\n  tar_jags(\n    example,\n    jags_files = \"model.jags\", # You provide this file.\n    parameters.to.save = \"beta\",\n    data = generate_data()\n  )\n)\n```\n\nRun [`tar_visnetwork()`](https://docs.ropensci.org/targets/reference/tar_visnetwork.html) to check `_targets.R` for correctness, then call [`tar_make()`](https://docs.ropensci.org/targets/reference/tar_make.html) to run the pipeline. Access the results using [`tar_read()`](https://docs.ropensci.org/targets/reference/tar_read.html), e.g. `tar_read(tar_read(example_summary_x)`. Visit the [introductory vignette](https://docs.ropensci.org/jagstargets/articles/introduction.html) to read more about this example.\n\n## How the package works\n\n`jagstargets` supports specialized [target factories](https://ropensci.org/blog/2021/02/03/targets/#target-factories) that create ensembles of [target objects](https://docs.ropensci.org/targets/reference/tar_target.html) for [`R2jags`](https://CRAN.R-project.org/package=R2jags) workflows. These [target factories](https://ropensci.org/blog/2021/02/03/targets/#target-factories) abstract away the details of [`targets`](https://docs.ropensci.org/targets/) and [`R2jags`](https://CRAN.R-project.org/package=R2jags) and make both packages easier to use. For details, please read the [introductory vignette](https://docs.ropensci.org/jagstargets/articles/introduction.html).\n\n## Help\n\nPlease read the `targets` help guide at \u003chttps://books.ropensci.org/targets/help.html\u003e to learn how to ask for help.\n\nIf you have trouble using `jagstargets`, you can ask for help in the [GitHub discussions forum](https://github.com/ropensci/jagstargets/discussions/categories/help). Because the purpose of `jagstargets` is to combine [`targets`](https://docs.ropensci.org/targets/) and [`R2jags`](https://CRAN.R-project.org/package=R2jags), your issue may have something to do with one of the latter two packages, a [dependency of `targets`](https://github.com/ropensci/targets/blob/4e3ef2a6c986f558a25e544416f480fc01236b6b/DESCRIPTION#L49-L88), or [`R2jags`](https://CRAN.R-project.org/package=R2jags) itself. When you troubleshoot, peel back as many layers as possible to isolate the problem. For example, if the issue comes from [`R2jags`](https://CRAN.R-project.org/package=R2jags), create a [reproducible example](https://reprex.tidyverse.org) that directly invokes [`R2jags`](https://CRAN.R-project.org/package=R2jags) without invoking `jagstargets`. The GitHub discussion and issue forums of those packages are great resources.\n\n## Participation\n\nDevelopment is a community effort, and we welcome discussion and contribution. By participating in this project, you agree to abide by the [code of conduct](https://ropensci.org/code-of-conduct/) and the [contributing guide](https://github.com/ropensci/jagstargets/blob/main/CONTRIBUTING.md).\n\n## Citation\n\n```{r, warning = FALSE}\ncitation(\"jagstargets\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Fjagstargets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropensci%2Fjagstargets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Fjagstargets/lists"}