[R] Echoing commands (not using source())

Henrik Bengtsson henrikb at braju.com
Wed Apr 11 05:40:55 CEST 2001

Is there a way of echoing (similar to Matlab "echo on") commands that are
being executed? I know how to do this for script files by using source(...,
echo=TRUE), but I would like to be able to use this within *any* function. I
am also not looking for the debug() function. Here is what I would like to

myFunction <- function() {
  x <- 3;
  cat("x = ", x, "\n");

x <- 3;
cat("x = ", x, "\n");
x = 3


Henrik Bengtsson

h e n r i k b @ b r a j u . c o m

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list