[R] monitor variable change

Rainer M Krug r.m.krug at gmail.com
Wed Feb 16 11:41:22 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/16/2011 11:21 AM, Alaios wrote:
> I think we are both talking for watchpoints-breakpoints

Yes - and it would be nice to have it, but it can actually be
implemented on IDE etc level: If you are using emacs / ess, checkout

http://code.google.com/p/ess-tracebug/

where you can do something like you are looking for. In addition, the
revolution GUI might help you (never used it, just saw that it has
debugging facilities as well).

But One could think about implementing it in R - as all functions can be
re-defined, to implement a logging mechanism should not be to difficult.
But at the moment, I am happy with ess-tracebug (using it at the moment).

By the way - breakpoints are in R, and they can be conditional as well
(see ?browser)

Cheers,

Rainer


> 
> --- On Wed, 2/16/11, Rainer M Krug <r.m.krug at gmail.com> wrote:
> 
>> From: Rainer M Krug <r.m.krug at gmail.com>
>> Subject: Re: [R] monitor variable change
>> To: "Alaios" <alaios at yahoo.com>
>> Cc: R-help at 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. 
>>>>
>>>> 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 variable I
> want to.
> 
> I don't think that this functionality is implemented.
> 
> But I guess you can implement it - would it be possible to
> re-define th
> "<-" to check if a certain variable is to be changed,
> and then print it?
> 
> Might be tricky and would slow everything considerably
> down.
> 
> Just a thought,
> 
> Rainer
> 
>>>>
>>>> If I put all the sprintf statements inside my loop
> then I get flooded with so many messages that makes it
> useless.  
>>>>
>>>> Best Regards
>>>> Alex
>>>>
>>>> ______________________________________________
>>>> R-help at r-project.org
> mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained,
> reproducible code.
> 
> 
>>

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1bqdIACgkQoYgNqgF2egpr7QCfW7vPgZe2HM3thzQexvUxeZks
UeAAn0G5Wg5ZB7OQnkCy1DHCHday6hBa
=5bMa
-----END PGP SIGNATURE-----



More information about the R-help mailing list