Re: [R] dataframe to a timeseries object

2011-03-14 Thread Daniele Amberti
sDaply2(X, X$ID) # list is not a timeSeries object str(cbind(t(res))) res <- as.timeSeries(cbind(t(res))) -Original Message- From: h.wick...@gmail.com [mailto:h.wick...@gmail.com] On Behalf Of Hadley Wickham Sent: 14 March 2011 15:07 To: Daniele Amberti Cc: r-help@r-project.org Subjec

Re: [R] dataframe to a timeseries object

2011-03-14 Thread Hadley Wickham
>  res <- daply(X, "ID", buildTimeSeriesFromDataFrame2, .parallel = FALSE) >  return(res) > } > # tsDaply2 .parallel = FALSE work but list discart timeSeries class > > # bind after ts creation > res <- tsDaply2(X, X$ID) > # list is not a timeSeries object &g

Re: [R] dataframe to a timeseries object

2011-03-14 Thread Daniele Amberti
orkers(w) -----Original Message- From: h.wick...@gmail.com [mailto:h.wick...@gmail.com] On Behalf Of Hadley Wickham Sent: 14 March 2011 12:48 To: Daniele Amberti Cc: r-help@r-project.org Subject: Re: [R] dataframe to a timeseries object - [ ] Message is from an unknown sender Well, I'd start

Re: [R] dataframe to a timeseries object

2011-03-14 Thread Hadley Wickham
Well, I'd start by removing all explicit use of environments, which makes you code very hard to follow. Hadley On Monday, March 14, 2011, Daniele Amberti wrote: > I found that plyr:::daply is more efficient than base:::by (am I doing > something wrong?), below updated code for comparison (I als

Re: [R] dataframe to a timeseries object

2011-03-14 Thread Daniele Amberti
I found that plyr:::daply is more efficient than base:::by (am I doing something wrong?), below updated code for comparison (I also fixed a couple things). Function daply from plyr package has also a .parallel argument and I wonder if creating timeseries objects in parallel and then combining th

[R] dataframe to a timeseries object

2011-03-11 Thread Daniele Amberti
I’m wondering which is the most efficient (time, than memory usage) way to obtain a multivariate time series object from a data frame (the easiest data structure to get data from a database trough RODBC). I have a starting point using timeSeries or xts library (these libraries can handle time zo