Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Jeff Gentry has created a couple of really fun and handy R packages for working with Twitter data called twitteR and ROAuth. He’s also written an easy to read vignette on how to get started. As of right now (March 1st, 2012) the current version of ROAuth, version 0.9.1, has some issues with running on Windows 7 that he’s aware of.
If you’re running into error messages like “SSL certificate problem, verify that the CA cert is OK” or “Invalid response from site, please check your consumerKey and consumerSecret and try again” – fear not, there are work–arounds.
If you’re a Windows 7 user the first thing to do is go back to the 0.9.0 version of ROAuth. You can download the tarball from the CRAN archive and compile it from inside R:
install.packages("ROAuth_0.9.0.tar.gz", repos = NULL, type="source")
Once you’ve gotten to the credentials step in the vignette there’s 1 more little twist to add. In order to get the handshake to work properly we have to tell OAuth where the cacert.pem file (a public key certificate file) is in order to verify that we’re communicating with the real Twitter website:
credentials$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))
The same is also true for any of the “get” methods like getUser() or getFollowers() that require OAuth. For example:
getUser('User', cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))
Until Jeff gets a chance to make any updates, this should be able to get you back up and running with his wonderful tool. Good luck!
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.