Command Reference : Command Reference
  
 
ttom
Convert table to matrix object.
Table-TO-Matrix Object: fills the matrix, m1, with the numeric 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.
Syntax
ttom(o1, o2[, range="cell_range", keepna])
where o1 is a table object in the current workfile, or an object view command that creates a table view from an object, o2 is a corresponding vector, svector, or matrix, range is an optional range of cells, and a non-zero value for keepna may be used to indicate that missing values should be retained. By default any row or column of the table that does not contain numbers will be dropped from the matrix.
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.
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
See also mtos, @convert, stom, and stomna.