Publish to WordPress directly from RStudio

The following piece of automation let me fall in love with R all over again: Publish a WordPress post directly from an R Markdown file! What’s so great about that? Usually, I develop my analysis and visualizations in an RMarkdown file that I publish to Github (version control, code sharing—all the good reasons to use git).

Github is fantastic to share code, but it’s not trivial to skim through a script and quickly understand what was done and how. Even with lots of comments, it will require dedication and time. However, A WordPress post about the analysis provides background, emphasizes only the interesting coding bits, provides visual results, and has a much higher likelihood to be found by other programmers.

Unfortunately, the above workflow separates the WordPress post from the underlying R script. Changing one part requires manually changing the other, which is particularly tedious for images. The ability to have the raw code (posted on Github) and the WordPress post from a single source of truth (the R Markdown script) is a game-changer! Best of all, it’s easy to set up, as we’ll see below.

Continue reading “Publish to WordPress directly from RStudio”

(Don’t) Blame the weather

This project uses time series analysis and forecasting techniques to explore crime data during the COVID-19 pandemic, while also considering the weather.

Did COVID-19 prevent homicides?

Admittedly, that header is a bit sensational, but when I analyzed Boston’s crime data during Covid-19, the drop in reported offenses was quite astonishing. While verbal dispute offenses sky-rocketed, and more people set out to rob a bank, the overall number of crimes dropped by more than half. So indeed, the lock-down prevented harm by reducing the risk of catching the virus and also decreased the probability of getting hit by a car or bullet.

Continue reading “(Don’t) Blame the weather”

Tableau vs R

I feel rueful. I’ve learned Tableau. A proprietary tool [cue the horror-movie sound].

Nothing wrong with that, you say? Well, I felt like a traitor, given that my book, Computing Skills for Biologists, spends many pages on why to prefer open-source software over proprietary tools.

In academia, some people carry it like a badge of honor that they don’t have Microsoft Office installed. While the intentions are good (accessibility of open source tools for everyone), the choice turns out less clear cut in an industry setting.

Continue reading “Tableau vs R”