{"id":26447290,"url":"https://github.com/byzheng/rapsimng","last_synced_at":"2025-07-24T01:32:53.119Z","repository":{"id":44426256,"uuid":"171789498","full_name":"byzheng/rapsimng","owner":"byzheng","description":"A R package for APSIM Next Generation","archived":false,"fork":false,"pushed_at":"2025-03-20T04:18:04.000Z","size":6039,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T15:04:41.412Z","etag":null,"topics":["apsim","apsimx","r"],"latest_commit_sha":null,"homepage":"https://rapsimng.bangyou.me/","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/byzheng.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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}},"created_at":"2019-02-21T02:57:31.000Z","updated_at":"2025-03-22T08:13:45.000Z","dependencies_parsed_at":"2023-01-18T16:30:55.024Z","dependency_job_id":"8b95a295-340a-4fea-931f-57f321d12413","html_url":"https://github.com/byzheng/rapsimng","commit_stats":{"total_commits":147,"total_committers":2,"mean_commits":73.5,"dds":"0.027210884353741527","last_synced_commit":"f647c680ae3ae675cea9445d97c1fea373d79db1"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/byzheng/rapsimng","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byzheng%2Frapsimng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byzheng%2Frapsimng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byzheng%2Frapsimng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byzheng%2Frapsimng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byzheng","download_url":"https://codeload.github.com/byzheng/rapsimng/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byzheng%2Frapsimng/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266779178,"owners_count":23982881,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["apsim","apsimx","r"],"created_at":"2025-03-18T13:51:37.540Z","updated_at":"2025-07-24T01:32:53.095Z","avatar_url":"https://github.com/byzheng.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rapsimng\n[![](https://www.r-pkg.org/badges/version/rapsimng?color=green)](https://cran.r-project.org/package=rapsimng)\n![R-CMD-check](https://github.com/byzheng/rapsimng/workflows/R-CMD-check/badge.svg) \n\n[![](http://cranlogs.r-pkg.org/badges/grand-total/rapsimng?color=green)](https://cran.r-project.org/package=rapsimng)\n[![](http://cranlogs.r-pkg.org/badges/last-month/rapsimng?color=green)](https://cran.r-project.org/package=rapsimng)\n[![](http://cranlogs.r-pkg.org/badges/last-week/rapsimng?color=green)](https://cran.r-project.org/package=rapsimng)\n\n\n[rapsimng](https://rapsimng.bangyou.me) package is designed to modify and run the *.apsimx simulations using R in [APSIM Next Generation](https://www.apsim.info/).\n\n\n\n## Features\n* Find elements in the *.apsimx file\n\n\n\n## Installation\n\nInstall from CRAN.\n\n```r\ninstall.packages('rapsimng')\n```\n\n\nInstall the developing version from [Github](https://github.com/byzheng/rapsimng).\n\n```r\nremotes::install_github('byzheng/rapsimng')\n```\n\n\n## Read APSIMX file\n\nThe `wheat.apsimx` in the validation dataset of APSIM NG  is used as an example. Function `read_apsimx` is used to read `*.apsimx` file through `jsonlite::read_json` and returns as a list.\n\n\n```r\n# Read Wheat.apsimx file with `read_apsimx` which returns a list of json results.\nfile \u003c- system.file(\"extdata/wheat.apsimx\", package = \"rapsimng\")\nm \u003c- read_apsimx(file)\n\n```\n\n\n\n## Search by of APSIM NG\n\nA node in the apsimx file can be found using the path specification in APSIM NG.\n```r\npotential \u003c- search_path(m,\n    path = '[Structure].BranchingRate.PotentialBranchingRate.Vegetative.PotentialBranchingRate')\npotential\n```\n\n\n## Modify a found model \n```r\nnew_model \u003c- potential$node\nnew_model$XProperty \u003c- 'NewVariable'\n```\n\n## Replace the new model \n```r\nnew \u003c- replace_model(m, potential$path, new_model)\n```\n\n## Save into a new apsimx file\n```r\nwrite_apsimx(new, tempfile(fileext = '.json'))\n```\n\n\n## Run apsimx file\n\nA function `run_models` is wrapped for APSIM NG `Models.exe` in the command line and can be called to run apsimx files. See [APSIM website](https://apsimnextgeneration.netlify.app/) for documentation. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyzheng%2Frapsimng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyzheng%2Frapsimng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyzheng%2Frapsimng/lists"}