Command Reference : Matrix Language Reference
  
 
ttom
Convert table to matrix.
Syntax: ttom(o1, o2[, range="cell_range", keepna])
Argument 1: table or object table view, o1
Argument 2: vector or matrix, o2
Argument 3: (optional) string containing a table cell range
Argument 4: (optional) option to keep rows and columns containing all NAs.
Table-TO-Matrix Object. ttom fills the matrix, m1, with the numerical values contained in the table o1. m1 will be resized appropriately. o1 may be a table object in the current workfile, or an object view command that creates a table view from an object.
If the “range=” option is provided, a subset of the cells of the table will be converted, where cell_range can take one of the following forms:
 
@all
Apply to all cells in the table.
cell
Cell identifier. You can identify cells using either the column letter and row number (e.g., “A1”), or by using “R” followed by the row number followed by “C” and the column number (e.g., “R1C2”).
row[,] col
Row number, followed by column letter or number (e.g., “2,C”, or “2,3”), separated by “,”. Apply to cell.
row
Row number (e.g., “2”). Apply to all cells in the row.
col
Column letter (e.g., “B”). Apply to all cells in the column.
first_cell[:]last_cell, first_cell[,]last_cell
Top left cell of the selection range (specified in “cell” format), followed by bottom right cell of the selection range (specified in “cell” format), separated by a “:” or “,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”, “R2C1,R10C3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
first_cell_row[,] first_cell_col[,] last_cell_row[,] last_cell_col
Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
By default any row or column of the table that does not contain any numbers will be dropped from the matrix. the keepna option disabled this.
Examples
ttom(table1,matrix1)
Creates a matrix object, MATRIX1, containing the numerical data in the table object TABLE1. Any row or column of the table that contains no numbers (i.e. are blank rows/columns, or only contain text) are skipped in the conversion process.
ttom(table1, matrix1, keepna)
Performs the same conversion, but this time any row or column of the table that contains no numbers are included in the conversion process as a row/column of NAs.
ttom(eq01.wald c(1)=0.3, matrix1)
Performs a Wald test of the restriction C(1)=0.3 from the EQ01, and saves the numerical output from that test in to the matrix object MATRIX1.
Cross-references