Skip to content
Prev 3963 / 15274 Next

Dates manipulation

Just one follow up.  Using the recent addition of the read.zoo
split= argument in the devel version of read.zoo we can
simplify this even further to:
+ "Date    Ticker  Price
+ 2009-04-21      X       2.32
+ 2009-04-22      X       2.35
+ 2009-04-23      X       2.34
+ 2009-04-21      Y       10.2
+ 2009-04-23      Y       10.15 "
X     Y
2009-04-21 2.32 10.20
2009-04-22 2.35    NA
2009-04-23 2.34 10.15

In the above split = 2 causes the rows to be split according to the conditioning
variable in column 2 and then merges them back together essentially
reshaping the input from long format to wide format (using the same terminology
used by the reshape command in the core of R).

On Mon, Apr 27, 2009 at 10:13 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote: