Re: [Rd] About R variable references

2005-08-23 Thread Duncan Temple Lang
Hi Markku. You have correctly diagnosed the problem that the initially set global variables "are not stable". In your call to myinit, you store a C-level reference to the var and func R objects. But you need to tell R's memory management that you need to hold onto them. Otherwise it is entitle

Re: [Rd] About R variable references

2005-08-17 Thread Prof Brian Ripley
R never moves objects in memory, but it may garbage collect them. What is not clear to me is that you can guarantee that the objects you pass in are not copies subject to garbage collection, but then I don't know how you are calling your functions. A way to make sure that your pointers remain

[Rd] About R variable references

2005-08-16 Thread Markku Mielityinen
Hello Group, I could use an advice on how SEXP handles work. My aim is to implement a system where I initially set a few global variables that are used for communication between C and R code. Then I do some work with R code and periodically call a function of my own that will update the system sta