Dear all I would like to ask you if there is a way in R to monitor in R when a
value changes.
Right now I use the sprintf('my variables is %d \n, j) to print the value of
the variable.
Is it possible when a 'big' for loop executes to open in a new window to
dynamically check only the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 02/16/2011 10:38 AM, Alaios wrote:
Dear all I would like to ask you if there is a way in R to monitor in R when
a value changes.
Right now I use the sprintf('my variables is %d \n, j) to print the value of
the variable.
Is it possible
I think we are both talking for watchpoints-breakpoints
--- On Wed, 2/16/11, Rainer M Krug r.m.k...@gmail.com wrote:
From: Rainer M Krug r.m.k...@gmail.com
Subject: Re: [R] monitor variable change
To: Alaios ala...@yahoo.com
Cc: R-help@r-project.org
Date: Wednesday, February 16, 2011, 9:54
r.m.k...@gmail.com
Subject: Re: [R] monitor variable change
To: Alaios ala...@yahoo.com
Cc: R-help@r-project.org
Date: Wednesday, February 16, 2011, 9:54 AM
On 02/16/2011 10:38 AM, Alaios wrote:
Dear all I would like to ask you if there is a way in
R to monitor in R when a value changes
.
Jan
Quoting Alaios ala...@yahoo.com:
I think we are both talking for watchpoints-breakpoints
--- On Wed, 2/16/11, Rainer M Krug r.m.k...@gmail.com wrote:
From: Rainer M Krug r.m.k...@gmail.com
Subject: Re: [R] monitor variable change
To: Alaios ala...@yahoo.com
Cc: R-help@r-project.org
-breakpoints
--- On Wed, 2/16/11, Rainer M Krug r.m.k...@gmail.com wrote:
From: Rainer M Krug r.m.k...@gmail.com
Subject: Re: [R] monitor variable change
To: Alaios ala...@yahoo.com
Cc: R-help@r-project.org
Date: Wednesday, February 16, 2011, 9:54 AM
On 02/16/2011 10:38 AM, Alaios wrote:
Dear
You could use any of the gui toolkits (tcltk, gWidgets ...)
and create a watch window which displays the changing value of your
variable in a popup widged.
On 2/16/2011 10:54 AM, Rainer M Krug wrote:
On 02/16/2011 10:38 AM, Alaios wrote:
Dear all I would like to ask you if there is a way in R
You can replace the previous line by:
browser(expr=(a!=old.a)
see ?browser for details.
I don't understand why you'd want to do that - using if is much more
readable to me (and is much more general!)
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics /
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 02/16/2011 03:24 PM, Hadley Wickham wrote:
You can replace the previous line by:
browser(expr=(a!=old.a)
see ?browser for details.
I don't understand why you'd want to do that - using if is much more
readable to me (and is much more
One way to implement this functionality is with a task manager callback:
watch - function(varname) {
old - get(varname)
changed - function(...) {
new - get(varname)
if (!identical(old, new)) {
message(varname, is now , new)
old - new
}
TRUE
}
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 02/16/2011 03:29 PM, Hadley Wickham wrote:
One way to implement this functionality is with a task manager callback:
watch - function(varname) {
old - get(varname)
changed - function(...) {
new - get(varname)
if
On 16/02/2011 9:04 AM, Jan van der Laan wrote:
One possible solution is to use something like:
a- 0
for (i in 1:1E6) {
old.a- a
# do something e.g.
a- runif(1) 1E-6
if (a != old.a) browser()
}
Another solution is to write your output to file (using sink for
example)
12 matches
Mail list logo