Re: [R] Call by reference or suggest workaround

2010-06-19 Thread Chidambaram Annamalai
On 6/19/10, Romain Francois wrote: > > Le 19/06/10 16:32, Chidambaram Annamalai a écrit : >> >> I have written code to compute multi-indices in R [1] and due to the >> recursive nature of the computation I need to pass around the *same* >> matrix object (where eac

Re: [R] Call by reference or suggest workaround

2010-06-19 Thread Chidambaram Annamalai
Doh! I never thought about nesting functions. Thanks a bunch! Chillu On 6/19/10, Duncan Murdoch wrote: > On 19/06/2010 10:32 AM, Chidambaram Annamalai wrote: >> I have written code to compute multi-indices in R [1] and due to the >> recursive nature of the computation I need to

[R] Call by reference or suggest workaround

2010-06-19 Thread Chidambaram Annamalai
I have written code to compute multi-indices in R [1] and due to the recursive nature of the computation I need to pass around the *same* matrix object (where each row corresponds to one multi-index). As pass by reference wasn't the default behavior I declared a global matrix (mat) and used the <<-

Re: [R] Derivative of a smooth function

2010-04-03 Thread Chidambaram Annamalai
While this doesn't answer your question, I want to let you know that there is a proposal for a related improvement within R that will let users compute (numerically) the derivatives, of any order, of a given function inside of R. In your case, this means that you will write the smooth spline functi

Re: [R] Operator overloading for custom classes

2010-03-23 Thread Chidambaram Annamalai
Thanks! On Wed, Mar 24, 2010 at 1:01 AM, Sharpie wrote: > > > Chidambaram Annamalai wrote: > > > > Hi, > > > > I need some help to get some of the object orientation, specifically the > > methods that overload the basic arithmetic operations, from

[R] Operator overloading for custom classes

2010-03-23 Thread Chidambaram Annamalai
Hi, I need some help to get some of the object orientation, specifically the methods that overload the basic arithmetic operations, from sample C++ code to R. I don't have experience with such advanced language features inside of R. So I was wondering if some of you could help me out in this regar

Re: [R] Reading data file with both fixed and tab-delimited fields

2010-03-02 Thread Chidambaram Annamalai
I tried to shoehorn the read.* functions and match both the fixed width and the variable width fields in the data but it doesn't seem evident to me. (read.fwf reads fixed width data properly but the rest of the fields must be processed separately -- maybe insert NULL stubs in the remaining fields a