Re: [Rd] [R] How to preserve data across function calls in a library package

2007-07-11 Thread Saptarshi Guha
On Jul 10, 2007, at 12:33 PM, Saptarshi Guha wrote: > Hi, > Some progress: I am using > SEXP retty; > book=Calloc(1,int); > *book=10; > PROTECT(retty=R_MakeExternalPtr(book,R_NilValue,R_NilValue)); > > then UNPROTECTING and returning retty. > > In

Re: [Rd] [R] How to preserve data across function calls in a library package

2007-07-10 Thread Saptarshi Guha
Hi, Some progress: I am using SEXP retty; book=Calloc(1,int); *book=10; PROTECT(retty=R_MakeExternalPtr(book,R_NilValue,R_NilValue)); then UNPROTECTING and returning retty. In a another function, foo(SEXP s){ int* f=