I have a function that, via .Call, modifies its argument, so I first
create a backup copy of the object I want to pass, make a copy of it,
and pass the copy to the function. However, my function also modifies
the backup copy. I guess this has to do with R not duplicating objects
until they are modified. Where can I read more about that? And/or how
can I solve my problem, i.e. save a copy of the argument?
Here is an example of what I mean:
mod.back$m0 <- rnorm(2)
mod.back
$m0
[1] -0.03431583 -1.66513535
...
mod <- mod.back
dlmLLsvd(ip,mod)
mod.back
$m0
[1] 3.360737 3.266844
...
Thanks in advance,
Giovanni
--