For statisticians trying to use the internet as a source of data, the Internet creates a unique dilemma . Statisticians don't really get web programming and web programmers don't really get statistics.
The most popular statistical language like R have extensive packages for XML, JSON and HTTP requests using CURL, yet when it comes to APIs the statistical languages make it tough to work with especially with the spread and the dissonance of their design with the OAuth Authentication protocols.
However Hadley Wickham ,creator of the now legendary ggplot package, has released an upgrade to his httr package that makes it easier to use for APIs. The package httr provides Tools for working with URLs and HTTP. Actually httr is a simplified wrapper built on top of RCurl. It is much much less configurable but because it only attempts to encompass the most common operations it is also much much simpler.
- functions for the most important http verbs:
- automatic cookie handing across requests, connection sharing, and standard SSL config.
- a request object which captures the body of the request along with request status, cookies, headers, timings and other useful information.
- easy ways to access the response as a raw vector, a character vector, or parsed into an R object (for html, XML, JSON, png and jpeg).
The upgrade was announced on the Rstudio Blog.The demos directory has six demos of using OAuth: three for 1.0 (linkedin, twitter and vimeo) and three for 2.0 (facebook, github, google). You can track httr’s development on github,
In addition to this statistical programming the web has a new weapon called Shiny that makes it easier to deploy web applications with built in statistical functionality. Shiny has been launched for public beta testing by RStudio as well:
"Shiny makes it super simple for R users to turn analyses into interactive web applications that anyone can use. These applications let you specify input parameters using friendly controls like sliders, drop-downs, and text fields; and they can easily incorporate any number of outputs like plots, tables, and summaries."
RevoDeployR is a Web Services Framework built on Revolution R Enterprise Server to support production applications of R. The RevoDeployR API supports the Integration of R-based analytics into Web, desktop and mobile applications. The standards-based API is exposed by the RevoDeployR server, an enterprise server technology capable of Scaling to meet the needs of highly intensive, highly trafficked R-enabled applications.
Statistical web applications on the internet- now just one more API call away!