User manual
Chapter 4: Interacting with the ESS process 30
‘n ’ The nth word, where n is a number
‘^’ The first word (i.e. the second one on the command line)
‘$’ The last word
‘x-y ’ A range of words; ‘-y ’ abbreviates ‘0-y ’
‘*’ All the words except the zeroth word, or nothing if the command had just one
word (the zeroth)
‘x *’ Abbreviates x-$
‘x-’ Like ‘x *’, but omitting the last word
In addition, you may surround the entire reference except for the first ‘!’ by braces to
allow it to be followed by other (non-whitespace) characters (which will be appended to the
expanded reference).
Finally, ESS also provides quick substitution; a reference like ‘^old^new^’ means “the
last command, but with the first occurrence of the string ‘old’ replaced with the string
‘new’” (the last ‘^’ is optional). Similarly, ‘^old^’ means “the last command, with the first
occurrence of the string ‘old’ deleted” (again, the last ‘^’ is optional).
To convert a history reference as described above to an input suitable for S, you need
to expand the history reference, using the TAB key. For this to work, the cursor must be
preceded by a space (otherwise it would try to complete an object name) and not be within
a string (otherwise it would try to complete a filename). So to expand the history reference,
type SPC TAB. This will convert the history reference into an S command from the history,
which you can then edit or press RET to execute.
For example, to execute the last command that referenced the variable data, type !?data
SPC TAB RET.
4.5 Hot keys for common commands
ESS provides a number of commands for executing the commonly used functions. These
commands below are basically information-gaining commands (such as objects() or
search()) which tend to clutter up your transcript and for this reason some of the hot
keys display their output in a temporary buffer instead of the process buffer by default.
This behavior is controlled by the following option:
[User Option]ess-execute-in-process-buffer
If non-nil, means that these commands will produce their output in the process
buffer instead.
In any case, passing a prefix argument to the commands (with C-u) will reverse the
meaning of ess-execute-in-process-buffer for that command, i.e. the output will be
displayed in the process buffer if it usually goes to a temporary buffer, and vice-versa. These
are the hot keys that behave in this way:
[Command]ess-execute-objects posn
C-c C-x Sends the objects() command to the ESS process. A prefix argument
specifies the position on the search list (use a negative argument to toggle ess-
execute-in-process-buffer as well). A quick way to see what objects are in your










