|
Hey there, I’ve enjoyed marching through some of the more common code smells that I see when looking at people’s data analysis work. Let me know if you’re eager to get my thoughts on any smells you frequently see or have heard about. This week I’m taking on “package hygiene”. What do I mean by package hygiene? This has a few aspects. Of course, as I discussed a few weeks ago, it means putting all of your Once, you have put all of the I once worked with someone who easily had 25 First, he had been googling for a package to do X, tried one of the results out in his script and then tried another. Then another. In the final script he may have only used one of those packages and forgotten to remove the other two Second, as suggested by all of his googling, he was an R beginner. Several of the packages were being used to add features onto Third, his script was waaaaay too long. It was hundreds of lines long. Maybe even more than 1,000 lines long. Long scripts are their own smell, which I’ll take on another time. Because his script did so many things, he needed multiple specialized packages for different types of analysis. His large number of Part of the reason this case is so memorable to me was because he was loading packages that conflicted with other packages. Whenever you do
See that section at the bottom with “Conflicts”? That tells me which functions conflict with other functions I’m already using. There are only so many words to describe filtering. It turns out that When you use more and more packages, the likelihood of having conflicts like these increases. What do you do when you can’t avoid having conflicts? Let’s consider the project I was helping with where conflicting To show a better approach, let’s say you’re working with time series data and want to use the
Some people will encourage you to always use this approach to specifying any function that you are loading from a package. I’m trying to be better about doing this myself, but old habits die hard. Plus, if I only have one package ( The other benefit of writing This week, look at some of your recent R code and count the number of WorkshopsI'm pleased to be able to offer you one of three recent workshops! With each you'll get access to 18 hours of video content, my code, and other materials. Click the buttons below to learn more
In case you missed it…I’m in the process of building an R package to implement the Naive Bayesian Classifier that used to be found at the Ribosomal Database Project. There were two videos this week. Click on the thumbnails below to go to each video. Finally, if you would like to support the Riffomonas project financially, please consider becoming a patron through Patreon! There are multiple tiers and fun gifts for each. By no means do I expect people to become patrons, but if you need to be asked, there you go :) I’ll talk to you more next week! Pat |
Hey folks, What a year! This will be the last newsletter of 2025 and so it’s a natural break point to think back on the year and to look forward to the next. Some highlights for me have been recreating a number of panels from the collection of WEB DuBois visualizations on YouTube, recreating plots from the popular media, and modifying and recreating figures from the scientific literature. I guess you could say 2025 was a year of “recreating”! I have found this approach to making...
Hey folks, As 2025 is winding down, I want to encourage you to think about your goals for 2026! For many people designing an effective visualization and then implementing it with the tool of their choice is too much to take on at once. I think this is why many researchers recycle approaches that they see in the literature or that their mentors insist they use. Of course, this perpetuates problematic design practices. What if you could break out of these practices? What if you could tell your...
Hey folks, Did you miss me last week? Friday was the day after the US Thanksgiving holiday and I just couldn’t get everything done that I needed to. The result was an extra livestream on the figure I shared in the previous newsletter. If you haven’t had a chance to watch the three videos (one critique, a livestream, and another livestream) from that figure, I really encourage you to. In the first livestream I made an effort to simplify the panels as a set of facets. Towards the end a viewer...