Category Thoughts and Things

Add Interaction Variables as Needed

In today’s edition of Becoming a Functional Data Analyst, I am writing to remind myself not to create interaction variables during data munging.  That is, when acquiring, cleaning, and aggregating data, I find it easier to not interact variables I will later need.  Instead, it is easier to keep variables as they are and only […]

Making HTML Tables in R

TL;DR: htmlTable and tableHTML are better than xtable for creating HTML tables in R. Today, I had to make tables for a Word document, meaning I could not convert my R table to Latex code.  (I know I know, pandoc.  Just another crusty old thing to learn.)  In the past, I had used xtable, but […]

Reason #1 Why I Don’t like ggplot

[UPDATE: My best use of academic Twitter yet.  I tweeted a link to this post and quickly got pwnd by the internet.  What I learned:  there is a function, ggsave(), that does this that I did not know about.  So use that instead of the hacky workaround I came up with.  Never would’ve learned if […]

The Lazy Way Around Updating my gcc Compiler

Today, I need to launch a new AWS EC2 instance to collect some more tweets.  Since I have done this several times, I used my AWS console to replicate the most recent instance I created that collects tweets.  Everything ran smoothly until I tried to install streamR, my go to library for collecting tweets in […]

A Slightly Less Simple Function for Forest Plots

This post is a sequel to my wildly popular – ok, not wildly popular, but very useful for me – post documenting my function to create a forest plot.  Recently, I made models using cross-validation via R’s caret package.  The train() function does the heavy lifting, but the problem is that its output is a […]

Changing Article Style in Overleaf

TL;DR: Just use generic style files for new projects. Overleaf is the best tool I have found for collaborating on Latex documents.  It is cloud-based, has a ton of templates, nice text editing features that go beyond TexShop and other desktop editors I know, and the rich text editor (using a GUI, like a word processor) […]

Who I Saw, 2017 Edition

On the heels of my book inventory for 2017 is this post, my celebrity sighting inventory for 2017.  The New England sophisticate in me hates that I even considered documenting these events, much less put them on my professional website, but the budding Angelino in me, interacted with my forgetfulness, thinks it’s so cool that […]

What I Read, 2017 Edition

Inspired by Aaron Clauset’s annual catalogue of his productivity and spurred by my forgetfulness, this post is the first of what I hope will be many that catalogue my leisure reading of the previous year. In no particular order, I read: The Autobiography of Malcolm X – As good as you’ve heard.  Though dictated, it felt like the […]

Proper Handling of Exceptions in Python

With some free time on my hands, I sat down to update my code that extracts tweets from my tweet collection based on user-supplied keywords or locations.  In doing that, however, I ended up making a major improvement, one that should have existed from day one. You see, simply trying to read a file of […]

I prefer simplejson to json

I thought I was going to spend some time on Friday analyzing tweets from Cameroon.  Instead, starting that process led me down a rabbit hold that has, I hope, culminated in me realizing I should have used Python’s simplejson library this whole time. A script of mine used a try-except sequence to enclose the section […]