PinnedLevel up your data visualizations with Human Factors Principles of DisplayThis article explains the why behind many of the decisions we make when creating a good visualization. Consider the clique: “A picture is worth a thousand words…” It’s important to think of your data visualizations in much of the same way. Our current society thrives on scroll culture, which means you need to make your visualization immune to it. It…Data Visualization8 min readData Visualization8 min read
PinnedVisualizing regression point-estimates in RYou can run your regression analysis (any variation) and then apply the following code: model.glm = glm(as.numeric(outcome == "Y") ~ Group + var1 + var2 + Group*var2, #specific to your model, family=gaussian(link="identity"), data = model.df)Data Visualization2 min readData Visualization2 min read
PinnedHow to Create Animated Lines and Labels in RI created an animated line graph with animated labels for a Data Viz Storytelling competition (Github here). The data included Denver eviction data from Jan 2019 — June 2019 and Jan 2020 — Aug 2020. …R6 min readR6 min read
Published inAnalytics Vidhya·PinnedMatching samples for controlled analyses in RWhy Match? If you want to isolate an effect and compare groups, we need to get rid of any other noise. For example, say you have…R6 min readR6 min read
Published inAnalytics Vidhya·PinnedExcluding values in multi-column mean calculations in RThe Task I have data that’s 1 row per person where people reported the number of drinks they had in a specific time-block. The columns are various time blocks, but the participant could also provide other answers that were coded differently: NA means that they didn't use alcohol at all 0 mean…R5 min readR5 min read
Jul 26, 2022Changing geom_text color for stacked bar graphs in ggplot()I have run into the issue, where some labels aren’t showing up/are misplaced for stacked bar charts enough that I decided to document my workarounds. Here is an example graph where the labels aren’t showing up using the iris dataset. The goal graph is below with conditionally colored labels, where…Ggplot23 min readGgplot23 min read
Published inNerd For Tech·Nov 15, 2021Replacing case_when() with joins in RI used to find myself writing hefty ifelse() or case_when() statement to recode values or create new columns — until someone told me to I could use a join instead. Example of how to replace a case_when() with a join. Let’s use a common dataset in R:R3 min readR3 min read
Jul 1, 2021Migrating Libraries in R (process credit to RBloggers)I came across a really cool 3-step way to install all your old libraries in a new instance of R (be it a new device or if you update R) here, but I also have come across a few snags when doing this so I’m going to write out my…R3 min readR3 min read
Feb 10, 2021Quick tips for making reproducible code in RReproducible code should (at minimum) be your last step before closing out a project. You want someone (especially your future self) to be able to pick up your code and quickly and efficiently be able to read it. …Coding3 min readCoding3 min read
Dec 21, 2020Swimming Faster Part II: The trick is in the kickThis post is a branch of my previous post Becoming a better lap swimmer where I cover some distinctions between triathletes and swim team swimmers. Why become a better kicker? Body position Efficiency/reduced energy Better rotation Stronger core Speed In short, if you are a strong kicker, everything else about swimming will become easier. You…Swimming5 min readSwimming5 min read