similar to: learning to debug

Displaying 20 results from an estimated 20000 matches similar to: "learning to debug"

2010 Oct 29
2
how to debug (mtrace) a function defined inside a function?
Hi, everyone. I am using a fair amount of closures in my code. Problem i am experiencing is i cannot figure out how to mtrace functions defined within a function. There must be some way to name such function for mtrace to see it and let me step into it. For example, say i have code mymodel<-function(){ data<-numeric(0) build<-function(){ data<<-1 } m<-list()
2004 Sep 27
1
mtrace and debug
Hello, pointed to the article "Debugging Without (Too Many) Tears" of Mark Bravington in Rnews Vol 3/3, December 2003 there is a package mvbutils mentioned. So I started to install this package from within R > install.package(mvbutils) I receive an error essage that this package is not found! Is due to a merge,removal or rename of this package? When I try to follow this
2006 Oct 18
1
strange error in mtrace
Dear useRs, I am experiencing very strange error with Mark Bravington's package "debug". I haven't seen them before. Here is the sample session > library(debug) Loading required package: mvbutils MVBUTILS: no "tasks" vector found in ROOT Loading required package: tcltk Loading Tcl/Tk interface ... done > x<-function() return(1) > mtrace(x) > x() Error
2003 Mar 26
5
predict (PR#2686)
# r-bugs@r-project.org `predict' complains about new factor levels, even if the "new" levels are merely levels in the original that didn't occur in the original fit and were sensibly dropped, and that don't occur in the prediction data either. (At least if `drop.unused.levels' was set to TRUE, which the default.) test> scrunge.data.2_ data.frame( y=runif( 3),
2010 Aug 25
1
RCMD CHECK and non-methods
I recently moved a function 'subset.with.warning' into the 'mvbutils' package (a version not yet on CRAN). When I tried RCMD CHECK, I got this warning: * checking S3 generic/method consistency ... WARNING subset: function(x, ...) subset.with.warning: function(x, cond, mess.head, mess.cond, row.info, sub) See section 'Generic functions and methods' of the
2009 Oct 30
1
parse_Rd and/or lazyload problem
I'm encountering problems when making lazy-loadable databases of the output from 'parse_Rd'. The lazy-load database is of seemingly limitless size when I try to reload it... Admittedly I am using functions that I'm not really supposed to use, which is why this isn't a bug report, but there does seem to be something strange going on; my code is very similar to code that lives
2002 Sep 19
3
savehistory directories and quitting R (PR#2038)
# # r-bugs@r-project.org # ###################################################### Because I work in different directories, but always want to save my .Rhistory in the same place, I have changed the system function savehistory to this: function (file = "D:/R50/.Rhistory") invisible(.Internal(savehistory(file))) When I use q() to quit R, and it asks me whether I want to
2004 Mar 09
3
update forgets about offset() (PR#6656)
In R1.7 and above (including R 1.9 alpha), 'update.formula' forgets to copy any offset(...) term in the original '.' formula: test> df <- data.frame( x=1:4, y=sqrt( 1:4), z=c(2:4,1)) test> fit1 <- glm( y~offset(x)+z, data=df) test> fit1$call glm(formula = y ~ offset(x) + z, data = df) test> fit1u <- update( fit1, ~.) test> fit1u$call glm(formula = y ~ z,
2003 Aug 05
1
(PR#3658)
The function 'getAnywhere' crashes if given a non-existent name containing a period: > getAnywhere( 'nomethod.noclassforme') Error in get(x, envir, mode, inherits) : variable "nomethod" was not found However, 'getAnywhere' behaves gracefully if the non-existent name lacks a period: > getAnywhere( 'nomethod') no object named `nomethod' was
2006 Oct 23
0
FW: Debug package question
Dear list, I received the response below from the package author of 'debug'. I post it to the list, with Mark's approval, in case it is useful to others too. Regards, Matthew -----Original Message----- From: Mark.Bravington at csiro.au [mailto:Mark.Bravington at csiro.au] Sent: 22 October 2006 23:53 To: Matthew Dowle Cc: Mark.Bravington at csiro.au Subject: RE: Debug package
2011 Apr 07
2
How to debug reference classes?
How do you debug methods of a reference class? I've been using mtrace, which is excellent, but i cannot figure out how to mtrace a reference class method. Maybe there is some other way to debug these, for example with ordinary trace? for now i am only able to use options(error=recover), which is not giving me idea where exactly in the code i am once i am stopped on an error. -- View this
2003 Sep 25
1
tkinsert (PR#4289)
In R-1.7.1, I used to be able to append a character vector to a 'tklistbox' with e.g. listio <- tklistbox( tktoplevel(), font='Courier', height=20, width=20, setgrid=TRUE) tkinsert( listio, 'end', letters[1:3]) tkpack( listio,side='left', expand=TRUE, fill='both') and three items would be added to 'listio'. This doesn't work in R-devel-- it
2008 Oct 24
1
changed behaviour of 'get' in 2.8.0: request for unchange
There is an unannounced and non-backwards-compatible change to the behaviour of 'get' in R2.8.0. 'get'ting a missing value now causes an error, whereas hitherto it's just returned a "missing" object. For example, in R2.8.0 this happens: test> getto <- function( x) get( 'x', sys.frame(1)) test> getto() Error in get("x", sys.frame(1)) :
2004 Jan 30
0
savehistory() for ESS {was "ess and debug package"}
>>>>> "StEgl" == Stephen Eglen <stephen@inf.ed.ac.uk> >>>>> on Fri, 30 Jan 2004 12:56:48 +0000 writes: >> I was trying to use the new debug package from within emacs, I get the >> following error: >> >library(debug) >> Loading required package: mvbutils >> MVBUTILS: no "tasks" vector
2007 May 12
1
mtrace() fails
I find the R debug package very useful. I've installed and used it on several of the machines I use, without problems, but on one machine I get the following error: Loading required package: mvbutils Loading required package: utils MVBUTILS: no "tasks" vector found in ROOT Loading required package: tcltk Loading Tcl/Tk interface ... done [Previously saved
2007 Apr 29
1
[debug] package - Error in all.levs (PR#9638)
Dear All, I encountered the following problem: fun1 <- function(x){ 2*cos(x) } >library(debug) > mtrace(fun1) > fun1(0.1) Error in all.levs[[j]] : subscript out of bounds > sessionInfo() R version 2.5.0 (2007-04-23) i386-pc-mingw32 locale: LC_COLLATE=Polish_Poland.1250;LC_CTYPE=Polish_Poland.1250; LC_MONETARY=Polish_Poland.1250;LC_NUMERIC=C;LC_TIME=Polish_Poland.1250 attached
2006 Dec 02
0
fixup for debug package and R2.4.0
A number of users have spotted a terminal problem with the 'debug' package under R2.4.0, along the lines of > mtrace(x) > x() Error in attr(value, "row.names") <- rlabs : row names must be 'character' or 'integer', not 'double' This arose from a bug in 'rbind.data.frame' in R2.4.0 itself. The bug is fixed in R2.4.0 patched, so the
2004 Nov 23
3
str() resets class for environments
I noticed the following today --- str() seems to remove any extra class information added to an environment. > e <- new.env() > class(e) [1] "environment" > class(e) <- c("foo", class(e)) > class(e) [1] "foo" "environment" > str(e) Classes 'foo', 'environment' length 0 <environment> > class(e) [1]
2016 Dec 12
2
why does parent.frame() cycle when called from inside capture.output()?
Hello R devel/help, I ran into this strange behavior: # showstack is supposed to walk through the stack of parent # environments when it is called: showstack = function() { env = environment() for(i in 1:12) { env = do.call(parent.frame, list(), env=env) print(env) } } # a simple chain of functions: g3=function(t) showstack()
2016 Dec 12
2
why does parent.frame() cycle when called from inside capture.output()?
Hello R devel/help, I ran into this strange behavior: # showstack is supposed to walk through the stack of parent # environments when it is called: showstack = function() { env = environment() for(i in 1:12) { env = do.call(parent.frame, list(), env=env) print(env) } } # a simple chain of functions: g3=function(t) showstack()