[R] how do you know which functions are being debugged?

2009-10-23 Thread Andrew Yee
This is kind of a dumb question: I know you can use isdebugged() to find out if a specific function is flagged for debugging, but is there a way to list all the functions that are flagged for debugging? Thanks, Andrew [[alternative HTML version deleted]]

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Yihui Xie
list all objects first; use a loop (explicitly or not) to check whether (1) your objects are functions (2) functions are debugged f = function(x) x g = 1 x = ls() debug(f) sapply(x[sapply(x, function(i) is.function(get(i)))], isdebugged) f TRUE undebug(f) sapply(x[sapply(x, function(i)

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Duncan Murdoch
On 10/23/2009 1:28 PM, Andrew Yee wrote: This is kind of a dumb question: I know you can use isdebugged() to find out if a specific function is flagged for debugging, but is there a way to list all the functions that are flagged for debugging? No, R doesn't keep any master list, it sets a

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Yihui Xie
Oops... I forgot to mention that 'envir' (or 'pos') should be specified in ls()/get() in my last reply if you are looking for debugged functions in environments other than .GlobalEnv. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-6609 Web: http://yihui.name Department of

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Gabor Grothendieck
I have often wanted to get such a list as well without having to write code myself. If a function which automatically iterated over all possible objects and listed out the ones that being debugged were available in the core it would be useful. Even if its slow this would be used at debug time

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Duncan Murdoch
On 10/23/2009 2:27 PM, Gabor Grothendieck wrote: I have often wanted to get such a list as well without having to write code myself. If a function which automatically iterated over all possible objects and listed out the ones that being debugged were available in the core it would be useful.

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Gabor Grothendieck
On Fri, Oct 23, 2009 at 2:34 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 2:27 PM, Gabor Grothendieck wrote: I have often wanted to get such a list as well without having to write code myself.  If  a function which automatically iterated over all possible objects and listed

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Andrew Yee
Thanks everyone for the responses. As a suggestion, wouldn't it be useful, that when you run isdebugged() without any parameters, it would just report back the functions that are being flagged for debugging? Andrew On Fri, Oct 23, 2009 at 2:12 PM, Yihui Xie xieyi...@gmail.com wrote: Oops... I

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Duncan Murdoch
On 10/23/2009 2:49 PM, Andrew Yee wrote: Thanks everyone for the responses. As a suggestion, wouldn't it be useful, that when you run isdebugged() without any parameters, it would just report back the functions that are being flagged for debugging? Could you give an example of what the answer

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Steve Lianoglou
Hi, On Oct 23, 2009, at 2:39 PM, Gabor Grothendieck wrote: On Fri, Oct 23, 2009 at 2:34 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 2:27 PM, Gabor Grothendieck wrote: I have often wanted to get such a list as well without having to write code myself. If a function

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Gabor Grothendieck
On Fri, Oct 23, 2009 at 2:52 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 2:49 PM, Andrew Yee wrote: Thanks everyone for the responses.  As a suggestion, wouldn't it be useful, that when you run isdebugged() without any parameters, it would just report back the functions

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Duncan Murdoch
Gabor Grothendieck wrote: On Fri, Oct 23, 2009 at 2:52 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 2:49 PM, Andrew Yee wrote: Thanks everyone for the responses. As a suggestion, wouldn't it be useful, that when you run isdebugged() without any parameters, it would

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Steve Lianoglou
Sweet Jesus ... I just read what I wrote earlier ... On Oct 23, 2009, at 2:57 PM, Steve Lianoglou wrote: If this is something you just want to use on your own functions that are set to `debug`, why not just make write a debug wraps the base::debug and does some keeps track of which functions

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Gabor Grothendieck
On Fri, Oct 23, 2009 at 7:06 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: Gabor Grothendieck wrote: On Fri, Oct 23, 2009 at 2:52 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 2:49 PM, Andrew Yee wrote: Thanks everyone for the responses.  As a suggestion, wouldn't it be