{"id":13401071,"url":"https://github.com/r-lib/lobstr","last_synced_at":"2025-05-16T12:04:18.943Z","repository":{"id":29078646,"uuid":"32606771","full_name":"r-lib/lobstr","owner":"r-lib","description":"Understanding complex R objects with tools similar to str()","archived":false,"fork":false,"pushed_at":"2023-10-30T18:52:51.000Z","size":1629,"stargazers_count":305,"open_issues_count":15,"forks_count":29,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-04T20:57:51.583Z","etag":null,"topics":["r"],"latest_commit_sha":null,"homepage":"https://lobstr.r-lib.org/","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/r-lib.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"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}},"created_at":"2015-03-20T20:57:44.000Z","updated_at":"2025-01-29T21:26:26.000Z","dependencies_parsed_at":"2024-01-18T11:03:58.161Z","dependency_job_id":"c0383875-c147-4da3-84e2-a989bac179dc","html_url":"https://github.com/r-lib/lobstr","commit_stats":{"total_commits":293,"total_committers":10,"mean_commits":29.3,"dds":0.2798634812286689,"last_synced_commit":"d9ea7fb56632590f66bc4cb41f0d0a97875607c1"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Flobstr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Flobstr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Flobstr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Flobstr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/lobstr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994120,"owners_count":21030050,"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":["r"],"created_at":"2024-07-30T19:00:58.396Z","updated_at":"2025-04-09T07:03:48.917Z","avatar_url":"https://github.com/r-lib.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\nlibrary(lobstr)\n```\n\n# lobstr \u003ca href=\"https://lobstr.r-lib.org\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"138\" alt=\"lobstr website\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/lobstr)](https://cran.r-project.org/package=lobstr)\n[![R-CMD-check](https://github.com/r-lib/lobstr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/lobstr/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/lobstr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/lobstr?branch=main)\n\u003c!-- badges: end --\u003e\n\nlobstr provides tools in the same vein as `str()`, which allow you to dig into the detail of an object.\n\n## Installation\n\nInstall the released version of lobstr from CRAN:\n\n``` r\ninstall.packages(\"lobstr\")\n```\n\nYou can install the development version with:\n\n``` r\n# install.packages(\"pak\")\npak::pak(\"r-lib/lobstr\")\n```\n## Example\n\n### Abstract syntax trees\n\n`ast()` draws the abstract syntax tree of R expressions:\n\n```{r example}\nast(a + b + c)\n\nast(function(x = 1) {\n  if (x \u003e 0) print(\"Hi!\")\n})\n```\n\n### References\n\n`ref()` shows hows objects can be shared across data structures by digging into the underlying __ref__erences:\n\n```{r}\nx \u003c- 1:1e6\ny \u003c- list(x, x, x)\nref(y)\n\ne \u003c- rlang::env()\ne$self \u003c- e\nref(e)\n```\n\nA related tool is `obj_size()`, which computes the size of an object taking these shared references into account:\n\n```{r}\nobj_size(x)\nobj_size(y)\n```\n\n### Call stack trees\n\n`cst()` shows how frames on the call stack are connected:\n\n```{r}\nf \u003c- function(x) g(x)\ng \u003c- function(x) h(x)\nh \u003c- function(x) x\nf(cst())\n```\n\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Flobstr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Flobstr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Flobstr/lists"}