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:07 -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 taishan

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.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-10-21 06:05:08 -0000 (Tue, 21 Oct 2025)
EndedAt: 2025-10-21 06:05:32 -0000 (Tue, 21 Oct 2025)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 (2025-04-11)
* using platform: aarch64-unknown-linux-gnu
* R was compiled by
    aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0
    GNU Fortran (GCC) 14.2.0
* running under: openEuler 24.03 (LTS)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* 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/R/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/R/R-4.5.0/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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){
      |            ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R-4.5.0/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.5.0/lib -lR
installing to /home/biocbuild/R/R-4.5.0/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.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.317   0.056   0.357 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 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] "Tue Oct 21 06:05:25 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] "Tue Oct 21 06:05:25 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: 0x13dffff0>
> 
> 
> 
> 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] "Tue Oct 21 06:05:26 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] "Tue Oct 21 06:05:26 2025"
> 
> ColMode(tmp2)
<pointer: 0x13dffff0>
> 
> 
> 
> ### 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,] 100.2621801 -1.96964186 -0.446484829  1.7822020
[2,]  -0.8060205  0.04879804 -0.161963213  0.4266251
[3,]   0.1664961  0.41188956 -0.005142313  0.3233673
[4,]  -0.3815489 -1.25669369 -0.148118670 -1.5344050
> 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,] 100.2621801 1.96964186 0.446484829 1.7822020
[2,]   0.8060205 0.04879804 0.161963213 0.4266251
[3,]   0.1664961 0.41188956 0.005142313 0.3233673
[4,]   0.3815489 1.25669369 0.148118670 1.5344050
> 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.0131004 1.4034393 0.66819520 1.3349914
[2,]  0.8977865 0.2209028 0.40244653 0.6531654
[3,]  0.4080394 0.6417862 0.07170993 0.5686539
[4,]  0.6176965 1.1210235 0.38486188 1.2387110
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.39318 41.00403 32.12844 40.13212
[2,]  34.78389 27.25783 29.18643 31.95828
[3,]  29.24689 31.82975 25.72224 31.00991
[4,]  31.55851 37.46693 28.99674 38.92152
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x1502f9a0>
> exp(tmp5)
<pointer: 0x1502f9a0>
> log(tmp5,2)
<pointer: 0x1502f9a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.1264
> Min(tmp5)
[1] 52.23236
> mean(tmp5)
[1] 72.39885
> Sum(tmp5)
[1] 14479.77
> Var(tmp5)
[1] 877.191
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.18359 70.13793 67.52863 70.38377 69.88005 74.29987 67.20029 70.18944
 [9] 70.55374 73.63113
> rowSums(tmp5)
 [1] 1803.672 1402.759 1350.573 1407.675 1397.601 1485.997 1344.006 1403.789
 [9] 1411.075 1472.623
> rowVars(tmp5)
 [1] 8061.78996  105.50746   47.27068   81.74993   86.21162   69.35622
 [7]   83.25774   77.65596   89.57595   68.22925
> rowSd(tmp5)
 [1] 89.787471 10.271683  6.875368  9.041567  9.285021  8.328038  9.124568
 [8]  8.812262  9.464457  8.260100
> rowMax(tmp5)
 [1] 469.12638  85.57203  84.98060  85.55394  86.82726  93.64524  85.92703
 [8]  85.00463  83.70119  87.37565
> rowMin(tmp5)
 [1] 53.32256 53.98576 53.53748 52.23236 56.88987 59.29628 53.78289 53.45730
 [9] 56.38080 61.34462
> 
> colMeans(tmp5)
 [1] 107.71746  68.11065  67.11373  71.35260  79.10175  67.76151  68.83481
 [8]  68.47435  71.45815  63.98281  75.16354  73.66040  65.95520  71.32020
[15]  70.57007  70.38890  74.22106  70.82501  68.79559  73.16911
> colSums(tmp5)
 [1] 1077.1746  681.1065  671.1373  713.5260  791.0175  677.6151  688.3481
 [8]  684.7435  714.5815  639.8281  751.6354  736.6040  659.5520  713.2020
[15]  705.7007  703.8890  742.2106  708.2501  687.9559  731.6911
> colVars(tmp5)
 [1] 16144.85476   104.59355    61.56258   110.19870    96.82526    71.66599
 [7]   100.35613    38.61612    90.53300    64.17449    62.58516    50.46765
[13]   128.14323    75.26408   121.22189    34.98207   107.36963    98.74334
[19]    56.81817    65.85846
> colSd(tmp5)
 [1] 127.062405  10.227099   7.846183  10.497557   9.839983   8.465577
 [7]  10.017791   6.214187   9.514883   8.010898   7.911078   7.104058
[13]  11.320037   8.675487  11.010081   5.914564  10.361932   9.936968
[19]   7.537783   8.115323
> colMax(tmp5)
 [1] 469.12638  85.34453  78.23123  85.96297  91.94425  82.12094  83.91608
 [8]  76.08333  85.55394  79.91668  87.37565  81.50387  83.70119  86.82726
[15]  85.57203  81.89936  87.28076  93.64524  81.41760  80.78970
> colMin(tmp5)
 [1] 60.87357 53.78289 53.53748 56.38080 58.44905 58.07376 53.32256 58.15722
 [9] 57.71910 53.98576 64.03788 56.88987 52.23236 59.29628 53.45730 64.66739
[17] 61.50715 57.95994 58.57619 59.88072
> 
> 
> ### 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.18359 70.13793 67.52863 70.38377 69.88005 74.29987 67.20029 70.18944
 [9] 70.55374       NA
> rowSums(tmp5)
 [1] 1803.672 1402.759 1350.573 1407.675 1397.601 1485.997 1344.006 1403.789
 [9] 1411.075       NA
> rowVars(tmp5)
 [1] 8061.78996  105.50746   47.27068   81.74993   86.21162   69.35622
 [7]   83.25774   77.65596   89.57595   70.47053
> rowSd(tmp5)
 [1] 89.787471 10.271683  6.875368  9.041567  9.285021  8.328038  9.124568
 [8]  8.812262  9.464457  8.394672
> rowMax(tmp5)
 [1] 469.12638  85.57203  84.98060  85.55394  86.82726  93.64524  85.92703
 [8]  85.00463  83.70119        NA
> rowMin(tmp5)
 [1] 53.32256 53.98576 53.53748 52.23236 56.88987 59.29628 53.78289 53.45730
 [9] 56.38080       NA
> 
> colMeans(tmp5)
 [1] 107.71746  68.11065  67.11373  71.35260  79.10175  67.76151  68.83481
 [8]  68.47435  71.45815  63.98281  75.16354  73.66040        NA  71.32020
[15]  70.57007  70.38890  74.22106  70.82501  68.79559  73.16911
> colSums(tmp5)
 [1] 1077.1746  681.1065  671.1373  713.5260  791.0175  677.6151  688.3481
 [8]  684.7435  714.5815  639.8281  751.6354  736.6040        NA  713.2020
[15]  705.7007  703.8890  742.2106  708.2501  687.9559  731.6911
> colVars(tmp5)
 [1] 16144.85476   104.59355    61.56258   110.19870    96.82526    71.66599
 [7]   100.35613    38.61612    90.53300    64.17449    62.58516    50.46765
[13]          NA    75.26408   121.22189    34.98207   107.36963    98.74334
[19]    56.81817    65.85846
> colSd(tmp5)
 [1] 127.062405  10.227099   7.846183  10.497557   9.839983   8.465577
 [7]  10.017791   6.214187   9.514883   8.010898   7.911078   7.104058
[13]         NA   8.675487  11.010081   5.914564  10.361932   9.936968
[19]   7.537783   8.115323
> colMax(tmp5)
 [1] 469.12638  85.34453  78.23123  85.96297  91.94425  82.12094  83.91608
 [8]  76.08333  85.55394  79.91668  87.37565  81.50387        NA  86.82726
[15]  85.57203  81.89936  87.28076  93.64524  81.41760  80.78970
> colMin(tmp5)
 [1] 60.87357 53.78289 53.53748 56.38080 58.44905 58.07376 53.32256 58.15722
 [9] 57.71910 53.98576 64.03788 56.88987       NA 59.29628 53.45730 64.66739
[17] 61.50715 57.95994 58.57619 59.88072
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.1264
> Min(tmp5,na.rm=TRUE)
[1] 52.23236
> mean(tmp5,na.rm=TRUE)
[1] 72.36679
> Sum(tmp5,na.rm=TRUE)
[1] 14400.99
> Var(tmp5,na.rm=TRUE)
[1] 881.4147
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.18359 70.13793 67.52863 70.38377 69.88005 74.29987 67.20029 70.18944
 [9] 70.55374 73.36023
> rowSums(tmp5,na.rm=TRUE)
 [1] 1803.672 1402.759 1350.573 1407.675 1397.601 1485.997 1344.006 1403.789
 [9] 1411.075 1393.844
> rowVars(tmp5,na.rm=TRUE)
 [1] 8061.78996  105.50746   47.27068   81.74993   86.21162   69.35622
 [7]   83.25774   77.65596   89.57595   70.47053
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.787471 10.271683  6.875368  9.041567  9.285021  8.328038  9.124568
 [8]  8.812262  9.464457  8.394672
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.12638  85.57203  84.98060  85.55394  86.82726  93.64524  85.92703
 [8]  85.00463  83.70119  87.37565
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.32256 53.98576 53.53748 52.23236 56.88987 59.29628 53.78289 53.45730
 [9] 56.38080 61.34462
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.71746  68.11065  67.11373  71.35260  79.10175  67.76151  68.83481
 [8]  68.47435  71.45815  63.98281  75.16354  73.66040  64.53043  71.32020
[15]  70.57007  70.38890  74.22106  70.82501  68.79559  73.16911
> colSums(tmp5,na.rm=TRUE)
 [1] 1077.1746  681.1065  671.1373  713.5260  791.0175  677.6151  688.3481
 [8]  684.7435  714.5815  639.8281  751.6354  736.6040  580.7738  713.2020
[15]  705.7007  703.8890  742.2106  708.2501  687.9559  731.6911
> colVars(tmp5,na.rm=TRUE)
 [1] 16144.85476   104.59355    61.56258   110.19870    96.82526    71.66599
 [7]   100.35613    38.61612    90.53300    64.17449    62.58516    50.46765
[13]   121.32385    75.26408   121.22189    34.98207   107.36963    98.74334
[19]    56.81817    65.85846
> colSd(tmp5,na.rm=TRUE)
 [1] 127.062405  10.227099   7.846183  10.497557   9.839983   8.465577
 [7]  10.017791   6.214187   9.514883   8.010898   7.911078   7.104058
[13]  11.014711   8.675487  11.010081   5.914564  10.361932   9.936968
[19]   7.537783   8.115323
> colMax(tmp5,na.rm=TRUE)
 [1] 469.12638  85.34453  78.23123  85.96297  91.94425  82.12094  83.91608
 [8]  76.08333  85.55394  79.91668  87.37565  81.50387  83.70119  86.82726
[15]  85.57203  81.89936  87.28076  93.64524  81.41760  80.78970
> colMin(tmp5,na.rm=TRUE)
 [1] 60.87357 53.78289 53.53748 56.38080 58.44905 58.07376 53.32256 58.15722
 [9] 57.71910 53.98576 64.03788 56.88987 52.23236 59.29628 53.45730 64.66739
[17] 61.50715 57.95994 58.57619 59.88072
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.18359 70.13793 67.52863 70.38377 69.88005 74.29987 67.20029 70.18944
 [9] 70.55374      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1803.672 1402.759 1350.573 1407.675 1397.601 1485.997 1344.006 1403.789
 [9] 1411.075    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8061.78996  105.50746   47.27068   81.74993   86.21162   69.35622
 [7]   83.25774   77.65596   89.57595         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.787471 10.271683  6.875368  9.041567  9.285021  8.328038  9.124568
 [8]  8.812262  9.464457        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.12638  85.57203  84.98060  85.55394  86.82726  93.64524  85.92703
 [8]  85.00463  83.70119        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.32256 53.98576 53.53748 52.23236 56.88987 59.29628 53.78289 53.45730
 [9] 56.38080       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.01928  68.71036  66.16755  70.59087  78.46480  66.56106  69.25974
 [8]  67.81043  72.11432  64.27594  73.80664  73.77171       NaN  71.73790
[15]  71.32500  70.94476  72.76998  70.40575  67.39315  72.57883
> colSums(tmp5,na.rm=TRUE)
 [1] 1008.1735  618.3933  595.5079  635.3178  706.1832  599.0495  623.3376
 [8]  610.2939  649.0289  578.4835  664.2597  663.9454    0.0000  645.6411
[15]  641.9250  638.5028  654.9298  633.6517  606.5383  653.2095
> colVars(tmp5,na.rm=TRUE)
 [1] 17954.77300   113.62160    59.18622   117.44590   104.36427    64.41206
 [7]   110.86931    38.48436    97.00579    71.22963    49.69500    56.63672
[13]          NA    82.70929   129.96308    35.87884    97.10254   109.10868
[19]    41.79334    70.17098
> colSd(tmp5,na.rm=TRUE)
 [1] 133.995422  10.659343   7.693258  10.837246  10.215883   8.025712
 [7]  10.529450   6.203577   9.849152   8.439765   7.049468   7.525737
[13]         NA   9.094465  11.400135   5.989895   9.854062  10.445510
[19]   6.464777   8.376812
> colMax(tmp5,na.rm=TRUE)
 [1] 469.12638  85.34453  78.23123  85.96297  91.94425  82.12094  83.91608
 [8]  76.08333  85.55394  79.91668  84.98060  81.50387      -Inf  86.82726
[15]  85.57203  81.89936  85.00463  93.64524  77.27788  80.78970
> colMin(tmp5,na.rm=TRUE)
 [1] 60.87357 53.78289 53.53748 56.38080 58.44905 58.07376 53.32256 58.15722
 [9] 57.71910 53.98576 64.03788 56.88987      Inf 59.29628 53.45730 64.66739
[17] 61.50715 57.95994 58.57619 59.88072
> 
> 
> 
> 
> 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] 154.9098 244.8521 163.5145 288.3447 228.4803 218.4264 290.7839 182.7754
 [9] 198.7815 237.6254
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 154.9098 244.8521 163.5145 288.3447 228.4803 218.4264 290.7839 182.7754
 [9] 198.7815 237.6254
> 
> 
> 
> 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] -8.526513e-14  5.684342e-14  0.000000e+00  0.000000e+00  5.684342e-14
 [6]  5.684342e-14  1.421085e-14 -1.705303e-13  2.842171e-14  8.526513e-14
[11] -5.684342e-14  4.263256e-14  1.705303e-13 -2.557954e-13  2.842171e-14
[16]  8.526513e-14  0.000000e+00  0.000000e+00  7.105427e-14 -1.705303e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   1 
4   12 
6   1 
6   16 
4   20 
3   4 
1   17 
9   10 
5   17 
6   8 
5   6 
7   12 
9   2 
10   4 
8   4 
3   20 
4   3 
6   19 
8   17 
1   1 
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.1429
> Min(tmp)
[1] -2.10957
> mean(tmp)
[1] 0.1327203
> Sum(tmp)
[1] 13.27203
> Var(tmp)
[1] 0.8836259
> 
> rowMeans(tmp)
[1] 0.1327203
> rowSums(tmp)
[1] 13.27203
> rowVars(tmp)
[1] 0.8836259
> rowSd(tmp)
[1] 0.9400138
> rowMax(tmp)
[1] 2.1429
> rowMin(tmp)
[1] -2.10957
> 
> colMeans(tmp)
  [1] -0.512997497  1.225074969  0.523818521 -0.788529665 -0.390230953
  [6] -1.416744547  0.245559227  1.042853734 -0.164047720 -0.684122143
 [11]  0.529562131 -0.984406874  0.505161105 -0.134550107  0.075780379
 [16] -0.327981029  0.790137033 -0.694381506  0.531510249 -0.035704552
 [21] -0.327609555  0.696981598  0.069991120 -0.603034102 -1.112575991
 [26] -1.368286225  2.118621799  2.104515801  1.301799779 -0.189248601
 [31]  1.207449358  1.568142628  1.465646665 -0.850727485  0.130518430
 [36] -1.687558832 -0.748446935 -0.075399626  1.932483071  0.259933963
 [41]  0.812916329 -0.122850409 -0.429779982  1.815876799 -1.745122634
 [46] -0.694119004  1.982342494 -0.020403205  2.142899927 -1.438371299
 [51] -0.017431395  0.073154361 -1.506066901 -0.400805878  0.619763903
 [56]  0.582015412  0.499357046 -0.454466207  0.176425665 -0.727534004
 [61]  1.961185676  0.002529523  1.253521016  0.653023633 -0.093163961
 [66]  1.588747166  0.174735841 -1.421474728 -0.043728856 -0.316647462
 [71]  0.794193213  0.760002786  1.254821165 -0.740403322 -0.680836608
 [76]  0.223771011 -0.337969372 -2.109570224 -0.288951445  0.222293419
 [81]  0.148756260  0.482297458  1.324140849  0.583953781 -0.110934420
 [86]  0.630677847  0.774866904 -0.554459074  0.093181949  0.440492867
 [91]  0.199608959  0.740667420 -0.382008928 -0.733294123  0.729999147
 [96] -1.218407618  0.729654893 -0.980916128  0.267670635  0.873239834
> colSums(tmp)
  [1] -0.512997497  1.225074969  0.523818521 -0.788529665 -0.390230953
  [6] -1.416744547  0.245559227  1.042853734 -0.164047720 -0.684122143
 [11]  0.529562131 -0.984406874  0.505161105 -0.134550107  0.075780379
 [16] -0.327981029  0.790137033 -0.694381506  0.531510249 -0.035704552
 [21] -0.327609555  0.696981598  0.069991120 -0.603034102 -1.112575991
 [26] -1.368286225  2.118621799  2.104515801  1.301799779 -0.189248601
 [31]  1.207449358  1.568142628  1.465646665 -0.850727485  0.130518430
 [36] -1.687558832 -0.748446935 -0.075399626  1.932483071  0.259933963
 [41]  0.812916329 -0.122850409 -0.429779982  1.815876799 -1.745122634
 [46] -0.694119004  1.982342494 -0.020403205  2.142899927 -1.438371299
 [51] -0.017431395  0.073154361 -1.506066901 -0.400805878  0.619763903
 [56]  0.582015412  0.499357046 -0.454466207  0.176425665 -0.727534004
 [61]  1.961185676  0.002529523  1.253521016  0.653023633 -0.093163961
 [66]  1.588747166  0.174735841 -1.421474728 -0.043728856 -0.316647462
 [71]  0.794193213  0.760002786  1.254821165 -0.740403322 -0.680836608
 [76]  0.223771011 -0.337969372 -2.109570224 -0.288951445  0.222293419
 [81]  0.148756260  0.482297458  1.324140849  0.583953781 -0.110934420
 [86]  0.630677847  0.774866904 -0.554459074  0.093181949  0.440492867
 [91]  0.199608959  0.740667420 -0.382008928 -0.733294123  0.729999147
 [96] -1.218407618  0.729654893 -0.980916128  0.267670635  0.873239834
> 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.512997497  1.225074969  0.523818521 -0.788529665 -0.390230953
  [6] -1.416744547  0.245559227  1.042853734 -0.164047720 -0.684122143
 [11]  0.529562131 -0.984406874  0.505161105 -0.134550107  0.075780379
 [16] -0.327981029  0.790137033 -0.694381506  0.531510249 -0.035704552
 [21] -0.327609555  0.696981598  0.069991120 -0.603034102 -1.112575991
 [26] -1.368286225  2.118621799  2.104515801  1.301799779 -0.189248601
 [31]  1.207449358  1.568142628  1.465646665 -0.850727485  0.130518430
 [36] -1.687558832 -0.748446935 -0.075399626  1.932483071  0.259933963
 [41]  0.812916329 -0.122850409 -0.429779982  1.815876799 -1.745122634
 [46] -0.694119004  1.982342494 -0.020403205  2.142899927 -1.438371299
 [51] -0.017431395  0.073154361 -1.506066901 -0.400805878  0.619763903
 [56]  0.582015412  0.499357046 -0.454466207  0.176425665 -0.727534004
 [61]  1.961185676  0.002529523  1.253521016  0.653023633 -0.093163961
 [66]  1.588747166  0.174735841 -1.421474728 -0.043728856 -0.316647462
 [71]  0.794193213  0.760002786  1.254821165 -0.740403322 -0.680836608
 [76]  0.223771011 -0.337969372 -2.109570224 -0.288951445  0.222293419
 [81]  0.148756260  0.482297458  1.324140849  0.583953781 -0.110934420
 [86]  0.630677847  0.774866904 -0.554459074  0.093181949  0.440492867
 [91]  0.199608959  0.740667420 -0.382008928 -0.733294123  0.729999147
 [96] -1.218407618  0.729654893 -0.980916128  0.267670635  0.873239834
> colMin(tmp)
  [1] -0.512997497  1.225074969  0.523818521 -0.788529665 -0.390230953
  [6] -1.416744547  0.245559227  1.042853734 -0.164047720 -0.684122143
 [11]  0.529562131 -0.984406874  0.505161105 -0.134550107  0.075780379
 [16] -0.327981029  0.790137033 -0.694381506  0.531510249 -0.035704552
 [21] -0.327609555  0.696981598  0.069991120 -0.603034102 -1.112575991
 [26] -1.368286225  2.118621799  2.104515801  1.301799779 -0.189248601
 [31]  1.207449358  1.568142628  1.465646665 -0.850727485  0.130518430
 [36] -1.687558832 -0.748446935 -0.075399626  1.932483071  0.259933963
 [41]  0.812916329 -0.122850409 -0.429779982  1.815876799 -1.745122634
 [46] -0.694119004  1.982342494 -0.020403205  2.142899927 -1.438371299
 [51] -0.017431395  0.073154361 -1.506066901 -0.400805878  0.619763903
 [56]  0.582015412  0.499357046 -0.454466207  0.176425665 -0.727534004
 [61]  1.961185676  0.002529523  1.253521016  0.653023633 -0.093163961
 [66]  1.588747166  0.174735841 -1.421474728 -0.043728856 -0.316647462
 [71]  0.794193213  0.760002786  1.254821165 -0.740403322 -0.680836608
 [76]  0.223771011 -0.337969372 -2.109570224 -0.288951445  0.222293419
 [81]  0.148756260  0.482297458  1.324140849  0.583953781 -0.110934420
 [86]  0.630677847  0.774866904 -0.554459074  0.093181949  0.440492867
 [91]  0.199608959  0.740667420 -0.382008928 -0.733294123  0.729999147
 [96] -1.218407618  0.729654893 -0.980916128  0.267670635  0.873239834
> colMedians(tmp)
  [1] -0.512997497  1.225074969  0.523818521 -0.788529665 -0.390230953
  [6] -1.416744547  0.245559227  1.042853734 -0.164047720 -0.684122143
 [11]  0.529562131 -0.984406874  0.505161105 -0.134550107  0.075780379
 [16] -0.327981029  0.790137033 -0.694381506  0.531510249 -0.035704552
 [21] -0.327609555  0.696981598  0.069991120 -0.603034102 -1.112575991
 [26] -1.368286225  2.118621799  2.104515801  1.301799779 -0.189248601
 [31]  1.207449358  1.568142628  1.465646665 -0.850727485  0.130518430
 [36] -1.687558832 -0.748446935 -0.075399626  1.932483071  0.259933963
 [41]  0.812916329 -0.122850409 -0.429779982  1.815876799 -1.745122634
 [46] -0.694119004  1.982342494 -0.020403205  2.142899927 -1.438371299
 [51] -0.017431395  0.073154361 -1.506066901 -0.400805878  0.619763903
 [56]  0.582015412  0.499357046 -0.454466207  0.176425665 -0.727534004
 [61]  1.961185676  0.002529523  1.253521016  0.653023633 -0.093163961
 [66]  1.588747166  0.174735841 -1.421474728 -0.043728856 -0.316647462
 [71]  0.794193213  0.760002786  1.254821165 -0.740403322 -0.680836608
 [76]  0.223771011 -0.337969372 -2.109570224 -0.288951445  0.222293419
 [81]  0.148756260  0.482297458  1.324140849  0.583953781 -0.110934420
 [86]  0.630677847  0.774866904 -0.554459074  0.093181949  0.440492867
 [91]  0.199608959  0.740667420 -0.382008928 -0.733294123  0.729999147
 [96] -1.218407618  0.729654893 -0.980916128  0.267670635  0.873239834
> colRanges(tmp)
           [,1]     [,2]      [,3]       [,4]      [,5]      [,6]      [,7]
[1,] -0.5129975 1.225075 0.5238185 -0.7885297 -0.390231 -1.416745 0.2455592
[2,] -0.5129975 1.225075 0.5238185 -0.7885297 -0.390231 -1.416745 0.2455592
         [,8]       [,9]      [,10]     [,11]      [,12]     [,13]      [,14]
[1,] 1.042854 -0.1640477 -0.6841221 0.5295621 -0.9844069 0.5051611 -0.1345501
[2,] 1.042854 -0.1640477 -0.6841221 0.5295621 -0.9844069 0.5051611 -0.1345501
          [,15]     [,16]    [,17]      [,18]     [,19]       [,20]      [,21]
[1,] 0.07578038 -0.327981 0.790137 -0.6943815 0.5315102 -0.03570455 -0.3276096
[2,] 0.07578038 -0.327981 0.790137 -0.6943815 0.5315102 -0.03570455 -0.3276096
         [,22]      [,23]      [,24]     [,25]     [,26]    [,27]    [,28]
[1,] 0.6969816 0.06999112 -0.6030341 -1.112576 -1.368286 2.118622 2.104516
[2,] 0.6969816 0.06999112 -0.6030341 -1.112576 -1.368286 2.118622 2.104516
      [,29]      [,30]    [,31]    [,32]    [,33]      [,34]     [,35]
[1,] 1.3018 -0.1892486 1.207449 1.568143 1.465647 -0.8507275 0.1305184
[2,] 1.3018 -0.1892486 1.207449 1.568143 1.465647 -0.8507275 0.1305184
         [,36]      [,37]       [,38]    [,39]    [,40]     [,41]      [,42]
[1,] -1.687559 -0.7484469 -0.07539963 1.932483 0.259934 0.8129163 -0.1228504
[2,] -1.687559 -0.7484469 -0.07539963 1.932483 0.259934 0.8129163 -0.1228504
        [,43]    [,44]     [,45]     [,46]    [,47]      [,48]  [,49]     [,50]
[1,] -0.42978 1.815877 -1.745123 -0.694119 1.982342 -0.0204032 2.1429 -1.438371
[2,] -0.42978 1.815877 -1.745123 -0.694119 1.982342 -0.0204032 2.1429 -1.438371
           [,51]      [,52]     [,53]      [,54]     [,55]     [,56]    [,57]
[1,] -0.01743139 0.07315436 -1.506067 -0.4008059 0.6197639 0.5820154 0.499357
[2,] -0.01743139 0.07315436 -1.506067 -0.4008059 0.6197639 0.5820154 0.499357
          [,58]     [,59]     [,60]    [,61]       [,62]    [,63]     [,64]
[1,] -0.4544662 0.1764257 -0.727534 1.961186 0.002529523 1.253521 0.6530236
[2,] -0.4544662 0.1764257 -0.727534 1.961186 0.002529523 1.253521 0.6530236
           [,65]    [,66]     [,67]     [,68]       [,69]      [,70]     [,71]
[1,] -0.09316396 1.588747 0.1747358 -1.421475 -0.04372886 -0.3166475 0.7941932
[2,] -0.09316396 1.588747 0.1747358 -1.421475 -0.04372886 -0.3166475 0.7941932
         [,72]    [,73]      [,74]      [,75]    [,76]      [,77]    [,78]
[1,] 0.7600028 1.254821 -0.7404033 -0.6808366 0.223771 -0.3379694 -2.10957
[2,] 0.7600028 1.254821 -0.7404033 -0.6808366 0.223771 -0.3379694 -2.10957
          [,79]     [,80]     [,81]     [,82]    [,83]     [,84]      [,85]
[1,] -0.2889514 0.2222934 0.1487563 0.4822975 1.324141 0.5839538 -0.1109344
[2,] -0.2889514 0.2222934 0.1487563 0.4822975 1.324141 0.5839538 -0.1109344
         [,86]     [,87]      [,88]      [,89]     [,90]    [,91]     [,92]
[1,] 0.6306778 0.7748669 -0.5544591 0.09318195 0.4404929 0.199609 0.7406674
[2,] 0.6306778 0.7748669 -0.5544591 0.09318195 0.4404929 0.199609 0.7406674
          [,93]      [,94]     [,95]     [,96]     [,97]      [,98]     [,99]
[1,] -0.3820089 -0.7332941 0.7299991 -1.218408 0.7296549 -0.9809161 0.2676706
[2,] -0.3820089 -0.7332941 0.7299991 -1.218408 0.7296549 -0.9809161 0.2676706
        [,100]
[1,] 0.8732398
[2,] 0.8732398
> 
> 
> Max(tmp2)
[1] 2.810904
> Min(tmp2)
[1] -2.357971
> mean(tmp2)
[1] -0.04979936
> Sum(tmp2)
[1] -4.979936
> Var(tmp2)
[1] 1.134046
> 
> rowMeans(tmp2)
  [1] -0.53996310 -0.04086513  1.98181386 -0.83031433  0.50232942  1.75790743
  [7] -2.35797065 -0.54276243 -0.27504061 -1.10990345 -0.65822151 -0.56258136
 [13]  0.84457689 -0.16637227 -0.36908701 -0.91618229 -0.39073502  0.15261037
 [19] -0.94869948  0.66946249 -0.13569771  0.59447345 -0.56598480 -0.33021778
 [25]  0.33262636 -0.21059907  1.25177043  1.51538348  0.61460732 -0.66201526
 [31] -1.33774433 -0.67323958 -0.99228952 -1.52704164  0.13204100 -0.20236726
 [37]  0.86691346 -0.90050023 -0.72082700 -0.05737677  0.03512894  1.65953199
 [43] -1.92941654  2.81090365 -1.99124670 -0.40468847 -0.63619714  2.03884191
 [49] -0.52756976  0.01245859  1.14029459 -1.00396814 -1.18351368  0.05332454
 [55] -0.42191925 -1.15445407 -1.08790474 -0.82604112 -1.58823793  1.37280677
 [61]  0.54402939  0.95997586 -0.63748807  0.57878981  1.32455753 -1.53585876
 [67] -0.13144068  1.70973657  0.45989494  0.39688353  0.82215848  1.41564771
 [73] -0.12309756  0.36447998  1.69058939  0.80587492  0.95698706  0.46561511
 [79]  2.01692257  0.96865576 -1.72829322  0.15653263  1.51673986 -0.90046863
 [85] -0.67772826 -0.14684012 -1.87289213  0.44882372  0.27192216 -0.43910917
 [91] -0.81659613  1.28146751 -0.28345399 -0.56356684 -0.24628496 -2.19283642
 [97] -0.65189850  1.44492333 -1.11731794 -1.07602228
> rowSums(tmp2)
  [1] -0.53996310 -0.04086513  1.98181386 -0.83031433  0.50232942  1.75790743
  [7] -2.35797065 -0.54276243 -0.27504061 -1.10990345 -0.65822151 -0.56258136
 [13]  0.84457689 -0.16637227 -0.36908701 -0.91618229 -0.39073502  0.15261037
 [19] -0.94869948  0.66946249 -0.13569771  0.59447345 -0.56598480 -0.33021778
 [25]  0.33262636 -0.21059907  1.25177043  1.51538348  0.61460732 -0.66201526
 [31] -1.33774433 -0.67323958 -0.99228952 -1.52704164  0.13204100 -0.20236726
 [37]  0.86691346 -0.90050023 -0.72082700 -0.05737677  0.03512894  1.65953199
 [43] -1.92941654  2.81090365 -1.99124670 -0.40468847 -0.63619714  2.03884191
 [49] -0.52756976  0.01245859  1.14029459 -1.00396814 -1.18351368  0.05332454
 [55] -0.42191925 -1.15445407 -1.08790474 -0.82604112 -1.58823793  1.37280677
 [61]  0.54402939  0.95997586 -0.63748807  0.57878981  1.32455753 -1.53585876
 [67] -0.13144068  1.70973657  0.45989494  0.39688353  0.82215848  1.41564771
 [73] -0.12309756  0.36447998  1.69058939  0.80587492  0.95698706  0.46561511
 [79]  2.01692257  0.96865576 -1.72829322  0.15653263  1.51673986 -0.90046863
 [85] -0.67772826 -0.14684012 -1.87289213  0.44882372  0.27192216 -0.43910917
 [91] -0.81659613  1.28146751 -0.28345399 -0.56356684 -0.24628496 -2.19283642
 [97] -0.65189850  1.44492333 -1.11731794 -1.07602228
> 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.53996310 -0.04086513  1.98181386 -0.83031433  0.50232942  1.75790743
  [7] -2.35797065 -0.54276243 -0.27504061 -1.10990345 -0.65822151 -0.56258136
 [13]  0.84457689 -0.16637227 -0.36908701 -0.91618229 -0.39073502  0.15261037
 [19] -0.94869948  0.66946249 -0.13569771  0.59447345 -0.56598480 -0.33021778
 [25]  0.33262636 -0.21059907  1.25177043  1.51538348  0.61460732 -0.66201526
 [31] -1.33774433 -0.67323958 -0.99228952 -1.52704164  0.13204100 -0.20236726
 [37]  0.86691346 -0.90050023 -0.72082700 -0.05737677  0.03512894  1.65953199
 [43] -1.92941654  2.81090365 -1.99124670 -0.40468847 -0.63619714  2.03884191
 [49] -0.52756976  0.01245859  1.14029459 -1.00396814 -1.18351368  0.05332454
 [55] -0.42191925 -1.15445407 -1.08790474 -0.82604112 -1.58823793  1.37280677
 [61]  0.54402939  0.95997586 -0.63748807  0.57878981  1.32455753 -1.53585876
 [67] -0.13144068  1.70973657  0.45989494  0.39688353  0.82215848  1.41564771
 [73] -0.12309756  0.36447998  1.69058939  0.80587492  0.95698706  0.46561511
 [79]  2.01692257  0.96865576 -1.72829322  0.15653263  1.51673986 -0.90046863
 [85] -0.67772826 -0.14684012 -1.87289213  0.44882372  0.27192216 -0.43910917
 [91] -0.81659613  1.28146751 -0.28345399 -0.56356684 -0.24628496 -2.19283642
 [97] -0.65189850  1.44492333 -1.11731794 -1.07602228
> rowMin(tmp2)
  [1] -0.53996310 -0.04086513  1.98181386 -0.83031433  0.50232942  1.75790743
  [7] -2.35797065 -0.54276243 -0.27504061 -1.10990345 -0.65822151 -0.56258136
 [13]  0.84457689 -0.16637227 -0.36908701 -0.91618229 -0.39073502  0.15261037
 [19] -0.94869948  0.66946249 -0.13569771  0.59447345 -0.56598480 -0.33021778
 [25]  0.33262636 -0.21059907  1.25177043  1.51538348  0.61460732 -0.66201526
 [31] -1.33774433 -0.67323958 -0.99228952 -1.52704164  0.13204100 -0.20236726
 [37]  0.86691346 -0.90050023 -0.72082700 -0.05737677  0.03512894  1.65953199
 [43] -1.92941654  2.81090365 -1.99124670 -0.40468847 -0.63619714  2.03884191
 [49] -0.52756976  0.01245859  1.14029459 -1.00396814 -1.18351368  0.05332454
 [55] -0.42191925 -1.15445407 -1.08790474 -0.82604112 -1.58823793  1.37280677
 [61]  0.54402939  0.95997586 -0.63748807  0.57878981  1.32455753 -1.53585876
 [67] -0.13144068  1.70973657  0.45989494  0.39688353  0.82215848  1.41564771
 [73] -0.12309756  0.36447998  1.69058939  0.80587492  0.95698706  0.46561511
 [79]  2.01692257  0.96865576 -1.72829322  0.15653263  1.51673986 -0.90046863
 [85] -0.67772826 -0.14684012 -1.87289213  0.44882372  0.27192216 -0.43910917
 [91] -0.81659613  1.28146751 -0.28345399 -0.56356684 -0.24628496 -2.19283642
 [97] -0.65189850  1.44492333 -1.11731794 -1.07602228
> 
> colMeans(tmp2)
[1] -0.04979936
> colSums(tmp2)
[1] -4.979936
> colVars(tmp2)
[1] 1.134046
> colSd(tmp2)
[1] 1.064916
> colMax(tmp2)
[1] 2.810904
> colMin(tmp2)
[1] -2.357971
> colMedians(tmp2)
[1] -0.1843698
> colRanges(tmp2)
          [,1]
[1,] -2.357971
[2,]  2.810904
> 
> 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]  5.3313405  2.4270893  1.1858259 -0.7947470 -1.3715938  1.2083871
 [7]  3.8885258  4.4269503  0.2021074 -8.4104211
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.42525554
[2,]  0.05193506
[3,]  0.39844874
[4,]  0.98189865
[5,]  2.50330044
> 
> rowApply(tmp,sum)
 [1]  1.349821  6.057398  3.219197 -1.981882 -2.641739 -1.250818  6.429268
 [8] -6.768204  1.398520  2.281903
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    9    7    2   10    6    3   10    6     6
 [2,]    3    2    2   10    5   10    7    7   10     1
 [3,]    9    5    4    5    7    8    6    8    3     4
 [4,]   10    6    1    7    2    3    4    6    2    10
 [5,]    4   10    8    6    6    2    1    1    8     5
 [6,]    8    3    5    9    1    4    5    9    7     7
 [7,]    2    8    6    3    8    7   10    5    4     9
 [8,]    6    7    9    4    3    9    8    4    9     8
 [9,]    1    4   10    8    9    5    9    2    1     3
[10,]    7    1    3    1    4    1    2    3    5     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.8090351  2.0315793 -4.0492697  1.7288656  4.9153116  2.7473509
 [7]  3.6868986 -2.3708582 -2.2105845 -0.3440734 -0.8810260 -2.5393503
[13]  3.1865214 -0.2430247 -0.3376909  0.2443471 -0.4067989  0.4004154
[19] -0.6032059 -5.2779831
> colApply(tmp,quantile)[,1]
             [,1]
[1,] -1.054274282
[2,] -0.118370962
[3,] -0.047337938
[4,] -0.007583411
[5,]  0.418531514
> 
> rowApply(tmp,sum)
[1] -2.576599 -3.674635  2.098655  1.080334  1.940634
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   11   13   14    3   10
[2,]    4   20   12   19    1
[3,]   10    4    3    2    3
[4,]    9   18   18    7   16
[5,]   20   19   16   14   14
> 
> 
> as.matrix(tmp)
             [,1]       [,2]       [,3]       [,4]      [,5]       [,6]
[1,] -0.047337938 -1.1235143 -0.1805786 -0.3332427 1.3685703  0.6241047
[2,] -0.118370962  2.2230093 -1.2054392  1.0323575 1.8947065 -1.2996302
[3,]  0.418531514  0.2963958 -1.0231741  1.0283774 0.8620204  0.2320045
[4,] -1.054274282  1.9927635 -1.1687131 -0.6696549 0.3592924  2.5561463
[5,] -0.007583411 -1.3570751 -0.4713646  0.6710283 0.4307220  0.6347256
            [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  1.26189615 -1.80659995 -0.6249301 -0.5391242  0.2696236 -0.6302065
[2,]  0.18237550  0.10661602 -0.6951946 -0.2541067 -0.3392345 -1.1130136
[3,]  1.93063989 -0.38886055 -0.2337780 -0.2410912  1.0201928 -1.8843492
[4,] -0.01719864  0.02134447 -0.4894376  0.9000280 -1.0048423  0.6754573
[5,]  0.32918573 -0.30335821 -0.1672443 -0.2097793 -0.8267656  0.4127617
           [,13]      [,14]      [,15]       [,16]      [,17]      [,18]
[1,]  1.08837473 -0.4993000  0.1764785  0.83566947  0.3012185  0.5997091
[2,] -0.04129806  0.9879199 -0.6431259 -0.24498623 -0.1280091 -0.6613956
[3,]  1.31458189  0.7953992 -0.2887991 -0.59795013 -0.5888838  0.4144269
[4,] -0.32547464 -1.3203937  0.7270829  0.01750549 -0.8125189 -0.8012492
[5,]  1.15033751 -0.2066501 -0.3093272  0.23410848  0.8213944  0.8489242
           [,19]      [,20]
[1,] -1.57533769 -1.7420717
[2,] -1.64839117 -1.7094239
[3,]  0.09626851 -1.0632973
[4,]  1.79530697 -0.3008364
[5,]  0.72894749 -0.4623538
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
            col1      col2      col3      col4       col5      col6       col7
row1 -0.01390485 0.0175874 0.3480905 0.6724981 -0.5394738 0.4424548 -0.4396582
          col8      col9    col10     col11     col12    col13      col14
row1 0.3384804 -1.223344 0.372139 -1.304761 0.8271776 1.308937 0.02882933
          col15      col16     col17       col18      col19    col20
row1 -0.6033706 -0.5758766 0.3050577 0.001134955 0.09042955 0.453136
> tmp[,"col10"]
          col10
row1  0.3721390
row2 -0.2011635
row3 -0.7076388
row4 -0.2949861
row5 -0.1324405
> tmp[c("row1","row5"),]
            col1      col2      col3       col4       col5      col6       col7
row1 -0.01390485 0.0175874 0.3480905  0.6724981 -0.5394738 0.4424548 -0.4396582
row5  1.14307362 0.2192473 1.3691853 -0.2643929  1.9060046 1.2501656 -0.6839206
          col8      col9      col10     col11     col12      col13      col14
row1 0.3384804 -1.223344  0.3721390 -1.304761 0.8271776 1.30893652 0.02882933
row5 1.8401962  1.670055 -0.1324405 -1.007141 0.5188389 0.08745175 0.67645742
          col15        col16      col17       col18      col19      col20
row1 -0.6033706 -0.575876602  0.3050577 0.001134955 0.09042955 0.45313600
row5  0.2222708  0.009394869 -0.8388810 0.427254169 0.99404289 0.03919614
> tmp[,c("col6","col20")]
           col6       col20
row1  0.4424548  0.45313600
row2 -0.4852310  2.22744479
row3 -1.7339681 -0.42095379
row4  0.4046668  1.93625278
row5  1.2501656  0.03919614
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.4424548 0.45313600
row5 1.2501656 0.03919614
> 
> 
> 
> 
> 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 48.96623 49.89211 51.24561 51.91913 49.70566 105.5414 50.96708 49.15158
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.43712 48.13259 49.24516 49.88238 50.87713 50.16426 49.66919 50.61252
       col17    col18    col19    col20
row1 49.0365 50.54541 51.04494 105.8727
> tmp[,"col10"]
        col10
row1 48.13259
row2 30.49025
row3 30.33344
row4 29.91380
row5 50.27971
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.96623 49.89211 51.24561 51.91913 49.70566 105.5414 50.96708 49.15158
row5 50.96196 50.76369 51.01781 49.90877 49.15368 104.9087 50.34245 51.25492
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.43712 48.13259 49.24516 49.88238 50.87713 50.16426 49.66919 50.61252
row5 47.94738 50.27971 49.07771 50.49188 50.97714 50.98106 50.47893 50.59588
        col17    col18    col19    col20
row1 49.03650 50.54541 51.04494 105.8727
row5 50.20457 49.73377 50.44051 103.6526
> tmp[,c("col6","col20")]
          col6     col20
row1 105.54142 105.87267
row2  75.69894  76.47087
row3  74.02743  74.75419
row4  75.59712  76.64695
row5 104.90868 103.65260
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.5414 105.8727
row5 104.9087 103.6526
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.5414 105.8727
row5 104.9087 103.6526
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.1007020
[2,]  1.0489149
[3,]  0.1293805
[4,] -2.8457536
[5,] -0.4284468
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.4119862 -0.8426982
[2,] -3.0863359  0.9319411
[3,] -1.0978400 -0.6525221
[4,]  0.7589559  1.7140268
[5,] -0.7826799  2.5125020
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.4709030  0.01256435
[2,]  0.3448938 -1.03257919
[3,]  0.6411385 -1.60628769
[4,]  0.4112791  2.78071406
[5,]  0.5799154 -1.41371071
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -0.470903
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.4709030
[2,]  0.3448938
> 
> 
> 
> 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]
row3 -0.6790226 -0.9474662  0.99835911  0.979789 -1.164688 -0.2285523
row1 -0.3725011  0.6224032 -0.06845613 -1.302232 -1.535774  1.6756279
            [,7]       [,8]       [,9]      [,10]      [,11]     [,12]
row3 -0.03692157  0.8555469 -1.3786349 -1.7007777 -2.0404754 -1.057555
row1  1.63398100 -2.0321380  0.3759219  0.1701209  0.5498237  1.934667
          [,13]      [,14]      [,15]      [,16]      [,17]     [,18]    [,19]
row3 -1.1322614 -0.5260751  0.9829954 -1.1879790 -1.1221508 2.8023136 1.787263
row1  0.8512705 -0.4636727 -1.4347783  0.2686323 -0.0559467 0.2756371 1.380948
         [,20]
row3 -1.915831
row1 -1.183302
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]        [,2]      [,3]       [,4]       [,5]        [,6]
row2 -0.3034366 -0.09892219 0.5827958 -0.7858715 -0.6145146 -0.06412621
           [,7]      [,8]      [,9]      [,10]
row2 -0.7262639 0.9919746 -1.633407 -0.5362008
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]     [,3]       [,4]      [,5]      [,6]       [,7]
row5 -0.3798113 0.8060911 1.336181 -0.2580035 -1.828174 -2.667466 -0.9487971
          [,8]     [,9]    [,10]      [,11]      [,12]    [,13]     [,14]
row5 0.2377793 1.073414 -1.13255 -0.5190159 -0.5223979 1.290234 -2.194031
          [,15]     [,16]      [,17]     [,18]      [,19]      [,20]
row5 -0.6220075 0.5770493 -0.6567707 0.1467224 -0.5619079 -0.5203392
> 
> 
> 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: 0x14cdddb0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1963975523127b"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM19639741e95a9c"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM19639710b267fe"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM196397336140c1"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM19639730109ca6"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM196397691f9d12"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1963976d875a2" 
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM196397203e4b06"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM19639728ea8596"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM19639778c44971"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM196397657375ec"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM196397237924a1"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1963976b7ffe39"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1963973c281743"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM19639727f7c08a"
> 
> 
> ### 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: 0x151b5b90>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x151b5b90>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x151b5b90>
> rowMedians(tmp)
  [1] -0.2894033938  0.5063442014 -0.0403022421  0.1220251088  0.1816357025
  [6] -0.0695060518  0.3833660224 -0.1264167617  0.3426498809  0.0577914470
 [11] -0.1894787435  0.4605784004  0.0495623035 -0.1444851730  0.1121980145
 [16] -0.2335230418 -0.6599042772  0.0626342017 -0.3284735086 -0.4998301318
 [21] -0.4766932420  0.2059340983 -0.0117747948 -0.2588760095 -0.2213489883
 [26] -0.1522729323 -0.2762500328 -0.3759551237  0.6600212789 -0.4507504711
 [31]  0.2089464211 -0.0188885962  0.0399568632 -0.2111786027 -0.1622324464
 [36]  0.3240700051  0.6237222279 -0.3399521827  0.1510881637  0.2793497770
 [41] -0.0187891508 -0.3028976363 -0.5159974180 -0.0381060625  0.5159685698
 [46]  0.2446378017  0.5232108546  0.0847214156  0.2830578945 -0.2546610781
 [51] -0.0604968737 -0.2600354127 -0.0753011814  0.4672002476 -0.2110367682
 [56] -0.0155808200 -0.1465807801  0.5843059549 -0.2407676587  0.3036742630
 [61]  0.4163785877 -0.3895760691 -0.8520813775 -0.4353165401  0.4329905821
 [66] -0.0238269064  0.1783162115 -0.4061624069  0.1438796272  0.3278906078
 [71] -0.2316035683 -0.1473737845  0.1327240469 -0.1058878232  0.1064584844
 [76] -0.1436548688 -0.2243022920 -0.2166567215 -0.0835918088  0.4187075086
 [81]  0.0038633484 -0.1264509893  0.0463006965  0.0437640652  0.2008336784
 [86] -0.3328449901 -0.0849399086 -0.0081559973 -0.3642770645  0.2505147548
 [91]  0.1443232491 -0.1308015120 -0.0730758260  0.3425044891  0.0012178499
 [96]  0.0973295360 -0.1434065457 -0.0259189351 -0.1146428306  0.2548536913
[101] -0.6476862373 -0.0252804720  0.1813272610 -0.1329415516 -0.5813979816
[106]  0.1100117884  0.2186894541  0.0477075709 -0.4242840449 -0.0004159030
[111] -0.1061319122  0.0217990401  0.1780613560 -0.6005341214  0.2139847637
[116] -0.2297055448 -0.1245198142 -0.2772830056 -0.2857740651  0.1732087980
[121] -0.3065547731 -0.4958174199  0.0545089252 -0.1435228360  0.1716025688
[126]  0.1900431799  0.1860147601  0.0547644261  0.1619526987 -0.0813831620
[131]  0.2191773794  0.1787346523 -0.1614341131 -0.2263093900 -0.6218579645
[136] -0.2770851440  0.4926750546 -0.1666217449  0.0767149265 -0.2335557647
[141]  0.0982739522  0.4133746861 -0.2045138860  0.2181035301  0.3337390660
[146] -0.2057791138 -0.3354906123 -0.3420527321  0.3130688993 -0.1540560578
[151] -0.2218063986  0.4345814316  0.2168943539  0.0771529117 -0.6922671818
[156] -0.0395318322  0.3918097557 -0.0217761134  0.1546970665  0.2625667465
[161]  0.0075351590  0.4593454401 -0.3372601225  0.0171385414 -0.2770116845
[166] -0.5565101449  0.1886203032  0.1097072175 -0.2734941133 -0.0342300790
[171] -0.2098959044  0.2864409394  0.2584934240 -0.6109701917  0.1486709053
[176] -0.3711317690 -0.0003643115 -0.8092801139  0.1136653363 -0.1273146146
[181] -0.1426655677  0.1170501640  0.2189150669 -0.2123431179  0.0219931134
[186]  0.5269873781  0.4798409025 -0.1202904428  0.4256904891  0.5212504062
[191] -0.1975677247 -0.1575001905  0.2568099774  0.2554369456 -0.3870862595
[196] -0.2507278873 -0.1145591118 -0.1002286030 -0.5658341533  0.1342771652
[201]  0.1397891064  0.3199022064  0.2332775970  0.2718272969 -0.2764340209
[206] -0.1108219864  0.1171713330 -0.1383316353 -0.0144922549 -0.2705536957
[211] -1.0961760437 -0.0959350337 -0.4720173274 -0.3710713069  0.4629124434
[216]  0.2268692344 -0.3693654772  0.3326969305 -0.0904765002 -0.4712106273
[221] -0.1213721377 -0.1062010825 -0.3354765312  0.3343869286 -0.3280324813
[226] -0.1996482167 -0.2212581846  0.0157280231 -0.0370451317 -0.3773995924
> 
> proc.time()
   user  system elapsed 
  1.912   0.867   2.804 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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: 0x4b33ff0>
> .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: 0x4b33ff0>
> .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: 0x4b33ff0>
> .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: 0x4b33ff0>
> 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: 0x4a3e470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x4a3e470>
> .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: 0x4a3e470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x4a3e470>
> .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: 0x4a3e470>
> 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: 0x4a190e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x4a190e0>
> .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: 0x4a190e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x4a190e0>
> .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: 0x4a190e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x4a190e0>
> .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: 0x4a190e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x4a190e0>
> .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: 0x4a190e0>
> 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: 0x39a0520>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x39a0520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x39a0520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x39a0520>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1964ea3357309b" "BufferedMatrixFile1964ea6f57446a"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1964ea3357309b" "BufferedMatrixFile1964ea6f57446a"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x58e9030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58e9030>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x58e9030>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x58e9030>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x58e9030>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x58e9030>
> .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: 0x42b45c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x42b45c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x42b45c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x42b45c0>
> 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: 0x5394f30>
> .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: 0x5394f30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.326   0.065   0.376 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.341   0.045   0.371 

Example timings