File: test_anySpecial.R

package info (click to toggle)
r-cran-reformulas 0.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 668 kB
  • sloc: makefile: 2
file content (13 lines) | stat: -rw-r--r-- 373 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
library(reformulas)
library(tinytest)

## shouldn't find 'naked' specials
expect_false(anySpecial(y ~ s))
expect_true(anySpecial(y ~ s(1)))
expect_false(anySpecial(y ~ s[[1]]))
expect_false(anySpecial(y ~ diag))
expect_true(anySpecial(y ~ diag(1)))
expect_false(anySpecial(y ~ diag[[1]]))

anySpecial(y ~ poly, specials = "poly")
anySpecial(y ~ poly(1), specials = "poly")