Error getting tags :
error 404Error getting tags :
error 404 transpose | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
transpose
Basics
Expander triangle
Type
Function
Syntax
transpose(array)
Introduced
1.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns a two-dimensional array after swapping the order of keys for each element of the array.
Examples

transpose(myArray)
put transpose(censusByHousehold) into censusByGroup

Additional Comments
Expander triangle

Use the transpose function to swap rows and columns in a matrix.

Parameters:

The array is a two-dimensional array variable whose elements are numbers, and whose keys are sequential numbers.

Value:

The transpose function returns an array.

Comments:

A two-dimensional array is an array whose elements have a two-part key to describe them. You can visualize such an array as a set of rows and columns: the first part of each element's key is the row number, and the second part is the column number. For example, the expression myArray[3,2] describes the element of myArray which is in the third row, second column.

The transpose function simply swaps rows for columns. In other words, for each element in the array, the corresponding element in transpose(array) has its two parts switched one for the other. The value in the third row, second column is moved to the second row, third column.

The transpose function is its own inverse: you can transpose a transposed array again to recover the original array.

Important! If the array has missing elements, the transposefunction will fail to work. For example, an array that contains elements myArray[1,1], myArray[1,2], and myArray[2,2] cannot be transposed because the element myArray[2,1] is missing.

User Comments
Expander triangle
User thumbnail
revolution@jaedworks.com
StarStarStarStarStar
Jan 11, 2010
The transpose function works only with the older style of multidimensional array (with a key consisting of multiple items). The old style array looks like this:

myArray[3,2]

. However, it does not work with the new true multidimensional arrays, with multiple keys: myArray[3][2].