File: test-extract.R

package info (click to toggle)
r-cran-splines2 0.5.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,020 kB
  • sloc: cpp: 3,232; sh: 13; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 376 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
## test the $ method
x <- c(NA, seq.int(0, 0.5, 0.1), NA, seq.int(0.6, 1, 0.1), NA)
knots <- c(0.25, 0.5, 0.75)
b_knots <- c(0, 1)

res <- bSpline(x, df = 6)
expect_equal(res$knots, knots(res))
expect_equal(res$Boundary.knots, b_knots)
expect_equal(res$degree, 3L)
expect_equal(res$derivs, 0L)
expect_false(res$integral)
expect_false(res$periodic)
expect_false(res$intercept)