R/knots.fd.R

Defines functions knots.fdSmooth knots.fd knots.basisfd

Documented in knots.basisfd knots.fd knots.fdSmooth

knots.basisfd <- function(Fn, interior = TRUE, ...) {
##
## 1.  object$type = 'bspline'?
##
  type <- Fn$type
  oName <- substring(deparse(substitute(Fn)), 1, 33)
  if(is.null(type))
    stop('is.null((', oName, ')$type);  must be "bspline"') 
  if(type != 'bspline')
    stop('(', oName, ')$type) = ', type[1], ';  must be "bspline"')
##
## 2.  knots
##
  int <- Fn$params
  if(interior) return(int)
#
  nord <- norder(Fn)
  rng <- Fn$rangeval 
  allKnots <- c(rep(rng[1], nord), int, rep(rng[2], nord))
  return(allKnots) 
}

knots.fd <- function(Fn, interior=TRUE, ...){
  knots(Fn$basis, interior=interior, ...)
}
knots.fdSmooth <- function(Fn, interior=TRUE, ...){
  knots(Fn$fd, interior=interior, ...)
} 

Try the fda package in your browser

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

fda documentation built on May 31, 2023, 9:19 p.m.