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 ArticleAnswer by Siva for General suggestions for debugging in R
To debug Reference Class methods without instance reference ClassName$trace(methodName, browser)
View ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleGeneral 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
More Pages to Explore .....