I am using forecast package for time series analysis. I have a dataset with hourly data from oct 3 2016 to oct 23 2016. I used the following code to convert my data into a time series object.
Dataset is about citibike stations I’m only using 6 stations
I’m not sure if Im supposed to use my time column or include my time column.
This is what i have so far.
data.ts <- ts(CitiBike[,2:7], freq = 504, start = 2016)
#----------------please find below code to convert any date format-------------------------#
date_vector <- as.vector(TSdata$Date)
date_format <- dateformat(date_vector)
print(paste("Date format identified as ",date_format,sep=""))
TSdata$Date <- date_handle(date_vector, date_format)
TSdata <- TSdata[order(TSdata$Date),]
str(TSdata)
#---------------------Transformation of the date data into time series------------------------------------#
TSdata=ts(TSdata[,2],start=c(2003,1),frequency=12)
start(TSdata)
end(TSdata)
frequency(TSdata)
StructTS(TSdata)
TSdata
Get Answers For Free
Most questions answered within 1 hours.