View source: R/linear_interpolation_with_time_limit.R
linear_interpolation_with_time_limit | R Documentation |
Linear interpolation limited by time since previous or following reading
linear_interpolation_with_time_limit(time, x, ti, threshold)
time |
time for x (time, POSIXct) |
x |
any quantity, for example discharge (double) |
ti |
time where time(x) will be interpolated to (time, POSIXct) |
threshold |
maximum duration where interpolation is allowed (hours) |
a data frame with time (ti), x interpolated from time(x) onto ti, and logical (ibad) if interpolation exceeded threshold
Daniel Livsey (2023) ORCID: 0000-0002-2028-6128
Dowle M, and others (2023). data.table: Extension of 'data.frame'. https://cran.r-project.org/web/packages/data.table
InputData <- realTimeloads::ExampleData
ADCP <- InputData$ADCP
Height <- InputData$Height
# Interpolate river height to ADCP time
time <- realTimeloads::ExampleData$Height$time
x <- realTimeloads::ExampleData$Height$Height_m
ti <-realTimeloads::ExampleData$ADCP$time
threshold <- 1
Output<- linear_interpolation_with_time_limit(time,x,ti,threshold)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.