Publications by Cory Nissen

Use foursquare to locate a twitter user using R

08.04.2013

I’ve been doing some work with Twitter data. In much of this work, my life would be so much easier if we could geographically locate the origin of the tweets. There are some ways to do this using the twitter APIs. For example, if a user has geo-location turned on, you can get the precise lat-lng info for a specific tweet. Also, each user has th...

2620 sym 2 img

Unshorten URLs in R

15.04.2013

Well, of course, this tip comes out one week after I needed it. The author uses the RCurl package to request the header of the shortened URL and then parse the “location” parameter on the return. This sort of operation tends to be needed frequently, especially when using data from twitter. Twitter now shortens even already shorten...

1262 sym

ggplot dodged vs faceted bar chart

17.04.2013

I’ve been bowling once per year at a charity event for the last few years and have kept track of the outcomes to share my group. I used ggplot2 to create a bar chart for the scores. Below are two graphs, one is dodged, the other is faceted. There’s no right way here, but you can see the code and decide for yourself which is more a...

1095 sym 4 img

3D Model Using the rgl Package

25.04.2013

A while back, I had a unique opportunity to work with some very talented interns for the summer while I was working at Allstate insurance. Without giving away details of the project that Allstate may prefer to keep secret, let’s just say that we had access to a laser range finder, and were testing it on a cardboard cutout. The laser...

1977 sym 2 img

Using R to communicate via a socket connection

28.05.2013

Occasionally, the need arises to communicate with R via another process. There are packages available to facilitate this communication, but for simple problems, a socket connection may be the answer. Nearly all software languages have a socket communication package, so this is very simple to implement.First, start off with your R “s...

1693 sym

Google Prediction API example

13.06.2013

Google’s prediction API offers a blackbox way of doing some prediction. They had advertised an R package, but it doesn’t seem to work with the new version of the prediction API or their OAuth2 authentication mechanism. So, in an effort to check out the prediction API, I tried to go through the authentication process myself. I got it to work, ...

2091 sym

Google Prediction API update

10.09.2013

A quick update on the last blog post…Mr Hadley Wickham has made the authentication for this much easier…Then you can use the curl script like in my last blog post. Related To leave a comment for the author, please follow the link and comment on their blog: Stats and things. R-bloggers.com offers daily e-mail updates about R ne...

574 sym

Mapping Foodborne Chicago Reports

25.11.2013

I help out with a project called Foodborne Chicago, where we search twitter for people in Chicago mentioning “food poisoning” and @reply to them with a link where they can file a report with the city of Chicago’s Department of Public Health. The application has been live since March 2013. Since then, we have passed on about 125 ...

2892 sym 6 img

Using R to Analyze Yahoo Fantasy Football Data

06.12.2013

I recently created a gist that demonstrated how to authenticate with the Yahoo API, using the httr package. In this post, I will expand on this a little to downloading personal Yahoo fantasy football data and creating a graph showing my regular season results.The first step, obviously, is to authenticate with the Yahoo API and get a s...

2236 sym 2 img

Graphing my MPG vs Temperature

09.12.2013

I use Fuelly to track the fuel mileage in my Toyota Tundra pickup truck. They have a mobile app, so while I’m waiting for the truck to fill up, I log the odometer, and the number of gallons that I put in and then also the price per gallon of fuel and an estimate of my city driving percentage.Any how, I’ve noticed a substantial dr...

2101 sym 4 img