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

This page was generated on 2026-03-10 11:57 -0400 (Tue, 10 Mar 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4892
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-03-09 13:45 -0400 (Mon, 09 Mar 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 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 nebbiolo2

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.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-03-09 21:38:34 -0400 (Mon, 09 Mar 2026)
EndedAt: 2026-03-09 21:38:57 -0400 (Mon, 09 Mar 2026)
EllapsedTime: 23.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.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) 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 ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-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.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.242   0.042   0.273 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478284 25.6    1046725   56   639600 34.2
Vcells 884773  6.8    8388608   64  2081613 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] "Mon Mar  9 21:38:49 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] "Mon Mar  9 21:38:49 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: 0x5aef3bcdb370>
> 
> 
> 
> 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] "Mon Mar  9 21:38:49 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] "Mon Mar  9 21:38:49 2026"
> 
> ColMode(tmp2)
<pointer: 0x5aef3bcdb370>
> 
> 
> 
> ### 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,] 98.22110737 -1.9149679 -0.05832153  0.4285245
[2,]  0.07926818 -0.5003453  0.68842331 -0.9549370
[3,]  1.48102075 -0.1811639 -0.73697356 -1.4080678
[4,]  0.18659887  0.8138020  1.00959470  1.8672584
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]      [,4]
[1,] 98.22110737 1.9149679 0.05832153 0.4285245
[2,]  0.07926818 0.5003453 0.68842331 0.9549370
[3,]  1.48102075 0.1811639 0.73697356 1.4080678
[4,]  0.18659887 0.8138020 1.00959470 1.8672584
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9106563 1.3838236 0.2414985 0.6546179
[2,] 0.2815460 0.7073509 0.8297128 0.9772088
[3,] 1.2169720 0.4256335 0.8584716 1.1866203
[4,] 0.4319709 0.9021098 1.0047859 1.3664766
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 222.32767 40.75320 27.47331 31.97470
[2,]  27.89473 32.57385 33.98555 35.72702
[3,]  38.65074 29.43750 34.32169 38.27427
[4,]  29.50631 34.83490 36.05745 40.53202
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5aef3ccd79b0>
> exp(tmp5)
<pointer: 0x5aef3ccd79b0>
> log(tmp5,2)
<pointer: 0x5aef3ccd79b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 462.7459
> Min(tmp5)
[1] 54.72652
> mean(tmp5)
[1] 72.12568
> Sum(tmp5)
[1] 14425.14
> Var(tmp5)
[1] 829.7378
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.78977 71.56511 71.26697 69.14130 69.92852 71.30067 70.11509 69.28926
 [9] 70.01842 70.84173
> rowSums(tmp5)
 [1] 1755.795 1431.302 1425.339 1382.826 1398.570 1426.013 1402.302 1385.785
 [9] 1400.368 1416.835
> rowVars(tmp5)
 [1] 7829.47582   48.80134   71.86684   76.07350   63.33295   73.95212
 [7]   59.22784   55.40634   61.64609   56.93803
> rowSd(tmp5)
 [1] 88.484325  6.985795  8.477431  8.722012  7.958200  8.599542  7.695963
 [8]  7.443543  7.851502  7.545729
> rowMax(tmp5)
 [1] 462.74592  86.05649  88.98442  84.36210  84.33299  89.91855  83.50729
 [8]  83.58508  88.12567  83.07588
> rowMin(tmp5)
 [1] 57.18209 58.05922 55.78044 55.17402 55.27680 56.35699 57.20280 60.38856
 [9] 57.71470 54.72652
> 
> colMeans(tmp5)
 [1] 105.65435  76.05845  69.96754  72.33948  70.50452  73.55266  66.48320
 [8]  66.02648  69.27553  66.05156  70.79239  70.62935  68.03010  68.38915
[15]  72.79869  68.79155  70.03187  71.87898  70.31256  74.94526
> colSums(tmp5)
 [1] 1056.5435  760.5845  699.6754  723.3948  705.0452  735.5266  664.8320
 [8]  660.2648  692.7553  660.5156  707.9239  706.2935  680.3010  683.8915
[15]  727.9869  687.9155  700.3187  718.7898  703.1256  749.4526
> colVars(tmp5)
 [1] 15810.79544    94.73976    64.71737    87.34103    65.74817    34.93901
 [7]    35.65252    27.67661    40.11903    47.28444    87.33786    28.33053
[13]    63.83572    31.08510    48.92399    37.79492   117.60934    19.09567
[19]    92.75791    38.34570
> colSd(tmp5)
 [1] 125.740986   9.733435   8.044710   9.345642   8.108524   5.910923
 [7]   5.970973   5.260857   6.333958   6.876368   9.345472   5.322643
[13]   7.989726   5.575401   6.994569   6.147757  10.844784   4.369859
[19]   9.631091   6.192390
> colMax(tmp5)
 [1] 462.74592  89.91855  88.12567  84.36210  83.58508  82.30413  74.79331
 [8]  76.15408  78.98609  79.61315  86.05649  78.27303  81.10892  79.85938
[15]  81.09242  76.68330  88.98442  77.22570  84.33299  82.68575
> colMin(tmp5)
 [1] 54.72652 61.27030 57.18209 57.71470 61.02053 65.15629 55.78044 56.35699
 [9] 60.38856 58.12578 55.27680 61.56087 57.86293 61.75487 63.28246 58.98988
[17] 57.20280 65.25750 55.17402 65.82448
> 
> 
> ### 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] 87.78977 71.56511 71.26697 69.14130 69.92852 71.30067 70.11509 69.28926
 [9]       NA 70.84173
> rowSums(tmp5)
 [1] 1755.795 1431.302 1425.339 1382.826 1398.570 1426.013 1402.302 1385.785
 [9]       NA 1416.835
> rowVars(tmp5)
 [1] 7829.47582   48.80134   71.86684   76.07350   63.33295   73.95212
 [7]   59.22784   55.40634   63.27276   56.93803
> rowSd(tmp5)
 [1] 88.484325  6.985795  8.477431  8.722012  7.958200  8.599542  7.695963
 [8]  7.443543  7.954417  7.545729
> rowMax(tmp5)
 [1] 462.74592  86.05649  88.98442  84.36210  84.33299  89.91855  83.50729
 [8]  83.58508        NA  83.07588
> rowMin(tmp5)
 [1] 57.18209 58.05922 55.78044 55.17402 55.27680 56.35699 57.20280 60.38856
 [9]       NA 54.72652
> 
> colMeans(tmp5)
 [1]       NA 76.05845 69.96754 72.33948 70.50452 73.55266 66.48320 66.02648
 [9] 69.27553 66.05156 70.79239 70.62935 68.03010 68.38915 72.79869 68.79155
[17] 70.03187 71.87898 70.31256 74.94526
> colSums(tmp5)
 [1]       NA 760.5845 699.6754 723.3948 705.0452 735.5266 664.8320 660.2648
 [9] 692.7553 660.5156 707.9239 706.2935 680.3010 683.8915 727.9869 687.9155
[17] 700.3187 718.7898 703.1256 749.4526
> colVars(tmp5)
 [1]        NA  94.73976  64.71737  87.34103  65.74817  34.93901  35.65252
 [8]  27.67661  40.11903  47.28444  87.33786  28.33053  63.83572  31.08510
[15]  48.92399  37.79492 117.60934  19.09567  92.75791  38.34570
> colSd(tmp5)
 [1]        NA  9.733435  8.044710  9.345642  8.108524  5.910923  5.970973
 [8]  5.260857  6.333958  6.876368  9.345472  5.322643  7.989726  5.575401
[15]  6.994569  6.147757 10.844784  4.369859  9.631091  6.192390
> colMax(tmp5)
 [1]       NA 89.91855 88.12567 84.36210 83.58508 82.30413 74.79331 76.15408
 [9] 78.98609 79.61315 86.05649 78.27303 81.10892 79.85938 81.09242 76.68330
[17] 88.98442 77.22570 84.33299 82.68575
> colMin(tmp5)
 [1]       NA 61.27030 57.18209 57.71470 61.02053 65.15629 55.78044 56.35699
 [9] 60.38856 58.12578 55.27680 61.56087 57.86293 61.75487 63.28246 58.98988
[17] 57.20280 65.25750 55.17402 65.82448
> 
> Max(tmp5,na.rm=TRUE)
[1] 462.7459
> Min(tmp5,na.rm=TRUE)
[1] 54.72652
> mean(tmp5,na.rm=TRUE)
[1] 72.16414
> Sum(tmp5,na.rm=TRUE)
[1] 14360.66
> Var(tmp5,na.rm=TRUE)
[1] 833.6312
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.78977 71.56511 71.26697 69.14130 69.92852 71.30067 70.11509 69.28926
 [9] 70.31027 70.84173
> rowSums(tmp5,na.rm=TRUE)
 [1] 1755.795 1431.302 1425.339 1382.826 1398.570 1426.013 1402.302 1385.785
 [9] 1335.895 1416.835
> rowVars(tmp5,na.rm=TRUE)
 [1] 7829.47582   48.80134   71.86684   76.07350   63.33295   73.95212
 [7]   59.22784   55.40634   63.27276   56.93803
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.484325  6.985795  8.477431  8.722012  7.958200  8.599542  7.695963
 [8]  7.443543  7.954417  7.545729
> rowMax(tmp5,na.rm=TRUE)
 [1] 462.74592  86.05649  88.98442  84.36210  84.33299  89.91855  83.50729
 [8]  83.58508  88.12567  83.07588
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.18209 58.05922 55.78044 55.17402 55.27680 56.35699 57.20280 60.38856
 [9] 57.71470 54.72652
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.23002  76.05845  69.96754  72.33948  70.50452  73.55266  66.48320
 [8]  66.02648  69.27553  66.05156  70.79239  70.62935  68.03010  68.38915
[15]  72.79869  68.79155  70.03187  71.87898  70.31256  74.94526
> colSums(tmp5,na.rm=TRUE)
 [1] 992.0702 760.5845 699.6754 723.3948 705.0452 735.5266 664.8320 660.2648
 [9] 692.7553 660.5156 707.9239 706.2935 680.3010 683.8915 727.9869 687.9155
[17] 700.3187 718.7898 703.1256 749.4526
> colVars(tmp5,na.rm=TRUE)
 [1] 17551.60675    94.73976    64.71737    87.34103    65.74817    34.93901
 [7]    35.65252    27.67661    40.11903    47.28444    87.33786    28.33053
[13]    63.83572    31.08510    48.92399    37.79492   117.60934    19.09567
[19]    92.75791    38.34570
> colSd(tmp5,na.rm=TRUE)
 [1] 132.482477   9.733435   8.044710   9.345642   8.108524   5.910923
 [7]   5.970973   5.260857   6.333958   6.876368   9.345472   5.322643
[13]   7.989726   5.575401   6.994569   6.147757  10.844784   4.369859
[19]   9.631091   6.192390
> colMax(tmp5,na.rm=TRUE)
 [1] 462.74592  89.91855  88.12567  84.36210  83.58508  82.30413  74.79331
 [8]  76.15408  78.98609  79.61315  86.05649  78.27303  81.10892  79.85938
[15]  81.09242  76.68330  88.98442  77.22570  84.33299  82.68575
> colMin(tmp5,na.rm=TRUE)
 [1] 54.72652 61.27030 57.18209 57.71470 61.02053 65.15629 55.78044 56.35699
 [9] 60.38856 58.12578 55.27680 61.56087 57.86293 61.75487 63.28246 58.98988
[17] 57.20280 65.25750 55.17402 65.82448
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.78977 71.56511 71.26697 69.14130 69.92852 71.30067 70.11509 69.28926
 [9]      NaN 70.84173
> rowSums(tmp5,na.rm=TRUE)
 [1] 1755.795 1431.302 1425.339 1382.826 1398.570 1426.013 1402.302 1385.785
 [9]    0.000 1416.835
> rowVars(tmp5,na.rm=TRUE)
 [1] 7829.47582   48.80134   71.86684   76.07350   63.33295   73.95212
 [7]   59.22784   55.40634         NA   56.93803
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.484325  6.985795  8.477431  8.722012  7.958200  8.599542  7.695963
 [8]  7.443543        NA  7.545729
> rowMax(tmp5,na.rm=TRUE)
 [1] 462.74592  86.05649  88.98442  84.36210  84.33299  89.91855  83.50729
 [8]  83.58508        NA  83.07588
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.18209 58.05922 55.78044 55.17402 55.27680 56.35699 57.20280 60.38856
 [9]       NA 54.72652
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 77.25199 67.94997 73.96445 70.04201 74.48559 66.44829 65.89371
 [9] 70.12398 66.50701 71.32906 70.82612 68.22861 68.58475 71.87717 68.79816
[17] 69.63274 71.60287 68.97994 74.44002
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 695.2679 611.5498 665.6801 630.3781 670.3703 598.0346 593.0434
 [9] 631.1159 598.5631 641.9615 637.4351 614.0574 617.2627 646.8945 619.1834
[17] 626.6947 644.4259 620.8195 669.9602
> colVars(tmp5,na.rm=TRUE)
 [1]        NA  90.55620  27.01293  68.55252  71.56021  29.51484  40.09538
 [8]  30.93788  37.03526  50.86141  95.01487  31.43627  71.37190  34.54032
[15]  45.48589  42.51879 130.51832  20.62499  84.37414  40.26719
> colSd(tmp5,na.rm=TRUE)
 [1]        NA  9.516102  5.197397  8.279645  8.459327  5.432756  6.332091
 [8]  5.562183  6.085660  7.131719  9.747557  5.606806  8.448189  5.877102
[15]  6.744323  6.520644 11.424462  4.541475  9.185540  6.345644
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 89.91855 75.04887 84.36210 83.58508 82.30413 74.79331 76.15408
 [9] 78.98609 79.61315 86.05649 78.27303 81.10892 79.85938 80.79106 76.68330
[17] 88.98442 77.22570 84.33299 82.68575
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 61.27030 57.18209 57.92026 61.02053 65.97324 55.78044 56.35699
 [9] 60.38856 58.12578 55.27680 61.56087 57.86293 61.75487 63.28246 58.98988
[17] 57.20280 65.25750 55.17402 65.82448
> 
> 
> 
> 
> 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] 256.7429 296.8014 268.2935 235.9566 172.7987 272.2720 197.9200 260.0316
 [9] 141.7865 262.0545
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 256.7429 296.8014 268.2935 235.9566 172.7987 272.2720 197.9200 260.0316
 [9] 141.7865 262.0545
> 
> 
> 
> 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]  0.000000e+00 -5.684342e-14 -1.136868e-13  8.526513e-14  5.684342e-14
 [6] -2.273737e-13 -2.842171e-14  5.684342e-14 -8.526513e-14 -1.705303e-13
[11]  7.105427e-15  0.000000e+00  1.705303e-13  3.126388e-13  5.684342e-14
[16]  0.000000e+00 -4.263256e-14 -2.842171e-14  5.684342e-14  1.421085e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   1 
7   20 
4   16 
8   9 
3   13 
8   2 
5   11 
3   13 
2   19 
4   10 
8   10 
3   17 
3   20 
7   14 
2   3 
6   9 
8   19 
10   6 
2   11 
6   17 
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.016529
> Min(tmp)
[1] -2.750415
> mean(tmp)
[1] -0.171371
> Sum(tmp)
[1] -17.1371
> Var(tmp)
[1] 1.048102
> 
> rowMeans(tmp)
[1] -0.171371
> rowSums(tmp)
[1] -17.1371
> rowVars(tmp)
[1] 1.048102
> rowSd(tmp)
[1] 1.023769
> rowMax(tmp)
[1] 2.016529
> rowMin(tmp)
[1] -2.750415
> 
> colMeans(tmp)
  [1]  0.711758876 -1.862569164 -0.813809986 -1.025319265 -1.211476512
  [6]  1.652293745  1.388379458  0.036393732 -2.750414954 -0.953282711
 [11] -0.939311389 -0.407663427 -0.500098938 -0.851797012 -1.903147483
 [16] -1.166073110  1.488424803  1.046889929 -1.650434938  0.846219438
 [21] -0.077156966 -0.716417670 -0.992120026 -1.243554644 -1.797694016
 [26] -1.384651518 -1.071928891 -0.026805245 -0.545476444  1.170016674
 [31] -0.782736986 -1.235283223  0.378187191 -0.027390773 -0.436046831
 [36] -0.170812006 -0.653620732 -0.811185043 -0.200967219 -1.183277652
 [41]  2.016528625  1.405491746 -1.045951627  1.179576806  1.138505535
 [46]  1.428845117  0.156914676 -0.937869613  0.813368550 -0.558136610
 [51] -0.379394222 -1.643206738 -0.670746062  0.101022397 -1.288556521
 [56]  0.024532855  0.377802988 -0.652266889 -0.546934608 -0.661361959
 [61] -0.568716528 -0.173928954  0.663018895 -0.011691878  0.946739361
 [66] -0.170437091  0.462383957 -2.126135621  0.921281022 -0.699233972
 [71] -1.097567229 -0.462743172  1.023346768  0.461993879  0.955511507
 [76] -0.408914968  0.422040299 -2.228873826  0.297318669  0.678226991
 [81]  1.147180627  1.149531507  1.962350326  0.771356735  0.921564953
 [86]  1.488129303  0.413729499 -1.392334848 -0.375285888 -0.003589549
 [91] -0.754076375 -0.476509372 -0.666602114  0.228068084  0.066466084
 [96] -0.135874175 -0.475344983 -0.334162577 -1.140125299  2.000609941
> colSums(tmp)
  [1]  0.711758876 -1.862569164 -0.813809986 -1.025319265 -1.211476512
  [6]  1.652293745  1.388379458  0.036393732 -2.750414954 -0.953282711
 [11] -0.939311389 -0.407663427 -0.500098938 -0.851797012 -1.903147483
 [16] -1.166073110  1.488424803  1.046889929 -1.650434938  0.846219438
 [21] -0.077156966 -0.716417670 -0.992120026 -1.243554644 -1.797694016
 [26] -1.384651518 -1.071928891 -0.026805245 -0.545476444  1.170016674
 [31] -0.782736986 -1.235283223  0.378187191 -0.027390773 -0.436046831
 [36] -0.170812006 -0.653620732 -0.811185043 -0.200967219 -1.183277652
 [41]  2.016528625  1.405491746 -1.045951627  1.179576806  1.138505535
 [46]  1.428845117  0.156914676 -0.937869613  0.813368550 -0.558136610
 [51] -0.379394222 -1.643206738 -0.670746062  0.101022397 -1.288556521
 [56]  0.024532855  0.377802988 -0.652266889 -0.546934608 -0.661361959
 [61] -0.568716528 -0.173928954  0.663018895 -0.011691878  0.946739361
 [66] -0.170437091  0.462383957 -2.126135621  0.921281022 -0.699233972
 [71] -1.097567229 -0.462743172  1.023346768  0.461993879  0.955511507
 [76] -0.408914968  0.422040299 -2.228873826  0.297318669  0.678226991
 [81]  1.147180627  1.149531507  1.962350326  0.771356735  0.921564953
 [86]  1.488129303  0.413729499 -1.392334848 -0.375285888 -0.003589549
 [91] -0.754076375 -0.476509372 -0.666602114  0.228068084  0.066466084
 [96] -0.135874175 -0.475344983 -0.334162577 -1.140125299  2.000609941
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.711758876 -1.862569164 -0.813809986 -1.025319265 -1.211476512
  [6]  1.652293745  1.388379458  0.036393732 -2.750414954 -0.953282711
 [11] -0.939311389 -0.407663427 -0.500098938 -0.851797012 -1.903147483
 [16] -1.166073110  1.488424803  1.046889929 -1.650434938  0.846219438
 [21] -0.077156966 -0.716417670 -0.992120026 -1.243554644 -1.797694016
 [26] -1.384651518 -1.071928891 -0.026805245 -0.545476444  1.170016674
 [31] -0.782736986 -1.235283223  0.378187191 -0.027390773 -0.436046831
 [36] -0.170812006 -0.653620732 -0.811185043 -0.200967219 -1.183277652
 [41]  2.016528625  1.405491746 -1.045951627  1.179576806  1.138505535
 [46]  1.428845117  0.156914676 -0.937869613  0.813368550 -0.558136610
 [51] -0.379394222 -1.643206738 -0.670746062  0.101022397 -1.288556521
 [56]  0.024532855  0.377802988 -0.652266889 -0.546934608 -0.661361959
 [61] -0.568716528 -0.173928954  0.663018895 -0.011691878  0.946739361
 [66] -0.170437091  0.462383957 -2.126135621  0.921281022 -0.699233972
 [71] -1.097567229 -0.462743172  1.023346768  0.461993879  0.955511507
 [76] -0.408914968  0.422040299 -2.228873826  0.297318669  0.678226991
 [81]  1.147180627  1.149531507  1.962350326  0.771356735  0.921564953
 [86]  1.488129303  0.413729499 -1.392334848 -0.375285888 -0.003589549
 [91] -0.754076375 -0.476509372 -0.666602114  0.228068084  0.066466084
 [96] -0.135874175 -0.475344983 -0.334162577 -1.140125299  2.000609941
> colMin(tmp)
  [1]  0.711758876 -1.862569164 -0.813809986 -1.025319265 -1.211476512
  [6]  1.652293745  1.388379458  0.036393732 -2.750414954 -0.953282711
 [11] -0.939311389 -0.407663427 -0.500098938 -0.851797012 -1.903147483
 [16] -1.166073110  1.488424803  1.046889929 -1.650434938  0.846219438
 [21] -0.077156966 -0.716417670 -0.992120026 -1.243554644 -1.797694016
 [26] -1.384651518 -1.071928891 -0.026805245 -0.545476444  1.170016674
 [31] -0.782736986 -1.235283223  0.378187191 -0.027390773 -0.436046831
 [36] -0.170812006 -0.653620732 -0.811185043 -0.200967219 -1.183277652
 [41]  2.016528625  1.405491746 -1.045951627  1.179576806  1.138505535
 [46]  1.428845117  0.156914676 -0.937869613  0.813368550 -0.558136610
 [51] -0.379394222 -1.643206738 -0.670746062  0.101022397 -1.288556521
 [56]  0.024532855  0.377802988 -0.652266889 -0.546934608 -0.661361959
 [61] -0.568716528 -0.173928954  0.663018895 -0.011691878  0.946739361
 [66] -0.170437091  0.462383957 -2.126135621  0.921281022 -0.699233972
 [71] -1.097567229 -0.462743172  1.023346768  0.461993879  0.955511507
 [76] -0.408914968  0.422040299 -2.228873826  0.297318669  0.678226991
 [81]  1.147180627  1.149531507  1.962350326  0.771356735  0.921564953
 [86]  1.488129303  0.413729499 -1.392334848 -0.375285888 -0.003589549
 [91] -0.754076375 -0.476509372 -0.666602114  0.228068084  0.066466084
 [96] -0.135874175 -0.475344983 -0.334162577 -1.140125299  2.000609941
> colMedians(tmp)
  [1]  0.711758876 -1.862569164 -0.813809986 -1.025319265 -1.211476512
  [6]  1.652293745  1.388379458  0.036393732 -2.750414954 -0.953282711
 [11] -0.939311389 -0.407663427 -0.500098938 -0.851797012 -1.903147483
 [16] -1.166073110  1.488424803  1.046889929 -1.650434938  0.846219438
 [21] -0.077156966 -0.716417670 -0.992120026 -1.243554644 -1.797694016
 [26] -1.384651518 -1.071928891 -0.026805245 -0.545476444  1.170016674
 [31] -0.782736986 -1.235283223  0.378187191 -0.027390773 -0.436046831
 [36] -0.170812006 -0.653620732 -0.811185043 -0.200967219 -1.183277652
 [41]  2.016528625  1.405491746 -1.045951627  1.179576806  1.138505535
 [46]  1.428845117  0.156914676 -0.937869613  0.813368550 -0.558136610
 [51] -0.379394222 -1.643206738 -0.670746062  0.101022397 -1.288556521
 [56]  0.024532855  0.377802988 -0.652266889 -0.546934608 -0.661361959
 [61] -0.568716528 -0.173928954  0.663018895 -0.011691878  0.946739361
 [66] -0.170437091  0.462383957 -2.126135621  0.921281022 -0.699233972
 [71] -1.097567229 -0.462743172  1.023346768  0.461993879  0.955511507
 [76] -0.408914968  0.422040299 -2.228873826  0.297318669  0.678226991
 [81]  1.147180627  1.149531507  1.962350326  0.771356735  0.921564953
 [86]  1.488129303  0.413729499 -1.392334848 -0.375285888 -0.003589549
 [91] -0.754076375 -0.476509372 -0.666602114  0.228068084  0.066466084
 [96] -0.135874175 -0.475344983 -0.334162577 -1.140125299  2.000609941
> colRanges(tmp)
          [,1]      [,2]     [,3]      [,4]      [,5]     [,6]     [,7]
[1,] 0.7117589 -1.862569 -0.81381 -1.025319 -1.211477 1.652294 1.388379
[2,] 0.7117589 -1.862569 -0.81381 -1.025319 -1.211477 1.652294 1.388379
           [,8]      [,9]      [,10]      [,11]      [,12]      [,13]     [,14]
[1,] 0.03639373 -2.750415 -0.9532827 -0.9393114 -0.4076634 -0.5000989 -0.851797
[2,] 0.03639373 -2.750415 -0.9532827 -0.9393114 -0.4076634 -0.5000989 -0.851797
         [,15]     [,16]    [,17]   [,18]     [,19]     [,20]       [,21]
[1,] -1.903147 -1.166073 1.488425 1.04689 -1.650435 0.8462194 -0.07715697
[2,] -1.903147 -1.166073 1.488425 1.04689 -1.650435 0.8462194 -0.07715697
          [,22]    [,23]     [,24]     [,25]     [,26]     [,27]       [,28]
[1,] -0.7164177 -0.99212 -1.243555 -1.797694 -1.384652 -1.071929 -0.02680525
[2,] -0.7164177 -0.99212 -1.243555 -1.797694 -1.384652 -1.071929 -0.02680525
          [,29]    [,30]     [,31]     [,32]     [,33]       [,34]      [,35]
[1,] -0.5454764 1.170017 -0.782737 -1.235283 0.3781872 -0.02739077 -0.4360468
[2,] -0.5454764 1.170017 -0.782737 -1.235283 0.3781872 -0.02739077 -0.4360468
         [,36]      [,37]     [,38]      [,39]     [,40]    [,41]    [,42]
[1,] -0.170812 -0.6536207 -0.811185 -0.2009672 -1.183278 2.016529 1.405492
[2,] -0.170812 -0.6536207 -0.811185 -0.2009672 -1.183278 2.016529 1.405492
         [,43]    [,44]    [,45]    [,46]     [,47]      [,48]     [,49]
[1,] -1.045952 1.179577 1.138506 1.428845 0.1569147 -0.9378696 0.8133686
[2,] -1.045952 1.179577 1.138506 1.428845 0.1569147 -0.9378696 0.8133686
          [,50]      [,51]     [,52]      [,53]     [,54]     [,55]      [,56]
[1,] -0.5581366 -0.3793942 -1.643207 -0.6707461 0.1010224 -1.288557 0.02453285
[2,] -0.5581366 -0.3793942 -1.643207 -0.6707461 0.1010224 -1.288557 0.02453285
        [,57]      [,58]      [,59]     [,60]      [,61]     [,62]     [,63]
[1,] 0.377803 -0.6522669 -0.5469346 -0.661362 -0.5687165 -0.173929 0.6630189
[2,] 0.377803 -0.6522669 -0.5469346 -0.661362 -0.5687165 -0.173929 0.6630189
           [,64]     [,65]      [,66]    [,67]     [,68]    [,69]     [,70]
[1,] -0.01169188 0.9467394 -0.1704371 0.462384 -2.126136 0.921281 -0.699234
[2,] -0.01169188 0.9467394 -0.1704371 0.462384 -2.126136 0.921281 -0.699234
         [,71]      [,72]    [,73]     [,74]     [,75]     [,76]     [,77]
[1,] -1.097567 -0.4627432 1.023347 0.4619939 0.9555115 -0.408915 0.4220403
[2,] -1.097567 -0.4627432 1.023347 0.4619939 0.9555115 -0.408915 0.4220403
         [,78]     [,79]    [,80]    [,81]    [,82]   [,83]     [,84]    [,85]
[1,] -2.228874 0.2973187 0.678227 1.147181 1.149532 1.96235 0.7713567 0.921565
[2,] -2.228874 0.2973187 0.678227 1.147181 1.149532 1.96235 0.7713567 0.921565
        [,86]     [,87]     [,88]      [,89]        [,90]      [,91]      [,92]
[1,] 1.488129 0.4137295 -1.392335 -0.3752859 -0.003589549 -0.7540764 -0.4765094
[2,] 1.488129 0.4137295 -1.392335 -0.3752859 -0.003589549 -0.7540764 -0.4765094
          [,93]     [,94]      [,95]      [,96]     [,97]      [,98]     [,99]
[1,] -0.6666021 0.2280681 0.06646608 -0.1358742 -0.475345 -0.3341626 -1.140125
[2,] -0.6666021 0.2280681 0.06646608 -0.1358742 -0.475345 -0.3341626 -1.140125
      [,100]
[1,] 2.00061
[2,] 2.00061
> 
> 
> Max(tmp2)
[1] 2.620722
> Min(tmp2)
[1] -3.235421
> mean(tmp2)
[1] -0.0527729
> Sum(tmp2)
[1] -5.27729
> Var(tmp2)
[1] 1.018301
> 
> rowMeans(tmp2)
  [1] -0.18725762  0.71424588  1.43379064 -1.80399742  0.17410964  0.64321266
  [7]  2.55400466 -0.03581114 -0.38989479 -0.20118025 -0.30098484 -0.49609332
 [13]  2.08454493  0.40250149  1.35808109 -0.15168406 -0.42142965 -1.37254723
 [19] -1.08712279  1.97060188 -0.54432228  0.86517307  0.26174998 -0.03492619
 [25] -0.10019069 -1.56380098 -0.92216384 -0.77179229 -0.92170985  0.39963585
 [31]  1.56903168 -3.23542062  0.04281253 -0.20146548  0.61669317  1.38826461
 [37] -1.26824866  0.70905889  0.57636023 -0.94892930 -0.16171460 -0.02171098
 [43]  1.26864855 -0.22549075 -0.79341195  0.86585513  0.17053759 -0.80838987
 [49] -0.08148003  1.83332195 -0.58929401  0.28290401 -0.86120041 -0.18386458
 [55]  0.28083459  0.15373840 -0.32373535 -0.47704543 -0.83678673 -0.45773081
 [61] -0.61877330 -0.16046404 -0.49064875  0.56257125 -0.84873554 -0.63978579
 [67] -0.79499944 -0.62788528 -0.45925373 -1.11026048 -0.13433505 -1.14752301
 [73] -1.36354787  0.40920886  1.24926833 -0.17053626  0.30950270  1.41823142
 [79] -1.61604211 -0.07762195  0.10956184 -0.54627778 -1.94807376 -1.21957305
 [85]  0.44850069  1.00774150 -0.12733278 -0.70184673  0.99130688 -0.61632558
 [91] -1.33999796  2.62072215  1.00534771  1.28203500  0.80973647  1.33896623
 [97] -0.31613435 -1.11805432  0.69873807 -1.18158405
> rowSums(tmp2)
  [1] -0.18725762  0.71424588  1.43379064 -1.80399742  0.17410964  0.64321266
  [7]  2.55400466 -0.03581114 -0.38989479 -0.20118025 -0.30098484 -0.49609332
 [13]  2.08454493  0.40250149  1.35808109 -0.15168406 -0.42142965 -1.37254723
 [19] -1.08712279  1.97060188 -0.54432228  0.86517307  0.26174998 -0.03492619
 [25] -0.10019069 -1.56380098 -0.92216384 -0.77179229 -0.92170985  0.39963585
 [31]  1.56903168 -3.23542062  0.04281253 -0.20146548  0.61669317  1.38826461
 [37] -1.26824866  0.70905889  0.57636023 -0.94892930 -0.16171460 -0.02171098
 [43]  1.26864855 -0.22549075 -0.79341195  0.86585513  0.17053759 -0.80838987
 [49] -0.08148003  1.83332195 -0.58929401  0.28290401 -0.86120041 -0.18386458
 [55]  0.28083459  0.15373840 -0.32373535 -0.47704543 -0.83678673 -0.45773081
 [61] -0.61877330 -0.16046404 -0.49064875  0.56257125 -0.84873554 -0.63978579
 [67] -0.79499944 -0.62788528 -0.45925373 -1.11026048 -0.13433505 -1.14752301
 [73] -1.36354787  0.40920886  1.24926833 -0.17053626  0.30950270  1.41823142
 [79] -1.61604211 -0.07762195  0.10956184 -0.54627778 -1.94807376 -1.21957305
 [85]  0.44850069  1.00774150 -0.12733278 -0.70184673  0.99130688 -0.61632558
 [91] -1.33999796  2.62072215  1.00534771  1.28203500  0.80973647  1.33896623
 [97] -0.31613435 -1.11805432  0.69873807 -1.18158405
> 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.18725762  0.71424588  1.43379064 -1.80399742  0.17410964  0.64321266
  [7]  2.55400466 -0.03581114 -0.38989479 -0.20118025 -0.30098484 -0.49609332
 [13]  2.08454493  0.40250149  1.35808109 -0.15168406 -0.42142965 -1.37254723
 [19] -1.08712279  1.97060188 -0.54432228  0.86517307  0.26174998 -0.03492619
 [25] -0.10019069 -1.56380098 -0.92216384 -0.77179229 -0.92170985  0.39963585
 [31]  1.56903168 -3.23542062  0.04281253 -0.20146548  0.61669317  1.38826461
 [37] -1.26824866  0.70905889  0.57636023 -0.94892930 -0.16171460 -0.02171098
 [43]  1.26864855 -0.22549075 -0.79341195  0.86585513  0.17053759 -0.80838987
 [49] -0.08148003  1.83332195 -0.58929401  0.28290401 -0.86120041 -0.18386458
 [55]  0.28083459  0.15373840 -0.32373535 -0.47704543 -0.83678673 -0.45773081
 [61] -0.61877330 -0.16046404 -0.49064875  0.56257125 -0.84873554 -0.63978579
 [67] -0.79499944 -0.62788528 -0.45925373 -1.11026048 -0.13433505 -1.14752301
 [73] -1.36354787  0.40920886  1.24926833 -0.17053626  0.30950270  1.41823142
 [79] -1.61604211 -0.07762195  0.10956184 -0.54627778 -1.94807376 -1.21957305
 [85]  0.44850069  1.00774150 -0.12733278 -0.70184673  0.99130688 -0.61632558
 [91] -1.33999796  2.62072215  1.00534771  1.28203500  0.80973647  1.33896623
 [97] -0.31613435 -1.11805432  0.69873807 -1.18158405
> rowMin(tmp2)
  [1] -0.18725762  0.71424588  1.43379064 -1.80399742  0.17410964  0.64321266
  [7]  2.55400466 -0.03581114 -0.38989479 -0.20118025 -0.30098484 -0.49609332
 [13]  2.08454493  0.40250149  1.35808109 -0.15168406 -0.42142965 -1.37254723
 [19] -1.08712279  1.97060188 -0.54432228  0.86517307  0.26174998 -0.03492619
 [25] -0.10019069 -1.56380098 -0.92216384 -0.77179229 -0.92170985  0.39963585
 [31]  1.56903168 -3.23542062  0.04281253 -0.20146548  0.61669317  1.38826461
 [37] -1.26824866  0.70905889  0.57636023 -0.94892930 -0.16171460 -0.02171098
 [43]  1.26864855 -0.22549075 -0.79341195  0.86585513  0.17053759 -0.80838987
 [49] -0.08148003  1.83332195 -0.58929401  0.28290401 -0.86120041 -0.18386458
 [55]  0.28083459  0.15373840 -0.32373535 -0.47704543 -0.83678673 -0.45773081
 [61] -0.61877330 -0.16046404 -0.49064875  0.56257125 -0.84873554 -0.63978579
 [67] -0.79499944 -0.62788528 -0.45925373 -1.11026048 -0.13433505 -1.14752301
 [73] -1.36354787  0.40920886  1.24926833 -0.17053626  0.30950270  1.41823142
 [79] -1.61604211 -0.07762195  0.10956184 -0.54627778 -1.94807376 -1.21957305
 [85]  0.44850069  1.00774150 -0.12733278 -0.70184673  0.99130688 -0.61632558
 [91] -1.33999796  2.62072215  1.00534771  1.28203500  0.80973647  1.33896623
 [97] -0.31613435 -1.11805432  0.69873807 -1.18158405
> 
> colMeans(tmp2)
[1] -0.0527729
> colSums(tmp2)
[1] -5.27729
> colVars(tmp2)
[1] 1.018301
> colSd(tmp2)
[1] 1.009109
> colMax(tmp2)
[1] 2.620722
> colMin(tmp2)
[1] -3.235421
> colMedians(tmp2)
[1] -0.1610893
> colRanges(tmp2)
          [,1]
[1,] -3.235421
[2,]  2.620722
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.5507476  1.2471592 -0.4205458  0.6261358  0.1582927 -2.1298190
 [7]  7.0954881  6.8973947  1.4094054 -0.9490152
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7494610
[2,] -0.8124358
[3,] -0.2040212
[4,]  0.9068536
[5,]  1.8467733
> 
> rowApply(tmp,sum)
 [1]  4.9816664  1.7374658  0.1105302  2.0820778 -3.3317853  1.9373991
 [7]  5.6009613  2.0518463  1.0823147 -2.8687279
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    9   10    2    5    5    5    2    2     3
 [2,]    4    1    4   10    2    6    3    8    7    10
 [3,]   10    2    3    1    4   10    6    1    8     8
 [4,]    1    4    6    3    8    7    1    6   10     2
 [5,]    2    8    9    8    3    4    9    4    3     6
 [6,]    3   10    5    9    1    2    2    3    4     5
 [7,]    7    6    7    5   10    9    7    9    5     4
 [8,]    8    7    8    7    9    8   10    7    1     7
 [9,]    6    5    2    6    7    3    4   10    6     1
[10,]    5    3    1    4    6    1    8    5    9     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.3148794  1.2222062 -1.4541081  1.8744364  1.3458314 -1.9262544
 [7] -1.6415750  0.9183181 -0.9664926  5.6091619 -1.0846588 -1.6631060
[13] -0.8349795  0.2551190 -5.3400876 -1.1349051  0.9714678 -3.2165156
[19]  3.0988485  1.0523719
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7056149
[2,] -0.5434664
[3,] -0.1388868
[4,]  0.2718165
[5,]  2.4310310
> 
> rowApply(tmp,sum)
[1]  0.4800517 -3.6270016 -4.8058671  2.4714879  3.8812870
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    5    9   12   20
[2,]    9   18    1   18   14
[3,]    3   20    3    7    6
[4,]   14    8   18   15   11
[5,]    8    3   15   16   19
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]        [,6]
[1,] -0.1388868  0.1464680 -1.0951842  0.4884577 -0.06035084  1.29106690
[2,] -0.7056149  0.9032570  1.5421490 -0.4629106 -1.57730577  0.09067701
[3,] -0.5434664 -1.6672002 -1.3720836  0.9534350  0.26321450 -1.11485473
[4,]  0.2718165  0.8851289 -0.1353755  0.6732112  0.68206179 -0.85835725
[5,]  2.4310310  0.9545524 -0.3936137  0.2222430  2.03821169 -1.33478633
            [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.29880697 -0.9702166  1.2990209 -0.2779829 -1.6066790  0.2938779
[2,] -0.27192727  0.3293522 -1.6655339  1.2241365  0.5320470 -0.4415329
[3,] -1.24428480 -0.4014317  0.2430195  2.4463959 -0.1798569  0.5742155
[4,] -0.44555553  0.6203307 -0.5419317  0.7106141  0.6056515 -1.9526412
[5,]  0.02138558  1.3402835 -0.3010673  1.5059983 -0.4358213 -0.1370253
           [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.34378461  1.0054898 -3.1404840  0.6409329  0.3788022 -0.5441798
[2,] -0.63753983  0.2753353 -1.0636517 -2.2624861  0.5706748 -0.2254104
[3,] -1.53699378 -0.2205108  1.0332002 -0.1464330 -1.1350164 -0.6986624
[4,]  0.02611541  1.3766891 -0.0849923 -0.1291206  1.2907732 -0.2539156
[5,]  0.96965412 -2.1818845 -2.0841599  0.7622018 -0.1337661 -1.4943473
           [,19]      [,20]
[1,]  1.47434389  0.6529641
[2,]  0.75324332 -0.5339603
[3,] -0.54443665  0.4858835
[4,]  0.01401789 -0.2830327
[5,]  1.40168000  0.7305172
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1       col2       col3       col4     col5      col6     col7
row1 1.081134 -0.3951479 -0.7709329 -0.7089189 1.527666 0.6357634 1.590288
          col8      col9     col10     col11       col12      col13      col14
row1 0.7107364 -1.608126 0.2178797 0.5353757 -0.08772736 0.07904562 0.09313487
         col15     col16     col17    col18    col19     col20
row1 0.8339015 0.1464165 0.1949277 1.015507 1.694206 0.2356181
> tmp[,"col10"]
          col10
row1  0.2178797
row2 -0.5145524
row3  0.3799733
row4  0.1799346
row5  0.7859811
> tmp[c("row1","row5"),]
          col1       col2       col3       col4        col5      col6
row1 1.0811340 -0.3951479 -0.7709329 -0.7089189  1.52766645 0.6357634
row5 0.4219136 -0.1261184 -0.5851247  1.3945235 -0.02460644 1.1900390
            col7       col8       col9     col10     col11       col12
row1  1.59028769  0.7107364 -1.6081262 0.2178797 0.5353757 -0.08772736
row5 -0.05000874 -1.4421453 -0.9675678 0.7859811 1.4385815  2.40011612
           col13       col14     col15      col16     col17      col18
row1  0.07904562  0.09313487 0.8339015  0.1464165 0.1949277  1.0155071
row5 -0.43023460 -0.10088594 0.4878983 -0.5888859 0.6957515 -0.8300402
          col19      col20
row1  1.6942060  0.2356181
row5 -0.4722267 -1.3104342
> tmp[,c("col6","col20")]
             col6      col20
row1  0.635763375  0.2356181
row2 -1.038702646  0.8141632
row3  0.476288193 -0.9883678
row4  0.004489484 -1.4451312
row5  1.190038974 -1.3104342
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.6357634  0.2356181
row5 1.1900390 -1.3104342
> 
> 
> 
> 
> 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 49.42828 49.92875 49.00095 50.31696 50.2424 106.2762 50.80973 52.00928
         col9    col10    col11    col12    col13    col14   col15    col16
row1 48.63045 48.16169 50.28504 49.73888 50.35784 48.78582 49.9238 50.16382
        col17   col18    col19   col20
row1 49.63529 50.2441 50.12106 106.336
> tmp[,"col10"]
        col10
row1 48.16169
row2 30.48755
row3 29.57103
row4 29.37160
row5 52.04352
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.42828 49.92875 49.00095 50.31696 50.24240 106.2762 50.80973 52.00928
row5 51.25591 49.79960 50.93617 50.81993 49.40308 106.0460 49.96299 50.69961
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.63045 48.16169 50.28504 49.73888 50.35784 48.78582 49.92380 50.16382
row5 49.72817 52.04352 50.35476 51.07437 50.02902 50.99989 49.40757 50.82506
        col17    col18    col19    col20
row1 49.63529 50.24410 50.12106 106.3360
row5 48.27622 50.69954 52.08088 102.4596
> tmp[,c("col6","col20")]
          col6     col20
row1 106.27620 106.33596
row2  74.38791  74.03763
row3  75.82864  75.27360
row4  74.32242  76.21344
row5 106.04602 102.45955
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.2762 106.3360
row5 106.0460 102.4596
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.2762 106.3360
row5 106.0460 102.4596
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.7719483
[2,]  0.6579161
[3,] -1.2233667
[4,] -0.5604953
[5,] -2.0833011
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.4575637  1.60578108
[2,] -1.6070183  0.20117493
[3,] -0.8320410 -1.37944856
[4,]  0.1521760 -0.03075977
[5,]  0.4686328  1.48176470
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.0814072 -0.7588366
[2,] -0.7627694  0.8194866
[3,] -0.6090692  1.4234174
[4,]  0.9026209 -0.5312550
[5,]  0.4643673 -0.6059023
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.081407
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.0814072
[2,] -0.7627694
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]     [,3]      [,4]      [,5]      [,6]       [,7]
row3 0.03631474 -0.29551391 1.048651 2.0119336  1.274337 1.7176407 -0.2305576
row1 0.05425821 -0.01853519 1.248120 0.3557836 -1.330494 0.4145598  0.7041220
           [,8]       [,9]      [,10]     [,11]      [,12]      [,13]
row3 -0.5254105 -0.7673688 -0.4991033 0.1702845 -0.7026773 -0.3167756
row1  0.5314525  0.4025150 -1.6914050 0.7328815  0.4573662  1.1497131
          [,14]     [,15]      [,16]      [,17]       [,18]      [,19]
row3  2.2574324 0.3803508 -0.2149191 -0.5651158  0.02849308 -1.7075195
row1 -0.4300953 0.9585583  0.6350043  0.6873958 -0.43607655 -0.6684958
         [,20]
row3 -2.381538
row1  1.490508
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]     [,3]      [,4]      [,5]       [,6]       [,7]
row2 0.5514271 -0.4056577 1.977166 0.7777668 -2.344058 -0.6956169 -0.3927034
          [,8]       [,9]     [,10]
row2 -0.831683 0.05124339 -1.687273
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]       [,2]      [,3]      [,4]        [,5]     [,6]      [,7]
row5 0.829507 -0.5475925 0.2243201 -1.410599 0.004165098 1.759556 0.2456447
           [,8]      [,9]    [,10]      [,11]      [,12]      [,13]      [,14]
row5 -0.6624983 -1.966534 1.440611 -0.2947664 -0.1800752 -0.5133508 -0.5458626
         [,15]     [,16]    [,17]      [,18]      [,19]     [,20]
row5 -0.432524 0.5387888 0.263782 -0.8124978 -0.8123368 -1.234851
> 
> 
> 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: 0x5aef3ad1a920>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a70fd5fa5"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a1f8c8ed5"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a5b371873"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a1611611d"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a3697be9a"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a2bc361fc"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a7e69d8be"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a70bf17c6"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a4ff855dc"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a2a159ca9"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a37fc22b7"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a924c31e" 
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a1218935" 
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a7b65f5b7"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM39057a4e2366e8"
> 
> 
> ### 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: 0x5aef3d18d360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5aef3d18d360>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5aef3d18d360>
> rowMedians(tmp)
  [1]  0.173271695 -0.191499124 -0.113992031  0.028464663 -0.130177723
  [6] -0.048221272  0.488692599  0.159284663  0.382151134  0.044196677
 [11]  0.058711913  0.201236842 -0.042653827 -0.200179314 -0.665945313
 [16]  0.287514409 -0.161467624  0.401000482  0.243633947  0.353542639
 [21]  0.232633981  0.034066356  0.002119725  0.290917902  0.357888886
 [26] -0.433200513  0.516736249 -0.125293305 -0.397942367 -0.416191724
 [31] -0.223043763  0.214340753 -0.053569131  0.453404134  0.431150358
 [36] -0.288838748 -0.235035566  0.252852468 -0.321928619 -0.401572003
 [41]  0.043373196  0.276522825  0.243245833 -0.147672598  0.093564707
 [46] -0.229588109 -0.090874377 -0.114569916  0.422819079 -0.012648863
 [51] -0.190451033 -0.125824592  0.018409282 -0.167900635 -0.385692621
 [56]  0.074022178  0.145776576 -0.474470043  0.009235019  0.046106950
 [61]  0.381352619 -0.368612377 -0.478287036  0.005342979  0.357561421
 [66]  0.222109165 -0.118411420 -0.266947978 -0.044475534  0.298131912
 [71]  0.358337087 -0.186800759 -0.120955811  0.011757906 -0.284778113
 [76] -0.648587282 -0.463228623 -1.058180200  0.046150574 -0.103172813
 [81]  0.126663833  0.085029398  0.073728094 -0.177743629 -0.311018488
 [86]  0.083365325 -0.417141434  0.213871758 -0.413058304  0.007320335
 [91] -0.226920378 -0.361169574  0.057522536 -0.234227761 -0.724079138
 [96] -0.383771413  0.533840026 -0.477278199 -0.201180968  0.149637212
[101] -0.312990297 -0.451885086  0.040294032 -0.493978492 -0.307010611
[106]  1.011803057  0.276165056  0.012193829  0.039066057 -0.323228245
[111] -0.145238001 -0.140728484 -0.092558606  0.168004431 -0.345212360
[116]  0.289646268  0.315457565 -0.177994423 -0.182079107 -0.096683579
[121] -0.354740990  0.192993281  0.253940348 -0.068387430  0.465748200
[126]  0.247243322  0.095674620 -0.184831219 -0.081270810 -0.210456439
[131]  0.605129795  0.040692852 -0.106920483  0.243416025  0.454324789
[136] -0.444852237 -0.339534771 -0.391738624  0.126111665  0.504812713
[141]  0.082045530 -0.128307893 -0.033203488 -0.151633045  0.325690475
[146]  0.078144336  0.024616562  0.102132305 -0.635079613  0.067060046
[151] -0.086179058  0.050833172 -0.489479802  0.067204630  0.204290910
[156] -0.427585179 -0.638630787 -0.286010128  0.030256355 -0.297988252
[161] -0.008227740  0.531382012  0.199656062  0.283338318 -0.066293123
[166]  0.144851729 -0.040230458 -0.347467000  0.194857230  0.115068416
[171]  0.359245002  0.228809336  0.155379249  0.385266371  0.060765451
[176] -0.161654721 -0.124034743 -0.146118455 -0.217077008 -0.712195718
[181] -0.533485530  0.320413340  0.279441513 -0.047662754 -0.448720936
[186] -0.050755506 -0.388990823 -0.151468095 -0.648787309 -0.265995604
[191]  0.123255380 -0.099188421  0.284472472  0.315845769 -0.270089764
[196]  0.341443291  0.088721816  0.273892841 -0.164187836 -0.224949734
[201] -0.606149222  0.056452416 -0.093480029 -0.055674750  0.003854416
[206] -0.438200305  0.418206972 -0.595121791 -0.064353313 -0.031311792
[211]  0.307401860 -0.095008778 -0.212175363  0.131557147  0.625760123
[216] -0.307695396  0.251139389 -0.204328780 -0.244170514  0.073505553
[221]  0.172484594  0.355059231  0.241230610  0.558003391 -0.270953588
[226]  0.221354901 -0.251380520 -0.553370884  0.341775338  0.152450151
> 
> proc.time()
   user  system elapsed 
  1.194   0.653   1.838 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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: 0x6212c6f29370>
> .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: 0x6212c6f29370>
> .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: 0x6212c6f29370>
> .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: 0x6212c6f29370>
> 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: 0x6212c6f111c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6212c6f111c0>
> .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: 0x6212c6f111c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6212c6f111c0>
> .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: 0x6212c6f111c0>
> 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: 0x6212c71f4120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6212c71f4120>
> .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: 0x6212c71f4120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6212c71f4120>
> .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: 0x6212c71f4120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6212c71f4120>
> .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: 0x6212c71f4120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6212c71f4120>
> .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: 0x6212c71f4120>
> 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: 0x6212c5f44390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6212c5f44390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6212c5f44390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6212c5f44390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3906694a03c316" "BufferedMatrixFile3906694a82f856"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3906694a03c316" "BufferedMatrixFile3906694a82f856"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6212c5e3b3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6212c5e3b3d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6212c5e3b3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6212c5e3b3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6212c5e3b3d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6212c5e3b3d0>
> .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: 0x6212c7970fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6212c7970fa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6212c7970fa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6212c7970fa0>
> 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: 0x6212c6148ff0>
> .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: 0x6212c6148ff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.267   0.061   0.311 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.238   0.044   0.271 

Example timings