[R] use save.image inside a function?

2008-01-09 Thread Hua Li
Hi, All I'm trying to save the workspace as a Check Point for possible future come back. The save.image function works if the whole coding is in a main function: rm(list=ls()) t = 1 t = t+1 print(paste(before,t)) # [1] before 2 save.image(tt.RData) t = t+1 print(paste(after,t)) # [1] after 3

Re: [R] use save.image inside a function?

2008-01-09 Thread Prof Brian Ripley
save.image() saves the global workspace: it does not save the environments of executing functions. If you want to save the latter, use the 'envir' argument of save(). On Tue, 8 Jan 2008, Hua Li wrote: Hi, All I'm trying to save the workspace as a Check Point for possible future come back.