{"id":22463734,"url":"https://github.com/poissonconsulting/nlist","last_synced_at":"2025-09-12T23:42:49.051Z","repository":{"id":37071798,"uuid":"194123871","full_name":"poissonconsulting/nlist","owner":"poissonconsulting","description":"An R package to create and check numeric list objects","archived":false,"fork":false,"pushed_at":"2023-05-28T22:57:45.000Z","size":1294,"stargazers_count":6,"open_issues_count":8,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-06-11T17:11:51.506Z","etag":null,"topics":["cran","data-frame","natomic","nlist","nlists","r","rstats"],"latest_commit_sha":null,"homepage":"https://poissonconsulting.github.io/nlist/","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/poissonconsulting.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":".github/CONTRIBUTING.md","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}},"created_at":"2019-06-27T15:51:53.000Z","updated_at":"2024-04-26T05:07:48.000Z","dependencies_parsed_at":"2022-06-24T20:32:03.493Z","dependency_job_id":null,"html_url":"https://github.com/poissonconsulting/nlist","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fnlist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fnlist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fnlist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fnlist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poissonconsulting","download_url":"https://codeload.github.com/poissonconsulting/nlist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228439452,"owners_count":17920026,"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":["cran","data-frame","natomic","nlist","nlists","r","rstats"],"created_at":"2024-12-06T09:13:55.844Z","updated_at":"2025-08-02T05:32:26.986Z","avatar_url":"https://github.com/poissonconsulting.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\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# nlist \u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"nlist logo\"/\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![R-CMD-check](https://github.com/poissonconsulting/nlist/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/poissonconsulting/nlist/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/poissonconsulting/nlist/graph/badge.svg)](https://app.codecov.io/gh/poissonconsulting/nlist)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/license/mit)\n[![CRAN status](https://www.r-pkg.org/badges/version/nlist)](https://cran.r-project.org/package=nlist)\n![CRAN downloads](https://cranlogs.r-pkg.org/badges/nlist)\n\u003c!-- badges: end --\u003e\n\n`nlist` is an R package to create and manipulate numeric list (`nlist`) objects.\n\nAn `nlist` is an S3 class list of uniquely named numeric objects.\nAn numeric object is an integer or double vector, matrix or array.\n`nlist` objects are the raw data inputs for analytic engines such as JAGS, STAN and TMB.\n\nAn `nlists` object is a S3 class list of `nlist` objects with the same names, dimensionalities and typeofs.\n`nlists` objects are useful for storing multiple realizations of simulated data sets.\nThey can be converted to `coda::mcmc` and  `coda::mcmc.list` objects.\n\n## Demonstration\n\n### `numeric`\n\nAn numeric object is an integer or double vector, matrix or array.\n\n```{r}\nlibrary(nlist)\nis.numeric(1L)\nis.numeric(matrix(1:3))\n```\n\n### `nlist`\n\nAn `nlist` is an S3 class list of uniquely named numeric objects.\n\nIt is straightforward to create an new `nlist` object.\n```{r}\nlibrary(nlist)\n\nnlist \u003c- nlist(x = 1, y = matrix(1:9, 3))\nnlist\n```\n\n### `nlists`\n\nAn `nlists` object is a S3 class list of `nlist` objects with the same names, dimensionalities and typeofs.\n\nThe nchains attribute is used to keep track of the number of chains.\n\n```{r}\nnlists \u003c- nlists(\n  nlist(x = 1, y = matrix(1:9, 3)),\n  nlist(x = -2, y = matrix(2:10, 3)),\n  nlist(x = 10, y = matrix(22:30, 3)),\n  nlist(x = -100, y = matrix(-2:-10, 3))\n)\n\nprint(nlists)\n```\n\n### Coercion\n\n#### nlist\n\nA data.frame can be coerced to an `nlist` object\n```{r}\ndata \u003c- data.frame(\n  lgl = c(TRUE, NA),\n  dte = as.Date(c(\"2001-01-02\", \"2001-01-01\")),\n  fac = factor(c(\"b\", \"a\"))\n)\n\nas_nlist(data)\n```\n\nAnd an `nlist` objects can be converted to an `mcmc` or `term_frame` objects (and converted back again)\n```{r}\nas_mcmc(nlist)\nas_term_frame(nlist)\n```\n\n#### nlists\n\nThe `estimates()` function can be used to aggregate an `nlists` object to an `nlist` object.\n```{r}\nestimates(nlists, fun = mean)\n```\n\nwhile the `tidy()` function treats the values as if they are MCMC samples\nand summarises the terms as a tidy tibble.\n```{r}\ntidy(nlists, simplify = TRUE)\n```\n\n\nAn `nlists` object can be converted to an `mcmc.list` object and a `term_frame`.\n```{r}\nas_mcmc_list(nlists)\nas_term_frame(nlists)\n```\n\nAn `nlists` object can have its chains split or collapsed.\n```{r}\nsplit_chains(nlists)\n```\n\n## Installation\n\n### Release\n\nTo install the release version from [CRAN](https://CRAN.R-project.org/package=nlist).\n```r\ninstall.packages(\"nlist\")\n```\n\nThe website for the release version is at \u003chttps://poissonconsulting.github.io/nlist/\u003e.\n\n### Development\n\nTo install the development version from [GitHub](https://github.com/poissonconsulting/nlist)\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"poissonconsulting/nlist\")\n```\n\nor from [r-universe](https://poissonconsulting.r-universe.dev/nlist).\n```r\ninstall.packages(\"nlist\", repos = c(\"https://poissonconsulting.r-universe.dev\", \"https://cloud.r-project.org\"))\n```\n## Contribution\n\nPlease report any [issues](https://github.com/poissonconsulting/nlist/issues).\n\n[Pull requests](https://github.com/poissonconsulting/nlist/pulls) are always welcome.\n\n## Code of Conduct\n\nPlease note that the nlist project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). \nBy contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoissonconsulting%2Fnlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoissonconsulting%2Fnlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoissonconsulting%2Fnlist/lists"}