Re: [R] Recursion is slow

2009-09-09 Thread Bryan Keller
Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison - Original Message - From: Martin Morgan Date: Wednesday, September 9, 2009 4:40 pm Subject: Re: [R] Recursion is slow To: Bryan Keller Cc: William Dunlap , r-help@r-project.org

Re: [R] Recursion is slow

2009-09-09 Thread William Dunlap
Sent: Wednesday, September 09, 2009 3:25 PM > To: Martin Morgan > Cc: William Dunlap; r-help@r-project.org > Subject: Re: [R] Recursion is slow > > Thanks Martin! It seems to be right on and it is blazing > fast! I greatly appreciate the responses from you and Bill > both. A

Re: [R] Recursion is slow

2009-09-09 Thread Martin Morgan
little memory inefficient, but seems to scale fairly well. Martin > > Bryan > > - > Bryan Keller, Doctoral Student/Project Assistant > Educational Psychology - Quantitative Methods > The University of Wisconsin - Madison > > - Original Message - > Fro

Re: [R] Recursion is slow

2009-09-03 Thread Bryan Keller
. Bryan - Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison - Original Message - From: William Dunlap Date: Thursday, September 3, 2009 6:41 pm Subject: RE: [R] Recursion is slow To: Bryan Keller

Re: [R] Recursion is slow

2009-09-03 Thread William Dunlap
g > Subject: [R] Recursion is slow > > The following recursion is about 120 times faster in C#. I > know R is not known for its speed with recursions but I'm > wondering if anyone has a tip about how to speed things up in R. > > #"T" is a vector and "m&

[R] Recursion is slow

2009-09-03 Thread Bryan Keller
The following recursion is about 120 times faster in C#. I know R is not known for its speed with recursions but I'm wondering if anyone has a tip about how to speed things up in R. #"T" is a vector and "m" is a number between 1 and sum(T) A <- function(T,m) { lt <- length(T) if (lt == 1) {