[R] Base function for flipping matrices
lists at revelle.net
Sat Dec 31 22:59:50 CET 2011
Presumably for fliplr you meant ncol(x)
fliplr <- function(x) x[, ncol(x):1]
On Dec 31, 2011, at 9:08 AM, Hadley Wickham wrote:
> Hi all,
> Are there base functions that do the equivalent of this?
> fliptb <- function(x) x[nrow(x):1, ]
> fliplr <- function(x) x[, nrow(x):1]
> Obviously not hard to implement (although it needs some more checks),
> just wondering if it had already been implemented.
> Assistant Professor / Dobelman Family Junior Chair
> Department of Statistics / Rice University
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
William Revelle http://personality-project.org/revelle.html
Department of Psychology http://www.wcas.northwestern.edu/psych/
Northwestern University http://www.northwestern.edu/
Use R for psychology http://personality-project.org/r
It is 6 minutes to midnight http://www.thebulletin.org
More information about the R-help