File: ndims.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 (15 lines) | stat: -rw-r--r-- 404 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
###
### $Id: ndims.R 22 2022-05-30 18:03:47Z proebuck $
###


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

test.ndims(list(A = array(NA, c(4, 4, 2))), 3)
test.ndims(list(A = matlab::magic(4)), 2)
test.ndims(list(A = 1:5), 2)