User manual
Chapter 11: Other ESS features and tools 59
11.8 TAGS
The Emacs tags facility can be used to navigate around your files containing definitions of
S functions. This facility is independent of ESS usage, but is written here since ESS users
may wish to take advantage of TAGS facility. Read more about emacs tags in an emacs
manual.
Etags, the program that generates the TAGS file, does not yet know the syntax to
recognise function definitions in S files. Hence, you will need to provide a regexp that
matches your function definitions. Here is an example call (broken over two lines; type as
one line) that should be appropriate.
etags --language=none
--regex=’/\([^ \t]+\)[ \t]*<-[ \t]*function/\1/’ *.R
This will find entries in your source file of the form:
some.name <- function
with the function name starting in column 0. Windows users may need to change the
single quotes to double quotes.
R version 2.9.0 introduced a front-end script for finding R tags, which calls the ‘rtags()’
function. By default, this script will recursively search the directories for relevant tags in
R/C/Rd files. To use this script from the command line, try the following to get started:
R CMD rtags --help
For further details, see http://developer.r-project.org/rtags.html
11.9 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.
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 environ-
ment 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).










