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
examp
-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 (!id
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
}
invisible
-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
> 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
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
t;
>
>
>
>
> Quoting Alaios :
>
>> I think we are both talking for watchpoints-breakpoints
>>
>> --- On Wed, 2/16/11, Rainer M Krug wrote:
>>
>>> From: Rainer M Krug
>>> Subject: Re: [R] monitor variable change
>>> To:
ol like tail.
Jan
Quoting Alaios :
I think we are both talking for watchpoints-breakpoints
--- On Wed, 2/16/11, Rainer M Krug wrote:
From: Rainer M Krug
Subject: Re: [R] monitor variable change
To: "Alaios"
Cc: R-help@r-project.org
Date: Wednesday, February 16, 2011,
M Krug
>> Subject: Re: [R] monitor variable change
>> To: "Alaios"
>> 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
>
I think we are both talking for watchpoints-breakpoints
--- On Wed, 2/16/11, Rainer M Krug wrote:
> From: Rainer M Krug
> Subject: Re: [R] monitor variable change
> To: "Alaios"
> Cc: R-help@r-project.org
> Date: Wednesday, February 16, 2011, 9:54 AM
> -
-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 pos
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 variabl
12 matches
Mail list logo