R Under development (unstable) (2023-11-08 r85496 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## > ## s i z e . R tests > ## > > size <- pracma::size > numel <- pracma::numel > ndims <- pracma::ndims > isempty <- pracma::isempty > > identical(size(1:8), c(1, 8)) [1] TRUE > identical(size(1:8, 1), 1) [1] TRUE > identical(size(1:8, 2), 8) [1] TRUE > identical(size(1:8, 3), 1) [1] TRUE > identical(size(matrix(1:12, 3, 4)), c(3L, 4L)) [1] TRUE > > identical(numel(array(0, c(4,4,2))), 32) [1] TRUE > identical(numel(1:100), 100) [1] TRUE > > identical(ndims(array(NA, c(4,4,2))), 3L) [1] TRUE > identical(ndims(list(a=1:5)), 2L) [1] FALSE > > identical(isempty(numeric(0)), TRUE) [1] TRUE > identical(isempty(matrix(0, 1, 0)), TRUE) [1] TRUE > identical(isempty(matrix(0, 1, 1)), FALSE) [1] TRUE > identical(isempty(array(NA, c(2,2,2))), FALSE) [1] TRUE > identical(isempty(array(NA, c(2,0,2))), TRUE) [1] TRUE > > proc.time() user system elapsed 0.10 0.03 0.14