Try:

xts(data[,-1],as.Date(data[,1]))

HTH
Jeff

On Dec 5, 2008 7:50am, sprohl@na.uni-tuebingen.de wrote:
> Hello Brian,
>
> please find attached sample of the data
>
> data[1:5,]
>
> X2002.07.01 X0.0071
>
> 1 2002-07-02 0.0072
>
> 2 2002-07-03 0.0072
>
> 3 2002-07-04 0.0073
>
> 4 2002-07-05 0.0073
>
> 5 2002-07-08 0.0073
>
> str(data)
>
> 'data.frame': 1503 obs. of 2 variables:
>
> $ X2002.07.01: Factor w/ 1503 levels "2002-07-02","2002-07-03",..: 1 2 3
>
> 4 5 6 7 8 9 10 ...
>
> $ X0.0071 : num 0.0072 0.0072 0.0073 0.0073 0.0073 0.0073 0.0073
>
> 0.0073 0.0073 0.0074 ...
>
> datas
> Fehler in as.POSIXlt.character(x, tz, ...) :
>
> character string is not in a standard unambiguous format
>
>
>
> How could I convert the data to xts?
>
> Thank in advance,
>
> Soeren
>
>
>
>
>
>
>
>
>
>
>
> Please attach a short sample of your data file that replicates your error.
>
> >
>
> > sprohl@na.uni-tuebingen.de wrote:
>
> >> Dear All,
>
> >> I have some problems with downloading and matching daily data
>
> >> of irregular frequency. I tried to apply zoo-codes to read file
>
> >>
>
> >> data
> >> and get the following message:
>
> >>
>
> >> Fehler in scan(file, what, nmax, sep, dec, quote, skip, nlines,
>
> >> na.strings, : Zeile 31 hatte keine 2 Elemente
>
> >>
>
> >> The data has missing values. How could I properly download them as
>
> >> time series and match different datasets by "Date". Unfrtunately,
>
> >> conventional procedures do not work properly.
>
> >> Thanks in advance,
>
> >> Soeren
>
> >
>
> >
>
> > --
>
> > Brian G. Peterson
>
> > http://braverock.com/brian/
>
> > Ph: 773-459-4973
>
> > IM: bgpbraverock
>
> >
>
>
>
> _______________________________________________
>
> R-SIG-Finance@stat.math.ethz.ch mailing list
>
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>
> -- Subscriber-posting only.
>
> -- If you want to post, subscribe first.
>

	[[alternative HTML version deleted]]

