R Speed with Ease

A Need for Speed R often receives (unfair) criticism of being slow. In some cases this is true but often this is simply due to how the code is written and which packages are being leveraged. The R language is fast when vectorized functions are used (e.g. mean()), which avoids coding for loops in R. However, sometimes a problem is simply easier to code and understand when written as a loop; this is especially the case when the loops are nested.

Bayesian interrupted time series with R & {brms}: Part 2/2

This post is the second of two parts. The focus here is on Bayesian interrupted time series modeling using data simulated in part 1

Bayesian interrupted time series with R & {brms}: Part 1/2

This post is the first of two parts. The focus here is on introducing a scenario and generating a simulated dataset, which is subsequently used for Bayesian interrupted time series modeling.

Animating STI trends in Alberta, Canada

This post was created in addition to wider content presented for the Telus World of Science Dark Matters event. In the summer of 2019 Alberta declared a Syphilis outbreak, with reported cases exceeding 2,000 that year. Syphilis is not the only example of rising Sexually Transmitted Infections (STIs) in the province, gonorrhea is also on the rise. This information is publicly available online via data portals and reports.

{relay}: an R Package for workflows

If I was being presumptuous, I would assume that the R programming language is primarily used for scripting tasks, especially in the field of Public Health. The R language is definitely capable of more complex tasks but, in terms of day-to-day use, creating scripts is most commonplace. Part of this is because R excels in this area, making it very easy for data analysts and epidemiologists to create reports quickly without the requirement to deeply understand software engineering principles and concepts.

{farrago}: an R Package of odds-and-ends

After working with R both professionally and through hobby projects I have accumulated an assortment of coding ‘odds-and-ends’, snippets that I have found useful enough to collate and document. {farrago} is an R package serving as a personal collection of tools to assist with data workflows and analysis, with a focus on health surveillance and epidemiological data; however, it may have utility to other audiences as well.

Addressing data stowaways and R memory usage

Among the errors R sessions produce, one commonly feared is: Error: cannot allocate vector of size X. This error is thrown when you force-feed R too much data. In other words, the system ran out of memory to run an operation. Not only is this an issue when trying to load a single massive data-set but also when a project slowly develops over time and becomes complex.

Bayes' Town: A place of data simulation

Welcome to Bayes’ Town Bayes’ Town is a special place, a place where we can be omnipotent and omniscient. We take comfort in having knowledge and control of all things, even though we know the entire place is apart from reality, a muddled reflection at best and a complete fantasy at worst. Bayes’ Town is a simulation, a useful tool to explore scenarios and test hypotheses, based in reality or otherwise.

Adding info tiles to R Markdown

R Markdown and customization For better or worse, creating reports is a common (if not endless) request for anyone working with data. R Markdown makes the reporting process easier, which I am very thankful for and it has definitely not gone unnoticed by others. If this is the first time hearing about R markdown, enlightenment awaits you here. R Markdown can do many great things right out of the box, as is evident from the details in Yihui Xie’s new book R Markdown Cookbook.

Tokyo Ramen: Mapping with OpenStreetMaps

Due to the combination of physical distancing and my work supporting the analytics arm of Alberta’s COVID-19 pandemic response, I have been unable to visit some of my favorite ramen shops. Naturally, I have been thinking about ramen, usually of my favorite locations in Tokyo. Another topic at the front of my mind has been mapping; one of my contributions to the COVID-19 response has been creating a seemingly endless supply of maps, most of which were cast into the fires of rejection…