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

This page was generated on 2025-10-24 12:03 -0400 (Fri, 24 Oct 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4898
lconwaymacOS 12.7.6 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4688
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4634
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4658
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/2359HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-23 14:17 -0400 (Thu, 23 Oct 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    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.73.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.73.0.tar.gz
StartedAt: 2025-10-23 21:41:43 -0400 (Thu, 23 Oct 2025)
EndedAt: 2025-10-23 21:42:12 -0400 (Thu, 23 Oct 2025)
EllapsedTime: 29.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.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-08-23 r88802)
* 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.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... 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.73.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.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.268   0.038   0.293 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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 478419 25.6    1047111   56   639600 34.2
Vcells 885237  6.8    8388608   64  2081604 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 Oct 23 21:42:03 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Oct 23 21:42:03 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x55c6abb7dc80>
> 
> 
> 
> 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 Oct 23 21:42:03 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Oct 23 21:42:03 2025"
> 
> ColMode(tmp2)
<pointer: 0x55c6abb7dc80>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]        [,4]
[1,] 101.1221009  2.358812  0.2526960 -0.57769841
[2,]   0.6307138 -1.058777  0.2007367  0.11905758
[3,]  -0.6273403 -0.470344  0.1984199 -1.22011096
[4,]  -1.9819305  1.831593 -0.3023560 -0.02940695
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]     [,2]      [,3]       [,4]
[1,] 101.1221009 2.358812 0.2526960 0.57769841
[2,]   0.6307138 1.058777 0.2007367 0.11905758
[3,]   0.6273403 0.470344 0.1984199 1.22011096
[4,]   1.9819305 1.831593 0.3023560 0.02940695
> 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.0559485 1.5358423 0.5026888 0.7600647
[2,]  0.7941749 1.0289690 0.4480365 0.3450472
[3,]  0.7920482 0.6858163 0.4454435 1.1045863
[4,]  1.4078105 1.3533637 0.5498691 0.1714846
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.68159 42.71723 30.27958 33.17835
[2,]  33.57246 36.34847 29.68110 28.56953
[3,]  33.54782 32.32851 29.65285 37.26597
[4,]  41.06004 40.36523 30.80105 26.74425
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x55c6add2d110>
> exp(tmp5)
<pointer: 0x55c6add2d110>
> log(tmp5,2)
<pointer: 0x55c6add2d110>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.808
> Min(tmp5)
[1] 53.28854
> mean(tmp5)
[1] 72.35074
> Sum(tmp5)
[1] 14470.15
> Var(tmp5)
[1] 889.6163
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.31610 67.06578 70.78707 70.37013 71.83041 71.18447 71.23448 71.35853
 [9] 70.15321 69.20723
> rowSums(tmp5)
 [1] 1806.322 1341.316 1415.741 1407.403 1436.608 1423.689 1424.690 1427.171
 [9] 1403.064 1384.145
> rowVars(tmp5)
 [1] 8147.75872   65.40864   73.54313   71.42913  101.67123   74.64485
 [7]   79.10867  100.70010   77.35574  130.54501
> rowSd(tmp5)
 [1] 90.264936  8.087561  8.575729  8.451576 10.083215  8.639725  8.894306
 [8] 10.034944  8.795211 11.425630
> rowMax(tmp5)
 [1] 471.80802  85.79294  91.91916  85.46109  87.51631  96.43867  84.42236
 [8]  90.62280  85.69506  93.13591
> rowMin(tmp5)
 [1] 55.54314 55.62585 58.93498 55.66466 54.11632 56.66890 56.25176 56.72399
 [9] 54.04241 53.28854
> 
> colMeans(tmp5)
 [1] 110.03635  76.20914  67.95983  69.61597  70.01327  70.10051  71.76216
 [8]  69.41568  68.94980  72.25433  64.68457  73.16022  71.83276  66.88280
[15]  63.81804  73.83638  70.73928  76.46860  67.91812  71.35701
> colSums(tmp5)
 [1] 1100.3635  762.0914  679.5983  696.1597  700.1327  701.0051  717.6216
 [8]  694.1568  689.4980  722.5433  646.8457  731.6022  718.3276  668.8280
[15]  638.1804  738.3638  707.3928  764.6860  679.1812  713.5701
> colVars(tmp5)
 [1] 16271.04867    86.06417    80.06460   102.36560    67.12916   150.00134
 [7]    83.08510   193.17804    51.49921    73.06170    82.82920   106.90517
[13]    76.20414    31.29609    38.28159    46.95614    46.96658    79.71243
[19]    68.44568    48.96444
> colSd(tmp5)
 [1] 127.558021   9.277078   8.947882  10.117589   8.193239  12.247503
 [7]   9.115103  13.898850   7.176295   8.547614   9.101055  10.339496
[13]   8.729498   5.594291   6.187212   6.852455   6.853217   8.928182
[19]   8.273191   6.997459
> colMax(tmp5)
 [1] 471.80802  88.91033  82.58903  81.38267  84.42236  96.43867  83.56565
 [8]  91.91916  82.71988  85.29657  82.95321  93.13591  85.69506  78.31803
[15]  72.82067  84.96703  81.22645  90.62280  81.20225  84.54018
> colMin(tmp5)
 [1] 54.11632 64.07805 53.28854 55.66466 60.76110 54.04241 54.50901 55.07822
 [9] 62.50049 57.16193 56.72399 63.49862 57.17455 59.35139 55.54314 63.58959
[17] 60.62178 58.96179 59.71370 61.34493
> 
> 
> ### 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] 90.31610 67.06578 70.78707 70.37013 71.83041 71.18447 71.23448       NA
 [9] 70.15321 69.20723
> rowSums(tmp5)
 [1] 1806.322 1341.316 1415.741 1407.403 1436.608 1423.689 1424.690       NA
 [9] 1403.064 1384.145
> rowVars(tmp5)
 [1] 8147.75872   65.40864   73.54313   71.42913  101.67123   74.64485
 [7]   79.10867  101.04585   77.35574  130.54501
> rowSd(tmp5)
 [1] 90.264936  8.087561  8.575729  8.451576 10.083215  8.639725  8.894306
 [8] 10.052157  8.795211 11.425630
> rowMax(tmp5)
 [1] 471.80802  85.79294  91.91916  85.46109  87.51631  96.43867  84.42236
 [8]        NA  85.69506  93.13591
> rowMin(tmp5)
 [1] 55.54314 55.62585 58.93498 55.66466 54.11632 56.66890 56.25176       NA
 [9] 54.04241 53.28854
> 
> colMeans(tmp5)
 [1] 110.03635  76.20914  67.95983  69.61597  70.01327  70.10051  71.76216
 [8]  69.41568  68.94980  72.25433  64.68457  73.16022  71.83276  66.88280
[15]  63.81804  73.83638  70.73928  76.46860        NA  71.35701
> colSums(tmp5)
 [1] 1100.3635  762.0914  679.5983  696.1597  700.1327  701.0051  717.6216
 [8]  694.1568  689.4980  722.5433  646.8457  731.6022  718.3276  668.8280
[15]  638.1804  738.3638  707.3928  764.6860        NA  713.5701
> colVars(tmp5)
 [1] 16271.04867    86.06417    80.06460   102.36560    67.12916   150.00134
 [7]    83.08510   193.17804    51.49921    73.06170    82.82920   106.90517
[13]    76.20414    31.29609    38.28159    46.95614    46.96658    79.71243
[19]          NA    48.96444
> colSd(tmp5)
 [1] 127.558021   9.277078   8.947882  10.117589   8.193239  12.247503
 [7]   9.115103  13.898850   7.176295   8.547614   9.101055  10.339496
[13]   8.729498   5.594291   6.187212   6.852455   6.853217   8.928182
[19]         NA   6.997459
> colMax(tmp5)
 [1] 471.80802  88.91033  82.58903  81.38267  84.42236  96.43867  83.56565
 [8]  91.91916  82.71988  85.29657  82.95321  93.13591  85.69506  78.31803
[15]  72.82067  84.96703  81.22645  90.62280        NA  84.54018
> colMin(tmp5)
 [1] 54.11632 64.07805 53.28854 55.66466 60.76110 54.04241 54.50901 55.07822
 [9] 62.50049 57.16193 56.72399 63.49862 57.17455 59.35139 55.54314 63.58959
[17] 60.62178 58.96179       NA 61.34493
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.808
> Min(tmp5,na.rm=TRUE)
[1] 53.28854
> mean(tmp5,na.rm=TRUE)
[1] 72.40333
> Sum(tmp5,na.rm=TRUE)
[1] 14408.26
> Var(tmp5,na.rm=TRUE)
[1] 893.5533
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.31610 67.06578 70.78707 70.37013 71.83041 71.18447 71.23448 71.85715
 [9] 70.15321 69.20723
> rowSums(tmp5,na.rm=TRUE)
 [1] 1806.322 1341.316 1415.741 1407.403 1436.608 1423.689 1424.690 1365.286
 [9] 1403.064 1384.145
> rowVars(tmp5,na.rm=TRUE)
 [1] 8147.75872   65.40864   73.54313   71.42913  101.67123   74.64485
 [7]   79.10867  101.04585   77.35574  130.54501
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.264936  8.087561  8.575729  8.451576 10.083215  8.639725  8.894306
 [8] 10.052157  8.795211 11.425630
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.80802  85.79294  91.91916  85.46109  87.51631  96.43867  84.42236
 [8]  90.62280  85.69506  93.13591
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.54314 55.62585 58.93498 55.66466 54.11632 56.66890 56.25176 56.72399
 [9] 54.04241 53.28854
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.03635  76.20914  67.95983  69.61597  70.01327  70.10051  71.76216
 [8]  69.41568  68.94980  72.25433  64.68457  73.16022  71.83276  66.88280
[15]  63.81804  73.83638  70.73928  76.46860  68.58850  71.35701
> colSums(tmp5,na.rm=TRUE)
 [1] 1100.3635  762.0914  679.5983  696.1597  700.1327  701.0051  717.6216
 [8]  694.1568  689.4980  722.5433  646.8457  731.6022  718.3276  668.8280
[15]  638.1804  738.3638  707.3928  764.6860  617.2965  713.5701
> colVars(tmp5,na.rm=TRUE)
 [1] 16271.04867    86.06417    80.06460   102.36560    67.12916   150.00134
 [7]    83.08510   193.17804    51.49921    73.06170    82.82920   106.90517
[13]    76.20414    31.29609    38.28159    46.95614    46.96658    79.71243
[19]    71.94560    48.96444
> colSd(tmp5,na.rm=TRUE)
 [1] 127.558021   9.277078   8.947882  10.117589   8.193239  12.247503
 [7]   9.115103  13.898850   7.176295   8.547614   9.101055  10.339496
[13]   8.729498   5.594291   6.187212   6.852455   6.853217   8.928182
[19]   8.482075   6.997459
> colMax(tmp5,na.rm=TRUE)
 [1] 471.80802  88.91033  82.58903  81.38267  84.42236  96.43867  83.56565
 [8]  91.91916  82.71988  85.29657  82.95321  93.13591  85.69506  78.31803
[15]  72.82067  84.96703  81.22645  90.62280  81.20225  84.54018
> colMin(tmp5,na.rm=TRUE)
 [1] 54.11632 64.07805 53.28854 55.66466 60.76110 54.04241 54.50901 55.07822
 [9] 62.50049 57.16193 56.72399 63.49862 57.17455 59.35139 55.54314 63.58959
[17] 60.62178 58.96179 59.71370 61.34493
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.31610 67.06578 70.78707 70.37013 71.83041 71.18447 71.23448      NaN
 [9] 70.15321 69.20723
> rowSums(tmp5,na.rm=TRUE)
 [1] 1806.322 1341.316 1415.741 1407.403 1436.608 1423.689 1424.690    0.000
 [9] 1403.064 1384.145
> rowVars(tmp5,na.rm=TRUE)
 [1] 8147.75872   65.40864   73.54313   71.42913  101.67123   74.64485
 [7]   79.10867         NA   77.35574  130.54501
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.264936  8.087561  8.575729  8.451576 10.083215  8.639725  8.894306
 [8]        NA  8.795211 11.425630
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.80802  85.79294  91.91916  85.46109  87.51631  96.43867  84.42236
 [8]        NA  85.69506  93.13591
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.54314 55.62585 58.93498 55.66466 54.11632 56.66890 56.25176       NA
 [9] 54.04241 53.28854
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.82914  77.25737  66.63638  68.49644  70.79130  69.79078  70.91116
 [8]  67.91189  69.14574  72.56662  65.56908  73.33323  73.46145  66.55019
[15]  64.13951  74.89755  71.55528  74.89591       NaN  69.89222
> colSums(tmp5,na.rm=TRUE)
 [1] 1015.4622  695.3163  599.7275  616.4679  637.1217  628.1171  638.2005
 [8]  611.2070  622.3116  653.0995  590.1217  659.9991  661.1531  598.9517
[15]  577.2556  674.0780  643.9975  674.0632    0.0000  629.0299
> colVars(tmp5,na.rm=TRUE)
 [1] 18217.18395    84.46086    70.36830   101.06110    68.71034   167.67230
 [7]    85.32363   191.88491    57.50470    81.09728    84.38133   119.93155
[13]    55.88754    33.96352    41.90421    40.15715    45.34660    61.85128
[19]          NA    30.94668
> colSd(tmp5,na.rm=TRUE)
 [1] 134.971049   9.190259   8.388582  10.052915   8.289170  12.948834
 [7]   9.237079  13.852253   7.583186   9.005403   9.185931  10.951327
[13]   7.475797   5.827823   6.473346   6.336967   6.733989   7.864559
[19]         NA   5.562974
> colMax(tmp5,na.rm=TRUE)
 [1] 471.80802  88.91033  82.58903  81.38267  84.42236  96.43867  83.56565
 [8]  91.91916  82.71988  85.29657  82.95321  93.13591  85.69506  78.31803
[15]  72.82067  84.96703  81.22645  85.76341      -Inf  78.00816
> colMin(tmp5,na.rm=TRUE)
 [1] 54.11632 64.07805 53.28854 55.66466 60.76110 54.04241 54.50901 55.07822
 [9] 62.50049 57.16193 56.98970 63.49862 62.43854 59.35139 55.54314 63.58959
[17] 60.62178 58.96179      Inf 61.34493
> 
> 
> 
> 
> 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] 272.3573 130.0416 254.2104 143.2334 262.7922 231.6626 222.8437 112.0531
 [9] 155.0141 170.1303
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 272.3573 130.0416 254.2104 143.2334 262.7922 231.6626 222.8437 112.0531
 [9] 155.0141 170.1303
> 
> 
> 
> 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  1.278977e-13  0.000000e+00  0.000000e+00
 [6]  0.000000e+00  0.000000e+00 -9.947598e-14  2.842171e-14 -2.842171e-14
[11]  5.684342e-14  8.526513e-14  1.705303e-13  0.000000e+00 -1.136868e-13
[16] -5.684342e-14  5.684342e-14  0.000000e+00 -2.842171e-13  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   8 
6   5 
3   10 
6   14 
6   3 
8   2 
7   16 
9   12 
1   2 
8   8 
8   9 
5   6 
6   16 
6   12 
6   4 
2   4 
10   8 
2   12 
1   7 
3   13 
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.944778
> Min(tmp)
[1] -1.890815
> mean(tmp)
[1] 0.04295056
> Sum(tmp)
[1] 4.295056
> Var(tmp)
[1] 0.9785881
> 
> rowMeans(tmp)
[1] 0.04295056
> rowSums(tmp)
[1] 4.295056
> rowVars(tmp)
[1] 0.9785881
> rowSd(tmp)
[1] 0.9892361
> rowMax(tmp)
[1] 2.944778
> rowMin(tmp)
[1] -1.890815
> 
> colMeans(tmp)
  [1]  0.08628802  0.64837764 -0.63504045  0.29598122  2.94477813 -0.11961286
  [7]  0.92824318 -0.26330921 -0.78495039  1.52319416  0.37202706 -1.36920501
 [13] -1.01161227 -1.39522983 -0.35974049  0.22663742 -0.47259538  1.32110713
 [19]  0.21558824  0.85989177 -0.31490917 -0.34173186 -0.76510311 -0.12073627
 [25] -0.12946642 -0.93733299 -0.69446377  0.34525599  0.41193453 -0.46977997
 [31]  2.11962864  1.66742533 -1.54006261  0.93743465  0.58967620  1.19568216
 [37]  0.10087781 -0.46222580  0.58577464  0.57316870 -0.54254236  0.87877159
 [43]  0.43474435 -1.67241832 -1.07804633  1.68114263  0.34862720 -0.22638532
 [49]  0.18741991  0.31574865  0.52892372 -0.78780496  1.59810453 -0.56664004
 [55] -0.44414877  0.75768287 -1.09424197 -0.84954467 -1.27550480 -1.56488836
 [61]  1.24349961  0.68796249  0.64622318  0.56177891  1.03178013  0.54279049
 [67]  0.04134877  0.47625560  1.94723173 -0.98691357 -1.58935673 -1.33491130
 [73]  0.65299090 -1.11482937 -0.69070909 -0.41430129 -1.04479912  1.01576694
 [79]  1.36465871 -0.10697814  1.26717726  0.98403505 -0.37567896 -0.80237868
 [85] -0.62079496 -1.89081453  1.05169583 -0.93488769  1.69010317 -0.51953022
 [91] -0.52069566  1.55576952 -0.46166145  1.60313149 -0.07197346 -0.02609312
 [97] -1.58816522 -0.48586304 -0.66734437 -0.21132859
> colSums(tmp)
  [1]  0.08628802  0.64837764 -0.63504045  0.29598122  2.94477813 -0.11961286
  [7]  0.92824318 -0.26330921 -0.78495039  1.52319416  0.37202706 -1.36920501
 [13] -1.01161227 -1.39522983 -0.35974049  0.22663742 -0.47259538  1.32110713
 [19]  0.21558824  0.85989177 -0.31490917 -0.34173186 -0.76510311 -0.12073627
 [25] -0.12946642 -0.93733299 -0.69446377  0.34525599  0.41193453 -0.46977997
 [31]  2.11962864  1.66742533 -1.54006261  0.93743465  0.58967620  1.19568216
 [37]  0.10087781 -0.46222580  0.58577464  0.57316870 -0.54254236  0.87877159
 [43]  0.43474435 -1.67241832 -1.07804633  1.68114263  0.34862720 -0.22638532
 [49]  0.18741991  0.31574865  0.52892372 -0.78780496  1.59810453 -0.56664004
 [55] -0.44414877  0.75768287 -1.09424197 -0.84954467 -1.27550480 -1.56488836
 [61]  1.24349961  0.68796249  0.64622318  0.56177891  1.03178013  0.54279049
 [67]  0.04134877  0.47625560  1.94723173 -0.98691357 -1.58935673 -1.33491130
 [73]  0.65299090 -1.11482937 -0.69070909 -0.41430129 -1.04479912  1.01576694
 [79]  1.36465871 -0.10697814  1.26717726  0.98403505 -0.37567896 -0.80237868
 [85] -0.62079496 -1.89081453  1.05169583 -0.93488769  1.69010317 -0.51953022
 [91] -0.52069566  1.55576952 -0.46166145  1.60313149 -0.07197346 -0.02609312
 [97] -1.58816522 -0.48586304 -0.66734437 -0.21132859
> 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.08628802  0.64837764 -0.63504045  0.29598122  2.94477813 -0.11961286
  [7]  0.92824318 -0.26330921 -0.78495039  1.52319416  0.37202706 -1.36920501
 [13] -1.01161227 -1.39522983 -0.35974049  0.22663742 -0.47259538  1.32110713
 [19]  0.21558824  0.85989177 -0.31490917 -0.34173186 -0.76510311 -0.12073627
 [25] -0.12946642 -0.93733299 -0.69446377  0.34525599  0.41193453 -0.46977997
 [31]  2.11962864  1.66742533 -1.54006261  0.93743465  0.58967620  1.19568216
 [37]  0.10087781 -0.46222580  0.58577464  0.57316870 -0.54254236  0.87877159
 [43]  0.43474435 -1.67241832 -1.07804633  1.68114263  0.34862720 -0.22638532
 [49]  0.18741991  0.31574865  0.52892372 -0.78780496  1.59810453 -0.56664004
 [55] -0.44414877  0.75768287 -1.09424197 -0.84954467 -1.27550480 -1.56488836
 [61]  1.24349961  0.68796249  0.64622318  0.56177891  1.03178013  0.54279049
 [67]  0.04134877  0.47625560  1.94723173 -0.98691357 -1.58935673 -1.33491130
 [73]  0.65299090 -1.11482937 -0.69070909 -0.41430129 -1.04479912  1.01576694
 [79]  1.36465871 -0.10697814  1.26717726  0.98403505 -0.37567896 -0.80237868
 [85] -0.62079496 -1.89081453  1.05169583 -0.93488769  1.69010317 -0.51953022
 [91] -0.52069566  1.55576952 -0.46166145  1.60313149 -0.07197346 -0.02609312
 [97] -1.58816522 -0.48586304 -0.66734437 -0.21132859
> colMin(tmp)
  [1]  0.08628802  0.64837764 -0.63504045  0.29598122  2.94477813 -0.11961286
  [7]  0.92824318 -0.26330921 -0.78495039  1.52319416  0.37202706 -1.36920501
 [13] -1.01161227 -1.39522983 -0.35974049  0.22663742 -0.47259538  1.32110713
 [19]  0.21558824  0.85989177 -0.31490917 -0.34173186 -0.76510311 -0.12073627
 [25] -0.12946642 -0.93733299 -0.69446377  0.34525599  0.41193453 -0.46977997
 [31]  2.11962864  1.66742533 -1.54006261  0.93743465  0.58967620  1.19568216
 [37]  0.10087781 -0.46222580  0.58577464  0.57316870 -0.54254236  0.87877159
 [43]  0.43474435 -1.67241832 -1.07804633  1.68114263  0.34862720 -0.22638532
 [49]  0.18741991  0.31574865  0.52892372 -0.78780496  1.59810453 -0.56664004
 [55] -0.44414877  0.75768287 -1.09424197 -0.84954467 -1.27550480 -1.56488836
 [61]  1.24349961  0.68796249  0.64622318  0.56177891  1.03178013  0.54279049
 [67]  0.04134877  0.47625560  1.94723173 -0.98691357 -1.58935673 -1.33491130
 [73]  0.65299090 -1.11482937 -0.69070909 -0.41430129 -1.04479912  1.01576694
 [79]  1.36465871 -0.10697814  1.26717726  0.98403505 -0.37567896 -0.80237868
 [85] -0.62079496 -1.89081453  1.05169583 -0.93488769  1.69010317 -0.51953022
 [91] -0.52069566  1.55576952 -0.46166145  1.60313149 -0.07197346 -0.02609312
 [97] -1.58816522 -0.48586304 -0.66734437 -0.21132859
> colMedians(tmp)
  [1]  0.08628802  0.64837764 -0.63504045  0.29598122  2.94477813 -0.11961286
  [7]  0.92824318 -0.26330921 -0.78495039  1.52319416  0.37202706 -1.36920501
 [13] -1.01161227 -1.39522983 -0.35974049  0.22663742 -0.47259538  1.32110713
 [19]  0.21558824  0.85989177 -0.31490917 -0.34173186 -0.76510311 -0.12073627
 [25] -0.12946642 -0.93733299 -0.69446377  0.34525599  0.41193453 -0.46977997
 [31]  2.11962864  1.66742533 -1.54006261  0.93743465  0.58967620  1.19568216
 [37]  0.10087781 -0.46222580  0.58577464  0.57316870 -0.54254236  0.87877159
 [43]  0.43474435 -1.67241832 -1.07804633  1.68114263  0.34862720 -0.22638532
 [49]  0.18741991  0.31574865  0.52892372 -0.78780496  1.59810453 -0.56664004
 [55] -0.44414877  0.75768287 -1.09424197 -0.84954467 -1.27550480 -1.56488836
 [61]  1.24349961  0.68796249  0.64622318  0.56177891  1.03178013  0.54279049
 [67]  0.04134877  0.47625560  1.94723173 -0.98691357 -1.58935673 -1.33491130
 [73]  0.65299090 -1.11482937 -0.69070909 -0.41430129 -1.04479912  1.01576694
 [79]  1.36465871 -0.10697814  1.26717726  0.98403505 -0.37567896 -0.80237868
 [85] -0.62079496 -1.89081453  1.05169583 -0.93488769  1.69010317 -0.51953022
 [91] -0.52069566  1.55576952 -0.46166145  1.60313149 -0.07197346 -0.02609312
 [97] -1.58816522 -0.48586304 -0.66734437 -0.21132859
> colRanges(tmp)
           [,1]      [,2]       [,3]      [,4]     [,5]       [,6]      [,7]
[1,] 0.08628802 0.6483776 -0.6350405 0.2959812 2.944778 -0.1196129 0.9282432
[2,] 0.08628802 0.6483776 -0.6350405 0.2959812 2.944778 -0.1196129 0.9282432
           [,8]       [,9]    [,10]     [,11]     [,12]     [,13]    [,14]
[1,] -0.2633092 -0.7849504 1.523194 0.3720271 -1.369205 -1.011612 -1.39523
[2,] -0.2633092 -0.7849504 1.523194 0.3720271 -1.369205 -1.011612 -1.39523
          [,15]     [,16]      [,17]    [,18]     [,19]     [,20]      [,21]
[1,] -0.3597405 0.2266374 -0.4725954 1.321107 0.2155882 0.8598918 -0.3149092
[2,] -0.3597405 0.2266374 -0.4725954 1.321107 0.2155882 0.8598918 -0.3149092
          [,22]      [,23]      [,24]      [,25]     [,26]      [,27]    [,28]
[1,] -0.3417319 -0.7651031 -0.1207363 -0.1294664 -0.937333 -0.6944638 0.345256
[2,] -0.3417319 -0.7651031 -0.1207363 -0.1294664 -0.937333 -0.6944638 0.345256
         [,29]    [,30]    [,31]    [,32]     [,33]     [,34]     [,35]
[1,] 0.4119345 -0.46978 2.119629 1.667425 -1.540063 0.9374347 0.5896762
[2,] 0.4119345 -0.46978 2.119629 1.667425 -1.540063 0.9374347 0.5896762
        [,36]     [,37]      [,38]     [,39]     [,40]      [,41]     [,42]
[1,] 1.195682 0.1008778 -0.4622258 0.5857746 0.5731687 -0.5425424 0.8787716
[2,] 1.195682 0.1008778 -0.4622258 0.5857746 0.5731687 -0.5425424 0.8787716
         [,43]     [,44]     [,45]    [,46]     [,47]      [,48]     [,49]
[1,] 0.4347443 -1.672418 -1.078046 1.681143 0.3486272 -0.2263853 0.1874199
[2,] 0.4347443 -1.672418 -1.078046 1.681143 0.3486272 -0.2263853 0.1874199
         [,50]     [,51]     [,52]    [,53]    [,54]      [,55]     [,56]
[1,] 0.3157486 0.5289237 -0.787805 1.598105 -0.56664 -0.4441488 0.7576829
[2,] 0.3157486 0.5289237 -0.787805 1.598105 -0.56664 -0.4441488 0.7576829
         [,57]      [,58]     [,59]     [,60]  [,61]     [,62]     [,63]
[1,] -1.094242 -0.8495447 -1.275505 -1.564888 1.2435 0.6879625 0.6462232
[2,] -1.094242 -0.8495447 -1.275505 -1.564888 1.2435 0.6879625 0.6462232
         [,64]   [,65]     [,66]      [,67]     [,68]    [,69]      [,70]
[1,] 0.5617789 1.03178 0.5427905 0.04134877 0.4762556 1.947232 -0.9869136
[2,] 0.5617789 1.03178 0.5427905 0.04134877 0.4762556 1.947232 -0.9869136
         [,71]     [,72]     [,73]     [,74]      [,75]      [,76]     [,77]
[1,] -1.589357 -1.334911 0.6529909 -1.114829 -0.6907091 -0.4143013 -1.044799
[2,] -1.589357 -1.334911 0.6529909 -1.114829 -0.6907091 -0.4143013 -1.044799
        [,78]    [,79]      [,80]    [,81]    [,82]     [,83]      [,84]
[1,] 1.015767 1.364659 -0.1069781 1.267177 0.984035 -0.375679 -0.8023787
[2,] 1.015767 1.364659 -0.1069781 1.267177 0.984035 -0.375679 -0.8023787
         [,85]     [,86]    [,87]      [,88]    [,89]      [,90]      [,91]
[1,] -0.620795 -1.890815 1.051696 -0.9348877 1.690103 -0.5195302 -0.5206957
[2,] -0.620795 -1.890815 1.051696 -0.9348877 1.690103 -0.5195302 -0.5206957
       [,92]      [,93]    [,94]       [,95]       [,96]     [,97]     [,98]
[1,] 1.55577 -0.4616614 1.603131 -0.07197346 -0.02609312 -1.588165 -0.485863
[2,] 1.55577 -0.4616614 1.603131 -0.07197346 -0.02609312 -1.588165 -0.485863
          [,99]     [,100]
[1,] -0.6673444 -0.2113286
[2,] -0.6673444 -0.2113286
> 
> 
> Max(tmp2)
[1] 2.595889
> Min(tmp2)
[1] -2.685207
> mean(tmp2)
[1] 0.1134857
> Sum(tmp2)
[1] 11.34857
> Var(tmp2)
[1] 1.123584
> 
> rowMeans(tmp2)
  [1] -0.813421555  0.838259953 -1.021347405 -0.443450529 -1.362397578
  [6] -0.430845003  0.024470880  1.167095532  2.456617816 -1.659576845
 [11]  0.608673680  0.203276965  1.033431696 -1.108058331 -0.682956807
 [16]  0.704481704 -0.087045695  0.536540135 -1.460377389  0.991161035
 [21]  0.506359184  0.599920679 -0.343960075 -0.769580997  0.256711658
 [26]  0.700571183 -0.081629676 -0.509589141 -0.329667563  1.094261384
 [31] -0.723157202  0.289479519  0.481599468 -0.600789426  0.339169976
 [36] -0.684987606  0.029650214  0.104811934 -0.208299497  0.410351496
 [41]  1.476100555 -2.576906500  0.210328501 -1.381688355  0.043014012
 [46] -0.119873294  0.215496401  0.755274080 -1.488407951  1.156045308
 [51]  0.170193317  1.383268176  2.396709142 -0.381795206 -0.098958156
 [56] -0.162049551 -0.853770191 -0.869401589  2.067973356 -1.177563096
 [61]  2.080626786  0.616064546  0.877278242  1.930658459 -0.249942865
 [66] -1.158116261 -2.685206646 -0.140463334 -0.502000178 -0.216409351
 [71]  0.327712235 -1.932912246 -0.488731165 -0.408200381  0.433686571
 [76] -0.058857455  1.226408703 -0.363894823  0.991409782  2.441077856
 [81]  0.172105864 -1.617705706  0.174845289 -0.056295451 -0.433890473
 [86]  0.002085059 -0.052032132 -0.744080379  1.903864830 -0.149280417
 [91]  0.842209773  0.054530304  1.249130022  2.595888605  0.868543688
 [96] -0.954289326  1.575866622  0.572612570  1.867153090 -0.062627745
> rowSums(tmp2)
  [1] -0.813421555  0.838259953 -1.021347405 -0.443450529 -1.362397578
  [6] -0.430845003  0.024470880  1.167095532  2.456617816 -1.659576845
 [11]  0.608673680  0.203276965  1.033431696 -1.108058331 -0.682956807
 [16]  0.704481704 -0.087045695  0.536540135 -1.460377389  0.991161035
 [21]  0.506359184  0.599920679 -0.343960075 -0.769580997  0.256711658
 [26]  0.700571183 -0.081629676 -0.509589141 -0.329667563  1.094261384
 [31] -0.723157202  0.289479519  0.481599468 -0.600789426  0.339169976
 [36] -0.684987606  0.029650214  0.104811934 -0.208299497  0.410351496
 [41]  1.476100555 -2.576906500  0.210328501 -1.381688355  0.043014012
 [46] -0.119873294  0.215496401  0.755274080 -1.488407951  1.156045308
 [51]  0.170193317  1.383268176  2.396709142 -0.381795206 -0.098958156
 [56] -0.162049551 -0.853770191 -0.869401589  2.067973356 -1.177563096
 [61]  2.080626786  0.616064546  0.877278242  1.930658459 -0.249942865
 [66] -1.158116261 -2.685206646 -0.140463334 -0.502000178 -0.216409351
 [71]  0.327712235 -1.932912246 -0.488731165 -0.408200381  0.433686571
 [76] -0.058857455  1.226408703 -0.363894823  0.991409782  2.441077856
 [81]  0.172105864 -1.617705706  0.174845289 -0.056295451 -0.433890473
 [86]  0.002085059 -0.052032132 -0.744080379  1.903864830 -0.149280417
 [91]  0.842209773  0.054530304  1.249130022  2.595888605  0.868543688
 [96] -0.954289326  1.575866622  0.572612570  1.867153090 -0.062627745
> 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.813421555  0.838259953 -1.021347405 -0.443450529 -1.362397578
  [6] -0.430845003  0.024470880  1.167095532  2.456617816 -1.659576845
 [11]  0.608673680  0.203276965  1.033431696 -1.108058331 -0.682956807
 [16]  0.704481704 -0.087045695  0.536540135 -1.460377389  0.991161035
 [21]  0.506359184  0.599920679 -0.343960075 -0.769580997  0.256711658
 [26]  0.700571183 -0.081629676 -0.509589141 -0.329667563  1.094261384
 [31] -0.723157202  0.289479519  0.481599468 -0.600789426  0.339169976
 [36] -0.684987606  0.029650214  0.104811934 -0.208299497  0.410351496
 [41]  1.476100555 -2.576906500  0.210328501 -1.381688355  0.043014012
 [46] -0.119873294  0.215496401  0.755274080 -1.488407951  1.156045308
 [51]  0.170193317  1.383268176  2.396709142 -0.381795206 -0.098958156
 [56] -0.162049551 -0.853770191 -0.869401589  2.067973356 -1.177563096
 [61]  2.080626786  0.616064546  0.877278242  1.930658459 -0.249942865
 [66] -1.158116261 -2.685206646 -0.140463334 -0.502000178 -0.216409351
 [71]  0.327712235 -1.932912246 -0.488731165 -0.408200381  0.433686571
 [76] -0.058857455  1.226408703 -0.363894823  0.991409782  2.441077856
 [81]  0.172105864 -1.617705706  0.174845289 -0.056295451 -0.433890473
 [86]  0.002085059 -0.052032132 -0.744080379  1.903864830 -0.149280417
 [91]  0.842209773  0.054530304  1.249130022  2.595888605  0.868543688
 [96] -0.954289326  1.575866622  0.572612570  1.867153090 -0.062627745
> rowMin(tmp2)
  [1] -0.813421555  0.838259953 -1.021347405 -0.443450529 -1.362397578
  [6] -0.430845003  0.024470880  1.167095532  2.456617816 -1.659576845
 [11]  0.608673680  0.203276965  1.033431696 -1.108058331 -0.682956807
 [16]  0.704481704 -0.087045695  0.536540135 -1.460377389  0.991161035
 [21]  0.506359184  0.599920679 -0.343960075 -0.769580997  0.256711658
 [26]  0.700571183 -0.081629676 -0.509589141 -0.329667563  1.094261384
 [31] -0.723157202  0.289479519  0.481599468 -0.600789426  0.339169976
 [36] -0.684987606  0.029650214  0.104811934 -0.208299497  0.410351496
 [41]  1.476100555 -2.576906500  0.210328501 -1.381688355  0.043014012
 [46] -0.119873294  0.215496401  0.755274080 -1.488407951  1.156045308
 [51]  0.170193317  1.383268176  2.396709142 -0.381795206 -0.098958156
 [56] -0.162049551 -0.853770191 -0.869401589  2.067973356 -1.177563096
 [61]  2.080626786  0.616064546  0.877278242  1.930658459 -0.249942865
 [66] -1.158116261 -2.685206646 -0.140463334 -0.502000178 -0.216409351
 [71]  0.327712235 -1.932912246 -0.488731165 -0.408200381  0.433686571
 [76] -0.058857455  1.226408703 -0.363894823  0.991409782  2.441077856
 [81]  0.172105864 -1.617705706  0.174845289 -0.056295451 -0.433890473
 [86]  0.002085059 -0.052032132 -0.744080379  1.903864830 -0.149280417
 [91]  0.842209773  0.054530304  1.249130022  2.595888605  0.868543688
 [96] -0.954289326  1.575866622  0.572612570  1.867153090 -0.062627745
> 
> colMeans(tmp2)
[1] 0.1134857
> colSums(tmp2)
[1] 11.34857
> colVars(tmp2)
[1] 1.123584
> colSd(tmp2)
[1] 1.059993
> colMax(tmp2)
[1] 2.595889
> colMin(tmp2)
[1] -2.685207
> colMedians(tmp2)
[1] 0.02706055
> colRanges(tmp2)
          [,1]
[1,] -2.685207
[2,]  2.595889
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]   0.4913482  -1.4698415  -2.7377427   2.4220601 -12.3585984   6.6784622
 [7]   3.4570694  -2.4640244   2.4798986   1.4640574
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.28682027
[2,] -0.71529143
[3,]  0.06180226
[4,]  0.84193720
[5,]  1.36281738
> 
> rowApply(tmp,sum)
 [1] -4.7457049  1.7532730 -3.2809688  3.1989413  0.1560528 -2.7642414
 [7]  0.3168462 -0.1599515  3.0364643  0.4519780
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    4    2    3    9    6    8    2    8     9
 [2,]   10    8    7    5    6    1    3    3    7     5
 [3,]    7    9    8    6    3    3    5    8    3     1
 [4,]    5    3    3    8    7    9    9   10    4     7
 [5,]    1    2    5    1    1    2    1    1    2     2
 [6,]    6    6    9    2   10   10   10    5   10     3
 [7,]    8   10   10    7    4    8    2    4    1     8
 [8,]    4    1    1    9    8    4    4    7    5     6
 [9,]    9    5    6    4    5    5    6    6    6    10
[10,]    3    7    4   10    2    7    7    9    9     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.06756155 -0.07421376  1.56710291 -2.41300637 -3.17048545 -1.57690576
 [7]  3.47259815  1.27635017 -1.15935616  2.19270953  2.04428764  1.70503461
[13]  0.76786453 -4.30784362  3.04817083  2.42391057 -1.53265329  0.22910630
[19] -0.66340118 -2.34897007
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.08822401
[2,]  0.61008417
[3,]  0.70645155
[4,]  0.82955350
[5,]  1.00969634
> 
> rowApply(tmp,sum)
[1] -3.368285  2.057223  2.495873 -4.906377  8.269427
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   17   16   14   13   15
[2,]    6   13   12    2   16
[3,]    7   17   20   14    4
[4,]    9    2    8    9    6
[5,]   14   10    4    4    1
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]        [,4]       [,5]       [,6]
[1,]  0.82955350 -0.9923723 -0.80704219 -0.56912451  0.4836720  1.2024397
[2,]  0.61008417  0.2863383  1.36808300 -1.09996668 -0.1598199 -0.4563225
[3,]  0.70645155  0.5255795  1.50456668 -0.09776082 -1.0925945 -0.3148227
[4,] -0.08822401 -1.2861160 -0.07653371 -0.70461170 -1.0653444 -0.8067424
[5,]  1.00969634  1.3923567 -0.42197087  0.05845734 -1.3363987 -1.2014578
           [,7]       [,8]        [,9]      [,10]      [,11]       [,12]
[1,]  0.8400592 -0.4962824 -0.06092158 -1.0451089  1.9785089  0.70800510
[2,] -0.1969915 -0.2000849 -0.99488344  2.2725192  0.4807162  0.40351072
[3,]  0.7305616  0.9802755  0.55212453  0.5186595 -1.4566312  0.03751851
[4,]  1.2984368 -0.9552606 -0.71779165 -1.5347153  0.7276775 -1.07183202
[5,]  0.8005321  1.9477026  0.06211599  1.9813551  0.3140163  1.62783230
          [,13]      [,14]      [,15]      [,16]         [,17]      [,18]
[1,] -1.5959752 -1.0774892 0.17517269  0.5401856 -0.0001440827 -1.7433747
[2,]  1.4522575 -0.9590348 0.03654623  0.2749971 -1.5800992878  1.7970981
[3,] -1.2176636 -1.1393073 0.98334768  1.3218344 -0.7660422435  0.3997560
[4,]  1.8692190 -0.8465905 0.36122955 -0.3833733  0.5487977628  0.6133545
[5,]  0.2600269 -0.2854218 1.49187467  0.6702668  0.2648345570 -0.8377276
          [,19]      [,20]
[1,] -0.5731775 -1.1648687
[2,] -0.9076928 -0.3700318
[3,]  1.0199388 -0.6999193
[4,] -0.3784121 -0.4095443
[5,]  0.1759425  0.2953939
> 
> 
> 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 :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2      col3       col4       col5      col6      col7
row1 -1.058617 0.7275768 0.3761002 -0.9957164 -0.4714619 0.8655653 0.3035653
          col8      col9     col10    col11     col12     col13       col14
row1 0.9348342 -1.086666 0.6004404 2.112731 0.3908623 0.4132967 -0.05828123
         col15     col16     col17     col18      col19     col20
row1 -2.131587 -1.219439 0.5057424 -1.501786 -0.6400395 0.2609799
> tmp[,"col10"]
          col10
row1  0.6004404
row2  1.0686013
row3 -1.3035094
row4  1.7359146
row5  0.8162296
> tmp[c("row1","row5"),]
          col1      col2      col3       col4       col5      col6       col7
row1 -1.058617 0.7275768 0.3761002 -0.9957164 -0.4714619 0.8655653  0.3035653
row5 -1.033278 1.7415880 1.2474566  0.1634423  0.7475715 0.4823577 -0.6034414
            col8       col9     col10      col11     col12      col13
row1  0.93483416 -1.0866656 0.6004404 2.11273085 0.3908623  0.4132967
row5 -0.05935928 -0.1605401 0.8162296 0.05013442 0.7527790 -0.7515154
           col14      col15     col16     col17      col18      col19
row1 -0.05828123 -2.1315873 -1.219439 0.5057424 -1.5017860 -0.6400395
row5  0.02090437  0.8980438 -1.269179 0.7967832  0.5459483 -0.8050957
            col20
row1  0.260979909
row5 -0.002291156
> tmp[,c("col6","col20")]
           col6        col20
row1  0.8655653  0.260979909
row2 -1.2432024 -0.468079658
row3  1.0358561  0.467144746
row4 -0.9036828 -0.261538510
row5  0.4823577 -0.002291156
> tmp[c("row1","row5"),c("col6","col20")]
          col6        col20
row1 0.8655653  0.260979909
row5 0.4823577 -0.002291156
> 
> 
> 
> 
> 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.56199 50.05632 51.32235 50.34584 49.86689 104.1903 51.10642 50.91536
         col9    col10    col11    col12   col13   col14    col15    col16
row1 49.58034 50.13325 50.01785 51.31288 49.4037 49.4559 48.97814 49.80881
        col17    col18    col19   col20
row1 50.18428 50.14079 49.84659 105.041
> tmp[,"col10"]
        col10
row1 50.13325
row2 29.55652
row3 30.98471
row4 29.18944
row5 50.73883
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.56199 50.05632 51.32235 50.34584 49.86689 104.1903 51.10642 50.91536
row5 50.66171 48.88585 48.57687 50.52144 50.88994 107.4018 50.36075 48.30975
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.58034 50.13325 50.01785 51.31288 49.40370 49.45590 48.97814 49.80881
row5 49.77725 50.73883 52.30637 49.39459 52.71919 50.23248 50.07573 48.44396
        col17    col18    col19    col20
row1 50.18428 50.14079 49.84659 105.0410
row5 49.23759 48.44348 50.54483 104.7034
> tmp[,c("col6","col20")]
          col6     col20
row1 104.19025 105.04100
row2  74.91262  75.31413
row3  75.03698  76.48514
row4  74.47158  75.25506
row5 107.40175 104.70344
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.1903 105.0410
row5 107.4018 104.7034
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.1903 105.0410
row5 107.4018 104.7034
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.6598559
[2,] -0.5369046
[3,] -1.4023878
[4,] -0.6990913
[5,]  0.4314872
> tmp[,c("col17","col7")]
          col17      col7
[1,]  1.1295456 0.1716333
[2,] -0.8459656 1.4673192
[3,]  1.2613046 0.1771521
[4,] -2.0211836 1.4745877
[5,]  0.8420003 0.3926735
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.2018886  1.5056891
[2,]  0.8678184  2.2098291
[3,] -0.1537909 -1.7131363
[4,] -0.1881285  1.1039759
[5,]  1.9971712  0.4285854
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.2018886
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.2018886
[2,]  0.8678184
> 
> 
> 
> 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.8841694 -0.2826472  1.406646 0.5036295 -0.7235711 0.4526535  0.3933321
row1 -0.1490366 -0.6057338 -1.110624 1.1370357 -1.3927345 2.2522559 -1.4368951
           [,8]      [,9]      [,10]      [,11]      [,12]    [,13]      [,14]
row3 -0.5525417  1.127065 -0.7814624  0.3139212  0.4187916 1.312038 0.41200925
row1  0.5203310 -1.693283  0.1045571 -0.6244488 -0.2011535 1.643001 0.04384396
          [,15]     [,16]      [,17]     [,18]     [,19]      [,20]
row3 -1.1456499 0.2102871  0.9322907 0.6004272 -1.405781 0.03730026
row1 -0.5630512 0.1730335 -0.7569858 1.5485969  1.371478 1.76091688
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]      [,5]       [,6]     [,7]
row2 -0.5760159 0.8184207 -1.822119 -0.2388882 -1.417414 -0.7903891 1.166276
          [,8]      [,9]      [,10]
row2 -2.513579 0.3273065 0.00520096
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
row5 0.0878745 -0.5036451 0.5955266 0.3528237 -1.392615 0.1035865 -0.9620667
          [,8]       [,9]     [,10]   [,11]      [,12]    [,13]     [,14]
row5 -1.932774 -0.1092645 0.3486007 1.37172 -0.4514147 1.120378 -1.114395
          [,15]      [,16]     [,17]     [,18]    [,19]      [,20]
row5 -0.7723398 -0.8916988 0.8438471 0.1921465 1.598866 -0.5434823
> 
> 
> 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: 0x55c6ac4130a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce621f02a7"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce2ccc2f37"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce40ec66e2"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce75a2195f"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce46302e21"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce2c1dca74"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce97392cc" 
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce198e2f6f"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce5f32a50a"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce51bafb4" 
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce70c82e91"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce1e9c2dc2"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fceb69f4fd" 
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce54df3f3e"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM309fce7b118831"
> 
> 
> ### 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: 0x55c6adc34790>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x55c6adc34790>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x55c6adc34790>
> rowMedians(tmp)
  [1]  0.0009896165 -0.1310123955  0.2990885123 -0.2077356856  0.3729282357
  [6]  0.1225855656  0.5885023994  0.3631555392  0.3741739517 -0.0738658522
 [11] -0.0379991130  0.1337725808 -0.1946947611  0.0359563831 -0.6548403677
 [16] -0.3036989647 -0.5186487961  0.3828438100 -0.1590470455 -0.3290361433
 [21]  0.2060004153  0.0956926242 -0.0538015882  0.3544277775  0.6544642614
 [26]  0.3906098236 -0.2300516966  0.3364032038  0.1400240084  0.4048199380
 [31]  0.1465356862 -0.2929042935  0.1614648964  0.2557450786  0.2266340405
 [36] -0.0992910839 -0.1866767582  0.1136346365  0.0373966998 -0.0083558714
 [41]  0.2233740865 -0.4319017116 -0.1378128800 -0.1546138019  0.2458030898
 [46] -0.0722425784  0.1376087277  0.3408433917  0.3893312065  0.2795503893
 [51] -0.5481336491  0.5188219920 -0.1655477921 -0.0819579351 -0.1074950152
 [56]  0.0040926658  0.1226552755  0.0066539661 -0.1789764960 -0.4687919151
 [61] -0.0663860612 -0.0647264625  0.4008769640  0.4528243499  0.4571435167
 [66]  0.2029437187  0.3887207932  0.8602828119 -0.2273964498  0.5222940172
 [71] -0.4338465393  0.2354327754  0.2993584136 -0.2767720653 -0.1670935074
 [76] -0.2967933138 -0.5642960298 -0.5763962110  0.2800996586  0.2499699241
 [81]  0.2882381262  0.7404926904 -0.0258285929 -0.1832755570 -0.2654596112
 [86]  0.5207690825 -0.3910387930 -0.4233038058 -0.4707538234 -0.2308322220
 [91] -0.0144803977  0.3702617105 -0.0693404345  0.0300533496 -0.0585624442
 [96] -0.3037226807 -0.2041467185 -0.0004313450  0.5173827841  0.1912251627
[101] -0.2838855360  0.2398480580  0.5667363770 -0.2041493243 -0.3599516075
[106]  0.3691720343 -0.0044829049  0.2034006611  0.5369144456  0.0440123173
[111] -0.6050556824 -0.0899552058  0.1460283902  0.1869126801 -0.4308687852
[116]  0.1851570775 -0.0698849240  0.2249237697 -0.1897067896  0.7171001751
[121] -0.2390650329  0.0678155415  0.0086529631 -0.3553300785 -0.2779238364
[126]  0.0741684076 -0.1342863884 -0.2687055680 -0.2006090378  0.1676474482
[131] -0.0562860246  0.1836186666 -0.1087687487  0.6017229757  0.0520522592
[136] -0.1895237331  0.4462811386 -0.4541462243  0.2635355224 -0.4889461503
[141]  0.2039352253  0.1808429708  0.5613517278  0.1966925239  0.0325848041
[146] -0.6185401876 -0.3182492875 -0.3655208182  0.1817971754 -0.1050542976
[151] -0.4495874188  0.2327505933 -0.3333740594  0.0555430383  0.1593870238
[156] -0.2549907406  0.1262163786 -0.1318748561 -0.5397571449 -0.2109145016
[161] -0.0305008446 -0.1522475282  0.2077427735 -0.2398782787  0.8084367928
[166] -0.4850351957 -0.5853183376  0.2490566105 -0.1831621220  0.4563860791
[171] -0.3915996582  0.0911011624 -0.0102036561 -0.0281431142 -0.0617107768
[176] -0.3655141467  0.2986786724 -0.4112186858 -0.0726991466 -0.1026732038
[181] -0.0631942788 -0.2517798508 -0.0911741770 -0.3892285784  0.3909611424
[186] -0.1963076778 -0.1630368521  0.0156193016 -0.1582355418  0.0295945615
[191] -0.3687641173  0.0626772329  0.0999504899  0.2912492976 -0.3922268538
[196] -0.1580168890  0.0259944258 -0.4611423949  0.3893192857 -0.0575305236
[201] -0.4607052390 -0.2027789523  0.6540187599  0.0647990157 -0.2082664540
[206] -0.7208705296 -0.4120882870 -0.4137323160 -0.0927618366  0.4682807508
[211] -0.0663017546 -0.0269235970  0.0565894408 -0.0077977521 -0.2690327284
[216] -0.2215555476  0.0991941690  0.3932354964 -0.1789462647 -0.1760385525
[221] -0.0609682670 -0.3241371429  0.1342987367  0.3193063511 -0.1682053258
[226]  0.3654626773  0.3505154663 -0.0541178917  0.3602243329  0.4814188982
> 
> proc.time()
   user  system elapsed 
  1.302   0.637   1.923 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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: 0x5a08ff747c80>
> .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: 0x5a08ff747c80>
> .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: 0x5a08ff747c80>
> .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: 0x5a08ff747c80>
> 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: 0x5a08ff3dea00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a08ff3dea00>
> .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: 0x5a08ff3dea00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a08ff3dea00>
> .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: 0x5a08ff3dea00>
> 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: 0x5a08ff4a9660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a08ff4a9660>
> .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: 0x5a08ff4a9660>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5a08ff4a9660>
> .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: 0x5a08ff4a9660>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5a08ff4a9660>
> .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: 0x5a08ff4a9660>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5a08ff4a9660>
> .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: 0x5a08ff4a9660>
> 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: 0x5a08ff9cb3e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5a08ff9cb3e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a08ff9cb3e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a08ff9cb3e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile30a03c2faa594d" "BufferedMatrixFile30a03c6cd07412"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile30a03c2faa594d" "BufferedMatrixFile30a03c6cd07412"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a0901b28470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a0901b28470>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5a0901b28470>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5a0901b28470>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5a0901b28470>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5a0901b28470>
> .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: 0x5a08fffad6e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a08fffad6e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5a08fffad6e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5a08fffad6e0>
> 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: 0x5a09013f00d0>
> .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: 0x5a09013f00d0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.231   0.060   0.279 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.250   0.046   0.284 

Example timings