Quantcast
Channel: General suggestions for debugging in R - Stack Overflow
Browsing latest articles
Browse All 14 View Live

Answer by user9669128 for General suggestions for debugging in R

I am beginning to think that not printing error line number - a most basic requirement - BY DEFAILT- is some kind of a joke in R/Rstudio. The only reliable method I have found to find where an error...

View Article



Answer by Siva for General suggestions for debugging in R

To debug Reference Class methods without instance reference ClassName$trace(methodName, browser)

View Article

Answer by Andy Clifton for General suggestions for debugging in R

I gave this answer to a more recent question, but am adding it here for completeness.Personally I tend not to use functions to debug. I often find that this causes as much trouble as it solves. Also,...

View Article

Answer by eykanal for General suggestions for debugging in R

Based on the answer I received here, you should definitely check out the options(error=recover) setting. When this is set, upon encountering an error, you'll see text on the console similar to the...

View Article

Answer by Ari B. Friedman for General suggestions for debugging in R

As was pointed out to me in another question, Rprof() and summaryRprof() are nice tools to find slow parts of your program that might benefit from speeding up or moving to a C/C++ implementation. This...

View Article


Answer by Prasad Chalasani for General suggestions for debugging in R

I like Gavin's answer: I did not know about options(error = recover). I also like to use the 'debug' package that gives a visual way to step through your code.require(debug)mtrace(foo)foo(1)At this...

View Article

Answer by Gavin Simpson for General suggestions for debugging in R

At some point, glm.fit is being called. That means one of the functions you call or one of the functions called by those functions is using either glm, glm.fit.Also, as I mention in my comment above,...

View Article

Answer by Joshua Ulrich for General suggestions for debugging in R

My general strategy looks like:Run traceback() to see look for obvious issuesSet options(warn=2) to treat warnings like errorsSet options(error=recover) to step into the call stack on error

View Article


Answer by Roman Luštrik for General suggestions for debugging in R

So browser(), traceback() and debug() walk into a bar, but trace() waits outside and keeps the motor running.By inserting browser somewhere in your function, the execution will halt and wait for your...

View Article


Answer by Michael Schneider for General suggestions for debugging in R

After going through all the steps suggested here I just learned that setting .verbose = TRUE in foreach() also gives me tons of useful information. In particular foreach(.verbose=TRUE) shows exactly...

View Article

Answer by Shane for General suggestions for debugging in R

I'd say that debugging is an art form, so there's no clear silver bullet. There are good strategies for debugging in any language, and they apply here too (e.g. read this nice article). For instance,...

View Article

Answer by David Lawrence Miller for General suggestions for debugging in R

Mark Bravington's debugger which is available as the package debug on CRAN is very good and pretty straight forward.library(debug);mtrace(myfunction);myfunction(a,b);#... debugging, can query objects,...

View Article

Answer by Christopher DuBois for General suggestions for debugging in R

The best walkthrough I've seen so far is:http://www.biostat.jhsph.edu/%7Erpeng/docs/R-debug-tools.pdfAnybody agree/disagree?

View Article


General suggestions for debugging in R

I get an error when using an R function that I wrote:Warning messages:1: glm.fit: algorithm did not converge 2: glm.fit: algorithm did not converge What I have done:Step through the functionAdding...

View Article
Browsing latest articles
Browse All 14 View Live




Latest Images