R/create_flag.R

Defines functions create_flag

create_flag <- function(x, thr) {
  x <- as.data.frame(x)
  motion_lgl <- apply(x, 2, function(x) abs(x) >= thr)
  flag <- as.numeric(rowSums(motion_lgl) > 0) %>%
    as.data.frame()
  return(flag)
}
epongpipat/ppi documentation built on Jan. 31, 2024, 1:02 p.m.