TABLE OF CONTENTS
splineUtils/mysplineDesign [ Functions ]
NAME
mysplineDesign --- works like splineDesign()
FUNCTION
a plug-in replacement for splineDesign() in the splines package. It calls the same internal code, but skips the input error checking and reformatting. This should only be called with known-good input.
SYNOPSIS
1668 mysplineDesign <- function (knots, x, ord = 4)
INPUTS
knots knots in the format required by splineDesign x set of observations at which the basis should be evaluated ord spline order
OUTPUTS
a spline basis matrix in which entry (i,j) contains the j-th basis function evaluated at x[i]
SOURCE
1671 { 1672 nk <- length(knots) 1673 x <- as.numeric(x) 1674 derivs <- integer(1) 1675 # call the internal function used by splineDesign() 1676 temp <- .Call("spline_basis", knots, ord, x, derivs, PACKAGE = "splines") 1677 ncoef <- nk - ord 1678 design <- rep(0, ncoef) 1679 jj <- 1:ord + attr(temp, "Offsets") 1680 design[jj] <- temp 1681 dim(design) <- c(1, ncoef) 1682 design 1683 }