[R] How to flip image?

Henrik Bengtsson hb at maths.lth.se
Thu Oct 16 11:26:34 CEST 2003


Yes, you need to follow Bjørn-Helge advice and manipulate the matrix
that is given to image. As this creates a copy of your first matrix,
this may be expensive if your matrix is large. I do not know of another
way. Unfortunately you can *not* use the argument 'x' and 'y' of image()
to flip and mirror the image produced; these arguments must given with
increasing values.

BTW, do you really want to flip your image (upside down) or you would
like to rotate it 180 degrees. If the latter, see
http://www.maths.lth.se/help/R/image/ for some image() example code
related to this. Try also

  source("http://www.maths.lth.se/help/R/image/image.R")

Best wishes

Henrik Bengtsson
Lund University

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
> Bjørn-Helge Mevik
> Sent: den 16 oktober 2003 09:57
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] How to flip image?
> 
> 
> Ernie Adorio <adorio at math.upd.edu.ph> writes:
> 
> > If not possible, is there any built-in R command to reverse 
> the rows 
> > of a
> > matrix?
> 
> How about Face[nrow(Face):1, ] ?
> 
> -- 
> Bjørn-Helge Mevik
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://www.stat.math.ethz.ch/mailma> n/listinfo/r-help
> 
>




More information about the R-help mailing list