Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-10-16 12:05 -0400 (Thu, 16 Oct 2025).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" | 4867 |
lconway | macOS 12.7.6 Monterey | x86_64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4655 |
kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4600 |
taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4610 |
Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X |
Package 255/2346 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.73.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | ![]() | ||||||||
lconway | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | ![]() | ||||||||
kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | ![]() | ||||||||
taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
Package: BufferedMatrix |
Version: 1.73.0 |
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz |
StartedAt: 2025-10-15 18:35:51 -0400 (Wed, 15 Oct 2025) |
EndedAt: 2025-10-15 18:36:07 -0400 (Wed, 15 Oct 2025) |
EllapsedTime: 16.2 seconds |
RetCode: 0 |
Status: WARNINGS |
CheckDir: BufferedMatrix.Rcheck |
Warnings: 1 |
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’ * using R version 4.5.1 Patched (2025-09-10 r88807) * using platform: aarch64-apple-darwin20 * R was compiled by Apple clang version 16.0.0 (clang-1600.0.26.6) GNU Fortran (GCC) 14.2.0 * running under: macOS Ventura 13.7.7 * using session charset: UTF-8 * using option ‘--no-vignettes’ * checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK * this is package ‘BufferedMatrix’ version ‘1.73.0’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘BufferedMatrix’ can be installed ... WARNING Found the following significant warnings: doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details. * used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’ * used SDK: ‘MacOSX11.3.1.sdk’ * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... NOTE checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup? 209 | $x^{power}$ elementwise of the matrix | ^ prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking compiled code ... NOTE Note: information on .o files is not available * checking sizes of PDF files under ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... NONE * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘Rcodetesting.R’ Running ‘c_code_level_tests.R’ Running ‘objectTesting.R’ Running ‘rawCalltesting.R’ OK * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking running R code from vignettes ... SKIPPED * checking re-building of vignette outputs ... SKIPPED * checking PDF version of manual ... OK * DONE Status: 1 WARNING, 2 NOTEs See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’ for details.
BufferedMatrix.Rcheck/00install.out
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix ### ############################################################################## ############################################################################## * installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library’ * installing *source* package ‘BufferedMatrix’ ... ** this is package ‘BufferedMatrix’ version ‘1.73.0’ ** using staged installation ** libs using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’ using SDK: ‘MacOSX11.3.1.sdk’ clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] if (!(Matrix->readonly) & setting){ ^ ~ doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first if (!(Matrix->readonly) & setting){ ^ ( ) doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning if (!(Matrix->readonly) & setting){ ^ ( ) doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function] static int sort_double(const double *a1,const double *a2){ ^ 2 warnings generated. clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R installing to /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs ** R ** inst ** byte-compile and prepare package for lazy loading Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’ Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’ Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’ Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’ Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’ Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’ ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** checking absolute paths in shared objects and dynamic libraries ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: aarch64-apple-darwin20 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. > library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1)) Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Assigning Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 Adding Additional Column Checking dimensions Rows: 5 Cols: 6 Buffer Rows: 1 Buffer Cols: 1 0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 Reassigning values 1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 Resizing Buffers Checking dimensions Rows: 5 Cols: 6 Buffer Rows: 3 Buffer Cols: 3 1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 Activating Row Buffer In row mode: 1 1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 Squaring Last Column 1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 Square rooting Last Row, then turing off Row Buffer In row mode: 0 Checking on value that should be not be in column buffer2.236068 1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 Single Indexing. Assign each value its square 1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 Resizing Buffers Smaller Checking dimensions Rows: 5 Cols: 6 Buffer Rows: 1 Buffer Cols: 1 1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 Activating Row Mode. Resizing Buffers Checking dimensions Rows: 5 Cols: 6 Buffer Rows: 1 Buffer Cols: 1 Activating ReadOnly Mode. The results of assignment is: 0 Printing matrix reversed. 900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 [[1]] [1] 0 > > proc.time() user system elapsed 0.108 0.036 0.140
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: aarch64-apple-darwin20 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. > library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths()); Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums > > > ### this is used to control how many repetitions in something below > ### higher values result in more checks. > nreps <-100 ##20000 > > > ## test creation and some simple assignments and subsetting operations > > ## first on single elements > tmp <- createBufferedMatrix(1000,10) > > tmp[10,5] [1] 0 > tmp[10,5] <- 10 > tmp[10,5] [1] 10 > tmp[10,5] <- 12.445 > tmp[10,5] [1] 12.445 > > > > ## now testing accessing multiple elements > tmp2 <- createBufferedMatrix(10,20) > > > tmp2[3,1] <- 51.34 > tmp2[9,2] <- 9.87654 > tmp2[,1:2] [,1] [,2] [1,] 0.00 0.00000 [2,] 0.00 0.00000 [3,] 51.34 0.00000 [4,] 0.00 0.00000 [5,] 0.00 0.00000 [6,] 0.00 0.00000 [7,] 0.00 0.00000 [8,] 0.00 0.00000 [9,] 0.00 9.87654 [10,] 0.00 0.00000 > tmp2[,-(3:20)] [,1] [,2] [1,] 0.00 0.00000 [2,] 0.00 0.00000 [3,] 51.34 0.00000 [4,] 0.00 0.00000 [5,] 0.00 0.00000 [6,] 0.00 0.00000 [7,] 0.00 0.00000 [8,] 0.00 0.00000 [9,] 0.00 9.87654 [10,] 0.00 0.00000 > tmp2[3,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 0 0 0 0 0 0 0 > tmp2[-3,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0 [9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 0 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 0 [3,] 0 0 0 0 0 0 0 [4,] 0 0 0 0 0 0 0 [5,] 0 0 0 0 0 0 0 [6,] 0 0 0 0 0 0 0 [7,] 0 0 0 0 0 0 0 [8,] 0 0 0 0 0 0 0 [9,] 0 0 0 0 0 0 0 > tmp2[2,1:3] [,1] [,2] [,3] [1,] 0 0 0 > tmp2[3:9,1:3] [,1] [,2] [,3] [1,] 51.34 0.00000 0 [2,] 0.00 0.00000 0 [3,] 0.00 0.00000 0 [4,] 0.00 0.00000 0 [5,] 0.00 0.00000 0 [6,] 0.00 0.00000 0 [7,] 0.00 9.87654 0 > tmp2[-4,-4] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0 [4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0 [9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [1,] 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 [3,] 0 0 0 0 0 0 [4,] 0 0 0 0 0 0 [5,] 0 0 0 0 0 0 [6,] 0 0 0 0 0 0 [7,] 0 0 0 0 0 0 [8,] 0 0 0 0 0 0 [9,] 0 0 0 0 0 0 > > ## now testing accessing/assigning multiple elements > tmp3 <- createBufferedMatrix(10,10) > > for (i in 1:10){ + for (j in 1:10){ + tmp3[i,j] <- (j-1)*10 + i + } + } > > tmp3[2:4,2:4] [,1] [,2] [,3] [1,] 12 22 32 [2,] 13 23 33 [3,] 14 24 34 > tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 11 21 31 11 21 31 91 1 11 1 11 21 31 [2,] 12 22 32 12 22 32 92 2 12 2 12 22 32 [3,] 13 23 33 13 23 33 93 3 13 3 13 23 33 [4,] 14 24 34 14 24 34 94 4 14 4 14 24 34 [5,] 15 25 35 15 25 35 95 5 15 5 15 25 35 [6,] 16 26 36 16 26 36 96 6 16 6 16 26 36 [7,] 17 27 37 17 27 37 97 7 17 7 17 27 37 [8,] 18 28 38 18 28 38 98 8 18 8 18 28 38 [9,] 19 29 39 19 29 39 99 9 19 9 19 29 39 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 41 51 61 71 81 91 91 81 71 61 51 41 [2,] 42 52 62 72 82 92 92 82 72 62 52 42 [3,] 43 53 63 73 83 93 93 83 73 63 53 43 [4,] 44 54 64 74 84 94 94 84 74 64 54 44 [5,] 45 55 65 75 85 95 95 85 75 65 55 45 [6,] 46 56 66 76 86 96 96 86 76 66 56 46 [7,] 47 57 67 77 87 97 97 87 77 67 57 47 [8,] 48 58 68 78 88 98 98 88 78 68 58 48 [9,] 49 59 69 79 89 99 99 89 79 69 59 49 [,26] [,27] [,28] [,29] [1,] 31 21 11 1 [2,] 32 22 12 2 [3,] 33 23 13 3 [4,] 34 24 14 4 [5,] 35 25 15 5 [6,] 36 26 16 6 [7,] 37 27 17 7 [8,] 38 28 18 8 [9,] 39 29 19 9 > tmp3[-c(1:5),-c(6:10)] [,1] [,2] [,3] [,4] [,5] [1,] 6 16 26 36 46 [2,] 7 17 27 37 47 [3,] 8 18 28 38 48 [4,] 9 19 29 39 49 [5,] 10 20 30 40 50 > > ## assignment of whole columns > tmp3[,1] <- c(1:10*100.0) > tmp3[,1:2] <- tmp3[,1:2]*100 > tmp3[,1:2] <- tmp3[,2:1] > tmp3[,1:2] [,1] [,2] [1,] 1100 1e+04 [2,] 1200 2e+04 [3,] 1300 3e+04 [4,] 1400 4e+04 [5,] 1500 5e+04 [6,] 1600 6e+04 [7,] 1700 7e+04 [8,] 1800 8e+04 [9,] 1900 9e+04 [10,] 2000 1e+05 > > > tmp3[,-1] <- tmp3[,1:9] > tmp3[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1100 1100 1e+04 21 31 41 51 61 71 81 [2,] 1200 1200 2e+04 22 32 42 52 62 72 82 [3,] 1300 1300 3e+04 23 33 43 53 63 73 83 [4,] 1400 1400 4e+04 24 34 44 54 64 74 84 [5,] 1500 1500 5e+04 25 35 45 55 65 75 85 [6,] 1600 1600 6e+04 26 36 46 56 66 76 86 [7,] 1700 1700 7e+04 27 37 47 57 67 77 87 [8,] 1800 1800 8e+04 28 38 48 58 68 78 88 [9,] 1900 1900 9e+04 29 39 49 59 69 79 89 [10,] 2000 2000 1e+05 30 40 50 60 70 80 90 > > tmp3[,1:2] <- rep(1,10) > tmp3[,1:2] <- rep(1,20) > tmp3[,1:2] <- matrix(c(1:5),1,5) > > tmp3[,-c(1:8)] <- matrix(c(1:5),1,5) > > tmp3[1,] <- 1:10 > tmp3[1,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 > tmp3[-1,] <- c(1,2) > tmp3[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 [2,] 1 2 1 2 1 2 1 2 1 2 [3,] 2 1 2 1 2 1 2 1 2 1 [4,] 1 2 1 2 1 2 1 2 1 2 [5,] 2 1 2 1 2 1 2 1 2 1 [6,] 1 2 1 2 1 2 1 2 1 2 [7,] 2 1 2 1 2 1 2 1 2 1 [8,] 1 2 1 2 1 2 1 2 1 2 [9,] 2 1 2 1 2 1 2 1 2 1 [10,] 1 2 1 2 1 2 1 2 1 2 > tmp3[-c(1:8),] <- matrix(c(1:5),1,5) > tmp3[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 [2,] 1 2 1 2 1 2 1 2 1 2 [3,] 2 1 2 1 2 1 2 1 2 1 [4,] 1 2 1 2 1 2 1 2 1 2 [5,] 2 1 2 1 2 1 2 1 2 1 [6,] 1 2 1 2 1 2 1 2 1 2 [7,] 2 1 2 1 2 1 2 1 2 1 [8,] 1 2 1 2 1 2 1 2 1 2 [9,] 1 3 5 2 4 1 3 5 2 4 [10,] 2 4 1 3 5 2 4 1 3 5 > > > tmp3[1:2,1:2] <- 5555.04 > tmp3[-(1:2),1:2] <- 1234.56789 > > > > ## testing accessors for the directory and prefix > directory(tmp3) [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests" > prefix(tmp3) [1] "BM" > > ## testing if we can remove these objects > rm(tmp, tmp2, tmp3) > gc() used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) Ncells 480828 25.7 1056624 56.5 NA 634340 33.9 Vcells 891019 6.8 8388608 64.0 196608 2109889 16.1 > > > > > ## > ## checking reads > ## > > tmp2 <- createBufferedMatrix(10,20) > > test.sample <- rnorm(10*20) > > tmp2[1:10,1:20] <- test.sample > > test.matrix <- matrix(test.sample,10,20) > > ## testing reads > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + which.col <- sample(1:20,1) + if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.col <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > date() [1] "Wed Oct 15 18:36:00 2025" > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > date() [1] "Wed Oct 15 18:36:00 2025" > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + which.col <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > > > RowMode(tmp2) <pointer: 0x600002f84000> > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + which.col <- sample(1:20,1) + if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.col <- sample(1:20,5,replace=TRUE) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > date() [1] "Wed Oct 15 18:36:01 2025" > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + which.col <- sample(1:20,5,replace=TRUE) + if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){ + cat("incorrect agreement") + break; + } + } > date() [1] "Wed Oct 15 18:36:01 2025" > > ColMode(tmp2) <pointer: 0x600002f84000> > > > > ### Now testing assignments > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + + new.data <- rnorm(20) + tmp2[which.row,] <- new.data + test.matrix[which.row,] <- new.data + if (rep > 1){ + if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){ + cat("incorrect agreement") + break; + } + } + prev.row <- which.row + + } > > > > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + new.data <- rnorm(10) + tmp2[,which.col] <- new.data + test.matrix[,which.col]<- new.data + + if (rep > 1){ + if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){ + cat("incorrect agreement") + break; + } + } + prev.col <- which.col + } > > > > > > for (rep in 1:nreps){ + which.col <- sample(1:20,5,replace=TRUE) + new.data <- matrix(rnorm(50),5,10) + tmp2[,which.col] <- new.data + test.matrix[,which.col]<- new.data + + if (rep > 1){ + if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){ + cat("incorrect agreement") + break; + } + } + prev.col <- which.col + } > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + new.data <- matrix(rnorm(50),5,10) + tmp2[which.row,] <- new.data + test.matrix[which.row,]<- new.data + + if (rep > 1){ + if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){ + cat("incorrect agreement") + break; + } + } + prev.row <- which.row + } > > > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + which.col <- sample(1:20,5,replace=TRUE) + new.data <- matrix(rnorm(25),5,5) + tmp2[which.row,which.col] <- new.data + test.matrix[which.row,which.col]<- new.data + + if (rep > 1){ + if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){ + cat("incorrect agreement") + break; + } + } + prev.row <- which.row + prev.col <- which.col + } > > > > > ### > ### > ### testing some more functions > ### > > > > ## duplication function > tmp5 <- duplicate(tmp2) > > # making sure really did copy everything. > tmp5[1,1] <- tmp5[1,1] +100.00 > > if (tmp5[1,1] == tmp2[1,1]){ + stop("Problem with duplication") + } > > > > > ### testing elementwise applying of functions > > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 99.1707827 0.8904548 -0.1002564 0.0458632 [2,] -0.7769350 0.3384607 1.3982161 -0.1476692 [3,] 0.5450194 -0.2140863 -0.3608478 -1.2342241 [4,] -0.8008290 -1.6878772 -0.6345588 0.6028851 > ewApply(tmp5,abs) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 99.1707827 0.8904548 0.1002564 0.0458632 [2,] 0.7769350 0.3384607 1.3982161 0.1476692 [3,] 0.5450194 0.2140863 0.3608478 1.2342241 [4,] 0.8008290 1.6878772 0.6345588 0.6028851 > ewApply(tmp5,sqrt) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 9.9584528 0.9436391 0.3166329 0.2141570 [2,] 0.8814391 0.5817738 1.1824619 0.3842775 [3,] 0.7382543 0.4626946 0.6007061 1.1109564 [4,] 0.8948905 1.2991833 0.7965920 0.7764568 > > my.function <- function(x,power){ + (x+5)^power + } > > ewApply(tmp5,my.function,power=2) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 223.75531 35.32685 28.26659 27.18743 [2,] 34.59133 31.15620 38.22283 28.99044 [3,] 32.92756 29.84103 31.36791 37.34379 [4,] 34.74973 39.67971 33.60048 33.36745 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x600002f80000> > exp(tmp5) <pointer: 0x600002f80000> > log(tmp5,2) <pointer: 0x600002f80000> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 465.7174 > Min(tmp5) [1] 52.55886 > mean(tmp5) [1] 72.28458 > Sum(tmp5) [1] 14456.92 > Var(tmp5) [1] 854.8097 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 88.16071 71.56053 70.37964 70.22195 69.95400 71.68608 69.49218 72.44086 [9] 67.83420 71.11561 > rowSums(tmp5) [1] 1763.214 1431.211 1407.593 1404.439 1399.080 1433.722 1389.844 1448.817 [9] 1356.684 1422.312 > rowVars(tmp5) [1] 7986.87832 90.52160 41.39244 56.47304 112.94250 96.31705 [7] 75.08964 44.20621 53.37091 85.03341 > rowSd(tmp5) [1] 89.369337 9.514284 6.433696 7.514855 10.627441 9.814125 8.665428 [8] 6.648775 7.305540 9.221356 > rowMax(tmp5) [1] 465.71736 86.39166 83.20524 86.68307 90.73065 88.12168 94.94732 [8] 83.84891 88.05773 85.11387 > rowMin(tmp5) [1] 54.36872 54.84574 58.18839 57.65941 54.11009 58.06696 58.06534 52.55886 [9] 54.70082 53.30482 > > colMeans(tmp5) [1] 110.25740 71.35782 68.79505 66.96338 73.64564 69.25421 71.42430 [8] 70.21135 67.40169 74.12194 66.58693 72.99143 66.41568 71.61201 [15] 68.35721 73.78502 72.89905 71.14994 64.48282 73.97867 > colSums(tmp5) [1] 1102.5740 713.5782 687.9505 669.6338 736.4564 692.5421 714.2430 [8] 702.1135 674.0169 741.2194 665.8693 729.9143 664.1568 716.1201 [15] 683.5721 737.8502 728.9905 711.4994 644.8282 739.7867 > colVars(tmp5) [1] 15642.13463 115.61056 72.72182 96.27244 43.04698 65.14736 [7] 26.58767 49.02581 135.90489 77.87871 65.40156 37.61887 [13] 87.58069 47.34060 79.36949 56.59909 106.38746 107.61775 [19] 37.58473 87.05571 > colSd(tmp5) [1] 125.068520 10.752235 8.527709 9.811852 6.561019 8.071391 [7] 5.156323 7.001844 11.657825 8.824891 8.087123 6.133422 [13] 9.358456 6.880450 8.908955 7.523237 10.314430 10.373898 [19] 6.130638 9.330365 > colMax(tmp5) [1] 465.71736 94.94732 79.55582 83.76264 83.20524 81.43694 79.23539 [8] 82.52014 90.73065 87.23769 79.19225 82.35456 82.00598 85.12327 [15] 82.51050 87.89234 88.05773 89.55173 73.82801 88.12168 > colMin(tmp5) [1] 55.17194 61.60437 56.99933 53.30482 63.15568 54.70082 63.76799 60.34996 [9] 54.84574 62.83705 54.35398 62.39967 52.55886 61.29732 56.00267 61.82002 [17] 60.11296 54.11009 57.37821 64.16999 > > > ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default) > > > which.row <- sample(1:10,1,replace=TRUE) > which.col <- sample(1:20,1,replace=TRUE) > > tmp5[which.row,which.col] <- NA > > Max(tmp5) [1] NA > Min(tmp5) [1] NA > mean(tmp5) [1] NA > Sum(tmp5) [1] NA > Var(tmp5) [1] NA > > rowMeans(tmp5) [1] 88.16071 71.56053 NA 70.22195 69.95400 71.68608 69.49218 72.44086 [9] 67.83420 71.11561 > rowSums(tmp5) [1] 1763.214 1431.211 NA 1404.439 1399.080 1433.722 1389.844 1448.817 [9] 1356.684 1422.312 > rowVars(tmp5) [1] 7986.87832 90.52160 42.17607 56.47304 112.94250 96.31705 [7] 75.08964 44.20621 53.37091 85.03341 > rowSd(tmp5) [1] 89.369337 9.514284 6.494310 7.514855 10.627441 9.814125 8.665428 [8] 6.648775 7.305540 9.221356 > rowMax(tmp5) [1] 465.71736 86.39166 NA 86.68307 90.73065 88.12168 94.94732 [8] 83.84891 88.05773 85.11387 > rowMin(tmp5) [1] 54.36872 54.84574 NA 57.65941 54.11009 58.06696 58.06534 52.55886 [9] 54.70082 53.30482 > > colMeans(tmp5) [1] 110.25740 71.35782 NA 66.96338 73.64564 69.25421 71.42430 [8] 70.21135 67.40169 74.12194 66.58693 72.99143 66.41568 71.61201 [15] 68.35721 73.78502 72.89905 71.14994 64.48282 73.97867 > colSums(tmp5) [1] 1102.5740 713.5782 NA 669.6338 736.4564 692.5421 714.2430 [8] 702.1135 674.0169 741.2194 665.8693 729.9143 664.1568 716.1201 [15] 683.5721 737.8502 728.9905 711.4994 644.8282 739.7867 > colVars(tmp5) [1] 15642.13463 115.61056 NA 96.27244 43.04698 65.14736 [7] 26.58767 49.02581 135.90489 77.87871 65.40156 37.61887 [13] 87.58069 47.34060 79.36949 56.59909 106.38746 107.61775 [19] 37.58473 87.05571 > colSd(tmp5) [1] 125.068520 10.752235 NA 9.811852 6.561019 8.071391 [7] 5.156323 7.001844 11.657825 8.824891 8.087123 6.133422 [13] 9.358456 6.880450 8.908955 7.523237 10.314430 10.373898 [19] 6.130638 9.330365 > colMax(tmp5) [1] 465.71736 94.94732 NA 83.76264 83.20524 81.43694 79.23539 [8] 82.52014 90.73065 87.23769 79.19225 82.35456 82.00598 85.12327 [15] 82.51050 87.89234 88.05773 89.55173 73.82801 88.12168 > colMin(tmp5) [1] 55.17194 61.60437 NA 53.30482 63.15568 54.70082 63.76799 60.34996 [9] 54.84574 62.83705 54.35398 62.39967 52.55886 61.29732 56.00267 61.82002 [17] 60.11296 54.11009 57.37821 64.16999 > > Max(tmp5,na.rm=TRUE) [1] 465.7174 > Min(tmp5,na.rm=TRUE) [1] 52.55886 > mean(tmp5,na.rm=TRUE) [1] 72.31974 > Sum(tmp5,na.rm=TRUE) [1] 14391.63 > Var(tmp5,na.rm=TRUE) [1] 858.8785 > > rowMeans(tmp5,na.rm=TRUE) [1] 88.16071 71.56053 70.64761 70.22195 69.95400 71.68608 69.49218 72.44086 [9] 67.83420 71.11561 > rowSums(tmp5,na.rm=TRUE) [1] 1763.214 1431.211 1342.305 1404.439 1399.080 1433.722 1389.844 1448.817 [9] 1356.684 1422.312 > rowVars(tmp5,na.rm=TRUE) [1] 7986.87832 90.52160 42.17607 56.47304 112.94250 96.31705 [7] 75.08964 44.20621 53.37091 85.03341 > rowSd(tmp5,na.rm=TRUE) [1] 89.369337 9.514284 6.494310 7.514855 10.627441 9.814125 8.665428 [8] 6.648775 7.305540 9.221356 > rowMax(tmp5,na.rm=TRUE) [1] 465.71736 86.39166 83.20524 86.68307 90.73065 88.12168 94.94732 [8] 83.84891 88.05773 85.11387 > rowMin(tmp5,na.rm=TRUE) [1] 54.36872 54.84574 58.18839 57.65941 54.11009 58.06696 58.06534 52.55886 [9] 54.70082 53.30482 > > colMeans(tmp5,na.rm=TRUE) [1] 110.25740 71.35782 69.18470 66.96338 73.64564 69.25421 71.42430 [8] 70.21135 67.40169 74.12194 66.58693 72.99143 66.41568 71.61201 [15] 68.35721 73.78502 72.89905 71.14994 64.48282 73.97867 > colSums(tmp5,na.rm=TRUE) [1] 1102.5740 713.5782 622.6623 669.6338 736.4564 692.5421 714.2430 [8] 702.1135 674.0169 741.2194 665.8693 729.9143 664.1568 716.1201 [15] 683.5721 737.8502 728.9905 711.4994 644.8282 739.7867 > colVars(tmp5,na.rm=TRUE) [1] 15642.13463 115.61056 80.10399 96.27244 43.04698 65.14736 [7] 26.58767 49.02581 135.90489 77.87871 65.40156 37.61887 [13] 87.58069 47.34060 79.36949 56.59909 106.38746 107.61775 [19] 37.58473 87.05571 > colSd(tmp5,na.rm=TRUE) [1] 125.068520 10.752235 8.950083 9.811852 6.561019 8.071391 [7] 5.156323 7.001844 11.657825 8.824891 8.087123 6.133422 [13] 9.358456 6.880450 8.908955 7.523237 10.314430 10.373898 [19] 6.130638 9.330365 > colMax(tmp5,na.rm=TRUE) [1] 465.71736 94.94732 79.55582 83.76264 83.20524 81.43694 79.23539 [8] 82.52014 90.73065 87.23769 79.19225 82.35456 82.00598 85.12327 [15] 82.51050 87.89234 88.05773 89.55173 73.82801 88.12168 > colMin(tmp5,na.rm=TRUE) [1] 55.17194 61.60437 56.99933 53.30482 63.15568 54.70082 63.76799 60.34996 [9] 54.84574 62.83705 54.35398 62.39967 52.55886 61.29732 56.00267 61.82002 [17] 60.11296 54.11009 57.37821 64.16999 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 88.16071 71.56053 NaN 70.22195 69.95400 71.68608 69.49218 72.44086 [9] 67.83420 71.11561 > rowSums(tmp5,na.rm=TRUE) [1] 1763.214 1431.211 0.000 1404.439 1399.080 1433.722 1389.844 1448.817 [9] 1356.684 1422.312 > rowVars(tmp5,na.rm=TRUE) [1] 7986.87832 90.52160 NA 56.47304 112.94250 96.31705 [7] 75.08964 44.20621 53.37091 85.03341 > rowSd(tmp5,na.rm=TRUE) [1] 89.369337 9.514284 NA 7.514855 10.627441 9.814125 8.665428 [8] 6.648775 7.305540 9.221356 > rowMax(tmp5,na.rm=TRUE) [1] 465.71736 86.39166 NA 86.68307 90.73065 88.12168 94.94732 [8] 83.84891 88.05773 85.11387 > rowMin(tmp5,na.rm=TRUE) [1] 54.36872 54.84574 NA 57.65941 54.11009 58.06696 58.06534 52.55886 [9] 54.70082 53.30482 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 114.89329 72.38533 NaN 65.76751 72.58346 67.90057 70.55640 [8] 70.31838 68.42539 74.69380 66.43168 73.08779 66.40070 72.13033 [15] 68.47806 73.63440 73.56784 70.99030 63.54410 74.95071 > colSums(tmp5,na.rm=TRUE) [1] 1034.0396 651.4680 0.0000 591.9076 653.2511 611.1052 635.0076 [8] 632.8654 615.8285 672.2442 597.8851 657.7901 597.6063 649.1729 [15] 616.3026 662.7096 662.1105 638.9127 571.8969 674.5564 > colVars(tmp5,na.rm=TRUE) [1] 17355.62255 118.18432 NA 92.21784 35.73534 52.67704 [7] 21.43707 55.02517 141.10344 83.93460 73.30558 42.21676 [13] 98.52575 50.23584 89.12636 63.41877 114.65410 120.78325 [19] 32.36934 87.30804 > colSd(tmp5,na.rm=TRUE) [1] 131.740740 10.871261 NA 9.603012 5.977904 7.257895 [7] 4.630019 7.417895 11.878697 9.161583 8.561868 6.497442 [13] 9.926014 7.087725 9.440676 7.963591 10.707665 10.990143 [19] 5.689406 9.343877 > colMax(tmp5,na.rm=TRUE) [1] 465.71736 94.94732 -Inf 83.76264 79.30712 80.79956 77.06964 [8] 82.52014 90.73065 87.23769 79.19225 82.35456 82.00598 85.12327 [15] 82.51050 87.89234 88.05773 89.55173 73.82801 88.12168 > colMin(tmp5,na.rm=TRUE) [1] 55.17194 61.60437 Inf 53.30482 63.15568 54.70082 63.76799 60.34996 [9] 54.84574 62.83705 54.35398 62.39967 52.55886 61.29732 56.00267 61.82002 [17] 60.11296 54.11009 57.37821 64.16999 > > > > > copymatrix <- matrix(rnorm(200,150,15),10,20) > > tmp5[1:10,1:20] <- copymatrix > which.row <- 3 > which.col <- 1 > cat(which.row," ",which.col,"\n") 3 1 > tmp5[which.row,which.col] <- NA > copymatrix[which.row,which.col] <- NA > > rowVars(tmp5,na.rm=TRUE) [1] 92.42906 252.16183 208.63598 238.11705 187.68022 138.93736 183.00370 [8] 134.73945 252.21623 198.33570 > apply(copymatrix,1,var,na.rm=TRUE) [1] 92.42906 252.16183 208.63598 238.11705 187.68022 138.93736 183.00370 [8] 134.73945 252.21623 198.33570 > > > > copymatrix <- matrix(rnorm(200,150,15),10,20) > > tmp5[1:10,1:20] <- copymatrix > which.row <- 1 > which.col <- 3 > cat(which.row," ",which.col,"\n") 1 3 > tmp5[which.row,which.col] <- NA > copymatrix[which.row,which.col] <- NA > > colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE) [1] -2.842171e-14 -1.705303e-13 0.000000e+00 -2.842171e-13 -1.989520e-13 [6] -1.136868e-13 4.547474e-13 5.684342e-14 -1.705303e-13 -1.136868e-13 [11] 1.421085e-14 -4.263256e-14 0.000000e+00 -2.842171e-14 -8.526513e-14 [16] 0.000000e+00 2.842171e-14 1.989520e-13 0.000000e+00 0.000000e+00 > > > > > > > > > > > ## making sure these things agree > ## > ## first when there is no NA > > > > agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){ + + if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){ + stop("No agreement in Max") + } + + + if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){ + stop("No agreement in Min") + } + + + if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){ + + cat(Sum(buff.matrix,na.rm=TRUE),"\n") + cat(sum(r.matrix,na.rm=TRUE),"\n") + cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n") + + stop("No agreement in Sum") + } + + if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){ + stop("No agreement in mean") + } + + + if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){ + stop("No agreement in Var") + } + + + + if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in rowMeans") + } + + + if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){ + stop("No agreement in colMeans") + } + + + if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){ + stop("No agreement in rowSums") + } + + + if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){ + stop("No agreement in colSums") + } + + ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when + ### computing variance + my.Var <- function(x,na.rm=FALSE){ + if (all(is.na(x))){ + return(NA) + } else { + var(x,na.rm=na.rm) + } + + } + + if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in rowVars") + } + + + if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in rowVars") + } + + + if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMax") + } + + + if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMax") + } + + + + if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMin") + } + + + if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMin") + } + + if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMedian") + } + + if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colRanges") + } + + + + } > > > > > > > > > > for (rep in 1:20){ + copymatrix <- matrix(rnorm(200,150,15),10,20) + + tmp5[1:10,1:20] <- copymatrix + + + agree.checks(tmp5,copymatrix) + + ## now lets assign some NA values and check agreement + + which.row <- sample(1:10,1,replace=TRUE) + which.col <- sample(1:20,1,replace=TRUE) + + cat(which.row," ",which.col,"\n") + + tmp5[which.row,which.col] <- NA + copymatrix[which.row,which.col] <- NA + + agree.checks(tmp5,copymatrix) + + ## make an entire row NA + tmp5[which.row,] <- NA + copymatrix[which.row,] <- NA + + + agree.checks(tmp5,copymatrix) + + ### also make an entire col NA + tmp5[,which.col] <- NA + copymatrix[,which.col] <- NA + + agree.checks(tmp5,copymatrix) + + ### now make 1 element non NA with NA in the rest of row and column + + tmp5[which.row,which.col] <- rnorm(1,150,15) + copymatrix[which.row,which.col] <- tmp5[which.row,which.col] + + agree.checks(tmp5,copymatrix) + } 3 2 9 5 6 20 7 10 7 9 10 5 9 18 3 13 6 14 1 10 3 1 9 6 4 5 2 12 7 16 8 18 5 8 7 9 7 17 4 19 There were 50 or more warnings (use warnings() to see the first 50) > > > ### now test 1 by n and n by 1 matrix > > > err.tol <- 1e-12 > > rm(tmp5) > > dataset1 <- rnorm(100) > dataset2 <- rnorm(100) > > tmp <- createBufferedMatrix(1,100) > tmp[1,] <- dataset1 > > tmp2 <- createBufferedMatrix(100,1) > tmp2[,1] <- dataset2 > > > > > > Max(tmp) [1] 2.449615 > Min(tmp) [1] -1.940858 > mean(tmp) [1] 0.1566841 > Sum(tmp) [1] 15.66841 > Var(tmp) [1] 0.8559142 > > rowMeans(tmp) [1] 0.1566841 > rowSums(tmp) [1] 15.66841 > rowVars(tmp) [1] 0.8559142 > rowSd(tmp) [1] 0.9251563 > rowMax(tmp) [1] 2.449615 > rowMin(tmp) [1] -1.940858 > > colMeans(tmp) [1] 0.0966762071 0.8160358113 -1.2715836825 0.5359378477 -0.6932101890 [6] -0.2869556456 -0.5675047061 -0.2269890866 0.5176011817 -0.7395116672 [11] -0.5451937892 1.0253166426 -0.6738651620 0.4037992202 1.7514742014 [16] 0.6754281427 -0.7176242697 0.1507880402 -1.1317077273 1.2112223503 [21] 2.4496153259 1.0400143112 -0.9843058164 -1.8069474769 1.2450288965 [26] -0.4862186069 -0.8717502026 1.0572125052 -0.4642148338 1.3326089609 [31] 1.7618013694 0.2960023742 -0.8166370971 -0.8424016614 0.6422386555 [36] 2.1422728888 -0.8505193961 0.3953205631 0.2077763684 -1.6259738820 [41] 0.8948332141 0.4584596076 0.0031449707 -0.9977160216 -1.6276642503 [46] -0.0265674695 -0.0735492297 0.6674950022 0.3410759179 0.8150430894 [51] -0.8736387584 0.4699806725 -0.3504680354 1.5476512630 2.4197081557 [56] -0.5176514726 0.0937852503 0.4883559863 0.1268602369 -0.1336044431 [61] -0.9349795332 0.2987328983 -0.1126699624 0.7836022931 0.6826260872 [66] 0.7470992854 0.0881578309 1.9416386803 2.4410651539 0.2642076753 [71] 0.4107522861 -0.4931228670 -1.8439203266 -0.1384477032 0.4539018569 [76] 0.8180876545 1.2725700093 0.4869562137 -0.2414558024 0.2403020820 [81] 0.7502529700 0.1799106568 -0.2776238130 -0.6196272713 0.0651427356 [86] -0.4612713625 1.5073900339 -0.0007586617 -0.3545790559 0.7347639316 [91] 0.3312424615 -0.0777367915 0.2885385096 -0.4688847424 0.5184125435 [96] -0.2183134056 -1.9408575498 0.3860546259 0.4421397825 -0.1574823824 > colSums(tmp) [1] 0.0966762071 0.8160358113 -1.2715836825 0.5359378477 -0.6932101890 [6] -0.2869556456 -0.5675047061 -0.2269890866 0.5176011817 -0.7395116672 [11] -0.5451937892 1.0253166426 -0.6738651620 0.4037992202 1.7514742014 [16] 0.6754281427 -0.7176242697 0.1507880402 -1.1317077273 1.2112223503 [21] 2.4496153259 1.0400143112 -0.9843058164 -1.8069474769 1.2450288965 [26] -0.4862186069 -0.8717502026 1.0572125052 -0.4642148338 1.3326089609 [31] 1.7618013694 0.2960023742 -0.8166370971 -0.8424016614 0.6422386555 [36] 2.1422728888 -0.8505193961 0.3953205631 0.2077763684 -1.6259738820 [41] 0.8948332141 0.4584596076 0.0031449707 -0.9977160216 -1.6276642503 [46] -0.0265674695 -0.0735492297 0.6674950022 0.3410759179 0.8150430894 [51] -0.8736387584 0.4699806725 -0.3504680354 1.5476512630 2.4197081557 [56] -0.5176514726 0.0937852503 0.4883559863 0.1268602369 -0.1336044431 [61] -0.9349795332 0.2987328983 -0.1126699624 0.7836022931 0.6826260872 [66] 0.7470992854 0.0881578309 1.9416386803 2.4410651539 0.2642076753 [71] 0.4107522861 -0.4931228670 -1.8439203266 -0.1384477032 0.4539018569 [76] 0.8180876545 1.2725700093 0.4869562137 -0.2414558024 0.2403020820 [81] 0.7502529700 0.1799106568 -0.2776238130 -0.6196272713 0.0651427356 [86] -0.4612713625 1.5073900339 -0.0007586617 -0.3545790559 0.7347639316 [91] 0.3312424615 -0.0777367915 0.2885385096 -0.4688847424 0.5184125435 [96] -0.2183134056 -1.9408575498 0.3860546259 0.4421397825 -0.1574823824 > colVars(tmp) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > colSd(tmp) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > colMax(tmp) [1] 0.0966762071 0.8160358113 -1.2715836825 0.5359378477 -0.6932101890 [6] -0.2869556456 -0.5675047061 -0.2269890866 0.5176011817 -0.7395116672 [11] -0.5451937892 1.0253166426 -0.6738651620 0.4037992202 1.7514742014 [16] 0.6754281427 -0.7176242697 0.1507880402 -1.1317077273 1.2112223503 [21] 2.4496153259 1.0400143112 -0.9843058164 -1.8069474769 1.2450288965 [26] -0.4862186069 -0.8717502026 1.0572125052 -0.4642148338 1.3326089609 [31] 1.7618013694 0.2960023742 -0.8166370971 -0.8424016614 0.6422386555 [36] 2.1422728888 -0.8505193961 0.3953205631 0.2077763684 -1.6259738820 [41] 0.8948332141 0.4584596076 0.0031449707 -0.9977160216 -1.6276642503 [46] -0.0265674695 -0.0735492297 0.6674950022 0.3410759179 0.8150430894 [51] -0.8736387584 0.4699806725 -0.3504680354 1.5476512630 2.4197081557 [56] -0.5176514726 0.0937852503 0.4883559863 0.1268602369 -0.1336044431 [61] -0.9349795332 0.2987328983 -0.1126699624 0.7836022931 0.6826260872 [66] 0.7470992854 0.0881578309 1.9416386803 2.4410651539 0.2642076753 [71] 0.4107522861 -0.4931228670 -1.8439203266 -0.1384477032 0.4539018569 [76] 0.8180876545 1.2725700093 0.4869562137 -0.2414558024 0.2403020820 [81] 0.7502529700 0.1799106568 -0.2776238130 -0.6196272713 0.0651427356 [86] -0.4612713625 1.5073900339 -0.0007586617 -0.3545790559 0.7347639316 [91] 0.3312424615 -0.0777367915 0.2885385096 -0.4688847424 0.5184125435 [96] -0.2183134056 -1.9408575498 0.3860546259 0.4421397825 -0.1574823824 > colMin(tmp) [1] 0.0966762071 0.8160358113 -1.2715836825 0.5359378477 -0.6932101890 [6] -0.2869556456 -0.5675047061 -0.2269890866 0.5176011817 -0.7395116672 [11] -0.5451937892 1.0253166426 -0.6738651620 0.4037992202 1.7514742014 [16] 0.6754281427 -0.7176242697 0.1507880402 -1.1317077273 1.2112223503 [21] 2.4496153259 1.0400143112 -0.9843058164 -1.8069474769 1.2450288965 [26] -0.4862186069 -0.8717502026 1.0572125052 -0.4642148338 1.3326089609 [31] 1.7618013694 0.2960023742 -0.8166370971 -0.8424016614 0.6422386555 [36] 2.1422728888 -0.8505193961 0.3953205631 0.2077763684 -1.6259738820 [41] 0.8948332141 0.4584596076 0.0031449707 -0.9977160216 -1.6276642503 [46] -0.0265674695 -0.0735492297 0.6674950022 0.3410759179 0.8150430894 [51] -0.8736387584 0.4699806725 -0.3504680354 1.5476512630 2.4197081557 [56] -0.5176514726 0.0937852503 0.4883559863 0.1268602369 -0.1336044431 [61] -0.9349795332 0.2987328983 -0.1126699624 0.7836022931 0.6826260872 [66] 0.7470992854 0.0881578309 1.9416386803 2.4410651539 0.2642076753 [71] 0.4107522861 -0.4931228670 -1.8439203266 -0.1384477032 0.4539018569 [76] 0.8180876545 1.2725700093 0.4869562137 -0.2414558024 0.2403020820 [81] 0.7502529700 0.1799106568 -0.2776238130 -0.6196272713 0.0651427356 [86] -0.4612713625 1.5073900339 -0.0007586617 -0.3545790559 0.7347639316 [91] 0.3312424615 -0.0777367915 0.2885385096 -0.4688847424 0.5184125435 [96] -0.2183134056 -1.9408575498 0.3860546259 0.4421397825 -0.1574823824 > colMedians(tmp) [1] 0.0966762071 0.8160358113 -1.2715836825 0.5359378477 -0.6932101890 [6] -0.2869556456 -0.5675047061 -0.2269890866 0.5176011817 -0.7395116672 [11] -0.5451937892 1.0253166426 -0.6738651620 0.4037992202 1.7514742014 [16] 0.6754281427 -0.7176242697 0.1507880402 -1.1317077273 1.2112223503 [21] 2.4496153259 1.0400143112 -0.9843058164 -1.8069474769 1.2450288965 [26] -0.4862186069 -0.8717502026 1.0572125052 -0.4642148338 1.3326089609 [31] 1.7618013694 0.2960023742 -0.8166370971 -0.8424016614 0.6422386555 [36] 2.1422728888 -0.8505193961 0.3953205631 0.2077763684 -1.6259738820 [41] 0.8948332141 0.4584596076 0.0031449707 -0.9977160216 -1.6276642503 [46] -0.0265674695 -0.0735492297 0.6674950022 0.3410759179 0.8150430894 [51] -0.8736387584 0.4699806725 -0.3504680354 1.5476512630 2.4197081557 [56] -0.5176514726 0.0937852503 0.4883559863 0.1268602369 -0.1336044431 [61] -0.9349795332 0.2987328983 -0.1126699624 0.7836022931 0.6826260872 [66] 0.7470992854 0.0881578309 1.9416386803 2.4410651539 0.2642076753 [71] 0.4107522861 -0.4931228670 -1.8439203266 -0.1384477032 0.4539018569 [76] 0.8180876545 1.2725700093 0.4869562137 -0.2414558024 0.2403020820 [81] 0.7502529700 0.1799106568 -0.2776238130 -0.6196272713 0.0651427356 [86] -0.4612713625 1.5073900339 -0.0007586617 -0.3545790559 0.7347639316 [91] 0.3312424615 -0.0777367915 0.2885385096 -0.4688847424 0.5184125435 [96] -0.2183134056 -1.9408575498 0.3860546259 0.4421397825 -0.1574823824 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.09667621 0.8160358 -1.271584 0.5359378 -0.6932102 -0.2869556 -0.5675047 [2,] 0.09667621 0.8160358 -1.271584 0.5359378 -0.6932102 -0.2869556 -0.5675047 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -0.2269891 0.5176012 -0.7395117 -0.5451938 1.025317 -0.6738652 0.4037992 [2,] -0.2269891 0.5176012 -0.7395117 -0.5451938 1.025317 -0.6738652 0.4037992 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 1.751474 0.6754281 -0.7176243 0.150788 -1.131708 1.211222 2.449615 [2,] 1.751474 0.6754281 -0.7176243 0.150788 -1.131708 1.211222 2.449615 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] 1.040014 -0.9843058 -1.806947 1.245029 -0.4862186 -0.8717502 1.057213 [2,] 1.040014 -0.9843058 -1.806947 1.245029 -0.4862186 -0.8717502 1.057213 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -0.4642148 1.332609 1.761801 0.2960024 -0.8166371 -0.8424017 0.6422387 [2,] -0.4642148 1.332609 1.761801 0.2960024 -0.8166371 -0.8424017 0.6422387 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 2.142273 -0.8505194 0.3953206 0.2077764 -1.625974 0.8948332 0.4584596 [2,] 2.142273 -0.8505194 0.3953206 0.2077764 -1.625974 0.8948332 0.4584596 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 0.003144971 -0.997716 -1.627664 -0.02656747 -0.07354923 0.667495 0.3410759 [2,] 0.003144971 -0.997716 -1.627664 -0.02656747 -0.07354923 0.667495 0.3410759 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [1,] 0.8150431 -0.8736388 0.4699807 -0.350468 1.547651 2.419708 -0.5176515 [2,] 0.8150431 -0.8736388 0.4699807 -0.350468 1.547651 2.419708 -0.5176515 [,57] [,58] [,59] [,60] [,61] [,62] [,63] [1,] 0.09378525 0.488356 0.1268602 -0.1336044 -0.9349795 0.2987329 -0.11267 [2,] 0.09378525 0.488356 0.1268602 -0.1336044 -0.9349795 0.2987329 -0.11267 [,64] [,65] [,66] [,67] [,68] [,69] [,70] [1,] 0.7836023 0.6826261 0.7470993 0.08815783 1.941639 2.441065 0.2642077 [2,] 0.7836023 0.6826261 0.7470993 0.08815783 1.941639 2.441065 0.2642077 [,71] [,72] [,73] [,74] [,75] [,76] [,77] [1,] 0.4107523 -0.4931229 -1.84392 -0.1384477 0.4539019 0.8180877 1.27257 [2,] 0.4107523 -0.4931229 -1.84392 -0.1384477 0.4539019 0.8180877 1.27257 [,78] [,79] [,80] [,81] [,82] [,83] [,84] [1,] 0.4869562 -0.2414558 0.2403021 0.750253 0.1799107 -0.2776238 -0.6196273 [2,] 0.4869562 -0.2414558 0.2403021 0.750253 0.1799107 -0.2776238 -0.6196273 [,85] [,86] [,87] [,88] [,89] [,90] [,91] [1,] 0.06514274 -0.4612714 1.50739 -0.0007586617 -0.3545791 0.7347639 0.3312425 [2,] 0.06514274 -0.4612714 1.50739 -0.0007586617 -0.3545791 0.7347639 0.3312425 [,92] [,93] [,94] [,95] [,96] [,97] [,98] [1,] -0.07773679 0.2885385 -0.4688847 0.5184125 -0.2183134 -1.940858 0.3860546 [2,] -0.07773679 0.2885385 -0.4688847 0.5184125 -0.2183134 -1.940858 0.3860546 [,99] [,100] [1,] 0.4421398 -0.1574824 [2,] 0.4421398 -0.1574824 > > > Max(tmp2) [1] 2.404904 > Min(tmp2) [1] -2.719074 > mean(tmp2) [1] -0.153059 > Sum(tmp2) [1] -15.3059 > Var(tmp2) [1] 1.066 > > rowMeans(tmp2) [1] -1.165372139 -0.666796937 -0.298665870 1.298881321 0.557003855 [6] 0.072498758 -0.933832427 -1.221577771 -1.135054791 2.048257952 [11] -0.822950632 0.331771338 1.019512595 -0.477627035 -2.055076374 [16] 0.835090978 -1.684841322 1.819842162 -0.495288662 -2.065742577 [21] -0.316536369 1.001498224 0.619854179 -0.889461242 2.404903829 [26] 1.681950801 1.361280466 1.121318524 -0.810917426 -1.050275287 [31] 0.102560455 1.442550064 -0.531475101 -0.464880244 -0.056595493 [36] 0.532954467 -0.230321650 -0.700764200 -0.846821010 0.154653480 [41] -0.016825474 -0.226877435 -1.387860715 2.090237087 0.217134249 [46] -0.046804045 -0.058754504 1.070065233 1.488787095 -0.607694807 [51] -0.888241341 -1.822942411 1.626721643 0.458669796 -0.243951571 [56] 0.505696206 0.109210684 -1.013793530 -0.608896140 -1.113980819 [61] -1.174237843 0.066377258 -0.928597195 0.292738902 0.926226135 [66] -0.184547730 -0.934440981 -0.604814358 -1.583552648 0.084731957 [71] -1.251578631 -0.367668246 -0.866963836 -0.420343634 -2.719074458 [76] 0.441537597 0.031040666 1.523761974 -0.253744142 -0.503616681 [81] -0.440992020 0.546139260 -0.684540250 0.661355228 -0.409168713 [86] -0.417120386 1.438555755 -0.868273768 -0.326036887 -0.932878153 [91] 0.412057601 0.392474603 0.538786875 -0.001315633 0.231644530 [96] -1.814684999 -2.399415156 -0.108127101 -1.839330949 0.126331235 > rowSums(tmp2) [1] -1.165372139 -0.666796937 -0.298665870 1.298881321 0.557003855 [6] 0.072498758 -0.933832427 -1.221577771 -1.135054791 2.048257952 [11] -0.822950632 0.331771338 1.019512595 -0.477627035 -2.055076374 [16] 0.835090978 -1.684841322 1.819842162 -0.495288662 -2.065742577 [21] -0.316536369 1.001498224 0.619854179 -0.889461242 2.404903829 [26] 1.681950801 1.361280466 1.121318524 -0.810917426 -1.050275287 [31] 0.102560455 1.442550064 -0.531475101 -0.464880244 -0.056595493 [36] 0.532954467 -0.230321650 -0.700764200 -0.846821010 0.154653480 [41] -0.016825474 -0.226877435 -1.387860715 2.090237087 0.217134249 [46] -0.046804045 -0.058754504 1.070065233 1.488787095 -0.607694807 [51] -0.888241341 -1.822942411 1.626721643 0.458669796 -0.243951571 [56] 0.505696206 0.109210684 -1.013793530 -0.608896140 -1.113980819 [61] -1.174237843 0.066377258 -0.928597195 0.292738902 0.926226135 [66] -0.184547730 -0.934440981 -0.604814358 -1.583552648 0.084731957 [71] -1.251578631 -0.367668246 -0.866963836 -0.420343634 -2.719074458 [76] 0.441537597 0.031040666 1.523761974 -0.253744142 -0.503616681 [81] -0.440992020 0.546139260 -0.684540250 0.661355228 -0.409168713 [86] -0.417120386 1.438555755 -0.868273768 -0.326036887 -0.932878153 [91] 0.412057601 0.392474603 0.538786875 -0.001315633 0.231644530 [96] -1.814684999 -2.399415156 -0.108127101 -1.839330949 0.126331235 > rowVars(tmp2) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > rowSd(tmp2) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > rowMax(tmp2) [1] -1.165372139 -0.666796937 -0.298665870 1.298881321 0.557003855 [6] 0.072498758 -0.933832427 -1.221577771 -1.135054791 2.048257952 [11] -0.822950632 0.331771338 1.019512595 -0.477627035 -2.055076374 [16] 0.835090978 -1.684841322 1.819842162 -0.495288662 -2.065742577 [21] -0.316536369 1.001498224 0.619854179 -0.889461242 2.404903829 [26] 1.681950801 1.361280466 1.121318524 -0.810917426 -1.050275287 [31] 0.102560455 1.442550064 -0.531475101 -0.464880244 -0.056595493 [36] 0.532954467 -0.230321650 -0.700764200 -0.846821010 0.154653480 [41] -0.016825474 -0.226877435 -1.387860715 2.090237087 0.217134249 [46] -0.046804045 -0.058754504 1.070065233 1.488787095 -0.607694807 [51] -0.888241341 -1.822942411 1.626721643 0.458669796 -0.243951571 [56] 0.505696206 0.109210684 -1.013793530 -0.608896140 -1.113980819 [61] -1.174237843 0.066377258 -0.928597195 0.292738902 0.926226135 [66] -0.184547730 -0.934440981 -0.604814358 -1.583552648 0.084731957 [71] -1.251578631 -0.367668246 -0.866963836 -0.420343634 -2.719074458 [76] 0.441537597 0.031040666 1.523761974 -0.253744142 -0.503616681 [81] -0.440992020 0.546139260 -0.684540250 0.661355228 -0.409168713 [86] -0.417120386 1.438555755 -0.868273768 -0.326036887 -0.932878153 [91] 0.412057601 0.392474603 0.538786875 -0.001315633 0.231644530 [96] -1.814684999 -2.399415156 -0.108127101 -1.839330949 0.126331235 > rowMin(tmp2) [1] -1.165372139 -0.666796937 -0.298665870 1.298881321 0.557003855 [6] 0.072498758 -0.933832427 -1.221577771 -1.135054791 2.048257952 [11] -0.822950632 0.331771338 1.019512595 -0.477627035 -2.055076374 [16] 0.835090978 -1.684841322 1.819842162 -0.495288662 -2.065742577 [21] -0.316536369 1.001498224 0.619854179 -0.889461242 2.404903829 [26] 1.681950801 1.361280466 1.121318524 -0.810917426 -1.050275287 [31] 0.102560455 1.442550064 -0.531475101 -0.464880244 -0.056595493 [36] 0.532954467 -0.230321650 -0.700764200 -0.846821010 0.154653480 [41] -0.016825474 -0.226877435 -1.387860715 2.090237087 0.217134249 [46] -0.046804045 -0.058754504 1.070065233 1.488787095 -0.607694807 [51] -0.888241341 -1.822942411 1.626721643 0.458669796 -0.243951571 [56] 0.505696206 0.109210684 -1.013793530 -0.608896140 -1.113980819 [61] -1.174237843 0.066377258 -0.928597195 0.292738902 0.926226135 [66] -0.184547730 -0.934440981 -0.604814358 -1.583552648 0.084731957 [71] -1.251578631 -0.367668246 -0.866963836 -0.420343634 -2.719074458 [76] 0.441537597 0.031040666 1.523761974 -0.253744142 -0.503616681 [81] -0.440992020 0.546139260 -0.684540250 0.661355228 -0.409168713 [86] -0.417120386 1.438555755 -0.868273768 -0.326036887 -0.932878153 [91] 0.412057601 0.392474603 0.538786875 -0.001315633 0.231644530 [96] -1.814684999 -2.399415156 -0.108127101 -1.839330949 0.126331235 > > colMeans(tmp2) [1] -0.153059 > colSums(tmp2) [1] -15.3059 > colVars(tmp2) [1] 1.066 > colSd(tmp2) [1] 1.032473 > colMax(tmp2) [1] 2.404904 > colMin(tmp2) [1] -2.719074 > colMedians(tmp2) [1] -0.2371366 > colRanges(tmp2) [,1] [1,] -2.719074 [2,] 2.404904 > > dataset1 <- matrix(dataset1,1,100) > > agree.checks(tmp,dataset1) > > dataset2 <- matrix(dataset2,100,1) > agree.checks(tmp2,dataset2) > > > tmp <- createBufferedMatrix(10,10) > > tmp[1:10,1:10] <- rnorm(100) > colApply(tmp,sum) [1] -0.03338753 7.31832259 -2.18655653 4.21767959 -1.80198566 -1.28297243 [7] -4.21370073 0.86058904 8.04882990 2.09095038 > colApply(tmp,quantile)[,1] [,1] [1,] -0.984372938 [2,] -0.507592916 [3,] -0.004239053 [4,] 0.609017174 [5,] 0.961833710 > > rowApply(tmp,sum) [1] 1.73783154 2.84868931 -3.27626473 2.96473357 0.01088918 3.88215691 [7] -5.35192469 3.72523409 3.45992729 3.01649616 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 10 5 4 2 4 7 5 7 5 2 [2,] 9 9 8 8 8 9 8 5 9 6 [3,] 7 7 10 4 5 2 9 4 4 1 [4,] 8 2 9 3 10 8 7 8 8 5 [5,] 4 8 2 1 3 4 3 1 7 8 [6,] 3 6 6 7 2 3 2 9 2 4 [7,] 1 1 7 5 1 5 1 3 3 10 [8,] 6 3 3 6 9 6 4 10 6 3 [9,] 5 10 5 10 7 1 10 2 10 9 [10,] 2 4 1 9 6 10 6 6 1 7 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] 1.26659630 3.94125531 5.13688139 -0.74484454 3.15060450 -1.34386254 [7] 1.62652401 -0.42202689 -2.63970817 -0.89898134 2.48076405 2.13829985 [13] 2.75144550 1.71363469 0.09501112 -1.37350181 -4.04667721 -0.90999171 [19] -1.22688005 -1.50445841 > colApply(tmp,quantile)[,1] [,1] [1,] -0.5436862 [2,] -0.1615766 [3,] 0.0527176 [4,] 0.9523703 [5,] 0.9667712 > > rowApply(tmp,sum) [1] 4.800021 7.975035 -3.543256 -2.212537 2.170820 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 7 16 6 15 9 [2,] 12 19 16 13 18 [3,] 14 20 18 20 4 [4,] 11 10 17 2 5 [5,] 2 9 20 14 19 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1615766 0.3368908 0.5480821 0.3105163 -1.0592100 -1.2259415 [2,] 0.9523703 1.6278490 2.1920222 0.2553424 0.2299611 -0.4945709 [3,] -0.5436862 0.6630063 0.8585823 0.6750950 1.8214098 -0.3080876 [4,] 0.9667712 0.2350754 2.0658906 -1.6058465 0.7726338 -0.7729147 [5,] 0.0527176 1.0784337 -0.5276958 -0.3799518 1.3858098 1.4576521 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.5793884 -1.0063986 1.9310325 -0.5599517 0.09685195 1.0175290 [2,] 0.7352194 0.8581102 -1.6017941 1.0688983 1.17980822 0.4587116 [3,] -1.5708512 0.5718180 -2.2458769 -0.6688448 -0.11760707 -0.3003836 [4,] 1.3576619 -0.5572467 -0.9097088 -1.4448024 1.18192270 1.1753674 [5,] 0.5251056 -0.2883098 0.1866391 0.7057193 0.13978824 -0.2129245 [,13] [,14] [,15] [,16] [,17] [,18] [1,] 1.8721621 -0.02415441 0.3866564 0.1097288 -0.5517791 1.4236339 [2,] 0.1963082 0.60250717 -0.3039970 -0.3588516 -0.3012891 0.1732644 [3,] 0.4618255 0.43313189 -0.4093068 1.4890586 -1.5933633 -2.3772982 [4,] -0.1747769 -0.01975669 -0.1452536 -2.4584899 -0.7247089 1.1027964 [5,] 0.3959266 0.72190674 0.5669121 -0.1549478 -0.8755368 -1.2323883 [,19] [,20] [1,] 1.136231664 -0.3596706 [2,] 0.212343934 0.2928219 [3,] -0.007945325 -0.3739323 [4,] -0.894527163 -1.3626247 [5,] -1.672983161 0.2989474 > > > is.BufferedMatrix(tmp) [1] TRUE > > as.BufferedMatrix(as.matrix(tmp)) BufferedMatrix object Matrix size: 5 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 800 bytes. > > > > subBufferedMatrix(tmp,1:5,1:5) BufferedMatrix object Matrix size: 5 5 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 648 bytes. Disk usage : 200 bytes. > subBufferedMatrix(tmp,,5:8) BufferedMatrix object Matrix size: 5 4 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 561 bytes. Disk usage : 160 bytes. > subBufferedMatrix(tmp,1:3,) BufferedMatrix object Matrix size: 3 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 480 bytes. > > > rm(tmp) > > > ### > ### Testing colnames and rownames > ### > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 row1 -0.6618635 0.625387 -1.322472 0.215453 -1.725876 0.6684454 -0.4756606 col8 col9 col10 col11 col12 col13 col14 row1 -1.507418 0.000353224 -0.5521397 0.7874646 1.233456 -1.290914 1.18992 col15 col16 col17 col18 col19 col20 row1 -0.6956476 0.658197 0.9834035 0.1063154 2.307901 -0.4634639 > tmp[,"col10"] col10 row1 -0.55213974 row2 -0.34283650 row3 0.23515840 row4 -0.02337678 row5 -0.02836212 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 row1 -0.6618635 0.6253870 -1.3224717 0.2154530 -1.7258762 0.6684454 -0.4756606 row5 1.0138696 0.3210659 0.1127847 0.1623673 0.7542129 -1.4825075 1.1417598 col8 col9 col10 col11 col12 col13 row1 -1.507418 0.000353224 -0.55213974 0.7874646 1.2334562 -1.2909142 row5 1.082516 -0.548075282 -0.02836212 0.8080317 -0.3951497 0.2575223 col14 col15 col16 col17 col18 col19 row1 1.1899199 -0.6956476 0.6581970 0.9834035 0.1063154 2.3079010 row5 -0.5082577 1.4594561 -0.4622921 -1.2272188 -0.6979306 0.2373884 col20 row1 -0.4634639 row5 1.0344604 > tmp[,c("col6","col20")] col6 col20 row1 0.6684454 -0.4634639 row2 0.5827822 -0.3689643 row3 -1.3350162 -0.0515202 row4 0.1202983 0.7414074 row5 -1.4825075 1.0344604 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 0.6684454 -0.4634639 row5 -1.4825075 1.0344604 > > > > > tmp["row1",] <- rnorm(20,mean=10) > tmp[,"col10"] <- rnorm(5,mean=30) > tmp[c("row1","row5"),] <- rnorm(40,mean=50) > tmp[,c("col6","col20")] <- rnorm(10,mean=75) > tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105) > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 col8 row1 47.39122 50.33443 48.85014 49.11537 50.05355 104.3079 50.41643 50.53215 col9 col10 col11 col12 col13 col14 col15 col16 row1 49.81242 49.35236 49.35072 51.81567 50.7962 47.86172 49.01387 50.02229 col17 col18 col19 col20 row1 49.36201 49.47012 48.5138 104.2288 > tmp[,"col10"] col10 row1 49.35236 row2 31.16340 row3 28.89860 row4 28.24756 row5 50.66785 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 47.39122 50.33443 48.85014 49.11537 50.05355 104.3079 50.41643 50.53215 row5 49.15300 50.15075 50.81044 50.93472 49.90478 105.4222 50.26255 49.43411 col9 col10 col11 col12 col13 col14 col15 col16 row1 49.81242 49.35236 49.35072 51.81567 50.79620 47.86172 49.01387 50.02229 row5 50.60644 50.66785 50.32278 49.86469 49.25846 51.00973 52.59131 51.06750 col17 col18 col19 col20 row1 49.36201 49.47012 48.51380 104.2288 row5 50.72614 51.64471 49.67487 103.9974 > tmp[,c("col6","col20")] col6 col20 row1 104.30791 104.22885 row2 75.19928 74.02859 row3 75.42038 75.09832 row4 75.89154 75.26950 row5 105.42217 103.99742 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 104.3079 104.2288 row5 105.4222 103.9974 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 104.3079 104.2288 row5 105.4222 103.9974 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] -0.6660044 [2,] -0.1625575 [3,] 0.2269506 [4,] -0.3294806 [5,] 0.2995679 > tmp[,c("col17","col7")] col17 col7 [1,] 0.9936407 -0.8287116 [2,] 0.4324726 -0.3825174 [3,] -3.1104551 0.9507832 [4,] -1.7943930 1.1374484 [5,] -0.6616147 -0.5659934 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] 0.6919330 -0.3874444 [2,] -1.5200480 -0.3988692 [3,] -0.1553765 -0.6042198 [4,] -1.3061131 0.1515694 [5,] 0.3896265 0.8651942 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] 0.691933 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] 0.691933 [2,] -1.520048 > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > > > > subBufferedMatrix(tmp,c("row3","row1"),)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row3 1.155679 1.2613704 0.4623955 -0.5838037 -2.032531 -1.022221 -1.5495457 row1 -0.794993 0.6064364 0.1004492 -0.7681391 1.259424 1.951971 0.4470082 [,8] [,9] [,10] [,11] [,12] [,13] row3 -2.08309555 -0.8285564 0.3076328 -1.1681404 -0.1017466 -0.1324009 row1 0.03429419 -1.1434779 -1.7688175 -0.8530641 -1.3464674 -1.6016308 [,14] [,15] [,16] [,17] [,18] [,19] [,20] row3 -1.1320374 1.0849849 0.00372355 -0.7625573 0.3301598 1.720883 2.256794 row1 -0.4468293 -0.2167161 1.19654587 -0.1103081 -0.9103781 -2.087128 -1.176153 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 -1.107806 -0.2390286 -0.5578 -0.7294327 -0.4083651 0.9282283 -2.302358 [,8] [,9] [,10] row2 -0.1850339 0.3510502 1.128397 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 -0.1812004 0.7564524 0.9956431 0.4296583 -0.5156892 -0.6742804 0.7611944 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 -0.1424096 -0.3899406 0.488149 -0.7447689 0.3253446 -0.04874365 -0.4456472 [,15] [,16] [,17] [,18] [,19] [,20] row5 1.014806 0.9295206 2.400194 0.4120841 0.2230856 0.3235435 > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > colnames(tmp) <- NULL > rownames(tmp) <- NULL > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > dimnames(tmp) [[1]] [1] "row1" "row2" "row3" "row4" "row5" [[2]] [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > > dimnames(tmp) <- NULL > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > dimnames(tmp) [[1]] NULL [[2]] [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > > > dimnames(tmp) <- NULL > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > dimnames(tmp) [[1]] [1] "row1" "row2" "row3" "row4" "row5" [[2]] NULL > > dimnames(tmp) <- list(NULL,c(colnames(tmp,do.NULL=FALSE))) > dimnames(tmp) [[1]] NULL [[2]] [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > > > > ### > ### Testing logical indexing > ### > ### > > tmp <- createBufferedMatrix(230,15) > tmp[1:230,1:15] <- rnorm(230*15) > x <-tmp[1:230,1:15] > > for (rep in 1:10){ + which.cols <- sample(c(TRUE,FALSE),15,replace=T) + which.rows <- sample(c(TRUE,FALSE),230,replace=T) + + if (!all(tmp[which.rows,which.cols] == x[which.rows,which.cols])){ + stop("No agreement when logical indexing\n") + } + + if (!all(subBufferedMatrix(tmp,,which.cols)[,1:sum(which.cols)] == x[,which.cols])){ + stop("No agreement when logical indexing in subBufferedMatrix cols\n") + } + if (!all(subBufferedMatrix(tmp,which.rows,)[1:sum(which.rows),] == x[which.rows,])){ + stop("No agreement when logical indexing in subBufferedMatrix rows\n") + } + + + if (!all(subBufferedMatrix(tmp,which.rows,which.cols)[1:sum(which.rows),1:sum(which.cols)]== x[which.rows,which.cols])){ + stop("No agreement when logical indexing in subBufferedMatrix rows and columns\n") + } + } > > > ## > ## Test the ReadOnlyMode > ## > > ReadOnlyMode(tmp) <pointer: 0x600002f98180> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8141631f848" [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8142aa34a5a" [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc81446667094" [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8146f6928a7" [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc81460ec2515" [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8142f76b769" [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8141b0366d7" [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8147c54bb1b" [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8141ec82962" [10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8146714f0b7" [11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc814fc7b340" [12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8147fc936d7" [13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc814732f9ecb" [14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc8143b625c81" [15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc81436a7379c" > > > ### testing coercion functions > ### > > tmp <- as(tmp,"matrix") > tmp <- as(tmp,"BufferedMatrix") > > > > ### testing whether can move storage from one location to another > > MoveStorageDirectory(tmp,"NewDirectory",full.path=FALSE) <pointer: 0x600002f88ae0> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x600002f88ae0> Warning message: In dir.create(new.directory) : '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x600002f88ae0> > rowMedians(tmp) [1] -0.2432192940 -0.6510934101 -0.1431980043 0.1043657164 -0.0389562069 [6] 0.3003645250 0.3498875796 -0.0287990882 -0.4310555846 0.0072890282 [11] -0.0681523524 -0.2230624963 0.2113782596 -0.2830035874 -0.1258033270 [16] 0.0551523608 -0.6912583912 -0.0793834398 -0.1378899148 0.2488811301 [21] -0.1347665635 -0.3459399287 0.0331414555 -0.0678485500 -0.1155893588 [26] 0.0025487238 -0.1310105415 0.6687819194 -0.1666139341 0.0348234185 [31] -0.0254898314 0.0857401089 0.1322752227 1.0710638014 0.0893603334 [36] -0.3338687274 0.0489264071 0.3691808212 0.7120778950 -0.1612062141 [41] 0.0361840938 0.1451168655 -0.0729801563 -0.0370695033 0.4861396199 [46] 0.4705821653 0.0543452025 -0.3155160568 0.4624805748 -0.2272279648 [51] -0.5263436187 -0.0290577053 -0.4240207903 0.7371802107 -0.3792726400 [56] 0.0127992217 -0.3289312132 0.4659880097 0.3448295879 0.0029557280 [61] 0.3011499028 0.2594320569 -0.0649747003 0.1245807574 0.1627250986 [66] 0.2647912638 0.6018627620 0.2095980011 0.2548671394 -0.2091033557 [71] -0.0253916393 0.0680394562 0.0156037124 0.0278934190 0.3905284582 [76] -0.1999112766 0.3297207858 -0.4607412105 -0.5398982793 0.0450685776 [81] 0.3641147991 0.0815341792 0.1030015649 -0.0442939714 -0.2087591642 [86] 0.3283361531 0.6601976050 -0.2618679782 -0.2072121792 -0.1675619642 [91] 0.2745760769 0.1838401026 -0.0972451179 0.3222368354 0.0246580197 [96] -0.0490467165 0.4794478681 -0.0194632823 0.5331649105 0.0008929163 [101] 0.1815013184 -0.6510633729 0.1165433618 0.0459009974 0.0466496627 [106] 0.0432808768 -0.4456989519 -0.4928746678 -0.1360368844 0.0117790968 [111] 0.5856669642 -0.0267923236 0.1487565524 -0.2405767287 -0.3626263277 [116] 0.3033286794 -0.1178566461 -0.3782289598 -0.2644646683 0.2468347280 [121] 0.0676125468 0.4537965596 0.0861924715 0.0030262193 -0.0264133613 [126] -0.1105625114 0.2892655220 -0.2112613271 0.7343657964 0.0252327717 [131] 0.6720981843 0.2262260151 0.1784448062 -0.0848490302 -0.3959891863 [136] 0.4265194644 0.0168863572 -0.1291579566 -0.0210113554 -0.0050026347 [141] 0.5021153326 -0.0048337119 -0.4533768778 0.3499866618 0.1710192577 [146] 0.3095839890 -0.1273662548 0.4281035117 0.2800316349 0.0544372477 [151] -0.0545809061 -0.1345765480 -0.2971623365 0.1951199439 -0.2326033777 [156] -0.6216081865 0.0519496990 0.4348966553 -0.1298254792 -0.4492456249 [161] -0.1683076642 0.3367463552 -0.4407871631 -0.1091468343 -0.5413978087 [166] 0.4494744494 -0.0568366728 -0.3017698692 0.6875057856 -0.4305553041 [171] 0.3996590358 -0.1951758890 -0.0011088088 0.1197314168 -0.1474956617 [176] -0.3846809308 -0.0348129310 0.2554858027 0.3822103327 -0.2961466786 [181] -0.2627443616 0.2345040911 -0.0094540009 -0.0777514218 0.0505870094 [186] -0.3210410240 0.7693880605 0.1249884416 0.1917819812 0.4057930162 [191] 0.3493679632 0.2987616070 -0.3096035229 0.7324941102 0.2880145555 [196] -0.3216262969 0.4182221986 -0.5658744821 -0.2564812909 -0.0389170915 [201] -0.5645915337 -0.1136831827 -0.3766535982 0.6572517508 0.3543020354 [206] -0.1634037720 0.0986018739 -0.3476067083 0.3019792043 0.3374525247 [211] -0.1602405411 -0.5536474797 -0.2940554319 -0.4345915456 0.1508159770 [216] -0.7214627666 -0.0405799777 -0.0042170592 0.0650431673 0.4617370766 [221] -0.1541887942 -0.3767178949 0.0475993299 0.2144058647 -0.5078348149 [226] -0.6207154560 -0.3370043674 -0.0812510423 -0.2609477468 -0.3706590679 > > proc.time() user system elapsed 0.621 3.153 3.828
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: aarch64-apple-darwin20 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. > library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths()); Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums > > prefix <- "dbmtest" > directory <- getwd() > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_Test_C",P) RBufferedMatrix Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Assigning Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001c14660> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001c14660> > .Call("R_bm_Test_C",P) RBufferedMatrix Checking dimensions Rows: 5 Cols: 10 Buffer Rows: 1 Buffer Cols: 1 Assigning Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001c14660> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 10 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000 3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 0.000000 0.000000 0.000000 0.000000 4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001c14660> > rm(P) > > #P <- .Call("R_bm_Destroy",P) > #.Call("R_bm_Destroy",P) > #.Call("R_bm_Test_C",P) > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,5) [1] TRUE > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 0 Buffer Rows: 1 Buffer Cols: 1 Printing Values <pointer: 0x600001c08420> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c08420> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 1 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001c08420> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c08420> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001c08420> > rm(P) > > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,5) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001c08600> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c08600> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001c08600> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001c08600> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 5 Buffer Cols: 5 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001c08600> > > .Call("R_bm_RowMode",P) <pointer: 0x600001c08600> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 5 Buffer Cols: 5 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001c08600> > > .Call("R_bm_ColMode",P) <pointer: 0x600001c08600> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 5 Buffer Cols: 5 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001c08600> > rm(P) > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001c087e0> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x600001c087e0> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c087e0> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c087e0> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFilecab44745a12c" "BufferedMatrixFilecab46ec6f22d" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFilecab44745a12c" "BufferedMatrixFilecab46ec6f22d" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001c08a80> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c08a80> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001c08a80> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001c08a80> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x600001c08a80> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x600001c08a80> > .Call("R_bm_isRowMode",P) [1] FALSE > rm(P) > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001c08c60> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c08c60> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001c08c60> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x600001c08c60> > rm(P) > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_Test_C",P) RBufferedMatrix Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Assigning Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001c08e40> > .Call("R_bm_getValue",P,3,3) [1] 6 > > .Call("R_bm_getValue",P,100000,10000) [1] NA > .Call("R_bm_setValue",P,3,3,12345.0) [1] TRUE > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 12345.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001c08e40> > rm(P) > > proc.time() user system elapsed 0.108 0.034 0.137
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: aarch64-apple-darwin20 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. > library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths()); Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums > > Temp <- createBufferedMatrix(100) > dim(Temp) [1] 100 0 > buffer.dim(Temp) [1] 1 1 > > > proc.time() user system elapsed 0.105 0.020 0.122