interpolateCond | R Documentation |
Interpolate variables of conditions
interpolateCond(conditions, method)
conditions |
|
method |
|
The function is a wrapper of approxfun
.
Return a list of functions that interpolate variable according to time. Functions have only v
as an argument which represent the time vector at which the function is to be interpolated. The names
attribute of the list correspond to the variable names.
#Example of a call with two variables conditions <- data.frame(time = seq(0,30,length.out = 10), temp = rnorm(10, 10, 5), rh = rnorm(10, 10, 5)) f <- interpolateCond(conditions, method = "constant") f #Plotting the result for temp plot(conditions$time,conditions$temp) x <- seq(0,30,length.out = 100) lines(x,f$temp(x), lty = 1) f <- interpolateCond(conditions, method = "spline") #Plotting the result for temp plot(conditions$time,conditions$temp) x <- seq(0,30,length.out = 100) lines(x,f$temp(x), lty = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.