r - Count number of events in time intervals -


i have dataframe looks this:

+---------+------------+------+  | event # |  time(ms)  | roi  | +---------+------------+------+ |       1 |  86247.912 |    1 | |       2 | 174363.500 |    1 | |       3 | 245536.347 |    2 | +---------+------------+------+... 

where many events assigned single roi (region of interest) label. , want create new data frame each column represents interval of time (e.g. 1000.0 milliseconds) , rows each roi , value in each column number of events fell within time interval. (so can use make correlation matrix/plot). e.g. :

+-----+-----------+-----------+-----------+-----------+--+ | roi | interval1 | interval2 | interval3 | interval4 |  | +-----+-----------+-----------+-----------+-----------+--+ |   1 |         2 |         3 |         1 |         2 |  | |   2 |         4 |         7 |         2 |         1 |  | |   3 |         1 |        11 |        10 |         3 |  | |   4 |         0 |         1 |         0 |         3 |  | +-----+-----------+-----------+-----------+-----------+--+... 

what idiomatic r way this?


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -