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

This page was generated on 2026-04-08 11:57 -0400 (Wed, 08 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4897
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-04-07 13:45 -0400 (Tue, 07 Apr 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-04-07 21:37:38 -0400 (Tue, 07 Apr 2026)
EndedAt: 2026-04-07 21:38:02 -0400 (Tue, 07 Apr 2026)
EllapsedTime: 24.0 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.4 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.1) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... 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.1) 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.243   0.045   0.276 

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] "Tue Apr  7 21:37:53 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Apr  7 21:37:53 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: 0x5911248d0370>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Apr  7 21:37:53 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Apr  7 21:37:53 2026"
> 
> ColMode(tmp2)
<pointer: 0x5911248d0370>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]      [,4]
[1,] 99.1937534  0.1596135  1.2422009 0.2094122
[2,]  0.2380192  0.1268732  0.6302830 1.1429957
[3,] -0.5924355 -0.6870356 -0.2868990 1.1211290
[4,]  1.1920842 -0.4328613  0.3191514 0.9973111
> 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,] 99.1937534 0.1596135 1.2422009 0.2094122
[2,]  0.2380192 0.1268732 0.6302830 1.1429957
[3,]  0.5924355 0.6870356 0.2868990 1.1211290
[4,]  1.1920842 0.4328613 0.3191514 0.9973111
> 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.9596061 0.3995165 1.1145407 0.4576157
[2,] 0.4878721 0.3561926 0.7939037 1.0691097
[3,] 0.7696983 0.8288761 0.5356295 1.0588338
[4,] 1.0918261 0.6579219 0.5649349 0.9986546
> 
> 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,] 223.78981 29.15478 37.38761 29.78557
[2,]  30.11674 28.68880 33.56932 36.83409
[3,]  33.28942 33.97580 30.64319 36.70947
[4,]  37.11035 32.01208 30.96850 35.98386
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5911258cc9b0>
> exp(tmp5)
<pointer: 0x5911258cc9b0>
> log(tmp5,2)
<pointer: 0x5911258cc9b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.7892
> Min(tmp5)
[1] 54.98731
> mean(tmp5)
[1] 73.20542
> Sum(tmp5)
[1] 14641.08
> Var(tmp5)
[1] 849.4358
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.39059 71.38911 68.79448 72.53682 71.69307 72.22303 71.11665 69.17238
 [9] 72.37862 70.35948
> rowSums(tmp5)
 [1] 1847.812 1427.782 1375.890 1450.736 1433.861 1444.461 1422.333 1383.448
 [9] 1447.572 1407.190
> rowVars(tmp5)
 [1] 7787.39134   50.92230   43.86160   48.35991   61.54196   90.93094
 [7]  120.32028   56.32599  102.22766   88.59080
> rowSd(tmp5)
 [1] 88.246197  7.135986  6.622809  6.954129  7.844869  9.535771 10.969060
 [8]  7.505064 10.110769  9.412269
> rowMax(tmp5)
 [1] 465.78918  81.82476  82.76272  83.04267  88.35673  85.64555  97.31745
 [8]  86.42570  86.82865  88.57349
> rowMin(tmp5)
 [1] 60.68185 59.18354 56.78903 58.80797 58.80887 57.03094 55.50261 58.01365
 [9] 54.98731 56.91367
> 
> colMeans(tmp5)
 [1] 106.79394  68.67170  70.52705  72.06412  66.80508  74.76427  73.11822
 [8]  66.34071  70.89217  69.59510  73.75262  72.47469  70.14805  69.94532
[15]  77.36388  72.91432  74.86643  72.01428  66.65549  74.40098
> colSums(tmp5)
 [1] 1067.9394  686.7170  705.2705  720.6412  668.0508  747.6427  731.1822
 [8]  663.4071  708.9217  695.9510  737.5262  724.7469  701.4805  699.4532
[15]  773.6388  729.1432  748.6643  720.1428  666.5549  744.0098
> colVars(tmp5)
 [1] 15957.59531    85.03618    87.04053   148.36773    69.64694    87.01834
 [7]   117.68584    34.60196    68.49477    47.54514    40.03437    37.40906
[13]    66.72749    79.34996    56.76588    49.49185    89.48952    44.10595
[19]    58.50106    53.92044
> colSd(tmp5)
 [1] 126.323376   9.221506   9.329552  12.180629   8.345474   9.328362
 [7]  10.848311   5.882343   8.276157   6.895298   6.327272   6.116295
[13]   8.168690   8.907859   7.534314   7.035044   9.459890   6.641231
[19]   7.648598   7.343054
> colMax(tmp5)
 [1] 465.78918  82.42406  88.23674  97.31745  79.06903  86.42570  95.06115
 [8]  77.77272  85.55386  79.22215  85.99725  85.13246  85.52828  83.04267
[15]  88.57349  86.82865  85.64555  82.48284  79.34010  88.35673
> colMin(tmp5)
 [1] 57.11270 55.60942 61.21258 57.03094 54.98731 55.50261 58.67437 58.80797
 [9] 58.06214 59.87610 65.28013 64.20795 61.71448 55.33676 66.50704 63.18096
[17] 56.91367 56.78903 56.61157 64.95550
> 
> 
> ### 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] 92.39059       NA 68.79448 72.53682 71.69307 72.22303 71.11665 69.17238
 [9] 72.37862 70.35948
> rowSums(tmp5)
 [1] 1847.812       NA 1375.890 1450.736 1433.861 1444.461 1422.333 1383.448
 [9] 1447.572 1407.190
> rowVars(tmp5)
 [1] 7787.39134   52.64155   43.86160   48.35991   61.54196   90.93094
 [7]  120.32028   56.32599  102.22766   88.59080
> rowSd(tmp5)
 [1] 88.246197  7.255450  6.622809  6.954129  7.844869  9.535771 10.969060
 [8]  7.505064 10.110769  9.412269
> rowMax(tmp5)
 [1] 465.78918        NA  82.76272  83.04267  88.35673  85.64555  97.31745
 [8]  86.42570  86.82865  88.57349
> rowMin(tmp5)
 [1] 60.68185       NA 56.78903 58.80797 58.80887 57.03094 55.50261 58.01365
 [9] 54.98731 56.91367
> 
> colMeans(tmp5)
 [1] 106.79394  68.67170  70.52705  72.06412  66.80508  74.76427  73.11822
 [8]  66.34071  70.89217        NA  73.75262  72.47469  70.14805  69.94532
[15]  77.36388  72.91432  74.86643  72.01428  66.65549  74.40098
> colSums(tmp5)
 [1] 1067.9394  686.7170  705.2705  720.6412  668.0508  747.6427  731.1822
 [8]  663.4071  708.9217        NA  737.5262  724.7469  701.4805  699.4532
[15]  773.6388  729.1432  748.6643  720.1428  666.5549  744.0098
> colVars(tmp5)
 [1] 15957.59531    85.03618    87.04053   148.36773    69.64694    87.01834
 [7]   117.68584    34.60196    68.49477          NA    40.03437    37.40906
[13]    66.72749    79.34996    56.76588    49.49185    89.48952    44.10595
[19]    58.50106    53.92044
> colSd(tmp5)
 [1] 126.323376   9.221506   9.329552  12.180629   8.345474   9.328362
 [7]  10.848311   5.882343   8.276157         NA   6.327272   6.116295
[13]   8.168690   8.907859   7.534314   7.035044   9.459890   6.641231
[19]   7.648598   7.343054
> colMax(tmp5)
 [1] 465.78918  82.42406  88.23674  97.31745  79.06903  86.42570  95.06115
 [8]  77.77272  85.55386        NA  85.99725  85.13246  85.52828  83.04267
[15]  88.57349  86.82865  85.64555  82.48284  79.34010  88.35673
> colMin(tmp5)
 [1] 57.11270 55.60942 61.21258 57.03094 54.98731 55.50261 58.67437 58.80797
 [9] 58.06214       NA 65.28013 64.20795 61.71448 55.33676 66.50704 63.18096
[17] 56.91367 56.78903 56.61157 64.95550
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.7892
> Min(tmp5,na.rm=TRUE)
[1] 54.98731
> mean(tmp5,na.rm=TRUE)
[1] 73.19266
> Sum(tmp5,na.rm=TRUE)
[1] 14565.34
> Var(tmp5,na.rm=TRUE)
[1] 853.6931
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.39059 71.15983 68.79448 72.53682 71.69307 72.22303 71.11665 69.17238
 [9] 72.37862 70.35948
> rowSums(tmp5,na.rm=TRUE)
 [1] 1847.812 1352.037 1375.890 1450.736 1433.861 1444.461 1422.333 1383.448
 [9] 1447.572 1407.190
> rowVars(tmp5,na.rm=TRUE)
 [1] 7787.39134   52.64155   43.86160   48.35991   61.54196   90.93094
 [7]  120.32028   56.32599  102.22766   88.59080
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.246197  7.255450  6.622809  6.954129  7.844869  9.535771 10.969060
 [8]  7.505064 10.110769  9.412269
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.78918  81.82476  82.76272  83.04267  88.35673  85.64555  97.31745
 [8]  86.42570  86.82865  88.57349
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.68185 59.18354 56.78903 58.80797 58.80887 57.03094 55.50261 58.01365
 [9] 54.98731 56.91367
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 106.79394  68.67170  70.52705  72.06412  66.80508  74.76427  73.11822
 [8]  66.34071  70.89217  68.91174  73.75262  72.47469  70.14805  69.94532
[15]  77.36388  72.91432  74.86643  72.01428  66.65549  74.40098
> colSums(tmp5,na.rm=TRUE)
 [1] 1067.9394  686.7170  705.2705  720.6412  668.0508  747.6427  731.1822
 [8]  663.4071  708.9217  620.2057  737.5262  724.7469  701.4805  699.4532
[15]  773.6388  729.1432  748.6643  720.1428  666.5549  744.0098
> colVars(tmp5,na.rm=TRUE)
 [1] 15957.59531    85.03618    87.04053   148.36773    69.64694    87.01834
 [7]   117.68584    34.60196    68.49477    48.23472    40.03437    37.40906
[13]    66.72749    79.34996    56.76588    49.49185    89.48952    44.10595
[19]    58.50106    53.92044
> colSd(tmp5,na.rm=TRUE)
 [1] 126.323376   9.221506   9.329552  12.180629   8.345474   9.328362
 [7]  10.848311   5.882343   8.276157   6.945122   6.327272   6.116295
[13]   8.168690   8.907859   7.534314   7.035044   9.459890   6.641231
[19]   7.648598   7.343054
> colMax(tmp5,na.rm=TRUE)
 [1] 465.78918  82.42406  88.23674  97.31745  79.06903  86.42570  95.06115
 [8]  77.77272  85.55386  79.22215  85.99725  85.13246  85.52828  83.04267
[15]  88.57349  86.82865  85.64555  82.48284  79.34010  88.35673
> colMin(tmp5,na.rm=TRUE)
 [1] 57.11270 55.60942 61.21258 57.03094 54.98731 55.50261 58.67437 58.80797
 [9] 58.06214 59.87610 65.28013 64.20795 61.71448 55.33676 66.50704 63.18096
[17] 56.91367 56.78903 56.61157 64.95550
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.39059      NaN 68.79448 72.53682 71.69307 72.22303 71.11665 69.17238
 [9] 72.37862 70.35948
> rowSums(tmp5,na.rm=TRUE)
 [1] 1847.812    0.000 1375.890 1450.736 1433.861 1444.461 1422.333 1383.448
 [9] 1447.572 1407.190
> rowVars(tmp5,na.rm=TRUE)
 [1] 7787.39134         NA   43.86160   48.35991   61.54196   90.93094
 [7]  120.32028   56.32599  102.22766   88.59080
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.246197        NA  6.622809  6.954129  7.844869  9.535771 10.969060
 [8]  7.505064 10.110769  9.412269
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.78918        NA  82.76272  83.04267  88.35673  85.64555  97.31745
 [8]  86.42570  86.82865  88.57349
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.68185       NA 56.78903 58.80797 58.80887 57.03094 55.50261 58.01365
 [9] 54.98731 56.91367
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.69504  69.66723  70.60004  71.55287  66.79732  74.04721  72.46686
 [8]  66.20137  72.19313       NaN  73.79496  72.41393  68.85064  68.67189
[15]  78.41842  73.62178  74.70126  72.08748  67.11691  74.33462
> colSums(tmp5,na.rm=TRUE)
 [1] 1005.2554  627.0051  635.4003  643.9759  601.1759  666.4249  652.2017
 [8]  595.8123  649.7382    0.0000  664.1546  651.7254  619.6558  618.0470
[15]  705.7658  662.5961  672.3113  648.7873  604.0522  669.0116
> colVars(tmp5,na.rm=TRUE)
 [1] 17682.06103    84.51616    97.86067   163.97325    78.35213    92.11107
 [7]   127.62346    38.70878    58.01605          NA    45.01851    42.04367
[13]    56.13155    71.02537    51.35112    50.04767   100.36878    49.55892
[19]    63.41845    60.61096
> colSd(tmp5,na.rm=TRUE)
 [1] 132.973911   9.193267   9.892455  12.805204   8.851674   9.597451
 [7]  11.297055   6.221638   7.616827         NA   6.709583   6.484109
[13]   7.492099   8.427655   7.165970   7.074438  10.018422   7.039809
[19]   7.963570   7.785304
> colMax(tmp5,na.rm=TRUE)
 [1] 465.78918  82.42406  88.23674  97.31745  79.06903  86.42570  95.06115
 [8]  77.77272  85.55386      -Inf  85.99725  85.13246  85.52828  83.04267
[15]  88.57349  86.82865  85.64555  82.48284  79.34010  88.35673
> colMin(tmp5,na.rm=TRUE)
 [1] 57.11270 55.60942 61.21258 57.03094 54.98731 55.50261 58.67437 58.80797
 [9] 58.06214      Inf 65.28013 64.20795 61.71448 55.33676 66.50704 63.18096
[17] 56.91367 56.78903 56.61157 64.95550
> 
> 
> 
> 
> 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] 293.01694 348.71899 174.37053 275.76829  98.35385 319.13552 151.51694
 [8] 159.66123 245.18576 245.29879
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 293.01694 348.71899 174.37053 275.76829  98.35385 319.13552 151.51694
 [8] 159.66123 245.18576 245.29879
> 
> 
> 
> 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]  2.273737e-13 -5.684342e-14  7.105427e-14 -5.684342e-14  5.684342e-14
 [6] -1.421085e-14  8.526513e-14 -2.842171e-14 -5.684342e-14  1.989520e-13
[11] -1.421085e-14  5.684342e-14  1.136868e-13 -4.263256e-14 -5.684342e-14
[16]  1.705303e-13 -2.842171e-14  0.000000e+00 -1.136868e-13  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   14 
4   17 
10   10 
5   10 
10   3 
3   19 
10   16 
9   20 
3   12 
6   12 
4   16 
8   10 
9   3 
8   7 
2   7 
3   14 
10   1 
9   6 
7   17 
2   6 
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.567051
> Min(tmp)
[1] -2.430594
> mean(tmp)
[1] 0.106332
> Sum(tmp)
[1] 10.6332
> Var(tmp)
[1] 1.084412
> 
> rowMeans(tmp)
[1] 0.106332
> rowSums(tmp)
[1] 10.6332
> rowVars(tmp)
[1] 1.084412
> rowSd(tmp)
[1] 1.041351
> rowMax(tmp)
[1] 2.567051
> rowMin(tmp)
[1] -2.430594
> 
> colMeans(tmp)
  [1]  0.458674154 -1.132775951 -0.845154340 -0.374856258 -0.047592387
  [6]  1.588737268 -1.248024836 -0.584647787  0.514865401  1.086564821
 [11]  0.377570519  0.286306399 -0.574697834  0.259600644 -1.898575696
 [16] -2.430594202 -0.389360013  0.101292256 -1.237291478  0.768112087
 [21] -1.199651400  0.194394525  1.537795835  1.958486986 -1.240264509
 [26] -0.156362233 -0.555439409 -0.305994716  0.756986828 -1.061270206
 [31]  1.503988169 -0.020979642 -2.003057669 -0.165197722 -0.136834839
 [36]  0.102215905 -0.172050479  1.090108155 -0.349144867 -0.584921720
 [41] -0.776076423 -0.459068345  2.081194615 -1.615106425  0.678312705
 [46]  1.449010318 -0.235378197  1.556121289  0.815387942  0.033842113
 [51]  1.887617718  1.775340248  1.875875754  2.123222210 -0.028784606
 [56] -0.627061118 -0.444964120  1.288749480 -0.690061415 -0.706852632
 [61]  1.071168994 -0.746687316 -0.864674602 -0.875964490 -1.612307305
 [66]  0.432843584 -0.822715551  0.850283399  0.001403197 -1.483994279
 [71]  0.273111368  2.463554015  0.376427678  0.406142366  0.573469545
 [76]  0.194726791  0.520110012 -0.689292119  0.060272688  0.503741445
 [81]  0.640080739  1.002497559  1.208161935 -0.601496549  0.607453244
 [86]  0.625452444 -0.565326189  0.090664057 -1.186631776  1.552545014
 [91] -0.817254202 -0.330499870  0.176259616 -0.487195227  1.291502759
 [96]  2.567050893  0.690168351  0.854761892 -0.194438400 -0.974459425
> colSums(tmp)
  [1]  0.458674154 -1.132775951 -0.845154340 -0.374856258 -0.047592387
  [6]  1.588737268 -1.248024836 -0.584647787  0.514865401  1.086564821
 [11]  0.377570519  0.286306399 -0.574697834  0.259600644 -1.898575696
 [16] -2.430594202 -0.389360013  0.101292256 -1.237291478  0.768112087
 [21] -1.199651400  0.194394525  1.537795835  1.958486986 -1.240264509
 [26] -0.156362233 -0.555439409 -0.305994716  0.756986828 -1.061270206
 [31]  1.503988169 -0.020979642 -2.003057669 -0.165197722 -0.136834839
 [36]  0.102215905 -0.172050479  1.090108155 -0.349144867 -0.584921720
 [41] -0.776076423 -0.459068345  2.081194615 -1.615106425  0.678312705
 [46]  1.449010318 -0.235378197  1.556121289  0.815387942  0.033842113
 [51]  1.887617718  1.775340248  1.875875754  2.123222210 -0.028784606
 [56] -0.627061118 -0.444964120  1.288749480 -0.690061415 -0.706852632
 [61]  1.071168994 -0.746687316 -0.864674602 -0.875964490 -1.612307305
 [66]  0.432843584 -0.822715551  0.850283399  0.001403197 -1.483994279
 [71]  0.273111368  2.463554015  0.376427678  0.406142366  0.573469545
 [76]  0.194726791  0.520110012 -0.689292119  0.060272688  0.503741445
 [81]  0.640080739  1.002497559  1.208161935 -0.601496549  0.607453244
 [86]  0.625452444 -0.565326189  0.090664057 -1.186631776  1.552545014
 [91] -0.817254202 -0.330499870  0.176259616 -0.487195227  1.291502759
 [96]  2.567050893  0.690168351  0.854761892 -0.194438400 -0.974459425
> 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.458674154 -1.132775951 -0.845154340 -0.374856258 -0.047592387
  [6]  1.588737268 -1.248024836 -0.584647787  0.514865401  1.086564821
 [11]  0.377570519  0.286306399 -0.574697834  0.259600644 -1.898575696
 [16] -2.430594202 -0.389360013  0.101292256 -1.237291478  0.768112087
 [21] -1.199651400  0.194394525  1.537795835  1.958486986 -1.240264509
 [26] -0.156362233 -0.555439409 -0.305994716  0.756986828 -1.061270206
 [31]  1.503988169 -0.020979642 -2.003057669 -0.165197722 -0.136834839
 [36]  0.102215905 -0.172050479  1.090108155 -0.349144867 -0.584921720
 [41] -0.776076423 -0.459068345  2.081194615 -1.615106425  0.678312705
 [46]  1.449010318 -0.235378197  1.556121289  0.815387942  0.033842113
 [51]  1.887617718  1.775340248  1.875875754  2.123222210 -0.028784606
 [56] -0.627061118 -0.444964120  1.288749480 -0.690061415 -0.706852632
 [61]  1.071168994 -0.746687316 -0.864674602 -0.875964490 -1.612307305
 [66]  0.432843584 -0.822715551  0.850283399  0.001403197 -1.483994279
 [71]  0.273111368  2.463554015  0.376427678  0.406142366  0.573469545
 [76]  0.194726791  0.520110012 -0.689292119  0.060272688  0.503741445
 [81]  0.640080739  1.002497559  1.208161935 -0.601496549  0.607453244
 [86]  0.625452444 -0.565326189  0.090664057 -1.186631776  1.552545014
 [91] -0.817254202 -0.330499870  0.176259616 -0.487195227  1.291502759
 [96]  2.567050893  0.690168351  0.854761892 -0.194438400 -0.974459425
> colMin(tmp)
  [1]  0.458674154 -1.132775951 -0.845154340 -0.374856258 -0.047592387
  [6]  1.588737268 -1.248024836 -0.584647787  0.514865401  1.086564821
 [11]  0.377570519  0.286306399 -0.574697834  0.259600644 -1.898575696
 [16] -2.430594202 -0.389360013  0.101292256 -1.237291478  0.768112087
 [21] -1.199651400  0.194394525  1.537795835  1.958486986 -1.240264509
 [26] -0.156362233 -0.555439409 -0.305994716  0.756986828 -1.061270206
 [31]  1.503988169 -0.020979642 -2.003057669 -0.165197722 -0.136834839
 [36]  0.102215905 -0.172050479  1.090108155 -0.349144867 -0.584921720
 [41] -0.776076423 -0.459068345  2.081194615 -1.615106425  0.678312705
 [46]  1.449010318 -0.235378197  1.556121289  0.815387942  0.033842113
 [51]  1.887617718  1.775340248  1.875875754  2.123222210 -0.028784606
 [56] -0.627061118 -0.444964120  1.288749480 -0.690061415 -0.706852632
 [61]  1.071168994 -0.746687316 -0.864674602 -0.875964490 -1.612307305
 [66]  0.432843584 -0.822715551  0.850283399  0.001403197 -1.483994279
 [71]  0.273111368  2.463554015  0.376427678  0.406142366  0.573469545
 [76]  0.194726791  0.520110012 -0.689292119  0.060272688  0.503741445
 [81]  0.640080739  1.002497559  1.208161935 -0.601496549  0.607453244
 [86]  0.625452444 -0.565326189  0.090664057 -1.186631776  1.552545014
 [91] -0.817254202 -0.330499870  0.176259616 -0.487195227  1.291502759
 [96]  2.567050893  0.690168351  0.854761892 -0.194438400 -0.974459425
> colMedians(tmp)
  [1]  0.458674154 -1.132775951 -0.845154340 -0.374856258 -0.047592387
  [6]  1.588737268 -1.248024836 -0.584647787  0.514865401  1.086564821
 [11]  0.377570519  0.286306399 -0.574697834  0.259600644 -1.898575696
 [16] -2.430594202 -0.389360013  0.101292256 -1.237291478  0.768112087
 [21] -1.199651400  0.194394525  1.537795835  1.958486986 -1.240264509
 [26] -0.156362233 -0.555439409 -0.305994716  0.756986828 -1.061270206
 [31]  1.503988169 -0.020979642 -2.003057669 -0.165197722 -0.136834839
 [36]  0.102215905 -0.172050479  1.090108155 -0.349144867 -0.584921720
 [41] -0.776076423 -0.459068345  2.081194615 -1.615106425  0.678312705
 [46]  1.449010318 -0.235378197  1.556121289  0.815387942  0.033842113
 [51]  1.887617718  1.775340248  1.875875754  2.123222210 -0.028784606
 [56] -0.627061118 -0.444964120  1.288749480 -0.690061415 -0.706852632
 [61]  1.071168994 -0.746687316 -0.864674602 -0.875964490 -1.612307305
 [66]  0.432843584 -0.822715551  0.850283399  0.001403197 -1.483994279
 [71]  0.273111368  2.463554015  0.376427678  0.406142366  0.573469545
 [76]  0.194726791  0.520110012 -0.689292119  0.060272688  0.503741445
 [81]  0.640080739  1.002497559  1.208161935 -0.601496549  0.607453244
 [86]  0.625452444 -0.565326189  0.090664057 -1.186631776  1.552545014
 [91] -0.817254202 -0.330499870  0.176259616 -0.487195227  1.291502759
 [96]  2.567050893  0.690168351  0.854761892 -0.194438400 -0.974459425
> colRanges(tmp)
          [,1]      [,2]       [,3]       [,4]        [,5]     [,6]      [,7]
[1,] 0.4586742 -1.132776 -0.8451543 -0.3748563 -0.04759239 1.588737 -1.248025
[2,] 0.4586742 -1.132776 -0.8451543 -0.3748563 -0.04759239 1.588737 -1.248025
           [,8]      [,9]    [,10]     [,11]     [,12]      [,13]     [,14]
[1,] -0.5846478 0.5148654 1.086565 0.3775705 0.2863064 -0.5746978 0.2596006
[2,] -0.5846478 0.5148654 1.086565 0.3775705 0.2863064 -0.5746978 0.2596006
         [,15]     [,16]    [,17]     [,18]     [,19]     [,20]     [,21]
[1,] -1.898576 -2.430594 -0.38936 0.1012923 -1.237291 0.7681121 -1.199651
[2,] -1.898576 -2.430594 -0.38936 0.1012923 -1.237291 0.7681121 -1.199651
         [,22]    [,23]    [,24]     [,25]      [,26]      [,27]      [,28]
[1,] 0.1943945 1.537796 1.958487 -1.240265 -0.1563622 -0.5554394 -0.3059947
[2,] 0.1943945 1.537796 1.958487 -1.240265 -0.1563622 -0.5554394 -0.3059947
         [,29]    [,30]    [,31]       [,32]     [,33]      [,34]      [,35]
[1,] 0.7569868 -1.06127 1.503988 -0.02097964 -2.003058 -0.1651977 -0.1368348
[2,] 0.7569868 -1.06127 1.503988 -0.02097964 -2.003058 -0.1651977 -0.1368348
         [,36]      [,37]    [,38]      [,39]      [,40]      [,41]      [,42]
[1,] 0.1022159 -0.1720505 1.090108 -0.3491449 -0.5849217 -0.7760764 -0.4590683
[2,] 0.1022159 -0.1720505 1.090108 -0.3491449 -0.5849217 -0.7760764 -0.4590683
        [,43]     [,44]     [,45]   [,46]      [,47]    [,48]     [,49]
[1,] 2.081195 -1.615106 0.6783127 1.44901 -0.2353782 1.556121 0.8153879
[2,] 2.081195 -1.615106 0.6783127 1.44901 -0.2353782 1.556121 0.8153879
          [,50]    [,51]   [,52]    [,53]    [,54]       [,55]      [,56]
[1,] 0.03384211 1.887618 1.77534 1.875876 2.123222 -0.02878461 -0.6270611
[2,] 0.03384211 1.887618 1.77534 1.875876 2.123222 -0.02878461 -0.6270611
          [,57]    [,58]      [,59]      [,60]    [,61]      [,62]      [,63]
[1,] -0.4449641 1.288749 -0.6900614 -0.7068526 1.071169 -0.7466873 -0.8646746
[2,] -0.4449641 1.288749 -0.6900614 -0.7068526 1.071169 -0.7466873 -0.8646746
          [,64]     [,65]     [,66]      [,67]     [,68]       [,69]     [,70]
[1,] -0.8759645 -1.612307 0.4328436 -0.8227156 0.8502834 0.001403197 -1.483994
[2,] -0.8759645 -1.612307 0.4328436 -0.8227156 0.8502834 0.001403197 -1.483994
         [,71]    [,72]     [,73]     [,74]     [,75]     [,76]   [,77]
[1,] 0.2731114 2.463554 0.3764277 0.4061424 0.5734695 0.1947268 0.52011
[2,] 0.2731114 2.463554 0.3764277 0.4061424 0.5734695 0.1947268 0.52011
          [,78]      [,79]     [,80]     [,81]    [,82]    [,83]      [,84]
[1,] -0.6892921 0.06027269 0.5037414 0.6400807 1.002498 1.208162 -0.6014965
[2,] -0.6892921 0.06027269 0.5037414 0.6400807 1.002498 1.208162 -0.6014965
         [,85]     [,86]      [,87]      [,88]     [,89]    [,90]      [,91]
[1,] 0.6074532 0.6254524 -0.5653262 0.09066406 -1.186632 1.552545 -0.8172542
[2,] 0.6074532 0.6254524 -0.5653262 0.09066406 -1.186632 1.552545 -0.8172542
          [,92]     [,93]      [,94]    [,95]    [,96]     [,97]     [,98]
[1,] -0.3304999 0.1762596 -0.4871952 1.291503 2.567051 0.6901684 0.8547619
[2,] -0.3304999 0.1762596 -0.4871952 1.291503 2.567051 0.6901684 0.8547619
          [,99]     [,100]
[1,] -0.1944384 -0.9744594
[2,] -0.1944384 -0.9744594
> 
> 
> Max(tmp2)
[1] 2.360678
> Min(tmp2)
[1] -1.692943
> mean(tmp2)
[1] 0.09537901
> Sum(tmp2)
[1] 9.537901
> Var(tmp2)
[1] 0.6644554
> 
> rowMeans(tmp2)
  [1]  0.43469381 -0.36529738  0.50974456  1.83955864  0.83225661 -0.59898806
  [7] -0.06909783 -1.17828983  0.27340168 -0.84525795  0.95627990 -1.69294335
 [13]  0.31755604  0.36540235  0.30318899 -0.42005551  1.14808674 -0.04221476
 [19] -1.13728783  0.24986501  0.10865604 -0.41155369 -0.06991561 -0.25149866
 [25]  0.05458015 -1.08851836 -0.22914522  0.99211798 -0.18047313  1.28851821
 [31]  2.36067816 -0.06566256  1.09554507 -0.49137363  0.19923054 -0.13919416
 [37] -0.63807564 -0.30849388 -0.30472876  0.30561659 -0.04222356  0.42885255
 [43] -0.92460057  0.33341146  1.71510211 -1.01562398  0.75326952 -0.49184370
 [49]  0.45690852 -0.32696908  0.51416859  1.47729961  0.84153546  1.95219409
 [55] -0.42550605  1.28170145 -0.08898323  0.44894489  0.89259056 -0.70168324
 [61] -1.20445820 -0.78620406  1.13244182  1.42045084 -1.11998689 -0.90870320
 [67] -0.04244772  0.58274365 -1.11119981 -1.17232993 -0.10067594 -0.57903174
 [73]  0.89594074  0.13354431 -0.72976738 -0.64378139 -0.84850803  0.26274638
 [79] -0.14060272  1.00332624  0.53610997  0.47391428  0.31996809  0.38667949
 [85]  1.21609690  0.49086124 -0.31289662 -1.08951798  1.31843551  0.93130293
 [91] -0.91339205 -0.35923514  1.02765194 -0.52364954 -0.20095865 -0.48763234
 [97] -0.41279189  0.57237571  0.50837448 -0.17274872
> rowSums(tmp2)
  [1]  0.43469381 -0.36529738  0.50974456  1.83955864  0.83225661 -0.59898806
  [7] -0.06909783 -1.17828983  0.27340168 -0.84525795  0.95627990 -1.69294335
 [13]  0.31755604  0.36540235  0.30318899 -0.42005551  1.14808674 -0.04221476
 [19] -1.13728783  0.24986501  0.10865604 -0.41155369 -0.06991561 -0.25149866
 [25]  0.05458015 -1.08851836 -0.22914522  0.99211798 -0.18047313  1.28851821
 [31]  2.36067816 -0.06566256  1.09554507 -0.49137363  0.19923054 -0.13919416
 [37] -0.63807564 -0.30849388 -0.30472876  0.30561659 -0.04222356  0.42885255
 [43] -0.92460057  0.33341146  1.71510211 -1.01562398  0.75326952 -0.49184370
 [49]  0.45690852 -0.32696908  0.51416859  1.47729961  0.84153546  1.95219409
 [55] -0.42550605  1.28170145 -0.08898323  0.44894489  0.89259056 -0.70168324
 [61] -1.20445820 -0.78620406  1.13244182  1.42045084 -1.11998689 -0.90870320
 [67] -0.04244772  0.58274365 -1.11119981 -1.17232993 -0.10067594 -0.57903174
 [73]  0.89594074  0.13354431 -0.72976738 -0.64378139 -0.84850803  0.26274638
 [79] -0.14060272  1.00332624  0.53610997  0.47391428  0.31996809  0.38667949
 [85]  1.21609690  0.49086124 -0.31289662 -1.08951798  1.31843551  0.93130293
 [91] -0.91339205 -0.35923514  1.02765194 -0.52364954 -0.20095865 -0.48763234
 [97] -0.41279189  0.57237571  0.50837448 -0.17274872
> 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.43469381 -0.36529738  0.50974456  1.83955864  0.83225661 -0.59898806
  [7] -0.06909783 -1.17828983  0.27340168 -0.84525795  0.95627990 -1.69294335
 [13]  0.31755604  0.36540235  0.30318899 -0.42005551  1.14808674 -0.04221476
 [19] -1.13728783  0.24986501  0.10865604 -0.41155369 -0.06991561 -0.25149866
 [25]  0.05458015 -1.08851836 -0.22914522  0.99211798 -0.18047313  1.28851821
 [31]  2.36067816 -0.06566256  1.09554507 -0.49137363  0.19923054 -0.13919416
 [37] -0.63807564 -0.30849388 -0.30472876  0.30561659 -0.04222356  0.42885255
 [43] -0.92460057  0.33341146  1.71510211 -1.01562398  0.75326952 -0.49184370
 [49]  0.45690852 -0.32696908  0.51416859  1.47729961  0.84153546  1.95219409
 [55] -0.42550605  1.28170145 -0.08898323  0.44894489  0.89259056 -0.70168324
 [61] -1.20445820 -0.78620406  1.13244182  1.42045084 -1.11998689 -0.90870320
 [67] -0.04244772  0.58274365 -1.11119981 -1.17232993 -0.10067594 -0.57903174
 [73]  0.89594074  0.13354431 -0.72976738 -0.64378139 -0.84850803  0.26274638
 [79] -0.14060272  1.00332624  0.53610997  0.47391428  0.31996809  0.38667949
 [85]  1.21609690  0.49086124 -0.31289662 -1.08951798  1.31843551  0.93130293
 [91] -0.91339205 -0.35923514  1.02765194 -0.52364954 -0.20095865 -0.48763234
 [97] -0.41279189  0.57237571  0.50837448 -0.17274872
> rowMin(tmp2)
  [1]  0.43469381 -0.36529738  0.50974456  1.83955864  0.83225661 -0.59898806
  [7] -0.06909783 -1.17828983  0.27340168 -0.84525795  0.95627990 -1.69294335
 [13]  0.31755604  0.36540235  0.30318899 -0.42005551  1.14808674 -0.04221476
 [19] -1.13728783  0.24986501  0.10865604 -0.41155369 -0.06991561 -0.25149866
 [25]  0.05458015 -1.08851836 -0.22914522  0.99211798 -0.18047313  1.28851821
 [31]  2.36067816 -0.06566256  1.09554507 -0.49137363  0.19923054 -0.13919416
 [37] -0.63807564 -0.30849388 -0.30472876  0.30561659 -0.04222356  0.42885255
 [43] -0.92460057  0.33341146  1.71510211 -1.01562398  0.75326952 -0.49184370
 [49]  0.45690852 -0.32696908  0.51416859  1.47729961  0.84153546  1.95219409
 [55] -0.42550605  1.28170145 -0.08898323  0.44894489  0.89259056 -0.70168324
 [61] -1.20445820 -0.78620406  1.13244182  1.42045084 -1.11998689 -0.90870320
 [67] -0.04244772  0.58274365 -1.11119981 -1.17232993 -0.10067594 -0.57903174
 [73]  0.89594074  0.13354431 -0.72976738 -0.64378139 -0.84850803  0.26274638
 [79] -0.14060272  1.00332624  0.53610997  0.47391428  0.31996809  0.38667949
 [85]  1.21609690  0.49086124 -0.31289662 -1.08951798  1.31843551  0.93130293
 [91] -0.91339205 -0.35923514  1.02765194 -0.52364954 -0.20095865 -0.48763234
 [97] -0.41279189  0.57237571  0.50837448 -0.17274872
> 
> colMeans(tmp2)
[1] 0.09537901
> colSums(tmp2)
[1] 9.537901
> colVars(tmp2)
[1] 0.6644554
> colSd(tmp2)
[1] 0.8151414
> colMax(tmp2)
[1] 2.360678
> colMin(tmp2)
[1] -1.692943
> colMedians(tmp2)
[1] -0.04221916
> colRanges(tmp2)
          [,1]
[1,] -1.692943
[2,]  2.360678
> 
> 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] -1.9344968 -1.6289298  1.9552546  1.1326770 -2.3173274 -0.7281024
 [7] -0.6641598  2.6680107  2.1475650  3.2870098
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7150938
[2,] -1.0802778
[3,]  0.1503225
[4,]  0.6728800
[5,]  0.8198679
> 
> rowApply(tmp,sum)
 [1]  0.2371970  4.0899080  0.3621434  2.3849090  5.3732490 -0.8907642
 [7]  0.6997502  0.3752579 -1.8406824 -6.8734671
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    7    1    2    6    1    8   10    5     9
 [2,]    7    8    2    6    1    6    9    2    9     2
 [3,]    8    9    4    4    9    7    2    1    7     7
 [4,]    3    4    9    7    7   10    6    4    6     1
 [5,]    1    1    5    9    5    9    4    5    3     5
 [6,]    2    5    3    8    2    8    1    9    8     4
 [7,]   10    3    8    1   10    2    5    3    2     6
 [8,]    4    6    6    3    8    3    3    7   10    10
 [9,]    9    2   10    5    3    5   10    8    4     3
[10,]    6   10    7   10    4    4    7    6    1     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.5989174  0.6792160  1.3703250  2.3558056  2.5617340 -0.8833315
 [7]  1.8798646  0.2699844  0.2805283  2.4170616  2.5451441  1.6571860
[13] -1.2889272 -0.3657910 -4.0925423  0.1549380  1.4881557 -0.1301445
[19] -2.0325613  2.9849573
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.69322913
[2,] -0.59837146
[3,] -0.25779497
[4,] -0.03189422
[5,] -0.01762760
> 
> rowApply(tmp,sum)
[1]  1.064393 11.351699  1.366571 -1.945726 -2.584252
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6    7    9    9    1
[2,]    7   10   18   14    4
[3,]   17   13    8   15   12
[4,]   19    9   11   18   13
[5,]    8   15   20   13   14
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]        [,4]       [,5]        [,6]
[1,] -0.59837146 -0.5844211  0.76748824  1.47376261 -0.4214917 -0.09683519
[2,] -0.03189422  0.3619705  0.57101997  0.20860036  1.1704566  0.56062541
[3,] -0.01762760  1.2851952 -0.13087970  0.07496757  1.4668842 -0.64626985
[4,] -0.25779497  0.1947089  0.25157546  0.67835771  0.1851008 -0.19245161
[5,] -1.69322913 -0.5782375 -0.08887897 -0.07988268  0.1607841 -0.50840021
           [,7]        [,8]       [,9]      [,10]      [,11]        [,12]
[1,]  0.4365818  0.07544416 -0.6981663 -0.6116101  0.4531726  1.159051602
[2,]  2.7019690 -0.05963803  0.5552715  2.1294869 -0.2181903 -0.100320164
[3,] -0.1800782  1.11293195  0.6664709  0.5544296  1.4039591 -0.006119072
[4,] -0.5944755 -1.13985119 -1.1190698  0.6346787  1.3638677 -0.344844800
[5,] -0.4841324  0.28109756  0.8760221 -0.2899236 -0.4576651  0.949418468
          [,13]      [,14]       [,15]      [,16]        [,17]       [,18]
[1,]  0.3476934 -0.6936023 -0.62565679  1.7657647  0.575812896 -1.52801136
[2,]  1.1913186 -0.7841152 -1.17752809  0.9181472  1.870157257  0.03287901
[3,] -0.9813867  0.8374061 -1.04370718 -1.7350386 -1.394414497  0.57847349
[4,] -0.6632592 -0.4689932 -1.14831341  0.4196045  0.003582383 -0.62480068
[5,] -1.1832933  0.7435136 -0.09733683 -1.2135398  0.433017704  1.41131505
           [,19]      [,20]
[1,] -0.42077496  0.2885623
[2,] -0.12366373  1.5751466
[3,] -1.31808558  0.8394597
[4,]  0.02992869  0.8467236
[5,] -0.19996574 -0.5649349
> 
> 
> 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 :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.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 -0.9955244 0.9154652 -0.5151361 -0.7033465 0.4267502 0.4332064 -0.4846466
         col8       col9      col10     col11     col12    col13     col14
row1 -1.16218 -0.2480263 -0.9284055 0.4313165 0.4575826 1.629859 0.1018476
           col15       col16     col17     col18     col19     col20
row1 -0.04137902 -0.03612626 -1.508042 -1.415019 -1.180768 0.6863771
> tmp[,"col10"]
          col10
row1 -0.9284055
row2 -0.5212638
row3 -0.3562202
row4 -0.9081648
row5  0.3483274
> tmp[c("row1","row5"),]
           col1      col2       col3       col4      col5      col6       col7
row1 -0.9955244 0.9154652 -0.5151361 -0.7033465 0.4267502 0.4332064 -0.4846466
row5 -1.1820688 0.3643678 -0.1871721  1.3822214 0.4582701 0.2033449  0.3126792
           col8       col9      col10     col11      col12       col13
row1 -1.1621800 -0.2480263 -0.9284055 0.4313165  0.4575826  1.62985950
row5  0.7519855 -1.7683467  0.3483274 1.0089327 -0.6184695 -0.07073753
          col14       col15       col16      col17     col18     col19
row1  0.1018476 -0.04137902 -0.03612626 -1.5080416 -1.415019 -1.180768
row5 -0.8307824 -0.35824631 -0.59550642  0.7084514 -1.217361 -1.419363
          col20
row1  0.6863771
row5 -1.1957439
> tmp[,c("col6","col20")]
          col6      col20
row1 0.4332064  0.6863771
row2 0.3187115 -0.5823254
row3 0.3302318  0.2110232
row4 2.4193150  1.2443844
row5 0.2033449 -1.1957439
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.4332064  0.6863771
row5 0.2033449 -1.1957439
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.58572 49.33054 51.06598 47.83038 50.44691 105.6766 48.54695 51.00713
         col9   col10    col11    col12   col13    col14    col15    col16
row1 49.96889 48.9624 50.69126 51.40243 49.3754 51.51088 50.34961 50.80026
        col17    col18    col19    col20
row1 49.87635 50.10027 50.33636 104.4595
> tmp[,"col10"]
        col10
row1 48.96240
row2 29.11058
row3 31.77453
row4 28.76457
row5 49.94365
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.58572 49.33054 51.06598 47.83038 50.44691 105.6766 48.54695 51.00713
row5 49.42566 49.56049 50.14553 49.39725 49.58587 106.3239 52.11919 49.94051
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.96889 48.96240 50.69126 51.40243 49.37540 51.51088 50.34961 50.80026
row5 50.12540 49.94365 51.12016 49.74727 48.93435 49.91886 50.18665 51.14281
        col17    col18    col19    col20
row1 49.87635 50.10027 50.33636 104.4595
row5 50.32430 50.79322 50.71472 103.3980
> tmp[,c("col6","col20")]
          col6     col20
row1 105.67656 104.45946
row2  76.06351  74.09054
row3  75.47818  74.28969
row4  75.20916  78.23092
row5 106.32394 103.39799
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.6766 104.4595
row5 106.3239 103.3980
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.6766 104.4595
row5 106.3239 103.3980
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.4330077
[2,] -0.7414498
[3,] -1.8249934
[4,] -0.6201957
[5,]  0.9279415
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.63046250  0.2437814
[2,] -0.18089515 -0.1764092
[3,]  0.74354317 -1.2821146
[4,] -0.09699009 -0.6774235
[5,] -0.33440897 -1.5741684
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.7504417  1.1914648
[2,] -0.1926970  0.2577367
[3,] -0.4672061 -1.5554994
[4,]  0.2188679  2.6674699
[5,]  0.1275807 -1.4597684
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.7504417
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.7504417
[2,] -0.1926970
> 
> 
> 
> 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 -2.130260 -0.2227947  0.8817319 1.307437 0.3353132 -1.5525528 -1.1888666
row1  1.131153 -0.4580828 -0.3497765 1.444399 2.2787940  0.3503115  0.1445794
            [,8]        [,9]      [,10]     [,11]       [,12]      [,13]
row3 -0.08885574 -0.82018545 -1.1794471  1.924631 -0.03755218  1.5919740
row1 -0.62106705  0.08684494 -0.1460751 -0.264592  0.95942665 -0.5589079
          [,14]     [,15]      [,16]     [,17]     [,18]      [,19]      [,20]
row3 -0.5036625 1.4815077  0.6082057 0.5643466 0.6359972  0.4964859 -0.5791059
row1  0.9153783 0.2436125 -0.6204338 1.4677489 0.4502528 -0.3431849 -0.1333919
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]     [,5]     [,6]       [,7]
row2 0.2695429 0.8532791 -1.045445 -0.439278 1.097577 1.054197 -0.3453857
          [,8]       [,9]     [,10]
row2 0.1124593 -0.1498866 0.3120085
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]     [,3]     [,4]      [,5]     [,6]      [,7]
row5 -0.102091 -1.360903 0.725158 1.213831 -1.621751 1.548096 -1.226399
           [,8]     [,9]      [,10]     [,11]     [,12]    [,13]      [,14]
row5 -0.1525835 1.254306 -0.5414986 -1.859333 0.1321102 1.266042 -0.3822958
         [,15]     [,16]      [,17]     [,18]    [,19]    [,20]
row5 0.3044311 -2.392306 -0.3191457 0.4874215 0.823017 1.066246
> 
> 
> 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: 0x5911254ce220>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a12746eb1"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a5e8da39f"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a59646862"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a691e9108"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a1b103667"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a304bec3a"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a6f2da748"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a57cc2d4f"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a7169feb4"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a331a1ce9"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a7cf6c773"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a497c2130"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a701f514e"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94ab69cd6d" 
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM32e94a1b132967"
> 
> 
> ### 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: 0x591123aab560>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x591123aab560>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x591123aab560>
> rowMedians(tmp)
  [1] -0.068132643 -0.125273171 -0.237546746  0.187140360  0.081816327
  [6] -0.338234350 -0.644712057  0.093952447 -0.635652282 -0.271842163
 [11]  0.714337652  0.272293286 -0.297355899  0.056591479  0.202014180
 [16] -0.037390543  0.048000497  0.066678744  0.002932348  0.148743706
 [21]  0.497973760 -0.611029794  0.103946440  0.098008492 -0.078256451
 [26] -0.288942357  0.195701311  0.429334282  0.446991770  0.810222299
 [31]  0.194043818  0.209222077 -0.514835720  0.004129277  0.536680523
 [36]  0.157322261 -0.333564705 -0.052414030 -0.146972215 -0.403028176
 [41] -0.221833367  0.309886872 -0.653899591  0.220556557 -0.229074651
 [46] -0.125371522 -0.010537193  0.227358795 -0.319131054  0.194186835
 [51] -0.289134671 -0.367231815 -0.136392483  0.462428842 -0.576190066
 [56]  0.239795856 -0.044759197  0.202125114  0.083991207 -0.223652455
 [61]  0.056030810 -0.358713495  0.414154829 -0.134264630 -0.435132134
 [66] -0.183639048  0.150842500  0.652603018  0.181705276 -0.853355058
 [71]  0.178838517  0.022623465 -0.082976941  0.371429665  0.172403440
 [76] -0.051930669  0.054622085  0.103701916 -0.017580891  0.351886230
 [81]  0.095293442 -0.047336593  0.004139437 -0.049835985 -0.354490321
 [86] -0.316559025 -0.027843392 -0.013237434 -0.074069288 -0.379263950
 [91]  0.391214818 -0.129926000 -0.257853290  0.467320910  0.573959736
 [96]  0.322160898 -0.227961663 -0.380434820  0.281349363 -0.176755115
[101]  0.346049137 -0.042512341 -0.168233709  0.355169650 -0.197878043
[106] -0.588558420 -0.308902485 -0.014093455 -0.288715891 -0.350417263
[111] -0.781799441  0.106039296 -0.033039866 -0.404613990 -0.358164322
[116]  0.299213965 -0.078933276 -0.059109133  0.183274777 -0.191598035
[121] -0.204551168  0.040997506 -0.002343634  0.273711377 -0.323369468
[126] -0.120913159  0.009742324 -0.132610722  0.178276094  0.411454693
[131] -0.156084461  0.531495072 -0.505002842  0.340014247 -0.287897377
[136]  0.469342633  0.051926632  0.294295680 -0.591527514 -0.222532274
[141]  0.098779969 -0.334771129 -0.489501407 -0.075852804  0.578836010
[146]  0.035279617 -0.378583754  0.001458521 -0.442982021 -0.370108643
[151]  0.036127251  0.232473214 -0.435523918  0.431857649 -0.190394756
[156] -0.367969270  0.509201470 -0.195369250  0.091477638 -0.077005161
[161]  0.118639980 -0.344369633  0.326728991  0.239666292 -0.154807606
[166]  0.003031966  0.190150613  0.216625563 -0.019254559  0.354939349
[171] -0.491053166  0.067114562  0.509021203 -0.467364417 -0.649503335
[176] -0.328139961  0.475419635  0.147868793  0.191044293  0.059183534
[181]  0.307491548 -0.015991214  0.501204130  0.382757199  0.175177943
[186]  0.201608713  0.218898758 -0.077355727  0.664128816 -0.345542468
[191] -0.360900131  0.340521323  0.506847852 -0.303973901  0.114850559
[196] -0.463533720  0.231538497 -0.101791029 -0.363841233 -0.546451259
[201] -0.263574871  0.431523584 -0.507746570 -0.467325122  0.329626733
[206]  0.091160360  0.482567802  0.181773417 -0.064294199  0.065342759
[211] -0.035698767 -0.087840783 -0.106349534  0.208300691 -0.574376603
[216]  0.010804774 -0.772378312 -0.167621627  0.262291037 -0.568840170
[221] -0.058806800  0.363278668  0.523171843  0.134039896  0.582476697
[226] -0.237051762  0.130556762 -0.091395162  0.265964009 -0.363554871
> 
> proc.time()
   user  system elapsed 
  1.231   0.660   1.882 

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: 0x5a887bc59370>
> .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: 0x5a887bc59370>
> .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: 0x5a887bc59370>
> .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: 0x5a887bc59370>
> 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: 0x5a887bc411c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a887bc411c0>
> .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: 0x5a887bc411c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a887bc411c0>
> .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: 0x5a887bc411c0>
> 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: 0x5a887bf24120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a887bf24120>
> .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: 0x5a887bf24120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5a887bf24120>
> .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: 0x5a887bf24120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5a887bf24120>
> .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: 0x5a887bf24120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5a887bf24120>
> .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: 0x5a887bf24120>
> 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: 0x5a887ac74390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5a887ac74390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a887ac74390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a887ac74390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile32ea63236f084e" "BufferedMatrixFile32ea63524d4612"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile32ea63236f084e" "BufferedMatrixFile32ea63524d4612"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a887ab6b3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a887ab6b3d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5a887ab6b3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5a887ab6b3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5a887ab6b3d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5a887ab6b3d0>
> .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: 0x5a887c6a0fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a887c6a0fa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5a887c6a0fa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5a887c6a0fa0>
> 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: 0x5a887ae78ff0>
> .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: 0x5a887ae78ff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.256   0.037   0.282 

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.247   0.052   0.286 

Example timings