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

This page was generated on 2025-08-18 11:41 -0400 (Mon, 18 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4824
palomino7Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4566
merida1macOS 12.7.5 Montereyx86_644.5.1 RC (2025-06-05 r88288) -- "Great Square Root" 4604
kjohnson1macOS 13.6.6 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4545
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4579
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 252/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.72.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-14 13:40 -0400 (Thu, 14 Aug 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_21
git_last_commit: aa9e634
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on palomino7

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.72.0
Command: E:\biocbuild\bbs-3.21-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=E:\biocbuild\bbs-3.21-bioc\R\library --no-vignettes --timings BufferedMatrix_1.72.0.tar.gz
StartedAt: 2025-08-15 00:11:15 -0400 (Fri, 15 Aug 2025)
EndedAt: 2025-08-15 00:14:09 -0400 (Fri, 15 Aug 2025)
EllapsedTime: 174.5 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'E:/biocbuild/bbs-3.21-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.72.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 'E:/biocbuild/bbs-3.21-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
  'E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'E:/biocbuild/bbs-3.21-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** this is package 'BufferedMatrix' version '1.72.0'
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 14.2.0'
gcc  -I"E:/biocbuild/bbs-3.21-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"E:/biocbuild/bbs-3.21-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"E:/biocbuild/bbs-3.21-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"E:/biocbuild/bbs-3.21-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 -LE:/biocbuild/bbs-3.21-bioc/R/bin/x64 -lR
installing to E:/biocbuild/bbs-3.21-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.31    0.14    3.40 

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] "E:/biocbuild/bbs-3.21-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    1042855 55.7   629414 33.7
Vcells 867347  6.7    8388608 64.0  2039045 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 00:11:47 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 00:11:49 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: 0x00000153dbefb2f0>
> 
> 
> 
> 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 00:12:13 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 00:12:21 2025"
> 
> ColMode(tmp2)
<pointer: 0x00000153dbefb2f0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]      [,2]        [,3]        [,4]
[1,] 100.7485986 0.5017939 -1.27659545  0.54260938
[2,]   0.5686632 0.1638921 -1.11412901 -0.09764737
[3,]  -1.2798399 0.3332696 -0.46476863  1.03291437
[4,]  -1.2702627 0.4764638  0.09751152 -1.61875951
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-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,] 100.7485986 0.5017939 1.27659545 0.54260938
[2,]   0.5686632 0.1638921 1.11412901 0.09764737
[3,]   1.2798399 0.3332696 0.46476863 1.03291437
[4,]   1.2702627 0.4764638 0.09751152 1.61875951
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-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.0373601 0.7083741 1.1298652 0.7366202
[2,]  0.7540976 0.4048359 1.0555231 0.3124858
[3,]  1.1313001 0.5772950 0.6817394 1.0163239
[4,]  1.1270593 0.6902636 0.3122683 1.2723048
> 
> 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:    E:/biocbuild/bbs-3.21-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.12220 32.58554 37.57525 32.90881
[2,]  33.10964 29.21225 36.66936 28.22251
[3,]  37.59284 31.10622 32.28216 36.19615
[4,]  37.54086 32.37910 28.22019 39.34181
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x00000153dbefb770>
> exp(tmp5)
<pointer: 0x00000153dbefb770>
> log(tmp5,2)
<pointer: 0x00000153dbefb770>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.6437
> Min(tmp5)
[1] 53.87866
> mean(tmp5)
[1] 73.64123
> Sum(tmp5)
[1] 14728.25
> Var(tmp5)
[1] 873.4831
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.72281 69.65739 71.73966 73.54866 73.45401 71.21780 73.50562 74.20099
 [9] 67.73807 70.62727
> rowSums(tmp5)
 [1] 1814.456 1393.148 1434.793 1470.973 1469.080 1424.356 1470.112 1484.020
 [9] 1354.761 1412.545
> rowVars(tmp5)
 [1] 8064.27199   59.55391   79.27434   55.91715   96.28151  133.66028
 [7]   81.33023   75.62007   82.47626   39.73021
> rowSd(tmp5)
 [1] 89.801292  7.717118  8.903614  7.477777  9.812314 11.561154  9.018327
 [8]  8.695980  9.081644  6.303191
> rowMax(tmp5)
 [1] 470.64373  83.49310  86.63980  81.88482  92.40144  86.69988  93.69509
 [8]  93.47583  91.27450  86.25505
> rowMin(tmp5)
 [1] 57.10446 58.74145 58.28872 54.62819 58.18571 54.95353 54.87692 60.91951
 [9] 53.87866 61.25015
> 
> colMeans(tmp5)
 [1] 113.47906  68.22064  69.52883  71.25906  73.73893  74.88465  72.71152
 [8]  73.20280  69.94006  66.23327  70.47364  80.87750  73.03136  69.58709
[15]  72.61633  72.24244  73.59748  68.37260  70.44753  68.37979
> colSums(tmp5)
 [1] 1134.7906  682.2064  695.2883  712.5906  737.3893  748.8465  727.1152
 [8]  732.0280  699.4006  662.3327  704.7364  808.7750  730.3136  695.8709
[15]  726.1633  722.4244  735.9748  683.7260  704.4753  683.7979
> colVars(tmp5)
 [1] 15798.14301    18.17635    89.25365   101.33519    83.75999    65.67479
 [7]   105.63569    42.80104    36.58156    64.14239   100.30391    43.45418
[13]   154.97503    54.06586   122.57687   115.01077    85.29522    51.97999
[19]    44.14127    71.85757
> colSd(tmp5)
 [1] 125.690664   4.263372   9.447415  10.066538   9.152049   8.103998
 [7]  10.277922   6.542250   6.048269   8.008894  10.015184   6.591979
[13]  12.448897   7.352949  11.071444  10.724308   9.235541   7.209715
[19]   6.643890   8.476885
> colMax(tmp5)
 [1] 470.64373  74.78466  78.83340  87.20033  86.69988  82.04131  93.47583
 [8]  81.54255  79.47422  79.14441  86.63980  93.69509  92.40144  81.98707
[15]  91.27450  86.18418  84.16476  81.49912  81.99551  80.33506
> colMin(tmp5)
 [1] 60.91951 60.80147 53.87866 58.74145 61.75303 60.39012 59.74921 61.69409
 [9] 61.43660 54.87692 55.80980 71.72710 57.37884 60.80402 54.95353 55.90363
[17] 58.28872 54.62819 62.09218 58.18571
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1]       NA 69.65739 71.73966 73.54866 73.45401 71.21780 73.50562 74.20099
 [9] 67.73807 70.62727
> rowSums(tmp5)
 [1]       NA 1393.148 1434.793 1470.973 1469.080 1424.356 1470.112 1484.020
 [9] 1354.761 1412.545
> rowVars(tmp5)
 [1] 8471.96771   59.55391   79.27434   55.91715   96.28151  133.66028
 [7]   81.33023   75.62007   82.47626   39.73021
> rowSd(tmp5)
 [1] 92.043293  7.717118  8.903614  7.477777  9.812314 11.561154  9.018327
 [8]  8.695980  9.081644  6.303191
> rowMax(tmp5)
 [1]       NA 83.49310 86.63980 81.88482 92.40144 86.69988 93.69509 93.47583
 [9] 91.27450 86.25505
> rowMin(tmp5)
 [1]       NA 58.74145 58.28872 54.62819 58.18571 54.95353 54.87692 60.91951
 [9] 53.87866 61.25015
> 
> colMeans(tmp5)
 [1] 113.47906  68.22064  69.52883  71.25906  73.73893  74.88465  72.71152
 [8]  73.20280        NA  66.23327  70.47364  80.87750  73.03136  69.58709
[15]  72.61633  72.24244  73.59748  68.37260  70.44753  68.37979
> colSums(tmp5)
 [1] 1134.7906  682.2064  695.2883  712.5906  737.3893  748.8465  727.1152
 [8]  732.0280        NA  662.3327  704.7364  808.7750  730.3136  695.8709
[15]  726.1633  722.4244  735.9748  683.7260  704.4753  683.7979
> colVars(tmp5)
 [1] 15798.14301    18.17635    89.25365   101.33519    83.75999    65.67479
 [7]   105.63569    42.80104          NA    64.14239   100.30391    43.45418
[13]   154.97503    54.06586   122.57687   115.01077    85.29522    51.97999
[19]    44.14127    71.85757
> colSd(tmp5)
 [1] 125.690664   4.263372   9.447415  10.066538   9.152049   8.103998
 [7]  10.277922   6.542250         NA   8.008894  10.015184   6.591979
[13]  12.448897   7.352949  11.071444  10.724308   9.235541   7.209715
[19]   6.643890   8.476885
> colMax(tmp5)
 [1] 470.64373  74.78466  78.83340  87.20033  86.69988  82.04131  93.47583
 [8]  81.54255        NA  79.14441  86.63980  93.69509  92.40144  81.98707
[15]  91.27450  86.18418  84.16476  81.49912  81.99551  80.33506
> colMin(tmp5)
 [1] 60.91951 60.80147 53.87866 58.74145 61.75303 60.39012 59.74921 61.69409
 [9]       NA 54.87692 55.80980 71.72710 57.37884 60.80402 54.95353 55.90363
[17] 58.28872 54.62819 62.09218 58.18571
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.6437
> Min(tmp5,na.rm=TRUE)
[1] 53.87866
> mean(tmp5,na.rm=TRUE)
[1] 73.68734
> Sum(tmp5,na.rm=TRUE)
[1] 14663.78
> Var(tmp5,na.rm=TRUE)
[1] 877.4673
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.10479 69.65739 71.73966 73.54866 73.45401 71.21780 73.50562 74.20099
 [9] 67.73807 70.62727
> rowSums(tmp5,na.rm=TRUE)
 [1] 1749.991 1393.148 1434.793 1470.973 1469.080 1424.356 1470.112 1484.020
 [9] 1354.761 1412.545
> rowVars(tmp5,na.rm=TRUE)
 [1] 8471.96771   59.55391   79.27434   55.91715   96.28151  133.66028
 [7]   81.33023   75.62007   82.47626   39.73021
> rowSd(tmp5,na.rm=TRUE)
 [1] 92.043293  7.717118  8.903614  7.477777  9.812314 11.561154  9.018327
 [8]  8.695980  9.081644  6.303191
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.64373  83.49310  86.63980  81.88482  92.40144  86.69988  93.69509
 [8]  93.47583  91.27450  86.25505
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.10446 58.74145 58.28872 54.62819 58.18571 54.95353 54.87692 60.91951
 [9] 53.87866 61.25015
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.47906  68.22064  69.52883  71.25906  73.73893  74.88465  72.71152
 [8]  73.20280  70.54837  66.23327  70.47364  80.87750  73.03136  69.58709
[15]  72.61633  72.24244  73.59748  68.37260  70.44753  68.37979
> colSums(tmp5,na.rm=TRUE)
 [1] 1134.7906  682.2064  695.2883  712.5906  737.3893  748.8465  727.1152
 [8]  732.0280  634.9354  662.3327  704.7364  808.7750  730.3136  695.8709
[15]  726.1633  722.4244  735.9748  683.7260  704.4753  683.7979
> colVars(tmp5,na.rm=TRUE)
 [1] 15798.14301    18.17635    89.25365   101.33519    83.75999    65.67479
 [7]   105.63569    42.80104    36.99121    64.14239   100.30391    43.45418
[13]   154.97503    54.06586   122.57687   115.01077    85.29522    51.97999
[19]    44.14127    71.85757
> colSd(tmp5,na.rm=TRUE)
 [1] 125.690664   4.263372   9.447415  10.066538   9.152049   8.103998
 [7]  10.277922   6.542250   6.082040   8.008894  10.015184   6.591979
[13]  12.448897   7.352949  11.071444  10.724308   9.235541   7.209715
[19]   6.643890   8.476885
> colMax(tmp5,na.rm=TRUE)
 [1] 470.64373  74.78466  78.83340  87.20033  86.69988  82.04131  93.47583
 [8]  81.54255  79.47422  79.14441  86.63980  93.69509  92.40144  81.98707
[15]  91.27450  86.18418  84.16476  81.49912  81.99551  80.33506
> colMin(tmp5,na.rm=TRUE)
 [1] 60.91951 60.80147 53.87866 58.74145 61.75303 60.39012 59.74921 61.69409
 [9] 61.43660 54.87692 55.80980 71.72710 57.37884 60.80402 54.95353 55.90363
[17] 58.28872 54.62819 62.09218 58.18571
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 69.65739 71.73966 73.54866 73.45401 71.21780 73.50562 74.20099
 [9] 67.73807 70.62727
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1393.148 1434.793 1470.973 1469.080 1424.356 1470.112 1484.020
 [9] 1354.761 1412.545
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  59.55391  79.27434  55.91715  96.28151 133.66028  81.33023
 [8]  75.62007  82.47626  39.73021
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  7.717118  8.903614  7.477777  9.812314 11.561154  9.018327
 [8]  8.695980  9.081644  6.303191
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 83.49310 86.63980 81.88482 92.40144 86.69988 93.69509 93.47583
 [9] 91.27450 86.25505
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 58.74145 58.28872 54.62819 58.18571 54.95353 54.87692 60.91951
 [9] 53.87866 61.25015
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 73.79410 68.26487 68.56448 71.56613 74.73485 74.11969 73.90158 72.43392
 [9]      NaN 66.03848 70.82849 80.03977 74.77052 69.08257 71.61015 73.92443
[17] 74.31371 67.74442 70.57397 68.01098
> colSums(tmp5,na.rm=TRUE)
 [1] 664.1469 614.3838 617.0803 644.0952 672.6136 667.0772 665.1142 651.9053
 [9]   0.0000 594.3463 637.4564 720.3579 672.9347 621.7431 644.4914 665.3199
[17] 668.8234 609.6998 635.1658 612.0988
> colVars(tmp5,na.rm=TRUE)
 [1]  55.32728  20.42638  89.94823 112.94126  83.07163  67.30108 102.90741
 [8]  41.50051        NA  71.73331 111.42535  40.99076 140.31895  57.96045
[15] 126.50970  97.55958  90.18605  54.03823  49.47906  79.30948
> colSd(tmp5,na.rm=TRUE)
 [1]  7.438231  4.519555  9.484104 10.627383  9.114364  8.203723 10.144329
 [8]  6.442089        NA  8.469552 10.555821  6.402402 11.845630  7.613176
[15] 11.247653  9.877225  9.496633  7.351070  7.034136  8.905587
> colMax(tmp5,na.rm=TRUE)
 [1] 86.25505 74.78466 78.83340 87.20033 86.69988 82.04131 93.47583 81.54255
 [9]     -Inf 79.14441 86.63980 93.69509 92.40144 81.98707 91.27450 86.18418
[17] 84.16476 81.49912 81.99551 80.33506
> colMin(tmp5,na.rm=TRUE)
 [1] 60.91951 60.80147 53.87866 58.74145 61.75303 60.39012 59.74921 61.69409
 [9]      Inf 54.87692 55.80980 71.72710 58.39197 60.80402 54.95353 55.90363
[17] 58.28872 54.62819 62.09218 58.18571
> 
> 
> 
> 
> 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] 103.5037 330.5354 298.7781 138.3795 260.7125 225.8242 219.0456 246.3275
 [9] 298.5472 350.3035
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 103.5037 330.5354 298.7781 138.3795 260.7125 225.8242 219.0456 246.3275
 [9] 298.5472 350.3035
> 
> 
> 
> 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]  1.705303e-13  2.842171e-14 -1.705303e-13  0.000000e+00  1.136868e-13
 [6] -8.526513e-14 -2.842171e-14 -4.263256e-14  8.526513e-14 -3.410605e-13
[11]  1.421085e-13 -5.684342e-14  2.273737e-13  2.273737e-13  1.421085e-14
[16]  8.526513e-14 -5.684342e-14  5.684342e-14  0.000000e+00 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   12 
10   8 
2   10 
6   8 
6   3 
8   18 
10   4 
1   1 
10   12 
10   15 
4   2 
4   5 
1   14 
9   5 
7   15 
8   7 
2   18 
8   9 
4   13 
8   13 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.406022
> Min(tmp)
[1] -2.263917
> mean(tmp)
[1] 0.1232296
> Sum(tmp)
[1] 12.32296
> Var(tmp)
[1] 1.044925
> 
> rowMeans(tmp)
[1] 0.1232296
> rowSums(tmp)
[1] 12.32296
> rowVars(tmp)
[1] 1.044925
> rowSd(tmp)
[1] 1.022216
> rowMax(tmp)
[1] 2.406022
> rowMin(tmp)
[1] -2.263917
> 
> colMeans(tmp)
  [1]  0.12550968 -0.67062327 -1.25629635  1.27353607 -0.50650893 -0.46447378
  [7]  0.10274756  0.53601855  1.14801529 -1.01288523 -0.03850696 -0.28780543
 [13]  2.29206795 -1.18560814  2.01586722 -0.58896097  0.42343855  0.47508844
 [19]  0.04069678 -0.58760357  1.36010550  1.55268928  1.22840557  0.39342491
 [25] -2.26391700 -0.37595356  0.37005919  2.40602174 -0.03400085 -1.76442386
 [31]  0.07504429  0.80615072  0.13645441 -0.06905217  0.03776930  0.14865778
 [37] -1.35216542 -0.67577239 -0.34265698  0.95946564  0.23315983  0.59293439
 [43]  1.55708407  1.19732799 -1.06927467  1.79234280  0.20326616  0.45801513
 [49]  1.12135070  1.45687607  0.28758497  1.41978033 -1.29596331 -0.75437150
 [55] -0.74729097  0.78586419  1.18290270 -0.35443601 -0.24301587 -0.34321222
 [61]  1.11465089 -0.37970042 -1.56265272  1.63851235  0.67217891 -0.58601219
 [67]  0.78876440  1.31551745 -0.83739765  1.34966551  1.55383844 -1.04412571
 [73] -2.01942516 -1.43728468 -0.38518411 -0.92054418  0.15486716  0.29578177
 [79] -0.73814948  1.02276500 -1.07054707 -1.67717789  0.03563427  0.34067999
 [85] -1.16527858  0.58156975  0.03905626  0.77926939 -0.41928674 -0.53919374
 [91] -1.17001328  1.72843931 -0.60526457  0.15777274  0.23640989  0.17963459
 [97] -0.23516776 -0.28219466  1.93517003  1.56644264
> colSums(tmp)
  [1]  0.12550968 -0.67062327 -1.25629635  1.27353607 -0.50650893 -0.46447378
  [7]  0.10274756  0.53601855  1.14801529 -1.01288523 -0.03850696 -0.28780543
 [13]  2.29206795 -1.18560814  2.01586722 -0.58896097  0.42343855  0.47508844
 [19]  0.04069678 -0.58760357  1.36010550  1.55268928  1.22840557  0.39342491
 [25] -2.26391700 -0.37595356  0.37005919  2.40602174 -0.03400085 -1.76442386
 [31]  0.07504429  0.80615072  0.13645441 -0.06905217  0.03776930  0.14865778
 [37] -1.35216542 -0.67577239 -0.34265698  0.95946564  0.23315983  0.59293439
 [43]  1.55708407  1.19732799 -1.06927467  1.79234280  0.20326616  0.45801513
 [49]  1.12135070  1.45687607  0.28758497  1.41978033 -1.29596331 -0.75437150
 [55] -0.74729097  0.78586419  1.18290270 -0.35443601 -0.24301587 -0.34321222
 [61]  1.11465089 -0.37970042 -1.56265272  1.63851235  0.67217891 -0.58601219
 [67]  0.78876440  1.31551745 -0.83739765  1.34966551  1.55383844 -1.04412571
 [73] -2.01942516 -1.43728468 -0.38518411 -0.92054418  0.15486716  0.29578177
 [79] -0.73814948  1.02276500 -1.07054707 -1.67717789  0.03563427  0.34067999
 [85] -1.16527858  0.58156975  0.03905626  0.77926939 -0.41928674 -0.53919374
 [91] -1.17001328  1.72843931 -0.60526457  0.15777274  0.23640989  0.17963459
 [97] -0.23516776 -0.28219466  1.93517003  1.56644264
> 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.12550968 -0.67062327 -1.25629635  1.27353607 -0.50650893 -0.46447378
  [7]  0.10274756  0.53601855  1.14801529 -1.01288523 -0.03850696 -0.28780543
 [13]  2.29206795 -1.18560814  2.01586722 -0.58896097  0.42343855  0.47508844
 [19]  0.04069678 -0.58760357  1.36010550  1.55268928  1.22840557  0.39342491
 [25] -2.26391700 -0.37595356  0.37005919  2.40602174 -0.03400085 -1.76442386
 [31]  0.07504429  0.80615072  0.13645441 -0.06905217  0.03776930  0.14865778
 [37] -1.35216542 -0.67577239 -0.34265698  0.95946564  0.23315983  0.59293439
 [43]  1.55708407  1.19732799 -1.06927467  1.79234280  0.20326616  0.45801513
 [49]  1.12135070  1.45687607  0.28758497  1.41978033 -1.29596331 -0.75437150
 [55] -0.74729097  0.78586419  1.18290270 -0.35443601 -0.24301587 -0.34321222
 [61]  1.11465089 -0.37970042 -1.56265272  1.63851235  0.67217891 -0.58601219
 [67]  0.78876440  1.31551745 -0.83739765  1.34966551  1.55383844 -1.04412571
 [73] -2.01942516 -1.43728468 -0.38518411 -0.92054418  0.15486716  0.29578177
 [79] -0.73814948  1.02276500 -1.07054707 -1.67717789  0.03563427  0.34067999
 [85] -1.16527858  0.58156975  0.03905626  0.77926939 -0.41928674 -0.53919374
 [91] -1.17001328  1.72843931 -0.60526457  0.15777274  0.23640989  0.17963459
 [97] -0.23516776 -0.28219466  1.93517003  1.56644264
> colMin(tmp)
  [1]  0.12550968 -0.67062327 -1.25629635  1.27353607 -0.50650893 -0.46447378
  [7]  0.10274756  0.53601855  1.14801529 -1.01288523 -0.03850696 -0.28780543
 [13]  2.29206795 -1.18560814  2.01586722 -0.58896097  0.42343855  0.47508844
 [19]  0.04069678 -0.58760357  1.36010550  1.55268928  1.22840557  0.39342491
 [25] -2.26391700 -0.37595356  0.37005919  2.40602174 -0.03400085 -1.76442386
 [31]  0.07504429  0.80615072  0.13645441 -0.06905217  0.03776930  0.14865778
 [37] -1.35216542 -0.67577239 -0.34265698  0.95946564  0.23315983  0.59293439
 [43]  1.55708407  1.19732799 -1.06927467  1.79234280  0.20326616  0.45801513
 [49]  1.12135070  1.45687607  0.28758497  1.41978033 -1.29596331 -0.75437150
 [55] -0.74729097  0.78586419  1.18290270 -0.35443601 -0.24301587 -0.34321222
 [61]  1.11465089 -0.37970042 -1.56265272  1.63851235  0.67217891 -0.58601219
 [67]  0.78876440  1.31551745 -0.83739765  1.34966551  1.55383844 -1.04412571
 [73] -2.01942516 -1.43728468 -0.38518411 -0.92054418  0.15486716  0.29578177
 [79] -0.73814948  1.02276500 -1.07054707 -1.67717789  0.03563427  0.34067999
 [85] -1.16527858  0.58156975  0.03905626  0.77926939 -0.41928674 -0.53919374
 [91] -1.17001328  1.72843931 -0.60526457  0.15777274  0.23640989  0.17963459
 [97] -0.23516776 -0.28219466  1.93517003  1.56644264
> colMedians(tmp)
  [1]  0.12550968 -0.67062327 -1.25629635  1.27353607 -0.50650893 -0.46447378
  [7]  0.10274756  0.53601855  1.14801529 -1.01288523 -0.03850696 -0.28780543
 [13]  2.29206795 -1.18560814  2.01586722 -0.58896097  0.42343855  0.47508844
 [19]  0.04069678 -0.58760357  1.36010550  1.55268928  1.22840557  0.39342491
 [25] -2.26391700 -0.37595356  0.37005919  2.40602174 -0.03400085 -1.76442386
 [31]  0.07504429  0.80615072  0.13645441 -0.06905217  0.03776930  0.14865778
 [37] -1.35216542 -0.67577239 -0.34265698  0.95946564  0.23315983  0.59293439
 [43]  1.55708407  1.19732799 -1.06927467  1.79234280  0.20326616  0.45801513
 [49]  1.12135070  1.45687607  0.28758497  1.41978033 -1.29596331 -0.75437150
 [55] -0.74729097  0.78586419  1.18290270 -0.35443601 -0.24301587 -0.34321222
 [61]  1.11465089 -0.37970042 -1.56265272  1.63851235  0.67217891 -0.58601219
 [67]  0.78876440  1.31551745 -0.83739765  1.34966551  1.55383844 -1.04412571
 [73] -2.01942516 -1.43728468 -0.38518411 -0.92054418  0.15486716  0.29578177
 [79] -0.73814948  1.02276500 -1.07054707 -1.67717789  0.03563427  0.34067999
 [85] -1.16527858  0.58156975  0.03905626  0.77926939 -0.41928674 -0.53919374
 [91] -1.17001328  1.72843931 -0.60526457  0.15777274  0.23640989  0.17963459
 [97] -0.23516776 -0.28219466  1.93517003  1.56644264
> colRanges(tmp)
          [,1]       [,2]      [,3]     [,4]       [,5]       [,6]      [,7]
[1,] 0.1255097 -0.6706233 -1.256296 1.273536 -0.5065089 -0.4644738 0.1027476
[2,] 0.1255097 -0.6706233 -1.256296 1.273536 -0.5065089 -0.4644738 0.1027476
          [,8]     [,9]     [,10]       [,11]      [,12]    [,13]     [,14]
[1,] 0.5360185 1.148015 -1.012885 -0.03850696 -0.2878054 2.292068 -1.185608
[2,] 0.5360185 1.148015 -1.012885 -0.03850696 -0.2878054 2.292068 -1.185608
        [,15]     [,16]     [,17]     [,18]      [,19]      [,20]    [,21]
[1,] 2.015867 -0.588961 0.4234386 0.4750884 0.04069678 -0.5876036 1.360106
[2,] 2.015867 -0.588961 0.4234386 0.4750884 0.04069678 -0.5876036 1.360106
        [,22]    [,23]     [,24]     [,25]      [,26]     [,27]    [,28]
[1,] 1.552689 1.228406 0.3934249 -2.263917 -0.3759536 0.3700592 2.406022
[2,] 1.552689 1.228406 0.3934249 -2.263917 -0.3759536 0.3700592 2.406022
           [,29]     [,30]      [,31]     [,32]     [,33]       [,34]     [,35]
[1,] -0.03400085 -1.764424 0.07504429 0.8061507 0.1364544 -0.06905217 0.0377693
[2,] -0.03400085 -1.764424 0.07504429 0.8061507 0.1364544 -0.06905217 0.0377693
         [,36]     [,37]      [,38]     [,39]     [,40]     [,41]     [,42]
[1,] 0.1486578 -1.352165 -0.6757724 -0.342657 0.9594656 0.2331598 0.5929344
[2,] 0.1486578 -1.352165 -0.6757724 -0.342657 0.9594656 0.2331598 0.5929344
        [,43]    [,44]     [,45]    [,46]     [,47]     [,48]    [,49]    [,50]
[1,] 1.557084 1.197328 -1.069275 1.792343 0.2032662 0.4580151 1.121351 1.456876
[2,] 1.557084 1.197328 -1.069275 1.792343 0.2032662 0.4580151 1.121351 1.456876
        [,51]   [,52]     [,53]      [,54]     [,55]     [,56]    [,57]
[1,] 0.287585 1.41978 -1.295963 -0.7543715 -0.747291 0.7858642 1.182903
[2,] 0.287585 1.41978 -1.295963 -0.7543715 -0.747291 0.7858642 1.182903
         [,58]      [,59]      [,60]    [,61]      [,62]     [,63]    [,64]
[1,] -0.354436 -0.2430159 -0.3432122 1.114651 -0.3797004 -1.562653 1.638512
[2,] -0.354436 -0.2430159 -0.3432122 1.114651 -0.3797004 -1.562653 1.638512
         [,65]      [,66]     [,67]    [,68]      [,69]    [,70]    [,71]
[1,] 0.6721789 -0.5860122 0.7887644 1.315517 -0.8373976 1.349666 1.553838
[2,] 0.6721789 -0.5860122 0.7887644 1.315517 -0.8373976 1.349666 1.553838
         [,72]     [,73]     [,74]      [,75]      [,76]     [,77]     [,78]
[1,] -1.044126 -2.019425 -1.437285 -0.3851841 -0.9205442 0.1548672 0.2957818
[2,] -1.044126 -2.019425 -1.437285 -0.3851841 -0.9205442 0.1548672 0.2957818
          [,79]    [,80]     [,81]     [,82]      [,83]   [,84]     [,85]
[1,] -0.7381495 1.022765 -1.070547 -1.677178 0.03563427 0.34068 -1.165279
[2,] -0.7381495 1.022765 -1.070547 -1.677178 0.03563427 0.34068 -1.165279
         [,86]      [,87]     [,88]      [,89]      [,90]     [,91]    [,92]
[1,] 0.5815698 0.03905626 0.7792694 -0.4192867 -0.5391937 -1.170013 1.728439
[2,] 0.5815698 0.03905626 0.7792694 -0.4192867 -0.5391937 -1.170013 1.728439
          [,93]     [,94]     [,95]     [,96]      [,97]      [,98]   [,99]
[1,] -0.6052646 0.1577727 0.2364099 0.1796346 -0.2351678 -0.2821947 1.93517
[2,] -0.6052646 0.1577727 0.2364099 0.1796346 -0.2351678 -0.2821947 1.93517
       [,100]
[1,] 1.566443
[2,] 1.566443
> 
> 
> Max(tmp2)
[1] 2.030173
> Min(tmp2)
[1] -2.632308
> mean(tmp2)
[1] -0.06689435
> Sum(tmp2)
[1] -6.689435
> Var(tmp2)
[1] 0.8874134
> 
> rowMeans(tmp2)
  [1] -1.858012575  0.742067030  1.027097303  0.424583535  0.945462785
  [6]  1.707261529 -0.061160938 -1.175549723 -0.670745108 -0.703844128
 [11] -1.186137850  1.172948139 -0.030521996 -0.075897437 -1.155683048
 [16]  1.007169890  0.529953323 -0.906593322 -0.155420751 -0.283355007
 [21]  0.253313135 -0.368896253  0.419035440 -0.234322165 -0.084246721
 [26] -0.593806528  0.844129335  1.066645303 -1.719751510  0.919667159
 [31]  1.389804401 -1.067794751  1.084859697  0.849068614 -1.013825152
 [36]  1.544081642 -0.228873315  1.027594594  0.009851294 -1.239243290
 [41]  2.030173326 -0.636008182 -1.657237876  0.572199018  0.404704865
 [46] -0.097896760  1.819301440  0.020463125 -0.634276467 -0.587532153
 [51] -0.284637700 -0.818405187  0.339235730 -0.667015702 -0.362082700
 [56] -0.253765146  0.941751302 -1.346727090 -0.568702138 -0.403575635
 [61]  0.784662039  0.276171309 -1.344115452  0.214554030 -1.918939148
 [66] -0.620349596 -1.654473691 -0.720071444  0.888774611 -1.380879040
 [71] -0.474301077 -1.042819751 -0.610609163  0.792318238 -1.216171104
 [76] -0.034321742 -0.684217248  0.084553771  0.646294193  1.102637553
 [81] -2.632308226  1.089791699  0.628422073  0.064055190  0.043943726
 [86]  0.201349329  0.374673704 -0.685475586 -1.516294813  1.612771913
 [91] -1.359219345  0.472482302  0.988552351  0.206759955  0.170363543
 [96]  0.027959057 -0.510174919 -0.061798138  0.634508624  0.510626178
> rowSums(tmp2)
  [1] -1.858012575  0.742067030  1.027097303  0.424583535  0.945462785
  [6]  1.707261529 -0.061160938 -1.175549723 -0.670745108 -0.703844128
 [11] -1.186137850  1.172948139 -0.030521996 -0.075897437 -1.155683048
 [16]  1.007169890  0.529953323 -0.906593322 -0.155420751 -0.283355007
 [21]  0.253313135 -0.368896253  0.419035440 -0.234322165 -0.084246721
 [26] -0.593806528  0.844129335  1.066645303 -1.719751510  0.919667159
 [31]  1.389804401 -1.067794751  1.084859697  0.849068614 -1.013825152
 [36]  1.544081642 -0.228873315  1.027594594  0.009851294 -1.239243290
 [41]  2.030173326 -0.636008182 -1.657237876  0.572199018  0.404704865
 [46] -0.097896760  1.819301440  0.020463125 -0.634276467 -0.587532153
 [51] -0.284637700 -0.818405187  0.339235730 -0.667015702 -0.362082700
 [56] -0.253765146  0.941751302 -1.346727090 -0.568702138 -0.403575635
 [61]  0.784662039  0.276171309 -1.344115452  0.214554030 -1.918939148
 [66] -0.620349596 -1.654473691 -0.720071444  0.888774611 -1.380879040
 [71] -0.474301077 -1.042819751 -0.610609163  0.792318238 -1.216171104
 [76] -0.034321742 -0.684217248  0.084553771  0.646294193  1.102637553
 [81] -2.632308226  1.089791699  0.628422073  0.064055190  0.043943726
 [86]  0.201349329  0.374673704 -0.685475586 -1.516294813  1.612771913
 [91] -1.359219345  0.472482302  0.988552351  0.206759955  0.170363543
 [96]  0.027959057 -0.510174919 -0.061798138  0.634508624  0.510626178
> 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] -1.858012575  0.742067030  1.027097303  0.424583535  0.945462785
  [6]  1.707261529 -0.061160938 -1.175549723 -0.670745108 -0.703844128
 [11] -1.186137850  1.172948139 -0.030521996 -0.075897437 -1.155683048
 [16]  1.007169890  0.529953323 -0.906593322 -0.155420751 -0.283355007
 [21]  0.253313135 -0.368896253  0.419035440 -0.234322165 -0.084246721
 [26] -0.593806528  0.844129335  1.066645303 -1.719751510  0.919667159
 [31]  1.389804401 -1.067794751  1.084859697  0.849068614 -1.013825152
 [36]  1.544081642 -0.228873315  1.027594594  0.009851294 -1.239243290
 [41]  2.030173326 -0.636008182 -1.657237876  0.572199018  0.404704865
 [46] -0.097896760  1.819301440  0.020463125 -0.634276467 -0.587532153
 [51] -0.284637700 -0.818405187  0.339235730 -0.667015702 -0.362082700
 [56] -0.253765146  0.941751302 -1.346727090 -0.568702138 -0.403575635
 [61]  0.784662039  0.276171309 -1.344115452  0.214554030 -1.918939148
 [66] -0.620349596 -1.654473691 -0.720071444  0.888774611 -1.380879040
 [71] -0.474301077 -1.042819751 -0.610609163  0.792318238 -1.216171104
 [76] -0.034321742 -0.684217248  0.084553771  0.646294193  1.102637553
 [81] -2.632308226  1.089791699  0.628422073  0.064055190  0.043943726
 [86]  0.201349329  0.374673704 -0.685475586 -1.516294813  1.612771913
 [91] -1.359219345  0.472482302  0.988552351  0.206759955  0.170363543
 [96]  0.027959057 -0.510174919 -0.061798138  0.634508624  0.510626178
> rowMin(tmp2)
  [1] -1.858012575  0.742067030  1.027097303  0.424583535  0.945462785
  [6]  1.707261529 -0.061160938 -1.175549723 -0.670745108 -0.703844128
 [11] -1.186137850  1.172948139 -0.030521996 -0.075897437 -1.155683048
 [16]  1.007169890  0.529953323 -0.906593322 -0.155420751 -0.283355007
 [21]  0.253313135 -0.368896253  0.419035440 -0.234322165 -0.084246721
 [26] -0.593806528  0.844129335  1.066645303 -1.719751510  0.919667159
 [31]  1.389804401 -1.067794751  1.084859697  0.849068614 -1.013825152
 [36]  1.544081642 -0.228873315  1.027594594  0.009851294 -1.239243290
 [41]  2.030173326 -0.636008182 -1.657237876  0.572199018  0.404704865
 [46] -0.097896760  1.819301440  0.020463125 -0.634276467 -0.587532153
 [51] -0.284637700 -0.818405187  0.339235730 -0.667015702 -0.362082700
 [56] -0.253765146  0.941751302 -1.346727090 -0.568702138 -0.403575635
 [61]  0.784662039  0.276171309 -1.344115452  0.214554030 -1.918939148
 [66] -0.620349596 -1.654473691 -0.720071444  0.888774611 -1.380879040
 [71] -0.474301077 -1.042819751 -0.610609163  0.792318238 -1.216171104
 [76] -0.034321742 -0.684217248  0.084553771  0.646294193  1.102637553
 [81] -2.632308226  1.089791699  0.628422073  0.064055190  0.043943726
 [86]  0.201349329  0.374673704 -0.685475586 -1.516294813  1.612771913
 [91] -1.359219345  0.472482302  0.988552351  0.206759955  0.170363543
 [96]  0.027959057 -0.510174919 -0.061798138  0.634508624  0.510626178
> 
> colMeans(tmp2)
[1] -0.06689435
> colSums(tmp2)
[1] -6.689435
> colVars(tmp2)
[1] 0.8874134
> colSd(tmp2)
[1] 0.9420262
> colMax(tmp2)
[1] 2.030173
> colMin(tmp2)
[1] -2.632308
> colMedians(tmp2)
[1] -0.04774134
> colRanges(tmp2)
          [,1]
[1,] -2.632308
[2,]  2.030173
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.06494696 -5.56845023  2.02501394  6.92919705 -1.76717213 -0.35981742
 [7] -1.03691996  6.94301338  2.84544248  0.82620033
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.00216064
[2,] -0.15397139
[3,] -0.06882777
[4,]  0.15803631
[5,]  1.97587604
> 
> rowApply(tmp,sum)
 [1] -3.062386  3.633062  3.975524  5.591074 -4.420667  1.757989 -2.087030
 [8]  1.938006  4.005004 -0.559016
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    4    3    6    2    6   10    5    4     6
 [2,]    3    1    9    1    7    1    3    3    3    10
 [3,]    7    3    4    8    4    8    5    4    6     5
 [4,]    9    2   10    5    6    2    9    8    9     9
 [5,]    6   10    5    3    5    3    6    1   10     1
 [6,]    8    9    1   10    9    4    1    6    1     2
 [7,]    5    5    2    7    3    9    7    2    2     4
 [8,]    4    7    7    4   10   10    8    7    5     7
 [9,]    1    6    8    9    8    5    4   10    8     8
[10,]   10    8    6    2    1    7    2    9    7     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.2011088  0.2782416  2.2050326 -1.6417259  0.6197344  0.1403427
 [7] -4.7889041 -0.4690483  1.1101934 -1.3946562  0.6462952 -2.9090083
[13] -0.7751307 -3.2406335  2.4057280  0.5555367 -0.6675253  4.5625648
[19]  0.1085475 -2.3600345
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9847048
[2,] -0.3748311
[3,] -0.2115548
[4,]  0.6260121
[5,]  1.1461874
> 
> rowApply(tmp,sum)
[1]  0.6470179 -0.4448864  3.2293003 -3.1775148 -5.6672580
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   17    9    4
[2,]   13    7   15   15    2
[3,]    7   10    8   20   17
[4,]   10   13    6    3    6
[5,]   15    3   12   19   10
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]        [,6]
[1,] -0.3748311  0.42466730 -0.3534348  0.3049607  0.5634806 -1.28794419
[2,]  0.6260121 -0.05675325  0.1893528  0.3401421 -0.8022666  0.52510936
[3,]  1.1461874  0.96468658 -0.1465444 -0.2373281  0.2420286  0.22728189
[4,] -0.2115548  0.58140938  2.2246434 -1.2738143  1.0688150  0.58644498
[5,] -0.9847048 -1.63576838  0.2910156 -0.7756863 -0.4523232  0.08945067
           [,7]       [,8]        [,9]      [,10]      [,11]       [,12]
[1,] -2.1179806  0.7283712 -0.32841804  1.0866024  0.3182333 -0.61226254
[2,]  0.2493689  0.5982163 -0.61905093 -2.5126515 -2.5608164  0.08826494
[3,] -0.1645731  0.2991293  1.09524869 -1.0128267  0.4947400 -0.10789585
[4,] -2.3858316  0.3359581  0.93683013 -0.3033977  0.9433269 -2.17130976
[5,] -0.3698877 -2.4307232  0.02558353  1.3476173  1.4508113 -0.10580510
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.3899442 -0.1493593  0.3894973  0.6424743  0.4285177 -0.4375374
[2,] -0.7366728  0.9099187  0.2005111  1.7356843 -0.4955037  1.1247063
[3,]  1.2580434 -1.5439668  1.9003262 -0.9231557 -0.4261157  1.3946256
[4,] -0.1617915 -1.2629094  0.4834029 -1.0465353  0.1869092  0.2970820
[5,] -0.7447655 -1.1943166 -0.5680094  0.1470691 -0.3613328  2.1836884
           [,19]      [,20]
[1,]  0.98427129  0.8276541
[2,]  0.78805018 -0.0365081
[3,]  0.07128319 -1.3018742
[4,] -1.11877849 -0.8864139
[5,] -0.61627865 -0.9628924
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-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:    E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  626  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  542  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-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.3314043 0.3274346 0.1675969 0.06553187 -0.1185802 0.9252399 1.384951
        col8       col9     col10     col11    col12     col13     col14
row1 1.61625 -0.9570439 0.7975054 -1.786902 1.117038 -1.074768 0.4484051
          col15      col16    col17       col18      col19     col20
row1 -0.4124642 -0.2492478 2.121773 -0.07384488 -0.6019707 0.9676628
> tmp[,"col10"]
          col10
row1  0.7975054
row2 -0.3486930
row3 -1.9815903
row4 -0.6650021
row5 -0.2373122
> tmp[c("row1","row5"),]
           col1        col2      col3        col4        col5      col6
row1 -0.3314043  0.32743465 0.1675969 0.065531867 -0.11858024 0.9252399
row5 -1.3210744 -0.06164636 0.6041004 0.005697797 -0.01566634 1.3287456
         col7      col8        col9      col10       col11     col12      col13
row1 1.384951  1.616250 -0.95704389  0.7975054 -1.78690172 1.1170384 -1.0747677
row5 1.335531 -0.725328 -0.08804603 -0.2373122  0.06724945 0.3893425  0.2538423
          col14      col15      col16    col17       col18      col19
row1  0.4484051 -0.4124642 -0.2492478 2.121773 -0.07384488 -0.6019707
row5 -1.3839161  0.4260365 -0.8343377 1.007211 -0.20066313 -0.1820497
          col20
row1  0.9676628
row5 -0.8036216
> tmp[,c("col6","col20")]
           col6      col20
row1  0.9252399  0.9676628
row2 -0.3112419 -0.6665287
row3  0.1137365  0.2964530
row4  0.8089176  0.7732168
row5  1.3287456 -0.8036216
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.9252399  0.9676628
row5 1.3287456 -0.8036216
> 
> 
> 
> 
> 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.1521 50.14614 50.98275 50.15672 52.4772 105.2983 51.32765 50.15859
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.19581 49.98816 48.81025 49.89955 49.08717 49.46691 49.18382 48.67482
        col17    col18    col19    col20
row1 49.32979 49.99161 50.68105 103.9213
> tmp[,"col10"]
        col10
row1 49.98816
row2 32.81306
row3 28.71575
row4 31.73315
row5 48.50986
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.15210 50.14614 50.98275 50.15672 52.47720 105.2983 51.32765 50.15859
row5 49.70475 48.61138 49.64594 50.94613 48.14716 106.1767 50.83607 48.41635
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.19581 49.98816 48.81025 49.89955 49.08717 49.46691 49.18382 48.67482
row5 50.64293 48.50986 51.49345 47.98738 49.84183 49.08859 50.56558 50.32443
        col17    col18    col19    col20
row1 49.32979 49.99161 50.68105 103.9213
row5 49.87092 50.38219 50.47857 103.8237
> tmp[,c("col6","col20")]
          col6     col20
row1 105.29834 103.92134
row2  74.42843  75.34932
row3  76.11658  74.18140
row4  75.23541  74.19469
row5 106.17666 103.82371
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.2983 103.9213
row5 106.1767 103.8237
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.2983 103.9213
row5 106.1767 103.8237
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.4336466
[2,] -0.9155181
[3,] -0.0546671
[4,]  0.6898540
[5,]  0.5226775
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.02874077  1.7411922
[2,] -1.46296730 -0.2769277
[3,] -1.28948936 -1.3852260
[4,]  1.43340194  0.9550091
[5,] -0.26970812 -1.9763780
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.8599449 1.19025243
[2,] -0.5739220 0.95117825
[3,]  1.5392813 2.33277867
[4,] -0.2821752 0.16939502
[5,] -0.8879935 0.08133013
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.8599449
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.8599449
[2,] -0.5739220
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]      [,3]      [,4]       [,5]       [,6]       [,7]
row3 -0.303101 -0.7239504 0.8933637  1.819365 0.04385083 -2.1747499 -1.0693148
row1  0.425514  0.4881572 0.5096727 -1.506721 0.17019800  0.3258704 -0.1864408
           [,8]      [,9]     [,10]      [,11]       [,12]      [,13]
row3  0.3192914 0.5097579 1.1508332  2.1577305 -0.08030992 -0.2713067
row1 -1.1941480 0.5041852 0.0397521 -0.8114751 -1.59348670 -0.4584232
          [,14]      [,15]     [,16]      [,17]      [,18]      [,19]     [,20]
row3 -0.9493238 -0.8384886 -1.521595 -1.0094998 -0.3979652  0.7861971 0.6307650
row1  0.2124532 -1.1107314  0.463095  0.3865337 -0.5742172 -0.5042552 0.5854113
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]       [,5]      [,6]       [,7]
row2 0.739591 -1.823809 0.3961666 0.9530015 0.08115261 -1.343862 -0.1825098
           [,8]      [,9]     [,10]
row2 -0.2367881 -1.814237 0.9081154
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]       [,4]      [,5]      [,6]      [,7]
row5 0.2742709 0.6699035 -0.4382377 0.08198282 0.5701083 -1.387844 -1.981322
           [,8]      [,9]     [,10]      [,11]    [,12]      [,13]     [,14]
row5 0.02530776 -1.067976 -0.393848 0.09897622 1.383192 -0.2256487 0.7460043
         [,15]      [,16]     [,17]     [,18]     [,19]    [,20]
row5 -1.431424 -0.9739109 0.7864029 0.6279651 -1.137615 1.077162
> 
> 
> 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: 0x00000153dbefbe30>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d8787e6393"
 [2] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d8544c39ea"
 [3] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d838a568e4"
 [4] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d86144717a"
 [5] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d856c11f62"
 [6] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d86d901689"
 [7] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d87e05988" 
 [8] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d8258d4886"
 [9] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d8226f1468"
[10] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d826d4403c"
[11] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d824ef3b42"
[12] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d865763004"
[13] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d82cb955"  
[14] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d876867438"
[15] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMc5d814426df5"
> 
> 
> ### 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: 0x00000153de6ff8f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x00000153de6ff8f0>
Warning message:
In dir.create(new.directory) :
  'E:\biocbuild\bbs-3.21-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x00000153de6ff8f0>
> rowMedians(tmp)
  [1]  0.516627959 -0.255150402  0.072302105  0.090039089  0.288888151
  [6] -0.402958481  0.182370511 -0.182836197  0.074178257  0.120558413
 [11]  0.409414280 -0.075708317  0.294805629  0.259134990  0.309347171
 [16]  0.248223051 -0.530379489  0.059656211  0.413772183 -0.243129335
 [21]  0.368028399  0.170389618 -0.846440077  0.529089045  0.320157693
 [26] -0.147175510  0.992583790  0.252361802 -0.070590718  0.381642657
 [31]  0.062858507  0.252622852  0.058179964  0.006966346 -0.109277747
 [36]  0.030423232  0.198230482 -0.268620050 -0.121410464  0.210884947
 [41]  0.222820614 -0.007202625 -0.014442024  0.175096094  0.327747987
 [46]  0.169796366 -0.382925676  0.345186338  0.237913800 -0.252643618
 [51] -0.165653775 -0.134201931  0.051779210 -0.167159601  0.218105059
 [56] -0.605226615 -0.278306763 -0.504801844 -0.127899712  0.314035562
 [61]  0.097564772  0.068984377 -0.172137611 -0.462383111 -0.124386170
 [66] -0.407127404 -0.089636058 -0.318549972  0.829833679 -0.299337243
 [71]  0.339482948 -0.021898841 -0.397246278 -0.035297891 -0.397471914
 [76] -0.092408925  0.133926660 -0.042335526  0.521161209 -0.578721772
 [81] -0.023140024  0.228476592  0.119982466 -0.168614917  0.163643844
 [86] -0.001381031 -0.030998977  0.276108596  0.030803518  0.606949500
 [91] -0.814289837 -0.596270609 -0.375862299  0.075058497  0.266812155
 [96] -0.203707542  0.264213593  0.284593484  0.028786310  0.213206524
[101] -0.255857350 -0.048574673 -0.050188279  0.501789611  0.392308337
[106]  0.265516459 -0.180868814 -0.145973384 -0.109769917 -0.324422262
[111] -0.321433126 -0.221586065 -0.314299754 -0.123129516 -0.278653903
[116]  0.519569946 -0.878879851 -0.167211934 -0.467872766 -0.264478290
[121] -0.399375437  0.442344828 -0.287568334  0.403294704 -0.164009618
[126]  0.162821102 -0.110931916  0.096520792  0.115029614 -0.053696885
[131] -0.413936803 -0.093039217 -0.003575720 -0.282402669  0.619769185
[136] -0.320084166 -0.530993363  0.379589994 -0.395914976 -0.035543978
[141] -0.498144118  0.014142071  0.437920805 -0.196805512  0.286342355
[146]  0.267345830  0.233759233 -0.071949484  0.629272764  0.100972385
[151] -0.309826629  0.166813735 -0.217384382 -0.042686015  0.127951049
[156] -0.182030220 -0.269738570 -0.163120803  0.076117487 -0.064905637
[161]  0.485552986  0.178876962  0.045098523  0.017492061 -0.080996433
[166]  0.136143982 -0.432794692  0.241250576  0.380832141  0.390786003
[171]  0.196701827  0.230916893 -0.182032716  0.023639755 -0.403713851
[176]  0.058240932  0.685815117  0.533583132  0.732092327  0.127458131
[181] -0.632427336 -0.000681041  0.108061128 -0.050603676  0.314048912
[186] -0.525679650 -0.326521181 -0.191747343 -0.150584341  0.625874778
[191]  0.038955570  0.082826567 -0.471959273 -0.061175771  0.426104031
[196]  0.552567843  0.474028812 -0.149212208  0.302909738 -0.191087067
[201]  0.747832860  0.349722381 -0.417202488  0.009893870  0.360582503
[206] -0.228762729  0.266841795 -0.232485023  0.324360425 -0.159379672
[211] -0.343722526 -0.046817791 -0.153433480  0.062157596  0.972892428
[216] -0.475031784  0.342981732 -0.218646364  0.200730777  0.485891173
[221] -0.071841100 -0.221884846  0.185188224 -0.024100084 -0.190854998
[226] -0.557438094 -0.225142664  0.556324718  0.517024527 -0.251515712
> 
> proc.time()
   user  system elapsed 
   3.45   16.12  136.57 

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: 0x000001a94f2ff410>
> .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: 0x000001a94f2ff410>
> .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: 0x000001a94f2ff410>
> .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: 0x000001a94f2ff410>
> 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: 0x000001a94e67a650>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a94e67a650>
> .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: 0x000001a94e67a650>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a94e67a650>
> .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: 0x000001a94e67a650>
> 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: 0x000001a94f2ffe90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a94f2ffe90>
> .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: 0x000001a94f2ffe90>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001a94f2ffe90>
> .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: 0x000001a94f2ffe90>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000001a94f2ffe90>
> .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: 0x000001a94f2ffe90>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000001a94f2ffe90>
> .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: 0x000001a94f2ffe90>
> 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: 0x000001a9515ff590>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000001a9515ff590>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a9515ff590>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a9515ff590>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1b380444b8"   "BufferedMatrixFile1b38053e3738"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1b380444b8"   "BufferedMatrixFile1b38053e3738"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a9515ff350>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a9515ff350>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001a9515ff350>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001a9515ff350>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000001a9515ff350>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000001a9515ff350>
> .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: 0x000001a9515ff110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001a9515ff110>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001a9515ff110>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000001a9515ff110>
> 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: 0x000001a9515ffbf0>
> .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: 0x000001a9515ffbf0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.35    0.18    0.86 

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.35    0.03    0.37 

Example timings