symbol_is_matrix: Check if object is a caracas matrix

View source: R/lin_alg.R View source: R/coerce.R

symbol_is_matrixR Documentation

Check if object is a caracas matrix

Description

Check if object is a caracas matrix

Usage

symbol_is_matrix(x)

Arguments

x

An object

Examples


if (has_sympy() && sympy_version() >= "1.6") {
  x <- vector_sym(4)
  symbol_is_matrix(x)   ## TRUE
  x2 <- as.character(x) ## "Matrix([[v1], [v2], [v3], [v4]])"
  symbol_is_matrix(x2)  ## TRUE
  x3 <- as_character_matrix(x) ## R matrix
  symbol_is_matrix(x3)  ## FALSE 
}


caracas documentation built on June 22, 2024, 10:59 a.m.