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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4883
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4671
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-08 13:45 -0500 (Thu, 08 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-08 21:43:30 -0500 (Thu, 08 Jan 2026)
EndedAt: 2026-01-08 21:43:54 -0500 (Thu, 08 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.257   0.038   0.284 

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] "Thu Jan  8 21:43:45 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] "Thu Jan  8 21:43:45 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: 0x58d9482d1370>
> 
> 
> 
> 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] "Thu Jan  8 21:43:45 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] "Thu Jan  8 21:43:45 2026"
> 
> ColMode(tmp2)
<pointer: 0x58d9482d1370>
> 
> 
> 
> ### 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,] 1.001621e+02 -0.09420226  1.6817454 -0.3288349
[2,] 5.642991e-01 -0.56907988 -0.0963382 -1.2977858
[3,] 2.474022e-02  1.10363632 -1.6215891 -0.1510085
[4,] 4.419685e-03  0.45138679  0.9738763  1.5690510
> 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,] 1.001621e+02 0.09420226 1.6817454 0.3288349
[2,] 5.642991e-01 0.56907988 0.0963382 1.2977858
[3,] 2.474022e-02 1.10363632 1.6215891 0.1510085
[4,] 4.419685e-03 0.45138679 0.9738763 1.5690510
> 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.00810370 0.3069239 1.2968213 0.5734413
[2,]  0.75119847 0.7543738 0.3103840 1.1392040
[3,]  0.15729023 1.0505410 1.2734163 0.3885982
[4,]  0.06648071 0.6718533 0.9868517 1.2526177
> 
> 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,] 225.24318 28.16344 39.64996 31.06325
[2,]  33.07628 33.11282 28.20018 37.68983
[3,]  26.59764 36.60905 39.35575 29.03699
[4,]  25.66923 32.16992 35.84239 39.09523
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x58d9492cd9b0>
> exp(tmp5)
<pointer: 0x58d9492cd9b0>
> log(tmp5,2)
<pointer: 0x58d9492cd9b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.8142
> Min(tmp5)
[1] 53.42713
> mean(tmp5)
[1] 72.43606
> Sum(tmp5)
[1] 14487.21
> Var(tmp5)
[1] 872.346
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.29955 69.80067 68.73480 72.03247 68.68861 69.62031 71.77586 70.37606
 [9] 69.78949 70.24279
> rowSums(tmp5)
 [1] 1865.991 1396.013 1374.696 1440.649 1373.772 1392.406 1435.517 1407.521
 [9] 1395.790 1404.856
> rowVars(tmp5)
 [1] 7926.80966   77.42734   90.69488   90.89318   59.50527   96.64394
 [7]   96.20544   42.73277   43.15545   92.02033
> rowSd(tmp5)
 [1] 89.032633  8.799281  9.523386  9.533792  7.713966  9.830765  9.808437
 [8]  6.537030  6.569281  9.592723
> rowMax(tmp5)
 [1] 468.81416  91.37104  88.87885  92.12363  84.74942  91.82783  84.19960
 [8]  83.04791  83.55605  87.19870
> rowMin(tmp5)
 [1] 58.49063 58.69498 54.29972 53.42713 57.23905 54.24211 54.29558 60.12355
 [9] 57.87252 56.58093
> 
> colMeans(tmp5)
 [1] 105.09441  69.05751  70.58052  73.64249  66.31220  72.28073  67.00041
 [8]  70.04933  72.33743  70.37004  74.10153  70.53597  69.43640  72.02303
[15]  69.07838  68.20174  70.49857  68.75517  77.57422  71.79114
> colSums(tmp5)
 [1] 1050.9441  690.5751  705.8052  736.4249  663.1220  722.8073  670.0041
 [8]  700.4933  723.3743  703.7004  741.0153  705.3597  694.3640  720.2303
[15]  690.7838  682.0174  704.9857  687.5517  775.7422  717.9114
> colVars(tmp5)
 [1] 16403.41566    61.09890    65.18807    50.04036    42.87538   164.60499
 [7]    94.27226    76.14957   117.75542    33.62414   110.71728   126.40446
[13]    93.78278    21.36161    40.99454    75.20617    87.47129   109.48955
[19]    68.49206    58.03598
> colSd(tmp5)
 [1] 128.075820   7.816578   8.073913   7.073921   6.547930  12.829848
 [7]   9.709390   8.726372  10.851517   5.798633  10.522228  11.242974
[13]   9.684151   4.621862   6.402698   8.672149   9.352609  10.463725
[19]   8.275993   7.618135
> colMax(tmp5)
 [1] 468.81416  83.81053  82.52619  81.37159  76.61884  92.12363  79.15784
 [8]  83.04791  91.37104  79.05654  88.87885  85.34829  87.19870  79.37375
[15]  75.82542  81.58378  88.89645  81.52101  91.50194  84.74942
> colMin(tmp5)
 [1] 53.42713 58.61851 58.69498 60.43669 55.38399 57.73241 54.29558 57.87252
 [9] 56.66685 61.72556 60.12644 55.49572 60.12355 63.60580 56.62185 57.23905
[17] 57.85463 54.24211 62.76627 61.34207
> 
> 
> ### 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] 93.29955 69.80067 68.73480 72.03247 68.68861 69.62031 71.77586       NA
 [9] 69.78949 70.24279
> rowSums(tmp5)
 [1] 1865.991 1396.013 1374.696 1440.649 1373.772 1392.406 1435.517       NA
 [9] 1395.790 1404.856
> rowVars(tmp5)
 [1] 7926.80966   77.42734   90.69488   90.89318   59.50527   96.64394
 [7]   96.20544   44.72165   43.15545   92.02033
> rowSd(tmp5)
 [1] 89.032633  8.799281  9.523386  9.533792  7.713966  9.830765  9.808437
 [8]  6.687425  6.569281  9.592723
> rowMax(tmp5)
 [1] 468.81416  91.37104  88.87885  92.12363  84.74942  91.82783  84.19960
 [8]        NA  83.55605  87.19870
> rowMin(tmp5)
 [1] 58.49063 58.69498 54.29972 53.42713 57.23905 54.24211 54.29558       NA
 [9] 57.87252 56.58093
> 
> colMeans(tmp5)
 [1] 105.09441  69.05751  70.58052  73.64249  66.31220  72.28073  67.00041
 [8]  70.04933  72.33743  70.37004  74.10153  70.53597  69.43640  72.02303
[15]  69.07838  68.20174  70.49857  68.75517  77.57422        NA
> colSums(tmp5)
 [1] 1050.9441  690.5751  705.8052  736.4249  663.1220  722.8073  670.0041
 [8]  700.4933  723.3743  703.7004  741.0153  705.3597  694.3640  720.2303
[15]  690.7838  682.0174  704.9857  687.5517  775.7422        NA
> colVars(tmp5)
 [1] 16403.41566    61.09890    65.18807    50.04036    42.87538   164.60499
 [7]    94.27226    76.14957   117.75542    33.62414   110.71728   126.40446
[13]    93.78278    21.36161    40.99454    75.20617    87.47129   109.48955
[19]    68.49206          NA
> colSd(tmp5)
 [1] 128.075820   7.816578   8.073913   7.073921   6.547930  12.829848
 [7]   9.709390   8.726372  10.851517   5.798633  10.522228  11.242974
[13]   9.684151   4.621862   6.402698   8.672149   9.352609  10.463725
[19]   8.275993         NA
> colMax(tmp5)
 [1] 468.81416  83.81053  82.52619  81.37159  76.61884  92.12363  79.15784
 [8]  83.04791  91.37104  79.05654  88.87885  85.34829  87.19870  79.37375
[15]  75.82542  81.58378  88.89645  81.52101  91.50194        NA
> colMin(tmp5)
 [1] 53.42713 58.61851 58.69498 60.43669 55.38399 57.73241 54.29558 57.87252
 [9] 56.66685 61.72556 60.12644 55.49572 60.12355 63.60580 56.62185 57.23905
[17] 57.85463 54.24211 62.76627       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.8142
> Min(tmp5,na.rm=TRUE)
[1] 53.42713
> mean(tmp5,na.rm=TRUE)
[1] 72.45931
> Sum(tmp5,na.rm=TRUE)
[1] 14419.4
> Var(tmp5,na.rm=TRUE)
[1] 876.6432
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.29955 69.80067 68.73480 72.03247 68.68861 69.62031 71.77586 70.51113
 [9] 69.78949 70.24279
> rowSums(tmp5,na.rm=TRUE)
 [1] 1865.991 1396.013 1374.696 1440.649 1373.772 1392.406 1435.517 1339.711
 [9] 1395.790 1404.856
> rowVars(tmp5,na.rm=TRUE)
 [1] 7926.80966   77.42734   90.69488   90.89318   59.50527   96.64394
 [7]   96.20544   44.72165   43.15545   92.02033
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.032633  8.799281  9.523386  9.533792  7.713966  9.830765  9.808437
 [8]  6.687425  6.569281  9.592723
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.81416  91.37104  88.87885  92.12363  84.74942  91.82783  84.19960
 [8]  83.04791  83.55605  87.19870
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.49063 58.69498 54.29972 53.42713 57.23905 54.24211 54.29558 60.12355
 [9] 57.87252 56.58093
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 105.09441  69.05751  70.58052  73.64249  66.31220  72.28073  67.00041
 [8]  70.04933  72.33743  70.37004  74.10153  70.53597  69.43640  72.02303
[15]  69.07838  68.20174  70.49857  68.75517  77.57422  72.23353
> colSums(tmp5,na.rm=TRUE)
 [1] 1050.9441  690.5751  705.8052  736.4249  663.1220  722.8073  670.0041
 [8]  700.4933  723.3743  703.7004  741.0153  705.3597  694.3640  720.2303
[15]  690.7838  682.0174  704.9857  687.5517  775.7422  650.1018
> colVars(tmp5,na.rm=TRUE)
 [1] 16403.41566    61.09890    65.18807    50.04036    42.87538   164.60499
 [7]    94.27226    76.14957   117.75542    33.62414   110.71728   126.40446
[13]    93.78278    21.36161    40.99454    75.20617    87.47129   109.48955
[19]    68.49206    63.08882
> colSd(tmp5,na.rm=TRUE)
 [1] 128.075820   7.816578   8.073913   7.073921   6.547930  12.829848
 [7]   9.709390   8.726372  10.851517   5.798633  10.522228  11.242974
[13]   9.684151   4.621862   6.402698   8.672149   9.352609  10.463725
[19]   8.275993   7.942847
> colMax(tmp5,na.rm=TRUE)
 [1] 468.81416  83.81053  82.52619  81.37159  76.61884  92.12363  79.15784
 [8]  83.04791  91.37104  79.05654  88.87885  85.34829  87.19870  79.37375
[15]  75.82542  81.58378  88.89645  81.52101  91.50194  84.74942
> colMin(tmp5,na.rm=TRUE)
 [1] 53.42713 58.61851 58.69498 60.43669 55.38399 57.73241 54.29558 57.87252
 [9] 56.66685 61.72556 60.12644 55.49572 60.12355 63.60580 56.62185 57.23905
[17] 57.85463 54.24211 62.76627 61.34207
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.29955 69.80067 68.73480 72.03247 68.68861 69.62031 71.77586      NaN
 [9] 69.78949 70.24279
> rowSums(tmp5,na.rm=TRUE)
 [1] 1865.991 1396.013 1374.696 1440.649 1373.772 1392.406 1435.517    0.000
 [9] 1395.790 1404.856
> rowVars(tmp5,na.rm=TRUE)
 [1] 7926.80966   77.42734   90.69488   90.89318   59.50527   96.64394
 [7]   96.20544         NA   43.15545   92.02033
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.032633  8.799281  9.523386  9.533792  7.713966  9.830765  9.808437
 [8]        NA  6.569281  9.592723
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.81416  91.37104  88.87885  92.12363  84.74942  91.82783  84.19960
 [8]        NA  83.55605  87.19870
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.49063 58.69498 54.29972 53.42713 57.23905 54.24211 54.29558       NA
 [9] 57.87252 56.58093
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.00644  69.56688  70.47204  74.30078  66.57612  71.79543  66.59181
 [8]  68.60504  73.19342  70.55914  74.86266  69.61949  70.47116  72.66831
[15]  68.44396  67.24533  70.80328  68.01178  77.27238       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 990.0579 626.1019 634.2484 668.7070 599.1851 646.1589 599.3263 617.4454
 [9] 658.7408 635.0323 673.7639 626.5754 634.2404 654.0148 615.9956 605.2080
[17] 637.2296 612.1061 695.4514   0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 18182.40220    65.81739    73.20421    51.42019    47.45117   182.53103
 [7]   104.17803    62.20115   124.23172    37.42486   118.03963   132.75576
[13]    93.45992    19.34739    41.59077    74.31643    97.36061   116.95868
[19]    76.02866          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 134.842138   8.112792   8.555946   7.170788   6.888481  13.510405
 [7]  10.206764   7.886770  11.145929   6.117586  10.864604  11.521969
[13]   9.667467   4.398567   6.449090   8.620698   9.867148  10.814744
[19]   8.719441         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 468.81416  83.81053  82.52619  81.37159  76.61884  92.12363  79.15784
 [8]  80.83681  91.37104  79.05654  88.87885  85.34829  87.19870  79.37375
[15]  75.82542  81.58378  88.89645  81.52101  91.50194      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 53.42713 58.61851 58.69498 60.43669 55.38399 57.73241 54.29558 57.87252
 [9] 56.66685 61.72556 60.12644 55.49572 61.61695 63.60580 56.62185 57.23905
[17] 57.85463 54.24211 62.76627      Inf
> 
> 
> 
> 
> 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] 294.0239 189.5555 204.1502 266.0315 139.6339 113.4458 265.5283 117.7989
 [9] 330.3970 100.2434
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 294.0239 189.5555 204.1502 266.0315 139.6339 113.4458 265.5283 117.7989
 [9] 330.3970 100.2434
> 
> 
> 
> 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  1.136868e-13 -2.842171e-14 -1.421085e-13 -1.136868e-13
 [6]  0.000000e+00  5.684342e-14 -2.842171e-14  1.705303e-13  5.684342e-14
[11]  1.136868e-13 -2.842171e-14  5.684342e-14  0.000000e+00 -1.705303e-13
[16] -1.989520e-13 -5.684342e-14 -2.842171e-14 -5.684342e-14 -3.410605e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
1   1 
6   8 
6   1 
6   1 
3   12 
1   1 
7   4 
7   3 
5   16 
9   11 
7   5 
10   9 
10   15 
10   16 
3   10 
2   17 
2   3 
4   1 
3   20 
6   7 
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.570763
> Min(tmp)
[1] -2.468256
> mean(tmp)
[1] -0.02924306
> Sum(tmp)
[1] -2.924306
> Var(tmp)
[1] 0.9079789
> 
> rowMeans(tmp)
[1] -0.02924306
> rowSums(tmp)
[1] -2.924306
> rowVars(tmp)
[1] 0.9079789
> rowSd(tmp)
[1] 0.9528793
> rowMax(tmp)
[1] 2.570763
> rowMin(tmp)
[1] -2.468256
> 
> colMeans(tmp)
  [1]  0.239880360 -0.484947733 -0.059219206  0.345908465  0.280773344
  [6] -0.408794551 -0.447595125 -0.131918781 -0.361338017 -0.233482918
 [11]  0.886877866  0.055112729  0.264126299 -0.461679152  0.141485269
 [16] -1.895258913 -0.866707003 -0.922496349  1.433066336 -0.342819193
 [21]  0.564962124 -0.318680004 -0.134986967 -0.920360382  0.247424082
 [26] -1.622037324  0.146969158 -1.731222565  0.232984610 -0.995436371
 [31]  0.337051408 -0.974865447 -0.319500363 -1.370400231 -0.731463886
 [36]  0.873793638  0.461726868  0.724307760 -0.291877384 -0.574549677
 [41]  1.510803411  0.239684451 -0.141818680 -0.208278418  0.485890595
 [46]  0.316479700  1.288911262  0.287160159 -0.133995406 -0.959911038
 [51]  1.161777461  1.005006634  0.883407648  0.097784773 -0.934143631
 [56] -0.358742929  0.478578229 -0.205415936  2.570763320  1.525614338
 [61] -1.373245195  1.265448380 -2.058219343  1.027257886  1.034045945
 [66] -1.211961930  0.989235422 -2.468256245 -0.204689786  0.544405014
 [71]  1.260162203 -0.326401731 -0.163716134 -0.665545058  0.561877964
 [76] -0.556701952 -0.798670441 -1.244072509 -0.588252588  1.129327619
 [81]  1.645861139 -0.196804416 -0.951820358 -0.408872395 -1.053239371
 [86]  0.801444232  1.721467431 -0.009121567 -0.755141361 -0.814854605
 [91]  0.170129059 -0.647582160  1.860085989 -0.346876415 -1.273977941
 [96]  0.479766468  0.827250032  1.246994431  1.042374100 -1.957784594
> colSums(tmp)
  [1]  0.239880360 -0.484947733 -0.059219206  0.345908465  0.280773344
  [6] -0.408794551 -0.447595125 -0.131918781 -0.361338017 -0.233482918
 [11]  0.886877866  0.055112729  0.264126299 -0.461679152  0.141485269
 [16] -1.895258913 -0.866707003 -0.922496349  1.433066336 -0.342819193
 [21]  0.564962124 -0.318680004 -0.134986967 -0.920360382  0.247424082
 [26] -1.622037324  0.146969158 -1.731222565  0.232984610 -0.995436371
 [31]  0.337051408 -0.974865447 -0.319500363 -1.370400231 -0.731463886
 [36]  0.873793638  0.461726868  0.724307760 -0.291877384 -0.574549677
 [41]  1.510803411  0.239684451 -0.141818680 -0.208278418  0.485890595
 [46]  0.316479700  1.288911262  0.287160159 -0.133995406 -0.959911038
 [51]  1.161777461  1.005006634  0.883407648  0.097784773 -0.934143631
 [56] -0.358742929  0.478578229 -0.205415936  2.570763320  1.525614338
 [61] -1.373245195  1.265448380 -2.058219343  1.027257886  1.034045945
 [66] -1.211961930  0.989235422 -2.468256245 -0.204689786  0.544405014
 [71]  1.260162203 -0.326401731 -0.163716134 -0.665545058  0.561877964
 [76] -0.556701952 -0.798670441 -1.244072509 -0.588252588  1.129327619
 [81]  1.645861139 -0.196804416 -0.951820358 -0.408872395 -1.053239371
 [86]  0.801444232  1.721467431 -0.009121567 -0.755141361 -0.814854605
 [91]  0.170129059 -0.647582160  1.860085989 -0.346876415 -1.273977941
 [96]  0.479766468  0.827250032  1.246994431  1.042374100 -1.957784594
> 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.239880360 -0.484947733 -0.059219206  0.345908465  0.280773344
  [6] -0.408794551 -0.447595125 -0.131918781 -0.361338017 -0.233482918
 [11]  0.886877866  0.055112729  0.264126299 -0.461679152  0.141485269
 [16] -1.895258913 -0.866707003 -0.922496349  1.433066336 -0.342819193
 [21]  0.564962124 -0.318680004 -0.134986967 -0.920360382  0.247424082
 [26] -1.622037324  0.146969158 -1.731222565  0.232984610 -0.995436371
 [31]  0.337051408 -0.974865447 -0.319500363 -1.370400231 -0.731463886
 [36]  0.873793638  0.461726868  0.724307760 -0.291877384 -0.574549677
 [41]  1.510803411  0.239684451 -0.141818680 -0.208278418  0.485890595
 [46]  0.316479700  1.288911262  0.287160159 -0.133995406 -0.959911038
 [51]  1.161777461  1.005006634  0.883407648  0.097784773 -0.934143631
 [56] -0.358742929  0.478578229 -0.205415936  2.570763320  1.525614338
 [61] -1.373245195  1.265448380 -2.058219343  1.027257886  1.034045945
 [66] -1.211961930  0.989235422 -2.468256245 -0.204689786  0.544405014
 [71]  1.260162203 -0.326401731 -0.163716134 -0.665545058  0.561877964
 [76] -0.556701952 -0.798670441 -1.244072509 -0.588252588  1.129327619
 [81]  1.645861139 -0.196804416 -0.951820358 -0.408872395 -1.053239371
 [86]  0.801444232  1.721467431 -0.009121567 -0.755141361 -0.814854605
 [91]  0.170129059 -0.647582160  1.860085989 -0.346876415 -1.273977941
 [96]  0.479766468  0.827250032  1.246994431  1.042374100 -1.957784594
> colMin(tmp)
  [1]  0.239880360 -0.484947733 -0.059219206  0.345908465  0.280773344
  [6] -0.408794551 -0.447595125 -0.131918781 -0.361338017 -0.233482918
 [11]  0.886877866  0.055112729  0.264126299 -0.461679152  0.141485269
 [16] -1.895258913 -0.866707003 -0.922496349  1.433066336 -0.342819193
 [21]  0.564962124 -0.318680004 -0.134986967 -0.920360382  0.247424082
 [26] -1.622037324  0.146969158 -1.731222565  0.232984610 -0.995436371
 [31]  0.337051408 -0.974865447 -0.319500363 -1.370400231 -0.731463886
 [36]  0.873793638  0.461726868  0.724307760 -0.291877384 -0.574549677
 [41]  1.510803411  0.239684451 -0.141818680 -0.208278418  0.485890595
 [46]  0.316479700  1.288911262  0.287160159 -0.133995406 -0.959911038
 [51]  1.161777461  1.005006634  0.883407648  0.097784773 -0.934143631
 [56] -0.358742929  0.478578229 -0.205415936  2.570763320  1.525614338
 [61] -1.373245195  1.265448380 -2.058219343  1.027257886  1.034045945
 [66] -1.211961930  0.989235422 -2.468256245 -0.204689786  0.544405014
 [71]  1.260162203 -0.326401731 -0.163716134 -0.665545058  0.561877964
 [76] -0.556701952 -0.798670441 -1.244072509 -0.588252588  1.129327619
 [81]  1.645861139 -0.196804416 -0.951820358 -0.408872395 -1.053239371
 [86]  0.801444232  1.721467431 -0.009121567 -0.755141361 -0.814854605
 [91]  0.170129059 -0.647582160  1.860085989 -0.346876415 -1.273977941
 [96]  0.479766468  0.827250032  1.246994431  1.042374100 -1.957784594
> colMedians(tmp)
  [1]  0.239880360 -0.484947733 -0.059219206  0.345908465  0.280773344
  [6] -0.408794551 -0.447595125 -0.131918781 -0.361338017 -0.233482918
 [11]  0.886877866  0.055112729  0.264126299 -0.461679152  0.141485269
 [16] -1.895258913 -0.866707003 -0.922496349  1.433066336 -0.342819193
 [21]  0.564962124 -0.318680004 -0.134986967 -0.920360382  0.247424082
 [26] -1.622037324  0.146969158 -1.731222565  0.232984610 -0.995436371
 [31]  0.337051408 -0.974865447 -0.319500363 -1.370400231 -0.731463886
 [36]  0.873793638  0.461726868  0.724307760 -0.291877384 -0.574549677
 [41]  1.510803411  0.239684451 -0.141818680 -0.208278418  0.485890595
 [46]  0.316479700  1.288911262  0.287160159 -0.133995406 -0.959911038
 [51]  1.161777461  1.005006634  0.883407648  0.097784773 -0.934143631
 [56] -0.358742929  0.478578229 -0.205415936  2.570763320  1.525614338
 [61] -1.373245195  1.265448380 -2.058219343  1.027257886  1.034045945
 [66] -1.211961930  0.989235422 -2.468256245 -0.204689786  0.544405014
 [71]  1.260162203 -0.326401731 -0.163716134 -0.665545058  0.561877964
 [76] -0.556701952 -0.798670441 -1.244072509 -0.588252588  1.129327619
 [81]  1.645861139 -0.196804416 -0.951820358 -0.408872395 -1.053239371
 [86]  0.801444232  1.721467431 -0.009121567 -0.755141361 -0.814854605
 [91]  0.170129059 -0.647582160  1.860085989 -0.346876415 -1.273977941
 [96]  0.479766468  0.827250032  1.246994431  1.042374100 -1.957784594
> colRanges(tmp)
          [,1]       [,2]        [,3]      [,4]      [,5]       [,6]       [,7]
[1,] 0.2398804 -0.4849477 -0.05921921 0.3459085 0.2807733 -0.4087946 -0.4475951
[2,] 0.2398804 -0.4849477 -0.05921921 0.3459085 0.2807733 -0.4087946 -0.4475951
           [,8]      [,9]      [,10]     [,11]      [,12]     [,13]      [,14]
[1,] -0.1319188 -0.361338 -0.2334829 0.8868779 0.05511273 0.2641263 -0.4616792
[2,] -0.1319188 -0.361338 -0.2334829 0.8868779 0.05511273 0.2641263 -0.4616792
         [,15]     [,16]     [,17]      [,18]    [,19]      [,20]     [,21]
[1,] 0.1414853 -1.895259 -0.866707 -0.9224963 1.433066 -0.3428192 0.5649621
[2,] 0.1414853 -1.895259 -0.866707 -0.9224963 1.433066 -0.3428192 0.5649621
        [,22]     [,23]      [,24]     [,25]     [,26]     [,27]     [,28]
[1,] -0.31868 -0.134987 -0.9203604 0.2474241 -1.622037 0.1469692 -1.731223
[2,] -0.31868 -0.134987 -0.9203604 0.2474241 -1.622037 0.1469692 -1.731223
         [,29]      [,30]     [,31]      [,32]      [,33]   [,34]      [,35]
[1,] 0.2329846 -0.9954364 0.3370514 -0.9748654 -0.3195004 -1.3704 -0.7314639
[2,] 0.2329846 -0.9954364 0.3370514 -0.9748654 -0.3195004 -1.3704 -0.7314639
         [,36]     [,37]     [,38]      [,39]      [,40]    [,41]     [,42]
[1,] 0.8737936 0.4617269 0.7243078 -0.2918774 -0.5745497 1.510803 0.2396845
[2,] 0.8737936 0.4617269 0.7243078 -0.2918774 -0.5745497 1.510803 0.2396845
          [,43]      [,44]     [,45]     [,46]    [,47]     [,48]      [,49]
[1,] -0.1418187 -0.2082784 0.4858906 0.3164797 1.288911 0.2871602 -0.1339954
[2,] -0.1418187 -0.2082784 0.4858906 0.3164797 1.288911 0.2871602 -0.1339954
         [,50]    [,51]    [,52]     [,53]      [,54]      [,55]      [,56]
[1,] -0.959911 1.161777 1.005007 0.8834076 0.09778477 -0.9341436 -0.3587429
[2,] -0.959911 1.161777 1.005007 0.8834076 0.09778477 -0.9341436 -0.3587429
         [,57]      [,58]    [,59]    [,60]     [,61]    [,62]     [,63]
[1,] 0.4785782 -0.2054159 2.570763 1.525614 -1.373245 1.265448 -2.058219
[2,] 0.4785782 -0.2054159 2.570763 1.525614 -1.373245 1.265448 -2.058219
        [,64]    [,65]     [,66]     [,67]     [,68]      [,69]    [,70]
[1,] 1.027258 1.034046 -1.211962 0.9892354 -2.468256 -0.2046898 0.544405
[2,] 1.027258 1.034046 -1.211962 0.9892354 -2.468256 -0.2046898 0.544405
        [,71]      [,72]      [,73]      [,74]    [,75]     [,76]      [,77]
[1,] 1.260162 -0.3264017 -0.1637161 -0.6655451 0.561878 -0.556702 -0.7986704
[2,] 1.260162 -0.3264017 -0.1637161 -0.6655451 0.561878 -0.556702 -0.7986704
         [,78]      [,79]    [,80]    [,81]      [,82]      [,83]      [,84]
[1,] -1.244073 -0.5882526 1.129328 1.645861 -0.1968044 -0.9518204 -0.4088724
[2,] -1.244073 -0.5882526 1.129328 1.645861 -0.1968044 -0.9518204 -0.4088724
         [,85]     [,86]    [,87]        [,88]      [,89]      [,90]     [,91]
[1,] -1.053239 0.8014442 1.721467 -0.009121567 -0.7551414 -0.8148546 0.1701291
[2,] -1.053239 0.8014442 1.721467 -0.009121567 -0.7551414 -0.8148546 0.1701291
          [,92]    [,93]      [,94]     [,95]     [,96]   [,97]    [,98]
[1,] -0.6475822 1.860086 -0.3468764 -1.273978 0.4797665 0.82725 1.246994
[2,] -0.6475822 1.860086 -0.3468764 -1.273978 0.4797665 0.82725 1.246994
        [,99]    [,100]
[1,] 1.042374 -1.957785
[2,] 1.042374 -1.957785
> 
> 
> Max(tmp2)
[1] 2.347392
> Min(tmp2)
[1] -2.178762
> mean(tmp2)
[1] 0.0901218
> Sum(tmp2)
[1] 9.01218
> Var(tmp2)
[1] 0.9933756
> 
> rowMeans(tmp2)
  [1]  0.444341898 -0.258956615  1.293413802  0.106646455  0.438041262
  [6]  1.783577955  0.543365395  0.460237829 -0.140476794  0.085204570
 [11]  0.809609280 -0.474783387 -0.842771767 -1.654439600  0.520228779
 [16] -0.916406911  0.534878159 -0.031151028 -0.113849894  0.105897369
 [21] -0.947317405 -0.669729156  1.841112838  1.129628758 -0.350152315
 [26]  1.686243357  0.798836350 -1.713793946  0.535058080 -1.854787802
 [31]  1.182450209 -0.155444294 -0.096843805  0.768561754  0.802507557
 [36]  0.651111279  0.156839669 -0.443516208  2.148139131 -0.877890194
 [41] -0.614814476  0.361412865 -1.017500773 -1.690004064  0.203559624
 [46]  1.548593981  0.674755568  0.268601320 -0.240000453  0.482022610
 [51] -0.976805224  1.012617396 -1.645762265 -0.157004598 -0.992248729
 [56]  1.365181175 -1.400224885  0.471696483 -0.754722764 -0.973335114
 [61]  0.398262428  0.102333522 -1.819331551  1.842528775 -1.588673749
 [66]  0.102613184  0.894633702  0.520793753 -0.203581121  1.382176807
 [71] -0.631463118 -2.178762320  0.996638525 -2.005372464  0.735152219
 [76] -0.177023690  0.914209528  0.951469942 -0.840185114  1.189602520
 [81] -0.079179477 -1.399216549  0.203799916 -1.627465911  0.916506527
 [86]  0.393527759 -0.379367118 -0.393484134  1.506561664 -0.093176683
 [91]  1.100717549  0.695201544  0.633645757 -0.007186574  2.347391583
 [96]  0.348425693 -0.081403877  0.460686930 -0.005078900  0.675614068
> rowSums(tmp2)
  [1]  0.444341898 -0.258956615  1.293413802  0.106646455  0.438041262
  [6]  1.783577955  0.543365395  0.460237829 -0.140476794  0.085204570
 [11]  0.809609280 -0.474783387 -0.842771767 -1.654439600  0.520228779
 [16] -0.916406911  0.534878159 -0.031151028 -0.113849894  0.105897369
 [21] -0.947317405 -0.669729156  1.841112838  1.129628758 -0.350152315
 [26]  1.686243357  0.798836350 -1.713793946  0.535058080 -1.854787802
 [31]  1.182450209 -0.155444294 -0.096843805  0.768561754  0.802507557
 [36]  0.651111279  0.156839669 -0.443516208  2.148139131 -0.877890194
 [41] -0.614814476  0.361412865 -1.017500773 -1.690004064  0.203559624
 [46]  1.548593981  0.674755568  0.268601320 -0.240000453  0.482022610
 [51] -0.976805224  1.012617396 -1.645762265 -0.157004598 -0.992248729
 [56]  1.365181175 -1.400224885  0.471696483 -0.754722764 -0.973335114
 [61]  0.398262428  0.102333522 -1.819331551  1.842528775 -1.588673749
 [66]  0.102613184  0.894633702  0.520793753 -0.203581121  1.382176807
 [71] -0.631463118 -2.178762320  0.996638525 -2.005372464  0.735152219
 [76] -0.177023690  0.914209528  0.951469942 -0.840185114  1.189602520
 [81] -0.079179477 -1.399216549  0.203799916 -1.627465911  0.916506527
 [86]  0.393527759 -0.379367118 -0.393484134  1.506561664 -0.093176683
 [91]  1.100717549  0.695201544  0.633645757 -0.007186574  2.347391583
 [96]  0.348425693 -0.081403877  0.460686930 -0.005078900  0.675614068
> 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.444341898 -0.258956615  1.293413802  0.106646455  0.438041262
  [6]  1.783577955  0.543365395  0.460237829 -0.140476794  0.085204570
 [11]  0.809609280 -0.474783387 -0.842771767 -1.654439600  0.520228779
 [16] -0.916406911  0.534878159 -0.031151028 -0.113849894  0.105897369
 [21] -0.947317405 -0.669729156  1.841112838  1.129628758 -0.350152315
 [26]  1.686243357  0.798836350 -1.713793946  0.535058080 -1.854787802
 [31]  1.182450209 -0.155444294 -0.096843805  0.768561754  0.802507557
 [36]  0.651111279  0.156839669 -0.443516208  2.148139131 -0.877890194
 [41] -0.614814476  0.361412865 -1.017500773 -1.690004064  0.203559624
 [46]  1.548593981  0.674755568  0.268601320 -0.240000453  0.482022610
 [51] -0.976805224  1.012617396 -1.645762265 -0.157004598 -0.992248729
 [56]  1.365181175 -1.400224885  0.471696483 -0.754722764 -0.973335114
 [61]  0.398262428  0.102333522 -1.819331551  1.842528775 -1.588673749
 [66]  0.102613184  0.894633702  0.520793753 -0.203581121  1.382176807
 [71] -0.631463118 -2.178762320  0.996638525 -2.005372464  0.735152219
 [76] -0.177023690  0.914209528  0.951469942 -0.840185114  1.189602520
 [81] -0.079179477 -1.399216549  0.203799916 -1.627465911  0.916506527
 [86]  0.393527759 -0.379367118 -0.393484134  1.506561664 -0.093176683
 [91]  1.100717549  0.695201544  0.633645757 -0.007186574  2.347391583
 [96]  0.348425693 -0.081403877  0.460686930 -0.005078900  0.675614068
> rowMin(tmp2)
  [1]  0.444341898 -0.258956615  1.293413802  0.106646455  0.438041262
  [6]  1.783577955  0.543365395  0.460237829 -0.140476794  0.085204570
 [11]  0.809609280 -0.474783387 -0.842771767 -1.654439600  0.520228779
 [16] -0.916406911  0.534878159 -0.031151028 -0.113849894  0.105897369
 [21] -0.947317405 -0.669729156  1.841112838  1.129628758 -0.350152315
 [26]  1.686243357  0.798836350 -1.713793946  0.535058080 -1.854787802
 [31]  1.182450209 -0.155444294 -0.096843805  0.768561754  0.802507557
 [36]  0.651111279  0.156839669 -0.443516208  2.148139131 -0.877890194
 [41] -0.614814476  0.361412865 -1.017500773 -1.690004064  0.203559624
 [46]  1.548593981  0.674755568  0.268601320 -0.240000453  0.482022610
 [51] -0.976805224  1.012617396 -1.645762265 -0.157004598 -0.992248729
 [56]  1.365181175 -1.400224885  0.471696483 -0.754722764 -0.973335114
 [61]  0.398262428  0.102333522 -1.819331551  1.842528775 -1.588673749
 [66]  0.102613184  0.894633702  0.520793753 -0.203581121  1.382176807
 [71] -0.631463118 -2.178762320  0.996638525 -2.005372464  0.735152219
 [76] -0.177023690  0.914209528  0.951469942 -0.840185114  1.189602520
 [81] -0.079179477 -1.399216549  0.203799916 -1.627465911  0.916506527
 [86]  0.393527759 -0.379367118 -0.393484134  1.506561664 -0.093176683
 [91]  1.100717549  0.695201544  0.633645757 -0.007186574  2.347391583
 [96]  0.348425693 -0.081403877  0.460686930 -0.005078900  0.675614068
> 
> colMeans(tmp2)
[1] 0.0901218
> colSums(tmp2)
[1] 9.01218
> colVars(tmp2)
[1] 0.9933756
> colSd(tmp2)
[1] 0.9966823
> colMax(tmp2)
[1] 2.347392
> colMin(tmp2)
[1] -2.178762
> colMedians(tmp2)
[1] 0.1317431
> colRanges(tmp2)
          [,1]
[1,] -2.178762
[2,]  2.347392
> 
> 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] -2.2008337  3.0178903 -4.1753106  1.8176432  2.7581065  0.9570429
 [7]  3.2524324  0.2166910 -0.5775642 -2.8181183
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.21140125
[2,] -0.58846099
[3,] -0.06701438
[4,]  0.32615526
[5,]  1.24091093
> 
> rowApply(tmp,sum)
 [1] -0.6337262 -1.4138860 -1.7532542  3.2914368  1.1373083  6.1742911
 [7]  0.7129341 -4.4546539 -3.3397029  2.5272326
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    1    9    9    1    2    7    4    7     6
 [2,]    9    9    2    6    4    1   10    9    3     8
 [3,]    4    8    8    1    5    5    4    7    1     2
 [4,]    8    6    4    8    9    3    6    2    5     5
 [5,]   10    4    3    2    8    4    9    6   10     9
 [6,]    1   10    1    5   10    6    3    8    8    10
 [7,]    7    2   10   10    6    8    8    5    4     7
 [8,]    3    3    6    3    7   10    5    1    9     4
 [9,]    2    7    7    4    2    9    2   10    6     1
[10,]    5    5    5    7    3    7    1    3    2     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.674648651 -2.101648314 -1.280487868  0.933399096  1.778609872
 [6]  2.873449970 -0.006330129  1.650254190 -0.570471853  0.688066924
[11]  0.298457716 -0.460287812 -3.693131745  1.152049871  3.784508974
[16]  2.449871547  0.490995264 -2.416029000 -1.645708105 -0.730657532
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.79995510
[2,]  0.01451131
[3,]  0.42729815
[4,]  0.85262177
[5,]  2.18017252
> 
> rowApply(tmp,sum)
[1] -0.1853807  4.2361423 -3.0159711  3.1688680  1.6659012
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   20   10   18    9    3
[2,]    7    2    5   13   10
[3,]   15    7   12    4    2
[4,]   12    5    7   19   19
[5,]    9   20    3   14    8
> 
> 
> as.matrix(tmp)
            [,1]        [,2]        [,3]       [,4]        [,5]       [,6]
[1,]  2.18017252 -0.28444879  0.44136057  0.1524319  0.01097435  1.1722559
[2,]  0.42729815 -1.58100299  0.07131047 -0.9461745  1.99738024  0.7246240
[3,]  0.85262177 -0.76461519 -0.11375191 -0.6549356 -0.80576991  0.5181030
[4,]  0.01451131  0.53390150 -0.59561145  1.3719975  0.72280987  0.7936941
[5,] -0.79995510 -0.00548285 -1.08379555  1.0100798 -0.14678469 -0.3352271
           [,7]        [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -0.8631270  0.06152912 -0.5164024  0.46932774 -0.2359008 -0.8347999
[2,]  1.2117002 -0.36949326  1.6205521  0.61417961  1.0408890  0.3175135
[3,] -0.5201922 -0.08594994 -0.2920937 -0.96007507 -0.7939441  2.2479032
[4,] -0.7355552  0.42898690 -0.2498514 -0.04162108 -0.5604814 -1.6294934
[5,]  0.9008440  1.61518137 -1.1326764  0.60625572  0.8478950 -0.5614112
          [,13]      [,14]      [,15]       [,16]      [,17]      [,18]
[1,] -1.6669328  0.8091866 0.74891431  0.36030943 -1.7225473  0.4147652
[2,] -1.5070214  0.3260316 1.90997264  0.45979141  1.2585464 -1.3972767
[3,] -0.3694903 -0.6871375 0.48898090 -0.07853293 -0.1673501 -2.1460351
[4,]  0.5232658  0.7836637 0.08770795  1.14267546  0.9759738  1.4532979
[5,] -0.6729530 -0.0796945 0.54893317  0.56562817  0.1463724 -0.7407804
             [,19]       [,20]
[1,] -0.8962590005  0.01380961
[2,]  0.4547051204 -2.39738341
[3,]  0.2566558789  1.05963780
[4,] -1.4602081272 -0.39079586
[5,] -0.0006019766  0.98407433
> 
> 
> 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 :  566  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 -1.043375 -0.03356671 -1.226759 1.433739 -0.3920492 -0.5942928 0.4003496
            col8       col9     col10      col11      col12     col13    col14
row1 -0.08543143 -0.7046285 -1.762351 -0.9452243 -0.2116673 0.6352496 0.237139
         col15    col16     col17      col18    col19     col20
row1 -1.533051 -1.22969 0.3754532 -0.1233067 2.276309 0.3975597
> tmp[,"col10"]
           col10
row1 -1.76235119
row2  0.05956872
row3 -0.48126565
row4  0.68665925
row5 -1.08228254
> tmp[c("row1","row5"),]
           col1        col2      col3      col4       col5       col6      col7
row1 -1.0433752 -0.03356671 -1.226759 1.4337392 -0.3920492 -0.5942928 0.4003496
row5  0.1598302 -0.91232728  0.817915 0.5195167  0.3348075  1.0178861 0.5242685
            col8       col9     col10      col11      col12      col13
row1 -0.08543143 -0.7046285 -1.762351 -0.9452243 -0.2116673  0.6352496
row5  1.74183846 -1.8012303 -1.082283  1.2105205  1.3396209 -0.7250351
         col14      col15      col16     col17      col18      col19      col20
row1  0.237139 -1.5330510 -1.2296897 0.3754532 -0.1233067  2.2763093  0.3975597
row5 -1.599621 -0.1599543 -0.4250619 1.7940943  0.1542213 -0.1392339 -0.2059409
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.5942928  0.3975597
row2  2.4712079  0.2003496
row3 -0.7974423 -0.3872303
row4  0.9290562 -0.9968774
row5  1.0178861 -0.2059409
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.5942928  0.3975597
row5  1.0178861 -0.2059409
> 
> 
> 
> 
> 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.93119 50.28602 50.6116 50.61162 48.81291 104.7329 49.97835 48.75048
        col9   col10    col11    col12    col13    col14    col15    col16
row1 51.0311 49.3161 48.39091 50.83178 50.05611 49.33814 51.25263 49.29769
        col17    col18    col19    col20
row1 50.78756 49.42208 51.19767 103.8893
> tmp[,"col10"]
        col10
row1 49.31610
row2 29.38028
row3 31.48194
row4 28.80520
row5 50.07479
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.93119 50.28602 50.61160 50.61162 48.81291 104.7329 49.97835 48.75048
row5 50.22547 51.65005 48.97586 49.92281 48.83324 105.4273 50.59806 49.83971
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.03110 49.31610 48.39091 50.83178 50.05611 49.33814 51.25263 49.29769
row5 51.49191 50.07479 50.11589 50.11051 49.61298 49.77639 48.92079 50.26646
        col17    col18    col19    col20
row1 50.78756 49.42208 51.19767 103.8893
row5 49.57891 50.84387 49.83180 104.6675
> tmp[,c("col6","col20")]
          col6     col20
row1 104.73294 103.88935
row2  74.44236  76.34514
row3  73.86619  72.42320
row4  75.21578  76.39673
row5 105.42726 104.66749
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7329 103.8893
row5 105.4273 104.6675
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7329 103.8893
row5 105.4273 104.6675
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.5202114
[2,] -0.1967095
[3,] -0.1191520
[4,]  1.2094247
[5,]  1.3406936
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.93690772  1.8178256
[2,]  0.02533892  1.0529047
[3,]  0.51282240 -0.8377611
[4,] -0.57387920 -0.9791347
[5,] -0.42160094 -0.2193758
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.5368988  0.41955625
[2,]  0.6192398 -0.57163196
[3,]  1.2765472  0.09462249
[4,]  0.2493080  1.16119282
[5,]  2.0648272  1.70174844
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5368988
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5368988
[2,]  0.6192398
> 
> 
> 
> 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.6044029 0.346598 -0.1430116 0.08638625 -0.3373328 -0.5384524 0.09232349
row1 0.4584284 1.684495 -1.9095703 1.23277377 -0.5166499  0.2941916 0.19346080
           [,8]       [,9]      [,10]      [,11]      [,12]      [,13]
row3 1.34330047 -0.4306718 -0.2284716  0.3416041 -0.4896657 -0.3955005
row1 0.02675206 -0.1830576 -1.0194936 -1.2839443 -0.3793811  0.4212236
         [,14]      [,15]      [,16]      [,17]      [,18]      [,19]
row3 -1.092471 -0.4814558 -2.0873893  0.7840227 -0.3200846  0.2945699
row1 -1.287705  0.3114116  0.6306543 -1.3378755  2.2622191 -0.3072560
          [,20]
row3 -0.9702097
row1  0.1300924
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]      [,5]     [,6]       [,7]
row2 -0.2510605 0.9425912 -0.445132 -0.3914641 0.7519521 1.543381 -0.3899984
          [,8]      [,9]        [,10]
row2 0.6598509 0.3429053 -0.002628955
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]     [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
row5 2.023982 1.436954 0.7896848 -1.725817 0.9003518 0.6620379 -0.1828038
          [,8]     [,9]      [,10]     [,11]     [,12]     [,13]     [,14]
row5 0.6601545 1.036708 -0.8461104 0.2892136 -1.644067 -1.353885 0.4240602
         [,15]    [,16]     [,17]     [,18]     [,19]       [,20]
row5 0.6170116 1.182971 -1.487005 -2.801783 -1.662845 0.005536422
> 
> 
> 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: 0x58d948fec0e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30485329f94243"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM304853709e9c8" 
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3048536cb232e" 
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM304853641fdee5"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3048535da6c716"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3048534bc6b39d"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30485338dfab1f"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30485319278458"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM304853755060d5"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30485332f26759"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30485344901a1a"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30485371bc450e"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30485346dcb895"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3048532c65971a"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30485325bdc7c1"
> 
> 
> ### 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: 0x58d949783130>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x58d949783130>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x58d949783130>
> rowMedians(tmp)
  [1]  4.657280e-01  3.160065e-01  9.112460e-02  2.010906e-01 -4.906504e-02
  [6] -1.197287e-01  5.373958e-01  3.523586e-01  4.271321e-01 -1.692040e-01
 [11]  4.018411e-01  4.268238e-03 -5.890520e-02  1.036397e-01 -3.799429e-01
 [16] -2.875615e-01  3.381206e-01  3.744179e-01 -9.298971e-02 -2.136806e-01
 [21]  8.536950e-02  1.227014e-02  2.312302e-03  2.456195e-01  7.756600e-01
 [26]  1.688496e-01 -5.050424e-02  6.285903e-01 -4.922851e-01  7.483401e-01
 [31] -4.606042e-02 -1.814882e-01 -1.089535e-01  4.268755e-01  2.826987e-01
 [36] -1.216230e-01 -1.878284e-01 -3.221282e-01  1.100789e-01  2.073748e-01
 [41] -6.885103e-02 -3.763615e-01 -3.863960e-01  8.912520e-02 -1.857333e-01
 [46] -1.529354e-01 -1.264838e-01 -4.801225e-03 -2.855437e-01 -1.024517e-01
 [51]  3.123828e-02  7.083960e-01  1.815880e-01  4.848594e-02  5.930718e-01
 [56]  8.388709e-02 -3.748156e-01  2.252827e-01  4.213746e-01 -1.125415e-01
 [61]  1.935392e-02 -2.804121e-01  9.647651e-02  4.901797e-01  3.527915e-02
 [66]  1.815275e-01 -1.246267e-01  5.149110e-01  2.091165e-01  1.036095e-01
 [71] -1.861168e-01  1.658877e-01  6.813361e-01 -4.254483e-01  7.334353e-02
 [76] -5.105374e-02 -3.512927e-01 -3.850148e-01 -6.346424e-01  2.951464e-03
 [81] -4.283181e-02  3.141465e-02  4.594024e-01  4.400202e-01 -3.878875e-01
 [86] -2.389518e-01 -1.794016e-01  4.403330e-02  2.862408e-01  4.752604e-01
 [91] -3.184362e-01  2.226733e-01 -2.423973e-01 -5.135922e-01  1.226929e-01
 [96] -3.916566e-02 -1.014288e-01  6.183857e-02 -4.676605e-01 -2.698140e-01
[101]  5.964908e-01  2.294603e-01 -2.681841e-01 -2.266446e-01 -1.139958e-01
[106] -3.874984e-01  2.496174e-01  1.776306e-02 -1.448832e-01  9.533744e-02
[111]  6.140126e-01  3.051422e-02  3.330283e-01  1.569388e-03  3.274870e-01
[116]  4.714146e-01  4.366600e-01 -2.491362e-01  2.281468e-01  3.190905e-01
[121]  1.802245e-01 -1.236057e-01  8.005573e-02 -4.066484e-01  9.116235e-02
[126]  1.118097e-01 -7.202605e-05 -2.318151e-01 -7.388658e-02  6.750919e-02
[131]  1.584364e-01  4.935527e-01  6.152974e-02  2.718014e-02  1.317855e-02
[136] -3.055649e-01 -2.275995e-01  6.596450e-02 -4.787565e-01 -2.676548e-01
[141]  9.541052e-02  7.989166e-02 -1.551224e-01 -1.693429e-01 -3.877660e-01
[146] -8.581233e-02 -7.016369e-01  3.821900e-01 -1.272537e-01 -7.910551e-02
[151]  9.682448e-02  1.000536e-01 -3.564134e-02  3.084982e-01 -3.683006e-02
[156]  5.351350e-01 -1.532126e-01 -2.979541e-01 -2.669663e-01 -3.439062e-01
[161] -6.007243e-02 -3.913508e-02  3.943893e-02 -2.570801e-01  1.131801e-02
[166]  1.176401e-01  2.787600e-01  1.780364e-01  2.768778e-01 -3.445140e-01
[171] -1.433078e-01 -1.132945e-01 -1.022456e-02 -6.454409e-01 -4.285777e-01
[176]  2.964481e-02  2.537235e-01 -9.032307e-02 -2.055432e-01 -5.675727e-01
[181] -1.050987e-01 -3.797585e-01  2.935166e-01 -4.156023e-01 -9.884503e-01
[186]  5.740133e-01 -7.035021e-02  1.028268e-02 -2.107541e-01  2.527885e-02
[191] -7.269430e-02  5.344622e-02 -3.345434e-02  1.747242e-01  9.349045e-02
[196] -6.090727e-01 -8.284629e-01  1.813153e-01 -4.371045e-01 -2.219227e-01
[201] -3.126739e-02  8.664862e-01 -2.741663e-02  4.479923e-01  3.952441e-01
[206] -6.048229e-01 -1.260848e-01  1.234443e-02  6.348439e-01  1.978149e-02
[211]  2.201733e-01  3.767693e-01  1.712775e-01 -3.786599e-02 -5.414051e-02
[216] -1.957925e-01  3.636472e-01 -7.560902e-02 -6.042605e-01  3.319477e-01
[221] -1.084284e-01  2.750691e-01 -3.914279e-01 -7.611908e-02 -4.979272e-01
[226] -5.384824e-01 -1.529809e-01 -1.163480e-01 -1.512457e-01 -9.508603e-01
> 
> proc.time()
   user  system elapsed 
  1.235   0.667   1.893 

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: 0x621bb0577370>
> .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: 0x621bb0577370>
> .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: 0x621bb0577370>
> .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: 0x621bb0577370>
> 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: 0x621bb055f1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x621bb055f1c0>
> .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: 0x621bb055f1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x621bb055f1c0>
> .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: 0x621bb055f1c0>
> 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: 0x621bb0842120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x621bb0842120>
> .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: 0x621bb0842120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x621bb0842120>
> .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: 0x621bb0842120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x621bb0842120>
> .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: 0x621bb0842120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x621bb0842120>
> .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: 0x621bb0842120>
> 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: 0x621baf592390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x621baf592390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x621baf592390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x621baf592390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile304948114ef650" "BufferedMatrixFile30494871d19cdc"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile304948114ef650" "BufferedMatrixFile30494871d19cdc"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x621baf4893d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x621baf4893d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x621baf4893d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x621baf4893d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x621baf4893d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x621baf4893d0>
> .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: 0x621bb0fbefa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x621bb0fbefa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x621bb0fbefa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x621bb0fbefa0>
> 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: 0x621baf796ff0>
> .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: 0x621baf796ff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.243   0.041   0.274 

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.253   0.048   0.286 

Example timings