# NOT RUN {
set.seed(1)
met <- data.table::data.table(id = 1:5,
condition = letters[1:5],
sex = c("M", "M", "M", "F", "F"),
key = "id")
data <- met[,
list(t = 1L:100L,
x = rnorm(100),
y = rnorm(100),
eating = runif(100) > .5 ),
by = "id"]
d <- behavr(data, met)
summary_d <- d[, .(test = mean(x)), by = id]
rejoin(summary_d)
# }
Run the code above in your browser using DataLab