is_scalar | R Documentation |
R is vector based. But I often come across vectors of length 1 or arrays and matrices with a single element.
is_scalar(x)
x |
An R object. |
A boolean.
Other logical helpers:
get_run_r_tests()
,
is_batch()
,
is_cran()
,
is_false()
,
is_force()
,
is_installed()
,
is_not_false()
,
is_null_or_true()
,
is_of_length_zero()
,
is_r_cmd_check()
,
is_r_package_installed()
,
is_running_on_fvafrcu_machines()
,
is_running_on_gitlab_com()
,
is_scalar_convertible2numeric()
,
is_success()
,
is_true()
,
is_version_sufficient()
,
is_windows()
x <- "C"
is_scalar(x)
x <- LETTERS[1:24]
!is_scalar(x)
is_scalar(x[3])
dim(x) <- c(6, 4)
!is_scalar(x)
is_scalar(x[1, 2])
dim(x) <- c(2, 3, 4)
!is_scalar(x)
is_scalar(x[1, 2, 3])
is_scalar(list(1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.