Back to Multiple platform build/check report for BioC 3.22:   simplified   long
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2026-01-15 11:58 -0500 (Thu, 15 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4886
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4672
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-12 13:45 -0500 (Mon, 12 Jan 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on nebbiolo2

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.

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-01-12 22:09:27 -0500 (Mon, 12 Jan 2026)
EndedAt: 2026-01-12 22:09:51 -0500 (Mon, 12 Jan 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.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 ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* 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 loading without being on the library search path ... 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 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 re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.22-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-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)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.239   0.046   0.275 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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] "/home/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) max used (Mb)
Ncells 478284 25.6    1046725   56   639600 34.2
Vcells 884773  6.8    8388608   64  2081613 15.9
> 
> 
> 
> 
> ##
> ## 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] "Mon Jan 12 22:09:42 2026"
> 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] "Mon Jan 12 22:09:42 2026"
> 
> 
> 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: 0x5c231cd35370>
> 
> 
> 
> 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] "Mon Jan 12 22:09:42 2026"
> 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] "Mon Jan 12 22:09:42 2026"
> 
> ColMode(tmp2)
<pointer: 0x5c231cd35370>
> 
> 
> 
> ### 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,] 101.1592357 -0.2107201 -1.2121543 -1.1708630
[2,]   0.4261646 -0.7968181  0.1022643 -0.1571572
[3,]   1.2837059 -0.6101959  0.3497481  0.4011717
[4,]  -0.7969544  0.3041202  1.5235770  0.3961141
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 101.1592357 0.2107201 1.2121543 1.1708630
[2,]   0.4261646 0.7968181 0.1022643 0.1571572
[3,]   1.2837059 0.6101959 0.3497481 0.4011717
[4,]   0.7969544 0.3041202 1.5235770 0.3961141
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0577948 0.4590426 1.1009788 1.0820642
[2,]  0.6528128 0.8926467 0.3197878 0.3964305
[3,]  1.1330075 0.7811503 0.5913950 0.6333811
[4,]  0.8927230 0.5514710 1.2343326 0.6293759
> 
> 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:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.73718 29.80115 37.22194 36.99151
[2,]  31.95429 34.72328 28.30014 29.12146
[3,]  37.61378 33.42170 31.26370 31.73498
[4,]  34.72418 30.81883 38.86690 31.68987
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5c231dd319b0>
> exp(tmp5)
<pointer: 0x5c231dd319b0>
> log(tmp5,2)
<pointer: 0x5c231dd319b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.9237
> Min(tmp5)
[1] 54.97727
> mean(tmp5)
[1] 72.20192
> Sum(tmp5)
[1] 14440.38
> Var(tmp5)
[1] 875.945
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.13026 69.48912 72.68915 69.18619 69.90846 71.37895 72.57539 69.59352
 [9] 66.88420 70.18401
> rowSums(tmp5)
 [1] 1802.605 1389.782 1453.783 1383.724 1398.169 1427.579 1451.508 1391.870
 [9] 1337.684 1403.680
> rowVars(tmp5)
 [1] 8130.89389   51.83541   84.59635   84.64562   80.01510   45.47990
 [7]  102.66270   83.74738   31.34114   75.63086
> rowSd(tmp5)
 [1] 90.171469  7.199681  9.197628  9.200305  8.945116  6.743878 10.132261
 [8]  9.151359  5.598316  8.696600
> rowMax(tmp5)
 [1] 471.92374  85.32716  92.47575  85.24742  89.85529  84.59144  91.64619
 [8]  80.96669  77.43318  87.60632
> rowMin(tmp5)
 [1] 58.05298 58.90304 55.92138 55.25080 57.35308 56.14822 57.10836 55.91722
 [9] 56.36520 54.97727
> 
> colMeans(tmp5)
 [1] 112.48359  66.38139  70.37686  72.45308  74.36310  68.84105  73.64868
 [8]  71.27824  68.89906  67.77612  69.98791  71.54463  70.26039  69.04089
[15]  69.61830  67.91320  70.58441  70.31534  72.55516  65.71710
> colSums(tmp5)
 [1] 1124.8359  663.8139  703.7686  724.5308  743.6310  688.4105  736.4868
 [8]  712.7824  688.9906  677.7612  699.8791  715.4463  702.6039  690.4089
[15]  696.1830  679.1320  705.8441  703.1534  725.5516  657.1710
> colVars(tmp5)
 [1] 15989.95911    32.00289   116.35764    84.33452   129.08657    33.79577
 [7]   127.97317    61.63029    41.92298    51.54575    57.68552   113.91727
[13]    69.36693    72.17290    66.26438    56.55693    92.06719    60.34182
[19]    82.39546    26.72809
> colSd(tmp5)
 [1] 126.451410   5.657109  10.786920   9.183383  11.361627   5.813413
 [7]  11.312523   7.850496   6.474796   7.179537   7.595098  10.673203
[13]   8.328681   8.495463   8.140293   7.520434   9.595165   7.768000
[19]   9.077194   5.169921
> colMax(tmp5)
 [1] 471.92374  72.70015  89.85529  87.60632  92.47575  80.92706  90.06250
 [8]  88.10233  80.31528  81.29432  83.34083  86.83029  82.38525  77.43318
[15]  82.06187  78.88830  85.24742  84.59144  88.62831  71.10441
> colMin(tmp5)
 [1] 64.17686 58.16795 57.82169 60.61251 61.00822 62.98808 54.97727 63.00212
 [9] 60.39364 58.89032 59.71841 55.25080 59.52932 55.91722 58.05298 56.83973
[17] 55.92138 57.23939 57.35308 57.11868
> 
> 
> ### 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]       NA 69.48912 72.68915 69.18619 69.90846 71.37895 72.57539 69.59352
 [9] 66.88420 70.18401
> rowSums(tmp5)
 [1]       NA 1389.782 1453.783 1383.724 1398.169 1427.579 1451.508 1391.870
 [9] 1337.684 1403.680
> rowVars(tmp5)
 [1] 8536.42408   51.83541   84.59635   84.64562   80.01510   45.47990
 [7]  102.66270   83.74738   31.34114   75.63086
> rowSd(tmp5)
 [1] 92.392771  7.199681  9.197628  9.200305  8.945116  6.743878 10.132261
 [8]  9.151359  5.598316  8.696600
> rowMax(tmp5)
 [1]       NA 85.32716 92.47575 85.24742 89.85529 84.59144 91.64619 80.96669
 [9] 77.43318 87.60632
> rowMin(tmp5)
 [1]       NA 58.90304 55.92138 55.25080 57.35308 56.14822 57.10836 55.91722
 [9] 56.36520 54.97727
> 
> colMeans(tmp5)
 [1] 112.48359        NA  70.37686  72.45308  74.36310  68.84105  73.64868
 [8]  71.27824  68.89906  67.77612  69.98791  71.54463  70.26039  69.04089
[15]  69.61830  67.91320  70.58441  70.31534  72.55516  65.71710
> colSums(tmp5)
 [1] 1124.8359        NA  703.7686  724.5308  743.6310  688.4105  736.4868
 [8]  712.7824  688.9906  677.7612  699.8791  715.4463  702.6039  690.4089
[15]  696.1830  679.1320  705.8441  703.1534  725.5516  657.1710
> colVars(tmp5)
 [1] 15989.95911          NA   116.35764    84.33452   129.08657    33.79577
 [7]   127.97317    61.63029    41.92298    51.54575    57.68552   113.91727
[13]    69.36693    72.17290    66.26438    56.55693    92.06719    60.34182
[19]    82.39546    26.72809
> colSd(tmp5)
 [1] 126.451410         NA  10.786920   9.183383  11.361627   5.813413
 [7]  11.312523   7.850496   6.474796   7.179537   7.595098  10.673203
[13]   8.328681   8.495463   8.140293   7.520434   9.595165   7.768000
[19]   9.077194   5.169921
> colMax(tmp5)
 [1] 471.92374        NA  89.85529  87.60632  92.47575  80.92706  90.06250
 [8]  88.10233  80.31528  81.29432  83.34083  86.83029  82.38525  77.43318
[15]  82.06187  78.88830  85.24742  84.59144  88.62831  71.10441
> colMin(tmp5)
 [1] 64.17686       NA 57.82169 60.61251 61.00822 62.98808 54.97727 63.00212
 [9] 60.39364 58.89032 59.71841 55.25080 59.52932 55.91722 58.05298 56.83973
[17] 55.92138 57.23939 57.35308 57.11868
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.9237
> Min(tmp5,na.rm=TRUE)
[1] 54.97727
> mean(tmp5,na.rm=TRUE)
[1] 72.25305
> Sum(tmp5,na.rm=TRUE)
[1] 14378.36
> Var(tmp5,na.rm=TRUE)
[1] 879.8435
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.60937 69.48912 72.68915 69.18619 69.90846 71.37895 72.57539 69.59352
 [9] 66.88420 70.18401
> rowSums(tmp5,na.rm=TRUE)
 [1] 1740.578 1389.782 1453.783 1383.724 1398.169 1427.579 1451.508 1391.870
 [9] 1337.684 1403.680
> rowVars(tmp5,na.rm=TRUE)
 [1] 8536.42408   51.83541   84.59635   84.64562   80.01510   45.47990
 [7]  102.66270   83.74738   31.34114   75.63086
> rowSd(tmp5,na.rm=TRUE)
 [1] 92.392771  7.199681  9.197628  9.200305  8.945116  6.743878 10.132261
 [8]  9.151359  5.598316  8.696600
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.92374  85.32716  92.47575  85.24742  89.85529  84.59144  91.64619
 [8]  80.96669  77.43318  87.60632
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.05298 58.90304 55.92138 55.25080 57.35308 56.14822 57.10836 55.91722
 [9] 56.36520 54.97727
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.48359  66.86519  70.37686  72.45308  74.36310  68.84105  73.64868
 [8]  71.27824  68.89906  67.77612  69.98791  71.54463  70.26039  69.04089
[15]  69.61830  67.91320  70.58441  70.31534  72.55516  65.71710
> colSums(tmp5,na.rm=TRUE)
 [1] 1124.8359  601.7867  703.7686  724.5308  743.6310  688.4105  736.4868
 [8]  712.7824  688.9906  677.7612  699.8791  715.4463  702.6039  690.4089
[15]  696.1830  679.1320  705.8441  703.1534  725.5516  657.1710
> colVars(tmp5,na.rm=TRUE)
 [1] 15989.95911    33.37003   116.35764    84.33452   129.08657    33.79577
 [7]   127.97317    61.63029    41.92298    51.54575    57.68552   113.91727
[13]    69.36693    72.17290    66.26438    56.55693    92.06719    60.34182
[19]    82.39546    26.72809
> colSd(tmp5,na.rm=TRUE)
 [1] 126.451410   5.776680  10.786920   9.183383  11.361627   5.813413
 [7]  11.312523   7.850496   6.474796   7.179537   7.595098  10.673203
[13]   8.328681   8.495463   8.140293   7.520434   9.595165   7.768000
[19]   9.077194   5.169921
> colMax(tmp5,na.rm=TRUE)
 [1] 471.92374  72.70015  89.85529  87.60632  92.47575  80.92706  90.06250
 [8]  88.10233  80.31528  81.29432  83.34083  86.83029  82.38525  77.43318
[15]  82.06187  78.88830  85.24742  84.59144  88.62831  71.10441
> colMin(tmp5,na.rm=TRUE)
 [1] 64.17686 58.16795 57.82169 60.61251 61.00822 62.98808 54.97727 63.00212
 [9] 60.39364 58.89032 59.71841 55.25080 59.52932 55.91722 58.05298 56.83973
[17] 55.92138 57.23939 57.35308 57.11868
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 69.48912 72.68915 69.18619 69.90846 71.37895 72.57539 69.59352
 [9] 66.88420 70.18401
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1389.782 1453.783 1383.724 1398.169 1427.579 1451.508 1391.870
 [9] 1337.684 1403.680
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  51.83541  84.59635  84.64562  80.01510  45.47990 102.66270
 [8]  83.74738  31.34114  75.63086
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  7.199681  9.197628  9.200305  8.945116  6.743878 10.132261
 [8]  9.151359  5.598316  8.696600
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 85.32716 92.47575 85.24742 89.85529 84.59144 91.64619 80.96669
 [9] 77.43318 87.60632
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 58.90304 55.92138 55.25080 57.35308 56.14822 57.10836 55.91722
 [9] 56.36520 54.97727
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 72.54580      NaN 69.58844 71.94865 75.84697 69.37194 72.32781 70.64950
 [9] 68.71249 66.27410 70.92928 71.10609 70.23331 69.94274 70.90334 67.76554
[17] 70.51796 70.74453 72.60403 65.32005
> colSums(tmp5,na.rm=TRUE)
 [1] 652.9122   0.0000 626.2960 647.5378 682.6228 624.3474 650.9503 635.8455
 [9] 618.4124 596.4669 638.3635 639.9548 632.0998 629.4847 638.1301 609.8898
[17] 634.6617 636.7007 653.4363 587.8805
> colVars(tmp5,na.rm=TRUE)
 [1]  44.64560        NA 123.90937  92.01375 120.45116  34.84954 124.34213
 [8]  64.88677  46.77173  32.60818  54.92669 125.99329  78.02955  72.04441
[15]  55.97010  63.38125 103.52591  65.81230  92.66802  28.29561
> colSd(tmp5,na.rm=TRUE)
 [1]  6.681736        NA 11.131458  9.592380 10.975025  5.903349 11.150880
 [8]  8.055232  6.838986  5.710357  7.411255 11.224673  8.833434  8.487898
[15]  7.481316  7.961234 10.174769  8.112478  9.626423  5.319362
> colMax(tmp5,na.rm=TRUE)
 [1] 80.64396     -Inf 89.85529 87.60632 92.47575 80.92706 90.06250 88.10233
 [9] 80.31528 74.02756 83.34083 86.83029 82.38525 77.43318 82.06187 78.88830
[17] 85.24742 84.59144 88.62831 71.10441
> colMin(tmp5,na.rm=TRUE)
 [1] 64.17686      Inf 57.82169 60.61251 62.61951 62.98808 54.97727 63.00212
 [9] 60.39364 58.89032 59.71841 55.25080 59.52932 55.91722 59.60145 56.83973
[17] 55.92138 57.23939 57.35308 57.11868
> 
> 
> 
> 
> 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] 216.8128 227.8556 161.5503 208.3119 343.3640 199.9058 249.4231 231.0268
 [9] 270.3664 163.9951
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 216.8128 227.8556 161.5503 208.3119 343.3640 199.9058 249.4231 231.0268
 [9] 270.3664 163.9951
> 
> 
> 
> 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]  0.000000e+00  5.684342e-14 -5.684342e-14 -2.273737e-13 -5.684342e-14
 [6]  4.263256e-14  0.000000e+00  5.684342e-14 -2.842171e-14  0.000000e+00
[11]  8.526513e-14 -1.705303e-13 -5.684342e-14 -5.684342e-14  1.136868e-13
[16] -2.842171e-14 -2.557954e-13  1.136868e-13 -5.684342e-14 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
7   4 
6   1 
3   8 
1   8 
4   17 
10   1 
2   12 
6   19 
5   14 
6   19 
2   11 
1   4 
4   20 
5   6 
7   16 
8   13 
1   13 
9   8 
7   4 
9   5 
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.494194
> Min(tmp)
[1] -3.343938
> mean(tmp)
[1] 0.04502868
> Sum(tmp)
[1] 4.502868
> Var(tmp)
[1] 0.9063928
> 
> rowMeans(tmp)
[1] 0.04502868
> rowSums(tmp)
[1] 4.502868
> rowVars(tmp)
[1] 0.9063928
> rowSd(tmp)
[1] 0.9520466
> rowMax(tmp)
[1] 2.494194
> rowMin(tmp)
[1] -3.343938
> 
> colMeans(tmp)
  [1]  0.622045595  0.126352802 -0.424901892 -3.343938335  1.438783044
  [6]  1.321942909  0.027236390 -0.374325204  2.494193610  0.329408121
 [11]  0.088460800  0.199819523  0.156222417 -0.031428149 -1.477149698
 [16]  0.133358730 -1.846676149  1.783824967  0.515620316  0.272251779
 [21] -1.551350390  1.487589943 -0.301383233 -0.809156030  0.374163719
 [26] -0.090828668 -0.232373808 -1.103681036 -0.736170553 -0.664626057
 [31] -0.051598737  1.056422870 -0.486903404 -1.330049264 -0.087525822
 [36] -0.199209545  1.911982671 -0.181317835  0.526154989  0.159794874
 [41] -0.713955400  0.354660127 -0.123129588  1.276944474  1.860815332
 [46]  0.506791111  0.960544522  0.089599334  0.956715704 -0.893532512
 [51] -1.168907121 -0.258760665 -1.329685258 -0.777991319  0.291203057
 [56] -0.449069922  1.777628787 -0.122023684 -0.690250740  0.139261478
 [61]  0.211220131 -0.391380996  1.634648817 -0.594812736 -0.299394575
 [66] -0.950848669 -0.738468987  0.694010215 -0.874295080  0.264181398
 [71]  0.283286366  0.250670591  0.009964733  0.489775426 -0.450737677
 [76]  1.583265294  0.899540321  0.249056081  0.518486885  0.553103362
 [81]  0.682177026 -1.073939710 -0.042970401  0.332040822  0.780772192
 [86] -0.909663776  0.582574685  1.826395439 -1.831088118  0.350960114
 [91] -0.661024020  0.707640331 -0.626892673 -0.224350830  1.497772503
 [96] -0.703041696 -0.739411070 -0.778699791  0.989600698 -0.385148668
> colSums(tmp)
  [1]  0.622045595  0.126352802 -0.424901892 -3.343938335  1.438783044
  [6]  1.321942909  0.027236390 -0.374325204  2.494193610  0.329408121
 [11]  0.088460800  0.199819523  0.156222417 -0.031428149 -1.477149698
 [16]  0.133358730 -1.846676149  1.783824967  0.515620316  0.272251779
 [21] -1.551350390  1.487589943 -0.301383233 -0.809156030  0.374163719
 [26] -0.090828668 -0.232373808 -1.103681036 -0.736170553 -0.664626057
 [31] -0.051598737  1.056422870 -0.486903404 -1.330049264 -0.087525822
 [36] -0.199209545  1.911982671 -0.181317835  0.526154989  0.159794874
 [41] -0.713955400  0.354660127 -0.123129588  1.276944474  1.860815332
 [46]  0.506791111  0.960544522  0.089599334  0.956715704 -0.893532512
 [51] -1.168907121 -0.258760665 -1.329685258 -0.777991319  0.291203057
 [56] -0.449069922  1.777628787 -0.122023684 -0.690250740  0.139261478
 [61]  0.211220131 -0.391380996  1.634648817 -0.594812736 -0.299394575
 [66] -0.950848669 -0.738468987  0.694010215 -0.874295080  0.264181398
 [71]  0.283286366  0.250670591  0.009964733  0.489775426 -0.450737677
 [76]  1.583265294  0.899540321  0.249056081  0.518486885  0.553103362
 [81]  0.682177026 -1.073939710 -0.042970401  0.332040822  0.780772192
 [86] -0.909663776  0.582574685  1.826395439 -1.831088118  0.350960114
 [91] -0.661024020  0.707640331 -0.626892673 -0.224350830  1.497772503
 [96] -0.703041696 -0.739411070 -0.778699791  0.989600698 -0.385148668
> 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.622045595  0.126352802 -0.424901892 -3.343938335  1.438783044
  [6]  1.321942909  0.027236390 -0.374325204  2.494193610  0.329408121
 [11]  0.088460800  0.199819523  0.156222417 -0.031428149 -1.477149698
 [16]  0.133358730 -1.846676149  1.783824967  0.515620316  0.272251779
 [21] -1.551350390  1.487589943 -0.301383233 -0.809156030  0.374163719
 [26] -0.090828668 -0.232373808 -1.103681036 -0.736170553 -0.664626057
 [31] -0.051598737  1.056422870 -0.486903404 -1.330049264 -0.087525822
 [36] -0.199209545  1.911982671 -0.181317835  0.526154989  0.159794874
 [41] -0.713955400  0.354660127 -0.123129588  1.276944474  1.860815332
 [46]  0.506791111  0.960544522  0.089599334  0.956715704 -0.893532512
 [51] -1.168907121 -0.258760665 -1.329685258 -0.777991319  0.291203057
 [56] -0.449069922  1.777628787 -0.122023684 -0.690250740  0.139261478
 [61]  0.211220131 -0.391380996  1.634648817 -0.594812736 -0.299394575
 [66] -0.950848669 -0.738468987  0.694010215 -0.874295080  0.264181398
 [71]  0.283286366  0.250670591  0.009964733  0.489775426 -0.450737677
 [76]  1.583265294  0.899540321  0.249056081  0.518486885  0.553103362
 [81]  0.682177026 -1.073939710 -0.042970401  0.332040822  0.780772192
 [86] -0.909663776  0.582574685  1.826395439 -1.831088118  0.350960114
 [91] -0.661024020  0.707640331 -0.626892673 -0.224350830  1.497772503
 [96] -0.703041696 -0.739411070 -0.778699791  0.989600698 -0.385148668
> colMin(tmp)
  [1]  0.622045595  0.126352802 -0.424901892 -3.343938335  1.438783044
  [6]  1.321942909  0.027236390 -0.374325204  2.494193610  0.329408121
 [11]  0.088460800  0.199819523  0.156222417 -0.031428149 -1.477149698
 [16]  0.133358730 -1.846676149  1.783824967  0.515620316  0.272251779
 [21] -1.551350390  1.487589943 -0.301383233 -0.809156030  0.374163719
 [26] -0.090828668 -0.232373808 -1.103681036 -0.736170553 -0.664626057
 [31] -0.051598737  1.056422870 -0.486903404 -1.330049264 -0.087525822
 [36] -0.199209545  1.911982671 -0.181317835  0.526154989  0.159794874
 [41] -0.713955400  0.354660127 -0.123129588  1.276944474  1.860815332
 [46]  0.506791111  0.960544522  0.089599334  0.956715704 -0.893532512
 [51] -1.168907121 -0.258760665 -1.329685258 -0.777991319  0.291203057
 [56] -0.449069922  1.777628787 -0.122023684 -0.690250740  0.139261478
 [61]  0.211220131 -0.391380996  1.634648817 -0.594812736 -0.299394575
 [66] -0.950848669 -0.738468987  0.694010215 -0.874295080  0.264181398
 [71]  0.283286366  0.250670591  0.009964733  0.489775426 -0.450737677
 [76]  1.583265294  0.899540321  0.249056081  0.518486885  0.553103362
 [81]  0.682177026 -1.073939710 -0.042970401  0.332040822  0.780772192
 [86] -0.909663776  0.582574685  1.826395439 -1.831088118  0.350960114
 [91] -0.661024020  0.707640331 -0.626892673 -0.224350830  1.497772503
 [96] -0.703041696 -0.739411070 -0.778699791  0.989600698 -0.385148668
> colMedians(tmp)
  [1]  0.622045595  0.126352802 -0.424901892 -3.343938335  1.438783044
  [6]  1.321942909  0.027236390 -0.374325204  2.494193610  0.329408121
 [11]  0.088460800  0.199819523  0.156222417 -0.031428149 -1.477149698
 [16]  0.133358730 -1.846676149  1.783824967  0.515620316  0.272251779
 [21] -1.551350390  1.487589943 -0.301383233 -0.809156030  0.374163719
 [26] -0.090828668 -0.232373808 -1.103681036 -0.736170553 -0.664626057
 [31] -0.051598737  1.056422870 -0.486903404 -1.330049264 -0.087525822
 [36] -0.199209545  1.911982671 -0.181317835  0.526154989  0.159794874
 [41] -0.713955400  0.354660127 -0.123129588  1.276944474  1.860815332
 [46]  0.506791111  0.960544522  0.089599334  0.956715704 -0.893532512
 [51] -1.168907121 -0.258760665 -1.329685258 -0.777991319  0.291203057
 [56] -0.449069922  1.777628787 -0.122023684 -0.690250740  0.139261478
 [61]  0.211220131 -0.391380996  1.634648817 -0.594812736 -0.299394575
 [66] -0.950848669 -0.738468987  0.694010215 -0.874295080  0.264181398
 [71]  0.283286366  0.250670591  0.009964733  0.489775426 -0.450737677
 [76]  1.583265294  0.899540321  0.249056081  0.518486885  0.553103362
 [81]  0.682177026 -1.073939710 -0.042970401  0.332040822  0.780772192
 [86] -0.909663776  0.582574685  1.826395439 -1.831088118  0.350960114
 [91] -0.661024020  0.707640331 -0.626892673 -0.224350830  1.497772503
 [96] -0.703041696 -0.739411070 -0.778699791  0.989600698 -0.385148668
> colRanges(tmp)
          [,1]      [,2]       [,3]      [,4]     [,5]     [,6]       [,7]
[1,] 0.6220456 0.1263528 -0.4249019 -3.343938 1.438783 1.321943 0.02723639
[2,] 0.6220456 0.1263528 -0.4249019 -3.343938 1.438783 1.321943 0.02723639
           [,8]     [,9]     [,10]     [,11]     [,12]     [,13]       [,14]
[1,] -0.3743252 2.494194 0.3294081 0.0884608 0.1998195 0.1562224 -0.03142815
[2,] -0.3743252 2.494194 0.3294081 0.0884608 0.1998195 0.1562224 -0.03142815
        [,15]     [,16]     [,17]    [,18]     [,19]     [,20]    [,21]   [,22]
[1,] -1.47715 0.1333587 -1.846676 1.783825 0.5156203 0.2722518 -1.55135 1.48759
[2,] -1.47715 0.1333587 -1.846676 1.783825 0.5156203 0.2722518 -1.55135 1.48759
          [,23]     [,24]     [,25]       [,26]      [,27]     [,28]      [,29]
[1,] -0.3013832 -0.809156 0.3741637 -0.09082867 -0.2323738 -1.103681 -0.7361706
[2,] -0.3013832 -0.809156 0.3741637 -0.09082867 -0.2323738 -1.103681 -0.7361706
          [,30]       [,31]    [,32]      [,33]     [,34]       [,35]
[1,] -0.6646261 -0.05159874 1.056423 -0.4869034 -1.330049 -0.08752582
[2,] -0.6646261 -0.05159874 1.056423 -0.4869034 -1.330049 -0.08752582
          [,36]    [,37]      [,38]    [,39]     [,40]      [,41]     [,42]
[1,] -0.1992095 1.911983 -0.1813178 0.526155 0.1597949 -0.7139554 0.3546601
[2,] -0.1992095 1.911983 -0.1813178 0.526155 0.1597949 -0.7139554 0.3546601
          [,43]    [,44]    [,45]     [,46]     [,47]      [,48]     [,49]
[1,] -0.1231296 1.276944 1.860815 0.5067911 0.9605445 0.08959933 0.9567157
[2,] -0.1231296 1.276944 1.860815 0.5067911 0.9605445 0.08959933 0.9567157
          [,50]     [,51]      [,52]     [,53]      [,54]     [,55]      [,56]
[1,] -0.8935325 -1.168907 -0.2587607 -1.329685 -0.7779913 0.2912031 -0.4490699
[2,] -0.8935325 -1.168907 -0.2587607 -1.329685 -0.7779913 0.2912031 -0.4490699
        [,57]      [,58]      [,59]     [,60]     [,61]     [,62]    [,63]
[1,] 1.777629 -0.1220237 -0.6902507 0.1392615 0.2112201 -0.391381 1.634649
[2,] 1.777629 -0.1220237 -0.6902507 0.1392615 0.2112201 -0.391381 1.634649
          [,64]      [,65]      [,66]     [,67]     [,68]      [,69]     [,70]
[1,] -0.5948127 -0.2993946 -0.9508487 -0.738469 0.6940102 -0.8742951 0.2641814
[2,] -0.5948127 -0.2993946 -0.9508487 -0.738469 0.6940102 -0.8742951 0.2641814
         [,71]     [,72]       [,73]     [,74]      [,75]    [,76]     [,77]
[1,] 0.2832864 0.2506706 0.009964733 0.4897754 -0.4507377 1.583265 0.8995403
[2,] 0.2832864 0.2506706 0.009964733 0.4897754 -0.4507377 1.583265 0.8995403
         [,78]     [,79]     [,80]    [,81]    [,82]      [,83]     [,84]
[1,] 0.2490561 0.5184869 0.5531034 0.682177 -1.07394 -0.0429704 0.3320408
[2,] 0.2490561 0.5184869 0.5531034 0.682177 -1.07394 -0.0429704 0.3320408
         [,85]      [,86]     [,87]    [,88]     [,89]     [,90]     [,91]
[1,] 0.7807722 -0.9096638 0.5825747 1.826395 -1.831088 0.3509601 -0.661024
[2,] 0.7807722 -0.9096638 0.5825747 1.826395 -1.831088 0.3509601 -0.661024
         [,92]      [,93]      [,94]    [,95]      [,96]      [,97]      [,98]
[1,] 0.7076403 -0.6268927 -0.2243508 1.497773 -0.7030417 -0.7394111 -0.7786998
[2,] 0.7076403 -0.6268927 -0.2243508 1.497773 -0.7030417 -0.7394111 -0.7786998
         [,99]     [,100]
[1,] 0.9896007 -0.3851487
[2,] 0.9896007 -0.3851487
> 
> 
> Max(tmp2)
[1] 2.843563
> Min(tmp2)
[1] -2.739669
> mean(tmp2)
[1] 0.06630719
> Sum(tmp2)
[1] 6.630719
> Var(tmp2)
[1] 0.8699063
> 
> rowMeans(tmp2)
  [1]  0.361177250 -0.605823511  1.152284133 -0.786191789  1.106665073
  [6] -0.209612751 -0.400832202 -0.857127858  1.899947775  1.402502084
 [11] -0.431056247  0.208842081  1.848799400  1.828357540 -1.230260084
 [16]  2.188738782  0.458605616 -1.586521824 -0.416694073 -0.076386127
 [21] -0.838003547 -0.502149760  0.709553632  0.076368989 -1.292862181
 [26]  0.513694213 -1.122080369 -0.244445196  0.118575909  0.804670813
 [31] -0.892304213 -0.700889553 -0.434594630  0.239009969 -2.739668760
 [36]  1.025332619  0.692583420 -0.050749836  1.362730250  0.730552095
 [41]  0.944149234 -0.833801652 -0.231502574  0.599015621 -0.338530220
 [46] -0.003473357 -0.010223207 -0.653539511 -1.158633107  0.308282297
 [51] -0.091692871 -0.426829884  0.505024373  1.401291275  0.091822716
 [56] -0.310779826  0.078409983 -0.307922276  2.037459410 -0.362105074
 [61]  0.285103434 -0.778082655 -0.874556703 -1.316007353  0.284147491
 [66] -0.654170400  0.379726004  0.340769083 -0.461917949 -0.366570080
 [71]  0.246427851  0.701680524  0.138818019  0.051769860  1.372564136
 [76]  0.096299337  0.823344606  1.184966116  0.879277331 -0.895455716
 [81]  2.843562968 -0.182547379  0.866087124  0.526174532  0.036474299
 [86] -0.512772016  0.251110160 -0.842315377  0.157906413 -0.746284081
 [91] -0.582765648 -0.801838035  1.953603457 -0.666969044  1.465266795
 [96] -0.677475556 -0.596442162 -0.365587839 -1.147039710 -0.332721371
> rowSums(tmp2)
  [1]  0.361177250 -0.605823511  1.152284133 -0.786191789  1.106665073
  [6] -0.209612751 -0.400832202 -0.857127858  1.899947775  1.402502084
 [11] -0.431056247  0.208842081  1.848799400  1.828357540 -1.230260084
 [16]  2.188738782  0.458605616 -1.586521824 -0.416694073 -0.076386127
 [21] -0.838003547 -0.502149760  0.709553632  0.076368989 -1.292862181
 [26]  0.513694213 -1.122080369 -0.244445196  0.118575909  0.804670813
 [31] -0.892304213 -0.700889553 -0.434594630  0.239009969 -2.739668760
 [36]  1.025332619  0.692583420 -0.050749836  1.362730250  0.730552095
 [41]  0.944149234 -0.833801652 -0.231502574  0.599015621 -0.338530220
 [46] -0.003473357 -0.010223207 -0.653539511 -1.158633107  0.308282297
 [51] -0.091692871 -0.426829884  0.505024373  1.401291275  0.091822716
 [56] -0.310779826  0.078409983 -0.307922276  2.037459410 -0.362105074
 [61]  0.285103434 -0.778082655 -0.874556703 -1.316007353  0.284147491
 [66] -0.654170400  0.379726004  0.340769083 -0.461917949 -0.366570080
 [71]  0.246427851  0.701680524  0.138818019  0.051769860  1.372564136
 [76]  0.096299337  0.823344606  1.184966116  0.879277331 -0.895455716
 [81]  2.843562968 -0.182547379  0.866087124  0.526174532  0.036474299
 [86] -0.512772016  0.251110160 -0.842315377  0.157906413 -0.746284081
 [91] -0.582765648 -0.801838035  1.953603457 -0.666969044  1.465266795
 [96] -0.677475556 -0.596442162 -0.365587839 -1.147039710 -0.332721371
> 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]  0.361177250 -0.605823511  1.152284133 -0.786191789  1.106665073
  [6] -0.209612751 -0.400832202 -0.857127858  1.899947775  1.402502084
 [11] -0.431056247  0.208842081  1.848799400  1.828357540 -1.230260084
 [16]  2.188738782  0.458605616 -1.586521824 -0.416694073 -0.076386127
 [21] -0.838003547 -0.502149760  0.709553632  0.076368989 -1.292862181
 [26]  0.513694213 -1.122080369 -0.244445196  0.118575909  0.804670813
 [31] -0.892304213 -0.700889553 -0.434594630  0.239009969 -2.739668760
 [36]  1.025332619  0.692583420 -0.050749836  1.362730250  0.730552095
 [41]  0.944149234 -0.833801652 -0.231502574  0.599015621 -0.338530220
 [46] -0.003473357 -0.010223207 -0.653539511 -1.158633107  0.308282297
 [51] -0.091692871 -0.426829884  0.505024373  1.401291275  0.091822716
 [56] -0.310779826  0.078409983 -0.307922276  2.037459410 -0.362105074
 [61]  0.285103434 -0.778082655 -0.874556703 -1.316007353  0.284147491
 [66] -0.654170400  0.379726004  0.340769083 -0.461917949 -0.366570080
 [71]  0.246427851  0.701680524  0.138818019  0.051769860  1.372564136
 [76]  0.096299337  0.823344606  1.184966116  0.879277331 -0.895455716
 [81]  2.843562968 -0.182547379  0.866087124  0.526174532  0.036474299
 [86] -0.512772016  0.251110160 -0.842315377  0.157906413 -0.746284081
 [91] -0.582765648 -0.801838035  1.953603457 -0.666969044  1.465266795
 [96] -0.677475556 -0.596442162 -0.365587839 -1.147039710 -0.332721371
> rowMin(tmp2)
  [1]  0.361177250 -0.605823511  1.152284133 -0.786191789  1.106665073
  [6] -0.209612751 -0.400832202 -0.857127858  1.899947775  1.402502084
 [11] -0.431056247  0.208842081  1.848799400  1.828357540 -1.230260084
 [16]  2.188738782  0.458605616 -1.586521824 -0.416694073 -0.076386127
 [21] -0.838003547 -0.502149760  0.709553632  0.076368989 -1.292862181
 [26]  0.513694213 -1.122080369 -0.244445196  0.118575909  0.804670813
 [31] -0.892304213 -0.700889553 -0.434594630  0.239009969 -2.739668760
 [36]  1.025332619  0.692583420 -0.050749836  1.362730250  0.730552095
 [41]  0.944149234 -0.833801652 -0.231502574  0.599015621 -0.338530220
 [46] -0.003473357 -0.010223207 -0.653539511 -1.158633107  0.308282297
 [51] -0.091692871 -0.426829884  0.505024373  1.401291275  0.091822716
 [56] -0.310779826  0.078409983 -0.307922276  2.037459410 -0.362105074
 [61]  0.285103434 -0.778082655 -0.874556703 -1.316007353  0.284147491
 [66] -0.654170400  0.379726004  0.340769083 -0.461917949 -0.366570080
 [71]  0.246427851  0.701680524  0.138818019  0.051769860  1.372564136
 [76]  0.096299337  0.823344606  1.184966116  0.879277331 -0.895455716
 [81]  2.843562968 -0.182547379  0.866087124  0.526174532  0.036474299
 [86] -0.512772016  0.251110160 -0.842315377  0.157906413 -0.746284081
 [91] -0.582765648 -0.801838035  1.953603457 -0.666969044  1.465266795
 [96] -0.677475556 -0.596442162 -0.365587839 -1.147039710 -0.332721371
> 
> colMeans(tmp2)
[1] 0.06630719
> colSums(tmp2)
[1] 6.630719
> colVars(tmp2)
[1] 0.8699063
> colSd(tmp2)
[1] 0.9326877
> colMax(tmp2)
[1] 2.843563
> colMin(tmp2)
[1] -2.739669
> colMedians(tmp2)
[1] -0.006848282
> colRanges(tmp2)
          [,1]
[1,] -2.739669
[2,]  2.843563
> 
> 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] -1.1681415  0.3543329 -0.2525929  0.5674405  4.3975116 -1.2636255
 [7]  4.4310629 -2.5635992  4.0860707  6.7634701
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.18285407
[2,] -0.68579780
[3,] -0.02080333
[4,]  0.52328489
[5,]  1.64347422
> 
> rowApply(tmp,sum)
 [1]  2.0452506  1.0545731  3.2185974  0.3957538  5.0050510 -0.2330379
 [7]  5.3728421  1.2186548  0.9941630 -3.7199182
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    9    2    3    9    6    4    1    2     3
 [2,]    6    1    3    8    8    3    1    4    8    10
 [3,]    1    5    6    6    4    2    9    8    4     6
 [4,]    7    2    7    5    5   10    3    5    3     2
 [5,]    3    7    4   10    7    7    6   10    7     9
 [6,]    4    3    9    7    2    1    5    2   10     4
 [7,]    2   10    5    4    6    4   10    9    1     8
 [8,]   10    4    1    1    3    5    2    3    6     5
 [9,]    5    8   10    2    1    8    8    7    9     1
[10,]    9    6    8    9   10    9    7    6    5     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.50190282  0.86567600 -2.72795643 -0.22841638  0.11373693  0.41330427
 [7] -1.55214093  2.94579857  2.58002082  3.53866662  0.08837278  2.92120283
[13]  0.95889779  1.84840148 -1.48649696  0.44575275 -4.64835756  3.57367617
[19] -1.90660195 -1.05484274
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8174086
[2,] -0.9064591
[3,] -0.8879682
[4,]  0.3666246
[5,]  0.7433085
> 
> rowApply(tmp,sum)
[1] -0.873991536  0.622966176  0.111277037  0.004305588  4.322233940
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15    1   16    3    3
[2,]    8    8   14   11   16
[3,]   19    2    6    6    2
[4,]    4   10    9   15    9
[5,]    7   18    5   10    8
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]        [,5]        [,6]
[1,]  0.3666246 -0.36639226  0.8527075 -0.7618595 -0.39285030  0.07710151
[2,] -1.8174086 -0.39795185 -1.3569841 -0.1163527  1.44898875  0.18116250
[3,]  0.7433085  0.63326336 -0.4950202  0.2057765 -0.98257454  0.30057314
[4,] -0.8879682 -0.08304114 -0.3911860  0.2331801 -0.09916354 -0.35691996
[5,] -0.9064591  1.07979789 -1.3374736  0.2108392  0.13933655  0.21138709
           [,7]        [,8]        [,9]     [,10]      [,11]      [,12]
[1,] -0.0918141 -0.09608247 -0.34496100 0.7275560  2.1332726 0.09124584
[2,] -0.4549193  0.45025524  0.91930607 1.4636722 -0.1523063 1.14316289
[3,] -1.9238656  1.88958251 -0.07932555 0.5519022 -0.1678910 0.69403407
[4,]  1.7657383 -0.57856135  1.42722722 0.1878261  0.1512554 0.73065276
[5,] -0.8472802  1.28060464  0.65777408 0.6077101 -1.8759579 0.26210726
          [,13]     [,14]      [,15]      [,16]       [,17]      [,18]
[1,] -0.3938909 -1.468332 -0.8157679 -0.3468354 -0.64460358 -0.9655042
[2,] -1.2756863  1.657913  0.7357133 -1.1614471 -1.08915370  0.9925217
[3,]  0.8764706  1.236880 -1.3796391  0.3178537 -2.15962448  1.4014465
[4,] -0.3132062 -0.760420 -0.3184700  1.7608988  0.05287633  0.3876929
[5,]  2.0652106  1.182359  0.2916668 -0.1247173 -0.80785214  1.7575192
          [,19]       [,20]
[1,]  0.8225907  0.74380306
[2,] -0.5952250  0.04770524
[3,] -1.8366100  0.28473594
[4,] -1.1712177 -1.73288832
[5,]  0.8738601 -0.39819867
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/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:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/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.06866676 -1.087034 -1.03858 1.528374 -0.5223012 0.3530989 -0.7725881
         col8      col9      col10    col11       col12      col13   col14
row1 1.041226 0.4460632 -0.4927826 1.876148 -0.02395372 -0.8914898 1.78085
         col15     col16      col17      col18    col19     col20
row1 -1.402067 -2.077017 -0.2621083 -0.1698218 1.280314 0.6818309
> tmp[,"col10"]
          col10
row1 -0.4927826
row2  0.9081065
row3  0.5506221
row4 -0.6448453
row5 -0.3960525
> tmp[c("row1","row5"),]
            col1      col2      col3      col4       col5      col6       col7
row1 -0.06866676 -1.087034 -1.038580 1.5283742 -0.5223012 0.3530989 -0.7725881
row5 -0.78693247  0.364251  0.753738 0.1865841 -0.5250215 1.0795053  0.8227968
          col8       col9      col10     col11       col12      col13
row1  1.041226  0.4460632 -0.4927826 1.8761477 -0.02395372 -0.8914898
row5 -1.766714 -2.3273222 -0.3960525 0.4616141 -0.46001567 -1.4839412
          col14      col15       col16      col17      col18      col19
row1  1.7808500 -1.4020667 -2.07701662 -0.2621083 -0.1698218  1.2803136
row5 -0.6351194  0.1277307 -0.08412469 -0.6973153  0.2680801 -0.6432226
         col20
row1 0.6818309
row5 1.0104065
> tmp[,c("col6","col20")]
           col6      col20
row1  0.3530989  0.6818309
row2  0.6780606 -0.6810540
row3 -0.2014580 -0.3911186
row4  1.0927322 -1.2742446
row5  1.0795053  1.0104065
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1 0.3530989 0.6818309
row5 1.0795053 1.0104065
> 
> 
> 
> 
> 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 50.70564 50.45939 50.35674 49.49196 50.26218 105.7677 49.15694 48.22996
         col9    col10    col11   col12    col13    col14    col15    col16
row1 50.03004 49.45909 48.91192 49.3829 46.92707 51.14776 49.97088 50.80323
        col17    col18    col19    col20
row1 49.56419 49.73807 50.86084 105.5821
> tmp[,"col10"]
        col10
row1 49.45909
row2 30.32571
row3 29.89851
row4 30.49098
row5 50.93216
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.70564 50.45939 50.35674 49.49196 50.26218 105.7677 49.15694 48.22996
row5 49.73808 50.04193 49.75476 48.28552 50.98126 103.4508 50.47489 50.69457
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.03004 49.45909 48.91192 49.38290 46.92707 51.14776 49.97088 50.80323
row5 49.92833 50.93216 49.07706 49.51241 50.79262 50.54702 49.30887 52.28745
        col17    col18    col19    col20
row1 49.56419 49.73807 50.86084 105.5821
row5 52.49994 50.28871 49.17951 104.8141
> tmp[,c("col6","col20")]
          col6     col20
row1 105.76766 105.58214
row2  74.83931  75.87560
row3  74.53087  75.66713
row4  75.29130  75.62774
row5 103.45081 104.81415
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7677 105.5821
row5 103.4508 104.8141
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7677 105.5821
row5 103.4508 104.8141
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.7526368
[2,] -1.8568709
[3,] -0.6897805
[4,] -0.5961660
[5,]  0.6010085
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.5272603 -0.21269894
[2,]  0.4605608  0.36107008
[3,]  0.9875991 -0.07211715
[4,] -1.2666184  0.37975677
[5,] -1.4479813 -0.30702352
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.5681039 -1.6138569
[2,]  1.0686840  0.4637844
[3,] -0.3202134  1.6789271
[4,]  2.7503572 -0.8791836
[5,]  0.8446649  0.3979375
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.5681039
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.5681039
[2,] 1.0686840
> 
> 
> 
> 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 0.5862857  0.1319525 -0.8243812  0.9438292  2.5487169 1.6961142  1.8290968
row1 0.6866613 -0.3302455  0.4850446 -0.2858952 -0.5358334 0.9681791 -0.6442747
           [,8]       [,9]       [,10]      [,11]       [,12]      [,13]
row3  0.6791524  0.1965890 -2.27886881 -0.3764709 -0.48702553 -2.1782170
row1 -0.3740073 -0.2444768 -0.08382065 -0.8058981  0.09092256 -0.1151769
          [,14]    [,15]     [,16]      [,17]      [,18]      [,19]      [,20]
row3 -0.1332193 1.081406 -0.110244  0.2468780 -0.2983254  0.3268068 -1.8342542
row1 -0.4367102 0.552764  1.694532 -0.4323043  0.8197818 -0.1873402  0.1902193
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]       [,3]       [,4]      [,5]       [,6]       [,7]
row2 2.226981 -0.5499932 -0.3476727 -0.7404941 0.6539505 -0.5667577 -0.7011841
          [,8]     [,9]     [,10]
row2 -1.272659 2.106453 -1.528673
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]      [,3]       [,4]       [,5]        [,6]     [,7]
row5 0.671659 0.4844969 0.2595819 -0.2104469 0.07910978 -0.04338866 1.355734
          [,8]      [,9]     [,10]       [,11]     [,12]     [,13]     [,14]
row5 0.6923835 -1.026941 0.5215266 -0.04657201 -1.898057 -0.784287 0.9086701
       [,15]     [,16]      [,17]    [,18]      [,19]     [,20]
row5 1.37311 0.6072618 -0.6122071 1.757229 0.05832715 -1.056807
> 
> 
> 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: 0x5c231da32ed0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b2a465f96"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b4c3152bd"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b65b177d7"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b1a9c7d9c"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b6a362746"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b200174b3"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b2cf35484"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b57a1e248"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5bcb8292b" 
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b1c60deeb"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b2d6658c5"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5bb539494" 
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b4af335f1"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b4c088c71"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM127a5b5a32a9d9"
> 
> 
> ### 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: 0x5c231e284150>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5c231e284150>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5c231e284150>
> rowMedians(tmp)
  [1]  5.148907e-01  1.093272e-01  6.579084e-01  1.994509e-01 -1.833722e-01
  [6] -2.395649e-01 -7.468918e-01 -2.338463e-02 -1.656382e-01  2.706874e-01
 [11]  5.551737e-02 -3.140367e-02  1.020290e-01  1.726721e-01  4.945456e-01
 [16]  2.492470e-01 -4.260638e-02  7.205701e-01  4.431561e-01 -2.802710e-01
 [21]  8.085634e-02  2.550723e-01  5.711951e-01  9.731504e-02  8.770716e-02
 [26]  2.697972e-01 -2.307850e-02  4.809820e-02 -5.557768e-01 -5.981748e-01
 [31] -9.652300e-03 -2.612436e-01 -4.388651e-02  2.889223e-01 -1.658294e-01
 [36]  2.250784e-01 -2.008878e-01  7.993171e-01 -2.643924e-01  5.341796e-01
 [41]  6.983828e-01 -1.976929e-01  9.170456e-03  3.126869e-01  3.339458e-02
 [46]  1.778862e-01  4.792450e-01  1.824128e-01 -3.304747e-02  2.447618e-01
 [51] -4.505250e-01 -1.226475e-01  2.171812e-01  5.042008e-04 -6.098470e-02
 [56] -7.459783e-04  7.985118e-01 -6.984734e-01 -3.965428e-01  1.467634e-01
 [61]  1.275593e-01 -1.615016e-02 -4.770516e-01  3.987669e-01  4.382962e-01
 [66]  2.965494e-01 -4.901646e-01  1.177752e-01  8.709594e-02  2.096518e-01
 [71]  2.552247e-01 -5.496169e-02 -1.865338e-01 -5.772437e-01 -1.761522e-01
 [76] -5.675492e-01 -1.350759e-01 -3.626061e-01  2.491079e-01 -8.330087e-01
 [81] -2.634370e-01  1.700496e-01  8.491479e-01 -2.911144e-01 -2.659907e-02
 [86] -4.596553e-01 -3.824325e-01 -4.677534e-01  1.448394e-01 -3.680118e-01
 [91]  1.409462e-01 -1.974636e-01  4.572833e-02 -6.444868e-02 -2.764635e-01
 [96]  2.092286e-01  4.481785e-01 -1.284744e-01 -1.172098e-01  1.218080e-01
[101] -1.885642e-01 -1.870361e-01  5.402889e-02 -4.372041e-01  2.024223e-01
[106]  3.891989e-01  1.019181e-01 -2.144056e-01  3.730742e-01 -3.949817e-01
[111] -4.685868e-01  4.132904e-01 -2.467286e-01 -3.279270e-02  3.968638e-01
[116] -5.261334e-01 -2.667752e-01  1.504402e-01 -9.613439e-02 -4.170976e-01
[121]  2.150314e-01 -9.241152e-01  4.857040e-01 -1.756321e-01 -1.706668e-01
[126]  4.023378e-01  5.049287e-02 -1.202566e-02 -1.900167e-01 -1.218556e-01
[131]  1.813900e-01  1.096069e-01  3.985819e-01 -1.980072e-01  1.304873e-01
[136] -1.599130e-01 -1.006276e-01 -9.264997e-02  1.490467e-06 -1.838386e-01
[141] -1.218111e-01 -2.147542e-01  4.283299e-01 -5.092072e-02 -2.449114e-01
[146]  1.149159e-01  2.713055e-01  1.570797e-03 -1.579035e-01  6.260732e-01
[151] -2.615539e-01 -6.056703e-01  5.195448e-01 -4.859963e-01  2.129297e-01
[156]  7.983765e-02 -6.824227e-02 -1.317460e-01  1.953250e-01 -2.333107e-01
[161] -2.603984e-02 -9.483514e-02 -4.533581e-01 -1.343933e-01 -4.060646e-01
[166] -4.962243e-01 -1.462581e-01  4.389254e-01 -2.865517e-03 -2.922634e-01
[171]  3.524261e-02 -4.962111e-01  1.199498e-01  3.109752e-01  3.829933e-01
[176]  2.489228e-01  1.943514e-02  6.244820e-02 -2.797107e-01 -1.145069e-01
[181] -1.548981e-01  2.502290e-01 -5.334578e-02 -3.990423e-01 -5.043392e-03
[186] -5.530187e-01  4.783810e-01 -1.251745e-01  9.030131e-03  4.322174e-02
[191] -5.202132e-01  4.001876e-01 -3.997240e-01 -3.016908e-01 -1.457166e-01
[196] -2.682108e-01  1.309732e-01 -1.015528e-01  2.951869e-01  1.775046e-01
[201]  3.174421e-01  1.940771e-01  2.275108e-01  2.084954e-01 -1.327553e-01
[206]  3.908553e-01  8.633784e-02  3.244237e-01 -1.153234e-02 -5.380068e-01
[211] -2.241083e-01  2.387639e-01 -1.153433e-01  2.009192e-01  2.185101e-01
[216]  3.756693e-01  3.637332e-02  2.929297e-03  3.510259e-01 -8.584758e-02
[221]  6.799893e-02 -2.575071e-01  3.109575e-01 -3.215064e-01 -1.047705e-01
[226]  1.485612e-01 -2.757136e-01  1.901015e-01  3.823584e-01 -3.354624e-01
> 
> proc.time()
   user  system elapsed 
  1.290   0.657   1.937 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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: 0x60d7898d1370>
> .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: 0x60d7898d1370>
> .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: 0x60d7898d1370>
> .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: 0x60d7898d1370>
> 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: 0x60d7898b91c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d7898b91c0>
> .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: 0x60d7898b91c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d7898b91c0>
> .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: 0x60d7898b91c0>
> 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: 0x60d789b9c120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d789b9c120>
> .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: 0x60d789b9c120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60d789b9c120>
> .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: 0x60d789b9c120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60d789b9c120>
> .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: 0x60d789b9c120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60d789b9c120>
> .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: 0x60d789b9c120>
> 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: 0x60d7888ec390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60d7888ec390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d7888ec390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d7888ec390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile127b9d19f45a88" "BufferedMatrixFile127b9d4ab334a9"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile127b9d19f45a88" "BufferedMatrixFile127b9d4ab334a9"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d7887e33d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d7887e33d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60d7887e33d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60d7887e33d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60d7887e33d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60d7887e33d0>
> .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: 0x60d78a318fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60d78a318fa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60d78a318fa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60d78a318fa0>
> 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: 0x60d788af0ff0>
> .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: 0x60d788af0ff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.252   0.043   0.285 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.228   0.052   0.270 

Example timings