{"id":28702890,"url":"https://github.com/epiforecasts/stanedit","last_synced_at":"2025-10-05T08:32:24.852Z","repository":{"id":262671510,"uuid":"887992024","full_name":"epiforecasts/stanedit","owner":"epiforecasts","description":"Edit stan models from R","archived":false,"fork":false,"pushed_at":"2024-12-03T11:11:21.000Z","size":91,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-03T12:20:34.081Z","etag":null,"topics":["probabilistic-programming","stan"],"latest_commit_sha":null,"homepage":"http://epiforecasts.io/stanedit/","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/epiforecasts.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}},"created_at":"2024-11-13T16:20:07.000Z","updated_at":"2024-12-03T11:09:02.000Z","dependencies_parsed_at":"2024-11-13T17:27:49.588Z","dependency_job_id":"e06eff8a-4258-4674-876e-91c9267634e3","html_url":"https://github.com/epiforecasts/stanedit","commit_stats":null,"previous_names":["epiforecasts/stanedit"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/epiforecasts/stanedit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fstanedit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fstanedit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fstanedit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fstanedit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epiforecasts","download_url":"https://codeload.github.com/epiforecasts/stanedit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fstanedit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259820812,"owners_count":22916548,"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","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":["probabilistic-programming","stan"],"created_at":"2025-06-14T13:05:48.876Z","updated_at":"2025-10-05T08:32:19.824Z","avatar_url":"https://github.com/epiforecasts.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n## Edit stan models using R\n\nThis package facilitates editing of stan model code using R. This includes adding/removing blocks, extracting variable names, and inserting/removing lines.\n\nDevelopment of this package was inspired by the `\u003cbi_model\u003e` class in the [rbi](https://github.com/sbfnk/rbi) package.\n\n## Installation\n\nThe stable version of the package can be installed using\n```{r eval=FALSE}\ninstall.packages(\"stanedit\", repos = \"https://epiforecasts.r-universe.dev/\")\n```\n\nThe development version can be installed using `pak`\n```{r eval=FALSE}\npak::pak(\"epiforecasts/stanedit\")\n```\n\n## Example\n\nFirst we load a stan model and prepare it for editing using the functionality in this package.\n\n```{r}\nlibrary(\"stanedit\")\nmodel_file_name \u003c- system.file(package = \"stanedit\", \"regression.stan\")\nreg \u003c- stanedit(filename = model_file_name)\nreg\n```\n\nLet's say we want to add standard normal priors for alpha and beta.\nWe can do this using\n\n```{r}\ninsert_lines(reg,\n  lines = c(\n    \"alpha ~ std_normal();\",\n    \"beta ~ std_normal();\"\n  ),\n  at_end_of = \"model\"\n)\n```\n\n## Contributors\n\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\nAll contributions to this project are gratefully acknowledged using the [`allcontributors` package](https://github.com/ropensci/allcontributors) following the [all-contributors](https://allcontributors.org) specification. Contributions of any kind are welcome!\n\n\n\u003ca href=\"https://github.com/epiforecasts/stanedit/commits?author=sbfnk\"\u003esbfnk\u003c/a\u003e\n\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepiforecasts%2Fstanedit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepiforecasts%2Fstanedit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepiforecasts%2Fstanedit/lists"}