Oddly Specific

A Blog About Data Science and Reproducible Research

Acetaminophen and Reflective vs. Reflexive Learning

Analysis narrative with R code for reproducing results

This post documents the key analyses reported in the article “Acetaminophen Enhances the Reflective Learning Process” by Rahel Pearson, Seth Koslov, Bethany Hamilton, Jason Shumake, Charles S. Carver, and Christopher G. Beevers. It is written from my perspective as a co-author who was not involved in designing or conducting the study but was consulted after it was finished to help with the data analysis.

When 0.1 + 0.2 Does Not Equal 0.3

Rewriting R's %in% operator to match floating point values

I explain the dangers of using == and R’s %in% operator with decimal values and how dplyr::near can be used instead of ==. I also show how to overload the %in% operator to perform safe approximate matching of numeric vectors.