Function to bin data based on a vector of bin separators, e.g. for use in VPC
bin_data(x, bins = c(0, 3, 5, 7), idv = "time", labeled = F)
data
numeric vector specifying bin separators
variable in the data specifies the independent variable (e.g. "time")
whether a labeled factor instead of integers should be returned