Re: [R] print value of variable to screen or alert box?

2009-05-02 Thread Bill.Venables
variable to screen or alert box? I am trying to debug a loop. Is there a way to print the value of a variable that is inside a loop? I have a vector v and inside a loop I have v[i] where i is the index of the loop. Is there a way to see v[i] per loop so that I can see what is going on? Thanks -- View

Re: [R] print value of variable to screen or alert box?

2009-05-02 Thread Greg Snow
ail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of onyourmark > Sent: Saturday, May 02, 2009 5:59 AM > To: r-help@r-project.org > Subject: [R] print value of variable to screen or alert box? &

Re: [R] print value of variable to screen or alert box?

2009-05-02 Thread Gabor Grothendieck
See ?cat, e.g. > v <- seq(10, 50, 10) > for(i in seq_along(v)) cat("v[", i, "] =", v[i], "\n") v[ 1 ] = 10 v[ 2 ] = 20 v[ 3 ] = 30 v[ 4 ] = 40 v[ 5 ] = 50 On Sat, May 2, 2009 at 7:59 AM, onyourmark wrote: > > I am trying to debug a loop. Is there a way to print the value of a variable > that is

Re: [R] print value of variable to screen or alert box?

2009-05-02 Thread David Winsemius
On May 2, 2009, at 7:59 AM, onyourmark wrote: I am trying to debug a loop. Is there a way to print the value of a variable that is inside a loop? I have a vector v and inside a loop I have v[i] where i is the index of the loop. Is there a way to see v[i] per loop so that I can see what

[R] print value of variable to screen or alert box?

2009-05-02 Thread onyourmark
I am trying to debug a loop. Is there a way to print the value of a variable that is inside a loop? I have a vector v and inside a loop I have v[i] where i is the index of the loop. Is there a way to see v[i] per loop so that I can see what is going on? Thanks -- View this message in context: ht