[R] How to make a deep copy of a list?

Giovanni Petris gpetr|@ @end|ng |rom u@rk@edu
Sat Nov 12 21:04:57 CET 2022


Hello everybody,

Does anybody know how to obtain a deep copy of a list?

The context is the following. I am passing a list to a function which, in turn, passes it to compiled C code via .Call. The problem is that the C code modifies elements of the list so that, after the R function returns, I end up with a modified version of the list argument. I believe passing to the function a deep copy of the list argument would solve my problem.

Thank you in advance for the help!

Giovanni

--
Giovanni Petris
Professor and Director of Statistics
Department of Mathematical Sciences
University of Arkansas
Fayetteville, AR 72701
USA



	[[alternative HTML version deleted]]



More information about the R-help mailing list