ed
text editor on a S-PLUS object.
ed(data=<<see below>>, file=tempfile("ed."), editor="ed", error.expr=<<see below>>)
data
is missing, then a file is to be re-edited after it has
failed to evaluate.
ed
as a building block.
See, for example, function
vi
.
ed
. See the examples.
It is important to realize that
ed
does not
change
data
;
the returned value must be reassigned in order to
save your editing changes, as in the example.
If errors resulted during the evaluation of the expression containing the
editing, the file is retained and calling
ed
with no arguments will allow
re-editing the file. This is typically useful if editing a function
definition produced a syntax error.
ttt <- ed(ttt) ttt <- ed(ttt) # now leave a syntax error in the file Syntax error: ... Errors occurred; Use a command like: my.object <- ed() to re-edit this object. ttt <- ed() # after an editing error occurred # example using error.expr ttt <- ed(ttt, error.expr = cat("Type my.object <- ed() again.\\n")) # leave another error in file Syntax error: ... # Type my.object <- ed() again. ttt <- ed() # fix the error