is_one_dim.Rd
Returns TRUE
if an object is a vector or a
one-dimensional matrix, FALSE
otherwise
is_one_dim(x)
an R object
whether x is one-dimensional
# vector
is_one_dim(1:5) # TRUE
#> [1] TRUE
# factor
is_one_dim(iris$Species) # TRUE
#> [1] TRUE
# one row matrix
is_one_dim(matrix(1:5, 1, 5)) # TRUE
#> [1] TRUE
# one column matrix
is_one_dim(matrix(1:5, 5, 1)) # TRUE
#> [1] TRUE
# general matrix (nrow>1, ncol>1)
is_one_dim(matrix(1:9, 3, 3)) # FALSE
#> [1] FALSE
# general data frame
is_one_dim(iris) # FALSE
#> [1] FALSE