[R] read.zoo issues

Santosh Srinivas santosh.srinivas at gmail.com
Mon Oct 18 10:24:07 CEST 2010


I am getting problems using read.zoo

I have the following data frame

> head(anlyNiftyDat[,1:10])
            TIMESTAMP    ACC AMBUJACEM AXISBANK BAJAJ-AUTO BHARTIARTL
BHEL   BPCL  CAIRN  CIPLA
1 2010-01-04 00:00:00 913.60    106.10   992.10    1732.05     325.20
2426.10 650.75 285.50 337.55
2 2010-01-05 00:00:00 901.75    105.30  1012.80    1740.05     330.35
2435.40 640.95 295.85 331.50
3 2010-01-06 00:00:00 907.60    105.95   995.80    1713.15     326.85
2426.25 631.30 299.45 344.90
4 2010-01-07 00:00:00 913.35    105.80  1002.85    1683.10     329.40
2409.50 619.05 307.85 342.05
5 2010-01-08 00:00:00 912.15    105.90  1015.95    1655.25     325.05
2424.10 629.55 306.15 341.10
6 2010-01-11 00:00:00 915.15    106.10  1049.40    1669.55     328.95
2396.95 627.90 300.15 342.30

> class(anlyNiftyDat)
[1] "cast_df"    "data.frame"
>

> anlyNiftyDatZoo <- read.zoo(anlyNiftyDat,split=2,check.names=F)
> head(anlyNiftyDatZoo[,1:10])
           X805.45.1 X805.45.2 X805.45.3 X805.45.4 X805.45.5 X805.45.6
X805.45.7 X805.45.8 X805.45.9 X805.45.10
2010-01-04        NA        NA        NA        NA        NA        NA
NA        NA        NA         NA
2010-01-05        NA        NA        NA        NA        NA        NA
NA        NA        NA         NA
2010-01-06        NA        NA        NA        NA        NA        NA
NA        NA        NA         NA
2010-01-07        NA        NA        NA        NA        NA        NA
NA        NA        NA         NA
2010-01-08        NA        NA        NA        NA        NA        NA
NA        NA        NA         NA
2010-01-11        NA        NA        NA        NA        NA        NA
NA        NA        NA         NA

Both the column names and values are thrown off.



More information about the R-help mailing list