File: fliplr.R

package info (click to toggle)
r-cran-matlab 1.0.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 640 kB
  • sloc: sh: 13; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 565 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
###
### $Id: fliplr.R 22 2022-05-30 18:03:47Z proebuck $
###


##-----------------------------------------------------------------------------
test.fliplr <- function(input, expected) {
    output <- do.call(getFromNamespace("fliplr", "matlab"), input)
    identical(output, expected)
}

X.mat <- matrix(1:6, 2, 3, byrow = TRUE)
fliplr.expected.X.mat <- matrix(c(3:1, 6:4), 2, 3, byrow = TRUE)

test.fliplr(list(X.mat), fliplr.expected.X.mat)

X.vec <- seq(1, 9, by = 2)
fliplr.expected.X.vec <- seq(9, 1, by = -2)

test.fliplr(list(X.vec), fliplr.expected.X.vec)