Re: [R-pkg-devel] Call internal R functions in C

2021-05-03 Thread Duncan Murdoch
On 27/04/2021 12:34 p.m., Cai Li wrote: /Dear Duncan, Thank you very much for your helpfulĀ advice! In addition, could you kindly help answer my follow-up questions below? / Sorry, I showed you how I did it. There are certainly other ways, but you'll have to dig around in the manuals to find

Re: [R-pkg-devel] Call internal R functions in C

2021-04-27 Thread Cai Li
*Dear Duncan, Thank you very much for your helpful advice! In addition, could you kindly help answer my follow-up questions below? * *Instead of passing the private R package environment to C, is there a way to alter the namespace so that files in the "R" directory of the package can be read by t

Re: [R-pkg-devel] Call internal R functions in C

2021-04-26 Thread Duncan Murdoch
On 25/04/2021 10:30 p.m., Cai Li wrote: Thanks Duncan! I was advised not to export those functions in the namespace and keep them as internals. In terms of this, could you advise what specific changes should I make to the C code so that I can evaluate them in a suitable environment? I tried som

Re: [R-pkg-devel] Call internal R functions in C

2021-04-25 Thread Cai Li
Thanks Duncan! I was advised not to export those functions in the namespace and keep them as internals. In terms of this, could you advise what specific changes should I make to the C code so that I can evaluate them in a suitable environment? I tried something like "PROTECT(func_R=lang2(install("P

Re: [R-pkg-devel] Call internal R functions in C

2021-04-25 Thread Duncan Murdoch
On 25/04/2021 7:23 p.m., Cai Li wrote: Hello All, I'm developing a package with C code. My question may be naive: I have several internal R functions that need to be called by C, but I cannot get it to work or find a solution. It can work if I export those internal functions in namespace, but it