search for: modificationfun

Displaying 1 result from an estimated 1 matches for "modificationfun".

2013 Nov 22
2
what is the correct way to force a copy of an object?
...eeking at 'a' and 'b' using .Internal(inspect(a)) seems to confirm this. But for some reason our function is not triggering the copy. We have been able to kludge it to force a copy and behave as expected by making a slight modification to the object before passing it to .Call: modificationFun <- function(x){ x$ForceCopy<-NULL x<-.Call("do_the_mod_in_c_R", package='mypackage') invisible(x) } What is the correct way to force the copy to occur to avoid inadvertently modifying both instances of the object? Neither force() or eval() seem to do this....