VMD Extension Functions
|
Functions | |
transpose matrix | |
lseq from to ?step? | |
arrayIndices arr | |
printTable ll ?prepend? ?ch? ?fmt? | |
printArray tmp ?prepend? ?ch? ?fmt? | |
reshapeLongToArray table | |
reshapeArrayToWide tmp | |
reshapeLongToWide table | |
reshapeArrayToLong tmp | |
Miscellaneous TCL data-structure related operations.
arrayIndices | arr | ||
Given an array indexed by A,B pairs, return sorted row and column indices.
lseq | from to ?step? | ||
Sequence of integers from $from to $to, step by $step
printArray | tmp ?prepend? ?ch? ?fmt? | ||
Pretty-print an array, prepending rows and columns
printTable | ll ?prepend? ?ch? ?fmt? | ||
Pretty-print a 2D array (list of lists). Each line is prepended by the optional "extra" argument, a string, and output on the given channel (stdout if not given).
reshapeArrayToLong | tmp | ||
Reverse of reshapeLongToWide
reshapeArrayToWide | tmp | ||
Reshape array format into "wide". No order is assumed.
reshapeLongToArray | table | ||
Reshape a matrix in "long" format into an array format. No order is assumed. Returns a list containing: 1. the serialized array; 2. the list of rows (first index); 3. the list of columns (second index). This is a convenient matrix format for interchanging data.
reshapeLongToWide | table | ||
Reshape a matrix in "long" format into a "wide" (rectangular) format The first column will be used as row index, the second as column. No order is assumed.
transpose | matrix | ||
Transpose a 2D table (list of lists). From [[http://wiki.tcl.tk/2748]]