Displaying 1 result from an estimated 1 matches for "interpone".
Did you mean:
interone
2009 May 22
2
Scope problem?
I've just spent today trying to fix a Heisenbug...
this function returns a linear interpolator function:
interpOne <- function(xl,yl){
f = function(data){
t = (data-min(xl))/(max(xl)-min(xl))
return(min(yl)+t*(max(yl)-min(yl)))
}
return(f)
}
> k=interpOne(c(0,1),c(4,5))
> k(0.5)
[1] 4.5
and this function uses the above to return a function that returns a
piece-wise linear interpolator f...