x <- "3"
expect_true(is_scalar_convertible2numeric(as.vector(x)))
expect_true(is_scalar_convertible2numeric(as.list(x)))
expect_true(is_scalar_convertible2numeric(as.array(x)))
expect_true(is_scalar_convertible2numeric(as.matrix(x)))
x <- as.character(1:24)
expect_error(is_scalar_convertible2numeric(x))
expect_true(is_scalar_convertible2numeric(x[3]))
dim(x) <- c(6, 4)
expect_error(is_scalar_convertible2numeric(x))
expect_true(is_scalar_convertible2numeric(x[1, 2]))
dim(x) <- c(2, 3, 4)
expect_error(is_scalar_convertible2numeric(x))
expect_true(is_scalar_convertible2numeric(x[1, 2, 3]))

x <- LETTERS[1:24]
expect_error(is_scalar_convertible2numeric(x))
expect_false(is_scalar_convertible2numeric(x[3]))
dim(x) <- c(6, 4)
expect_error(is_scalar_convertible2numeric(x))
expect_false(is_scalar_convertible2numeric(x[1, 2]))
dim(x) <- c(2, 3, 4)
expect_error(is_scalar_convertible2numeric(x))
expect_false(is_scalar_convertible2numeric(x[1, 2, 3]))
