Re: [R] Debugging functions defined (locally) inside another functions

2024-04-12 Thread Iago Giné Vázquez
Thanks a lot both Duncan and Ivan, I will keep that example in mind, Duncan, great! Best regards, Iago De: Duncan Murdoch Enviat el: divendres, 12 d�abril de 2024 15:36 Per a: Iago Gin� V�zquez ; r-help@r-project.org Tema: Re: [R] Debugging functions defined

Re: [R] Debugging functions defined (locally) inside another functions

2024-04-12 Thread Duncan Murdoch
On 12/04/2024 8:15 a.m., Iago Giné Vázquez wrote: Hi all, I am trying to debug an error of a function g defined and used inside another function f of a package. So I have f <- function(whatever){ ... g <- function(whatever2){ ... } ... } If I wanted to debug some thing di

Re: [R] Debugging functions defined (locally) inside another functions

2024-04-12 Thread Ivan Krylov via R-help
В Fri, 12 Apr 2024 12:53:02 + Iago Giné Vázquez пишет: > How should I call trace() if f was a function? Let the tracer be quote(debug(g)) and use as.list(body(f)) to determine where it should be injected: f <- function() { message('exists("g") so far is ', exists('g')) g <- function() {

Re: [R] Debugging functions defined (locally) inside another functions

2024-04-12 Thread Iago Giné Vázquez
ing a call to debug(g) after it's created. How should I call trace() if f was a function? Best regards, Iago De: Ivan Krylov Enviat el: divendres, 12 d��abril de 2024 14:38 Per a: Iago Gin�� V��zquez A/c: r-help@r-project.org Tema: Re: [R] Debugging functio

Re: [R] Debugging functions defined (locally) inside another functions

2024-04-12 Thread Ivan Krylov via R-help
В Fri, 12 Apr 2024 12:15:07 + Iago Giné Vázquez пишет: > f <- function(whatever){ >... >g <- function(whatever2){ > ... >} >... > } > > If I wanted to debug some thing directly inside f I would do > debug(f). But this does not go inside g code. On the other hand, > debug

Re: [R] Debugging functions defined (locally) inside another functions

2024-04-12 Thread Iago Giné Vázquez
14:15 Per a: r-help@r-project.org Tema: [R] Debugging functions defined (locally) inside another functions Hi all, I am trying to debug an error of a function g defined and used inside another function f of a package. So I have f <- function(whatever){ ... g <- function(

[R] Debugging functions defined (locally) inside another functions

2024-04-12 Thread Iago Giné Vázquez
Hi all, I am trying to debug an error of a function g defined and used inside another function f of a package. So I have f <- function(whatever){ ... g <- function(whatever2){ ... } ... } If I wanted to debug some thing directly inside f I would do debug(f). But this does not g

Re: [R] Debugging Rmarkdown

2019-04-23 Thread Patrick Connolly
knitr::purl -- thats a great tip! As soon as got hold of a reqular .R script, I spotted the reason why my Fmd file wouldn't knit in a matter of seconds. Thank you Jeff. Thanks also to all the other suggestions. On Fri, 19-Apr-2019 at 02:44PM -0700, Jeff Newmiller wrote: |> I just run each ch

Re: [R] Debugging Rmarkdown

2019-04-19 Thread William Dunlap via R-help
You can set the error handler to save the current state of R in a file, "last.dump.rda" in the current working directory, when an error occurs with options(error=expression(dump.frames(to.file=TRUE, include.GlobalEnv=TRUE))) In another R session you can look at what it saved with load("last.d

Re: [R] Debugging Rmarkdown

2019-04-19 Thread Jeff Newmiller
Chunks are not isolated... they are executed in sequence in the same environment, starting with a fresh environment unrelated to whatever is present when you invoke render(). On April 19, 2019 3:00:33 PM PDT, Patrick Connolly wrote: >There are options to set echo and messages but AFAIK, the te

Re: [R] Debugging Rmarkdown

2019-04-19 Thread Patrick Connolly
There are options to set echo and messages but AFAIK, the text appears in the resultant file, but if the script fails, there's no file to inspect. On 20/04/19 9:50 AM, Bert Gunter wrote: > This might be offbase, but do you need to set options to cache the > results in the original code chunks to

Re: [R] Debugging Rmarkdown

2019-04-19 Thread Bert Gunter
This might be offbase, but do you need to set options to cache the results in the original code chunks to reuse in later chunks? (I haven't worked with knitr lately, so this may be nonsense). Cheers, Bert On Fri, Apr 19, 2019 at 2:03 PM Patrick Connolly wrote: > > On 19/04/19 12:13 AM, Thierry

Re: [R] Debugging Rmarkdown

2019-04-19 Thread Jeff Newmiller
I just run each chunk in sequence starting from an fresh restart of R by copying code to the R console. However you can use knitr::purl to extract all of the code into a regular R script to do whatever debugging you are most familiar with. On April 19, 2019 2:03:00 PM PDT, Patrick Connolly wr

Re: [R] Debugging Rmarkdown

2019-04-19 Thread Patrick Connolly
On 19/04/19 12:13 AM, Thierry Onkelinx wrote: > Dear Patrick, > > This is not easy to debug without a reprex > > I would check the content of zzz and wide.i in the loop > > str(wide.i) >  zzz <- rbind(zzz, wide.i) > str(zzz) > That's just what I'm trying to achieve but the debugging doesn't work

Re: [R] Debugging Rmarkdown

2019-04-18 Thread Thierry Onkelinx via R-help
Dear Patrick, This is not easy to debug without a reprex I would check the content of zzz and wide.i in the loop str(wide.i) zzz <- rbind(zzz, wide.i) str(zzz) Note that the Rmd always runs in a clean environment. This might explain the difference Best regards, ir. Thierry Onkelinx Statistic

[R] Debugging Rmarkdown

2019-04-18 Thread Patrick Connolly
I have a function that works in ESS, but it fails if I include it in an .Rmd file that I tried to knit using Rstudio. I found advice at: https://www.rstudio.com/products/rstudio/release-notes/debugging-with-rstudio/ It seems to be not referring to markdown files. Somewhere else suggested calling

Re: [R] debugging R code and dealing with dependencies

2014-12-25 Thread Mike Miller
On Thu, 25 Dec 2014, David Winsemius wrote: On Dec 25, 2014, at 1:04 AM, Mike Miller wrote: I just wanted to put this out there. It's just some of my observations about things that happen with R, or happened in this particular investigation. There were definitely some lessons for me in thi

Re: [R] debugging R code and dealing with dependencies

2014-12-25 Thread David Winsemius
> On Dec 25, 2014, at 1:04 AM, Mike Miller wrote: > > I just wanted to put this out there. It's just some of my observations about > things that happen with R, or happened in this particular investigation. > There were definitely some lessons for me in this, and maybe that will be > true of

Re: [R] debugging R code and dealing with dependencies

2014-12-25 Thread Mike Miller
Thanks, but I was already in touch with Rob Kirkpatrick about it. We all work together at U Minnesota, or did until Rob went to VCU. Mike On Thu, 25 Dec 2014, Uwe Ligges wrote: This is a rather detailed analysis, thanks, but I think it should be send to the maintainer of the "RFGLS" package

Re: [R] debugging R code and dealing with dependencies

2014-12-25 Thread Uwe Ligges
This is a rather detailed analysis, thanks, but I think it should be send to the maintainer of the "RFGLS" package (CCing). Best, Uwe Ligges On 25.12.2014 10:04, Mike Miller wrote: I just wanted to put this out there. It's just some of my observations about things that happen with R, or happ

[R] debugging R code and dealing with dependencies

2014-12-25 Thread Mike Miller
I just wanted to put this out there. It's just some of my observations about things that happen with R, or happened in this particular investigation. There were definitely some lessons for me in this, and maybe that will be true of someone else. The main thing I picked up is that it is good

Re: [R] Debugging (was Re: HELP!!!)

2013-02-28 Thread Duncan Murdoch
On 13-02-28 4:20 AM, Patrick Connolly wrote: On Fri, 22-Feb-2013 at 02:23PM -0500, jim holtman wrote: |> Run with: |> |> options(error=utils::recover) |> |> Then at the point of the error you will be able to examine sigma2$id |> which is probably not a numeric. Any time you get an error like th

[R] Debugging (was Re: HELP!!!)

2013-02-28 Thread Patrick Connolly
On Fri, 22-Feb-2013 at 02:23PM -0500, jim holtman wrote: |> Run with: |> |> options(error=utils::recover) |> |> Then at the point of the error you will be able to examine sigma2$id |> which is probably not a numeric. Any time you get an error like this, |> if you have been using the above state

Re: [R] Debugging using RStudio or any other R editor

2012-02-21 Thread Shige Song
Both ESS (with ess-tracebug) and StatET (an R plug-in for Eclipse) has debugger function. Shige On Tue, Feb 21, 2012 at 8:16 AM, R. Michael Weylandt wrote: > ?findLineNum in conjunction with ?setBreakpoint and ?traceback or > options(error=recover) seems like a good strategy within R. Not sure >

Re: [R] Debugging using RStudio or any other R editor

2012-02-21 Thread R. Michael Weylandt
?findLineNum in conjunction with ?setBreakpoint and ?traceback or options(error=recover) seems like a good strategy within R. Not sure what you can get on the IDE end. Michael On Tue, Feb 21, 2012 at 2:38 AM, jpm miao wrote: > Hello, > >   I am using RStudio and have trouble finding out the prob

[R] Debugging using RStudio or any other R editor

2012-02-20 Thread jpm miao
Hello, I am using RStudio and have trouble finding out the problematic line in the presence of a bug. Could I view the line NUMBER which contains a bug? Is there any R editor able to do it? Thanks, Miao [[alternative HTML version deleted]] ___

Re: [R] debugging R

2012-02-05 Thread Duncan Murdoch
On 12-02-05 3:01 AM, Alaios wrote: Dear all, I am using browse() to debug my R applications. My problem is that I need a bit more control of the debugging process. For example 'I want R to stop at the 7th iteration and check. One can do think that I can put the browse inside an if statement bu

Re: [R] debugging R

2012-02-05 Thread michael.zombok
Hi Alex, some hints and advices on debugging can be found in the 'Writing R Extensions Manual': http://cran.r-project.org/doc/manuals/R-exts.html#Debugging-R-code Depending on the IDE/editor you are using, there may be additional debugging tools/options, but without further informations about yo

Re: [R] debugging R

2012-02-05 Thread Gabor Grothendieck
On Sun, Feb 5, 2012 at 3:01 AM, Alaios wrote: > Dear all, > I am using browse() to debug my R applications. My problem is that I need a > bit more control of the debugging process. > > For example 'I want R to stop at the 7th iteration and check. One can do > think that I can put the browse insi

[R] debugging R

2012-02-05 Thread Alaios
Dear all, I am using browse() to debug my R applications. My problem is that I need a bit more control of the debugging process.   For example 'I want R to stop at the 7th iteration and check. One can do think that I can put the browse inside an if statement but this limits by lot the flexibili

Re: [R] Help! Big problem when using "browser()" to do R debugging?

2011-12-03 Thread Liviu Andronic
On Sat, Dec 3, 2011 at 2:38 AM, Michael wrote: > Hi all, > > Could you please help me? > > I am having the following weird problem when debugging R programs > using "browser()": > > In my function, I've inserted a "browser()" in front of Step 1. My > function has 3 steps and at the end of each ste

Re: [R] Help! Big problem when using "browser()" to do R debugging?

2011-12-02 Thread Duncan Murdoch
On 11-12-02 8:38 PM, Michael wrote: Hi all, Could you please help me? I am having the following weird problem when debugging R programs using "browser()": In my function, I've inserted a "browser()" in front of Step 1. My function has 3 steps and at the end of each step, it will print out the

[R] Help! Big problem when using "browser()" to do R debugging?

2011-12-02 Thread Michael
Hi all, Could you please help me? I am having the following weird problem when debugging R programs using "browser()": In my function, I've inserted a "browser()" in front of Step 1. My function has 3 steps and at the end of each step, it will print out the message "Step i is done"... However,

Re: [R] new R debugging tool

2011-10-30 Thread Norm Matloff
Rainer wrote: * On Thu, Oct 20, 2011 at 12:22 AM, Norm Matloff * wrote: * * > * > I've developed a new R debugging tool, debugR, available at * > http://heather.cs.ucdavis.edu/debugR.html * > * > This basically replaces my edtdbg, which I will no longer be * > s

Re: [R] new R debugging tool

2011-10-28 Thread Tal Galili
) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) -- On Thu, Oct 20, 2011 at 12:22 AM, Norm Matloff wrote: > > I've developed a new R debugging tool, debugR, availabl

Re: [R] new R debugging tool

2011-10-24 Thread Rainer M Krug
On Thu, Oct 20, 2011 at 12:22 AM, Norm Matloff wrote: > > I've developed a new R debugging tool, debugR, available at > http://heather.cs.ucdavis.edu/debugR.html > > This basically replaces my edtdbg, which I will no longer be supporting. > The new tool is now decoupled

[R] new R debugging tool

2011-10-19 Thread Norm Matloff
I've developed a new R debugging tool, debugR, available at http://heather.cs.ucdavis.edu/debugR.html This basically replaces my edtdbg, which I will no longer be supporting. The new tool is now decoupled from one's text editor, and has a lot more features than edtdbg did. Try it! F

Re: [R] debugging functions in R

2011-08-25 Thread Spencer Graves
See also the debug function, which allows you to walk through a function line by line. I also concur with Duncan's recommendation to try the R package system. I'm an author of one of two contributed documents available from CRAN -> Documentation: Contributed -> "Creating R Packa

Re: [R] debugging functions in R

2011-08-25 Thread Duncan Murdoch
On 11-08-24 10:20 AM, Eran Eidinger wrote: Hi, I am not sure if this is the right list to ask this question (though I did not find a more appropriate one). I've started using R a month ago, and small scripts work fine. However, when I start writing more complex code, it gets messy. 1. Is there

Re: [R] debugging functions in R

2011-08-24 Thread jim holtman
Also check out the 'debug' package On Wed, Aug 24, 2011 at 10:59 AM, Eran Eidinger wrote: > Wow, thanks Justin and Liviu, > > DebugOnce and browser. great! > > Eran > > On Wed, Aug 24, 2011 at 5:34 PM, Justin Haynes wrote: > >> Another great tool is debugonce() >> >> wrap your function name in i

Re: [R] debugging functions in R

2011-08-24 Thread Eran Eidinger
Wow, thanks Justin and Liviu, DebugOnce and browser. great! Eran On Wed, Aug 24, 2011 at 5:34 PM, Justin Haynes wrote: > Another great tool is debugonce() > > wrap your function name in it and then execute your function call. > > debugonce(my.function) > > out<-my.function(df) > > And you'll b

Re: [R] debugging functions in R

2011-08-24 Thread Justin Haynes
Another great tool is debugonce() wrap your function name in it and then execute your function call. debugonce(my.function) out<-my.function(df) And you'll be brought into the same interactive browser. (its Vi if im not mistaken which can take a little getting used to.) Justin On Wed, Aug 2

Re: [R] debugging functions in R

2011-08-24 Thread Liviu Andronic
On Wed, Aug 24, 2011 at 4:20 PM, Eran Eidinger wrote: > Hi, > > I am not sure if this is the right list to ask this question (though I did > not find a more appropriate one). > I've started using R a month ago, and small scripts work fine. However, when > I start writing more complex code, it gets

[R] debugging functions in R

2011-08-24 Thread Eran Eidinger
Hi, I am not sure if this is the right list to ask this question (though I did not find a more appropriate one). I've started using R a month ago, and small scripts work fine. However, when I start writing more complex code, it gets messy. 1. Is there any way to debug "normally", with breakpoints

[R] Debugging multiple imputation in mice

2011-07-25 Thread Harish Narayanan
Hello all, I am trying to impute some missing data using the mice package. The data set I am working with contains 125 variables (190 observations), involving both categorical and continuous data. Some of these variables are missing up to 30% of their data. I am running into a peculiar problem wh

[R] Debugging foreach loop with doMC

2011-05-23 Thread Jannis
Dear list members, I am running a rather long forach loop while using 16 cores on a cluster simultaneously using the package doMC. After approximately 12000 calculations I get the following error message: Fehler in calcs.iter(i) : task 5166 failed - "Indizierung außerhalb der Grenzen" cal

Re: [R] debugging

2011-02-24 Thread jim holtman
options(error=utils::recover) On Thu, Feb 24, 2011 at 12:06 PM, Yan Jiao wrote: > Dear R user > > > > How to make the program stop at the spot where the error occurs?  I mean > inside the iterations,. > > > > Many thanks > > > > yan > > > **

Re: [R] debugging

2011-02-24 Thread Rainer M Krug
On Thu, Feb 24, 2011 at 6:06 PM, Yan Jiao wrote: > Dear R user > > > > How to make the program stop at the spot where the error occurs?  I mean > inside the iterations,. > Check ?browser ?debug Rainer > > > Many thanks > > > > yan > > > **

[R] debugging

2011-02-24 Thread Yan Jiao
Dear R user How to make the program stop at the spot where the error occurs? I mean inside the iterations,. Many thanks yan ** This email and any files transmitted with it are confide...{{dropped:10}} __

Re: [R] Debugging segfault in foreach

2010-11-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/16/2010 04:53 AM, Steve Lianoglou wrote: > Hi, > > I'm using R-2.12 on a linux 64bit machine. > > When I run a chunk of code inside a foreach() %do% { ...} or %dopar% > {...} (with doMC backend) I keep getting a segfault. Running the > *same* c

Re: [R] Debugging segfault in foreach

2010-11-16 Thread Duncan Murdoch
On 15/11/2010 10:53 PM, Steve Lianoglou wrote: Hi, I'm using R-2.12 on a linux 64bit machine. When I run a chunk of code inside a foreach() %do% { ...} or %dopar% {...} (with doMC backend) I keep getting a segfault. Running the *same* code within lapply(something, function(x) ... ) doesn't resu

[R] Debugging segfault in foreach

2010-11-15 Thread Steve Lianoglou
Hi, I'm using R-2.12 on a linux 64bit machine. When I run a chunk of code inside a foreach() %do% { ...} or %dopar% {...} (with doMC backend) I keep getting a segfault. Running the *same* code within lapply(something, function(x) ... ) doesn't result in any segfaults. I'll paste the output below,

Re: [R] debugging

2010-10-07 Thread Duncan Murdoch
On 07/10/2010 6:09 AM, Maas James Dr (MED) wrote: I'm attempting to learn how to use the debug function to find the values of some variables. I've found a couple of documents describing the basics and they show examples that the debugger returns "Browse[1]>" but for some reason when I follo

[R] debugging

2010-10-07 Thread Maas James Dr (MED)
I'm attempting to learn how to use the debug function to find the values of some variables. I've found a couple of documents describing the basics and they show examples that the debugger returns "Browse[1]>" but for some reason when I follow the examples I get "Browse[2]>" What is the "2"

Re: [R] debugging substitute function in R 2.11

2010-05-15 Thread Peter Ehlers
substitute() does not have an argument 'list'; it does have 'env'. Replace this line: list = list (member = as.name (member), with env = list (member = as.name (member), -Peter Ehlers On 2010-05-14 3:09, Gil Tomás wrote: Dear list, A while ago I found in the web a

[R] debugging substitute function in R 2.11

2010-05-14 Thread Gil Tomás
Dear list, A while ago I found in the web a function (sadly I can't credit the author as I don't remember where I picked it up from) whose output is a dataframe that lists for every object in the global environment its class, mode, dim & length (where applicable). It is meant to be an upgrade to t

Re: [R] Debugging issues encountered during the "R CMD check" process

2010-01-07 Thread Jason Rupert
addressing errors that occur during the "R CMD check" process, especially since they are not in the R Console and not possible to "browser()" into the issue... Thanks again for any insights or feedback. - Original Message From: Duncan Murdoch To: Jason Rupert

Re: [R] Debugging issues encountered during the "R CMD check" process

2010-01-07 Thread Uwe Ligges
Dear Jason Rupert, I would need to dig into this and cannot answer yet. But I am about to take over maintainership of the orphaned signal package and already registered an R-forge project (currently I only cleaned up some files without really fixing issues). Have you already invested some wor

Re: [R] Debugging issues encountered during the "R CMD check" process

2010-01-07 Thread Duncan Murdoch
On 07/01/2010 2:48 PM, Jason Rupert wrote: I read through the "Writing R Extensions" and the "Debugging in R" website (http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/), looking for some hints about how to solve the issue of debugging problems encountered during the "R CMD check" proce

[R] Debugging issues encountered during the "R CMD check" process

2010-01-07 Thread Jason Rupert
I read through the "Writing R Extensions" and the "Debugging in R" website (http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/), looking for some hints about how to solve the issue of debugging problems encountered during the "R CMD check" process, but nothing seems to be mentioned abo

Re: [R] debugging package

2010-01-06 Thread Liviu Andronic
Hello On 1/6/10, Markus Weisner wrote: > * checking whether package 'NFIRS' can be installed ... WARNING > Found the following significant warnings: >missing link(s): ~~fun~~ CLASSNAME-class > See '/Users/markus/Dropbox/NFIRS_S4/NFIRS.Rcheck/00install.out' for details. > I am not sure

Re: [R] debugging package

2010-01-06 Thread Uwe Ligges
On 06.01.2010 02:15, Markus Weisner wrote: I am trying to debug a package to submit it to CRAN and am getting a bunch of error messages. Most of the errors are because of the Rd files which were automatically populated by the package.skeleton function. I find the section on documentation to b

[R] debugging package

2010-01-05 Thread Markus Weisner
I am trying to debug a package to submit it to CRAN and am getting a bunch of error messages. Most of the errors are because of the Rd files which were automatically populated by the package.skeleton function. I find the section on documentation to be pretty confusion in the R Extensions manual.

Re: [R] Debugging the "unexpected string constant" error in the zp2ssg2.R

2009-11-27 Thread Jason Rupert
:10:24 PM Subject: [R] Debugging the "unexpected string constant" error in the zp2ssg2.R I posted the full extent of this question to Nabble, but essentially I'm having difficulty determining the route cause of the "unexpected string constant" error in the zp2ssg2.R (whic

[R] Debugging the "unexpected string constant" error in the zp2ssg2.R

2009-11-27 Thread Jason Rupert
I posted the full extent of this question to Nabble, but essentially I'm having difficulty determining the route cause of the "unexpected string constant" error in the zp2ssg2.R (which I'm trying to port over from Octave). Here is my current Nabble posting: http://n2.nabble.com/Need-help-solvi

Re: [R] debugging S4 methods

2009-10-01 Thread Duncan Murdoch
On 01/10/2009 7:02 AM, sebastian mueller wrote: Hi all, Does anyone know how to debug S4 methods? In my case I want to find an error in the specc-function of the kernlab-package. As this seems to be a S4-method the normal S3 debugging can't be applied apparently (e.g. debug(s3function.someclass)

[R] debugging S4 methods

2009-10-01 Thread sebastian mueller
Hi all, Does anyone know how to debug S4 methods? In my case I want to find an error in the specc-function of the kernlab-package. As this seems to be a S4-method the normal S3 debugging can't be applied apparently (e.g. debug(s3function.someclass)). So in my case > debug(specc:kernlab) seems on

[R] debugging

2008-09-01 Thread ivo welch
dear R wizards---I am not sure at what point I owe pennance for asking so many questions. I am now wrangling debugging. I want to write a function assert = function( condition, ... ) { if (!condition) { cat(...); cat("\n"); browser(); } stopifnot(condition); } assert( nrow(ds)==12,

Re: [R] debugging a try() statement

2008-02-19 Thread Berwin A Turlach
G'day Juliet, On Tue, 19 Feb 2008 21:35:11 -0500 "Juliet Hannah" <[EMAIL PROTECTED]> wrote: > I implemented a try() statement that looks like: > > <- function(index) > { > >reduced_model <- try(glm.fit(X4,n,family=poisson(link="log"))) >full_model <- try(glm.fit(X5,n,family=poisson(lin

[R] debugging a try() statement

2008-02-19 Thread Juliet Hannah
Dear R Users, I implemented a try() statement that looks like: <- function(index) { reduced_model <- try(glm.fit(X4,n,family=poisson(link="log"))) full_model <- try(glm.fit(X5,n,family=poisson(link="log"))) if (inherits(reduced_model,"try-error") || inherits(full_model,"try-error")) r

Re: [R] Debugging a hanging function within R

2007-11-16 Thread Duncan Murdoch
On 11/16/2007 9:48 AM, Yan Wong wrote: > On 16 Nov 2007, at 14:16, Duncan Murdoch wrote: > >> On 11/16/2007 6:58 AM, Yan Wong wrote: >>> Hi, >>> I can't seem to find a way to do this (i.e. interrupt a routine at >>> an arbitrary time during its run, then step into it using the >>> debugger).

Re: [R] Debugging a hanging function within R

2007-11-16 Thread Yan Wong
On 16 Nov 2007, at 15:05, Gabor Grothendieck wrote: > Try this: > > f <- function() { >for(i in 1:1000) { > if (i == 50) browser() > print(i) > } > } > > # enters debugger when i is 50. > # n/c/Q will step one statement/continue/Quit respectively > f() Thanks. The problem is that

Re: [R] Debugging a hanging function within R

2007-11-16 Thread Gabor Grothendieck
Try this: f <- function() { for(i in 1:1000) { if (i == 50) browser() print(i) } } # enters debugger when i is 50. # n/c/Q will step one statement/continue/Quit respectively f() On Nov 16, 2007 6:58 AM, Yan Wong <[EMAIL PROTECTED]> wrote: > Hi, > > I have an R program which takes

Re: [R] Debugging a hanging function within R

2007-11-16 Thread Yan Wong
On 16 Nov 2007, at 14:16, Duncan Murdoch wrote: > On 11/16/2007 6:58 AM, Yan Wong wrote: >> Hi, >> I can't seem to find a way to do this (i.e. interrupt a routine at >> an arbitrary time during its run, then step into it using the >> debugger). > > If you prepare in advance by using options(

Re: [R] Debugging a hanging function within R

2007-11-16 Thread Duncan Murdoch
On 11/16/2007 6:58 AM, Yan Wong wrote: > Hi, > > I have an R program which takes several days to run, and sometimes > hangs while running, presumably stuck in some sort of loop within a > package function. I don't know where in the program code it is > hanging: it is likely to be within a ro

[R] Debugging a hanging function within R

2007-11-16 Thread Yan Wong
Hi, I have an R program which takes several days to run, and sometimes hangs while running, presumably stuck in some sort of loop within a package function. I don't know where in the program code it is hanging: it is likely to be within a routine that is iterated many hundreds of thousands