Re: [R] Confused: Looping in dataframes

2010-06-25 Thread phani kishan
Hey, I only got the output once cuz I was returning from the function at the end of one loop. I set that right and I have printed the values. function being used by me now is: function(x) { for(i in 1:length(x)) { print(names(x[i])) print(myets(x[[i]])) } } where myets is my customized exponentia

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread David Winsemius
On Jun 25, 2010, at 7:09 AM, phani kishan wrote: On Fri, Jun 25, 2010 at 1:54 PM, Paul Hiemstra wrote: On 06/25/2010 10:02 AM, phani kishan wrote: Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential smoothing for each of

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread phani kishan
On Fri, Jun 25, 2010 at 1:54 PM, Paul Hiemstra wrote: > On 06/25/2010 10:02 AM, phani kishan wrote: > >> Hey, >> I have a data frame x which consists of say 10 vectors. I essentially want >> to find out the best fit exponential smoothing for each of the vectors. >> >> The problem while I'm gettin

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread Paul Hiemstra
On 06/25/2010 10:02 AM, phani kishan wrote: Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential smoothing for each of the vectors. The problem while I'm getting results when i say lapply(x,ets) I am getting an error whe

[R] Confused: Looping in dataframes

2010-06-25 Thread phani kishan
Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential smoothing for each of the vectors. The problem while I'm getting results when i say > lapply(x,ets) I am getting an error when I say >> myprint function(x) { for(i in 1:length(x))