Here is my recipe for creating plots in a loop using mapply()Read more "Create plots in a loop using mapply()"
Up until a few weeks ago, I had been working off the RStudio version I had initially downloaded in December 2015. The most recent version has a cool feature: tear-away source. You can now fit source scripts, markdowns, and other files side by side. Very convenient.Read more "New RStudio feature: tear-away source"
When and how to use mapply() Use mapply() when you need to pass more than one (multiple) vector to sapply(). Take for example, the two vectors .url and .destfile which contain url download files and file destinations, respectively. We want to use download.file() to download the files in .url to the file destinations in .destfile. We can use: While […]Read more "When to use mapply() over sapply()"
In this post I will go over how to create an aggregated table of the FRED data and merge it with the election data. This aggregated table will serve as the basis for a future post on mapping out both the FRED and election data. In my next post, I will go through how to tier and […]Read more "R, FRED, and the 2016 Texas Primary: Part 3.1"
This post will cover the final steps of assembling the FRED data. If you didn’t catch the first part, check it out here. I also have a PDF copy of this post for viewing. Overview: Picking up from last time I have all the metadata and the data itself. However, all that data is floating […]Read more "R, FRED, and the 2016 Texas Primary: Part 2"
404 = Not Found This is a “client side” error – indicating that you, the individual sending a request to a server, have made some kind of error. In my most recent run-in with this error, I scraped 10,000+ links in order to downloaded image files using download.file(). Over a thousand of the links were […]Read more "404 Error Handling with R’s download.file()"
I created a PDF knitr version of this post if you’d like to view that instead. Intro Rig count data can be found at Baker Hughes’ website. However, some state regulators have readily available rig count data. North Dakota is one such state. In this post, I am going to briefly go over how we […]Read more "Scraping and Mapping North Dakota Rig Counts with R"