Re: [R] getting the name of a single object in R for debugging output

2009-11-18 Thread Andrew
Henrique,   It works great.  Perfect!   Thank you.   Warm regards,   Andrew --- On Wed, 11/18/09, Henrique Dallazuanna wrote: Try this: debugPrint <- function(x, ...){     print(sprintf("%s: %d", deparse(substitute(x)), x), ...) } On Wed, Nov 18, 2009 at 8:35 AM, Andrew wrote: > I often use

Re: [R] getting the name of a single object in R for debugging output

2009-11-18 Thread Henrique Dallazuanna
Try this: debugPrint <- function(x, ...){ print(sprintf("%s: %d", deparse(substitute(x)), x), ...) } On Wed, Nov 18, 2009 at 8:35 AM, Andrew wrote: > 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

[R] getting the name of a single object in R for debugging output

2009-11-18 Thread Andrew
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(.