Re: [R] Convert data frame containing time stamps to time series

2009-04-09 Thread amvds
What is zoo? I cannot find anything about zoo int he documentation. I did try as.ts() see below. Thank you, Alex van der Spek > have you tried using zoo and then using the function as.ts() > > On Wed, Apr 8, 2009 at 11:56 AM, wrote: >> Converting dates is getting stranger still. I am coercing

Re: [R] Convert data frame containing time stamps to time series

2009-04-08 Thread stephen sefick
have you tried using zoo and then using the function as.ts() On Wed, Apr 8, 2009 at 11:56 AM, wrote: > Converting dates is getting stranger still. I am coercing a data frame > into a ts as follows: > > > tst1<-as.POSIXct("1/21/09 5:01",format="%m/%d/%y %H:%M") > tst2<-as.POSIXct("1/28/09 3:40",f

Re: [R] Convert data frame containing time stamps to time series

2009-04-08 Thread amvds
Converting dates is getting stranger still. I am coercing a data frame into a ts as follows: tst1<-as.POSIXct("1/21/09 5:01",format="%m/%d/%y %H:%M") tst2<-as.POSIXct("1/28/09 3:40",format="%m/%d/%y %H:%M") tsdat<-as.ts(dat,start=tst1,end=tst2,frequency=1) This generates a ts object. But strange

Re: [R] Convert data frame containing time stamps to time series

2009-04-08 Thread Gabor Grothendieck
Try varying the arguments to this to accommodate the precise format of your data. See the three zoo vignettes, ?read.zoo and R News 4/1 for dates and times. > Lines <- "t,f,p,d,o,s,a,l,c + 1/21/09 5:01,16151,8.2,76,30,282,1060,53,7 + 1/21/09 5:02,16256,8.3,76,23,282,1059,54,7 + 1/21/09 5:03,16150

[R] Convert data frame containing time stamps to time series

2009-04-08 Thread amvds
I read records using scan: dat<-data.frame(scan(file="KDA.csv",what=list(t="%m/%d/%y %H:%M",f=0,p=0,d=0,o=0,s=0,a=0,l=0,c=0),skip=2,sep=",",nmax=np,flush=TRUE,na.strings=c("I/OTimeout","ArcOff-line"))) which results in: > dat[1:5,] t fp d o sa l c 1 1/21/09 5:01 161