diag.bathy | R Documentation |
Finds either the values of the coordinates of the non-linear diagonal of non-square matrices.
diag.bathy(mat,coord=FALSE)
mat |
a data matrix |
coord |
whether of not to output the coordinates of the diagonal (default is |
diag.bathy gets the values or coordinates from the first element of a matrix to its last elements. If the matrix is non-square, that is, its number of rows and columns differ, diag.bathy computes an approximate diagonal.
A vector of diagonal values is coord
is FALSE
, or a table of diagonal coordinates ifcoord
is FALSE
Eric Pante
get.transect
, diag
# a square matrix: diag.bathy behaves as diag
matrix(1:25, 5, 5) -> a ; a
diag(a)
diag.bathy(a)
# a non-square matrix: diag.bathy does not behaves as diag
matrix(1:15, 3, 5) -> b ; b
diag(b)
diag.bathy(b)
# output the diagonal or its coordinates:
rownames(b) <- seq(32,35, length.out=3)
colnames(b) <- seq(-100,-95, length.out=5)
diag.bathy(b, coord=FALSE)
diag.bathy(b, coord=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.