I am working on a data set that has multiple traffic speed measurements per day. My data is from the city of chicago, and it is taken every minute for about six months. I wanted to consolidate this data into days only, so this is what I did:
traffic <- read.csv("path.csv",header=TRUE) traffic2 <- aggregate(SPEED~DATE, data=traffic, FUN=MEAN)
this was perfect because it took all of my data and averaged it by date. For example, my original data looked something like this:
DATE SPEED 12/31/2012 22 12/31/2012 25 12/31/2012 23 ...
and the final looked like this:
DATE SPEED 10/1/2012 22 10/2/2012 23 10/3/2012 22 ...
The only problem, is my data is supposed to start at 9/1/2012. I plotted this data, and it turns out the data goes from 10/1/2012-12/31/2012 and then 9/1/2012-9/30/2012.
What in the world is going on here?