On Fri, May 04, 2007 at 03:45:10PM -0400, Weiwei Shi
wrote:> hi,
>
> is there a way to save a R object into workspace instead of into a
> file during a running of function?
>
if I understand the question correctly you want the 'super-assignment'
operator `<<-' as in
-------------cut---------------
R> f <- function(x) y <<- 2*x
R> f(1)
R> y
[1] 2
R> f(10)
R> y
[1] 20
-------------cut---------------
i.e. y is assigned a value in the 'workspace'. be careful, though, with
this kind of assignment. why not return the object you are interested
in as a list component together with other results when the function
call finishes?