Skip to contents

This function retrieves trip details from the Pelagic Data API for a specified time range, with options to filter by IMEIs and include additional information.

Usage

get_trips(
  token = NULL,
  secret = NULL,
  dateFrom = NULL,
  dateTo = NULL,
  imeis = NULL,
  deviceInfo = FALSE,
  withLastSeen = FALSE,
  tags = NULL
)

Arguments

token

Character string. The API token for authentication.

secret

Character string. The API secret for authentication.

dateFrom

Character string. Start date in 'YYYY-MM-dd' format.

dateTo

Character string. End date in 'YYYY-MM-dd' format.

imeis

Character vector. Optional. Filter by IMEI numbers.

deviceInfo

Logical. If TRUE, include device IMEI and ID fields in the response. Default is FALSE.

withLastSeen

Logical. If TRUE, include device last seen date in the response. Default is FALSE.

tags

Character vector. Optional. Filter by trip tags.

Value

A data frame containing trip details.

Examples

if (FALSE) { # \dontrun{
trips <- get_trips(
  token = "your_token",
  secret = "your_secret",
  dateFrom = "2020-05-01",
  dateTo = "2020-05-03",
  imeis = c("123456789", "987654321"),
  deviceInfo = TRUE,
  withLastSeen = TRUE,
  tags = c("tag1", "tag2")
)
} # }