[R] Zeitreihen problem
    Wojtek Musial 
    wmusial at gmx.de
       
    Mon May 12 03:47:33 CEST 2003
    
    
  
Hallo!
I lese große Zeitreihen in R ein z.B. mit:
> disc<-read.table("F:/R/DATA/discount_rate_usa.txt")
disc hat dann folgende Struktur:
> disc[1:5]
           V1       V2
1  01/03/1955 1.5
2  01/04/1955 1.5
3  01/05/1955 1.5
4  01/06/1955 1.5
5  01/07/1955 1.5
ich will das disc als Zeitreihe erkannt wird und will z.B 01/03/1955 in ein
Datum verwandeln, aber es wird als factor aufgefasst:
> disc[1,1]
[1] 01/03/1955
17647 Levels: 01/01/1956 01/01/1957 01/01/1958 01/01/1959 ... 12/31/2002
Wie kann ich z.B. disc[1,1] in ein Datum verwandeln?
Mit as.date() geht es nicht:
> library(survival)
> as.date(disc[1,1])
Error in as.date(disc[1, 1]) : Cannot coerce to date format
Danke im Vorraus!
    
    
More information about the R-help
mailing list