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]]
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) is.function(get(i)))], isdebugged)f FALSE Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Fri, Oct 23, 2009 at 12:28 PM, Andrew Yee <yee at post.harvard.edu> 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? > Thanks, > Andrew > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > 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. >
Duncan Murdoch
2009-Oct-23 18:02 UTC
[R] how do you know which functions are being debugged?
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 flag in each one. So you could iterate over all visible objects to find the ones that have the flag set (and this is quite slow, there are a lot of places to look), but there would always be the chance that one was hiding somewhere you didn't look. Duncan Murdoch