Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any good R object browsers?

Tags:

r

S-Plus has a great object explorer and data editor built into its GUI. It allows you to easily see all the objects in the workspace at a glance, and sort them by name, size, or date.

As far as I'm aware, the only equivalent for R is the object browser in JGR (http://jgr.markushelbig.org/).

Otherwise I just use the search() and ls() commands most of the time (along with grep() when I have a lot of objects).

# trivial example of routine: search() utils.list <- ls(pos="package:utils") utils.list[grep("edit",utils.list)] 

Does anyone have any tricks or suggestions for browsing the R workspace? Are there any point-and-click solutions?

like image 303
Shane Avatar asked Sep 06 '09 21:09

Shane


1 Answers

The ESS mode for Emacs has the following to say in its manual:

13.7 Rdired

Ess-rdired provides a dired-like buffer for viewing, editing and plotting objects in your current R session. If you are used to using the dired (directory editor) facility in Emacs, this mode gives you similar functionality for R objects.

To get started, first make sure you can load ess-rdired. Add the following to your .emacs and then restart emacs.

 (autoload 'ess-rdired "ess-rdired"      "View *R* objects in a dired-like buffer." t)   

Start an R session with `M-x R' and then store a few variables, such as:

 s <- sin(seq(from=0, to=8*pi, length=100))  x <- c(1, 4, 9)  y <- rnorm(20)  z <- TRUE 

Then use `M-x ess-rdired' to create a buffer listing the objects in your current environment and display it in a new window:

             mode length    s      numeric    100    x      numeric      3    y      numeric     20    z      logical      1 

Type C-h m or ? to get a list of the keybindings for this mode. For example, with your point on the line of a variable, p will plot the object, v will view it, and d will mark the object for deletion (x will actually perform the deletion).

like image 174
Dirk Eddelbuettel Avatar answered Oct 04 '22 17:10

Dirk Eddelbuettel