R/function.from.vector.R

"function.from.vector" <-
function(x, y, argument.vect) {

	#	x must be in ascending order
	#	the lengths of x and y must match
	#	argument.vect can be a vector
	
	indices <- sapply(argument.vect, which.min.diff, x)
	return(y[indices])
}

Try the DDHFm package in your browser

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

DDHFm documentation built on Nov. 26, 2022, 1:06 a.m.