R/y2x_ssp.f.R

Defines functions y2x_ssp.f

Documented in y2x_ssp.f

#' @title squared diameter using smoothing 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 squared estimated diameter based on smoothing splines 
#' (\code{\link[stats]{smooth.spline}})
#' @author Edgar Kublin
#' @importFrom stats smooth.spline predict

y2x_ssp.f <-
function(x, x.grd, y.grd, ...){
  ssp = smooth.spline(x.grd, y.grd)
  return(predict(ssp, x)$y^2)
}

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.