divide: Divide Events/Sensors objects by deployment IDs

divideR Documentation

Divide Events/Sensors objects by deployment IDs

Description

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

Usage

divide(object, deployids)

## S4 method for signature 'Events'
divide(object, deployids)

## S4 method for signature '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]])
# A Sensors object with the remaining five deployments
deployments(divided_sensors[[2]])


FlukeAndFeather/rstickleback documentation built on June 23, 2022, 1:17 p.m.