linalg[swaprow] - swap two rows in a matrix
linalg[swapcol] - swap two columns in a matrix
|
Calling Sequence
|
|
swaprow(A, r1, r2)
swapcol(A, c1, c2)
|
|
Parameters
|
|
A
|
-
|
matrix
|
r1, r2, c1, c2
|
-
|
positive integers
|
|
|
|
|
Description
|
|
•
|
The swaprow(A, r1, r2) function creates a new matrix in which row r1 has been swapped with row r2. Similarly, swapcol(A, c1, c2) creates a new matrix in which column c1 has been swapped with column c2.
|
|
These functions are part of the linalg package, and so can be used in the form swaprow(..) only after performing the command with(linalg) or with(linalg, swaprow). They can always be accessed in the long form linalg[swaprow](..).
|
|
|
Download Help Document
Was this information helpful?