Skip to contents

Positions are events whose coordinates travel inside payload, a JSON object. This turns one row per fix into that object, keeping every column so nothing the collar recorded is lost, and naming the coordinates so the server finds them whatever your source called them.

Usage

telem_add_payload(data, latitude, longitude)

Arguments

data

A data frame, one row per fix.

latitude

Character. The column holding latitude in decimal degrees.

longitude

Character. The column holding longitude in decimal degrees.

Value

data with a payload list-column added. Source columns are kept, so the rest of a pipeline can still reach them.

Details

Most positions never go through this: the server collects them from the manufacturer's API on a schedule. This is for positions you hold locally and need to upload.

Examples

fixes <- tibble::tibble(
  Latitude = c(51.19, 51.20),
  Longitude = c(-123.4, -123.5),
  Temp = c(-3, -2)
)
telem_add_payload(fixes, "Latitude", "Longitude")$payload[[1]]
#> $latitude
#> [1] 51.19
#> 
#> $longitude
#> [1] -123.4
#> 
#> $Temp
#> [1] -3
#>