Displaying 2 results from an estimated 2 matches for "fivemin".
Did you mean:
filein
2010 Mar 10
3
Help with aggregate and cor
...between 'Mar 1, 2007' and 'Apr 1, 2007')
group by id,tshour order by id,tshour;
I've pulled data from PostgreSQL into R, and have a dataframe
containing a timestamp column, v, and o (both numeric).
I created an grouping index for every 5 minutes along these lines:
obsfivemin <- trunc(obsts,units="hours")
+( floor( (obsts$min / 5 ) ) * 5 * 60 )
(where obsts is the sql timestamp converted into a DateTime object)
Then I tried aggregate(df,by=obsfivemin,cor), but that seemed to pass
just a single column at a time to cor, not the entire dat...
2011 Sep 01
3
Oh apply functions, how you confuse me
...data.frame(Id=2009:2016,Dir=rep(c("NB","NB","SB","SB"),252),Mph=runif(1008,0,65),
Volume=runif(1008,0,19),Hour=rep(01,1008),Min5Break=rep(1:12,84),Day=rep(2,1008)))
#Example calc
Results_<-list()
#Sum Volume by 5 minute break by Day by Direction
Results_$FiveMin.Direction<-tapply(Df..$Volume,list(Df..$Min5Break,Df..$Day,Df..$Hour,Df..$Dir),sum)
The data is a snap shot of what im working with and I am trying to get to
something similar to the last line where the volumes are summed. What i
want to do is to do a weighted average for the speed by 5 minute...