Dear list members,

I am trying to use dump.frames to debug some code that i run non interactively. I use the following method:




dump.frames.mod = function() {
  dump.frames(dumpto = 'test', to.file = TRUE)
  quit(save = 'no', status = 10)
}

options(error = dump.frames.mod)


Is there any way to acess the content of the global environment from the *.rda file created in case of an error?

When I run the following, for example, I would like to access the contents of a,b and c from the debugging file:



dump.frames.mod = function() {
  dump.frames(dumpto = 'test', to.file = TRUE)
  quit(save = 'no', status = 10)
}

options(error = dump.frames.mod)


#uncomment with care:
#rm(list=ls())
a = 2
source('testscript.R', local = TRUE)

load('test.rda')
debugger(test)


testscript.R in this testcase contains:

b = 2
c = 3
plot(d)


The only way I found is wrapping a function around the lines of code but this would mean changing a lot of code.


Any Ideas?


Cheers
Jannis


> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-unknown-linux-gnu (64-bit)

______________________________________________
R-help@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.

Reply via email to