View source: R/ff_interpolate.R
interpolate | R Documentation |
This function applies interpolation to fill in missing (or non-recorded) values.
interpolate(
x,
col_name,
out_name = NULL,
miss_table,
threshold,
method = "linear"
)
x |
data frame with class |
col_name |
string with column name of the series to interpolate. |
out_name |
optional. String with new column name. If you set
it as |
miss_table |
data frame with three columns: first and last date
of interpolation (first and second column respectively). The last and
third column, is of class |
threshold |
numeric variable with the maximum number of dates in which to apply the interpolation. |
method |
string with the interpolation method. In this version only
|
The same data frame but with interpolated values.
# read cuevas station file
path <- system.file('extdata', 'ianigla_cuevas.csv',
package = 'hydrotoolbox')
cuevas <- read_ianigla(path = path)
# get the miss_table
miss_data <- report_miss(x = cuevas, col_name = 'Irradiancia')[[1]]
# apply interpolation function when gap is less than 3 hours
cuevas_interpo <- interpolate(x = cuevas,
col_name = 'Irradiancia',
out_name = 'kin_interpo',
miss_table = miss_data,
threshold = 3)
report_miss(x = cuevas_interpo,
col_name = c('Irradiancia', 'kin_interpo'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.