Refactoring notes

I worked on a refactor of an R package at work the other day. Here’s some notes about that after doing the work. This IS NOT a best practices post - it’s just a collection of thoughts. For context, the package is an API client. It made sense to break the work for any given exported function into the following components, as applicable depending on the endpoint being handled (some endpoints needed just a few lines of code, so those funtions were left unchanged):...

March 20, 2024 · 3 min · Scott Chamberlain

Moved to Hugo

This blog is now using Hugo. Important - if you subscribe to the RSS for this blog you likely have to delete/remove the old one and add the new RSS link. It is:

March 20, 2024 · 1 min · Scott Chamberlain

Shiny file inputs

I wrote the other day about overcoming an issue with Shiny. Another issue I ran into concurrently was about file inputs. The issue was that file inputs (i.e., shiny::fileInput) was difficult to clear. That is, after a user uploads a file, it was easy to get some of the various parts cleared/cleaned up, but not others: (Not Easy) The UI components of fileInput (the text of the file name, the loading display) (Not Easy) The data behind the fileInput handler (Easy) Displaying some feedback in the UI after handling file input Load libraries...

March 8, 2024 · 3 min · Scott Chamberlain

Shiny button weirdness

I’ve been working on Shiny app at work for the past few months. One of the many frustrating things about Shiny lately has been around buttons. Well, it wasn’t really about buttons, but that’s where it started. Load libraries library(shiny) library(bslib) library(crul) Helper function, returned a random UUID from an httpbin server httpbin_uuid <- function(...) { con <- crul::HttpClient$new("") res <- con$get("uuid") jsonlite::fromJSON(res$parse("UTF-8"))$uuid } A bslib ui component ui <- page_sidebar( title = "My dashboard", sidebar = list( actionButton("submit", "Submit"), actionButton("reset", "Reset") ), textInput(inputId = "name", "Your name"), textOutput("uuid") ) Here’s the server part that was giving me trouble....

March 4, 2024 · 2 min

Avoiding the word footgun(s)

I recently opened an issue in a repository for a package I’m working on to think about potential footguns and how to avoid them. That word “footguns” got me thinking; does using phrases/metaphors for a certain topic in a way lend credibility to it? For example, we use a lot of sports metaphors in the US, especially baseball (swing for the fences, anything related to bases, curveballs, heavy hitter, etc.), and that says something about the place of baseball in our culture....

March 3, 2024 · 2 min

Weird thoughts

My parents just found this email they had printed out from me from May 19, 2006, when I was 26. I chatted about some family stuff, then had this rambling string of weird thoughts below. I thought others might appreciate a good cringe - or cringy laugh - at my expense. It’s especially funny because I’m most def an atheist. I don’t know, those Tucson sunsets really are transformative. … Actually, some deep thoughts:...

October 12, 2023 · 2 min · Scott Chamberlain

Job searching notes

notes to self for next job hunt (some of which may be generally useful): don’t apply to general tech companies anymore for many reasons. heard back from very very few but that may be b/c I don’t know many people at general tech companies never been able to get through interviews; they’re presumably looking for computer science grads (not me) most of their missions are probably not stuff I’d be happy about at the end of the day....

October 9, 2023 · 3 min · Scott Chamberlain

Working at Fred Hutchinson Cancer Center

Soooo, my last job at Deck was amazing. I loved it. I was doing data engineer stuff there, mostly maintaining infrastructure for data pipelines. Everyone was great and the mission was amazing: helping Democrats win. Yet the company was shut down about a month ago, sending me on another job search, the 3rd since early/mid 2021. I’m super thrilled to have landed a job (Software and Reproducibility Software Developer) at the Fred Hutch Data Science Lab (DASL), headed up by Jeff Leek, working with Sean Kross, Amy Paguirigan, and Monica Gerber, among many other amazing folks....

October 6, 2023 · 1 min · Scott Chamberlain

Python, ast, and redbaron

I recently had a use case at work where I wanted to check that file paths given in a Python script actually existed. These paths were in various GitHub repositories, so all I had to do was pull out the paths and check if they exist on GitHub. There were a few catches though. First, I couldn’t simply get any string out of each Python script - they needed to be strings specficied by a specific function parameter, and match a regex (e....

April 18, 2023 · 4 min · Scott Chamberlain

CRAN Checks API and Badges

TL;DR In 6 months (end of November 2022) the CRAN Checks API will be gone You can still get badges at You can use the new badges like: [![cran checks](]( Find more details at Sunsetting the CRAN Checks API If you contribute an R package to CRAN, you may use badges from the CRAN checks API at The CRAN Checks API has been operating since about September 2017 (I think)....

June 2, 2022 · 2 min · Scott Chamberlain