I often use a debug flag (set to TRUE) to turn on various debugging print 
statements in my R scripts.  I was thinking I should create a function 
debugPrint(object,debugFlag),
to print out the object name and contents if the debugFlag is set to TRUE.  
Then I wouldn't have to make my script ugly(..er) than it already is by adding 
IF statements all over the place.  I've seen how ls() dumps object names, but 
how do I get access to the character representation of the name of an object.

E.g.

myVar<- 10

print(myVar) produces "10"

I'd like to print out something like " myVar : 10"

I'd appreciate any suggestions.

Regards,

Andrew



      
        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to