Skip to content
Prev 176141 / 398503 Next

Filling in Gapped Interval of a Data Frame As Series

Try this:
+   -6      20.2
+   -1      1.5
+    2      3.00
+    3      78.8
+    5      33.2
+    6      44.5
+    7     5.00"
-8    -7    -6    -5    -4    -3    -2    -1     0     1     2     3     4
100.0   0.0  20.2   0.0   0.0   0.0   0.0   1.5   0.0   0.0   3.0  78.8   0.0
    5     6     7
 33.2  44.5   5.0


If you want to create a data frame from that try this:

newDF <- data.frame(Time = time(zz), Value = coredata(zz))

although you might be best off to just leave it as a zoo object
so that you can make use of other zoo methods too.
See the three zoo vignettes (PDF documents) for more info.
On Sun, Apr 5, 2009 at 3:22 AM, Gundala Viswanath <gundalav at gmail.com> wrote: