Skip to main content

Search R Documentation and Manuals with R documentation

Karlijn Willems,
June 12, 2013 min read
Search R documentation and manuals instantly with the help of RDocumentation.

Last week, I was working on an educational R project when I needed to consult the help files of different R packages and functions online. After doing some Google searches, I realized that finding an easy-to-use tool was not as simple as I had expected. The closest that I got was the websites Inside-R and R search, but as a user, it wasn't as "smooth" as what I was looking for (I needed something really user-friendly for this educational project).

Therefore, inspired by the documentation websites of programming languages/frameworks such as Ruby on Rails and AngularJS, I decided to build an online documentation search interface for R myself together with colleagues.

Check the result on!

Checking R documentation online instead of with the built-in R help function can often provide some extra benefits. First, you are capable of searching through the latest version of all R packages, even those that are not installed on your device. This makes it not only a helpful tool but also a tool for discovery. Second, I added the discussion system 'Disqus’. For every function and package, Disqus allows users to ask questions, add extra examples to the documentation, etc. Furthermore, today’s web development tools allow you to build a more user-friendly interface. Especially for an R-beginner this can be helpful. And last but not least, since R is a “one letter word”, googling for “R” + “something” is always a challenge. Having all the documentation in one place can at least eliminate that frustration.

I wrote the code for together with some colleagues. It is quite dirty code since it is only needed to get the job done, but for those who are interested, just send me a request. Also, while coding, we discovered the great staticdocs package of Hadley Wickham. It was not exactly what we needed, but maybe it can be used for other/similar initiatives. For all packages on CRAN, the help files were generated in HTML.

Next, these HTML files were parsed and inserted into an SQL database. We opted for Ruby on Rails to build the web app, that serves all the documentation on R packages and functions.

Finally, using JQuery and Twitter Bootstrap, we built the instant search tool that allows you to see all R packages and R functions immediately while typing.

My colleagues and I hope that with we have delivered the R community a new and useful tool. Just let us know if you have any suggestions on how we can further improve