Calculating Start for stl()
I'm reading weekly data from a .csv data file.   A sample of the data is:    

    Date,Demand    
    "Feb 08, 1991",6621    
    "Feb 15, 1991",6433    
    "Feb 22, 1991",6582   
    "Mar 01, 1991",7224   
    "Mar 08, 1991",6875   
    "Mar 15, 1991",6947   
    "Mar 22, 1991",7328   
    "Mar 29, 1991",6777   
    "Apr 05, 1991",7503
    .....  
   

My code is:

    > temp<-read.table(file="E:\\Data\\Demand_00.csv",header=TRUE, sep=",")
    > stadat<-strptime(as.character(temp[,1]),"%b %d, %Y")[1]
    > statim<-as.numeric(strftime(stadat,"%Y"))+(as.numeric(strftime(stadat,"%j"))/366)
    > temdat<-ts(temp[,2],start=statim,frequency=52)
    > plot(temp2<- stl(log(temdat), "per"))

My question is:  Is there a better/cleaner way to build statim (the start required in the above ts object)?   Notice that this is weekly data that may or may not start at the first week of the year.   


Thanks,    
Bill
Calculating Start for stl()
===

I'm reading weekly data from a .csv data file.   A sample of the data is:    

    Date,Demand    
    "Feb 08, 1991",6621    
    "Feb 15, 1991",6433    
    "Feb 22, 1991",6582   
    "Mar 01, 1991",7224   
    "Mar 08, 1991",6875   
    "Mar 15, 1991",6947   
    "Mar 22, 1991",7328   
    "Mar 29, 1991",6777   
    "Apr 05, 1991",7503
    .....  
   

My code is:

    > temp<-read.table(file="E:\\Data\\Demand_00.csv",header=TRUE, sep=",")
    > stadat<-strptime(as.character(temp[,1]),"%b %d, %Y")[1]
    > statim<-as.numeric(strftime(stadat,"%Y"))+(as.numeric(strftime(stadat,"%j"))/366)
    > temdat<-ts(temp[,2],start=statim,frequency=52)
    > plot(temp2<- stl(log(temdat), "per"))

My question is:  Is there a better/cleaner way to build statim (the start required in the above ts object)?   Notice that this is weekly data that may or may not start at the first week of the year.   


Thanks,    
Bill