Description Arguments See Also Examples
Tests if an object is a scalar number
is_scalar
tests if an object is a scalar
is_not_scalar
tests if an object is not a scalar
is_positive_scalar
tests if an object is a
positive scalar
is_negative_scalar
tests if an
object is a negative scalar
x |
an R object |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | is_scalar(1) # TRUE
is_scalar(pi) # TRUE
is_scalar(1:5) # FALSE
is_scalar(matrix(runif(4), 2, 2)) # FALSE
is_not_scalar(1:5) # TRUE
is_not_scalar(NULL) # TRUE
is_not_scalar(matrix(runif(4), 2, 2)) # TRUE
is_positive_scalar(1.0) # TRUE
is_positive_scalar(0) # FALSE
is_positive_scalar(-10) # FALSE
is_positive_scalar("hoskdflksfd") # FALSE
is_positive_scalar(NA) # FALSE
is_negative_scalar(-1) # TRUE
is_negative_scalar(0) # FALSE
is_negative_scalar(10) # FALSE
is_negative_scalar("hoskdflksfd") # FALSE
is_negative_scalar(NA) # FALSE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.