R/yx_isp.f.R

Defines functions yx_isp.f

Documented in yx_isp.f

#' @title diameter using interpolating splines
#' @description Internal function not usually called by users
#' @param x relative height
#' @param x.grd relative heights for interpolation
#' @param y.grd diameter of taper curve at relative heights \code{x.grd} for
#' interpolation
#' @param ... not currently used
#'
#' @return estimated diameter based on natural interpolating spline 
#' (\code{\link[stats]{splinefun}})
#' @author Edgar Kublin
#' @importFrom stats spline 

yx_isp.f <-
function(x, x.grd, y.grd, ...){

		 y = spline(xout = c(x), x = x.grd, y = y.grd, method = "natural", ties = mean)$y
	#	 y = predict(interpSpline( x = x.grd, y = y.grd),x=x)$y

		 return(y)
	}

Try the TapeR package in your browser

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

TapeR documentation built on Aug. 16, 2023, 9:07 a.m.