|
| 1 | +--- |
| 2 | +title: "toolero: An R package for research" # enter the title of the resource (typically the name of the presentation/article/workshop/video/book/etc. ) |
| 3 | +author: |
| 4 | + - name: Erwin Lares # replace with your name |
| 5 | + email: erwin.lares@wisc.edu # If you prefer not to share your email, delete this entire line (including "email:"). |
| 6 | + |
| 7 | +date: 2026-06-02 # enter today's date as YYYY-MM-DD |
| 8 | +date-format: long # leave as is |
| 9 | +image: "/images/toolerologo.png" # In your local copy of the Nexus repository, add a representative image for this resource to the images folder. Both PNGs and JPGs are acceptable formats. Adjust the filename here from "vincent-van-zalinge-mDohQISBnCk-unsplash.jpg" to the name of your image. |
| 10 | + |
| 11 | +# Enter a list of relevant categories/tags for this resource, including the type (workshop, book, video, podcast, etc.) topic of focus, and anything else that might be relevant. Please check out the tags which are already being used on Nexus by visiting https://uw-madison-datascience.github.io/ML-X-Nexus/Learn/ and looking under "Categories". Avoid repeating tags with alternative spelling (e.g., use Deep Learning rather than DL since Deep Learning is already being used.). |
| 12 | +# Example categories below: |
| 13 | +categories: |
| 14 | + - Compute # Deep learning, Regression, Large language models, NLP, Clustering, Decision trees, etc. |
| 15 | + - Open-Source # If there is a codebase, is it open-source? |
| 16 | + - Project |
| 17 | + - R # Python, R, PyTorch, Keras, Tensorflow, Sklearn, etc. |
| 18 | + - Quarto |
| 19 | + - Package # Is this a package or library for use in other projects? |
| 20 | + - Presentation # Presentation, Workshops, Books, Podcasts, Videos, Blogs, Models, Datasets, EDA, etc. |
| 21 | + # Include this tag for any resource that involves coding along as a learning mechanism (e.g., workshop, short demo/guide with code examples) |
| 22 | + # Anything else you think people may want to group this by |
| 23 | + - CHTC |
| 24 | + - Containerization |
| 25 | +--- |
| 26 | +## {{< meta title >}} |
| 27 | +Every research coding project begins with a blank slate and a cluster of low-stakes decisions — where does the data go, |
| 28 | +what do I call the scripts, do I track dependencies? The trouble is that these decisions rarely stay low-stakes. The |
| 29 | +cost surfaces later, when a collaborator tries to reproduce the analysis, when the project needs to move to a computing |
| 30 | +cluster, or when you return to it six months later and realize the outputs no longer match the code. |
| 31 | + |
| 32 | +At the June 2026 UW-RSE monthly meeting, I presented toolero, a small, opinionated R package designed to reduce that |
| 33 | +friction. The motivating idea is simple: best practices are easier to adopt when the tooling makes them the path of |
| 34 | +least resistance. toolero does not impose a rigid framework — it provides sensible defaults and gets out of the way. |
| 35 | + |
| 36 | +Here are a few functions I covered: |
| 37 | + |
| 38 | +`init_project()` scaffolds a standard folder structure and optionally initializes renv and git from the start. |
| 39 | + |
| 40 | +`create_qmd()` produces a reproducible Quarto document with a post-render hook that keeps the .R script derived from — |
| 41 | +rather than diverging from — the source document. |
| 42 | + |
| 43 | +`read_clean_csv()` and `write_clean_csv()` make the raw/clean data distinction explicit and automatic. |
| 44 | + |
| 45 | +`write_by_group()` splits a data frame into per-group files, producing a manifest that feeds directly into |
| 46 | +high-throughput computing job submission. |
| 47 | + |
| 48 | +And `detect_execution_context()` handles the perennial headache of file path resolution across interactive, Quarto, |
| 49 | +and Rscript environments. |
| 50 | + |
| 51 | +toolero is also the first step in a three-package family — containr and submitr extend the same philosophy toward |
| 52 | +containerization and CHTC job submission — but it stands on its own for anyone whose work lives entirely on their |
| 53 | +laptop. |
| 54 | + |
| 55 | +The package is on CRAN. Documentation and examples are at [erwinlares.github.io/toolero](erwinlares.github.io/toolero). |
| 56 | + |
| 57 | +## Questions? |
| 58 | +If you any lingering questions about this resource, please feel free to post to the [Nexus Q&A](https://github.com/UW-Madison-DataScience/UW-RSE-Nexus/discussions/categories/q-a) on GitHub. |
| 59 | +We will improve materials on this website as additional questions come in. |
| 60 | + |
| 61 | +## See also |
| 62 | +<!-- MARKDOWN COMMENT: Please Check the existing resources on Nexus to see if any other related resources |
| 63 | +(e.g., related books/videos, blog posts commenting on the resource, alternative approaches/frameworks, etc.) |
| 64 | +should be linked below. You may also link to resources which aren't currently on the Nexus platform, if applicable. |
| 65 | +However, if you're feeling ambitious, you may wish to post those to Nexus as well! |
| 66 | +NOTE: When doing related resources links to UW RSE Nexus pages, please use local pathing to the .qmd file instead |
| 67 | +of the web url. So, use "/KB/Guides/some_guide.qmd" instead of the "https://.../some_guide.html" URL. |
| 68 | +--> |
| 69 | +- [toolero on GitHub](https://github.com/erwinlares/toolero/): Github toolero page. |
| 70 | + |
0 commit comments