Publications by stathack

UPDATE Multiple postgreSQL Table Records in Parellel

27.02.2013

Unfortunately the RpostgreSQL package (I’m pretty sure other SQL DBs as well) doesn’t have a provision to UPDATE multiple records (say a whole data.frame) at once or allow placeholders making the UPDATE a one row at a time ordeal, so I built a work around hack to do the job in parellel.  The big problem was that you have to open and close th...

960 sym R (497 sym/2 pcs) 4 img

Tapping the FourSquare Trending Venues API with R

04.03.2013

I came up with the following function to tap into the FourSquare trending venues API: library("RCurl", "RJSONIO") foursquare<-function(x,y,z){ w<-paste("https://api.foursquare.com/v2/venues/trending?ll=",x,"&radius=2000&oauth_token=",y,"&v=",z,sep="") u<-getURL(w) test<-fromJSON(u) locationname="" lat="" long="" zip=...

852 sym R (907 sym/2 pcs) 6 img

Getting started with twitteR in R

13.06.2013

I have asked by a few people lately to help walk them through using twitter API in R, and I’ve always just directed them to the blog post I wrote last year during the US presidential debates not knowing that Twitter had changed a few things. Having my interest peaked through a potential project at work I tried using some of my old code only to ...

2158 sym R (144 sym/2 pcs) 8 img

Heatmapping Washington, DC Rental Price Changes using OpenStreetMaps

04.08.2013

Percentage change of median price per square foot from July 2012 to July 2013: Percentage change of median price from July 2012 to July 2013: Last November I made a  choropleth of median rental prices in the San Francisco Bay Area using data from my company, Kwelia.  I have wanted to figure out how to plot a similar heat map over an actual ma...

1909 sym R (1346 sym/3 pcs) 8 img

Scheduling R Tasks with Crontabs to Conserve Memory

03.09.2013

One of R’s biggest pitfalls is that eats up memory without letting it go.  This can be a huge problem if you are running really big jobs, have a lot of tasks  to run, or there are multiple users on your local computer or r server.  When I run huge jobs on my mac, I can pretty much forget doing anything else like watching a movie or ram inten...

2832 sym 10 img