constant | R Documentation |
Check if formula contains constant
constant(x)
x |
formula |
Primitive function to check a formula for a constant part. Function checks first and last term on rhs for constant variables at front and back position.
## Not run:
constant(y ~ x + a * z) # x
constant(y ~ x * b + 1) # 1
constant(y ~ 0 + x) # NULL
constant(y ~ x) # x
constant(y ~ x1 * b1 + b0 + x2 * b2) # wont find b0
constant( y ~ (x*b +k) + a*y + b*z ) # wont find k
constant( y ~ (k+ x*b) + a*y + b*z ) # k
constant( y ~ a*y + b*z + (k + x*b) ) # wont find k
constant( y ~ a*y + b*z + (x*b + k) ) # k
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.