{"id":31786085,"url":"https://github.com/danielvartan/logolink","last_synced_at":"2026-01-08T21:13:00.893Z","repository":{"id":316676915,"uuid":"1063651220","full_name":"danielvartan/logolink","owner":"danielvartan","description":"🐢 An Interface for Running NetLogo Simulations from R","archived":false,"fork":false,"pushed_at":"2025-10-06T07:39:51.000Z","size":12003,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T09:37:46.284Z","etag":null,"topics":["agent-based-modeling","apis","behaviorspace","complexity-science","computational-science","computational-social-science","data-science","ecological-modeling","environmental-modeling","headless-execution","individual-based-modeling","multi-agent-systems","netlogo","r-packages","rstats","simulations","system-dynamics","tidyverse"],"latest_commit_sha":null,"homepage":"https://danielvartan.github.io/logolink/","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/danielvartan.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["danielvartan"]}},"created_at":"2025-09-24T23:47:45.000Z","updated_at":"2025-10-06T07:38:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"897421ad-8e20-49a7-876d-5462077dece6","html_url":"https://github.com/danielvartan/logolink","commit_stats":null,"previous_names":["danielvartan/logolink"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danielvartan/logolink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Flogolink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Flogolink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Flogolink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Flogolink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielvartan","download_url":"https://codeload.github.com/danielvartan/logolink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielvartan%2Flogolink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003899,"owners_count":26083641,"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-10T02:00:06.843Z","response_time":62,"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":["agent-based-modeling","apis","behaviorspace","complexity-science","computational-science","computational-social-science","data-science","ecological-modeling","environmental-modeling","headless-execution","individual-based-modeling","multi-agent-systems","netlogo","r-packages","rstats","simulations","system-dynamics","tidyverse"],"created_at":"2025-10-10T12:44:14.444Z","updated_at":"2026-01-08T21:13:00.875Z","avatar_url":"https://github.com/danielvartan.png","language":"R","funding_links":["https://github.com/sponsors/danielvartan"],"categories":[],"sub_categories":[],"readme":"# logolink \u003ca href = \"https://danielvartan.github.io/logolink/\"\u003e\u003cimg src = \"man/figures/logo.svg\" align=\"right\" width=\"120\" /\u003e\u003c/a\u003e\n\n\u003c!-- quarto render --\u003e\n\n\u003c!-- Install the package before rendering this file: `devtools::install()` --\u003e\n\n\u003c!-- badges: start --\u003e\n[![Project Status: Active - The project has reached a stable, usable\nstate and is being actively\ndeveloped.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![CRAN Status\nBadge](https://www.r-pkg.org/badges/version-ago/logolink)](https://cran.r-project.org/package=logolink)\n[![DOI\nbadge](https://img.shields.io/badge/doi-10.32614/CRAN.package.logolink-1284C5.svg)](https://doi.org/10.32614/CRAN.package.logolink)\n[![](http://cranlogs.r-pkg.org/badges/grand-total/logolink)](https://cran.r-project.org/package=logolink)\n[![R build\nstatus](https://github.com/danielvartan/logolink/workflows/R-CMD-check/badge.svg)](https://github.com/danielvartan/logolink/actions)\n[![CRAN\nchecks](https://badges.cranchecks.info/summary/logolink.svg)](https://cran.r-project.org/web/checks/check_results_logolink.html)\n[![FAIR checklist\nbadge](https://img.shields.io/badge/fairsoftwarechecklist.net--00a7d9)](https://fairsoftwarechecklist.net/v0.2/?f=31\u0026a=32113\u0026i=32322\u0026r=133)\n[![](https://codecov.io/gh/danielvartan/logolink/branch/main/graph/badge.svg)](https://app.codecov.io/gh/danielvartan/logolink)\n[![GNU GPLv3\nLicense](https://img.shields.io/badge/license-GPLv3-bd0000.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![FAIR checklist\nbadge](https://img.shields.io/badge/fairsoftwarechecklist.net--00a7d9)](https://fairsoftwarechecklist.net/v0.2/?f=31\u0026a=32113\u0026i=32322\u0026r=133)\n[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu)\n[![Contributor Covenant 3.0 Code of\nConduct](https://img.shields.io/badge/Contributor%20Covenant-3.0-4baaaa.svg)](https://www.contributor-covenant.org/version/3/0/code_of_conduct/)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\n`logolink` is an [R](https://www.r-project.org/) package that simplifies\nsetting up and running [NetLogo](https://www.netlogo.org/) simulations\ndirectly from R. It provides a modern, intuitive interface that follows\n[tidyverse\nprinciples](https://tidyverse.tidyverse.org/articles/manifesto.html) and\nintegrates seamlessly with the [tidyverse\necosystem](https://tidyverse.org/).\n\nThe package is designed to work with NetLogo 7.0.1 and above. Earlier\nversions are not supported. See NetLogo’s [Transition\nGuide](https://docs.netlogo.org/transition.html) to upgrade your models\nif needed.\n\n\u003e If you find this project useful, please consider giving it a star!  \n\u003e [![GitHub Repository\n\u003e Stars](https://img.shields.io/github/stars/danielvartan/logolink)](https://github.com/danielvartan/logolink/)\n\n\u003e The continuous development of `logolink` depends on community support.\n\u003e If you can afford to do so, please consider becoming a sponsor.  \n\u003e [![](https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86)](https://github.com/sponsors/danielvartan)\n\n## Another R Package for NetLogo?\n\nWhile other R packages connect R to NetLogo, `logolink` is currently the\nonly one that fully supports the latest NetLogo release. It is actively\nmaintained, follows [tidyverse\nconventions](https://design.tidyverse.org/), and is designed to be\nsimple and straightforward to use.\n\nFor context, [`RNetLogo`](https://CRAN.R-project.org/package=RNetLogo)\nsupports only older versions (up to 6.0.0, released in December 2016)\nand has not been updated since June 2017.\n[`nlrx`](https://CRAN.R-project.org/package=nlrx) offers a powerful\nframework for managing experiments and results, but\n[supports](https://docs.ropensci.org/nlrx/reference/supported_netlogo_versions.html)\nonly up to NetLogo 6.3.0 (released in September 2022), requires\nadditional system dependencies, uses its own internal conventions that\ndiverge from NetLogo standards, and has [many unresolved\nissues](https://github.com/ropensci/nlrx/issues).\n\n`logolink` complements these packages by prioritizing simplicity,\noffering finer control over output, ensuring full compatibility with\nNetLogo 7, and integrating seamlessly with modern R workflows.\n\n## Installation\n\nYou can install the released version of `logolink` from\n[CRAN](https://CRAN.R-project.org) with:\n\n``` r\ninstall.packages(\"logolink\")\n```\n\nAnd the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"danielvartan/logolink\")\n```\n\n## Usage\n\n`logolink` usage is very straightforward. The main functions are:\n\n- [`create_experiment`](https://danielvartan.github.io/logolink/reference/create_experiment.html):\n  Create NetLogo BehaviorSpace experiment\n- [`run_experiment`](https://danielvartan.github.io/logolink/reference/run_experiment.html):\n  Run NetLogo BehaviorSpace experiment\n\nAlong with this package, you will also need NetLogo 7.0.1 or higher\ninstalled on your computer. You can download it from the [NetLogo\nwebsite](https://www.netlogo.org).\n\n### Setting the Stage\n\nAfter installing NetLogo and `logolink`, start by loading the package\nwith:\n\n``` r\nlibrary(logolink)\n```\n\n`logolink` will try to find out the path to the NetLogo installation\nautomatically. This is usually successful, but if it fails, you can set\nit manually. See the documentation for the\n[`run_experiment`](https://danielvartan.github.io/logolink/reference/run_experiment.html)\nfunction for more details.\n\nTo start our example analysis, we’ll need to first specify the path to\nthe NetLogo model.\n\nThis example uses Wilensky’s [Wolf Sheep\nSimple](https://www.netlogoweb.org/launch#https://www.netlogoweb.org/assets/modelslib/IABM%20Textbook/chapter%204/Wolf%20Sheep%20Simple%205.nlogox)\nmodel, a classic predator-prey simulation grounded in the\n[Lotka-Volterra\nequations](https://danielvartan.github.io/lotka-volterra/) developed by\nAlfred J. Lotka\n([1925](http://archive.org/details/elementsofphysic017171mbp)) and Vito\nVolterra ([1926](https://www.nature.com/articles/118558a0)). Since this\nmodel comes bundled with NetLogo, no download is required.\n\nWe’ll use\n[`find_netlogo_home`](https://danielvartan.github.io/logolink/reference/find_netlogo_home.html)\nfunction to locate the NetLogo installation directory, then build the\npath to the model file:\n\n``` r\nmodel_path \u003c-\n  find_netlogo_home() |\u003e\n  file.path(\n    \"models\",\n    \"IABM Textbook\",\n    \"chapter 4\",\n    \"Wolf Sheep Simple 5.nlogox\"\n  )\n```\n\n### Creating an Experiment\n\nTo run the model from R, we’ll need to setup an experiment. We can do\nthis by setting a\n[BehaviorSpace](https://docs.netlogo.org/behaviorspace.html) experiment\nwith the\n[`create_experiment`](https://danielvartan.github.io/logolink/reference/create_experiment.html)\nfunction. This function will create a\n[BehaviorSpace](https://docs.netlogo.org/behaviorspace.html)\n[XML](https://en.wikipedia.org/wiki/XML) file that contains all the\ninformation about the experiment, including the parameters to vary, the\nmetrics to collect, and the number of runs to perform.\n\n``` r\nsetup_file \u003c- create_experiment(\n  name = \"Wolf Sheep Simple Model Analysis\",\n  repetitions = 10,\n  sequential_run_order = TRUE,\n  run_metrics_every_step = TRUE,\n  setup = \"setup\",\n  go = \"go\",\n  time_limit = 1000,\n  metrics = c(\n    'count wolves',\n    'count sheep'\n  ),\n  run_metrics_condition = NULL,\n  constants = list(\n    \"number-of-sheep\" = 500,\n    \"number-of-wolves\" = list(\n      first = 5,\n      step = 1,\n      last = 15\n    ),\n    \"movement-cost\" = 0.5,\n    \"grass-regrowth-rate\" = 0.3,\n    \"energy-gain-from-grass\" = 2,\n    \"energy-gain-from-sheep\" = 5\n  )\n)\n```\n\nAlternatively, you can set up your experiment [directly in\nNetLogo](https://docs.netlogo.org/behaviorspace.html#how-it-works) and\nsave it as part of your model. In this case, you can skip the\n[`create_experiment`](https://danielvartan.github.io/logolink/reference/create_experiment.html)\nstep and just provide the name of the experiment when running the model\nwith\n[`run_experiment`](https://danielvartan.github.io/logolink/reference/run_experiment.html).\n\n### Running the Simulation\n\nWith the experiment file created, we can now run the model using the\n[`run_experiment`](https://danielvartan.github.io/logolink/reference/run_experiment.html)\nfunction. This function will execute the NetLogo model with the\nspecified parameters and return the results as [tidy data\nframes](https://r4ds.hadley.nz/data-tidy.html).\n\n``` r\nresults \u003c-\n  model_path |\u003e\n  run_experiment(\n    setup_file = setup_file\n  )\n#\u003e ✔ Running model [13.4s]\n#\u003e ✔ Gathering metadata [15ms]\n#\u003e ✔ Processing table output [8ms]\n```\n\n### Checking the Results\n\n`logolink` supports the [four output\nformats](https://docs.netlogo.org/behaviorspace.html#run-options-formats)\navailable in\n[BehaviorSpace](https://docs.netlogo.org/behaviorspace.html):\n[Table](https://docs.netlogo.org/behaviorspace.html#table-output),\n[Spreadsheet](https://docs.netlogo.org/behaviorspace.html#spreadsheet-output),\n[Lists](https://docs.netlogo.org/behaviorspace.html#lists-output), and\n[Statistics](https://docs.netlogo.org/behaviorspace.html#statistics-output).\nBy default, only the\n[Table](https://docs.netlogo.org/behaviorspace.html#table-output) format\nis returned, along with some metadata about the experiment run.\n\n``` r\nlibrary(dplyr)\n\nresults |\u003e glimpse()\n#\u003e List of 2\n#\u003e  $ metadata:List of 6\n#\u003e   ..$ timestamp       : POSIXct[1:1], format: \"2026-01-08 05:11:42\"\n#\u003e   ..$ netlogo_version : chr \"7.0.3\"\n#\u003e   ..$ output_version  : chr \"2.0\"\n#\u003e   ..$ model_file      : chr \"Wolf Sheep Simple 5.nlogox\"\n#\u003e   ..$ experiment_name : chr \"Wolf Sheep Simple Model Analysis\"\n#\u003e   ..$ world_dimensions: Named int [1:4] -17 17 -17 17\n#\u003e   .. ..- attr(*, \"names\")= chr [1:4] \"min-pxcor\" \"max-pxcor\" \"min-pycor\" \"max-pycor\"\n#\u003e  $ table   : tibble [110,110 × 10] (S3: tbl_df/tbl/data.frame)\n#\u003e   ..$ run_number            : num [1:110110] 1 1 1 1 1 1 1 1 1 1 ...\n#\u003e   ..$ number_of_sheep       : num [1:110110] 500 500 500 500 500 500 500 500 500 500 ...\n#\u003e   ..$ number_of_wolves      : num [1:110110] 5 5 5 5 5 5 5 5 5 5 ...\n#\u003e   ..$ movement_cost         : num [1:110110] 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 ...\n#\u003e   ..$ grass_regrowth_rate   : num [1:110110] 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 ...\n#\u003e   ..$ energy_gain_from_grass: num [1:110110] 2 2 2 2 2 2 2 2 2 2 ...\n#\u003e   ..$ energy_gain_from_sheep: num [1:110110] 5 5 5 5 5 5 5 5 5 5 ...\n#\u003e   ..$ step                  : num [1:110110] 0 1 2 3 4 5 6 7 8 9 ...\n#\u003e   ..$ count_wolves          : num [1:110110] 5 5 5 5 5 5 5 5 5 5 ...\n#\u003e   ..$ count_sheep           : num [1:110110] 500 499 499 498 495 494 492 489 488 486 ...\n```\n\nIf you already have a file with experiment results, you can read it into\nR using the\n[`read_experiment`](https://danielvartan.github.io/logolink/reference/read_experiment.html)\nfunction, which will produce the same output structure as\n[`run_experiment`](https://danielvartan.github.io/logolink/reference/run_experiment.html).\n\n### Analyzing the Data (Bonus Section)\n\nBelow is a simple example of how to visualize the results using\n[`ggplot2`](https://ggplot2.tidyverse.org/).\n\n``` r\nlibrary(dplyr)\nlibrary(magrittr)\n\ndata \u003c-\n  results |\u003e\n  extract2(\"table\") |\u003e\n  select(where(is.numeric)) |\u003e\n  summarize(\n    across(everything(), ~ mean(.x, na.rm = TRUE)),\n    .by = c(step, number_of_wolves)\n  ) |\u003e\n  arrange(number_of_wolves, step)\n```\n\n``` r\nlibrary(ggplot2)\n\ndata |\u003e\n  mutate(number_of_wolves = as.factor(number_of_wolves)) |\u003e\n  ggplot(\n    aes(\n      x = step,\n      y = count_sheep,\n      group = number_of_wolves,\n      color = number_of_wolves\n    )\n  ) +\n  geom_line() +\n  labs(\n    x = \"Time Step\",\n    y = \"Average Number of Sheep\",\n    color = \"Wolves\"\n  )\n```\n\n\u003cimg\nsrc=\"man/figures/readme-wolf-sheep-model-plot-1-1.png\"\ndata-fig-alt=\"Line plot showing the average number of sheep over time for different initial numbers of wolves.\" /\u003e\n\n### Visualizing the NetLogo World (Bonus Section)\n\n`logolink` also includes tutorials to help you get the most out of\nNetLogo in R. The [Visualizing the NetLogo\nWorld](https://danielvartan.github.io/logolink/articles/visualizing-the-netlogo-world.html)\ntutorial demonstrates how to plot the NetLogo world at specific time\nsteps and animate its evolution over time.\n\n![](man/figures/vignette-wolf-sheep-model-animation-1.gif)\n\nClick [here](https://danielvartan.github.io/logolink/reference/) to see\nthe full list of `logolink` functions.\n\nFor complete guidance on setting up and running experiments in NetLogo,\nplease refer to the [BehaviorSpace\nGuide](https://docs.netlogo.org/behaviorspace.html).\n\n## Citation\n\n[![](https://img.shields.io/badge/doi-10.32614/CRAN.package.logolink-1284C5.svg)](https://doi.org/10.32614/CRAN.package.logolink)\n\nIf you use this package in your research, please cite it to acknowledge\nthe effort put into its development and maintenance. Your citation helps\nsupport its continued improvement.\n\n``` r\ncitation(\"logolink\")\n#\u003e To cite logolink in publications use:\n#\u003e \n#\u003e   Vartanian, D. (2026). logolink: An interface for running NetLogo\n#\u003e   simulations from R [Computer software]. CRAN.\n#\u003e   https://doi.org/10.32614/CRAN.package.logolink\n#\u003e \n#\u003e A BibTeX entry for LaTeX users is\n#\u003e \n#\u003e   @Misc{,\n#\u003e     title = {logolink: An interface for running NetLogo simulations from R},\n#\u003e     author = {Daniel Vartanian},\n#\u003e     year = {2026},\n#\u003e     doi = {10.32614/CRAN.package.logolink},\n#\u003e     note = {Computer software},\n#\u003e   }\n```\n\n## License\n\n[![](https://img.shields.io/badge/license-GPLv3-bd0000.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n``` text\nCopyright (C) 2025 Daniel Vartanian\n\nlogolink is free software: you can redistribute it and/or modify it under the\nterms of the GNU General Public License as published by the Free Software\nFoundation, either version 3 of the License, or (at your option) any later\nversion.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with\nthis program. If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n\n## Contributing\n\n[![](https://img.shields.io/badge/Contributor%20Covenant-3.0-4baaaa.svg)](https://www.contributor-covenant.org/version/3/0/code_of_conduct/)\n\nContributions are always welcome! Whether you want to report bugs,\nsuggest new features, or help improve the code or documentation, your\ninput makes a difference.\n\nBefore opening a new issue, please check the [issues\ntab](https://github.com/danielvartan/logolink/issues) to see if your\ntopic has already been reported.\n\n[![](https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86)](https://github.com/sponsors/danielvartan)\n\nYou can also support the development of `logolink` by becoming a\nsponsor.\n\nClick [here](https://github.com/sponsors/danielvartan) to make a\ndonation. Please mention `logolink` in your donation message.\n\n## Acknowledgments\n\n`logolink` brand identity is based on the [NetLogo\n7](https://www.netlogo.org/) brand identity.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielvartan%2Flogolink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielvartan%2Flogolink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielvartan%2Flogolink/lists"}