> h <- taskCallbackManager() > h$add(function(expr, value, ok, visible) {if(!visible){print(value)};TRUE})
On Sun, Jul 31, 2011 at 12:15 PM, Anthony Ching Ho Ng <anthony.ch...@gmail.com> wrote: > Hello R-help, > > I wonder if it is possible to configure R, so that it will > display/show the evaluation result of the R commands automatically > (similar to the behavior of Matlab) > > i.e. If I type x <- 8 > > it will print 8 in the command prompt, instead of having type x > explicitly to show the result and perhaps put an ";" at the end to > suppress the output. > > i.e. x <- 8; > The first thing I think you can do by adding a task callback manager to print the value if the value would otherwise be invisible: > h <- taskCallbackManager() > h$add(function(expr, value, ok, visible) {if(!visible){print(value)};TRUE}) The semicolon thing would probably need rewriting bits of R at the C code level. I don't think many people would use it though. And my code above might break things. I don't use it. Barry ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.