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 each row corresponds to one multi-ind

Re: [R] Call by reference or suggest workaround

2010-06-19 Thread Romain Francois
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 each row corresponds to one multi-index). As pass by reference wasn't the default beh

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 pass around the *

Re: [R] Call by reference or suggest workaround

2010-06-19 Thread Duncan Murdoch
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 pass around the *same* matrix object (where each row corresponds to one multi-index). As pass by reference wasn't the default beh

[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 <<-