Description Usage Arguments Value Author(s) See Also Examples
A numerical vector consists only of identical values
1 | is.constant(x)
|
x |
a vector |
TRUE if x is numerical and $\max(x) == \min(x)$.
Kjetil Brinchmann Halvorsen, kjetil@acelerate.com, expanded by Christian W. Hoffmann <christian.hoffmann@wsl.ch>
1 2 3 4 5 6 7 | is.constant(rep(c(sin(pi/2),1),10)) # TRUE
x <- factor(c(1,1,NA))
is.constant(x) # FALSE because of NA
is.constant(x[1:2]) # TRUE
is.constant(c(1,1,NA)) # FALSE because of NA
is.constant(c(1,1,2)) # FALSE
is.constant(c(1,1,1)) # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.