User manual
Chapter 5: Sending code to the ESS process 34
5 Sending code to the ESS process
Other commands are also available for evaluating portions of code in the S process. These
commands cause the selected code to be evaluated directly by the ESS process as if you had
typed them in at the command line; the source() function is not used. You may choose
whether both the commands and their output appear in the process buffer (as if you had
typed in the commands yourself) or if the output alone is echoed. The behavior is controlled
by the variable:
[User Option]ess-eval-visibly
Non-nil means ess-eval-* commands display commands and output in the process
buffer. Default is t.
Passing a prefix (C-u) vis to any of the following commands, however, reverses the mean-
ing of ess-eval-visibly for that command only — for example C-u C-c C-j suppresses
the current line of S (or other) code in the ESS process buffer. This method of evaluation
is an alternative to S’s source() function when you want the input as well as the output
to be displayed. (You can sort of do this with source() when the option echo=T is set,
except that prompts do not get displayed. ESS puts prompts in the right places.)
Primary commands for evaluating code are:
[Command]ess-eval-region-or-line-and-step vis
Send the highlighted region or current line and step to next line of code.
[Command]ess-eval-region-or-function-or-paragraph vis
C-M-x Sends the current selected region or function or paragraph.
[Command]ess-eval-region-or-function-or-paragraph-and-step vis
C-c C-c Like ess-eval-region-or-function-or-paragraph but steps to next line
of code.
Other, not so often used, evaluation commands are:
[Command]ess-eval-line vis
C-c C-j Sends the current line to the ESS process.
[Command]ess-eval-line-and-go vis
C-c M-j Like ess-eval-line but additionally switches point to the ESS process.
[Command]ess-eval-function vis no-error
C-c C-f Sends the S function containing point to the ESS process.
[Command]ess-eval-function-and-go vis
C-c M-f Like ess-eval-function but additionally switches point to the ESS process.
[Command]ess-eval-region start end toggle message
C-c C-r Sends the current region to the ESS process.
[Command]ess-eval-region-and-go start end vis
C-c M-r Like ess-eval-region but additionally switches point to the ESS process.










