{"id":14068704,"url":"https://github.com/jennybc/debugging","last_synced_at":"2025-11-04T22:03:12.418Z","repository":{"id":70157398,"uuid":"236074039","full_name":"jennybc/debugging","owner":"jennybc","description":"Talk about general debugging strategies. How to be less confused and frustrated.","archived":false,"fork":false,"pushed_at":"2020-02-15T01:00:31.000Z","size":96358,"stargazers_count":113,"open_issues_count":2,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-15T14:05:57.690Z","etag":null,"topics":["debugging","r","slides","talk"],"latest_commit_sha":null,"homepage":"https://rstd.io/debugging","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jennybc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-01-24T20:00:40.000Z","updated_at":"2024-11-08T15:47:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"d00a13c8-0a61-4334-828e-1cfc2ce14ad8","html_url":"https://github.com/jennybc/debugging","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jennybc/debugging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jennybc%2Fdebugging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jennybc%2Fdebugging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jennybc%2Fdebugging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jennybc%2Fdebugging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jennybc","download_url":"https://codeload.github.com/jennybc/debugging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jennybc%2Fdebugging/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282720755,"owners_count":26716064,"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-11-04T02:00:05.887Z","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":["debugging","r","slides","talk"],"created_at":"2024-08-13T07:06:21.431Z","updated_at":"2025-11-04T22:03:12.399Z","avatar_url":"https://github.com/jennybc.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# Object of type 'closure' is not subsettable\n\nTalk developed for [rstudio::conf 2020](https://rstudio.com/conference/), January 27 - 30, 2020 in San Francisco  \nby Jenny Bryan  \n[jennybryan.org](https://jennybryan.org)  \nTwitter: [@jennyBryan](https://twitter.com/JennyBryan)  \nGitHub: [@jennybc](https://github.com/jennybc)  \n\n\u003e Your first \"object of type 'closure' is not subsettable\" error message is a big milestone for an R user. Congratulations, if there was any lingering doubt, you now know that you are officially programming! Programming involves considerably more troubleshooting and debugging than many of us expected (or signed up for). The ability to solve your own problems is an incredibly powerful stealth skill that is worth cultivating with intention. This talk will help you nurture your inner problem solver, covering both general debugging methods and specific ways to implement them in the R ecosystem.\n\n## Link to this repo\n\n[rstd.io/debugging](https://rstd.io/debugging) is a shortlink to HERE\n\n## Slides\n\n\u003ca href=\"https://speakerdeck.com/jennybc/object-of-type-closure-is-not-subsettable\"\u003e\u003cimg src=\"debugging-title-600.jpg\"\u003e\u003c/a\u003e\n\nSlides [on SpeakerDeck](https://speakerdeck.com/jennybc/object-of-type-closure-is-not-subsettable)\n\nSlides [as PDF file](debugging-jenny-bryan.pdf) here in this repo \n\n## Video\n\nThe original rstudio::conf talk was live-streamed and recorded. Video is available here:\n\n\u003chttps://resources.rstudio.com/rstudio-conf-2020/object-of-type-closure-is-not-subsettable-jenny-bryan\u003e\n\n## Credits and resources\n\nAnnotated and hyperlink-y list of resources mentioned in the slides, in roughly the same order.\n\n---\n\nRestart R, often, and don't save/reload `.Rdata`.\n\nThis recommendation is explored more thoroughly in [Save source, not the workspace](https://rstats.wtf/save-source.html). This mindset works best as part of a more holistic \"project-oriented workflow\", which is described in adjacent sections of [What They Forgot to Teach You About R](https://rstats.wtf/index.html).\n\n---\n\n\u003e One of the most useful things I’ve learned from hanging out with (much) better programmers: don’t wring hands and speculate. Work a small example that reveals, confirms, or eliminates something.\n\nI'm paraphrasing my own tweet: \u003chttps://twitter.com/JennyBryan/status/952285541617123328\u003e\n\n---\n\nThe reprex package: \u003chttps://reprex.tidyverse.org\u003e\n\nRStudio webinar about reprex: [Help me help you: Creating reproducible examples with reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html)\n\n---\n\nThe REPREX section features several illustrations by [Christine Kuper](https://christinekuper.com).\n\nWe gratefully acknowledge [Michelle Rial](https://www.michellerial.com) and her charts for an inspiring visual style.\n\n---\n\nThe example of how a wild-caught puzzle evolves into a good reprex was kindly donated by [Brooke Watson Madubuonwu](https://twitter.com/brookLYNevery1).\n\nStory concluded in [tidyverse/dplyr#4094](https://github.com/tidyverse/dplyr/issues/4094).\n\n---\n\nGitHub search for Hadley's \"slightly more minimal reprexes\": [`more minimal reprex NOT advice user:tidyverse user:r-lib user:hadley involves:hadley is:issue`] [`more minimal reprex NOT advice user:tidyverse user:r-lib involves:hadley is:issue`](https://github.com/search?o=desc\u0026q=more+minimal+reprex+NOT+advice+user%3Atidyverse+user%3Ar-lib+involves%3Ahadley+is%3Aissue\u0026s=updated\u0026type=Issues)\n\n---\n\nPresentation of a rather intimidating R message was inspired by a Far Side comic from Gary Larson. You know ... the one about Ginger the dog and \"blah blah\".\n\nThe Far Side very recently got a real online home: \u003chttps://www.thefarside.com\u003e. However, last time I checked, this particular comic isn't there (yet). Hopefully it will appear one day and I can link to it.\n\n---\n\nAll the code snippets from the `fruit_avg()` debugging example are in [R/](R).\n\n---\n\n[Debugging with RStudio](https://support.rstudio.com/hc/en-us/articles/205612627-Debugging-with-RStudio)\n\nrlang's functions for [Errors, conditions, and backtraces](https://rlang.r-lib.org/reference/index.html#section-errors-conditions-and-backtraces)\n\n---\n\nVideo of a tiny room hidden behind an electrical outlet is from Mozu Studios:\n\n  * \u003chttps://www.mozustudios.com\u003e\n  * \u003chttps://www.instagram.com/p/B6NvxK7JnpU/\u003e\n\n---\n\n\u003e The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at and repair.\n\nQuote attributed to [Douglas Adams](https://www.brainyquote.com/quotes/douglas_adams_124773), but I am not sure of the original source.\n\n---\n\nThe tidyverse and r-lib packages have an *aspirational* and developing style guide for error messages:\n\n\u003chttps://style.tidyverse.org/error-messages.html\u003e\n\n---\n\nStatic code snippets prepared with the [reprex package](https://reprex.tidyverse.org), using [`venue = \"rtf\"`](https://reprex.tidyverse.org/articles/articles/rtf.html), which relies on [highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php).\n\nGIFs of code prepared with [r-lib/asciicast](https://github.com/r-lib/asciicast) plus [asciinema/asciicast2gif](https://github.com/asciinema/asciicast2gif).\n\n---\n\nThis talk benefitted greatly from:\n\n  * Regular discussions with the rest of the tidyverse / r-lib team at RStudio\n    - [tidyverse org members](https://github.com/orgs/tidyverse/people)\n    - [r-lib org members](https://github.com/orgs/r-lib/people)\n  * Visual design and art from Christine Kuper\n    - \u003chttps://christinekuper.com\u003e\n  * Lightning talk on debugging the IDE given internally by RStudio engineer Jonathan McPherson\n\n---\n\nImage credits\n\nFret: https://unsplash.com/photos/OsC8HauR0e0  \nDo same thing again: https://unsplash.com/photos/uxUUENpp01I  \nDiver: https://unsplash.com/photos/wVvxjiLJr-g  \nOcean horizon background: https://unsplash.com/photos/sYzFIusQp3Q  \nCalm sea background: https://unsplash.com/photos/IZ01rjX0XQA  \nCoral reef background: https://unsplash.com/photos/T1Wru10gKhg  \nSeaweed background: https://unsplash.com/photos/nAkC-KS444M  \nOrchid: https://unsplash.com/photos/Ug6z9PCwr58  \nCorn field: https://unsplash.com/photos/nCQXxsSg3oo  \nOn/off key: https://unsplash.com/photos/cw_uvISXkCI  \nSunlight under water background: https://unsplash.com/photos/K785Da4A_JA    \nGarnishing with sauce: https://unsplash.com/photos/YaiY50wzWzI    \nDeath certificate (modified): Public Domain, https://commons.wikimedia.org/w/index.php?curid=214170    \nSunlight under water background: https://unsplash.com/photos/K785Da4A_JA\nWashing pot: https://unsplash.com/photos/-VhH4S1Lur8  \nThe Night King: https://cnet4.cbsistatic.com/img/vugy5MvUVBvwcJf0JvKIBd1RwJE=/1200x675/2019/04/22/2b2fee8d-111a-4d19-ae83-4e61899cfd47/1nightking.jpg (probably copyright HBO)  \nAutopsy painting by Rembrandt: https://www.mauritshuis.nl/en/explore/the-collection/artworks/the-anatomy-lesson-of-dr-nicolaes-tulp-146/detailgegevens/ Public Domain, https://commons.wikimedia.org/w/index.php?curid=64281722  \nGray cube abstract wallpaper vector art https://unsplash.com/photos/1CVy8JStf3A  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjennybc%2Fdebugging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjennybc%2Fdebugging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjennybc%2Fdebugging/lists"}