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

This page was generated on 2025-08-15 12:06 -0400 (Fri, 15 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4818
palomino8Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4554
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4595
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4537
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4535
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 251/2317HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-14 13:45 -0400 (Thu, 14 Aug 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
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 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 palomino8

To the developers/maintainers of the BufferedMatrix package:
- Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information.
- Use the following Renviron settings to reproduce errors and warnings.
- If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information.

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: F:\biocbuild\bbs-3.22-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.22-bioc\R\library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-08-15 01:14:37 -0400 (Fri, 15 Aug 2025)
EndedAt: 2025-08-15 01:17:19 -0400 (Fri, 15 Aug 2025)
EllapsedTime: 162.2 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   F:\biocbuild\bbs-3.22-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.22-bioc\R\library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck'
* using R version 4.5.1 (2025-06-13 ucrt)
* using platform: x86_64-w64-mingw32
* R was compiled by
    gcc.exe (GCC) 14.2.0
    GNU Fortran (GCC) 14.2.0
* running under: Windows Server 2022 x64 (build 20348)
* 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 whether package 'BufferedMatrix' can be installed ... OK
* used C compiler: 'gcc.exe (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 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 for x64 is not available
File 'F:/biocbuild/bbs-3.22-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found '_exit', possibly from '_exit' (C)
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs nor [v]sprintf. The detected symbols are linked into
the code but might come from libraries and not actually be called.

See 'Writing portable packages' in the 'Writing R Extensions' manual.
* checking sizes of PDF files under 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ... NONE
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
  Running 'Rcodetesting.R'
  Running 'c_code_level_tests.R'
  Running 'objectTesting.R'
  Running 'rawCalltesting.R'
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   F:\biocbuild\bbs-3.22-bioc\R\bin\R.exe CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library 'F:/biocbuild/bbs-3.22-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** this is package 'BufferedMatrix' version '1.73.0'
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 14.2.0'
gcc  -I"F:/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG     -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall -std=gnu2x  -mfpmath=sse -msse2 -mstackrealign   -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"F:/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG     -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall -std=gnu2x  -mfpmath=sse -msse2 -mstackrealign   -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function 'dbm_ReadOnlyMode':
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: 'sort_double' defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc  -I"F:/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG     -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall -std=gnu2x  -mfpmath=sse -msse2 -mstackrealign   -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"F:/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG     -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall -std=gnu2x  -mfpmath=sse -msse2 -mstackrealign   -c init_package.c -o init_package.o
gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -LC:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools45/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.22-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.22-bioc/R/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs/x64
** 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
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 (2025-06-13 ucrt) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.43    0.17    1.28 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 (2025-06-13 ucrt) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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] "F:/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 475147 25.4    1042854 55.7   629417 33.7
Vcells 867347  6.7    8388608 64.0  2039165 15.6
> 
> 
> 
> 
> ##
> ## 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] "Fri Aug 15 01:15:16 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] "Fri Aug 15 01:15:18 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: 0x000001eb3b2f8a70>
> 
> 
> 
> 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] "Fri Aug 15 01:15:40 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] "Fri Aug 15 01:15:47 2025"
> 
> ColMode(tmp2)
<pointer: 0x000001eb3b2f8a70>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]       [,4]
[1,] 101.2084969 -2.8295150 0.0695989 -2.0068861
[2,]  -0.1281473  0.0409521 1.4671359  0.2575151
[3,]  -0.2640608 -0.2657612 2.1680831 -1.0356287
[4,]   0.4232301  0.7703574 1.1485015  1.1578187
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 101.2084969 2.8295150 0.0695989 2.0068861
[2,]   0.1281473 0.0409521 1.4671359 0.2575151
[3,]   0.2640608 0.2657612 2.1680831 1.0356287
[4,]   0.4232301 0.7703574 1.1485015 1.1578187
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]     [,3]      [,4]
[1,] 10.0602434 1.6821162 0.263816 1.4166461
[2,]  0.3579767 0.2023663 1.211254 0.5074594
[3,]  0.5138685 0.5155204 1.472441 1.0176584
[4,]  0.6505613 0.8777001 1.071682 1.0760199
> 
> 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:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.81093 44.65068 27.70776 41.17335
[2,]  28.70791 27.06461 38.57967 30.33211
[3,]  30.40275 30.42096 41.89250 36.21221
[4,]  31.92884 34.54736 36.86532 36.91802
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001eb3b2f8290>
> exp(tmp5)
<pointer: 0x000001eb3b2f8290>
> log(tmp5,2)
<pointer: 0x000001eb3b2f8290>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.0772
> Min(tmp5)
[1] 55.2757
> mean(tmp5)
[1] 74.07595
> Sum(tmp5)
[1] 14815.19
> Var(tmp5)
[1] 878.6829
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.49959 69.20147 73.54014 72.08975 72.08013 72.94287 73.06162 69.87056
 [9] 70.52523 73.94816
> rowSums(tmp5)
 [1] 1869.992 1384.029 1470.803 1441.795 1441.603 1458.857 1461.232 1397.411
 [9] 1410.505 1478.963
> rowVars(tmp5)
 [1] 8073.22012   70.89505  116.76687   49.40362   95.92762   87.02975
 [7]   53.44243   67.00647   71.21708   53.00601
> rowSd(tmp5)
 [1] 89.851100  8.419920 10.805872  7.028771  9.794265  9.328973  7.310433
 [8]  8.185748  8.439021  7.280523
> rowMax(tmp5)
 [1] 472.07724  83.35497 100.04144  87.52278  90.79738  87.23663  84.10689
 [8]  84.68685  92.68045  83.46900
> rowMin(tmp5)
 [1] 55.64086 56.07867 59.61914 59.67871 57.04315 56.00141 57.08003 56.06382
 [9] 55.27570 56.08790
> 
> colMeans(tmp5)
 [1] 110.30664  72.00624  75.18580  75.77188  69.44071  72.87305  69.99511
 [8]  69.36899  71.54788  71.82453  75.36258  76.55295  70.24243  70.62628
[15]  69.89921  73.35396  74.53722  65.89092  71.49945  75.23322
> colSums(tmp5)
 [1] 1103.0664  720.0624  751.8580  757.7188  694.4071  728.7305  699.9511
 [8]  693.6899  715.4788  718.2453  753.6258  765.5295  702.4243  706.2628
[15]  698.9921  733.5396  745.3722  658.9092  714.9945  752.3322
> colVars(tmp5)
 [1] 16223.37360   111.63347   100.25319    82.70237    49.91203    67.21356
 [7]    60.30549    74.75928    41.14174    47.12045    10.73595   192.99766
[13]   122.10665    61.51554    88.58243    96.76226    62.39412    63.91636
[19]   126.24533    54.10126
> colSd(tmp5)
 [1] 127.371008  10.565674  10.012651   9.094085   7.064845   8.198387
 [7]   7.765661   8.646345   6.414183   6.864434   3.276575  13.892360
[13]  11.050188   7.843184   9.411824   9.836781   7.898995   7.994771
[19]  11.235895   7.355356
> colMax(tmp5)
 [1] 472.07724  92.93453  87.32359  90.79738  85.80575  87.23663  80.92949
 [8]  82.42558  78.18672  80.76325  79.58867 100.04144  84.62942  83.18046
[15]  83.35497  87.52278  88.93056  78.59726  87.94068  90.27274
> colMin(tmp5)
 [1] 59.75176 56.33145 57.67007 60.82230 59.72239 59.58879 59.00824 55.98844
 [9] 59.50347 62.78696 68.40052 59.67871 57.04315 56.07867 55.64086 56.06382
[17] 64.23197 55.27570 56.08790 66.20964
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 93.49959 69.20147 73.54014 72.08975 72.08013 72.94287 73.06162 69.87056
 [9] 70.52523       NA
> rowSums(tmp5)
 [1] 1869.992 1384.029 1470.803 1441.795 1441.603 1458.857 1461.232 1397.411
 [9] 1410.505       NA
> rowVars(tmp5)
 [1] 8073.22012   70.89505  116.76687   49.40362   95.92762   87.02975
 [7]   53.44243   67.00647   71.21708   55.88510
> rowSd(tmp5)
 [1] 89.851100  8.419920 10.805872  7.028771  9.794265  9.328973  7.310433
 [8]  8.185748  8.439021  7.475634
> rowMax(tmp5)
 [1] 472.07724  83.35497 100.04144  87.52278  90.79738  87.23663  84.10689
 [8]  84.68685  92.68045        NA
> rowMin(tmp5)
 [1] 55.64086 56.07867 59.61914 59.67871 57.04315 56.00141 57.08003 56.06382
 [9] 55.27570       NA
> 
> colMeans(tmp5)
 [1] 110.30664  72.00624  75.18580  75.77188  69.44071  72.87305  69.99511
 [8]  69.36899  71.54788  71.82453  75.36258  76.55295  70.24243  70.62628
[15]  69.89921  73.35396  74.53722  65.89092  71.49945        NA
> colSums(tmp5)
 [1] 1103.0664  720.0624  751.8580  757.7188  694.4071  728.7305  699.9511
 [8]  693.6899  715.4788  718.2453  753.6258  765.5295  702.4243  706.2628
[15]  698.9921  733.5396  745.3722  658.9092  714.9945        NA
> colVars(tmp5)
 [1] 16223.37360   111.63347   100.25319    82.70237    49.91203    67.21356
 [7]    60.30549    74.75928    41.14174    47.12045    10.73595   192.99766
[13]   122.10665    61.51554    88.58243    96.76226    62.39412    63.91636
[19]   126.24533          NA
> colSd(tmp5)
 [1] 127.371008  10.565674  10.012651   9.094085   7.064845   8.198387
 [7]   7.765661   8.646345   6.414183   6.864434   3.276575  13.892360
[13]  11.050188   7.843184   9.411824   9.836781   7.898995   7.994771
[19]  11.235895         NA
> colMax(tmp5)
 [1] 472.07724  92.93453  87.32359  90.79738  85.80575  87.23663  80.92949
 [8]  82.42558  78.18672  80.76325  79.58867 100.04144  84.62942  83.18046
[15]  83.35497  87.52278  88.93056  78.59726  87.94068        NA
> colMin(tmp5)
 [1] 59.75176 56.33145 57.67007 60.82230 59.72239 59.58879 59.00824 55.98844
 [9] 59.50347 62.78696 68.40052 59.67871 57.04315 56.07867 55.64086 56.06382
[17] 64.23197 55.27570 56.08790       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.0772
> Min(tmp5,na.rm=TRUE)
[1] 55.2757
> mean(tmp5,na.rm=TRUE)
[1] 74.08192
> Sum(tmp5,na.rm=TRUE)
[1] 14742.3
> Var(tmp5,na.rm=TRUE)
[1] 883.1135
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.49959 69.20147 73.54014 72.08975 72.08013 72.94287 73.06162 69.87056
 [9] 70.52523 74.00394
> rowSums(tmp5,na.rm=TRUE)
 [1] 1869.992 1384.029 1470.803 1441.795 1441.603 1458.857 1461.232 1397.411
 [9] 1410.505 1406.075
> rowVars(tmp5,na.rm=TRUE)
 [1] 8073.22012   70.89505  116.76687   49.40362   95.92762   87.02975
 [7]   53.44243   67.00647   71.21708   55.88510
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.851100  8.419920 10.805872  7.028771  9.794265  9.328973  7.310433
 [8]  8.185748  8.439021  7.475634
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.07724  83.35497 100.04144  87.52278  90.79738  87.23663  84.10689
 [8]  84.68685  92.68045  83.46900
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.64086 56.07867 59.61914 59.67871 57.04315 56.00141 57.08003 56.06382
 [9] 55.27570 56.08790
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.30664  72.00624  75.18580  75.77188  69.44071  72.87305  69.99511
 [8]  69.36899  71.54788  71.82453  75.36258  76.55295  70.24243  70.62628
[15]  69.89921  73.35396  74.53722  65.89092  71.49945  75.49377
> colSums(tmp5,na.rm=TRUE)
 [1] 1103.0664  720.0624  751.8580  757.7188  694.4071  728.7305  699.9511
 [8]  693.6899  715.4788  718.2453  753.6258  765.5295  702.4243  706.2628
[15]  698.9921  733.5396  745.3722  658.9092  714.9945  679.4439
> colVars(tmp5,na.rm=TRUE)
 [1] 16223.37360   111.63347   100.25319    82.70237    49.91203    67.21356
 [7]    60.30549    74.75928    41.14174    47.12045    10.73595   192.99766
[13]   122.10665    61.51554    88.58243    96.76226    62.39412    63.91636
[19]   126.24533    60.10019
> colSd(tmp5,na.rm=TRUE)
 [1] 127.371008  10.565674  10.012651   9.094085   7.064845   8.198387
 [7]   7.765661   8.646345   6.414183   6.864434   3.276575  13.892360
[13]  11.050188   7.843184   9.411824   9.836781   7.898995   7.994771
[19]  11.235895   7.752431
> colMax(tmp5,na.rm=TRUE)
 [1] 472.07724  92.93453  87.32359  90.79738  85.80575  87.23663  80.92949
 [8]  82.42558  78.18672  80.76325  79.58867 100.04144  84.62942  83.18046
[15]  83.35497  87.52278  88.93056  78.59726  87.94068  90.27274
> colMin(tmp5,na.rm=TRUE)
 [1] 59.75176 56.33145 57.67007 60.82230 59.72239 59.58879 59.00824 55.98844
 [9] 59.50347 62.78696 68.40052 59.67871 57.04315 56.07867 55.64086 56.06382
[17] 64.23197 55.27570 56.08790 66.20964
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.49959 69.20147 73.54014 72.08975 72.08013 72.94287 73.06162 69.87056
 [9] 70.52523      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1869.992 1384.029 1470.803 1441.795 1441.603 1458.857 1461.232 1397.411
 [9] 1410.505    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8073.22012   70.89505  116.76687   49.40362   95.92762   87.02975
 [7]   53.44243   67.00647   71.21708         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.851100  8.419920 10.805872  7.028771  9.794265  9.328973  7.310433
 [8]  8.185748  8.439021        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.07724  83.35497 100.04144  87.52278  90.79738  87.23663  84.10689
 [8]  84.68685  92.68045        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.64086 56.07867 59.61914 59.67871 57.04315 56.00141 57.08003 56.06382
 [9] 55.27570       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.71865  72.78492  75.39553  75.45148  69.47506  71.97194  70.91446
 [8]  68.42510  70.84071  71.44170  75.35234  78.00214  68.97941  70.06299
[15]  69.07714  73.17996  73.54480  64.47910  73.21185       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1023.4679  655.0643  678.5598  679.0634  625.2755  647.7474  638.2302
 [8]  615.8259  637.5664  642.9753  678.1710  702.0193  620.8147  630.5669
[15]  621.6943  658.6197  661.9032  580.3119  658.9066    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 18120.32490   118.76628   112.29001    91.88529    56.13777    66.48019
 [7]    58.33504    74.08108    40.65837    51.36169    12.07676   193.49540
[13]   119.42382    65.63547    92.05255   108.51695    59.11329    49.48215
[19]   109.03766          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 134.611756  10.897994  10.596698   9.585682   7.492514   8.153538
 [7]   7.637738   8.607036   6.376392   7.166707   3.475163  13.910262
[13]  10.928121   8.101572   9.594402  10.417147   7.688516   7.034355
[19]  10.442110         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 472.07724  92.93453  87.32359  90.79738  85.80575  87.23663  80.92949
 [8]  82.42558  78.18672  80.76325  79.58867 100.04144  84.62942  83.18046
[15]  83.35497  87.52278  88.93056  75.13037  87.94068      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 59.75176 56.33145 57.67007 60.82230 59.72239 59.58879 59.00824 55.98844
 [9] 59.50347 62.78696 68.40052 59.67871 57.04315 56.07867 55.64086 56.06382
[17] 64.23197 55.27570 59.81141      Inf
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 114.1871 215.4950 376.7540 243.2090 206.3900 229.6723 210.1836 146.5605
 [9] 178.0152 217.1054
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 114.1871 215.4950 376.7540 243.2090 206.3900 229.6723 210.1836 146.5605
 [9] 178.0152 217.1054
> 
> 
> 
> 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]  5.684342e-14 -2.842171e-14  1.563194e-13  2.842171e-14  2.415845e-13
 [6] -5.684342e-14  0.000000e+00  1.989520e-13 -5.684342e-14  5.684342e-14
[11]  1.421085e-14 -8.526513e-14  0.000000e+00 -8.526513e-14  3.979039e-13
[16]  0.000000e+00  1.136868e-13  0.000000e+00  5.684342e-14 -1.421085e-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)
+ }
7   4 
3   13 
4   4 
6   10 
5   10 
2   5 
2   15 
3   1 
9   6 
6   11 
8   3 
4   9 
7   18 
5   2 
9   8 
1   9 
2   14 
5   5 
9   9 
4   2 
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] 3.095899
> Min(tmp)
[1] -2.607726
> mean(tmp)
[1] -0.05112455
> Sum(tmp)
[1] -5.112455
> Var(tmp)
[1] 1.239429
> 
> rowMeans(tmp)
[1] -0.05112455
> rowSums(tmp)
[1] -5.112455
> rowVars(tmp)
[1] 1.239429
> rowSd(tmp)
[1] 1.113297
> rowMax(tmp)
[1] 3.095899
> rowMin(tmp)
[1] -2.607726
> 
> colMeans(tmp)
  [1]  0.651524322  0.478480147  1.623810293 -1.328275781  0.512120976
  [6]  2.091895483  1.842642479  0.480709374  1.582473832  0.623127191
 [11] -1.444567874  1.919313109 -0.469331423  0.159172798 -0.154780459
 [16]  1.170627976 -0.192495445 -1.762148278  0.047523342 -0.226451306
 [21] -0.447006406 -1.041567393 -0.169101340  1.847246796  0.063943539
 [26]  0.332824183 -1.387689064 -0.938303675 -0.992083534 -2.607725571
 [31] -2.033770118 -0.347677724  2.348790957 -1.771243718 -0.638682991
 [36] -0.621709516  0.668728353 -0.072458377 -1.461278713  0.454728792
 [41]  0.595811045  0.038593034 -0.320993645 -0.506098842 -0.307987798
 [46] -0.691896069 -0.399579674  0.683425421 -0.008132656  0.238433304
 [51]  0.428007196 -0.914425765 -0.582268775  0.725958426  0.456417300
 [56]  0.050313615  0.436215199 -2.139706488  0.582104954  0.297316998
 [61] -1.694754601 -0.326858822 -0.371090469 -1.156016126  0.884820396
 [66]  0.646799408 -1.719350907  0.162138506 -2.484634113  0.428767199
 [71]  3.095898502  0.155714640 -1.111851523  1.033433204 -0.035024128
 [76] -1.453940310 -0.940192805 -0.084828882  0.463177113  1.962436074
 [81]  2.753315889 -0.172932258 -1.122689994  0.374532299 -1.002045329
 [86] -0.632512878  0.071252620  0.191889029  0.651390201 -0.738525837
 [91]  1.541850780 -1.319425087  0.207112250  1.215167440 -1.438027144
 [96]  0.113366626 -0.293842664  0.809946686 -1.019461200 -0.210300619
> colSums(tmp)
  [1]  0.651524322  0.478480147  1.623810293 -1.328275781  0.512120976
  [6]  2.091895483  1.842642479  0.480709374  1.582473832  0.623127191
 [11] -1.444567874  1.919313109 -0.469331423  0.159172798 -0.154780459
 [16]  1.170627976 -0.192495445 -1.762148278  0.047523342 -0.226451306
 [21] -0.447006406 -1.041567393 -0.169101340  1.847246796  0.063943539
 [26]  0.332824183 -1.387689064 -0.938303675 -0.992083534 -2.607725571
 [31] -2.033770118 -0.347677724  2.348790957 -1.771243718 -0.638682991
 [36] -0.621709516  0.668728353 -0.072458377 -1.461278713  0.454728792
 [41]  0.595811045  0.038593034 -0.320993645 -0.506098842 -0.307987798
 [46] -0.691896069 -0.399579674  0.683425421 -0.008132656  0.238433304
 [51]  0.428007196 -0.914425765 -0.582268775  0.725958426  0.456417300
 [56]  0.050313615  0.436215199 -2.139706488  0.582104954  0.297316998
 [61] -1.694754601 -0.326858822 -0.371090469 -1.156016126  0.884820396
 [66]  0.646799408 -1.719350907  0.162138506 -2.484634113  0.428767199
 [71]  3.095898502  0.155714640 -1.111851523  1.033433204 -0.035024128
 [76] -1.453940310 -0.940192805 -0.084828882  0.463177113  1.962436074
 [81]  2.753315889 -0.172932258 -1.122689994  0.374532299 -1.002045329
 [86] -0.632512878  0.071252620  0.191889029  0.651390201 -0.738525837
 [91]  1.541850780 -1.319425087  0.207112250  1.215167440 -1.438027144
 [96]  0.113366626 -0.293842664  0.809946686 -1.019461200 -0.210300619
> 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.651524322  0.478480147  1.623810293 -1.328275781  0.512120976
  [6]  2.091895483  1.842642479  0.480709374  1.582473832  0.623127191
 [11] -1.444567874  1.919313109 -0.469331423  0.159172798 -0.154780459
 [16]  1.170627976 -0.192495445 -1.762148278  0.047523342 -0.226451306
 [21] -0.447006406 -1.041567393 -0.169101340  1.847246796  0.063943539
 [26]  0.332824183 -1.387689064 -0.938303675 -0.992083534 -2.607725571
 [31] -2.033770118 -0.347677724  2.348790957 -1.771243718 -0.638682991
 [36] -0.621709516  0.668728353 -0.072458377 -1.461278713  0.454728792
 [41]  0.595811045  0.038593034 -0.320993645 -0.506098842 -0.307987798
 [46] -0.691896069 -0.399579674  0.683425421 -0.008132656  0.238433304
 [51]  0.428007196 -0.914425765 -0.582268775  0.725958426  0.456417300
 [56]  0.050313615  0.436215199 -2.139706488  0.582104954  0.297316998
 [61] -1.694754601 -0.326858822 -0.371090469 -1.156016126  0.884820396
 [66]  0.646799408 -1.719350907  0.162138506 -2.484634113  0.428767199
 [71]  3.095898502  0.155714640 -1.111851523  1.033433204 -0.035024128
 [76] -1.453940310 -0.940192805 -0.084828882  0.463177113  1.962436074
 [81]  2.753315889 -0.172932258 -1.122689994  0.374532299 -1.002045329
 [86] -0.632512878  0.071252620  0.191889029  0.651390201 -0.738525837
 [91]  1.541850780 -1.319425087  0.207112250  1.215167440 -1.438027144
 [96]  0.113366626 -0.293842664  0.809946686 -1.019461200 -0.210300619
> colMin(tmp)
  [1]  0.651524322  0.478480147  1.623810293 -1.328275781  0.512120976
  [6]  2.091895483  1.842642479  0.480709374  1.582473832  0.623127191
 [11] -1.444567874  1.919313109 -0.469331423  0.159172798 -0.154780459
 [16]  1.170627976 -0.192495445 -1.762148278  0.047523342 -0.226451306
 [21] -0.447006406 -1.041567393 -0.169101340  1.847246796  0.063943539
 [26]  0.332824183 -1.387689064 -0.938303675 -0.992083534 -2.607725571
 [31] -2.033770118 -0.347677724  2.348790957 -1.771243718 -0.638682991
 [36] -0.621709516  0.668728353 -0.072458377 -1.461278713  0.454728792
 [41]  0.595811045  0.038593034 -0.320993645 -0.506098842 -0.307987798
 [46] -0.691896069 -0.399579674  0.683425421 -0.008132656  0.238433304
 [51]  0.428007196 -0.914425765 -0.582268775  0.725958426  0.456417300
 [56]  0.050313615  0.436215199 -2.139706488  0.582104954  0.297316998
 [61] -1.694754601 -0.326858822 -0.371090469 -1.156016126  0.884820396
 [66]  0.646799408 -1.719350907  0.162138506 -2.484634113  0.428767199
 [71]  3.095898502  0.155714640 -1.111851523  1.033433204 -0.035024128
 [76] -1.453940310 -0.940192805 -0.084828882  0.463177113  1.962436074
 [81]  2.753315889 -0.172932258 -1.122689994  0.374532299 -1.002045329
 [86] -0.632512878  0.071252620  0.191889029  0.651390201 -0.738525837
 [91]  1.541850780 -1.319425087  0.207112250  1.215167440 -1.438027144
 [96]  0.113366626 -0.293842664  0.809946686 -1.019461200 -0.210300619
> colMedians(tmp)
  [1]  0.651524322  0.478480147  1.623810293 -1.328275781  0.512120976
  [6]  2.091895483  1.842642479  0.480709374  1.582473832  0.623127191
 [11] -1.444567874  1.919313109 -0.469331423  0.159172798 -0.154780459
 [16]  1.170627976 -0.192495445 -1.762148278  0.047523342 -0.226451306
 [21] -0.447006406 -1.041567393 -0.169101340  1.847246796  0.063943539
 [26]  0.332824183 -1.387689064 -0.938303675 -0.992083534 -2.607725571
 [31] -2.033770118 -0.347677724  2.348790957 -1.771243718 -0.638682991
 [36] -0.621709516  0.668728353 -0.072458377 -1.461278713  0.454728792
 [41]  0.595811045  0.038593034 -0.320993645 -0.506098842 -0.307987798
 [46] -0.691896069 -0.399579674  0.683425421 -0.008132656  0.238433304
 [51]  0.428007196 -0.914425765 -0.582268775  0.725958426  0.456417300
 [56]  0.050313615  0.436215199 -2.139706488  0.582104954  0.297316998
 [61] -1.694754601 -0.326858822 -0.371090469 -1.156016126  0.884820396
 [66]  0.646799408 -1.719350907  0.162138506 -2.484634113  0.428767199
 [71]  3.095898502  0.155714640 -1.111851523  1.033433204 -0.035024128
 [76] -1.453940310 -0.940192805 -0.084828882  0.463177113  1.962436074
 [81]  2.753315889 -0.172932258 -1.122689994  0.374532299 -1.002045329
 [86] -0.632512878  0.071252620  0.191889029  0.651390201 -0.738525837
 [91]  1.541850780 -1.319425087  0.207112250  1.215167440 -1.438027144
 [96]  0.113366626 -0.293842664  0.809946686 -1.019461200 -0.210300619
> colRanges(tmp)
          [,1]      [,2]    [,3]      [,4]     [,5]     [,6]     [,7]      [,8]
[1,] 0.6515243 0.4784801 1.62381 -1.328276 0.512121 2.091895 1.842642 0.4807094
[2,] 0.6515243 0.4784801 1.62381 -1.328276 0.512121 2.091895 1.842642 0.4807094
         [,9]     [,10]     [,11]    [,12]      [,13]     [,14]      [,15]
[1,] 1.582474 0.6231272 -1.444568 1.919313 -0.4693314 0.1591728 -0.1547805
[2,] 1.582474 0.6231272 -1.444568 1.919313 -0.4693314 0.1591728 -0.1547805
        [,16]      [,17]     [,18]      [,19]      [,20]      [,21]     [,22]
[1,] 1.170628 -0.1924954 -1.762148 0.04752334 -0.2264513 -0.4470064 -1.041567
[2,] 1.170628 -0.1924954 -1.762148 0.04752334 -0.2264513 -0.4470064 -1.041567
          [,23]    [,24]      [,25]     [,26]     [,27]      [,28]      [,29]
[1,] -0.1691013 1.847247 0.06394354 0.3328242 -1.387689 -0.9383037 -0.9920835
[2,] -0.1691013 1.847247 0.06394354 0.3328242 -1.387689 -0.9383037 -0.9920835
         [,30]    [,31]      [,32]    [,33]     [,34]     [,35]      [,36]
[1,] -2.607726 -2.03377 -0.3476777 2.348791 -1.771244 -0.638683 -0.6217095
[2,] -2.607726 -2.03377 -0.3476777 2.348791 -1.771244 -0.638683 -0.6217095
         [,37]       [,38]     [,39]     [,40]    [,41]      [,42]      [,43]
[1,] 0.6687284 -0.07245838 -1.461279 0.4547288 0.595811 0.03859303 -0.3209936
[2,] 0.6687284 -0.07245838 -1.461279 0.4547288 0.595811 0.03859303 -0.3209936
          [,44]      [,45]      [,46]      [,47]     [,48]        [,49]
[1,] -0.5060988 -0.3079878 -0.6918961 -0.3995797 0.6834254 -0.008132656
[2,] -0.5060988 -0.3079878 -0.6918961 -0.3995797 0.6834254 -0.008132656
         [,50]     [,51]      [,52]      [,53]     [,54]     [,55]      [,56]
[1,] 0.2384333 0.4280072 -0.9144258 -0.5822688 0.7259584 0.4564173 0.05031361
[2,] 0.2384333 0.4280072 -0.9144258 -0.5822688 0.7259584 0.4564173 0.05031361
         [,57]     [,58]    [,59]    [,60]     [,61]      [,62]      [,63]
[1,] 0.4362152 -2.139706 0.582105 0.297317 -1.694755 -0.3268588 -0.3710905
[2,] 0.4362152 -2.139706 0.582105 0.297317 -1.694755 -0.3268588 -0.3710905
         [,64]     [,65]     [,66]     [,67]     [,68]     [,69]     [,70]
[1,] -1.156016 0.8848204 0.6467994 -1.719351 0.1621385 -2.484634 0.4287672
[2,] -1.156016 0.8848204 0.6467994 -1.719351 0.1621385 -2.484634 0.4287672
        [,71]     [,72]     [,73]    [,74]       [,75]    [,76]      [,77]
[1,] 3.095899 0.1557146 -1.111852 1.033433 -0.03502413 -1.45394 -0.9401928
[2,] 3.095899 0.1557146 -1.111852 1.033433 -0.03502413 -1.45394 -0.9401928
           [,78]     [,79]    [,80]    [,81]      [,82]    [,83]     [,84]
[1,] -0.08482888 0.4631771 1.962436 2.753316 -0.1729323 -1.12269 0.3745323
[2,] -0.08482888 0.4631771 1.962436 2.753316 -0.1729323 -1.12269 0.3745323
         [,85]      [,86]      [,87]    [,88]     [,89]      [,90]    [,91]
[1,] -1.002045 -0.6325129 0.07125262 0.191889 0.6513902 -0.7385258 1.541851
[2,] -1.002045 -0.6325129 0.07125262 0.191889 0.6513902 -0.7385258 1.541851
         [,92]     [,93]    [,94]     [,95]     [,96]      [,97]     [,98]
[1,] -1.319425 0.2071122 1.215167 -1.438027 0.1133666 -0.2938427 0.8099467
[2,] -1.319425 0.2071122 1.215167 -1.438027 0.1133666 -0.2938427 0.8099467
         [,99]     [,100]
[1,] -1.019461 -0.2103006
[2,] -1.019461 -0.2103006
> 
> 
> Max(tmp2)
[1] 2.376235
> Min(tmp2)
[1] -2.695844
> mean(tmp2)
[1] 0.06050638
> Sum(tmp2)
[1] 6.050638
> Var(tmp2)
[1] 1.053561
> 
> rowMeans(tmp2)
  [1]  2.01309454 -0.70275193 -0.36318856  1.12435595  0.80736124  1.20239144
  [7] -1.01870877  1.33741275  0.21048017  0.04859221 -2.69584396  0.07783770
 [13]  1.33242202 -0.38574387  1.07095977 -1.63251336 -0.93744022 -0.85755483
 [19]  0.71671436  2.31881089 -0.31012526  2.13110473 -1.40951722 -0.66936861
 [25] -0.43545070  1.11904071  0.31382546 -0.62403345 -1.01675730  1.57628419
 [31] -0.16032917 -0.28004735 -0.31293050 -0.15189377  0.85843309  0.68384321
 [37]  0.10108153 -0.61088775  0.26640700 -1.47394619  0.80872163  0.79190707
 [43]  0.94866985  1.17980772  1.61834377 -0.67416684 -0.85503178  0.16265421
 [49] -0.91358880 -0.21829888 -0.77628582 -2.02669668  0.05534559 -0.23397755
 [55] -0.22125804  1.21949984 -0.64497329  1.10035625  2.37623453  0.86013348
 [61] -0.62200555 -1.71024712 -0.32596760 -1.29473135 -0.24919434 -0.64556914
 [67]  0.62917237 -0.24989534 -0.02128942  1.46921254  0.82032136  1.01713150
 [73] -0.98976589  0.50939710  0.24284033  0.33759302  2.03199547 -0.28022445
 [79]  0.03609157 -1.05556564  0.31894495 -0.36427655  0.43351518 -1.30674609
 [85] -1.11953638  0.29218252  0.61923071  1.09085450  0.75253023  1.62241133
 [91] -1.41744270 -0.10085944 -0.15849998  0.42861351 -1.90223408 -0.87389797
 [97] -0.34667788 -0.82775597  0.11673376  1.32543286
> rowSums(tmp2)
  [1]  2.01309454 -0.70275193 -0.36318856  1.12435595  0.80736124  1.20239144
  [7] -1.01870877  1.33741275  0.21048017  0.04859221 -2.69584396  0.07783770
 [13]  1.33242202 -0.38574387  1.07095977 -1.63251336 -0.93744022 -0.85755483
 [19]  0.71671436  2.31881089 -0.31012526  2.13110473 -1.40951722 -0.66936861
 [25] -0.43545070  1.11904071  0.31382546 -0.62403345 -1.01675730  1.57628419
 [31] -0.16032917 -0.28004735 -0.31293050 -0.15189377  0.85843309  0.68384321
 [37]  0.10108153 -0.61088775  0.26640700 -1.47394619  0.80872163  0.79190707
 [43]  0.94866985  1.17980772  1.61834377 -0.67416684 -0.85503178  0.16265421
 [49] -0.91358880 -0.21829888 -0.77628582 -2.02669668  0.05534559 -0.23397755
 [55] -0.22125804  1.21949984 -0.64497329  1.10035625  2.37623453  0.86013348
 [61] -0.62200555 -1.71024712 -0.32596760 -1.29473135 -0.24919434 -0.64556914
 [67]  0.62917237 -0.24989534 -0.02128942  1.46921254  0.82032136  1.01713150
 [73] -0.98976589  0.50939710  0.24284033  0.33759302  2.03199547 -0.28022445
 [79]  0.03609157 -1.05556564  0.31894495 -0.36427655  0.43351518 -1.30674609
 [85] -1.11953638  0.29218252  0.61923071  1.09085450  0.75253023  1.62241133
 [91] -1.41744270 -0.10085944 -0.15849998  0.42861351 -1.90223408 -0.87389797
 [97] -0.34667788 -0.82775597  0.11673376  1.32543286
> 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]  2.01309454 -0.70275193 -0.36318856  1.12435595  0.80736124  1.20239144
  [7] -1.01870877  1.33741275  0.21048017  0.04859221 -2.69584396  0.07783770
 [13]  1.33242202 -0.38574387  1.07095977 -1.63251336 -0.93744022 -0.85755483
 [19]  0.71671436  2.31881089 -0.31012526  2.13110473 -1.40951722 -0.66936861
 [25] -0.43545070  1.11904071  0.31382546 -0.62403345 -1.01675730  1.57628419
 [31] -0.16032917 -0.28004735 -0.31293050 -0.15189377  0.85843309  0.68384321
 [37]  0.10108153 -0.61088775  0.26640700 -1.47394619  0.80872163  0.79190707
 [43]  0.94866985  1.17980772  1.61834377 -0.67416684 -0.85503178  0.16265421
 [49] -0.91358880 -0.21829888 -0.77628582 -2.02669668  0.05534559 -0.23397755
 [55] -0.22125804  1.21949984 -0.64497329  1.10035625  2.37623453  0.86013348
 [61] -0.62200555 -1.71024712 -0.32596760 -1.29473135 -0.24919434 -0.64556914
 [67]  0.62917237 -0.24989534 -0.02128942  1.46921254  0.82032136  1.01713150
 [73] -0.98976589  0.50939710  0.24284033  0.33759302  2.03199547 -0.28022445
 [79]  0.03609157 -1.05556564  0.31894495 -0.36427655  0.43351518 -1.30674609
 [85] -1.11953638  0.29218252  0.61923071  1.09085450  0.75253023  1.62241133
 [91] -1.41744270 -0.10085944 -0.15849998  0.42861351 -1.90223408 -0.87389797
 [97] -0.34667788 -0.82775597  0.11673376  1.32543286
> rowMin(tmp2)
  [1]  2.01309454 -0.70275193 -0.36318856  1.12435595  0.80736124  1.20239144
  [7] -1.01870877  1.33741275  0.21048017  0.04859221 -2.69584396  0.07783770
 [13]  1.33242202 -0.38574387  1.07095977 -1.63251336 -0.93744022 -0.85755483
 [19]  0.71671436  2.31881089 -0.31012526  2.13110473 -1.40951722 -0.66936861
 [25] -0.43545070  1.11904071  0.31382546 -0.62403345 -1.01675730  1.57628419
 [31] -0.16032917 -0.28004735 -0.31293050 -0.15189377  0.85843309  0.68384321
 [37]  0.10108153 -0.61088775  0.26640700 -1.47394619  0.80872163  0.79190707
 [43]  0.94866985  1.17980772  1.61834377 -0.67416684 -0.85503178  0.16265421
 [49] -0.91358880 -0.21829888 -0.77628582 -2.02669668  0.05534559 -0.23397755
 [55] -0.22125804  1.21949984 -0.64497329  1.10035625  2.37623453  0.86013348
 [61] -0.62200555 -1.71024712 -0.32596760 -1.29473135 -0.24919434 -0.64556914
 [67]  0.62917237 -0.24989534 -0.02128942  1.46921254  0.82032136  1.01713150
 [73] -0.98976589  0.50939710  0.24284033  0.33759302  2.03199547 -0.28022445
 [79]  0.03609157 -1.05556564  0.31894495 -0.36427655  0.43351518 -1.30674609
 [85] -1.11953638  0.29218252  0.61923071  1.09085450  0.75253023  1.62241133
 [91] -1.41744270 -0.10085944 -0.15849998  0.42861351 -1.90223408 -0.87389797
 [97] -0.34667788 -0.82775597  0.11673376  1.32543286
> 
> colMeans(tmp2)
[1] 0.06050638
> colSums(tmp2)
[1] 6.050638
> colVars(tmp2)
[1] 1.053561
> colSd(tmp2)
[1] 1.026431
> colMax(tmp2)
[1] 2.376235
> colMin(tmp2)
[1] -2.695844
> colMedians(tmp2)
[1] 0.007401074
> colRanges(tmp2)
          [,1]
[1,] -2.695844
[2,]  2.376235
> 
> 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.8697100 -1.7020813  2.3826006  1.2694833 -1.4098869 -4.2750612
 [7] -0.2538504 -5.5899387  0.1199969 -3.0437831
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8246067
[2,]  0.1064486
[3,]  0.6739218
[4,]  0.8785405
[5,]  2.4536454
> 
> rowApply(tmp,sum)
 [1] -0.4914509 -5.6134527 -1.0750348 -0.4829172  2.5048182 -2.6345559
 [7] -2.5373413 -3.7402273 -4.7613809 12.1987318
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    7    5    8   10   10    5    9    2     4
 [2,]    3    3    2    9    4    4    9    5    3     9
 [3,]    5    6    4    1    9    9    7    8    8    10
 [4,]    8    1    7    3    7    6    8   10    9     7
 [5,]    1   10    6    5    8    7    2    3    6     8
 [6,]    7    5    1    2    3    2    6    4    5     6
 [7,]   10    4   10    7    2    3    4    2    7     2
 [8,]    6    2    9    6    5    8    1    1    4     3
 [9,]    2    9    8   10    6    5    3    6    1     5
[10,]    4    8    3    4    1    1   10    7   10     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.81173604  1.83687451  2.82204922 -1.42366101 -1.78673121 -3.16716031
 [7] -4.59505549  1.90032743 -0.73499238 -3.20724527 -0.89362082 -1.79870065
[13] -2.52569934 -0.95337676  2.64301842  2.24892444  1.39162591 -1.78817268
[19] -0.02947781 -1.76953648
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4800056
[2,] -0.3951735
[3,] -0.1690920
[4,] -0.1274765
[5,]  0.3600116
> 
> rowApply(tmp,sum)
[1] -6.0008325  1.0218083 -0.4173848 -1.7160119 -6.5299255
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4   10    7    9   16
[2,]   19   15   16    7   10
[3,]   11   16   14   15   20
[4,]   17    5    6    8    4
[5,]   16    4   12    5    3
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.4800056  0.8208624 -0.3182707  0.7141902  0.5736847 -0.3880034
[2,] -0.1274765  0.8095183  0.9533483 -0.4967102 -0.9335426  1.4375258
[3,] -0.3951735  0.7885503  0.7527531 -0.4459253  0.3297897 -1.3965876
[4,] -0.1690920 -0.3622778  0.3576399 -0.1701948 -0.5330569 -1.0400685
[5,]  0.3600116 -0.2197786  1.0765786 -1.0250210 -1.2236062 -1.7800266
           [,7]       [,8]       [,9]      [,10]       [,11]      [,12]
[1,] -0.1643254  0.7315913 -0.3524842 -0.3858066  0.20410585 -0.3582387
[2,] -1.6699018  0.1691002 -0.1695674 -2.2098233  0.26080920 -1.7481986
[3,] -1.4609899 -0.3345357  0.7633294  1.2676052 -1.60278066 -0.3315443
[4,] -1.8148959  0.9093841 -0.1033986 -0.8674552 -0.09914995  0.5216385
[5,]  0.5150575  0.4247874 -0.8728717 -1.0117654  0.34339473  0.1176424
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -1.6831912 -0.7793493  1.3087375  0.2422025 -1.9607602 -0.7078117
[2,] -0.1522707  0.2481860  1.4215854  1.4702137  0.6289387 -0.3736233
[3,] -1.7696725  1.5655727  0.7032737  1.1388802  1.8005486 -0.3611748
[4,]  1.4841245  0.5309443 -0.9331564  0.3433813  0.2173374 -0.5245550
[5,] -0.4046895 -2.5187305  0.1425782 -0.9457533  0.7055614  0.1789920
            [,19]     [,20]
[1,]  0.123478900 -2.141439
[2,] -0.137458881  1.641156
[3,]  0.001913004 -1.431217
[4,] -0.126769075  0.663608
[5,]  0.109358244 -0.501645
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  630  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  547  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  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.619534 -0.4985965 1.44603 0.498506 -0.3889318 -0.4522026 -2.639372
          col8        col9     col10       col11       col12    col13   col14
row1 0.3182213 -0.05756617 0.7289603 -0.08512031 -0.02324302 1.253897 1.53855
          col15     col16      col17    col18     col19     col20
row1 0.02325035 -2.298421 -0.2258469 1.158893 0.5767806 0.9218185
> tmp[,"col10"]
          col10
row1  0.7289603
row2  0.2568284
row3 -0.8050303
row4  0.8403295
row5  0.1255293
> tmp[c("row1","row5"),]
          col1       col2       col3      col4       col5       col6      col7
row1 -0.619534 -0.4985965  1.4460304 0.4985060 -0.3889318 -0.4522026 -2.639372
row5  1.055085 -2.1292887 -0.6535312 0.8558689 -0.4491285  0.2710684  3.352477
           col8        col9     col10       col11       col12      col13
row1  0.3182213 -0.05756617 0.7289603 -0.08512031 -0.02324302  1.2538969
row5 -0.6993941 -0.02500154 0.1255293 -0.71301222  0.13935952 -0.8357523
        col14      col15      col16      col17     col18      col19      col20
row1 1.538550 0.02325035 -2.2984210 -0.2258469  1.158893  0.5767806  0.9218185
row5 1.056247 0.10678593  0.9601967 -2.2670657 -1.146305 -1.1628990 -0.3806808
> tmp[,c("col6","col20")]
           col6       col20
row1 -0.4522026  0.92181851
row2 -0.5397717  0.02554449
row3 -0.9537896  1.32457282
row4  1.1564239 -0.75597617
row5  0.2710684 -0.38068084
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.4522026  0.9218185
row5  0.2710684 -0.3806808
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5     col6     col7     col8
row1 50.62167 50.5494 49.96207 51.11408 51.34031 106.0425 50.36108 50.56946
         col9    col10    col11    col12    col13   col14    col15   col16
row1 48.65398 49.32652 51.12324 50.59781 49.02697 49.3875 49.52132 50.9075
        col17   col18   col19    col20
row1 48.93107 51.4086 47.6384 104.7144
> tmp[,"col10"]
        col10
row1 49.32652
row2 29.38708
row3 31.32891
row4 31.17365
row5 49.74311
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.62167 50.54940 49.96207 51.11408 51.34031 106.0425 50.36108 50.56946
row5 49.74011 50.24118 49.87668 49.09460 49.05506 106.6991 49.28263 49.73586
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.65398 49.32652 51.12324 50.59781 49.02697 49.38750 49.52132 50.90750
row5 48.58605 49.74311 50.36279 50.13665 50.09761 48.77869 49.62151 49.05196
        col17    col18    col19    col20
row1 48.93107 51.40860 47.63840 104.7144
row5 48.72184 48.89913 48.88025 104.7658
> tmp[,c("col6","col20")]
          col6     col20
row1 106.04248 104.71439
row2  77.42002  76.29474
row3  74.68132  73.62914
row4  75.68323  75.03758
row5 106.69911 104.76580
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.0425 104.7144
row5 106.6991 104.7658
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.0425 104.7144
row5 106.6991 104.7658
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.31000289
[2,]  0.02540629
[3,]  1.21910650
[4,]  0.28422801
[5,]  0.70945762
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.5876645 -0.52052014
[2,] -0.5217978 -0.02658054
[3,] -1.4704884  0.44932673
[4,]  0.7969110  0.58175440
[5,]  1.2147534  1.31461057
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  1.9386350  0.8894463
[2,]  0.1640828 -0.3269596
[3,] -0.1178767 -0.9478521
[4,] -1.0344403 -1.3974381
[5,]  0.3954632 -0.1069867
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.938635
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 1.9386350
[2,] 0.1640828
> 
> 
> 
> 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.38265264  0.30507279 0.02569466  0.6731607 1.59787629 -0.1987621
row1 0.03309385 -0.01326439 1.12545499 -1.0281777 0.07998837  0.4427644
           [,7]       [,8]       [,9]      [,10]     [,11]       [,12]
row3 -0.2088102 -1.0860502 0.01933581  0.1715832 1.0638448  0.90871338
row1  0.8928773  0.1869955 0.21390079 -1.0943243 0.8311575 -0.04666709
          [,13]     [,14]     [,15]      [,16]     [,17]      [,18]      [,19]
row3 -0.3572491 -2.358274 -1.990482 -0.8200543 1.4766317  1.8416517 -0.2930191
row1  0.9118744  1.923716  1.775819 -0.8363902 0.3376019 -0.3335374  0.2373788
          [,20]
row3  0.8473182
row1 -1.0468472
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]       [,4]     [,5]       [,6]      [,7]
row2 -0.44727 0.9508124 0.6066824 -0.5202395 1.013768 -0.8702054 0.9484401
          [,8]     [,9]      [,10]
row2 0.4087658 1.565915 -0.1919397
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]      [,4]       [,5]       [,6]     [,7]
row5 -0.2386783 0.2600925 0.6316003 0.0887378 -0.2561741 -0.8738856 1.507102
          [,8]      [,9]    [,10]    [,11]    [,12]     [,13]      [,14]
row5 0.3130593 -1.238231 1.134551 1.333208 0.363607 -2.713581 -0.4361689
          [,15]     [,16]     [,17]     [,18]    [,19]      [,20]
row5 -0.2142233 0.4019487 0.5664452 -1.386412 0.475341 -0.6186732
> 
> 
> 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: 0x000001eb3b2f8b30>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c43ed74b3"
 [2] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c5ca22bc1"
 [3] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c89136c5" 
 [4] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c34b15e06"
 [5] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c2a95508" 
 [6] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c76847bf5"
 [7] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c52e5697e"
 [8] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c1fe968b4"
 [9] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c7a21329f"
[10] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c724429a4"
[11] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c4b8c4cf1"
[12] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c15d7c93" 
[13] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c4a092ad9"
[14] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c2407e33" 
[15] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM21c4c74d53eb1"
> 
> 
> ### 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: 0x000001eb3bfff470>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001eb3bfff470>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.22-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001eb3bfff470>
> rowMedians(tmp)
  [1]  0.457257840 -0.344648754  0.683655967  0.206815867  0.359693621
  [6]  0.250124333 -0.051754383 -0.231385246  0.303499864  0.351405123
 [11] -0.099517490 -0.142842837 -0.256239100  0.276198963 -0.420637875
 [16]  0.033458816 -0.166372222 -0.199692985  0.335985687 -0.020073280
 [21] -0.336308465 -0.169675524  0.333251758  0.262073166  0.292702050
 [26] -0.194712635 -0.130539855  0.042961529 -0.435013215 -0.090500459
 [31] -0.477287709 -0.342423154  0.129508109  0.127178323  0.465656902
 [36]  0.048440905 -0.134664668  0.078196275 -0.501351482  0.471226196
 [41]  0.132205093  0.237591907 -0.338792317  0.083581669 -0.245015572
 [46] -0.371322383  0.244318851  0.192688589 -0.081943233  0.028900669
 [51]  0.038107938  0.130946980 -0.447666369  0.112909974  0.294976328
 [56] -0.043169528 -0.637746592 -0.699472519 -0.529491982 -0.127818899
 [61]  0.213372561  0.168515863  0.090887497  0.330586756  0.016001031
 [66] -0.453955743  0.079354943  0.191644645  0.230584330 -0.278507026
 [71] -0.018524267 -0.661625861  0.269120503 -0.116700599 -0.063184823
 [76]  0.074708978 -0.123766705 -0.324359231 -0.484557817  0.228346126
 [81] -0.171199492 -0.045696435 -0.271386244 -0.506999159  0.005479679
 [86] -0.008503169 -0.085828740 -0.218828276 -0.170616559  0.496613526
 [91] -0.311838729 -0.101495755  0.030147606 -0.599045823  0.509718853
 [96]  0.605824487  0.007152088 -0.180845566  0.053905220  0.505618261
[101] -0.180277345 -0.126569061  0.625029803  0.304608877 -0.482868341
[106] -0.116934214 -0.166565141 -0.453870805  0.050898063  0.770763674
[111]  1.073515069 -0.134961861 -0.439060522 -0.728665944 -0.055950233
[116]  0.094701899 -0.045827029 -0.060401834  0.656478576  0.383795018
[121]  0.516946453  0.404094277 -0.089742566  0.140837846 -0.512422778
[126]  0.108118125 -0.176565411  0.319015183  0.103785695 -0.603794209
[131]  0.144797792  0.334548196  0.257990469  0.282534930 -0.211840968
[136] -0.030707313  0.190135208  0.211511993 -0.034757796  0.176744906
[141] -0.001951961 -0.250288360  0.155540157 -0.247496138 -0.439399790
[146] -0.001926555 -0.557238902  0.210708079  0.105500060 -0.005631493
[151] -0.040093781 -0.432220165 -0.178804302 -0.318437443 -0.176699334
[156] -0.377092790 -0.123585440 -0.582030834  0.018138439  0.059830171
[161]  0.619289271 -0.174926393 -0.193844176  0.479001327 -0.216303551
[166]  0.383827227  0.004072753  0.138619679  0.382546647  0.295740322
[171] -0.035115477  0.470872437  0.090141914  0.272186319  0.213105405
[176] -0.185237732 -0.465923261 -0.488356601 -0.403853189  0.256031660
[181] -0.371903828 -0.134688246 -0.235764041 -0.631150203  0.199103483
[186]  0.096584150 -0.306188012 -0.012347686 -0.898357108  0.347807951
[191]  0.151754044 -0.479218404 -0.209907480  0.625255452 -0.353270249
[196] -0.250702541  0.029771428 -0.321128690 -0.519494441 -0.419958541
[201]  0.134642825  0.161977070  0.496295578  0.404614834 -0.620461148
[206] -0.659752768  0.571286401  0.074217143 -0.273373308  0.713388142
[211] -0.325753253 -0.125145952  0.055105529 -0.259432838 -0.306601713
[216] -0.525940191  0.022148204  0.337858309  0.201137650  0.026349146
[221] -0.084693015  0.316801165 -0.072997768  0.185886905 -0.075495213
[226]  0.185243136  0.426548801 -0.472071557 -0.214521068 -0.198855929
> 
> proc.time()
   user  system elapsed 
   3.73   15.18  119.26 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 (2025-06-13 ucrt) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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: 0x000001d8d62f8050>
> .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: 0x000001d8d62f8050>
> .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: 0x000001d8d62f8050>
> .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: 0x000001d8d62f8050>
> 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: 0x000001d8d62f8bf0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d8d62f8bf0>
> .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: 0x000001d8d62f8bf0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d8d62f8bf0>
> .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: 0x000001d8d62f8bf0>
> 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: 0x000001d8d62f8410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d8d62f8410>
> .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: 0x000001d8d62f8410>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001d8d62f8410>
> .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: 0x000001d8d62f8410>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000001d8d62f8410>
> .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: 0x000001d8d62f8410>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000001d8d62f8410>
> .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: 0x000001d8d62f8410>
> 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: 0x000001d8d62f8e90>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000001d8d62f8e90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d8d62f8e90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d8d62f8e90>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1b4b0422525e4" "BufferedMatrixFile1b4b059911524"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1b4b0422525e4" "BufferedMatrixFile1b4b059911524"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d8d75f88f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d8d75f88f0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001d8d75f88f0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001d8d75f88f0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000001d8d75f88f0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000001d8d75f88f0>
> .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: 0x000001d8d75f8bf0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d8d75f8bf0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001d8d75f8bf0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000001d8d75f8bf0>
> 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: 0x000001d8d75f8050>
> .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: 0x000001d8d75f8050>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.28    0.09    0.64 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 (2025-06-13 ucrt) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.34    0.09    0.40 

Example timings