Re: [Rd] Most efficient way to check the length of a variable mentioned in a formula.

2014-10-21 Thread Duncan Murdoch
On 17/10/2014, 2:23 PM, Gabriel Becker wrote: > Joris, > > For me > > length(environment(form)[["x"]]) > > Was about twice as fast as > > length(get("x",environment(form > > In the year-old version of R (3.0.2) that I have on the virtual machine i'm > currently using. Those are different:

Re: [Rd] Most efficient way to check the length of a variable mentioned in a formula.

2014-10-21 Thread Joris Meys
Hi Duncan, thanks for your reaction. I'm not following completely though what you mean with "no guarantee that the length() function will do what I want if I evaluate it in an environment set by the user". I wasn't intending to give the user the opportunity to set those environments, but is there

[Rd] How can I use R-function in My C++ project ?

2014-10-21 Thread 黄博
Dear seniors: I am a student in Nanjing Agricultural University of China. I want to use the function "optim" of package stats in my C++ project. I have got the R.dll , R.def and R.lib, but I can't find the function prototypes of "optim" in R.def. How can I do ? Is the Method

Re: [Rd] How can I use R-function in My C++ project ?

2014-10-21 Thread Duncan Murdoch
On 21/10/2014 8:14 AM, 黄博 wrote: Dear seniors: I am a student in Nanjing Agricultural University of China. I want to use the function "optim" of package stats in my C++ project. I have got the R.dll , R.def and R.lib, but I can't find the function prototypes of "optim" in R.def.