{"id":14069060,"url":"https://github.com/dirmeier/datastructures","last_synced_at":"2026-03-10T05:31:49.054Z","repository":{"id":56936113,"uuid":"90047671","full_name":"dirmeier/datastructures","owner":"dirmeier","description":" :rocket: Implementation of core data structures for R","archived":false,"fork":false,"pushed_at":"2023-06-28T14:44:31.000Z","size":30815,"stargazers_count":80,"open_issues_count":9,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-02-13T14:39:36.592Z","etag":null,"topics":["algorithms","datastructures","r","rcpp"],"latest_commit_sha":null,"homepage":"https://dirmeier.github.io/datastructures","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirmeier.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2017-05-02T15:16:55.000Z","updated_at":"2025-12-06T06:44:54.000Z","dependencies_parsed_at":"2024-08-13T07:14:55.949Z","dependency_job_id":"967819c9-0d5b-455c-bbe5-ad4771cb05fc","html_url":"https://github.com/dirmeier/datastructures","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/dirmeier/datastructures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fdatastructures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fdatastructures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fdatastructures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fdatastructures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirmeier","download_url":"https://codeload.github.com/dirmeier/datastructures/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fdatastructures/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30326071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: 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":["algorithms","datastructures","r","rcpp"],"created_at":"2024-08-13T07:06:34.747Z","updated_at":"2026-03-10T05:31:49.017Z","avatar_url":"https://github.com/dirmeier.png","language":"R","readme":"# datastructures \u003cimg src=\"https://cdn.rawgit.com/dirmeier/datastructures/87d7cd08/inst/heap/heap.png\" align=\"right\" width=\"160px\"/\u003e\n\n[![Project Status](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n[![Project Life](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)\n[![ci](https://github.com/dirmeier/datastructures/workflows/ci/badge.svg)](https://github.com/dirmeier/datastructures/actions?query=workflow%3Aci)\n[![codecov](https://codecov.io/gh/dirmeier/datastructures/branch/master/graph/badge.svg)](https://codecov.io/gh/dirmeier/datastructures)\n[![CRAN](http://www.r-pkg.org/badges/version/datastructures?color=brightgreen)](https://cran.r-project.org/package=datastructures)\n\nImplementation of core data structures for R.\n\n## Introduction\n\nImplementation of advanced data structures such as hashmaps, heaps, or queues in `R`.\nAdvanced data structures are essential in many computer science and statistics\nproblems, for example graph algorithms or string analysis. The package uses\n`Boost` and `STL` data types and extends these to `R` with `Rcpp` modules.\n\nSo far `datastructures` has implementations for:\n\n* Fibonacci and binomial heaps,\n* queues and stacks,\n* hashmaps, multimaps and bimaps.\n\nAs an introductory example, imagine that you want to compute shortest paths on a\ngraph and decide to use a Fibonacci heap for keeping the distances. A Fibonacci heap is an efficient tree-like data structure\nthat satisfies the *min-heap property*. We can use it to quickly get the node with the shortest distance in *O(log n)* time like this:\n\n```R\n  fh \u003c- fibonacci_heap(\"numeric\")\n  node.labels    \u003c- paste0(\"n\", 10:1)\n  node.distances \u003c- seq(1, 0, length.out=length(node.labels))\n  fh \u003c- insert(fh, node.distances, node.labels)\n\n  peek(fh)\n  $`0`\n  [1] \"n1\"\n```\n\n`datastructures` also allows storing non-orimitive objects, like `data.frames`, `matrices` or `environments`.\nFor instance, we could use a hashmap for storing such objects:\n\n```R\n  hm \u003c- hashmap(\"integer\")\n  keys \u003c- 1:2\n  values \u003c- list(\n    environment(),\n    data.frame(A=rbeta(3, .5, .5), B=rgamma(3, 1)))\n  hm[keys] \u003c- values\n\n  hm[1L]\n  [[1]]\n  \u003cenvironment: R_GlobalEnv\u003e\n```\n\n## Installation\n\nGet the package from *CRAN* using:\n\n```R\n  install.packages(\"datastructures\")\n```\n\nYou can also download the tarball of the latest release and install with:\n\n```bash\n  R CMD install \u003cdatastructures-x.y.z.tar.gz\u003e\n```\n\nwhere `\u003cdatastructures-x.y.z.tar.gz\u003e` is your downloaded tarball. If you want\nto you can also use devtools, but I don't recommend it since it might give unstable\nversions:\n\n```R\n  devtools::install_github(\"dirmeier/datastructures\")\n```\n\n## Documentation\n\nLoad the library using `library(datastructures)`. We provide a vignette for\nthe package that can be called using: `vignette(\"datastructures\")`. If there\nare any questions let met know.\n\n## Citation\n\nIf you want to cite `datastructures`, please use the following entry:\n\n\u003e Dirmeier, Simon (2018). `datastructures`: An R package for organisation and storage of data. Journal of Open Source Software, 3(28), 910, https://doi.org/10.21105/joss.00910\n\n## Feature requests and contributing\n\nIf you want to have another datastructure added, say from `boost` or the `STL`,\njust open up a new issue. Alternatively it would be great if you provided a PR.\n\n## Author\n\n* Simon Dirmeier \u003ca href=\"mailto:simon.dirmeier@web.de\"\u003esimon.dirmeier@web.de\u003c/a\u003e\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirmeier%2Fdatastructures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirmeier%2Fdatastructures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirmeier%2Fdatastructures/lists"}