The same excellent documentation for R commands is available through two different help browsers: text and HTML, and let’s see how how each looks, works, and how to switch the default.
Look and feel
Here is how both look for the same options help page on Windows 7 in Revolution R 4.3:
On Linux in a console window, the text browser works functions like the less command, so you can search using /, but on Windows in RGui, there appears to be no search functionality.
The HTML browser starts a web server listening on a local address and launches the default browser (in my case, Firefox). On Windows, I prefer it because the MDI (multiple document interface) in RGui is awkward, and also I can search and follow hyperlinks to related help pages.
RStudio’s help browser looks like an integrated HTML browser:
Choosing a help browser
Regular R 2.13 defaults to the HTML help, while Revolution R 4.3 (R 2.12) defaults to text. To switch the default for the current session, issue one of these commands:
# set the default help type options(help_type="text") options(help_type="html")
Then issue a search command as you normally would:
?options # opens help page for 'options' command
To permanently change the default (until you upgrade or re-install R), modify the Rprofile.site file which can be in one of these locations (which vary slightly by the version of R):
- C:\Revolution\R-Community-4.3\R-2.12.2\etc (Revolution R 4.3)
- C:\Program Files\r\R-2.13.0\etc\Rprofile.site (R 2.13.0)
For Revolution R, before editing, you must change the file to read-write by right clicking on Rprofile.site, choosing Properties, and un-checking Read-only.
Instead of messing with Rrofile.site, you can also create an .Rprofile file in your home directory.
For more ideas on customizing your R profile, see the discussion “Expert R users, what’s in your .Rprofile?”.