[R] Outputting variable names and their value bindings

Jim Lemon drj|m|emon @end|ng |rom gm@||@com
Mon Jun 25 02:37:05 CEST 2018


Hi Simon,
Easy to do if you call "print" directly:

print<-function(x) cat(deparse(substitute(x)),"=\n",x,"\n")
y<-3
print(y)
y =
 3

Obviously you will want to get rid of your print function when it is
not being used with "rm" or by starting a new session. Getting it to
bypass the default print method is more difficult and I don't have the
time to untangle that one at the moment.

Jim




More information about the R-help mailing list