Useful for dividing bio-logging sensor data (Sensors) and behavioral event data (Events) into test-train sets.

divide(object, deployids)

# S4 method for Events
divide(object, deployids)

# S4 method for Sensors
divide(object, deployids)

Arguments

object

[Events/Sensors] An Events or Sensors object.

deployids

[character] The deployment IDs to divide on. Each ID must be a deployment in object. Deployments with IDs in deployids will end up in one Events/Sensors object, the remaining deployments will be in another.

Value

[list(Events/Sensors)] A list of two Events/Sensors objects. The first list element contains the deployments with IDs in deployids, the second element contains the remainder.

Examples

c(lunge_sensors, lunge_events) %<-% load_lunges()
divided_sensors <- divide(lunge_sensors, "bw180905-53")
# A Sensors object with *only* deployment "bw180905-53"
deployments(divided_sensors[[1]])
#> [1] "bw180905-53"
# A Sensors object with the remaining five deployments
deployments(divided_sensors[[2]])
#> [1] "bw180905-49" "bw180905-42" "bw180904-52" "bw180904-48" "bw180904-44"