| reso_dm | R Documentation |
Determines the average temporal resolution (in minutes) of a time series vector (e.g., dendrometer timestamps) and detects inconsistencies in time intervals. If the time column is character-formatted, it is automatically converted to POSIXct. Any inconsistent intervals are flagged and printed.
reso_dm(input_time)
input_time |
A vector of class |
This function is helpful for checking if a time series (especially dendrometer data) is regularly sampled. It handles both regular and irregular timestamps and gives feedback if the resolution changes.
A single integer: the estimated (rounded) average resolution in minutes. If multiple intervals are detected, a warning and index positions are printed.
## Not run:
# Regular 30-minute time sequence
time_seq <- seq.POSIXt(from = as.POSIXct("2023-06-01 00:00:00"),
by = "30 min", length.out = 100)
reso_dm(time_seq) # Should return 30
# With character time input
time_char <- format(time_seq, format = "%Y-%m-%d %H:%M:%S")
reso_dm(time_char) # Auto converts to POSIXct
# Introduce an irregular step
time_seq[51] <- time_seq[50] + 60 # One-time 1-hour jump
reso_dm(time_seq) # Should print warning and irregular step index
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.