is_multidim: Test if an object is multi-dimensional

Description Usage Arguments Value See Also Examples

Description

Returns TRUE if an object is a matrix or data frame with at least 2 rows and at least 2 columns, FALSE otherwise

Usage

1

Arguments

x

an R object

Value

whether x is multi-dimensional

See Also

is_one_dim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# general matrix (nrow>1, ncol>1)
is_multidim(matrix(1:9, 3, 3))  # TRUE

# general data frame
is_multidim(iris)  # TRUE

# vector
is_multidim(1:5)  # FALSE

# factor
is_multidim(iris$Species)  # FALSE

# one row matrix
is_multidim(matrix(1:5, 1, 5))  # FALSE

# one column matrix
is_multidim(matrix(1:5, 5, 1))  # FALSE

gastonstat/tester documentation built on May 16, 2019, 6:38 p.m.