R Under development (unstable) (2023-11-26 r85638 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. > #!/usr/bin/Rscript > > library(RcppCNPy) > > fmat <- npyLoad("fmat.npy") > print(fmat) [,1] [,2] [,3] [,4] [1,] 0.0 1.1 2.2 3.3 [2,] 4.4 5.5 6.6 7.7 [3,] 8.8 9.9 11.0 12.1 > stopifnot(all.equal(fmat, t(matrix(seq(0,11) * 1.1, 4, 3)))) > > fmat <- npyLoad("fmat.npy.gz") > print(fmat) [,1] [,2] [,3] [,4] [1,] 0.0 1.1 2.2 3.3 [2,] 4.4 5.5 6.6 7.7 [3,] 8.8 9.9 11.0 12.1 > stopifnot(all.equal(fmat, t(matrix(seq(0,11) * 1.1, 4, 3)))) > > imat <- npyLoad("imat.npy", "integer") > print(imat) [,1] [,2] [,3] [,4] [1,] 0 1 2 3 [2,] 4 5 6 7 [3,] 8 9 10 11 > stopifnot(all.equal(imat, t(matrix(seq(0,11), 4, 3)))) > > fvec <- npyLoad("fvec.npy") > print(fvec) [1] 0.0 1.1 2.2 3.3 4.4 > stopifnot(all.equal(fvec, seq(0,4) * 1.1)) > > ivec <- npyLoad("ivec.npy", "integer") > print(ivec) [1] 0 1 2 3 4 > stopifnot(all.equal(ivec, seq(0,4))) > > > > proc.time() user system elapsed 0.34 0.07 0.35