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
Post a Comment