[R] print value of variable to screen or alert box?
Greg.Snow at imail.org
Sun May 3 02:52:18 CEST 2009
Well there are always the print and cat functions which print to standard output. You may also want to look at flush.console if buffering is a problem. Also using "\b" or "\r" with cat can keep from producing too much output. There are also the progress bar functions (winProgressBar, tkProgressBar, txtProgressBar) which show progress bars but also allow for labels that can be changed inside the loop, the bar could show i and the label could show v[i].
Hope this helps,
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of onyourmark
> Sent: Saturday, May 02, 2009 5:59 AM
> To: r-help at r-project.org
> Subject: [R] print value of variable to screen or alert box?
> I am trying to debug a loop. Is there a way to print the value of a
> that is inside a loop? I have a vector v and inside a loop I have v[i]
> i is the index of the loop. Is there a way to see v[i] per loop so that
> can see what is going on?
> View this message in context: http://www.nabble.com/print-value-of-
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help