ToTable
Converts an object to a table.
Syntax
-
ToTable(X)-
Xis any object
-
Description
If X is any object, ToTable(X) returns X as a table. Specifically:
-
If
Xis a two-dimensional container, like a matrix or a pixmap, thenToTable(X)is the table with entries being the elements ofXconverted to strings using thestringfunction. -
If
Xis a string, then it is split into rows and columns by splitting on CRLF and TAB, respectively. -
If
Xis a two-dimensional nested list, thenToTable(X)returns the table with entries being the second-level elements ofXconverted to strings using theAsSingleLinefunction. -
If none of the above applies and
Xis a one-dimensional container (such as a vector or a list), thenToString(X)is the column table consisting of the entries obtained fromXby means ofstring. -
Otherwise, the result is a single-cell (1×1) table with text
string(X).
Examples
T ≔ compute(a⋅b, a, 1, 12, b, 1, 12); for(i, 1, 12, VarInsert(T[i], 1, i)); VarInsert(T, 1, SequenceList(0, 12)); T[1][1] ≔ "×"; display(ToTable(T))

See also
-
Type conversion functions (list)