R/blob_properties.R

blob_properties <- function(blob, time) {
  data.frame(time = time,
             id = unique(blob$group),
             x = aggregate(col ~ group, data = blob, FUN = mean)[, 2],
             y = aggregate(row ~ group, data = blob, FUN = mean)[, 2],
             size = aggregate(col ~ group, data = blob, FUN = length)[, 2])
}
swarm-lab/videotrackR documentation built on May 30, 2019, 9:37 p.m.