Dear list,

I am running R in slave mode to run some calculations on a remote cluster and 
would like to somehow retrieve the last command in the case that it causes an 
error. When an error occours, my job is just quitted and it takes me a lot of 
work to find out which command in my rather lengthy scripts caused the problem. 
With the following I manage to save the workspace in case of an error:

save.ws.error = function()
{
        last.error <- paste('Last error: ',geterrmessage(),sep='')
        save.image(file='filename.RData')
}
options(error=quote({save.ws.error()})) 

I would like to include

history() or savehistory() in this call to get the command that caused the 
error but when I run my script with:

R --slave < scriptname.R  > text_output.out

i get the error message that there is no command history available.

Is there any way to achieve this? 


Cheers
Jannis



______________________________________________
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