flip.matrix: Flips a matrix 'left-right'. Used in re-arranging image data...

Description Usage Arguments Author(s) References See Also Examples

View source: R/flip.matrix.R

Description

Flips a matrix 'left-right'. Used in re-arranging image data for plotting properly in R.

Usage

1

Arguments

x

A matrix corresponding to raster or image data.

Author(s)

Glenn J Tattersall

References

1. http://www.inside-r.org/packages/cran/RSEIS/docs/mirror.matrix

2. Based on similar code in package <RSEIS>

See Also

mirror.matrix rotate90.matrix rotate270.matrix rotate180.matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## The function is currently defined as
function (x) 
{
    mirror.matrix(rotate180.matrix(x))
  }


par(mfrow=c(1,2),mar=c(1,1,1,1))
r<-c(1:100,rnorm(1:100)*10,1:100)
m<-matrix(r,20)
image(m, axes=FALSE)
box()
text(.5,.5,"Matrix",col="white")
mf<-flip.matrix(m)
image(mf,axes=FALSE)
box()
text(.5,.5,"Flipped",col="white")
  

Example output

function (x) 
{
    mirror.matrix(rotate180.matrix(x))
}

Thermimage documentation built on Sept. 27, 2021, 5:11 p.m.