R/LinInterp.R

Defines functions LinInterp

Documented in LinInterp

LinInterp <-
function(xin,yin,xout,mode='data')
{
yout=NULL
for(i in xout){

	if(i %in% xin){
		yout=c(yout,yin[xin==i])
	}else{
		f=switch(mode,jump='ordered',data=mean,all='ordered')
		yout=c(yout,approx(xin,yin,i,ties=f)$y)
	}
}
return(yout)

}

Try the TauP.R package in your browser

Any scripts or data that you put into this service are public.

TauP.R documentation built on May 2, 2019, 3:25 a.m.