search for: returnvaluefromr

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

2007 May 14
1
Best Practise
...( arrayToPassToR = allocVector( REALSXP, n ) ); for(i=0; i < n; i++) { REAL(arrayToPassToR)[i] = oldCarray[i]; <---- very slow way to copy data, can I use memcpy/pointer assignment here to remove the loop without running into garbage collector? } UNPROTECT( arrayToPassToR ); SEXP returnValueFromR; (3) Have made it to call back to an R function which returns a new / different SEXP double array. returnValueFromR = Test_tryEval(...); (4) Copy back to oldCArray for(i=0; i < n; i++) { oldCarray[i] = REAL(returnValueFromR)[i]; <--- can I use memcpy/pointer assignment here to remove...