Format time series data frame into a matrix
Usage
ts2mat(
ts,
sensor = "time series",
twl_offset = 0,
value = "value",
twl_time_tolerance = 180
)Arguments
- ts
data.frame of a
tag, containing at leastdateandvalue.- sensor
sensor name used in messages.
- twl_offset
Shift of the middle of the night compared to 00:00 UTC (in hours). If not provided, it uses the middle of all nights.
- value
column name to extract
- twl_time_tolerance
Maximum allowed time difference in seconds between observations and the regular grid. Observations beyond this threshold will be set to NA. Default is 180 seconds (3 minutes).
