## Example given in the reference paper by Ramsay (1988)
library(graphics)
x <- seq(0, 1, by = .01)
knots <- c(0.3, 0.5, 0.6)
mMat <- mSpline(x, knots = knots, degree = 2, intercept = TRUE)
matplot(x, mMat, type = "l", ylab = "M-spline basis")
abline(v = knots, lty = 2, col = "gray")
Run the code above in your browser using DataLab