Back to Build/check report for BioC 3.23:   simplified   long
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2026-05-13 11:32 -0400 (Wed, 13 May 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4994
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 262/2418HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.76.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-05-12 13:40 -0400 (Tue, 12 May 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_23
git_last_commit: 9d72964
git_last_commit_date: 2026-04-28 08:32:08 -0400 (Tue, 28 Apr 2026)
nebbiolo1Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo1

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.76.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz
StartedAt: 2026-05-12 22:04:31 -0400 (Tue, 12 May 2026)
EndedAt: 2026-05-12 22:04:56 -0400 (Tue, 12 May 2026)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-05-13 02:04:31 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.76.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.241   0.052   0.282 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-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 480233 25.7    1053308 56.3   637571 34.1
Vcells 887253  6.8    8388608 64.0  2083896 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue May 12 22:04:46 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue May 12 22:04:46 2026"
> 
> 
> 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: 0x57b30e580690>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue May 12 22:04:47 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue May 12 22:04:47 2026"
> 
> ColMode(tmp2)
<pointer: 0x57b30e580690>
> 
> 
> 
> ### 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,] 99.77638828 0.6641116  1.1374751  0.6925922
[2,]  0.52591047 0.1870474  0.5907189  0.1114169
[3,]  0.04847238 1.4836361 -2.0895093 -0.7059735
[4,]  0.17186160 0.1150552  0.5069138 -2.2543930
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 99.77638828 0.6641116 1.1374751 0.6925922
[2,]  0.52591047 0.1870474 0.5907189 0.1114169
[3,]  0.04847238 1.4836361 2.0895093 0.7059735
[4,]  0.17186160 0.1150552 0.5069138 2.2543930
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9888132 0.8149304 1.0665248 0.8322212
[2,] 0.7251968 0.4324898 0.7685824 0.3337916
[3,] 0.2201644 1.2180460 1.4455135 0.8402223
[4,] 0.4145619 0.3391978 0.7119788 1.5014636
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.66452 33.81342 36.80272 34.01480
[2,]  32.77788 29.51195 33.27654 28.44933
[3,]  27.25012 38.66410 41.54464 34.10820
[4,]  29.31748 28.50703 32.62670 42.26903
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x57b30f9340c0>
> exp(tmp5)
<pointer: 0x57b30f9340c0>
> log(tmp5,2)
<pointer: 0x57b30f9340c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.6098
> Min(tmp5)
[1] 53.12555
> mean(tmp5)
[1] 73.51067
> Sum(tmp5)
[1] 14702.13
> Var(tmp5)
[1] 866.3184
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.98190 69.79249 69.70500 71.61623 74.34034 71.11343 69.83618 72.65316
 [9] 73.68137 72.38656
> rowSums(tmp5)
 [1] 1799.638 1395.850 1394.100 1432.325 1486.807 1422.269 1396.724 1453.063
 [9] 1473.627 1447.731
> rowVars(tmp5)
 [1] 7968.78090   41.26053  106.97299  127.12967   91.07636   65.68333
 [7]   77.75549   85.64024   72.89248   94.07641
> rowSd(tmp5)
 [1] 89.268028  6.423436 10.342775 11.275180  9.543394  8.104526  8.817908
 [8]  9.254201  8.537709  9.699300
> rowMax(tmp5)
 [1] 467.60976  84.42833  87.88422  97.00938  89.36451  87.19914  84.39947
 [8]  93.38040  83.96139  94.27701
> rowMin(tmp5)
 [1] 54.37861 57.38739 55.91693 56.08767 57.70604 54.73138 57.37185 56.16812
 [9] 58.65251 53.12555
> 
> colMeans(tmp5)
 [1] 107.63985  70.00420  73.55996  70.59687  70.01553  71.14881  76.36240
 [8]  66.62638  66.50840  73.63460  73.17134  68.64229  76.87418  71.11784
[15]  76.49153  71.43546  70.52861  74.79665  69.04908  72.00933
> colSums(tmp5)
 [1] 1076.3985  700.0420  735.5996  705.9687  700.1553  711.4881  763.6240
 [8]  666.2638  665.0840  736.3460  731.7134  686.4229  768.7418  711.1784
[15]  764.9153  714.3546  705.2861  747.9665  690.4908  720.0933
> colVars(tmp5)
 [1] 16051.58966    95.76922    95.47920    76.29769    74.97211    70.83207
 [7]    34.11696    88.73914    56.21877   100.15174   107.16373    79.72939
[13]    60.45308   101.20637   125.24318    54.92817   117.03064   117.10166
[19]    84.05973    14.50290
> colSd(tmp5)
 [1] 126.694868   9.786175   9.771346   8.734855   8.658643   8.416179
 [7]   5.840973   9.420145   7.497918  10.007584  10.351992   8.929132
[13]   7.775158  10.060138  11.191210   7.411354  10.818070  10.821352
[19]   9.168410   3.808267
> colMax(tmp5)
 [1] 467.60976  80.47425  86.46973  87.97745  81.96676  84.42833  83.80737
 [8]  87.88422  78.43843  87.21334  93.38040  81.32350  84.02612  87.19914
[15]  94.27701  83.96139  89.36451  97.00938  83.11936  77.87729
> colMin(tmp5)
 [1] 56.71755 57.37185 59.78713 59.21356 54.37861 59.77385 66.69597 57.70604
 [9] 56.16812 61.61551 56.08767 57.24881 59.65870 53.12555 61.97931 58.91644
[17] 54.73138 64.27887 55.91693 63.07139
> 
> 
> ### 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] 89.98190 69.79249 69.70500 71.61623 74.34034 71.11343 69.83618 72.65316
 [9] 73.68137       NA
> rowSums(tmp5)
 [1] 1799.638 1395.850 1394.100 1432.325 1486.807 1422.269 1396.724 1453.063
 [9] 1473.627       NA
> rowVars(tmp5)
 [1] 7968.78090   41.26053  106.97299  127.12967   91.07636   65.68333
 [7]   77.75549   85.64024   72.89248   98.89449
> rowSd(tmp5)
 [1] 89.268028  6.423436 10.342775 11.275180  9.543394  8.104526  8.817908
 [8]  9.254201  8.537709  9.944571
> rowMax(tmp5)
 [1] 467.60976  84.42833  87.88422  97.00938  89.36451  87.19914  84.39947
 [8]  93.38040  83.96139        NA
> rowMin(tmp5)
 [1] 54.37861 57.38739 55.91693 56.08767 57.70604 54.73138 57.37185 56.16812
 [9] 58.65251       NA
> 
> colMeans(tmp5)
 [1] 107.63985        NA  73.55996  70.59687  70.01553  71.14881  76.36240
 [8]  66.62638  66.50840  73.63460  73.17134  68.64229  76.87418  71.11784
[15]  76.49153  71.43546  70.52861  74.79665  69.04908  72.00933
> colSums(tmp5)
 [1] 1076.3985        NA  735.5996  705.9687  700.1553  711.4881  763.6240
 [8]  666.2638  665.0840  736.3460  731.7134  686.4229  768.7418  711.1784
[15]  764.9153  714.3546  705.2861  747.9665  690.4908  720.0933
> colVars(tmp5)
 [1] 16051.58966          NA    95.47920    76.29769    74.97211    70.83207
 [7]    34.11696    88.73914    56.21877   100.15174   107.16373    79.72939
[13]    60.45308   101.20637   125.24318    54.92817   117.03064   117.10166
[19]    84.05973    14.50290
> colSd(tmp5)
 [1] 126.694868         NA   9.771346   8.734855   8.658643   8.416179
 [7]   5.840973   9.420145   7.497918  10.007584  10.351992   8.929132
[13]   7.775158  10.060138  11.191210   7.411354  10.818070  10.821352
[19]   9.168410   3.808267
> colMax(tmp5)
 [1] 467.60976        NA  86.46973  87.97745  81.96676  84.42833  83.80737
 [8]  87.88422  78.43843  87.21334  93.38040  81.32350  84.02612  87.19914
[15]  94.27701  83.96139  89.36451  97.00938  83.11936  77.87729
> colMin(tmp5)
 [1] 56.71755       NA 59.78713 59.21356 54.37861 59.77385 66.69597 57.70604
 [9] 56.16812 61.61551 56.08767 57.24881 59.65870 53.12555 61.97931 58.91644
[17] 54.73138 64.27887 55.91693 63.07139
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.6098
> Min(tmp5,na.rm=TRUE)
[1] 53.12555
> mean(tmp5,na.rm=TRUE)
[1] 73.50303
> Sum(tmp5,na.rm=TRUE)
[1] 14627.1
> Var(tmp5,na.rm=TRUE)
[1] 870.6821
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.98190 69.79249 69.70500 71.61623 74.34034 71.11343 69.83618 72.65316
 [9] 73.68137 72.24747
> rowSums(tmp5,na.rm=TRUE)
 [1] 1799.638 1395.850 1394.100 1432.325 1486.807 1422.269 1396.724 1453.063
 [9] 1473.627 1372.702
> rowVars(tmp5,na.rm=TRUE)
 [1] 7968.78090   41.26053  106.97299  127.12967   91.07636   65.68333
 [7]   77.75549   85.64024   72.89248   98.89449
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.268028  6.423436 10.342775 11.275180  9.543394  8.104526  8.817908
 [8]  9.254201  8.537709  9.944571
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.60976  84.42833  87.88422  97.00938  89.36451  87.19914  84.39947
 [8]  93.38040  83.96139  94.27701
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.37861 57.38739 55.91693 56.08767 57.70604 54.73138 57.37185 56.16812
 [9] 58.65251 53.12555
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.63985  69.44587  73.55996  70.59687  70.01553  71.14881  76.36240
 [8]  66.62638  66.50840  73.63460  73.17134  68.64229  76.87418  71.11784
[15]  76.49153  71.43546  70.52861  74.79665  69.04908  72.00933
> colSums(tmp5,na.rm=TRUE)
 [1] 1076.3985  625.0128  735.5996  705.9687  700.1553  711.4881  763.6240
 [8]  666.2638  665.0840  736.3460  731.7134  686.4229  768.7418  711.1784
[15]  764.9153  714.3546  705.2861  747.9665  690.4908  720.0933
> colVars(tmp5,na.rm=TRUE)
 [1] 16051.58966   104.23335    95.47920    76.29769    74.97211    70.83207
 [7]    34.11696    88.73914    56.21877   100.15174   107.16373    79.72939
[13]    60.45308   101.20637   125.24318    54.92817   117.03064   117.10166
[19]    84.05973    14.50290
> colSd(tmp5,na.rm=TRUE)
 [1] 126.694868  10.209474   9.771346   8.734855   8.658643   8.416179
 [7]   5.840973   9.420145   7.497918  10.007584  10.351992   8.929132
[13]   7.775158  10.060138  11.191210   7.411354  10.818070  10.821352
[19]   9.168410   3.808267
> colMax(tmp5,na.rm=TRUE)
 [1] 467.60976  80.47425  86.46973  87.97745  81.96676  84.42833  83.80737
 [8]  87.88422  78.43843  87.21334  93.38040  81.32350  84.02612  87.19914
[15]  94.27701  83.96139  89.36451  97.00938  83.11936  77.87729
> colMin(tmp5,na.rm=TRUE)
 [1] 56.71755 57.37185 59.78713 59.21356 54.37861 59.77385 66.69597 57.70604
 [9] 56.16812 61.61551 56.08767 57.24881 59.65870 53.12555 61.97931 58.91644
[17] 54.73138 64.27887 55.91693 63.07139
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.98190 69.79249 69.70500 71.61623 74.34034 71.11343 69.83618 72.65316
 [9] 73.68137      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1799.638 1395.850 1394.100 1432.325 1486.807 1422.269 1396.724 1453.063
 [9] 1473.627    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7968.78090   41.26053  106.97299  127.12967   91.07636   65.68333
 [7]   77.75549   85.64024   72.89248         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.268028  6.423436 10.342775 11.275180  9.543394  8.104526  8.817908
 [8]  9.254201  8.537709        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.60976  84.42833  87.88422  97.00938  89.36451  87.19914  84.39947
 [8]  93.38040  83.96139        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.37861 57.38739 55.91693 56.08767 57.70604 54.73138 57.37185 56.16812
 [9] 58.65251       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.28367       NaN  74.73858  71.03639  69.26629  70.13843  76.67799
 [8]  67.11243  66.59562  72.82875  73.93634  67.76653  76.31097  73.11699
[15]  74.51537  70.71141  69.18930  75.96529  69.71778  71.35733
> colSums(tmp5,na.rm=TRUE)
 [1] 1010.5531    0.0000  672.6472  639.3275  623.3966  631.2458  690.1019
 [8]  604.0118  599.3606  655.4587  665.4271  609.8988  686.7987  658.0529
[15]  670.6383  636.4027  622.7037  683.6876  627.4600  642.2160
> colVars(tmp5,na.rm=TRUE)
 [1] 17815.43103          NA    91.78601    83.66168    78.02831    68.20121
 [7]    37.26111    97.17385    63.16053   105.36493   113.97530    81.06747
[13]    64.44118    68.89568    96.96481    55.89639   111.47958   116.37497
[19]    89.53657    11.53340
> colSd(tmp5,na.rm=TRUE)
 [1] 133.474458         NA   9.580502   9.146676   8.833364   8.258403
 [7]   6.104188   9.857680   7.947360  10.264742  10.675922   9.003747
[13]   8.027526   8.300342   9.847071   7.476389  10.558389  10.787723
[19]   9.462377   3.396086
> colMax(tmp5,na.rm=TRUE)
 [1] 467.60976      -Inf  86.46973  87.97745  81.96676  84.42833  83.80737
 [8]  87.88422  78.43843  87.21334  93.38040  81.32350  84.02612  87.19914
[15]  85.73609  83.96139  89.36451  97.00938  83.11936  73.97238
> colMin(tmp5,na.rm=TRUE)
 [1] 56.71755      Inf 59.78713 59.21356 54.37861 59.77385 66.69597 57.70604
 [9] 56.16812 61.61551 56.08767 57.24881 59.65870 65.00812 61.97931 58.91644
[17] 54.73138 64.50558 55.91693 63.07139
> 
> 
> 
> 
> 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] 306.5352 142.2238 332.9347 252.6063 201.2325 399.5183 197.3238 116.7422
 [9] 135.7054 166.3581
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 306.5352 142.2238 332.9347 252.6063 201.2325 399.5183 197.3238 116.7422
 [9] 135.7054 166.3581
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  5.684342e-14 -2.842171e-14  1.421085e-13 -2.842171e-13 -1.136868e-13
 [6] -1.136868e-13 -2.842171e-14 -1.705303e-13 -1.136868e-13 -1.136868e-13
[11] -7.105427e-14  5.684342e-14 -2.273737e-13  1.136868e-13  4.263256e-14
[16] -5.684342e-14  1.705303e-13  0.000000e+00  2.842171e-14  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   4 
7   5 
2   15 
4   20 
5   14 
3   13 
6   14 
8   7 
8   19 
2   5 
10   12 
4   17 
8   7 
9   19 
6   8 
9   20 
6   17 
3   19 
1   5 
8   3 
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.24912
> Min(tmp)
[1] -2.023466
> mean(tmp)
[1] -0.005862997
> Sum(tmp)
[1] -0.5862997
> Var(tmp)
[1] 0.8249618
> 
> rowMeans(tmp)
[1] -0.005862997
> rowSums(tmp)
[1] -0.5862997
> rowVars(tmp)
[1] 0.8249618
> rowSd(tmp)
[1] 0.9082741
> rowMax(tmp)
[1] 2.24912
> rowMin(tmp)
[1] -2.023466
> 
> colMeans(tmp)
  [1]  1.021801241 -0.163086385 -1.317217803  0.463046426 -0.073053554
  [6] -0.843677269  0.878608539 -1.201826092  0.363772658  0.904964191
 [11] -0.451324166 -1.092547708 -1.635975911 -1.114303211 -0.289512516
 [16] -1.143306252  0.420793123  0.350810119 -1.376059344  1.562757785
 [21] -0.089763439  0.945570793  1.373893555  0.793174514  0.334278541
 [26] -1.259694265 -0.969595092  0.310891323  1.084185431  0.004457687
 [31]  1.015063054 -0.098262151  0.323067402  0.053521555  0.812007339
 [36] -0.190144014  0.552244416 -1.642558090 -0.375289252  0.792014786
 [41] -0.922830642  0.634551248  0.351040294 -1.219537265  1.226769768
 [46]  1.020874163  1.146757086 -0.822859534  0.340410237 -0.196374907
 [51] -0.421661282 -0.699517534  0.215366129 -1.021680866  0.986254195
 [56] -1.679054039 -0.485152677 -0.452163386 -0.650718991  0.177676698
 [61]  2.249119787 -0.172244286  1.165596095 -1.282788463  0.060717128
 [66]  1.212679340 -1.428605264 -1.288989927  1.752652167 -0.728342189
 [71]  0.067981970  0.497003838 -0.106247032 -0.015984760  0.269232326
 [76] -1.280284004  0.990207516 -0.422354154 -0.098685445 -0.146325939
 [81] -0.496432464  1.464682547  1.008597198 -1.264923958  1.332470427
 [86] -0.138207093  0.775906089 -0.879222893  0.595943300  0.362184051
 [91]  0.226318704  0.708214918 -2.023466101 -0.229775256 -0.528319671
 [96] -0.083848510  0.701147005 -0.684199801  1.244563556 -0.534147115
> colSums(tmp)
  [1]  1.021801241 -0.163086385 -1.317217803  0.463046426 -0.073053554
  [6] -0.843677269  0.878608539 -1.201826092  0.363772658  0.904964191
 [11] -0.451324166 -1.092547708 -1.635975911 -1.114303211 -0.289512516
 [16] -1.143306252  0.420793123  0.350810119 -1.376059344  1.562757785
 [21] -0.089763439  0.945570793  1.373893555  0.793174514  0.334278541
 [26] -1.259694265 -0.969595092  0.310891323  1.084185431  0.004457687
 [31]  1.015063054 -0.098262151  0.323067402  0.053521555  0.812007339
 [36] -0.190144014  0.552244416 -1.642558090 -0.375289252  0.792014786
 [41] -0.922830642  0.634551248  0.351040294 -1.219537265  1.226769768
 [46]  1.020874163  1.146757086 -0.822859534  0.340410237 -0.196374907
 [51] -0.421661282 -0.699517534  0.215366129 -1.021680866  0.986254195
 [56] -1.679054039 -0.485152677 -0.452163386 -0.650718991  0.177676698
 [61]  2.249119787 -0.172244286  1.165596095 -1.282788463  0.060717128
 [66]  1.212679340 -1.428605264 -1.288989927  1.752652167 -0.728342189
 [71]  0.067981970  0.497003838 -0.106247032 -0.015984760  0.269232326
 [76] -1.280284004  0.990207516 -0.422354154 -0.098685445 -0.146325939
 [81] -0.496432464  1.464682547  1.008597198 -1.264923958  1.332470427
 [86] -0.138207093  0.775906089 -0.879222893  0.595943300  0.362184051
 [91]  0.226318704  0.708214918 -2.023466101 -0.229775256 -0.528319671
 [96] -0.083848510  0.701147005 -0.684199801  1.244563556 -0.534147115
> 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]  1.021801241 -0.163086385 -1.317217803  0.463046426 -0.073053554
  [6] -0.843677269  0.878608539 -1.201826092  0.363772658  0.904964191
 [11] -0.451324166 -1.092547708 -1.635975911 -1.114303211 -0.289512516
 [16] -1.143306252  0.420793123  0.350810119 -1.376059344  1.562757785
 [21] -0.089763439  0.945570793  1.373893555  0.793174514  0.334278541
 [26] -1.259694265 -0.969595092  0.310891323  1.084185431  0.004457687
 [31]  1.015063054 -0.098262151  0.323067402  0.053521555  0.812007339
 [36] -0.190144014  0.552244416 -1.642558090 -0.375289252  0.792014786
 [41] -0.922830642  0.634551248  0.351040294 -1.219537265  1.226769768
 [46]  1.020874163  1.146757086 -0.822859534  0.340410237 -0.196374907
 [51] -0.421661282 -0.699517534  0.215366129 -1.021680866  0.986254195
 [56] -1.679054039 -0.485152677 -0.452163386 -0.650718991  0.177676698
 [61]  2.249119787 -0.172244286  1.165596095 -1.282788463  0.060717128
 [66]  1.212679340 -1.428605264 -1.288989927  1.752652167 -0.728342189
 [71]  0.067981970  0.497003838 -0.106247032 -0.015984760  0.269232326
 [76] -1.280284004  0.990207516 -0.422354154 -0.098685445 -0.146325939
 [81] -0.496432464  1.464682547  1.008597198 -1.264923958  1.332470427
 [86] -0.138207093  0.775906089 -0.879222893  0.595943300  0.362184051
 [91]  0.226318704  0.708214918 -2.023466101 -0.229775256 -0.528319671
 [96] -0.083848510  0.701147005 -0.684199801  1.244563556 -0.534147115
> colMin(tmp)
  [1]  1.021801241 -0.163086385 -1.317217803  0.463046426 -0.073053554
  [6] -0.843677269  0.878608539 -1.201826092  0.363772658  0.904964191
 [11] -0.451324166 -1.092547708 -1.635975911 -1.114303211 -0.289512516
 [16] -1.143306252  0.420793123  0.350810119 -1.376059344  1.562757785
 [21] -0.089763439  0.945570793  1.373893555  0.793174514  0.334278541
 [26] -1.259694265 -0.969595092  0.310891323  1.084185431  0.004457687
 [31]  1.015063054 -0.098262151  0.323067402  0.053521555  0.812007339
 [36] -0.190144014  0.552244416 -1.642558090 -0.375289252  0.792014786
 [41] -0.922830642  0.634551248  0.351040294 -1.219537265  1.226769768
 [46]  1.020874163  1.146757086 -0.822859534  0.340410237 -0.196374907
 [51] -0.421661282 -0.699517534  0.215366129 -1.021680866  0.986254195
 [56] -1.679054039 -0.485152677 -0.452163386 -0.650718991  0.177676698
 [61]  2.249119787 -0.172244286  1.165596095 -1.282788463  0.060717128
 [66]  1.212679340 -1.428605264 -1.288989927  1.752652167 -0.728342189
 [71]  0.067981970  0.497003838 -0.106247032 -0.015984760  0.269232326
 [76] -1.280284004  0.990207516 -0.422354154 -0.098685445 -0.146325939
 [81] -0.496432464  1.464682547  1.008597198 -1.264923958  1.332470427
 [86] -0.138207093  0.775906089 -0.879222893  0.595943300  0.362184051
 [91]  0.226318704  0.708214918 -2.023466101 -0.229775256 -0.528319671
 [96] -0.083848510  0.701147005 -0.684199801  1.244563556 -0.534147115
> colMedians(tmp)
  [1]  1.021801241 -0.163086385 -1.317217803  0.463046426 -0.073053554
  [6] -0.843677269  0.878608539 -1.201826092  0.363772658  0.904964191
 [11] -0.451324166 -1.092547708 -1.635975911 -1.114303211 -0.289512516
 [16] -1.143306252  0.420793123  0.350810119 -1.376059344  1.562757785
 [21] -0.089763439  0.945570793  1.373893555  0.793174514  0.334278541
 [26] -1.259694265 -0.969595092  0.310891323  1.084185431  0.004457687
 [31]  1.015063054 -0.098262151  0.323067402  0.053521555  0.812007339
 [36] -0.190144014  0.552244416 -1.642558090 -0.375289252  0.792014786
 [41] -0.922830642  0.634551248  0.351040294 -1.219537265  1.226769768
 [46]  1.020874163  1.146757086 -0.822859534  0.340410237 -0.196374907
 [51] -0.421661282 -0.699517534  0.215366129 -1.021680866  0.986254195
 [56] -1.679054039 -0.485152677 -0.452163386 -0.650718991  0.177676698
 [61]  2.249119787 -0.172244286  1.165596095 -1.282788463  0.060717128
 [66]  1.212679340 -1.428605264 -1.288989927  1.752652167 -0.728342189
 [71]  0.067981970  0.497003838 -0.106247032 -0.015984760  0.269232326
 [76] -1.280284004  0.990207516 -0.422354154 -0.098685445 -0.146325939
 [81] -0.496432464  1.464682547  1.008597198 -1.264923958  1.332470427
 [86] -0.138207093  0.775906089 -0.879222893  0.595943300  0.362184051
 [91]  0.226318704  0.708214918 -2.023466101 -0.229775256 -0.528319671
 [96] -0.083848510  0.701147005 -0.684199801  1.244563556 -0.534147115
> colRanges(tmp)
         [,1]       [,2]      [,3]      [,4]        [,5]       [,6]      [,7]
[1,] 1.021801 -0.1630864 -1.317218 0.4630464 -0.07305355 -0.8436773 0.8786085
[2,] 1.021801 -0.1630864 -1.317218 0.4630464 -0.07305355 -0.8436773 0.8786085
          [,8]      [,9]     [,10]      [,11]     [,12]     [,13]     [,14]
[1,] -1.201826 0.3637727 0.9049642 -0.4513242 -1.092548 -1.635976 -1.114303
[2,] -1.201826 0.3637727 0.9049642 -0.4513242 -1.092548 -1.635976 -1.114303
          [,15]     [,16]     [,17]     [,18]     [,19]    [,20]       [,21]
[1,] -0.2895125 -1.143306 0.4207931 0.3508101 -1.376059 1.562758 -0.08976344
[2,] -0.2895125 -1.143306 0.4207931 0.3508101 -1.376059 1.562758 -0.08976344
         [,22]    [,23]     [,24]     [,25]     [,26]      [,27]     [,28]
[1,] 0.9455708 1.373894 0.7931745 0.3342785 -1.259694 -0.9695951 0.3108913
[2,] 0.9455708 1.373894 0.7931745 0.3342785 -1.259694 -0.9695951 0.3108913
        [,29]       [,30]    [,31]       [,32]     [,33]      [,34]     [,35]
[1,] 1.084185 0.004457687 1.015063 -0.09826215 0.3230674 0.05352155 0.8120073
[2,] 1.084185 0.004457687 1.015063 -0.09826215 0.3230674 0.05352155 0.8120073
         [,36]     [,37]     [,38]      [,39]     [,40]      [,41]     [,42]
[1,] -0.190144 0.5522444 -1.642558 -0.3752893 0.7920148 -0.9228306 0.6345512
[2,] -0.190144 0.5522444 -1.642558 -0.3752893 0.7920148 -0.9228306 0.6345512
         [,43]     [,44]   [,45]    [,46]    [,47]      [,48]     [,49]
[1,] 0.3510403 -1.219537 1.22677 1.020874 1.146757 -0.8228595 0.3404102
[2,] 0.3510403 -1.219537 1.22677 1.020874 1.146757 -0.8228595 0.3404102
          [,50]      [,51]      [,52]     [,53]     [,54]     [,55]     [,56]
[1,] -0.1963749 -0.4216613 -0.6995175 0.2153661 -1.021681 0.9862542 -1.679054
[2,] -0.1963749 -0.4216613 -0.6995175 0.2153661 -1.021681 0.9862542 -1.679054
          [,57]      [,58]     [,59]     [,60]   [,61]      [,62]    [,63]
[1,] -0.4851527 -0.4521634 -0.650719 0.1776767 2.24912 -0.1722443 1.165596
[2,] -0.4851527 -0.4521634 -0.650719 0.1776767 2.24912 -0.1722443 1.165596
         [,64]      [,65]    [,66]     [,67]    [,68]    [,69]      [,70]
[1,] -1.282788 0.06071713 1.212679 -1.428605 -1.28899 1.752652 -0.7283422
[2,] -1.282788 0.06071713 1.212679 -1.428605 -1.28899 1.752652 -0.7283422
          [,71]     [,72]     [,73]       [,74]     [,75]     [,76]     [,77]
[1,] 0.06798197 0.4970038 -0.106247 -0.01598476 0.2692323 -1.280284 0.9902075
[2,] 0.06798197 0.4970038 -0.106247 -0.01598476 0.2692323 -1.280284 0.9902075
          [,78]       [,79]      [,80]      [,81]    [,82]    [,83]     [,84]
[1,] -0.4223542 -0.09868545 -0.1463259 -0.4964325 1.464683 1.008597 -1.264924
[2,] -0.4223542 -0.09868545 -0.1463259 -0.4964325 1.464683 1.008597 -1.264924
       [,85]      [,86]     [,87]      [,88]     [,89]     [,90]     [,91]
[1,] 1.33247 -0.1382071 0.7759061 -0.8792229 0.5959433 0.3621841 0.2263187
[2,] 1.33247 -0.1382071 0.7759061 -0.8792229 0.5959433 0.3621841 0.2263187
         [,92]     [,93]      [,94]      [,95]       [,96]    [,97]      [,98]
[1,] 0.7082149 -2.023466 -0.2297753 -0.5283197 -0.08384851 0.701147 -0.6841998
[2,] 0.7082149 -2.023466 -0.2297753 -0.5283197 -0.08384851 0.701147 -0.6841998
        [,99]     [,100]
[1,] 1.244564 -0.5341471
[2,] 1.244564 -0.5341471
> 
> 
> Max(tmp2)
[1] 2.539969
> Min(tmp2)
[1] -2.76195
> mean(tmp2)
[1] 0.05902703
> Sum(tmp2)
[1] 5.902703
> Var(tmp2)
[1] 1.073894
> 
> rowMeans(tmp2)
  [1]  0.75296893 -2.03398108  0.46207968 -0.09397526 -0.85666399  0.73170765
  [7]  1.55881340 -0.41375790  0.19917493  1.38700868 -1.28430311 -1.44434738
 [13]  0.29986599 -1.46642641  0.57472230  0.42389057  0.29659416  0.68199706
 [19]  0.37523097 -1.56556579  0.95140185 -2.62201189  0.13124155 -0.17515170
 [25] -0.46109893  0.10440525 -0.95697768 -0.18762681  1.14246429 -0.34103893
 [31] -0.26856596  1.14671646 -0.41168494  0.49254953 -1.10355595 -0.17391861
 [37]  0.22124297 -0.60570410  1.00148685 -0.52208506 -2.76194989 -0.61600254
 [43] -0.27411594 -0.27835133  0.68887554  1.70971486 -1.30964580  0.16713338
 [49]  0.19448847  0.74828421 -2.13630488  1.11996629 -0.56480067 -0.01028238
 [55]  1.82070303 -0.23391846 -0.46677445  0.80633119  0.69705675 -1.85400729
 [61]  0.91522391  0.59158826  2.53996933  0.69901434 -1.11991638  0.46697360
 [67] -0.73810206  1.09114499 -0.41367299 -0.25102701 -0.85061995  1.41621331
 [73]  0.66520705  0.79860210 -1.25734344 -0.77543001  1.72974454  0.57477175
 [79]  1.11949886  0.44814742 -1.84436509 -1.16294387 -0.73402425  0.34401715
 [85]  0.02984127  0.32732384  1.10707977  0.06960112 -0.08831886  0.49042890
 [91]  2.04016481 -0.48220596  1.20943250  0.22454647  1.67514216  1.82759085
 [97] -0.87899890  0.85814105 -0.04220543 -0.11105432
> rowSums(tmp2)
  [1]  0.75296893 -2.03398108  0.46207968 -0.09397526 -0.85666399  0.73170765
  [7]  1.55881340 -0.41375790  0.19917493  1.38700868 -1.28430311 -1.44434738
 [13]  0.29986599 -1.46642641  0.57472230  0.42389057  0.29659416  0.68199706
 [19]  0.37523097 -1.56556579  0.95140185 -2.62201189  0.13124155 -0.17515170
 [25] -0.46109893  0.10440525 -0.95697768 -0.18762681  1.14246429 -0.34103893
 [31] -0.26856596  1.14671646 -0.41168494  0.49254953 -1.10355595 -0.17391861
 [37]  0.22124297 -0.60570410  1.00148685 -0.52208506 -2.76194989 -0.61600254
 [43] -0.27411594 -0.27835133  0.68887554  1.70971486 -1.30964580  0.16713338
 [49]  0.19448847  0.74828421 -2.13630488  1.11996629 -0.56480067 -0.01028238
 [55]  1.82070303 -0.23391846 -0.46677445  0.80633119  0.69705675 -1.85400729
 [61]  0.91522391  0.59158826  2.53996933  0.69901434 -1.11991638  0.46697360
 [67] -0.73810206  1.09114499 -0.41367299 -0.25102701 -0.85061995  1.41621331
 [73]  0.66520705  0.79860210 -1.25734344 -0.77543001  1.72974454  0.57477175
 [79]  1.11949886  0.44814742 -1.84436509 -1.16294387 -0.73402425  0.34401715
 [85]  0.02984127  0.32732384  1.10707977  0.06960112 -0.08831886  0.49042890
 [91]  2.04016481 -0.48220596  1.20943250  0.22454647  1.67514216  1.82759085
 [97] -0.87899890  0.85814105 -0.04220543 -0.11105432
> 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.75296893 -2.03398108  0.46207968 -0.09397526 -0.85666399  0.73170765
  [7]  1.55881340 -0.41375790  0.19917493  1.38700868 -1.28430311 -1.44434738
 [13]  0.29986599 -1.46642641  0.57472230  0.42389057  0.29659416  0.68199706
 [19]  0.37523097 -1.56556579  0.95140185 -2.62201189  0.13124155 -0.17515170
 [25] -0.46109893  0.10440525 -0.95697768 -0.18762681  1.14246429 -0.34103893
 [31] -0.26856596  1.14671646 -0.41168494  0.49254953 -1.10355595 -0.17391861
 [37]  0.22124297 -0.60570410  1.00148685 -0.52208506 -2.76194989 -0.61600254
 [43] -0.27411594 -0.27835133  0.68887554  1.70971486 -1.30964580  0.16713338
 [49]  0.19448847  0.74828421 -2.13630488  1.11996629 -0.56480067 -0.01028238
 [55]  1.82070303 -0.23391846 -0.46677445  0.80633119  0.69705675 -1.85400729
 [61]  0.91522391  0.59158826  2.53996933  0.69901434 -1.11991638  0.46697360
 [67] -0.73810206  1.09114499 -0.41367299 -0.25102701 -0.85061995  1.41621331
 [73]  0.66520705  0.79860210 -1.25734344 -0.77543001  1.72974454  0.57477175
 [79]  1.11949886  0.44814742 -1.84436509 -1.16294387 -0.73402425  0.34401715
 [85]  0.02984127  0.32732384  1.10707977  0.06960112 -0.08831886  0.49042890
 [91]  2.04016481 -0.48220596  1.20943250  0.22454647  1.67514216  1.82759085
 [97] -0.87899890  0.85814105 -0.04220543 -0.11105432
> rowMin(tmp2)
  [1]  0.75296893 -2.03398108  0.46207968 -0.09397526 -0.85666399  0.73170765
  [7]  1.55881340 -0.41375790  0.19917493  1.38700868 -1.28430311 -1.44434738
 [13]  0.29986599 -1.46642641  0.57472230  0.42389057  0.29659416  0.68199706
 [19]  0.37523097 -1.56556579  0.95140185 -2.62201189  0.13124155 -0.17515170
 [25] -0.46109893  0.10440525 -0.95697768 -0.18762681  1.14246429 -0.34103893
 [31] -0.26856596  1.14671646 -0.41168494  0.49254953 -1.10355595 -0.17391861
 [37]  0.22124297 -0.60570410  1.00148685 -0.52208506 -2.76194989 -0.61600254
 [43] -0.27411594 -0.27835133  0.68887554  1.70971486 -1.30964580  0.16713338
 [49]  0.19448847  0.74828421 -2.13630488  1.11996629 -0.56480067 -0.01028238
 [55]  1.82070303 -0.23391846 -0.46677445  0.80633119  0.69705675 -1.85400729
 [61]  0.91522391  0.59158826  2.53996933  0.69901434 -1.11991638  0.46697360
 [67] -0.73810206  1.09114499 -0.41367299 -0.25102701 -0.85061995  1.41621331
 [73]  0.66520705  0.79860210 -1.25734344 -0.77543001  1.72974454  0.57477175
 [79]  1.11949886  0.44814742 -1.84436509 -1.16294387 -0.73402425  0.34401715
 [85]  0.02984127  0.32732384  1.10707977  0.06960112 -0.08831886  0.49042890
 [91]  2.04016481 -0.48220596  1.20943250  0.22454647  1.67514216  1.82759085
 [97] -0.87899890  0.85814105 -0.04220543 -0.11105432
> 
> colMeans(tmp2)
[1] 0.05902703
> colSums(tmp2)
[1] 5.902703
> colVars(tmp2)
[1] 1.073894
> colSd(tmp2)
[1] 1.036288
> colMax(tmp2)
[1] 2.539969
> colMin(tmp2)
[1] -2.76195
> colMedians(tmp2)
[1] 0.1491875
> colRanges(tmp2)
          [,1]
[1,] -2.761950
[2,]  2.539969
> 
> 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]  4.35660858 -2.92316209  1.70027696  2.03663647 -2.71617783  1.23317060
 [7] -3.95166960 -6.42431827  1.29049632 -0.07236246
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.52885595
[2,]  0.02408839
[3,]  0.22961437
[4,]  1.02759894
[5,]  1.40331747
> 
> rowApply(tmp,sum)
 [1]  2.8385144 -0.7766782 -1.7383133  2.4944997 -3.2508607 -3.3020051
 [7]  2.4734311 -2.9429539  0.4676848 -1.7338201
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    8    5    5    4   10    8   10    9     7
 [2,]    4    2    7    4    9    1    7    7    1     8
 [3,]    9    1    4    9    5    3   10    9    5     4
 [4,]    7    7    9    7    7    8    4    2    8     9
 [5,]    6    6    1    8    1    9    9    6    6     2
 [6,]    8    4    6    6    3    5    5    8    2    10
 [7,]    1    5    8    3    6    6    6    1    4     3
 [8,]    2    3    3   10   10    2    1    3    7     1
 [9,]    3    9    2    2    8    7    2    4   10     6
[10,]   10   10   10    1    2    4    3    5    3     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.0142703943 -5.3112110256 -4.5886593624 -4.3727115028  0.1982276115
 [6]  1.1773948344  4.8358194791  2.3948018706  1.4501143908  1.8098382796
[11] -0.8280201301  0.0008574999  4.6421519633  3.8334593511  1.3985629134
[16] -1.7340682559 -0.0920756345 -2.4610614434  1.0144973307 -1.5905356781
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.76608967
[2,] -0.36310433
[3,]  0.04806591
[4,]  0.35420695
[5,]  0.71265074
> 
> rowApply(tmp,sum)
[1] -2.599458  4.258239  4.348680  2.786903 -7.031254
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6    9   13   12   10
[2,]    1    4    9    8    1
[3,]    3    1    3   15    4
[4,]    2    2   12    2    6
[5,]   17   11   10    7    5
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
[1,] -0.76608967 -2.1486436 -1.0742565 -1.3150863  0.5826346  0.49591439
[2,]  0.04806591 -0.5548954 -2.1761464 -1.6687574  0.2130858  0.05336026
[3,]  0.71265074  0.1995501 -1.0231739  0.5688047  0.4292533  0.82992088
[4,]  0.35420695 -0.2308153  0.4883970 -1.3736415 -0.2558516  0.75584565
[5,] -0.36310433 -2.5764068 -0.8034795 -0.5840310 -0.7708944 -0.95764634
           [,7]        [,8]        [,9]      [,10]       [,11]       [,12]
[1,]  1.9199656  0.31216698 -0.62280076 -0.6244458 -0.78037770 -0.24862766
[2,] -0.6846512  0.37530472  1.51884114  0.9854674 -0.01528119  1.58963475
[3,]  1.1934397  1.26033772  0.47582265 -0.2055044  0.88940240 -0.25517848
[4,]  2.1553733  0.46511479  0.09596788  1.0330514 -1.48350013 -0.07488571
[5,]  0.2516920 -0.01812234 -0.01771652  0.6212697  0.56173648 -1.01008540
           [,13]      [,14]      [,15]       [,16]       [,17]      [,18]
[1,]  2.42135603  1.2970895 -0.1860500 -0.88101214 -0.21536403 -0.1202248
[2,]  0.51549258  1.3984575 -0.4214976  0.83004948 -0.18598840 -0.1226735
[3,]  0.07055924  1.0635918  2.2951146 -1.11375949 -0.69707730 -2.2966781
[4,]  1.77506400  0.4449711 -0.6643470 -0.54337171  0.96694249  0.3048048
[5,] -0.14031988 -0.3706506  0.3753428 -0.02597439  0.03941161 -0.2262898
           [,19]      [,20]
[1,]  0.06918676 -0.7147924
[2,]  1.14171379  1.4186572
[3,]  0.82523219 -0.8736279
[4,] -0.45001908 -0.9764040
[5,] -0.57161634 -0.4443686
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
            col1      col2       col3     col4       col5      col6      col7
row1 -0.08164674 -1.417194 -0.6013201 1.638889 0.02992594 0.7822593 -0.520068
          col8       col9      col10     col11       col12     col13     col14
row1 0.8114794 -0.7439814 -0.6308779 -0.419355 0.009484528 -1.268943 0.8425789
        col15      col16      col17   col18      col19     col20
row1 1.346417 -0.2340535 -0.7661275 0.68311 0.08764006 -1.448372
> tmp[,"col10"]
          col10
row1 -0.6308779
row2  0.2763218
row3 -0.4199067
row4 -1.7427435
row5 -0.1710194
> tmp[c("row1","row5"),]
            col1        col2       col3      col4       col5        col6
row1 -0.08164674 -1.41719411 -0.6013201 1.6388888 0.02992594  0.78225930
row5 -1.65888666  0.06336773 -2.2160365 0.4829097 1.40246881 -0.08367231
           col7       col8       col9      col10       col11       col12
row1 -0.5200680  0.8114794 -0.7439814 -0.6308779 -0.41935496 0.009484528
row5  0.0653734 -0.6083957 -0.2369542 -0.1710194  0.07631862 0.711090736
          col13     col14     col15      col16      col17      col18      col19
row1 -1.2689430 0.8425789  1.346417 -0.2340535 -0.7661275  0.6831100 0.08764006
row5  0.4663435 0.2868693 -1.371779  0.4656263 -0.8926064 -0.6233106 0.15042359
          col20
row1 -1.4483721
row5 -0.5799216
> tmp[,c("col6","col20")]
            col6      col20
row1  0.78225930 -1.4483721
row2 -1.03292383  1.3732839
row3  0.70771793  0.9796866
row4 -0.67351007 -0.5640490
row5 -0.08367231 -0.5799216
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1  0.78225930 -1.4483721
row5 -0.08367231 -0.5799216
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6    col7     col8
row1 48.91792 52.01964 50.68241 51.87052 50.19543 106.2072 48.7281 52.17584
         col9   col10   col11    col12    col13    col14    col15   col16
row1 50.63558 49.4647 50.9358 49.78613 49.85458 49.93439 51.30892 50.0685
        col17    col18    col19    col20
row1 49.00998 48.89644 48.61758 105.2518
> tmp[,"col10"]
        col10
row1 49.46470
row2 30.32556
row3 29.68587
row4 30.08476
row5 49.31202
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.91792 52.01964 50.68241 51.87052 50.19543 106.2072 48.72810 52.17584
row5 49.67975 48.95243 50.94544 50.39669 51.14505 103.2809 50.09883 47.80505
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.63558 49.46470 50.93580 49.78613 49.85458 49.93439 51.30892 50.06850
row5 50.20575 49.31202 50.49046 49.51380 51.97148 48.75846 49.69293 51.62918
        col17    col18    col19    col20
row1 49.00998 48.89644 48.61758 105.2518
row5 51.73869 49.73483 49.38007 105.2411
> tmp[,c("col6","col20")]
          col6     col20
row1 106.20721 105.25176
row2  76.65774  76.87178
row3  76.28919  72.88362
row4  75.59311  74.95859
row5 103.28091 105.24109
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.2072 105.2518
row5 103.2809 105.2411
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.2072 105.2518
row5 103.2809 105.2411
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.4323381
[2,]  1.3615770
[3,]  1.1696617
[4,] -0.7948713
[5,] -1.1582024
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.44973045  1.5650838
[2,] -1.61772127 -0.6069068
[3,] -0.04580122 -0.2979606
[4,] -1.07742353 -0.3280684
[5,]  1.42768687 -0.1588986
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,]  0.41468396 -0.12882103
[2,] -1.32457492  0.08884426
[3,]  0.37649615 -1.06724361
[4,]  0.76388017  0.79444474
[5,]  0.01888498 -0.70971691
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.414684
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  0.414684
[2,] -1.324575
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]       [,4]       [,5]       [,6]
row3 -0.1663148  0.388619 -0.6957765 -0.4884566  0.9066775  0.5066132
row1 -0.5462497 -1.863052  0.6399334 -0.4197213 -1.3626032 -1.4655099
            [,7]        [,8]     [,9]      [,10]      [,11]       [,12]
row3 -0.43318276 -0.07634688 1.708349  0.5730272  2.2160928  0.08767247
row1  0.03033954 -0.56102866 0.742592 -1.0071631 -0.2537613 -0.85308526
         [,13]     [,14]     [,15]      [,16]        [,17]      [,18]
row3 0.2529465 2.9144067 1.4904435 0.05857074 -0.856092318 -0.1667542
row1 0.7315474 0.8470926 0.5958841 1.52217405  0.006792673  0.9045166
          [,19]     [,20]
row3  0.8498144 0.5519042
row1 -1.0677188 1.6249524
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]     [,2]       [,3]      [,4]       [,5]      [,6]      [,7]
row2 1.803481 1.330851 -0.9821014 -1.587503 -0.3934669 0.4814204 0.2039982
            [,8]      [,9]     [,10]
row2 -0.02128232 0.3718304 0.1310363
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]        [,2]       [,3]      [,4]      [,5]      [,6]      [,7]
row5 0.9497005 -0.05435146 -0.3521871 -1.507718 0.1147303 0.2986123 0.4801523
          [,8]      [,9]      [,10]     [,11]      [,12]      [,13]       [,14]
row5 0.5661751 -0.109713 0.09771985 -2.795822 -0.6554266 -0.5929438 -0.08663974
          [,15]      [,16]     [,17]     [,18]      [,19]     [,20]
row5 -0.9736642 0.05155287 -1.831533 -1.115067 -0.6186452 0.9487163
> 
> 
> 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: 0x57b30f949810>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc515f7b8a"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc1b7bbedb"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc36353150"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc6cdb239d"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc43552fb3"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc57302139"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc715f3de" 
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc44204880"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc77ff396b"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc11911864"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc5c829f28"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc27cbd9e3"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc7192810e"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc7571ffe" 
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e91fc439c61b5"
> 
> 
> ### 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: 0x57b30e4c70b0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x57b30e4c70b0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x57b30e4c70b0>
> rowMedians(tmp)
  [1]  0.533428212 -0.272778441 -0.153411041 -0.477057112  0.199167264
  [6]  0.285753070 -0.078075695 -0.095579553 -0.544227771 -0.429116818
 [11] -0.054538102 -0.169610569 -0.218996545 -0.126999011  0.118746173
 [16]  0.425283152 -0.070080923  0.426571455  0.080240002 -0.108846511
 [21] -0.060543485 -0.418827904 -0.242339282  0.283505859  0.457993648
 [26]  0.156886294  0.267314240  0.118713256  0.262364623 -0.292746188
 [31] -0.036691249  0.300235276 -0.089934065 -0.088248590 -0.080961320
 [36]  0.358034547 -0.193083828  0.160267375 -0.686798522 -0.434855418
 [41] -0.361570582  0.647164464 -0.621191967  0.107534521 -0.019153330
 [46] -0.207707272  0.055474256  0.532600377  0.299904510  0.006872559
 [51]  0.277747001 -0.390271381 -0.177084327 -0.777991609  0.151913511
 [56]  0.153060883  0.251952190  0.031142196  0.027087632 -0.338996517
 [61]  0.383118019  0.125123137 -0.115456672  0.224811297 -0.352179046
 [66]  0.411123885 -0.363481358 -0.073319568  0.059190995 -0.078016070
 [71]  0.609158702  0.128655052 -0.254879467  0.212279211  0.423880026
 [76]  0.015705079  0.561260649 -0.175157376  0.068529217 -0.307526963
 [81]  0.132574016 -0.562989948 -0.121057054  0.071847218 -0.379861950
 [86] -0.478814369  0.055650471  0.115245019  0.050967596 -0.096028814
 [91] -0.421425645  0.103050283  0.013454399 -0.161071078  0.133348628
 [96]  0.880074299 -0.149911885 -0.126996339  0.099766754  0.586261083
[101]  0.380669906  0.139437345  0.250690592 -0.223526560  0.260467403
[106]  0.816407100 -0.299577567 -0.273673253 -0.176197822 -0.150408053
[111] -0.128019444  0.297872533  0.146850277  0.113496214  0.279495519
[116] -0.538912837  0.325026139 -0.354564467  0.109950450  0.103900353
[121]  0.100192110 -0.300645466  0.050675987 -0.073401999  0.007147719
[126]  0.280578977 -0.091733596 -0.502162004  0.188775155 -0.542116735
[131] -0.260693254 -0.445595276  0.087042416 -0.179210004 -0.137466774
[136] -0.236531162  0.300460271  0.005624457 -0.112921590 -0.225775452
[141]  0.009570958 -0.030131072 -0.217610527 -0.180020749  0.761456852
[146]  0.738806205  0.062404221 -0.093436383 -0.163302985 -0.163433152
[151] -0.140310788  0.149994885  0.428545318 -0.075503139  0.098707299
[156] -0.759277746 -0.314486699 -0.075637614 -0.021134228 -0.332397493
[161]  0.111358049  0.127539084 -0.449818073  0.111426785  0.244515629
[166]  0.294771266 -0.247462843  0.719307622 -0.240274830 -0.151448025
[171] -0.095191363  0.771040866 -0.019762572  0.002926229 -0.094305324
[176]  0.079062028 -0.284254396 -0.127599627 -0.324537535  0.333270571
[181]  0.148744394  0.398178598  0.297091336 -0.387275975 -0.199020877
[186] -0.272384864 -0.097921180 -0.066402371 -0.400760218 -0.333273513
[191] -0.073527738  0.238832333 -0.233839694  0.044500056 -0.404564984
[196]  0.076825943  0.254464898 -0.267963105  0.649407004 -0.133273557
[201]  0.014895389  0.361656549  0.068335270  0.422220482 -0.080206521
[206] -0.123333573 -0.436961925 -0.460710326 -0.672293838 -0.292629744
[211] -0.070711235  0.214123865 -0.122096665  0.566955174 -0.404118215
[216] -0.089940736  0.481366710  0.401939411 -0.066569355  0.097724195
[221]  0.578692035  0.330695643  0.078641577  0.348742530 -0.101176480
[226]  0.330838608  0.164182940  0.241370694 -0.471887172 -0.350382494
> 
> proc.time()
   user  system elapsed 
  1.298   1.574   2.862 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x6038e89e80f0>
> .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: 0x6038e89e80f0>
> .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: 0x6038e89e80f0>
> .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: 0x6038e89e80f0>
> 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: 0x6038e9836690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6038e9836690>
> .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: 0x6038e9836690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6038e9836690>
> .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: 0x6038e9836690>
> 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: 0x6038eb270010>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6038eb270010>
> .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: 0x6038eb270010>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6038eb270010>
> .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: 0x6038eb270010>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6038eb270010>
> .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: 0x6038eb270010>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6038eb270010>
> .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: 0x6038eb270010>
> 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: 0x6038eb2c0070>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6038eb2c0070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6038eb2c0070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6038eb2c0070>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1e935920882ff9" "BufferedMatrixFile1e935975440d9e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1e935920882ff9" "BufferedMatrixFile1e935975440d9e"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6038e8f7a7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6038e8f7a7e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6038e8f7a7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6038e8f7a7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6038e8f7a7e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6038e8f7a7e0>
> .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: 0x6038eaf163b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6038eaf163b0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6038eaf163b0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6038eaf163b0>
> 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: 0x6038e90dc520>
> .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: 0x6038e90dc520>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.240   0.061   0.287 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.250   0.037   0.276 

Example timings