library(graphics)
x <- seq(0, 1, by = 0.01)
knots <- c(0.3, 0.5, 0.6)
bsMat <- bSpline(x, knots = knots, degree = 0, intercept = TRUE)
matplot(x, bsMat, type = "l", ylab = "B-spline basis with degree zero")
abline(v = knots, lty = 2, col = "gray")
Run the code above in your browser using DataLab