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

This page was generated on 2025-03-10 12:06 -0400 (Mon, 10 Mar 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.3 (2025-02-28) -- "Trophy Case" 4670
palomino8Windows Server 2022 Datacenterx644.4.3 (2025-02-28 ucrt) -- "Trophy Case" 4355
merida1macOS 12.7.5 Montereyx86_644.4.3 (2025-02-28) -- "Trophy Case" 4446
kjohnson1macOS 13.6.6 Venturaarm644.4.3 (2025-02-28) -- "Trophy Case" 4439
taishanLinux (openEuler 24.03 LTS)aarch644.4.3 (2025-02-28) -- "Trophy Case" 4306
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-03-06 13:00 -0500 (Thu, 06 Mar 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
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
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on palomino8

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.0
Command: F:\biocbuild\bbs-3.20-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.20-bioc\R\library --no-vignettes --timings BufferedMatrix_1.70.0.tar.gz
StartedAt: 2025-03-06 23:56:02 -0500 (Thu, 06 Mar 2025)
EndedAt: 2025-03-06 23:59:02 -0500 (Thu, 06 Mar 2025)
EllapsedTime: 180.6 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck'
* using R version 4.4.3 (2025-02-28 ucrt)
* using platform: x86_64-w64-mingw32
* R was compiled by
    gcc.exe (GCC) 13.3.0
    GNU Fortran (GCC) 13.3.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.70.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) 13.3.0'
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files for x64 is not available
File 'F:/biocbuild/bbs-3.20-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found '_exit', possibly from '_exit' (C)
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

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

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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'F:/biocbuild/bbs-3.20-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 13.3.0'
gcc  -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function 'dbm_ReadOnlyMode':
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: 'sort_double' defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc  -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -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:/rtools44/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.20-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.20-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.4.3 (2025-02-28 ucrt) -- "Trophy Case"
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.34    0.10    0.96 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.3 (2025-02-28 ucrt) -- "Trophy Case"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "F:/biocbuild/bbs-3.20-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 467958 25.0    1020317 54.5   633411 33.9
Vcells 853510  6.6    8388608 64.0  2003128 15.3
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Mar  6 23:56:33 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Mar  6 23:56:36 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: 0x000002a20faf88f0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Mar  6 23:57: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] "Thu Mar  6 23:57:26 2025"
> 
> ColMode(tmp2)
<pointer: 0x000002a20faf88f0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]         [,2]       [,3]     [,4]
[1,] 101.4928687  1.610524706 -0.2008352 1.378384
[2,]   0.9011104  0.053119340  2.2415008 1.050223
[3,]   1.3390736  0.563749339 -0.1291658 1.187617
[4,]   0.4491462 -0.001060543 -0.2354202 1.108382
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]        [,2]      [,3]     [,4]
[1,] 101.4928687 1.610524706 0.2008352 1.378384
[2,]   0.9011104 0.053119340 2.2415008 1.050223
[3,]   1.3390736 0.563749339 0.1291658 1.187617
[4,]   0.4491462 0.001060543 0.2354202 1.108382
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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.0743669 1.26906450 0.4481464 1.174046
[2,]  0.9492684 0.23047633 1.4971642 1.024804
[3,]  1.1571835 0.75083243 0.3593964 1.089778
[4,]  0.6701837 0.03256597 0.4852012 1.052797
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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,] 227.23654 39.30117 29.68230 38.11885
[2,]  35.39379 27.35788 42.21314 36.29826
[3,]  37.91091 33.07207 28.72313 37.08540
[4,]  32.15098 25.32672 30.08743 36.63636
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000002a20faf8830>
> exp(tmp5)
<pointer: 0x000002a20faf8830>
> log(tmp5,2)
<pointer: 0x000002a20faf8830>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.9631
> Min(tmp5)
[1] 52.71425
> mean(tmp5)
[1] 73.86747
> Sum(tmp5)
[1] 14773.49
> Var(tmp5)
[1] 878.3357
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.38645 69.92291 69.06527 70.35634 74.48849 70.34166 69.61253 71.50126
 [9] 77.74940 75.25041
> rowSums(tmp5)
 [1] 1807.729 1398.458 1381.305 1407.127 1489.770 1406.833 1392.251 1430.025
 [9] 1554.988 1505.008
> rowVars(tmp5)
 [1] 8205.63119   77.17295   73.92760   73.85596   44.14218   63.17953
 [7]   47.30930   86.81499   61.73768   68.45180
> rowSd(tmp5)
 [1] 90.584939  8.784814  8.598116  8.593949  6.643958  7.948555  6.878176
 [8]  9.317456  7.857333  8.273560
> rowMax(tmp5)
 [1] 472.96308  87.86113  92.48611  87.82072  89.53232  84.10681  80.04681
 [8]  88.11167  93.87051  87.79998
> rowMin(tmp5)
 [1] 53.89692 53.82736 57.62079 52.71425 62.18362 57.40800 54.28710 54.73569
 [9] 61.34373 58.23171
> 
> colMeans(tmp5)
 [1] 114.15087  66.98797  70.80075  75.58120  71.04142  70.05998  73.79459
 [8]  71.09664  72.81966  76.34980  75.00840  73.91629  71.51291  72.53646
[15]  68.64084  75.42942  72.49003  67.45882  72.27966  65.39378
> colSums(tmp5)
 [1] 1141.5087  669.8797  708.0075  755.8120  710.4142  700.5998  737.9459
 [8]  710.9664  728.1966  763.4980  750.0840  739.1629  715.1291  725.3646
[15]  686.4084  754.2942  724.9003  674.5882  722.7966  653.9378
> colVars(tmp5)
 [1] 15935.24778   110.16347   123.15735    32.38736   100.12598   104.92071
 [7]    89.78113    38.89720    75.69895    56.33444    42.23894    97.17173
[13]    51.79724    92.83906    42.67368    30.56450    43.87723   105.61793
[19]    54.52687   109.04741
> colSd(tmp5)
 [1] 126.234891  10.495878  11.097628   5.690989  10.006297  10.243081
 [7]   9.475291   6.236762   8.700514   7.505627   6.499149   9.857572
[13]   7.197030   9.635303   6.532509   5.528517   6.623989  10.277058
[19]   7.384231  10.442577
> colMax(tmp5)
 [1] 472.96308  86.55802  87.86113  82.79867  89.53232  92.48611  87.82072
 [8]  80.09753  84.66379  88.11167  84.69792  93.87051  82.32855  94.12005
[15]  76.02159  83.37781  80.80131  87.79998  81.24089  82.20272
> colMin(tmp5)
 [1] 62.57135 52.71425 59.78343 62.51614 57.83613 54.28710 53.82736 61.42095
 [9] 59.13750 66.48511 64.59845 62.59100 63.14294 60.15449 58.23171 66.57492
[17] 58.84211 54.79283 57.62079 53.89692
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.38645 69.92291 69.06527 70.35634 74.48849 70.34166       NA 71.50126
 [9] 77.74940 75.25041
> rowSums(tmp5)
 [1] 1807.729 1398.458 1381.305 1407.127 1489.770 1406.833       NA 1430.025
 [9] 1554.988 1505.008
> rowVars(tmp5)
 [1] 8205.63119   77.17295   73.92760   73.85596   44.14218   63.17953
 [7]   49.62654   86.81499   61.73768   68.45180
> rowSd(tmp5)
 [1] 90.584939  8.784814  8.598116  8.593949  6.643958  7.948555  7.044611
 [8]  9.317456  7.857333  8.273560
> rowMax(tmp5)
 [1] 472.96308  87.86113  92.48611  87.82072  89.53232  84.10681        NA
 [8]  88.11167  93.87051  87.79998
> rowMin(tmp5)
 [1] 53.89692 53.82736 57.62079 52.71425 62.18362 57.40800       NA 54.73569
 [9] 61.34373 58.23171
> 
> colMeans(tmp5)
 [1] 114.15087  66.98797        NA  75.58120  71.04142  70.05998  73.79459
 [8]  71.09664  72.81966  76.34980  75.00840  73.91629  71.51291  72.53646
[15]  68.64084  75.42942  72.49003  67.45882  72.27966  65.39378
> colSums(tmp5)
 [1] 1141.5087  669.8797        NA  755.8120  710.4142  700.5998  737.9459
 [8]  710.9664  728.1966  763.4980  750.0840  739.1629  715.1291  725.3646
[15]  686.4084  754.2942  724.9003  674.5882  722.7966  653.9378
> colVars(tmp5)
 [1] 15935.24778   110.16347          NA    32.38736   100.12598   104.92071
 [7]    89.78113    38.89720    75.69895    56.33444    42.23894    97.17173
[13]    51.79724    92.83906    42.67368    30.56450    43.87723   105.61793
[19]    54.52687   109.04741
> colSd(tmp5)
 [1] 126.234891  10.495878         NA   5.690989  10.006297  10.243081
 [7]   9.475291   6.236762   8.700514   7.505627   6.499149   9.857572
[13]   7.197030   9.635303   6.532509   5.528517   6.623989  10.277058
[19]   7.384231  10.442577
> colMax(tmp5)
 [1] 472.96308  86.55802        NA  82.79867  89.53232  92.48611  87.82072
 [8]  80.09753  84.66379  88.11167  84.69792  93.87051  82.32855  94.12005
[15]  76.02159  83.37781  80.80131  87.79998  81.24089  82.20272
> colMin(tmp5)
 [1] 62.57135 52.71425       NA 62.51614 57.83613 54.28710 53.82736 61.42095
 [9] 59.13750 66.48511 64.59845 62.59100 63.14294 60.15449 58.23171 66.57492
[17] 58.84211 54.79283 57.62079 53.89692
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.9631
> Min(tmp5,na.rm=TRUE)
[1] 52.71425
> mean(tmp5,na.rm=TRUE)
[1] 73.87727
> Sum(tmp5,na.rm=TRUE)
[1] 14701.58
> Var(tmp5,na.rm=TRUE)
[1] 882.7524
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.38645 69.92291 69.06527 70.35634 74.48849 70.34166 69.49115 71.50126
 [9] 77.74940 75.25041
> rowSums(tmp5,na.rm=TRUE)
 [1] 1807.729 1398.458 1381.305 1407.127 1489.770 1406.833 1320.332 1430.025
 [9] 1554.988 1505.008
> rowVars(tmp5,na.rm=TRUE)
 [1] 8205.63119   77.17295   73.92760   73.85596   44.14218   63.17953
 [7]   49.62654   86.81499   61.73768   68.45180
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.584939  8.784814  8.598116  8.593949  6.643958  7.948555  7.044611
 [8]  9.317456  7.857333  8.273560
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.96308  87.86113  92.48611  87.82072  89.53232  84.10681  80.04681
 [8]  88.11167  93.87051  87.79998
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.89692 53.82736 57.62079 52.71425 62.18362 57.40800 54.28710 54.73569
 [9] 61.34373 58.23171
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.15087  66.98797  70.67652  75.58120  71.04142  70.05998  73.79459
 [8]  71.09664  72.81966  76.34980  75.00840  73.91629  71.51291  72.53646
[15]  68.64084  75.42942  72.49003  67.45882  72.27966  65.39378
> colSums(tmp5,na.rm=TRUE)
 [1] 1141.5087  669.8797  636.0886  755.8120  710.4142  700.5998  737.9459
 [8]  710.9664  728.1966  763.4980  750.0840  739.1629  715.1291  725.3646
[15]  686.4084  754.2942  724.9003  674.5882  722.7966  653.9378
> colVars(tmp5,na.rm=TRUE)
 [1] 15935.24778   110.16347   138.37839    32.38736   100.12598   104.92071
 [7]    89.78113    38.89720    75.69895    56.33444    42.23894    97.17173
[13]    51.79724    92.83906    42.67368    30.56450    43.87723   105.61793
[19]    54.52687   109.04741
> colSd(tmp5,na.rm=TRUE)
 [1] 126.234891  10.495878  11.763435   5.690989  10.006297  10.243081
 [7]   9.475291   6.236762   8.700514   7.505627   6.499149   9.857572
[13]   7.197030   9.635303   6.532509   5.528517   6.623989  10.277058
[19]   7.384231  10.442577
> colMax(tmp5,na.rm=TRUE)
 [1] 472.96308  86.55802  87.86113  82.79867  89.53232  92.48611  87.82072
 [8]  80.09753  84.66379  88.11167  84.69792  93.87051  82.32855  94.12005
[15]  76.02159  83.37781  80.80131  87.79998  81.24089  82.20272
> colMin(tmp5,na.rm=TRUE)
 [1] 62.57135 52.71425 59.78343 62.51614 57.83613 54.28710 53.82736 61.42095
 [9] 59.13750 66.48511 64.59845 62.59100 63.14294 60.15449 58.23171 66.57492
[17] 58.84211 54.79283 57.62079 53.89692
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.38645 69.92291 69.06527 70.35634 74.48849 70.34166      NaN 71.50126
 [9] 77.74940 75.25041
> rowSums(tmp5,na.rm=TRUE)
 [1] 1807.729 1398.458 1381.305 1407.127 1489.770 1406.833    0.000 1430.025
 [9] 1554.988 1505.008
> rowVars(tmp5,na.rm=TRUE)
 [1] 8205.63119   77.17295   73.92760   73.85596   44.14218   63.17953
 [7]         NA   86.81499   61.73768   68.45180
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.584939  8.784814  8.598116  8.593949  6.643958  7.948555        NA
 [8]  9.317456  7.857333  8.273560
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.96308  87.86113  92.48611  87.82072  89.53232  84.10681        NA
 [8]  88.11167  93.87051  87.79998
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.89692 53.82736 57.62079 52.71425 62.18362 57.40800       NA 54.73569
 [9] 61.34373 58.23171
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 118.81167  67.44497       NaN  76.05298  72.50867  71.81252  74.05430
 [8]  71.47565  73.56550  75.93903  76.01311  73.90576  72.19535  72.08594
[15]  67.97479  76.41325  71.71977  66.92366  71.66904  65.56242
> colSums(tmp5,na.rm=TRUE)
 [1] 1069.3050  607.0047    0.0000  684.4768  652.5780  646.3127  666.4887
 [8]  643.2808  662.0895  683.4512  684.1180  665.1518  649.7581  648.7734
[15]  611.7731  687.7193  645.4780  602.3130  645.0214  590.0618
> colVars(tmp5,na.rm=TRUE)
 [1] 17682.76926   121.58439          NA    33.93186    88.42235    83.48249
 [7]   100.24499    42.14329    78.90318    61.47793    36.16258   109.31695
[13]    53.03245   102.16053    43.01726    23.49587    42.68738   115.59826
[19]    57.14809   122.35837
> colSd(tmp5,na.rm=TRUE)
 [1] 132.976574  11.026531         NA   5.825106   9.403316   9.136875
 [7]  10.012242   6.491786   8.882746   7.840786   6.013533  10.455475
[13]   7.282339  10.107449   6.558754   4.847254   6.533558  10.751663
[19]   7.559635  11.061572
> colMax(tmp5,na.rm=TRUE)
 [1] 472.96308  86.55802      -Inf  82.79867  89.53232  92.48611  87.82072
 [8]  80.09753  84.66379  88.11167  84.69792  93.87051  82.32855  94.12005
[15]  76.02159  83.37781  80.80131  87.79998  81.24089  82.20272
> colMin(tmp5,na.rm=TRUE)
 [1] 62.57135 52.71425      Inf 62.51614 62.13630 63.85034 53.82736 61.42095
 [9] 59.13750 66.48511 64.59845 62.59100 63.14294 60.15449 58.23171 71.61941
[17] 58.84211 54.79283 57.62079 53.89692
> 
> 
> 
> 
> 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] 315.2490 190.2113 189.3749 124.2289 301.8168 180.1091 228.6564 185.6866
 [9] 204.3364 128.1979
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 315.2490 190.2113 189.3749 124.2289 301.8168 180.1091 228.6564 185.6866
 [9] 204.3364 128.1979
> 
> 
> 
> 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.136868e-13  5.684342e-14  2.273737e-13  1.705303e-13  0.000000e+00
 [6]  2.842171e-14 -1.136868e-13  2.842171e-14  0.000000e+00 -1.421085e-14
[11]  0.000000e+00  2.842171e-14  2.273737e-13  0.000000e+00  1.136868e-13
[16]  2.842171e-14  8.526513e-14  5.684342e-14  0.000000e+00 -1.421085e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   7 
2   10 
10   20 
9   17 
10   7 
8   12 
5   12 
5   17 
8   1 
2   12 
3   15 
9   18 
2   12 
1   10 
3   7 
7   7 
6   6 
6   9 
7   16 
9   20 
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.213972
> Min(tmp)
[1] -2.437927
> mean(tmp)
[1] -0.03904419
> Sum(tmp)
[1] -3.904419
> Var(tmp)
[1] 1.105727
> 
> rowMeans(tmp)
[1] -0.03904419
> rowSums(tmp)
[1] -3.904419
> rowVars(tmp)
[1] 1.105727
> rowSd(tmp)
[1] 1.051535
> rowMax(tmp)
[1] 2.213972
> rowMin(tmp)
[1] -2.437927
> 
> colMeans(tmp)
  [1] -0.49709446  1.80213363  0.66510928 -0.25530971 -0.46001834  0.28270168
  [7]  0.29971260 -1.51491206 -0.59757300 -0.50116824  0.16182171  0.79852787
 [13]  1.18044013 -2.36673799 -1.46774552  0.37305487 -1.95766949  1.62852403
 [19] -0.78699993  0.85035543  0.89666375  1.64959768 -1.37041163 -0.03400306
 [25] -0.83501958 -0.89025348 -2.09799180  1.07073175 -0.61171733 -1.83333325
 [31] -0.89387678  1.04588947 -0.55298505 -0.87064707  0.78339839  1.47279734
 [37]  0.06037287  1.08979999 -0.12739297  1.37341155 -1.71688758 -0.33593832
 [43] -0.12337566  0.77825810 -0.62883168 -0.70194292 -0.14330863 -2.25373167
 [49]  0.57315158 -0.05325723 -0.41699703  1.18722721  0.45943691 -0.06565415
 [55] -0.20490164 -0.76449273  0.40745803  1.53100229  0.23797844  0.60676248
 [61] -0.02632623  0.45210331  0.11097049  0.50722145  0.64276992  1.00507589
 [67] -0.20056347  1.17154049  0.49891384  0.50048046 -1.49906497  1.21097985
 [73]  0.34565252 -1.08773110  1.21377369  0.52088898 -0.20778892  0.10629343
 [79]  0.71263439 -0.59368591 -1.43476946 -0.45415856  2.21397242 -0.27255473
 [85] -0.71620685  1.66742197 -0.46858112 -0.40166341  0.37537839 -1.08679665
 [91]  0.48366736  0.35322343 -2.43792676  2.18908626 -0.53908616  0.91272221
 [97] -1.84007478 -0.69879750 -2.04686934 -0.42068249
> colSums(tmp)
  [1] -0.49709446  1.80213363  0.66510928 -0.25530971 -0.46001834  0.28270168
  [7]  0.29971260 -1.51491206 -0.59757300 -0.50116824  0.16182171  0.79852787
 [13]  1.18044013 -2.36673799 -1.46774552  0.37305487 -1.95766949  1.62852403
 [19] -0.78699993  0.85035543  0.89666375  1.64959768 -1.37041163 -0.03400306
 [25] -0.83501958 -0.89025348 -2.09799180  1.07073175 -0.61171733 -1.83333325
 [31] -0.89387678  1.04588947 -0.55298505 -0.87064707  0.78339839  1.47279734
 [37]  0.06037287  1.08979999 -0.12739297  1.37341155 -1.71688758 -0.33593832
 [43] -0.12337566  0.77825810 -0.62883168 -0.70194292 -0.14330863 -2.25373167
 [49]  0.57315158 -0.05325723 -0.41699703  1.18722721  0.45943691 -0.06565415
 [55] -0.20490164 -0.76449273  0.40745803  1.53100229  0.23797844  0.60676248
 [61] -0.02632623  0.45210331  0.11097049  0.50722145  0.64276992  1.00507589
 [67] -0.20056347  1.17154049  0.49891384  0.50048046 -1.49906497  1.21097985
 [73]  0.34565252 -1.08773110  1.21377369  0.52088898 -0.20778892  0.10629343
 [79]  0.71263439 -0.59368591 -1.43476946 -0.45415856  2.21397242 -0.27255473
 [85] -0.71620685  1.66742197 -0.46858112 -0.40166341  0.37537839 -1.08679665
 [91]  0.48366736  0.35322343 -2.43792676  2.18908626 -0.53908616  0.91272221
 [97] -1.84007478 -0.69879750 -2.04686934 -0.42068249
> 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.49709446  1.80213363  0.66510928 -0.25530971 -0.46001834  0.28270168
  [7]  0.29971260 -1.51491206 -0.59757300 -0.50116824  0.16182171  0.79852787
 [13]  1.18044013 -2.36673799 -1.46774552  0.37305487 -1.95766949  1.62852403
 [19] -0.78699993  0.85035543  0.89666375  1.64959768 -1.37041163 -0.03400306
 [25] -0.83501958 -0.89025348 -2.09799180  1.07073175 -0.61171733 -1.83333325
 [31] -0.89387678  1.04588947 -0.55298505 -0.87064707  0.78339839  1.47279734
 [37]  0.06037287  1.08979999 -0.12739297  1.37341155 -1.71688758 -0.33593832
 [43] -0.12337566  0.77825810 -0.62883168 -0.70194292 -0.14330863 -2.25373167
 [49]  0.57315158 -0.05325723 -0.41699703  1.18722721  0.45943691 -0.06565415
 [55] -0.20490164 -0.76449273  0.40745803  1.53100229  0.23797844  0.60676248
 [61] -0.02632623  0.45210331  0.11097049  0.50722145  0.64276992  1.00507589
 [67] -0.20056347  1.17154049  0.49891384  0.50048046 -1.49906497  1.21097985
 [73]  0.34565252 -1.08773110  1.21377369  0.52088898 -0.20778892  0.10629343
 [79]  0.71263439 -0.59368591 -1.43476946 -0.45415856  2.21397242 -0.27255473
 [85] -0.71620685  1.66742197 -0.46858112 -0.40166341  0.37537839 -1.08679665
 [91]  0.48366736  0.35322343 -2.43792676  2.18908626 -0.53908616  0.91272221
 [97] -1.84007478 -0.69879750 -2.04686934 -0.42068249
> colMin(tmp)
  [1] -0.49709446  1.80213363  0.66510928 -0.25530971 -0.46001834  0.28270168
  [7]  0.29971260 -1.51491206 -0.59757300 -0.50116824  0.16182171  0.79852787
 [13]  1.18044013 -2.36673799 -1.46774552  0.37305487 -1.95766949  1.62852403
 [19] -0.78699993  0.85035543  0.89666375  1.64959768 -1.37041163 -0.03400306
 [25] -0.83501958 -0.89025348 -2.09799180  1.07073175 -0.61171733 -1.83333325
 [31] -0.89387678  1.04588947 -0.55298505 -0.87064707  0.78339839  1.47279734
 [37]  0.06037287  1.08979999 -0.12739297  1.37341155 -1.71688758 -0.33593832
 [43] -0.12337566  0.77825810 -0.62883168 -0.70194292 -0.14330863 -2.25373167
 [49]  0.57315158 -0.05325723 -0.41699703  1.18722721  0.45943691 -0.06565415
 [55] -0.20490164 -0.76449273  0.40745803  1.53100229  0.23797844  0.60676248
 [61] -0.02632623  0.45210331  0.11097049  0.50722145  0.64276992  1.00507589
 [67] -0.20056347  1.17154049  0.49891384  0.50048046 -1.49906497  1.21097985
 [73]  0.34565252 -1.08773110  1.21377369  0.52088898 -0.20778892  0.10629343
 [79]  0.71263439 -0.59368591 -1.43476946 -0.45415856  2.21397242 -0.27255473
 [85] -0.71620685  1.66742197 -0.46858112 -0.40166341  0.37537839 -1.08679665
 [91]  0.48366736  0.35322343 -2.43792676  2.18908626 -0.53908616  0.91272221
 [97] -1.84007478 -0.69879750 -2.04686934 -0.42068249
> colMedians(tmp)
  [1] -0.49709446  1.80213363  0.66510928 -0.25530971 -0.46001834  0.28270168
  [7]  0.29971260 -1.51491206 -0.59757300 -0.50116824  0.16182171  0.79852787
 [13]  1.18044013 -2.36673799 -1.46774552  0.37305487 -1.95766949  1.62852403
 [19] -0.78699993  0.85035543  0.89666375  1.64959768 -1.37041163 -0.03400306
 [25] -0.83501958 -0.89025348 -2.09799180  1.07073175 -0.61171733 -1.83333325
 [31] -0.89387678  1.04588947 -0.55298505 -0.87064707  0.78339839  1.47279734
 [37]  0.06037287  1.08979999 -0.12739297  1.37341155 -1.71688758 -0.33593832
 [43] -0.12337566  0.77825810 -0.62883168 -0.70194292 -0.14330863 -2.25373167
 [49]  0.57315158 -0.05325723 -0.41699703  1.18722721  0.45943691 -0.06565415
 [55] -0.20490164 -0.76449273  0.40745803  1.53100229  0.23797844  0.60676248
 [61] -0.02632623  0.45210331  0.11097049  0.50722145  0.64276992  1.00507589
 [67] -0.20056347  1.17154049  0.49891384  0.50048046 -1.49906497  1.21097985
 [73]  0.34565252 -1.08773110  1.21377369  0.52088898 -0.20778892  0.10629343
 [79]  0.71263439 -0.59368591 -1.43476946 -0.45415856  2.21397242 -0.27255473
 [85] -0.71620685  1.66742197 -0.46858112 -0.40166341  0.37537839 -1.08679665
 [91]  0.48366736  0.35322343 -2.43792676  2.18908626 -0.53908616  0.91272221
 [97] -1.84007478 -0.69879750 -2.04686934 -0.42068249
> colRanges(tmp)
           [,1]     [,2]      [,3]       [,4]       [,5]      [,6]      [,7]
[1,] -0.4970945 1.802134 0.6651093 -0.2553097 -0.4600183 0.2827017 0.2997126
[2,] -0.4970945 1.802134 0.6651093 -0.2553097 -0.4600183 0.2827017 0.2997126
          [,8]      [,9]      [,10]     [,11]     [,12]   [,13]     [,14]
[1,] -1.514912 -0.597573 -0.5011682 0.1618217 0.7985279 1.18044 -2.366738
[2,] -1.514912 -0.597573 -0.5011682 0.1618217 0.7985279 1.18044 -2.366738
         [,15]     [,16]     [,17]    [,18]      [,19]     [,20]     [,21]
[1,] -1.467746 0.3730549 -1.957669 1.628524 -0.7869999 0.8503554 0.8966637
[2,] -1.467746 0.3730549 -1.957669 1.628524 -0.7869999 0.8503554 0.8966637
        [,22]     [,23]       [,24]      [,25]      [,26]     [,27]    [,28]
[1,] 1.649598 -1.370412 -0.03400306 -0.8350196 -0.8902535 -2.097992 1.070732
[2,] 1.649598 -1.370412 -0.03400306 -0.8350196 -0.8902535 -2.097992 1.070732
          [,29]     [,30]      [,31]    [,32]     [,33]      [,34]     [,35]
[1,] -0.6117173 -1.833333 -0.8938768 1.045889 -0.552985 -0.8706471 0.7833984
[2,] -0.6117173 -1.833333 -0.8938768 1.045889 -0.552985 -0.8706471 0.7833984
        [,36]      [,37]  [,38]     [,39]    [,40]     [,41]      [,42]
[1,] 1.472797 0.06037287 1.0898 -0.127393 1.373412 -1.716888 -0.3359383
[2,] 1.472797 0.06037287 1.0898 -0.127393 1.373412 -1.716888 -0.3359383
          [,43]     [,44]      [,45]      [,46]      [,47]     [,48]     [,49]
[1,] -0.1233757 0.7782581 -0.6288317 -0.7019429 -0.1433086 -2.253732 0.5731516
[2,] -0.1233757 0.7782581 -0.6288317 -0.7019429 -0.1433086 -2.253732 0.5731516
           [,50]     [,51]    [,52]     [,53]       [,54]      [,55]      [,56]
[1,] -0.05325723 -0.416997 1.187227 0.4594369 -0.06565415 -0.2049016 -0.7644927
[2,] -0.05325723 -0.416997 1.187227 0.4594369 -0.06565415 -0.2049016 -0.7644927
        [,57]    [,58]     [,59]     [,60]       [,61]     [,62]     [,63]
[1,] 0.407458 1.531002 0.2379784 0.6067625 -0.02632623 0.4521033 0.1109705
[2,] 0.407458 1.531002 0.2379784 0.6067625 -0.02632623 0.4521033 0.1109705
         [,64]     [,65]    [,66]      [,67]   [,68]     [,69]     [,70]
[1,] 0.5072215 0.6427699 1.005076 -0.2005635 1.17154 0.4989138 0.5004805
[2,] 0.5072215 0.6427699 1.005076 -0.2005635 1.17154 0.4989138 0.5004805
         [,71]   [,72]     [,73]     [,74]    [,75]    [,76]      [,77]
[1,] -1.499065 1.21098 0.3456525 -1.087731 1.213774 0.520889 -0.2077889
[2,] -1.499065 1.21098 0.3456525 -1.087731 1.213774 0.520889 -0.2077889
         [,78]     [,79]      [,80]     [,81]      [,82]    [,83]      [,84]
[1,] 0.1062934 0.7126344 -0.5936859 -1.434769 -0.4541586 2.213972 -0.2725547
[2,] 0.1062934 0.7126344 -0.5936859 -1.434769 -0.4541586 2.213972 -0.2725547
          [,85]    [,86]      [,87]      [,88]     [,89]     [,90]     [,91]
[1,] -0.7162068 1.667422 -0.4685811 -0.4016634 0.3753784 -1.086797 0.4836674
[2,] -0.7162068 1.667422 -0.4685811 -0.4016634 0.3753784 -1.086797 0.4836674
         [,92]     [,93]    [,94]      [,95]     [,96]     [,97]      [,98]
[1,] 0.3532234 -2.437927 2.189086 -0.5390862 0.9127222 -1.840075 -0.6987975
[2,] 0.3532234 -2.437927 2.189086 -0.5390862 0.9127222 -1.840075 -0.6987975
         [,99]     [,100]
[1,] -2.046869 -0.4206825
[2,] -2.046869 -0.4206825
> 
> 
> Max(tmp2)
[1] 2.531138
> Min(tmp2)
[1] -2.740722
> mean(tmp2)
[1] 0.06458952
> Sum(tmp2)
[1] 6.458952
> Var(tmp2)
[1] 1.301657
> 
> rowMeans(tmp2)
  [1] -0.214390412 -1.512236710 -1.424863301 -0.362960454  0.010814792
  [6] -2.532576079 -0.538321826  0.513024833  0.370494186  0.256686215
 [11]  1.363535717 -1.654903308 -0.290741939  1.590603096 -0.735539960
 [16] -0.121696778  0.902346386  1.334482913 -0.184915290  1.590148039
 [21]  1.668318969  0.637403479  0.238308353  0.919540835 -2.462816314
 [26]  0.961637246  1.053173586  0.002478483  1.121295436 -0.163061618
 [31] -0.023343344 -1.010626793  0.968536782 -1.516041912 -0.601715686
 [36]  0.588050589  0.710272721 -1.003722184 -0.648256257 -1.191980360
 [41]  1.899844905  0.198478937 -1.445815729  0.690712250 -0.436857020
 [46] -0.534486386 -0.313324758 -0.276687003  1.023069794 -1.411752763
 [51] -0.331678662  0.774125053 -0.223915972  0.998837483  0.941045306
 [56]  1.516789997 -2.740722269 -1.182181952  0.340606388 -0.653233326
 [61]  1.125131937  1.597410034  0.184672134  1.961180314 -1.795675006
 [66]  2.531138430  0.458771373 -0.309086264 -0.633556120 -0.805153894
 [71] -0.349900686  0.620750298 -1.585876391  0.991386635  0.926005372
 [76]  1.185653376  0.584261130 -0.977868026  0.415175066 -2.434317889
 [81] -1.633886555 -0.159227845  0.801936819  2.233942568  1.359429992
 [86] -0.779266166 -0.689622846 -0.504849076  0.447207383  2.151205026
 [91]  0.591782352 -1.336806360  0.523272755  2.041880828 -1.233704102
 [96]  0.127226816  0.705465704 -0.072668606 -0.326985798  1.083221358
> rowSums(tmp2)
  [1] -0.214390412 -1.512236710 -1.424863301 -0.362960454  0.010814792
  [6] -2.532576079 -0.538321826  0.513024833  0.370494186  0.256686215
 [11]  1.363535717 -1.654903308 -0.290741939  1.590603096 -0.735539960
 [16] -0.121696778  0.902346386  1.334482913 -0.184915290  1.590148039
 [21]  1.668318969  0.637403479  0.238308353  0.919540835 -2.462816314
 [26]  0.961637246  1.053173586  0.002478483  1.121295436 -0.163061618
 [31] -0.023343344 -1.010626793  0.968536782 -1.516041912 -0.601715686
 [36]  0.588050589  0.710272721 -1.003722184 -0.648256257 -1.191980360
 [41]  1.899844905  0.198478937 -1.445815729  0.690712250 -0.436857020
 [46] -0.534486386 -0.313324758 -0.276687003  1.023069794 -1.411752763
 [51] -0.331678662  0.774125053 -0.223915972  0.998837483  0.941045306
 [56]  1.516789997 -2.740722269 -1.182181952  0.340606388 -0.653233326
 [61]  1.125131937  1.597410034  0.184672134  1.961180314 -1.795675006
 [66]  2.531138430  0.458771373 -0.309086264 -0.633556120 -0.805153894
 [71] -0.349900686  0.620750298 -1.585876391  0.991386635  0.926005372
 [76]  1.185653376  0.584261130 -0.977868026  0.415175066 -2.434317889
 [81] -1.633886555 -0.159227845  0.801936819  2.233942568  1.359429992
 [86] -0.779266166 -0.689622846 -0.504849076  0.447207383  2.151205026
 [91]  0.591782352 -1.336806360  0.523272755  2.041880828 -1.233704102
 [96]  0.127226816  0.705465704 -0.072668606 -0.326985798  1.083221358
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.214390412 -1.512236710 -1.424863301 -0.362960454  0.010814792
  [6] -2.532576079 -0.538321826  0.513024833  0.370494186  0.256686215
 [11]  1.363535717 -1.654903308 -0.290741939  1.590603096 -0.735539960
 [16] -0.121696778  0.902346386  1.334482913 -0.184915290  1.590148039
 [21]  1.668318969  0.637403479  0.238308353  0.919540835 -2.462816314
 [26]  0.961637246  1.053173586  0.002478483  1.121295436 -0.163061618
 [31] -0.023343344 -1.010626793  0.968536782 -1.516041912 -0.601715686
 [36]  0.588050589  0.710272721 -1.003722184 -0.648256257 -1.191980360
 [41]  1.899844905  0.198478937 -1.445815729  0.690712250 -0.436857020
 [46] -0.534486386 -0.313324758 -0.276687003  1.023069794 -1.411752763
 [51] -0.331678662  0.774125053 -0.223915972  0.998837483  0.941045306
 [56]  1.516789997 -2.740722269 -1.182181952  0.340606388 -0.653233326
 [61]  1.125131937  1.597410034  0.184672134  1.961180314 -1.795675006
 [66]  2.531138430  0.458771373 -0.309086264 -0.633556120 -0.805153894
 [71] -0.349900686  0.620750298 -1.585876391  0.991386635  0.926005372
 [76]  1.185653376  0.584261130 -0.977868026  0.415175066 -2.434317889
 [81] -1.633886555 -0.159227845  0.801936819  2.233942568  1.359429992
 [86] -0.779266166 -0.689622846 -0.504849076  0.447207383  2.151205026
 [91]  0.591782352 -1.336806360  0.523272755  2.041880828 -1.233704102
 [96]  0.127226816  0.705465704 -0.072668606 -0.326985798  1.083221358
> rowMin(tmp2)
  [1] -0.214390412 -1.512236710 -1.424863301 -0.362960454  0.010814792
  [6] -2.532576079 -0.538321826  0.513024833  0.370494186  0.256686215
 [11]  1.363535717 -1.654903308 -0.290741939  1.590603096 -0.735539960
 [16] -0.121696778  0.902346386  1.334482913 -0.184915290  1.590148039
 [21]  1.668318969  0.637403479  0.238308353  0.919540835 -2.462816314
 [26]  0.961637246  1.053173586  0.002478483  1.121295436 -0.163061618
 [31] -0.023343344 -1.010626793  0.968536782 -1.516041912 -0.601715686
 [36]  0.588050589  0.710272721 -1.003722184 -0.648256257 -1.191980360
 [41]  1.899844905  0.198478937 -1.445815729  0.690712250 -0.436857020
 [46] -0.534486386 -0.313324758 -0.276687003  1.023069794 -1.411752763
 [51] -0.331678662  0.774125053 -0.223915972  0.998837483  0.941045306
 [56]  1.516789997 -2.740722269 -1.182181952  0.340606388 -0.653233326
 [61]  1.125131937  1.597410034  0.184672134  1.961180314 -1.795675006
 [66]  2.531138430  0.458771373 -0.309086264 -0.633556120 -0.805153894
 [71] -0.349900686  0.620750298 -1.585876391  0.991386635  0.926005372
 [76]  1.185653376  0.584261130 -0.977868026  0.415175066 -2.434317889
 [81] -1.633886555 -0.159227845  0.801936819  2.233942568  1.359429992
 [86] -0.779266166 -0.689622846 -0.504849076  0.447207383  2.151205026
 [91]  0.591782352 -1.336806360  0.523272755  2.041880828 -1.233704102
 [96]  0.127226816  0.705465704 -0.072668606 -0.326985798  1.083221358
> 
> colMeans(tmp2)
[1] 0.06458952
> colSums(tmp2)
[1] 6.458952
> colVars(tmp2)
[1] 1.301657
> colSd(tmp2)
[1] 1.140902
> colMax(tmp2)
[1] 2.531138
> colMin(tmp2)
[1] -2.740722
> colMedians(tmp2)
[1] 0.0690208
> colRanges(tmp2)
          [,1]
[1,] -2.740722
[2,]  2.531138
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.31796237 -1.89372328  2.98624683 -0.45987072 -6.67905011 -2.04506225
 [7] -4.40056598  0.08790962 -2.72502979  0.17505394
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.70253377
[2,] -0.36837564
[3,]  0.07941861
[4,]  0.76822091
[5,]  1.69840935
> 
> rowApply(tmp,sum)
 [1] -5.509181 -1.977837  2.160243 -1.234055  1.156295 -2.759908 -2.470284
 [8] -0.192027 -5.345590  3.536216
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    6    1   10   10    9    5    2    8     5
 [2,]    2    4    7    1    9    6    3   10    4     9
 [3,]   10    7    2    8    4    8    4    6    6    10
 [4,]    5   10    8    7    1   10    9    1    1     3
 [5,]    1    1    6    9    3    5    2    4    3     6
 [6,]    7    3    3    2    5    7    1    5   10     1
 [7,]    4    5   10    6    2    1    8    3    2     4
 [8,]    3    9    9    4    8    3    6    9    9     7
 [9,]    6    2    5    3    7    4   10    7    7     2
[10,]    8    8    4    5    6    2    7    8    5     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.3513295 -2.9363840 -2.4630684 -7.1480672  1.0535714  1.1891460
 [7]  4.5913560 -2.5378130  4.1292379 -2.8475124  2.2122180 -3.7115801
[13] -1.4656888 -0.0322784  2.2470670 -5.9876741  0.0284314  5.1273082
[19] -1.3662014 -5.9481902
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7840027
[2,] -1.5966219
[3,] -1.0967513
[4,]  0.4977646
[5,]  1.6282819
> 
> rowApply(tmp,sum)
[1] -5.0547269 -8.0086169 -0.4664562 -7.2048168  2.5171655
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    5   18    3   11
[2,]    6   10    2   13    9
[3,]    9   16    1    8   18
[4,]    2    7    4    1    8
[5,]   17   14   13    7   12
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]        [,6]
[1,] -1.7840027 -0.92095188 -0.6627532 -1.8527090  1.1159215 -0.78342763
[2,] -1.0967513 -0.31936833  0.5266930 -0.7377204  0.2116961  0.60015619
[3,]  1.6282819 -1.59470035 -2.4842301 -1.5395931  0.3439434  0.05079772
[4,] -1.5966219 -0.07497272 -1.1421622 -2.8619424 -1.2655424  0.23843497
[5,]  0.4977646 -0.02639068  1.2993840 -0.1561022  0.6475529  1.08318477
           [,7]       [,8]       [,9]        [,10]      [,11]      [,12]
[1,]  2.6624383 -0.3709838  1.8929053 -0.307585148 -0.1865654 -1.9268166
[2,] -0.5506425 -0.5540126 -2.6290956  0.001220095  0.8892852 -0.3135967
[3,]  1.1730022 -0.3252714  2.5058796  0.227438803 -0.0404739 -0.9179765
[4,]  1.4694851 -0.4410332  3.0298192 -0.090268291  0.8833434 -1.4786306
[5,] -0.1629271 -0.8465120 -0.6702705 -2.678317836  0.6666287  0.9254402
           [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
[1,]  0.03363173  1.4732093  0.9116430 -1.7395689 -0.10611421 -0.9054159
[2,]  0.79517007 -0.7571862  0.2586415 -1.6851647 -1.23850945  0.5991514
[3,] -1.05710861 -1.5587548 -0.4785864 -0.5413767  0.55203206  2.2679633
[4,]  0.79520330 -1.4518772 -1.0902022 -0.8582010  0.05220271  2.3150773
[5,] -2.03258524  2.2623305  2.6455712 -1.1633628  0.76882029  0.8505322
           [,19]      [,20]
[1,]  0.21791109 -1.8154927
[2,] -0.04470686 -1.9638757
[3,]  0.48655807  0.8357185
[4,] -2.04478224 -1.5921463
[5,]  0.01881856 -1.4123941
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  631  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  547  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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 -1.085371 -1.260768 0.9573885 -0.8582618 0.01509585 0.05106094 -2.323768
          col8      col9     col10      col11      col12     col13      col14
row1 0.3850234 0.8025808 0.8709114 -0.7581347 -0.2576377 0.4814554 -0.1200233
         col15      col16      col17      col18      col19     col20
row1 -1.122997 -0.6380345 -0.4578275 -0.5133622 -0.6245459 0.4174373
> tmp[,"col10"]
           col10
row1  0.87091140
row2  1.97753051
row3 -0.01094557
row4 -0.22653104
row5  0.44894299
> tmp[c("row1","row5"),]
           col1        col2      col3       col4        col5        col6
row1 -1.0853715 -1.26076824 0.9573885 -0.8582618  0.01509585  0.05106094
row5  0.8571507 -0.02551664 0.6941146  1.9899278 -0.62524380 -0.58456197
          col7       col8      col9     col10      col11       col12
row1 -2.323768  0.3850234 0.8025808 0.8709114 -0.7581347 -0.25763772
row5  1.131616 -0.1161122 0.1208820 0.4489430  0.8980931 -0.05163723
           col13      col14     col15      col16      col17       col18
row1  0.48145538 -0.1200233 -1.122997 -0.6380345 -0.4578275 -0.51336216
row5 -0.08882013  0.8800396 -1.193233  0.1362215  0.4293721 -0.05315136
          col19     col20
row1 -0.6245459 0.4174373
row5 -0.1384584 0.9541303
> tmp[,c("col6","col20")]
            col6      col20
row1  0.05106094  0.4174373
row2 -1.17691750 -0.9917544
row3  0.67054435  2.3788472
row4  0.63441614 -0.8681977
row5 -0.58456197  0.9541303
> tmp[c("row1","row5"),c("col6","col20")]
            col6     col20
row1  0.05106094 0.4174373
row5 -0.58456197 0.9541303
> 
> 
> 
> 
> 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.58536 49.53473 48.67377 49.47866 50.90695 104.5284 51.08342 49.55036
         col9   col10    col11    col12    col13    col14    col15    col16
row1 50.66674 50.0799 49.98263 49.48422 49.60555 52.19767 52.22302 49.47937
        col17    col18    col19   col20
row1 48.85676 49.09393 50.44572 104.972
> tmp[,"col10"]
        col10
row1 50.07990
row2 30.43892
row3 28.98649
row4 30.14424
row5 50.48622
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.58536 49.53473 48.67377 49.47866 50.90695 104.5284 51.08342 49.55036
row5 49.70291 51.16764 48.73224 49.64729 50.89258 104.9780 48.12822 49.66284
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.66674 50.07990 49.98263 49.48422 49.60555 52.19767 52.22302 49.47937
row5 48.55015 50.48622 51.93383 50.71777 50.85371 50.67657 50.55505 50.80594
        col17    col18    col19    col20
row1 48.85676 49.09393 50.44572 104.9720
row5 50.06666 51.53397 50.27853 105.1919
> tmp[,c("col6","col20")]
          col6     col20
row1 104.52845 104.97202
row2  73.81511  74.36222
row3  76.02129  75.77767
row4  74.90034  74.84057
row5 104.97803 105.19191
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.5284 104.9720
row5 104.9780 105.1919
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.5284 104.9720
row5 104.9780 105.1919
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.3787126
[2,] -0.6241757
[3,] -0.6575744
[4,]  1.2196913
[5,] -1.0611734
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.2993927  1.0899835
[2,]  1.3057411  0.2431684
[3,] -1.8500941 -0.4921783
[4,] -1.8684063 -0.4143306
[5,] -0.5259552  0.8480081
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  0.1147809 -0.01844677
[2,]  0.1325274 -0.15306051
[3,]  0.3994236  1.23929842
[4,] -0.6520889 -1.17217712
[5,]  0.4224806  0.66397282
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.1147809
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.1147809
[2,] 0.1325274
> 
> 
> 
> 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.2063024  0.1682764 0.5449885 -1.23091719 -1.210799 1.266735 1.6145111
row1  0.2484207 -1.4765071 1.3360830  0.07494366  0.685517 1.073715 0.3953541
           [,8]      [,9]      [,10]      [,11]       [,12]      [,13]
row3 -0.9327964 1.4366488 -0.7022283  0.9060817 -0.09585533 -0.7108322
row1  0.5207707 0.6030624  0.8994105 -1.0195994  0.48200054  0.7628434
          [,14]      [,15]     [,16]     [,17]     [,18]      [,19]     [,20]
row3 -0.6793694 -1.7479075 0.2121546 0.1771213 -1.211638 -0.9146662 -1.353176
row1  0.6089346  0.2712136 0.7032921 1.1239460 -1.061838 -1.3937591 -1.441162
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]      [,5]       [,6]     [,7]
row2 -1.440933 -1.807047 0.4064202 -1.568598 -1.622348 -0.7892351 1.763943
         [,8]      [,9]    [,10]
row2 1.560508 -1.011471 1.014543
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]     [,3]     [,4]       [,5]      [,6]      [,7]
row5 0.4096525 0.07449771 1.048363 1.460242 -0.2770127 -1.482593 0.1170546
          [,8]      [,9]    [,10]    [,11]     [,12]     [,13]     [,14]
row5 0.3794637 0.4288249 1.479878 1.081234 0.9948591 -2.186738 0.2947707
          [,15]    [,16]     [,17]      [,18]    [,19]      [,20]
row5 -0.5140555 -1.46052 0.5059039 -0.7587213 1.406504 0.07954193
> 
> 
> 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: 0x000002a20faf8710>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2306416d12679"
 [2] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM23064638c2fa1"
 [3] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230642b261c3a"
 [4] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2306455441fc9"
 [5] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230644ffc7e0b"
 [6] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230642e184cb8"
 [7] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM23064c354493" 
 [8] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230641c2323e9"
 [9] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230646feb75d7"
[10] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230642a696d21"
[11] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230642961365b"
[12] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230641d6b4af" 
[13] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230646639758a"
[14] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM230647df9af2" 
[15] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2306454e73958"
> 
> 
> ### 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: 0x000002a2121ff410>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000002a2121ff410>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.20-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000002a2121ff410>
> rowMedians(tmp)
  [1] -0.057765443 -0.279197672  0.380675992  0.591447781  0.368574768
  [6] -0.161422893  0.722841034  0.497787348  0.208997910  0.072945796
 [11]  0.512989864 -0.437638938 -0.454686344 -0.263414046 -0.310624370
 [16] -0.054415306  0.034336703 -0.575706263 -0.100240988  0.278479347
 [21]  0.192236858 -0.084610289 -0.041087560  0.020343368  0.183422307
 [26]  0.020389255  0.306596060  0.615859915  0.155469858  0.638700798
 [31]  0.175137950  0.219610913 -0.593983029 -0.033807244 -0.419451275
 [36]  0.451850664  0.151985290 -0.033949654 -0.359794080 -0.180716471
 [41] -0.308029707 -0.638210677 -0.162251039 -0.445249655 -0.294356450
 [46] -0.152256468  0.215279593  0.486818788  0.542982294  0.176960618
 [51]  0.153467244 -0.179936474 -0.400742472 -0.012489640 -0.024204768
 [56]  0.408550817  0.124633199  0.248771948  0.274403701  0.867391006
 [61] -0.516752027  0.269868236 -0.096305323 -0.094139387 -0.247746531
 [66]  0.021407177 -0.222549900 -0.407725288  0.016730182 -0.014649452
 [71]  0.226726362 -0.642668433  0.073236776 -0.096100496 -0.264397818
 [76]  0.280940723  0.145462330 -0.365729972 -0.523303268  0.068726270
 [81]  0.528638261 -0.209332229 -0.136350512 -0.516403704 -0.312331498
 [86] -0.058215799 -0.496056769 -0.447205150  0.195060961 -0.062482263
 [91] -0.221957900 -0.133084631 -0.265260460 -0.528415522 -0.026541974
 [96]  0.012041396  0.316958774  0.737998283 -0.192092654  0.444257536
[101]  0.341252369 -0.268904172  0.002574403  0.098423339 -0.484337148
[106] -0.215236684  0.120998458 -0.265391138 -0.264602494 -0.539971515
[111]  0.533096549 -0.222338685 -0.038338920  0.181217691  0.694624671
[116] -0.140751359  0.190662448 -0.207867505 -0.227781921 -0.449100655
[121]  0.211447862  0.097785562 -0.070219679  0.112754640 -0.010503326
[126] -0.304318722 -0.580605747 -0.036939142 -0.302981354  0.186358159
[131]  0.221554299 -0.059592529  0.170359041 -0.243416772  0.194951971
[136]  0.196301143  0.347663461 -0.166971674  0.232231381 -0.495863796
[141] -0.603857248  0.382235802  0.311439158  0.704725056 -0.459351246
[146] -0.619156172 -0.256785695 -0.351933399 -0.192279098  0.298362875
[151] -0.220201360  0.008623363  0.272963290 -0.498864759  0.261221405
[156]  0.293316277 -0.037385690 -0.223218694  0.017231466  0.229957934
[161] -0.345817965  0.262262642 -0.244650893  0.469233256  0.445401365
[166]  0.109791393 -0.013708830  0.102410159 -0.197070778  0.323255205
[171] -0.360621500 -0.111050732 -0.233869962 -1.080290396  0.215613416
[176] -0.098377360  0.004931737 -0.059351877  0.168979302  0.143225719
[181] -0.416308192 -0.394011773  0.389655308  0.065814866 -0.083751863
[186]  0.480420931  0.621035163 -0.028327737  0.277841610  0.097111163
[191]  0.321645267 -0.131597632  0.397038074 -0.076913732 -0.206534437
[196] -0.340591917  0.146439367  0.360211603  0.441065076 -0.298783483
[201] -0.498433619  0.019979788 -0.340299556  0.262577732  0.079898372
[206]  0.016310126  0.259524749 -0.038866661  0.032587575  0.153082376
[211] -0.124199655 -0.405874887 -0.162215820 -0.253579056 -0.229236679
[216] -0.930410195  0.413203333  0.022781399  0.164141187 -0.338855022
[221] -0.136499190  0.034041911 -0.651790495  0.783910599  0.272184469
[226]  0.030649704  0.063864176  0.151314839  0.388995921  0.172031849
> 
> proc.time()
   user  system elapsed 
   4.00   14.73  143.54 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.3 (2025-02-28 ucrt) -- "Trophy Case"
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: 0x0000020570efeb30>
> .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: 0x0000020570efeb30>
> .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: 0x0000020570efeb30>
> .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: 0x0000020570efeb30>
> 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: 0x0000020570efe290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000020570efe290>
> .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: 0x0000020570efe290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000020570efe290>
> .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: 0x0000020570efe290>
> 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: 0x0000020570efed70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000020570efed70>
> .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: 0x0000020570efed70>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x0000020570efed70>
> .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: 0x0000020570efed70>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x0000020570efed70>
> .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: 0x0000020570efed70>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x0000020570efed70>
> .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: 0x0000020570efed70>
> 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: 0x0000020570efedd0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x0000020570efedd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000020570efedd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x0000020570efedd0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1ff803321318"  "BufferedMatrixFile1ff803a40620f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1ff803321318"  "BufferedMatrixFile1ff803a40620f"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000205735ff0b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000205735ff0b0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000205735ff0b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000205735ff0b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x00000205735ff0b0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x00000205735ff0b0>
> .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: 0x00000205735ff5f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000205735ff5f0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000205735ff5f0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x00000205735ff5f0>
> 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: 0x00000205735ff230>
> .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: 0x00000205735ff230>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.26    0.14    0.64 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.3 (2025-02-28 ucrt) -- "Trophy Case"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
   0.34    0.10    0.39 

Example timings