Skip to contents

This function read an exported csv file from TRAINSET https://trainset.raphaelnussbaumer.com/ and update the twilight data tag$twilight.

Usage

twilight_label_read(
  tag,
  file = glue::glue("./data/twilight-label/{tag$param$id}-labeled.csv")
)

Arguments

tag

a GeoPressureR tag object

file

csv file of the labels to be read.

Value

Same tag object, updated with the labels tag$twilight$label.

See also

Examples

withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
  tag <- tag_create("18LX", quiet = TRUE) |>
    tag_label(quiet = TRUE) |>
    twilight_create()

  tag_labelled <- twilight_label_read(tag)
})

plot(tag, type = "twilight") |> plotly::layout(title = list(text = "Before label"))
str(tag_labelled$twilight) #> 'data.frame': 28 obs. of 4 variables: #> $ twilight: POSIXct, format: "2017-07-27 03:05:00" "2017-07-27 18:30:00" ... #> $ rise : logi TRUE FALSE TRUE FALSE TRUE FALSE ... #> $ stap_id : num 1 1 1 1 1 1 1 1 1 1 ... #> $ label : chr "1" "discard" "discard" "1" ... plot(tag_labelled, type = "twilight") |> plotly::layout(title = list(text = "After label"))