Re: [Rd] Assignment operator and deep copy for calling C functions

2016-04-07 Thread Martyn Plummer
This is discussed in the "Writing R Extensions" manual section 5.9.10: Named objects and copying. .Call does not copy its arguments and it is not safe to modify them, as you have found, since multiple symbols may refer to the same object. If you are going to modify an argument to .Call you should

[Rd] Assignment operator and deep copy for calling C functions

2016-04-06 Thread Thorsten R
Hi All, i have a problem in understanding what the assignment operator '<-' really is doing. If i create two numeric arrays in R and copy one into the other with '<-' and afterwards change one array by calling a C function, both arrays are changed! The problem I am facing can easily be seen in