Object of type ‘closure’ is not subsettable
summary
R workflows start by restart R often and stop reloading/saving the workspace; reproducibility uses the repRex tooling to create tiny inlined examples. Debugging proceeds from traceback to traceback/recover/browser to inspect frames; a concrete bug shows minidat becoming a vector (rowMeans needs a 2D object) and the fix is subsetting with drop = FALSE plus tests for zero/one/two matches. Production practices include R CMD check, testthat unit tests, and CI across OSes.
AI-written summary · about
chapters (34)
- 0:00Intro
- 3:33Poll
- 6:20Troubleshooting advice
- 7:25Restarting R
- 13:00Fresh Start
- 14:09Reptrix
- 15:04Work a small example
- 16:00Minimum reproducible example
- 16:44Reprex is both science and art
- 17:33Why is there an error
- 20:42The classic haystack exercise
- 21:19A wild caught problem
- 22:45Inline data
- 23:47Minimal Rep rex
- 24:20Rep rex size
- 25:07Getting your ducks in a row
- 27:19Error message
- 28:04Fruit average example
- 30:02Death metaphor
- 30:58Traceback
- 31:51Call Stack
- 36:44Source references
- 38:07Live browser
- 39:50Conclusion
- 41:07Future facing
- 41:32Package development
- 41:58Data analysis
- 42:17Pipeline assertion
- 44:00Continuous integration
- 44:50Bug magnets
- 46:09Douglas Adams quote
- 46:36Access panel
- 47:37Closure is not subsettable
- 49:16Dplyr example
related talks
18mHow non-programmers can make sparks fly when using testthat during package development
43mDebug Like a Scientist!
27mParallel testing with Ractors - Putting CPU's to work
05mShiny Developer Secrets: Insights From Over 1200 Applicants and What You MUST Know to Shine
40mDebuggers for Clojure
42mTesting a Data Science Model
01h 57mResearch Reproducibility in Embedded Learning
43mRegression Obsession
