HTML5

R Websockets Package

Note: Active development and maintenance of the R websockets package has been transferred to Joe Cheng at RStudio. All the links below have been updated

Visit RStudio at http://rstudio.org.

Get the R package from CRAN here: http://cran.r-project.org/web/packages/websockets/index.html

Get the development code here: https://github.com/rstudio/R-Websockets

A talk I gave on websockets at JSM is available here: http://illposed.net/jsm2012.pdf

The reference vignette is available here: websockets.pdf

Here is a silly cool R "chat" script using websockets (many web clients can share a super basic R session): http://illposed.net/rchat.R.

The HTML 5 websocket API is a modern socket-like communication protocol for the web. The websockets package is a native websocket implementation for R that supports most of the draft IETF protocols in use by web browsers. The packae implements both a websocket client and R websocket server. The websockets package is especially well-suited to interaction between R and web scripting languages like Javascript. Multiple simultaneous websocket server and client connections are supported.

The library has few external dependencies and, written mostly in R, is easily portable. In many cases, websockets may make much more efficient use of networks than Ajax-like schemes for interacting with clients over web protocls.

Enjoy!