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

This page was generated on 2026-02-20 11:32 -0500 (Fri, 20 Feb 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" 4869
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 255/2354HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-02-19 13:40 -0500 (Thu, 19 Feb 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (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 nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-02-19 21:46:50 -0500 (Thu, 19 Feb 2026)
EndedAt: 2026-02-19 21:47:15 -0500 (Thu, 19 Feb 2026)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.252   0.056   0.292 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478920 25.6    1048721 56.1   639242 34.2
Vcells 885815  6.8    8388608 64.0  2083259 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] "Thu Feb 19 21:47:05 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] "Thu Feb 19 21:47:05 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: 0x6015c77f4c10>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Feb 19 21:47:05 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] "Thu Feb 19 21:47:05 2026"
> 
> ColMode(tmp2)
<pointer: 0x6015c77f4c10>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.9512340 -0.9596542  1.0257691 -0.2018870
[2,]  -0.3363918 -1.4767491 -0.8025801  0.6660436
[3,]  -1.3754348 -1.5801711  1.2419896  1.2801102
[4,]  -1.8325089 -1.0463902  1.5007561  1.5530943
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.9512340 0.9596542 1.0257691 0.2018870
[2,]   0.3363918 1.4767491 0.8025801 0.6660436
[3,]   1.3754348 1.5801711 1.2419896 1.2801102
[4,]   1.8325089 1.0463902 1.5007561 1.5530943
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0474491 0.9796194 1.0128026 0.4493183
[2,]  0.5799929 1.2152156 0.8958684 0.8161150
[3,]  1.1727893 1.2570486 1.1144459 1.1314196
[4,]  1.3537019 1.0229322 1.2250535 1.2462321
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.42573 35.75585 36.15380 29.69507
[2,]  31.13632 38.62891 34.76126 33.82719
[3,]  38.10333 39.15066 37.38645 37.59431
[4,]  40.36953 36.27571 38.75129 39.01541
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6015c7982cb0>
> exp(tmp5)
<pointer: 0x6015c7982cb0>
> log(tmp5,2)
<pointer: 0x6015c7982cb0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.2755
> Min(tmp5)
[1] 53.87421
> mean(tmp5)
[1] 72.35856
> Sum(tmp5)
[1] 14471.71
> Var(tmp5)
[1] 870.2135
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.22066 70.37455 74.43929 71.27535 67.76187 69.72782 72.27742 69.04107
 [9] 70.40401 68.06360
> rowSums(tmp5)
 [1] 1804.413 1407.491 1488.786 1425.507 1355.237 1394.556 1445.548 1380.821
 [9] 1408.080 1361.272
> rowVars(tmp5)
 [1] 8117.99077   93.58276   58.95671   57.32790   51.44434   59.59517
 [7]   46.07940   78.55805   90.82747   49.63870
> rowSd(tmp5)
 [1] 90.099893  9.673818  7.678327  7.571519  7.172471  7.719790  6.788181
 [8]  8.863298  9.530345  7.045474
> rowMax(tmp5)
 [1] 471.27548  89.35701  93.59329  84.02388  82.64486  87.88109  83.10348
 [8]  85.34877  83.78821  81.41620
> rowMin(tmp5)
 [1] 57.57417 53.87421 59.52797 57.73195 57.19521 57.86848 59.66445 56.17517
 [9] 55.18066 57.21286
> 
> colMeans(tmp5)
 [1] 114.94716  73.80771  75.12792  69.10306  68.18164  70.82140  66.65223
 [8]  64.23804  65.20662  75.25954  68.77536  71.26099  68.63721  67.65570
[15]  68.89310  73.72076  72.37156  68.99933  72.97316  70.53877
> colSums(tmp5)
 [1] 1149.4716  738.0771  751.2792  691.0306  681.8164  708.2140  666.5223
 [8]  642.3804  652.0662  752.5954  687.7536  712.6099  686.3721  676.5570
[15]  688.9310  737.2076  723.7156  689.9933  729.7316  705.3877
> colVars(tmp5)
 [1] 15754.53576    56.87487    36.90551    52.03968    45.70866    81.90913
 [7]    45.07176    38.81508    48.03727    91.30822    32.23654   108.62067
[13]    47.00169    31.96397   140.26883    46.00793    94.44146    75.91543
[19]    60.16367    30.35587
> colSd(tmp5)
 [1] 125.517074   7.541543   6.074991   7.213853   6.760818   9.050366
 [7]   6.713550   6.230175   6.930892   9.555534   5.677723  10.422124
[13]   6.855778   5.653668  11.843514   6.782915   9.718100   8.712946
[19]   7.756524   5.509616
> colMax(tmp5)
 [1] 471.27548  82.11073  83.05377  81.20547  76.51472  81.41620  77.07882
 [8]  73.88869  77.17555  93.59329  74.73717  87.88109  79.50787  75.33029
[15]  92.36129  85.34877  89.35701  83.78821  85.13484  78.76165
> colMin(tmp5)
 [1] 57.22281 59.66445 64.82271 57.86848 56.60008 53.87421 57.19521 56.17517
 [9] 55.18066 62.73567 58.07804 58.57600 60.45990 57.21286 54.83108 64.49411
[17] 58.23320 55.97546 63.61408 63.52240
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.22066 70.37455 74.43929 71.27535 67.76187 69.72782       NA 69.04107
 [9] 70.40401 68.06360
> rowSums(tmp5)
 [1] 1804.413 1407.491 1488.786 1425.507 1355.237 1394.556       NA 1380.821
 [9] 1408.080 1361.272
> rowVars(tmp5)
 [1] 8117.99077   93.58276   58.95671   57.32790   51.44434   59.59517
 [7]   43.42721   78.55805   90.82747   49.63870
> rowSd(tmp5)
 [1] 90.099893  9.673818  7.678327  7.571519  7.172471  7.719790  6.589932
 [8]  8.863298  9.530345  7.045474
> rowMax(tmp5)
 [1] 471.27548  89.35701  93.59329  84.02388  82.64486  87.88109        NA
 [8]  85.34877  83.78821  81.41620
> rowMin(tmp5)
 [1] 57.57417 53.87421 59.52797 57.73195 57.19521 57.86848       NA 56.17517
 [9] 55.18066 57.21286
> 
> colMeans(tmp5)
 [1] 114.94716  73.80771  75.12792  69.10306  68.18164  70.82140  66.65223
 [8]  64.23804  65.20662  75.25954        NA  71.26099  68.63721  67.65570
[15]  68.89310  73.72076  72.37156  68.99933  72.97316  70.53877
> colSums(tmp5)
 [1] 1149.4716  738.0771  751.2792  691.0306  681.8164  708.2140  666.5223
 [8]  642.3804  652.0662  752.5954        NA  712.6099  686.3721  676.5570
[15]  688.9310  737.2076  723.7156  689.9933  729.7316  705.3877
> colVars(tmp5)
 [1] 15754.53576    56.87487    36.90551    52.03968    45.70866    81.90913
 [7]    45.07176    38.81508    48.03727    91.30822          NA   108.62067
[13]    47.00169    31.96397   140.26883    46.00793    94.44146    75.91543
[19]    60.16367    30.35587
> colSd(tmp5)
 [1] 125.517074   7.541543   6.074991   7.213853   6.760818   9.050366
 [7]   6.713550   6.230175   6.930892   9.555534         NA  10.422124
[13]   6.855778   5.653668  11.843514   6.782915   9.718100   8.712946
[19]   7.756524   5.509616
> colMax(tmp5)
 [1] 471.27548  82.11073  83.05377  81.20547  76.51472  81.41620  77.07882
 [8]  73.88869  77.17555  93.59329        NA  87.88109  79.50787  75.33029
[15]  92.36129  85.34877  89.35701  83.78821  85.13484  78.76165
> colMin(tmp5)
 [1] 57.22281 59.66445 64.82271 57.86848 56.60008 53.87421 57.19521 56.17517
 [9] 55.18066 62.73567       NA 58.57600 60.45990 57.21286 54.83108 64.49411
[17] 58.23320 55.97546 63.61408 63.52240
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.2755
> Min(tmp5,na.rm=TRUE)
[1] 53.87421
> mean(tmp5,na.rm=TRUE)
[1] 72.40641
> Sum(tmp5,na.rm=TRUE)
[1] 14408.88
> Var(tmp5,na.rm=TRUE)
[1] 874.1483
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.22066 70.37455 74.43929 71.27535 67.76187 69.72782 72.77430 69.04107
 [9] 70.40401 68.06360
> rowSums(tmp5,na.rm=TRUE)
 [1] 1804.413 1407.491 1488.786 1425.507 1355.237 1394.556 1382.712 1380.821
 [9] 1408.080 1361.272
> rowVars(tmp5,na.rm=TRUE)
 [1] 8117.99077   93.58276   58.95671   57.32790   51.44434   59.59517
 [7]   43.42721   78.55805   90.82747   49.63870
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.099893  9.673818  7.678327  7.571519  7.172471  7.719790  6.589932
 [8]  8.863298  9.530345  7.045474
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.27548  89.35701  93.59329  84.02388  82.64486  87.88109  83.10348
 [8]  85.34877  83.78821  81.41620
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.57417 53.87421 59.52797 57.73195 57.19521 57.86848 59.66445 56.17517
 [9] 55.18066 57.21286
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.94716  73.80771  75.12792  69.10306  68.18164  70.82140  66.65223
 [8]  64.23804  65.20662  75.25954  69.43521  71.26099  68.63721  67.65570
[15]  68.89310  73.72076  72.37156  68.99933  72.97316  70.53877
> colSums(tmp5,na.rm=TRUE)
 [1] 1149.4716  738.0771  751.2792  691.0306  681.8164  708.2140  666.5223
 [8]  642.3804  652.0662  752.5954  624.9169  712.6099  686.3721  676.5570
[15]  688.9310  737.2076  723.7156  689.9933  729.7316  705.3877
> colVars(tmp5,na.rm=TRUE)
 [1] 15754.53576    56.87487    36.90551    52.03968    45.70866    81.90913
 [7]    45.07176    38.81508    48.03727    91.30822    31.36776   108.62067
[13]    47.00169    31.96397   140.26883    46.00793    94.44146    75.91543
[19]    60.16367    30.35587
> colSd(tmp5,na.rm=TRUE)
 [1] 125.517074   7.541543   6.074991   7.213853   6.760818   9.050366
 [7]   6.713550   6.230175   6.930892   9.555534   5.600693  10.422124
[13]   6.855778   5.653668  11.843514   6.782915   9.718100   8.712946
[19]   7.756524   5.509616
> colMax(tmp5,na.rm=TRUE)
 [1] 471.27548  82.11073  83.05377  81.20547  76.51472  81.41620  77.07882
 [8]  73.88869  77.17555  93.59329  74.73717  87.88109  79.50787  75.33029
[15]  92.36129  85.34877  89.35701  83.78821  85.13484  78.76165
> colMin(tmp5,na.rm=TRUE)
 [1] 57.22281 59.66445 64.82271 57.86848 56.60008 53.87421 57.19521 56.17517
 [9] 55.18066 62.73567 58.07804 58.57600 60.45990 57.21286 54.83108 64.49411
[17] 58.23320 55.97546 63.61408 63.52240
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.22066 70.37455 74.43929 71.27535 67.76187 69.72782      NaN 69.04107
 [9] 70.40401 68.06360
> rowSums(tmp5,na.rm=TRUE)
 [1] 1804.413 1407.491 1488.786 1425.507 1355.237 1394.556    0.000 1380.821
 [9] 1408.080 1361.272
> rowVars(tmp5,na.rm=TRUE)
 [1] 8117.99077   93.58276   58.95671   57.32790   51.44434   59.59517
 [7]         NA   78.55805   90.82747   49.63870
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.099893  9.673818  7.678327  7.571519  7.172471  7.719790        NA
 [8]  8.863298  9.530345  7.045474
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.27548  89.35701  93.59329  84.02388  82.64486  87.88109        NA
 [8]  85.34877  83.78821  81.41620
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.57417 53.87421 59.52797 57.73195 57.19521 57.86848       NA 56.17517
 [9] 55.18066 57.21286
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 118.67629  75.37918  74.85750  68.76652  67.25574  70.25258  65.99318
 [8]  63.45155  65.16272  76.65108       NaN  69.94516  67.54791  67.19920
[15]  68.78121  74.74594  71.78708  67.79263  73.66895  70.00197
> colSums(tmp5,na.rm=TRUE)
 [1] 1068.0866  678.4126  673.7175  618.8987  605.3017  632.2732  593.9386
 [8]  571.0640  586.4645  689.8597    0.0000  629.5064  607.9311  604.7928
[15]  619.0309  672.7135  646.0837  610.1336  663.0206  630.0177
> colVars(tmp5,na.rm=TRUE)
 [1] 17567.40585    36.20207    40.69601    57.27045    41.77777    88.50773
 [7]    45.81925    36.70818    54.02025    80.93740          NA   102.71985
[13]    39.52780    33.61506   157.66159    39.93515   102.40341    69.02328
[19]    62.23767    30.90859
> colSd(tmp5,na.rm=TRUE)
 [1] 132.542091   6.016815   6.379343   7.567724   6.463572   9.407855
 [7]   6.768992   6.058728   7.349847   8.996522         NA  10.135080
[13]   6.287114   5.797849  12.556337   6.319427  10.119457   8.308025
[19]   7.889085   5.559550
> colMax(tmp5,na.rm=TRUE)
 [1] 471.27548  82.11073  83.05377  81.20547  76.10743  81.41620  77.07882
 [8]  73.88869  77.17555  93.59329      -Inf  87.88109  79.50787  75.33029
[15]  92.36129  85.34877  89.35701  83.78821  85.13484  78.76165
> colMin(tmp5,na.rm=TRUE)
 [1] 57.22281 62.36740 64.82271 57.86848 56.60008 53.87421 57.19521 56.17517
 [9] 55.18066 67.96980      Inf 58.57600 60.45990 57.21286 54.83108 65.69773
[17] 58.23320 55.97546 63.61408 63.52240
> 
> 
> 
> 
> 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] 135.0463 179.9530 130.5256 224.0260 178.5760 144.1456 239.8280 296.6731
 [9] 257.0679 177.7563
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 135.0463 179.9530 130.5256 224.0260 178.5760 144.1456 239.8280 296.6731
 [9] 257.0679 177.7563
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  5.684342e-14 -1.136868e-13  1.421085e-14  1.136868e-13  1.136868e-13
 [6] -1.421085e-14  8.526513e-14  4.547474e-13  0.000000e+00 -5.684342e-14
[11] -8.526513e-14 -2.842171e-14  4.263256e-14  8.526513e-14  0.000000e+00
[16] -2.842171e-14  5.684342e-14  5.684342e-14  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)
+ }
4   16 
7   15 
6   11 
2   2 
1   13 
6   15 
2   8 
10   5 
7   19 
5   5 
9   12 
2   12 
1   12 
4   11 
6   6 
3   18 
3   20 
10   7 
8   20 
7   16 
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.862618
> Min(tmp)
[1] -3.94139
> mean(tmp)
[1] -0.04033901
> Sum(tmp)
[1] -4.033901
> Var(tmp)
[1] 1.130726
> 
> rowMeans(tmp)
[1] -0.04033901
> rowSums(tmp)
[1] -4.033901
> rowVars(tmp)
[1] 1.130726
> rowSd(tmp)
[1] 1.063356
> rowMax(tmp)
[1] 2.862618
> rowMin(tmp)
[1] -3.94139
> 
> colMeans(tmp)
  [1] -0.787766280 -0.868233724 -0.213078491  0.779887999  0.273095763
  [6]  1.211596458  1.143400621 -1.674721939 -1.542347853 -0.799440420
 [11]  0.102058471 -1.892860666  0.444369535 -1.708280133 -0.105808154
 [16]  1.341447150  0.495785448  0.936481917  0.640411884 -0.713431896
 [21]  0.685099155  0.398061041  1.994649520 -1.134798602 -2.099151419
 [26]  0.994593277 -2.087193358  0.467305340  0.481657578 -1.027124681
 [31]  0.454969730  0.270255479  0.781589594 -0.394503311  1.097567038
 [36] -1.011008782  0.149771191  0.046038892  0.324069310 -0.002166589
 [41]  1.159212187  0.236827292 -0.120963134  1.547643394  0.154614504
 [46] -0.798148191  1.022505660 -0.825144038 -0.558194182 -1.165990996
 [51] -0.349390223 -1.196369919  0.178424473  0.756999893 -0.389002067
 [56]  0.057314959 -3.941389788 -1.220418453 -0.025529917  0.190474565
 [61]  0.162502246  2.091140550  0.165709621 -0.172415282  1.043941128
 [66]  0.018006505  1.046285907  1.049894741  0.788443098 -1.229705298
 [71]  0.853931366 -0.264158563  0.165116149  0.820918354 -0.036144083
 [76]  0.679759513 -0.483927080  0.378372806 -0.190720380  0.745438937
 [81] -0.074528938 -0.821681189  0.193962260  0.747557760  0.441213021
 [86] -0.056072683 -0.697087112 -2.242189705  0.530045642  0.883500347
 [91] -2.177845221 -1.075001245  2.049224597  2.862617531 -1.217757564
 [96] -0.905246698 -0.440453163 -0.725033575 -0.912898273 -0.194338753
> colSums(tmp)
  [1] -0.787766280 -0.868233724 -0.213078491  0.779887999  0.273095763
  [6]  1.211596458  1.143400621 -1.674721939 -1.542347853 -0.799440420
 [11]  0.102058471 -1.892860666  0.444369535 -1.708280133 -0.105808154
 [16]  1.341447150  0.495785448  0.936481917  0.640411884 -0.713431896
 [21]  0.685099155  0.398061041  1.994649520 -1.134798602 -2.099151419
 [26]  0.994593277 -2.087193358  0.467305340  0.481657578 -1.027124681
 [31]  0.454969730  0.270255479  0.781589594 -0.394503311  1.097567038
 [36] -1.011008782  0.149771191  0.046038892  0.324069310 -0.002166589
 [41]  1.159212187  0.236827292 -0.120963134  1.547643394  0.154614504
 [46] -0.798148191  1.022505660 -0.825144038 -0.558194182 -1.165990996
 [51] -0.349390223 -1.196369919  0.178424473  0.756999893 -0.389002067
 [56]  0.057314959 -3.941389788 -1.220418453 -0.025529917  0.190474565
 [61]  0.162502246  2.091140550  0.165709621 -0.172415282  1.043941128
 [66]  0.018006505  1.046285907  1.049894741  0.788443098 -1.229705298
 [71]  0.853931366 -0.264158563  0.165116149  0.820918354 -0.036144083
 [76]  0.679759513 -0.483927080  0.378372806 -0.190720380  0.745438937
 [81] -0.074528938 -0.821681189  0.193962260  0.747557760  0.441213021
 [86] -0.056072683 -0.697087112 -2.242189705  0.530045642  0.883500347
 [91] -2.177845221 -1.075001245  2.049224597  2.862617531 -1.217757564
 [96] -0.905246698 -0.440453163 -0.725033575 -0.912898273 -0.194338753
> 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.787766280 -0.868233724 -0.213078491  0.779887999  0.273095763
  [6]  1.211596458  1.143400621 -1.674721939 -1.542347853 -0.799440420
 [11]  0.102058471 -1.892860666  0.444369535 -1.708280133 -0.105808154
 [16]  1.341447150  0.495785448  0.936481917  0.640411884 -0.713431896
 [21]  0.685099155  0.398061041  1.994649520 -1.134798602 -2.099151419
 [26]  0.994593277 -2.087193358  0.467305340  0.481657578 -1.027124681
 [31]  0.454969730  0.270255479  0.781589594 -0.394503311  1.097567038
 [36] -1.011008782  0.149771191  0.046038892  0.324069310 -0.002166589
 [41]  1.159212187  0.236827292 -0.120963134  1.547643394  0.154614504
 [46] -0.798148191  1.022505660 -0.825144038 -0.558194182 -1.165990996
 [51] -0.349390223 -1.196369919  0.178424473  0.756999893 -0.389002067
 [56]  0.057314959 -3.941389788 -1.220418453 -0.025529917  0.190474565
 [61]  0.162502246  2.091140550  0.165709621 -0.172415282  1.043941128
 [66]  0.018006505  1.046285907  1.049894741  0.788443098 -1.229705298
 [71]  0.853931366 -0.264158563  0.165116149  0.820918354 -0.036144083
 [76]  0.679759513 -0.483927080  0.378372806 -0.190720380  0.745438937
 [81] -0.074528938 -0.821681189  0.193962260  0.747557760  0.441213021
 [86] -0.056072683 -0.697087112 -2.242189705  0.530045642  0.883500347
 [91] -2.177845221 -1.075001245  2.049224597  2.862617531 -1.217757564
 [96] -0.905246698 -0.440453163 -0.725033575 -0.912898273 -0.194338753
> colMin(tmp)
  [1] -0.787766280 -0.868233724 -0.213078491  0.779887999  0.273095763
  [6]  1.211596458  1.143400621 -1.674721939 -1.542347853 -0.799440420
 [11]  0.102058471 -1.892860666  0.444369535 -1.708280133 -0.105808154
 [16]  1.341447150  0.495785448  0.936481917  0.640411884 -0.713431896
 [21]  0.685099155  0.398061041  1.994649520 -1.134798602 -2.099151419
 [26]  0.994593277 -2.087193358  0.467305340  0.481657578 -1.027124681
 [31]  0.454969730  0.270255479  0.781589594 -0.394503311  1.097567038
 [36] -1.011008782  0.149771191  0.046038892  0.324069310 -0.002166589
 [41]  1.159212187  0.236827292 -0.120963134  1.547643394  0.154614504
 [46] -0.798148191  1.022505660 -0.825144038 -0.558194182 -1.165990996
 [51] -0.349390223 -1.196369919  0.178424473  0.756999893 -0.389002067
 [56]  0.057314959 -3.941389788 -1.220418453 -0.025529917  0.190474565
 [61]  0.162502246  2.091140550  0.165709621 -0.172415282  1.043941128
 [66]  0.018006505  1.046285907  1.049894741  0.788443098 -1.229705298
 [71]  0.853931366 -0.264158563  0.165116149  0.820918354 -0.036144083
 [76]  0.679759513 -0.483927080  0.378372806 -0.190720380  0.745438937
 [81] -0.074528938 -0.821681189  0.193962260  0.747557760  0.441213021
 [86] -0.056072683 -0.697087112 -2.242189705  0.530045642  0.883500347
 [91] -2.177845221 -1.075001245  2.049224597  2.862617531 -1.217757564
 [96] -0.905246698 -0.440453163 -0.725033575 -0.912898273 -0.194338753
> colMedians(tmp)
  [1] -0.787766280 -0.868233724 -0.213078491  0.779887999  0.273095763
  [6]  1.211596458  1.143400621 -1.674721939 -1.542347853 -0.799440420
 [11]  0.102058471 -1.892860666  0.444369535 -1.708280133 -0.105808154
 [16]  1.341447150  0.495785448  0.936481917  0.640411884 -0.713431896
 [21]  0.685099155  0.398061041  1.994649520 -1.134798602 -2.099151419
 [26]  0.994593277 -2.087193358  0.467305340  0.481657578 -1.027124681
 [31]  0.454969730  0.270255479  0.781589594 -0.394503311  1.097567038
 [36] -1.011008782  0.149771191  0.046038892  0.324069310 -0.002166589
 [41]  1.159212187  0.236827292 -0.120963134  1.547643394  0.154614504
 [46] -0.798148191  1.022505660 -0.825144038 -0.558194182 -1.165990996
 [51] -0.349390223 -1.196369919  0.178424473  0.756999893 -0.389002067
 [56]  0.057314959 -3.941389788 -1.220418453 -0.025529917  0.190474565
 [61]  0.162502246  2.091140550  0.165709621 -0.172415282  1.043941128
 [66]  0.018006505  1.046285907  1.049894741  0.788443098 -1.229705298
 [71]  0.853931366 -0.264158563  0.165116149  0.820918354 -0.036144083
 [76]  0.679759513 -0.483927080  0.378372806 -0.190720380  0.745438937
 [81] -0.074528938 -0.821681189  0.193962260  0.747557760  0.441213021
 [86] -0.056072683 -0.697087112 -2.242189705  0.530045642  0.883500347
 [91] -2.177845221 -1.075001245  2.049224597  2.862617531 -1.217757564
 [96] -0.905246698 -0.440453163 -0.725033575 -0.912898273 -0.194338753
> colRanges(tmp)
           [,1]       [,2]       [,3]     [,4]      [,5]     [,6]     [,7]
[1,] -0.7877663 -0.8682337 -0.2130785 0.779888 0.2730958 1.211596 1.143401
[2,] -0.7877663 -0.8682337 -0.2130785 0.779888 0.2730958 1.211596 1.143401
          [,8]      [,9]      [,10]     [,11]     [,12]     [,13]    [,14]
[1,] -1.674722 -1.542348 -0.7994404 0.1020585 -1.892861 0.4443695 -1.70828
[2,] -1.674722 -1.542348 -0.7994404 0.1020585 -1.892861 0.4443695 -1.70828
          [,15]    [,16]     [,17]     [,18]     [,19]      [,20]     [,21]
[1,] -0.1058082 1.341447 0.4957854 0.9364819 0.6404119 -0.7134319 0.6850992
[2,] -0.1058082 1.341447 0.4957854 0.9364819 0.6404119 -0.7134319 0.6850992
        [,22]   [,23]     [,24]     [,25]     [,26]     [,27]     [,28]
[1,] 0.398061 1.99465 -1.134799 -2.099151 0.9945933 -2.087193 0.4673053
[2,] 0.398061 1.99465 -1.134799 -2.099151 0.9945933 -2.087193 0.4673053
         [,29]     [,30]     [,31]     [,32]     [,33]      [,34]    [,35]
[1,] 0.4816576 -1.027125 0.4549697 0.2702555 0.7815896 -0.3945033 1.097567
[2,] 0.4816576 -1.027125 0.4549697 0.2702555 0.7815896 -0.3945033 1.097567
         [,36]     [,37]      [,38]     [,39]        [,40]    [,41]     [,42]
[1,] -1.011009 0.1497712 0.04603889 0.3240693 -0.002166589 1.159212 0.2368273
[2,] -1.011009 0.1497712 0.04603889 0.3240693 -0.002166589 1.159212 0.2368273
          [,43]    [,44]     [,45]      [,46]    [,47]     [,48]      [,49]
[1,] -0.1209631 1.547643 0.1546145 -0.7981482 1.022506 -0.825144 -0.5581942
[2,] -0.1209631 1.547643 0.1546145 -0.7981482 1.022506 -0.825144 -0.5581942
         [,50]      [,51]    [,52]     [,53]     [,54]      [,55]      [,56]
[1,] -1.165991 -0.3493902 -1.19637 0.1784245 0.7569999 -0.3890021 0.05731496
[2,] -1.165991 -0.3493902 -1.19637 0.1784245 0.7569999 -0.3890021 0.05731496
        [,57]     [,58]       [,59]     [,60]     [,61]    [,62]     [,63]
[1,] -3.94139 -1.220418 -0.02552992 0.1904746 0.1625022 2.091141 0.1657096
[2,] -3.94139 -1.220418 -0.02552992 0.1904746 0.1625022 2.091141 0.1657096
          [,64]    [,65]     [,66]    [,67]    [,68]     [,69]     [,70]
[1,] -0.1724153 1.043941 0.0180065 1.046286 1.049895 0.7884431 -1.229705
[2,] -0.1724153 1.043941 0.0180065 1.046286 1.049895 0.7884431 -1.229705
         [,71]      [,72]     [,73]     [,74]       [,75]     [,76]      [,77]
[1,] 0.8539314 -0.2641586 0.1651161 0.8209184 -0.03614408 0.6797595 -0.4839271
[2,] 0.8539314 -0.2641586 0.1651161 0.8209184 -0.03614408 0.6797595 -0.4839271
         [,78]      [,79]     [,80]       [,81]      [,82]     [,83]     [,84]
[1,] 0.3783728 -0.1907204 0.7454389 -0.07452894 -0.8216812 0.1939623 0.7475578
[2,] 0.3783728 -0.1907204 0.7454389 -0.07452894 -0.8216812 0.1939623 0.7475578
        [,85]       [,86]      [,87]    [,88]     [,89]     [,90]     [,91]
[1,] 0.441213 -0.05607268 -0.6970871 -2.24219 0.5300456 0.8835003 -2.177845
[2,] 0.441213 -0.05607268 -0.6970871 -2.24219 0.5300456 0.8835003 -2.177845
         [,92]    [,93]    [,94]     [,95]      [,96]      [,97]      [,98]
[1,] -1.075001 2.049225 2.862618 -1.217758 -0.9052467 -0.4404532 -0.7250336
[2,] -1.075001 2.049225 2.862618 -1.217758 -0.9052467 -0.4404532 -0.7250336
          [,99]     [,100]
[1,] -0.9128983 -0.1943388
[2,] -0.9128983 -0.1943388
> 
> 
> Max(tmp2)
[1] 2.457199
> Min(tmp2)
[1] -2.185569
> mean(tmp2)
[1] -0.00465884
> Sum(tmp2)
[1] -0.465884
> Var(tmp2)
[1] 0.8424019
> 
> rowMeans(tmp2)
  [1]  0.098785800 -1.242884152 -0.815781075  0.851737132 -0.993357329
  [6]  0.554611360 -1.168331570 -0.400010879 -0.067547093  0.573923282
 [11]  0.074820913  1.297350411  0.733110220  0.122388269 -0.574031233
 [16] -0.134416659  0.029158221  1.034860778 -0.618958581 -1.790900254
 [21]  0.754708561  1.136437610  0.498095611  0.232113424 -0.375811630
 [26]  0.184095826  0.871565084 -1.488253122 -0.654226987 -0.593119936
 [31] -1.843936250  0.379395721 -0.401435071  0.856349444  0.041266471
 [36]  2.457198617 -0.539942673 -1.302037321 -0.376476383  0.763578592
 [41]  0.345915741  0.418220093 -0.473606154  0.519847522 -1.762652012
 [46] -0.008378577 -0.119758539 -0.152320784  0.184041351  0.368802786
 [51] -1.425085422  0.297281638 -2.185568580 -0.773330744  0.851177602
 [56]  2.214803786 -0.273373432  0.625927166 -1.123410929  0.032885748
 [61] -0.152604299  0.497548272  0.530070652  1.056855881 -0.998736294
 [66] -0.336329024 -0.069884898  1.134850032 -0.569639991 -0.004296353
 [71] -0.371976458  0.877279821 -1.246018081 -1.285156702  0.408245134
 [76]  1.765122904  0.640530392  0.042733068  1.396295941 -0.989263459
 [81] -0.664241743  0.816859125 -1.618377976 -0.381561687  1.253420029
 [86] -0.373673337  0.426069297 -0.544169239  0.913962591 -1.918202687
 [91]  1.633137164 -0.158471156  0.230646708  0.701326837  0.448141248
 [96] -0.694538951  0.079191430  0.154811654 -0.264405385  1.443054146
> rowSums(tmp2)
  [1]  0.098785800 -1.242884152 -0.815781075  0.851737132 -0.993357329
  [6]  0.554611360 -1.168331570 -0.400010879 -0.067547093  0.573923282
 [11]  0.074820913  1.297350411  0.733110220  0.122388269 -0.574031233
 [16] -0.134416659  0.029158221  1.034860778 -0.618958581 -1.790900254
 [21]  0.754708561  1.136437610  0.498095611  0.232113424 -0.375811630
 [26]  0.184095826  0.871565084 -1.488253122 -0.654226987 -0.593119936
 [31] -1.843936250  0.379395721 -0.401435071  0.856349444  0.041266471
 [36]  2.457198617 -0.539942673 -1.302037321 -0.376476383  0.763578592
 [41]  0.345915741  0.418220093 -0.473606154  0.519847522 -1.762652012
 [46] -0.008378577 -0.119758539 -0.152320784  0.184041351  0.368802786
 [51] -1.425085422  0.297281638 -2.185568580 -0.773330744  0.851177602
 [56]  2.214803786 -0.273373432  0.625927166 -1.123410929  0.032885748
 [61] -0.152604299  0.497548272  0.530070652  1.056855881 -0.998736294
 [66] -0.336329024 -0.069884898  1.134850032 -0.569639991 -0.004296353
 [71] -0.371976458  0.877279821 -1.246018081 -1.285156702  0.408245134
 [76]  1.765122904  0.640530392  0.042733068  1.396295941 -0.989263459
 [81] -0.664241743  0.816859125 -1.618377976 -0.381561687  1.253420029
 [86] -0.373673337  0.426069297 -0.544169239  0.913962591 -1.918202687
 [91]  1.633137164 -0.158471156  0.230646708  0.701326837  0.448141248
 [96] -0.694538951  0.079191430  0.154811654 -0.264405385  1.443054146
> 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.098785800 -1.242884152 -0.815781075  0.851737132 -0.993357329
  [6]  0.554611360 -1.168331570 -0.400010879 -0.067547093  0.573923282
 [11]  0.074820913  1.297350411  0.733110220  0.122388269 -0.574031233
 [16] -0.134416659  0.029158221  1.034860778 -0.618958581 -1.790900254
 [21]  0.754708561  1.136437610  0.498095611  0.232113424 -0.375811630
 [26]  0.184095826  0.871565084 -1.488253122 -0.654226987 -0.593119936
 [31] -1.843936250  0.379395721 -0.401435071  0.856349444  0.041266471
 [36]  2.457198617 -0.539942673 -1.302037321 -0.376476383  0.763578592
 [41]  0.345915741  0.418220093 -0.473606154  0.519847522 -1.762652012
 [46] -0.008378577 -0.119758539 -0.152320784  0.184041351  0.368802786
 [51] -1.425085422  0.297281638 -2.185568580 -0.773330744  0.851177602
 [56]  2.214803786 -0.273373432  0.625927166 -1.123410929  0.032885748
 [61] -0.152604299  0.497548272  0.530070652  1.056855881 -0.998736294
 [66] -0.336329024 -0.069884898  1.134850032 -0.569639991 -0.004296353
 [71] -0.371976458  0.877279821 -1.246018081 -1.285156702  0.408245134
 [76]  1.765122904  0.640530392  0.042733068  1.396295941 -0.989263459
 [81] -0.664241743  0.816859125 -1.618377976 -0.381561687  1.253420029
 [86] -0.373673337  0.426069297 -0.544169239  0.913962591 -1.918202687
 [91]  1.633137164 -0.158471156  0.230646708  0.701326837  0.448141248
 [96] -0.694538951  0.079191430  0.154811654 -0.264405385  1.443054146
> rowMin(tmp2)
  [1]  0.098785800 -1.242884152 -0.815781075  0.851737132 -0.993357329
  [6]  0.554611360 -1.168331570 -0.400010879 -0.067547093  0.573923282
 [11]  0.074820913  1.297350411  0.733110220  0.122388269 -0.574031233
 [16] -0.134416659  0.029158221  1.034860778 -0.618958581 -1.790900254
 [21]  0.754708561  1.136437610  0.498095611  0.232113424 -0.375811630
 [26]  0.184095826  0.871565084 -1.488253122 -0.654226987 -0.593119936
 [31] -1.843936250  0.379395721 -0.401435071  0.856349444  0.041266471
 [36]  2.457198617 -0.539942673 -1.302037321 -0.376476383  0.763578592
 [41]  0.345915741  0.418220093 -0.473606154  0.519847522 -1.762652012
 [46] -0.008378577 -0.119758539 -0.152320784  0.184041351  0.368802786
 [51] -1.425085422  0.297281638 -2.185568580 -0.773330744  0.851177602
 [56]  2.214803786 -0.273373432  0.625927166 -1.123410929  0.032885748
 [61] -0.152604299  0.497548272  0.530070652  1.056855881 -0.998736294
 [66] -0.336329024 -0.069884898  1.134850032 -0.569639991 -0.004296353
 [71] -0.371976458  0.877279821 -1.246018081 -1.285156702  0.408245134
 [76]  1.765122904  0.640530392  0.042733068  1.396295941 -0.989263459
 [81] -0.664241743  0.816859125 -1.618377976 -0.381561687  1.253420029
 [86] -0.373673337  0.426069297 -0.544169239  0.913962591 -1.918202687
 [91]  1.633137164 -0.158471156  0.230646708  0.701326837  0.448141248
 [96] -0.694538951  0.079191430  0.154811654 -0.264405385  1.443054146
> 
> colMeans(tmp2)
[1] -0.00465884
> colSums(tmp2)
[1] -0.465884
> colVars(tmp2)
[1] 0.8424019
> colSd(tmp2)
[1] 0.9178245
> colMax(tmp2)
[1] 2.457199
> colMin(tmp2)
[1] -2.185569
> colMedians(tmp2)
[1] 0.03707611
> colRanges(tmp2)
          [,1]
[1,] -2.185569
[2,]  2.457199
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.597585059  1.196140464  1.007433324  0.007622189 -1.705565112
 [6]  0.719259565 -0.713667514 -0.247616667  2.127810718  4.728901882
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1898083
[2,] -0.5314657
[3,]  0.2053773
[4,]  0.6249561
[5,]  1.1241454
> 
> rowApply(tmp,sum)
 [1]  1.0680533  1.7883115 -1.8880943  1.7332578  1.5080004 -0.3869562
 [7] -0.8191627  1.4778056  5.6300753 -2.3933868
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    1    2   10    6    4    2    9    3     9
 [2,]    5    5    1    2   10    8    9    3    8     1
 [3,]   10    8    8    9    4    3    1    5    1     6
 [4,]    6    3    6    5    7    1    6   10    9     2
 [5,]    9    9    5    1    1    2    4    7    6     5
 [6,]    3    6    4    7    3    9    8    2    7    10
 [7,]    1    4   10    6    2    5    5    8    5     7
 [8,]    2    2    3    8    9   10    3    4    4     3
 [9,]    4    7    9    4    5    7   10    1    2     8
[10,]    7   10    7    3    8    6    7    6   10     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.7977742  1.4650257 -1.9667982 -1.0263337 -0.6540334  0.2713377
 [7]  0.8773971 -1.4586104 -2.2130795 -1.5238627 -2.1195120  1.1155479
[13]  0.2191795 -5.0497790 -2.7061812  2.0169058  0.8678767  3.7416581
[19]  2.6005983  3.0035020
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0448163
[2,]  0.2791478
[3,]  1.4739935
[4,]  1.5320668
[5,]  2.5573824
> 
> rowApply(tmp,sum)
[1] -6.0056618  2.9353623  1.5556330  0.2253373  3.5479421
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   20    3   18   20   10
[2,]   18   19   11    4    8
[3,]    5   17    5    6    1
[4,]    9    8    7   11   13
[5,]    8    7   14    9    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]        [,5]        [,6]
[1,]  1.4739935  0.8358701 -1.0150249 -0.52254194 -0.54631284  0.66483011
[2,] -1.0448163  1.7186511  1.4001898 -0.36487155 -0.48070498  1.04643281
[3,]  2.5573824 -0.1129294 -0.7928673 -0.64860684  0.35751703 -1.91200509
[4,]  1.5320668 -1.0904166 -0.4208037  0.09172901 -0.07597197  0.07739746
[5,]  0.2791478  0.1138505 -1.1382921  0.41795760  0.09143933  0.39468246
           [,7]       [,8]        [,9]      [,10]      [,11]       [,12]
[1,] -0.7459835 -1.6343991  0.39530963 -1.2582087 -0.8295643  0.02956479
[2,] -0.9424781 -0.2587379  0.05788793 -2.0106057 -0.8477263 -1.14061793
[3,]  2.7673993  1.5513913 -0.49410972  2.7801282 -0.3870963  0.21956961
[4,]  0.7329290 -0.1853453 -1.51325361 -1.5554718 -0.2269822  1.35825524
[5,] -0.9344696 -0.9315194 -0.65891378  0.5202953  0.1718572  0.64877615
          [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,]  0.9521318 -2.1320582 -1.90591215  0.4746948 -0.3954225 0.14457123
[2,]  0.1390747 -0.5430004  0.72944468  1.4898914  0.8172331 0.03614657
[3,] -1.1142153 -0.7002641 -2.46213573 -1.0456979  0.5397248 0.98171469
[4,] -1.0753527 -1.9550970  1.01494807  0.1485708  0.2511766 1.45576625
[5,]  1.3175410  0.2806407 -0.08252606  0.9494467 -0.3448354 1.12345932
          [,19]       [,20]
[1,]  0.3805461 -0.37174574
[2,]  1.2720419  1.86192732
[3,] -0.5696643  0.04039756
[4,]  0.8617332  0.79945979
[5,]  0.6559414  0.67346309
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2     col3       col4      col5      col6       col7
row1 0.9719025 0.0632308 1.324591 -0.1578766 -1.949729 0.6438043 -0.3439778
            col8      col9    col10      col11     col12     col13      col14
row1 -0.09640689 -1.083152 1.863609 0.09938996 -1.804573 -1.370138 -0.5490326
        col15      col16     col17     col18     col19      col20
row1 1.565328 -0.6979065 0.2913738 -0.611923 -1.209247 -0.7847246
> tmp[,"col10"]
          col10
row1  1.8636093
row2  0.5240958
row3  0.7525710
row4 -0.8249878
row5  0.1911781
> tmp[c("row1","row5"),]
          col1       col2      col3       col4      col5       col6       col7
row1 0.9719025  0.0632308 1.3245910 -0.1578766 -1.949729  0.6438043 -0.3439778
row5 1.0318480 -0.2066841 0.6702444 -0.1027227 -2.054403 -0.4632342  0.5117844
            col8       col9     col10      col11      col12      col13
row1 -0.09640689 -1.0831521 1.8636093 0.09938996 -1.8045728 -1.3701384
row5  1.26909589  0.9262231 0.1911781 0.44248640 -0.7164177 -0.5430071
          col14    col15      col16     col17      col18      col19      col20
row1 -0.5490326 1.565328 -0.6979065 0.2913738 -0.6119230 -1.2092470 -0.7847246
row5 -1.2066206 1.704847  0.4613120 0.2763964  0.3492323 -0.5732973 -0.2288127
> tmp[,c("col6","col20")]
           col6      col20
row1  0.6438043 -0.7847246
row2 -0.1381716  0.5360492
row3 -0.2649739 -0.7911241
row4  0.1692289  0.3213366
row5 -0.4632342 -0.2288127
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.6438043 -0.7847246
row5 -0.4632342 -0.2288127
> 
> 
> 
> 
> 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.17252 51.64708 50.66311 47.95744 50.11753 104.1748 49.96099 51.48895
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.32117 50.41119 50.25178 50.70563 50.16551 49.17542 48.16497 48.51623
        col17    col18    col19   col20
row1 49.72488 47.99107 50.29362 104.842
> tmp[,"col10"]
        col10
row1 50.41119
row2 30.04202
row3 30.53966
row4 30.26954
row5 50.41512
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.17252 51.64708 50.66311 47.95744 50.11753 104.1748 49.96099 51.48895
row5 51.52223 50.81291 48.97237 50.18632 49.82654 105.4428 51.85806 49.68609
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.32117 50.41119 50.25178 50.70563 50.16551 49.17542 48.16497 48.51623
row5 51.99982 50.41512 49.66249 50.00092 48.70094 47.82308 51.10365 49.52626
        col17    col18    col19    col20
row1 49.72488 47.99107 50.29362 104.8420
row5 50.71765 49.07341 48.74668 105.1487
> tmp[,c("col6","col20")]
          col6     col20
row1 104.17478 104.84196
row2  75.65713  74.42522
row3  76.29459  74.32677
row4  75.13107  75.72833
row5 105.44280 105.14873
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.1748 104.8420
row5 105.4428 105.1487
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.1748 104.8420
row5 105.4428 105.1487
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.4306855
[2,] -0.1440514
[3,]  0.1699743
[4,]  0.7599805
[5,]  0.8065542
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.2563185  1.3849295
[2,] -0.1856889  0.2654225
[3,]  0.2723753 -0.8790412
[4,] -0.6072931  0.1226013
[5,]  0.4104294  0.6649531
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.2337163  1.9101160
[2,]  1.5053672 -0.6635884
[3,] -0.1702017 -0.2724343
[4,]  1.0608913 -0.2603600
[5,] -0.8418139 -0.9476502
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.2337163
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.2337163
[2,]  1.5053672
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]        [,4]       [,5]      [,6]
row3  0.4069645 -0.4275089 -1.9064556  0.07991955 -0.2582093 1.0989948
row1 -1.4905757 -0.1819682 -0.8235508 -0.84047688  0.4737451 0.6119143
           [,7]      [,8]      [,9]      [,10]      [,11]      [,12]      [,13]
row3 -0.7180908 -2.411903 0.3201465 -1.5354220 -0.1593146  0.2653098 -0.5455379
row1  0.6180720  1.787947 0.6677188 -0.1271525  0.3283343 -1.6395730  0.2637451
         [,14]    [,15]      [,16]     [,17]      [,18]      [,19]      [,20]
row3 0.7875344 1.441425 -0.1888805 0.1175856 -0.6951494 -0.5965217 -1.0119073
row1 1.4301090 1.206891  2.1843880 0.8478790  1.4372401  0.2472052  0.3764409
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
row2 -0.1184646 0.7813291 0.9682624 0.0273609 0.1724191 0.8825997 -0.9445164
          [,8]      [,9]    [,10]
row2 0.2263951 0.4716522 1.095639
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]      [,4]      [,5]     [,6]      [,7]
row5 0.1804522 0.3920143 -0.8059868 -1.085305 0.5164818 1.740842 0.3027046
          [,8]       [,9]      [,10]      [,11]     [,12]     [,13]     [,14]
row5 0.5712941 -0.7194377 0.09022404 -0.2975401 -0.655214 0.8006945 0.1909864
         [,15]     [,16]      [,17]      [,18]      [,19]    [,20]
row5 -0.263202 0.0558472 -0.1688797 -0.1103592 -0.3339955 1.456251
> 
> 
> 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: 0x6015c8cbd710>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f716a9ca5d"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f76fd4b047"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f767329397"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f77c1c818" 
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f7803f6ae" 
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f758fcc47a"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f74b859508"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f759609eb3"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f76865482a"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f717ca50ce"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f7d71789"  
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f71c7882d3"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f761389e62"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f74aa9a8b3"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a77f77e37a5ed"
> 
> 
> ### 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: 0x6015cbdbe780>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6015cbdbe780>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6015cbdbe780>
> rowMedians(tmp)
  [1] -0.071622614 -0.043065572 -0.148301606 -0.066777574  0.259876189
  [6]  0.044252514 -0.335819000  0.341300580 -0.289271120 -0.202703950
 [11] -0.423952566 -0.140524320  0.354636771  0.176974172  0.332191089
 [16] -0.100321900 -0.052403286  0.227727788 -0.038469528 -0.191723153
 [21]  0.357264142  0.172431746 -0.538488588  0.134408941  0.179539204
 [26] -0.174516312  0.141818780  0.357189444 -0.041987265  0.138017649
 [31]  0.033494791  0.202743204  0.653423902 -0.175029587 -0.263444914
 [36] -0.079144829 -0.043880977  0.058938707  0.165503479  0.262487058
 [41]  0.286282450  0.293227239  0.083203212  0.008337438  0.098715476
 [46] -0.365602057 -0.076858282  0.520197512  0.181634390 -0.141452126
 [51] -0.002631016  0.236907255 -0.253447011 -0.120866562 -0.191274272
 [56]  0.231168228 -0.236505255  0.303535393 -0.042245197  0.780039242
 [61]  0.640448180 -0.125764194 -0.277430873 -0.078119906 -0.374032986
 [66] -0.460679283  0.694239217  0.061512740  0.175758097 -0.291480141
 [71]  0.047856841  0.215095919 -0.058976500 -0.226360063 -0.455735783
 [76]  0.145767659 -0.508841771 -0.164632020  0.347355839  0.159731095
 [81]  0.105753692  0.143127186 -0.021492647 -0.337299166 -0.051286348
 [86]  0.082986281 -0.208543108  0.391953383  0.070504752  0.117073255
 [91]  0.097872433  0.453205291 -0.089207405 -0.279050017  0.136190231
 [96]  0.207030430  0.384070029 -0.568988501  0.451751047 -0.117920850
[101]  0.091826991  0.257786512  0.408636420 -0.558525061  0.014941017
[106] -0.313812951 -0.227358836 -0.232840220 -0.609274275  0.084274500
[111]  0.517078267 -0.145116875 -0.313214519  0.320167180 -0.263034138
[116] -0.240296071 -0.071441913 -0.193717779 -0.529568907 -0.306741395
[121]  0.163377736 -0.733925282  0.344360403  0.344943477  0.221132679
[126]  0.149589069  0.467402392 -0.249082073  0.039200768 -0.286503250
[131] -0.184178698  0.142844409  0.620015897 -0.028822650  0.536021645
[136] -0.100404877  0.124519395 -0.810820991 -0.457985189  0.550219978
[141]  0.255002335 -0.432869763  0.153717723  0.375105725 -0.519449460
[146] -0.358353350  0.021817102  0.666605026  0.696258450 -0.278056926
[151]  0.281231229  0.545199801 -0.384364030 -0.144193184  0.087556039
[156] -0.482742735  0.167112249 -0.525419168 -0.029584640  0.437320608
[161]  0.180908778  0.051665308 -0.093580974  0.034399477  0.257378674
[166] -0.333541304  0.104058134 -0.062631976 -0.360054351 -0.090100716
[171]  0.312623733 -0.144108038  0.203067526  0.221691020  0.359871080
[176]  0.890723306 -0.571416416 -0.147906032  0.273084304  0.146285865
[181] -0.188894379  0.157981721  0.306226946 -0.272698793  0.365064514
[186]  0.100873487 -0.348870438  0.057852555  0.042946114  0.295075434
[191] -0.146651266 -0.432713447  0.227316877 -0.234551374 -0.067504921
[196] -0.182872518  0.074546079 -0.942356062 -0.203947269  0.216700716
[201]  0.286172545  0.228007857 -0.488497804 -0.286781692 -0.333490317
[206] -0.341103845  0.456989611 -0.024454199  0.506935001  0.039718308
[211] -0.183254824 -0.233175773  0.059786735  0.012853133 -0.048515158
[216] -0.012930641  0.235214097  0.233441458  0.107747216  0.125765554
[221]  0.120922174  0.031509106  0.111594246 -0.334539589  0.390776905
[226]  0.568531035 -0.044822118 -0.206691038 -0.199047502  0.198298379
> 
> proc.time()
   user  system elapsed 
  1.419   1.456   2.860 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x591e1b13cc10>
> .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: 0x591e1b13cc10>
> .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: 0x591e1b13cc10>
> .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: 0x591e1b13cc10>
> 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: 0x591e1bdff2d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x591e1bdff2d0>
> .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: 0x591e1bdff2d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x591e1bdff2d0>
> .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: 0x591e1bdff2d0>
> 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: 0x591e1c4d4d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x591e1c4d4d70>
> .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: 0x591e1c4d4d70>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x591e1c4d4d70>
> .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: 0x591e1c4d4d70>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x591e1c4d4d70>
> .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: 0x591e1c4d4d70>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x591e1c4d4d70>
> .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: 0x591e1c4d4d70>
> 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: 0x591e1c048370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x591e1c048370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x591e1c048370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x591e1c048370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3a78c01e9c68f5" "BufferedMatrixFile3a78c0d7d0378" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3a78c01e9c68f5" "BufferedMatrixFile3a78c0d7d0378" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x591e1bf93ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x591e1bf93ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x591e1bf93ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x591e1bf93ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x591e1bf93ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x591e1bf93ff0>
> .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: 0x591e1c16c5b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x591e1c16c5b0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x591e1c16c5b0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x591e1c16c5b0>
> 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: 0x591e1d149500>
> .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: 0x591e1d149500>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.266   0.053   0.307 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.241   0.051   0.278 

Example timings