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

This page was generated on 2026-01-06 11:34 -0500 (Tue, 06 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" 4815
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4593
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 253/2332HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-05 13:40 -0500 (Mon, 05 Jan 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
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


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-01-05 21:36:19 -0500 (Mon, 05 Jan 2026)
EndedAt: 2026-01-05 21:36:44 -0500 (Mon, 05 Jan 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) (2025-12-22 r89219)
* 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) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.243   0.057   0.290 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.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 478851 25.6    1048487   56   639317 34.2
Vcells 885659  6.8    8388608   64  2082734 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Jan  5 21:36:34 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Jan  5 21:36:34 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: 0x631b6e4752b0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Jan  5 21:36:35 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Jan  5 21:36:35 2026"
> 
> ColMode(tmp2)
<pointer: 0x631b6e4752b0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]         [,4]
[1,] 99.42485278 -0.1405023 -0.2099804 -0.003625289
[2,]  0.01294009 -1.0553945  1.3870331 -0.135250770
[3,] -1.82648372 -0.6341987 -0.3457582  0.488088037
[4,]  0.78773572 -1.0920990  0.0312176 -2.088494226
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]        [,4]
[1,] 99.42485278 0.1405023 0.2099804 0.003625289
[2,]  0.01294009 1.0553945 1.3870331 0.135250770
[3,]  1.82648372 0.6341987 0.3457582 0.488088037
[4,]  0.78773572 1.0920990 0.0312176 2.088494226
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]       [,4]
[1,] 9.9712012 0.3748364 0.4582362 0.06021038
[2,] 0.1137545 1.0273239 1.1777237 0.36776456
[3,] 1.3514746 0.7963660 0.5880120 0.69863298
[4,] 0.8875448 1.0450354 0.1766850 1.44516235
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.13686 28.88887 29.79234 25.60573
[2,]  26.15049 36.32863 38.16427 28.81290
[3,]  40.34123 33.59786 31.22588 32.47442
[4,]  34.66318 36.54245 26.79807 41.54012
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x631b6eb7c500>
> exp(tmp5)
<pointer: 0x631b6eb7c500>
> log(tmp5,2)
<pointer: 0x631b6eb7c500>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.5115
> Min(tmp5)
[1] 53.29497
> mean(tmp5)
[1] 72.85802
> Sum(tmp5)
[1] 14571.6
> Var(tmp5)
[1] 845.3805
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 86.73421 70.55359 69.42108 72.29646 71.72442 69.57015 73.53940 70.50963
 [9] 72.65773 71.57357
> rowSums(tmp5)
 [1] 1734.684 1411.072 1388.422 1445.929 1434.488 1391.403 1470.788 1410.193
 [9] 1453.155 1431.471
> rowVars(tmp5)
 [1] 8046.86839   63.25989   91.52616   75.42886   73.81251   46.95843
 [7]   95.22455   35.75970   55.89994   27.66618
> rowSd(tmp5)
 [1] 89.704339  7.953609  9.566931  8.684979  8.591421  6.852622  9.758307
 [8]  5.979941  7.476626  5.259865
> rowMax(tmp5)
 [1] 466.51152  79.92837  87.75122  86.46031  94.31463  79.90706  85.66349
 [8]  79.49754  84.62832  81.17865
> rowMin(tmp5)
 [1] 53.29497 54.42881 55.03333 55.77667 60.13616 57.97670 53.60277 59.32015
 [9] 58.42323 61.62094
> 
> colMeans(tmp5)
 [1] 109.35491  68.95872  70.39429  73.52338  73.87168  76.01263  68.91092
 [8]  66.25119  69.23011  67.70594  74.97256  69.88472  67.20245  71.72825
[15]  68.25288  71.48707  74.82424  71.75392  72.13980  70.70077
> colSums(tmp5)
 [1] 1093.5491  689.5872  703.9429  735.2338  738.7168  760.1263  689.1092
 [8]  662.5119  692.3011  677.0594  749.7256  698.8472  672.0245  717.2825
[15]  682.5288  714.8707  748.2424  717.5392  721.3980  707.0077
> colVars(tmp5)
 [1] 15831.43630    37.80149    59.33329   121.33051    42.04310    11.65195
 [7]    46.99166    60.00770   117.76671    57.49752   105.39663    40.34994
[13]    71.64969    50.66724    80.52496    40.22668    58.56281     5.23104
[19]    57.69682    81.05776
> colSd(tmp5)
 [1] 125.823036   6.148291   7.702810  11.015013   6.484065   3.413495
 [7]   6.855046   7.746464  10.852037   7.582712  10.266286   6.352160
[13]   8.464614   7.118093   8.973570   6.342451   7.652634   2.287147
[19]   7.595842   9.003209
> colMax(tmp5)
 [1] 466.51152  76.48952  79.43393  86.46031  82.32837  82.55369  79.99301
 [8]  82.57699  87.75122  79.26516  94.31463  79.90706  79.63290  82.84886
[15]  83.63603  79.95145  84.62832  76.68629  82.76951  82.89955
> colMin(tmp5)
 [1] 54.42881 60.12839 55.77667 53.29497 64.16486 71.63969 58.11500 57.37290
 [9] 55.00788 57.98628 55.40658 58.34224 53.60277 60.95623 57.23199 61.96344
[17] 61.25360 68.61313 58.42323 55.03333
> 
> 
> ### 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] 86.73421 70.55359 69.42108       NA 71.72442 69.57015 73.53940 70.50963
 [9] 72.65773 71.57357
> rowSums(tmp5)
 [1] 1734.684 1411.072 1388.422       NA 1434.488 1391.403 1470.788 1410.193
 [9] 1453.155 1431.471
> rowVars(tmp5)
 [1] 8046.86839   63.25989   91.52616   79.59634   73.81251   46.95843
 [7]   95.22455   35.75970   55.89994   27.66618
> rowSd(tmp5)
 [1] 89.704339  7.953609  9.566931  8.921678  8.591421  6.852622  9.758307
 [8]  5.979941  7.476626  5.259865
> rowMax(tmp5)
 [1] 466.51152  79.92837  87.75122        NA  94.31463  79.90706  85.66349
 [8]  79.49754  84.62832  81.17865
> rowMin(tmp5)
 [1] 53.29497 54.42881 55.03333       NA 60.13616 57.97670 53.60277 59.32015
 [9] 58.42323 61.62094
> 
> colMeans(tmp5)
 [1] 109.35491  68.95872  70.39429  73.52338  73.87168  76.01263  68.91092
 [8]  66.25119  69.23011  67.70594  74.97256  69.88472  67.20245  71.72825
[15]  68.25288  71.48707  74.82424        NA  72.13980  70.70077
> colSums(tmp5)
 [1] 1093.5491  689.5872  703.9429  735.2338  738.7168  760.1263  689.1092
 [8]  662.5119  692.3011  677.0594  749.7256  698.8472  672.0245  717.2825
[15]  682.5288  714.8707  748.2424        NA  721.3980  707.0077
> colVars(tmp5)
 [1] 15831.43630    37.80149    59.33329   121.33051    42.04310    11.65195
 [7]    46.99166    60.00770   117.76671    57.49752   105.39663    40.34994
[13]    71.64969    50.66724    80.52496    40.22668    58.56281          NA
[19]    57.69682    81.05776
> colSd(tmp5)
 [1] 125.823036   6.148291   7.702810  11.015013   6.484065   3.413495
 [7]   6.855046   7.746464  10.852037   7.582712  10.266286   6.352160
[13]   8.464614   7.118093   8.973570   6.342451   7.652634         NA
[19]   7.595842   9.003209
> colMax(tmp5)
 [1] 466.51152  76.48952  79.43393  86.46031  82.32837  82.55369  79.99301
 [8]  82.57699  87.75122  79.26516  94.31463  79.90706  79.63290  82.84886
[15]  83.63603  79.95145  84.62832        NA  82.76951  82.89955
> colMin(tmp5)
 [1] 54.42881 60.12839 55.77667 53.29497 64.16486 71.63969 58.11500 57.37290
 [9] 55.00788 57.98628 55.40658 58.34224 53.60277 60.95623 57.23199 61.96344
[17] 61.25360       NA 58.42323 55.03333
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.5115
> Min(tmp5,na.rm=TRUE)
[1] 53.29497
> mean(tmp5,na.rm=TRUE)
[1] 72.85769
> Sum(tmp5,na.rm=TRUE)
[1] 14498.68
> Var(tmp5,na.rm=TRUE)
[1] 849.65
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 86.73421 70.55359 69.42108 72.26345 71.72442 69.57015 73.53940 70.50963
 [9] 72.65773 71.57357
> rowSums(tmp5,na.rm=TRUE)
 [1] 1734.684 1411.072 1388.422 1373.006 1434.488 1391.403 1470.788 1410.193
 [9] 1453.155 1431.471
> rowVars(tmp5,na.rm=TRUE)
 [1] 8046.86839   63.25989   91.52616   79.59634   73.81251   46.95843
 [7]   95.22455   35.75970   55.89994   27.66618
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.704339  7.953609  9.566931  8.921678  8.591421  6.852622  9.758307
 [8]  5.979941  7.476626  5.259865
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.51152  79.92837  87.75122  86.46031  94.31463  79.90706  85.66349
 [8]  79.49754  84.62832  81.17865
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.29497 54.42881 55.03333 55.77667 60.13616 57.97670 53.60277 59.32015
 [9] 58.42323 61.62094
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.35491  68.95872  70.39429  73.52338  73.87168  76.01263  68.91092
 [8]  66.25119  69.23011  67.70594  74.97256  69.88472  67.20245  71.72825
[15]  68.25288  71.48707  74.82424  71.62394  72.13980  70.70077
> colSums(tmp5,na.rm=TRUE)
 [1] 1093.5491  689.5872  703.9429  735.2338  738.7168  760.1263  689.1092
 [8]  662.5119  692.3011  677.0594  749.7256  698.8472  672.0245  717.2825
[15]  682.5288  714.8707  748.2424  644.6155  721.3980  707.0077
> colVars(tmp5,na.rm=TRUE)
 [1] 15831.436304    37.801487    59.333288   121.330506    42.043098
 [6]    11.651950    46.991655    60.007699   117.766712    57.497524
[11]   105.396625    40.349939    71.649695    50.667242    80.524962
[16]    40.226682    58.562806     5.694847    57.696821    81.057764
> colSd(tmp5,na.rm=TRUE)
 [1] 125.823036   6.148291   7.702810  11.015013   6.484065   3.413495
 [7]   6.855046   7.746464  10.852037   7.582712  10.266286   6.352160
[13]   8.464614   7.118093   8.973570   6.342451   7.652634   2.386388
[19]   7.595842   9.003209
> colMax(tmp5,na.rm=TRUE)
 [1] 466.51152  76.48952  79.43393  86.46031  82.32837  82.55369  79.99301
 [8]  82.57699  87.75122  79.26516  94.31463  79.90706  79.63290  82.84886
[15]  83.63603  79.95145  84.62832  76.68629  82.76951  82.89955
> colMin(tmp5,na.rm=TRUE)
 [1] 54.42881 60.12839 55.77667 53.29497 64.16486 71.63969 58.11500 57.37290
 [9] 55.00788 57.98628 55.40658 58.34224 53.60277 60.95623 57.23199 61.96344
[17] 61.25360 68.61313 58.42323 55.03333
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 86.73421 70.55359 69.42108      NaN 71.72442 69.57015 73.53940 70.50963
 [9] 72.65773 71.57357
> rowSums(tmp5,na.rm=TRUE)
 [1] 1734.684 1411.072 1388.422    0.000 1434.488 1391.403 1470.788 1410.193
 [9] 1453.155 1431.471
> rowVars(tmp5,na.rm=TRUE)
 [1] 8046.86839   63.25989   91.52616         NA   73.81251   46.95843
 [7]   95.22455   35.75970   55.89994   27.66618
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.704339  7.953609  9.566931        NA  8.591421  6.852622  9.758307
 [8]  5.979941  7.476626  5.259865
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.51152  79.92837  87.75122        NA  94.31463  79.90706  85.66349
 [8]  79.49754  84.62832  81.17865
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.29497 54.42881 55.03333       NA 60.13616 57.97670 53.60277 59.32015
 [9] 58.42323 61.62094
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.48913  68.16987  72.01847  72.08595  72.97192  76.06224  69.84767
 [8]  67.23766  68.93635  68.30927  75.20355  70.14022  67.17600  71.48044
[15]  66.54364  71.53240  74.07253       NaN  72.16175  69.34535
> colSums(tmp5,na.rm=TRUE)
 [1] 1021.4022  613.5289  648.1662  648.7735  656.7473  684.5601  628.6290
 [8]  605.1390  620.4272  614.7834  676.8320  631.2620  604.5840  643.3240
[15]  598.8928  643.7916  666.6527    0.0000  649.4557  624.1081
> colVars(tmp5,na.rm=TRUE)
 [1] 17618.08282    35.52606    37.07288   113.25180    38.19085    13.08076
 [7]    42.99380    56.56089   131.51673    60.58965   117.97093    44.65924
[13]    80.59803    56.30981    57.72372    45.23191    59.52598          NA
[19]    64.90351    70.52189
> colSd(tmp5,na.rm=TRUE)
 [1] 132.733126   5.960374   6.088750  10.641983   6.179875   3.616733
 [7]   6.556966   7.520697  11.468074   7.783935  10.861442   6.682757
[13]   8.977641   7.503986   7.597613   6.725467   7.715308         NA
[19]   8.056271   8.397731
> colMax(tmp5,na.rm=TRUE)
 [1] 466.51152  76.48952  79.43393  84.01778  82.32837  82.55369  79.99301
 [8]  82.57699  87.75122  79.26516  94.31463  79.90706  79.63290  82.84886
[15]  77.16080  79.95145  84.62832      -Inf  82.76951  81.10027
> colMin(tmp5,na.rm=TRUE)
 [1] 54.42881 60.12839 62.00886 53.29497 64.16486 71.63969 58.11500 59.54226
 [9] 55.00788 57.98628 55.40658 58.34224 53.60277 60.95623 57.23199 61.96344
[17] 61.25360      Inf 58.42323 55.03333
> 
> 
> 
> 
> 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] 125.76997 203.31321 169.25568 404.48010 181.02685 290.46456 138.78192
 [8] 306.11612 201.04124  95.05424
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 125.76997 203.31321 169.25568 404.48010 181.02685 290.46456 138.78192
 [8] 306.11612 201.04124  95.05424
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.273737e-13  2.842171e-14 -2.842171e-14  2.273737e-13  2.842171e-14
 [6] -1.421085e-14 -5.684342e-14  2.557954e-13  1.278977e-13 -2.842171e-14
[11] -2.984279e-13  5.684342e-14  5.115908e-13 -1.421085e-14  5.684342e-14
[16] -2.842171e-14  1.705303e-13  0.000000e+00 -1.421085e-14 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   3 
3   19 
2   4 
6   6 
9   15 
8   18 
7   13 
8   6 
1   11 
8   10 
1   20 
8   2 
10   3 
3   20 
9   18 
10   15 
3   13 
7   3 
5   15 
3   8 
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.700212
> Min(tmp)
[1] -2.419866
> mean(tmp)
[1] 0.143221
> Sum(tmp)
[1] 14.3221
> Var(tmp)
[1] 1.081938
> 
> rowMeans(tmp)
[1] 0.143221
> rowSums(tmp)
[1] 14.3221
> rowVars(tmp)
[1] 1.081938
> rowSd(tmp)
[1] 1.040162
> rowMax(tmp)
[1] 2.700212
> rowMin(tmp)
[1] -2.419866
> 
> colMeans(tmp)
  [1] -0.85556083 -0.55538251  0.31556161 -0.37351147  0.11501822  1.50951741
  [7] -0.70928633  1.09035891  1.71916338 -0.01284316 -0.93363161  0.36510399
 [13]  0.55693555  0.47998905 -0.71536879  1.01263380 -0.10622140  0.36482408
 [19] -1.36018795 -1.00384425 -0.88848523 -0.38350858  1.66850586 -1.12585319
 [25]  1.49473218  0.32576627 -0.34563086 -0.69280834 -2.41986585 -0.07571651
 [31] -0.32768696  1.42575701  0.48224776  0.21067309  0.30979396  1.71392291
 [37]  0.17217039  0.13079414  2.40070320  1.75221037  0.02735658  1.27056685
 [43]  1.09762579  0.24079350  0.51134501 -0.89544809 -0.46128639 -1.71631220
 [49]  1.31144690  0.92899532 -0.73512147  0.45482553  0.11005897 -0.63451293
 [55]  0.79513540 -0.51570204  1.09550972  1.26595773  0.02614560 -0.83328645
 [61]  0.26329115  0.60479799 -0.53662296 -1.81604446 -2.09864664 -0.99446974
 [67]  0.43798850 -2.26363220  1.45736369 -0.50449232  0.81616322 -0.44356455
 [73]  1.36607987  0.53204016  1.09452610  2.70021179  0.87176331  1.54740480
 [79]  0.03874004 -0.42270634  1.77362529  1.49065296 -1.60806550  0.28964705
 [85]  0.20468142  0.57496488 -0.15551790 -1.44189903 -0.86304716  1.19705218
 [91] -1.02454296 -0.67638530 -0.07446313 -1.36877309  0.23703365  1.08892980
 [97]  0.08420625  0.16283119  0.24227418  1.46361667
> colSums(tmp)
  [1] -0.85556083 -0.55538251  0.31556161 -0.37351147  0.11501822  1.50951741
  [7] -0.70928633  1.09035891  1.71916338 -0.01284316 -0.93363161  0.36510399
 [13]  0.55693555  0.47998905 -0.71536879  1.01263380 -0.10622140  0.36482408
 [19] -1.36018795 -1.00384425 -0.88848523 -0.38350858  1.66850586 -1.12585319
 [25]  1.49473218  0.32576627 -0.34563086 -0.69280834 -2.41986585 -0.07571651
 [31] -0.32768696  1.42575701  0.48224776  0.21067309  0.30979396  1.71392291
 [37]  0.17217039  0.13079414  2.40070320  1.75221037  0.02735658  1.27056685
 [43]  1.09762579  0.24079350  0.51134501 -0.89544809 -0.46128639 -1.71631220
 [49]  1.31144690  0.92899532 -0.73512147  0.45482553  0.11005897 -0.63451293
 [55]  0.79513540 -0.51570204  1.09550972  1.26595773  0.02614560 -0.83328645
 [61]  0.26329115  0.60479799 -0.53662296 -1.81604446 -2.09864664 -0.99446974
 [67]  0.43798850 -2.26363220  1.45736369 -0.50449232  0.81616322 -0.44356455
 [73]  1.36607987  0.53204016  1.09452610  2.70021179  0.87176331  1.54740480
 [79]  0.03874004 -0.42270634  1.77362529  1.49065296 -1.60806550  0.28964705
 [85]  0.20468142  0.57496488 -0.15551790 -1.44189903 -0.86304716  1.19705218
 [91] -1.02454296 -0.67638530 -0.07446313 -1.36877309  0.23703365  1.08892980
 [97]  0.08420625  0.16283119  0.24227418  1.46361667
> 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.85556083 -0.55538251  0.31556161 -0.37351147  0.11501822  1.50951741
  [7] -0.70928633  1.09035891  1.71916338 -0.01284316 -0.93363161  0.36510399
 [13]  0.55693555  0.47998905 -0.71536879  1.01263380 -0.10622140  0.36482408
 [19] -1.36018795 -1.00384425 -0.88848523 -0.38350858  1.66850586 -1.12585319
 [25]  1.49473218  0.32576627 -0.34563086 -0.69280834 -2.41986585 -0.07571651
 [31] -0.32768696  1.42575701  0.48224776  0.21067309  0.30979396  1.71392291
 [37]  0.17217039  0.13079414  2.40070320  1.75221037  0.02735658  1.27056685
 [43]  1.09762579  0.24079350  0.51134501 -0.89544809 -0.46128639 -1.71631220
 [49]  1.31144690  0.92899532 -0.73512147  0.45482553  0.11005897 -0.63451293
 [55]  0.79513540 -0.51570204  1.09550972  1.26595773  0.02614560 -0.83328645
 [61]  0.26329115  0.60479799 -0.53662296 -1.81604446 -2.09864664 -0.99446974
 [67]  0.43798850 -2.26363220  1.45736369 -0.50449232  0.81616322 -0.44356455
 [73]  1.36607987  0.53204016  1.09452610  2.70021179  0.87176331  1.54740480
 [79]  0.03874004 -0.42270634  1.77362529  1.49065296 -1.60806550  0.28964705
 [85]  0.20468142  0.57496488 -0.15551790 -1.44189903 -0.86304716  1.19705218
 [91] -1.02454296 -0.67638530 -0.07446313 -1.36877309  0.23703365  1.08892980
 [97]  0.08420625  0.16283119  0.24227418  1.46361667
> colMin(tmp)
  [1] -0.85556083 -0.55538251  0.31556161 -0.37351147  0.11501822  1.50951741
  [7] -0.70928633  1.09035891  1.71916338 -0.01284316 -0.93363161  0.36510399
 [13]  0.55693555  0.47998905 -0.71536879  1.01263380 -0.10622140  0.36482408
 [19] -1.36018795 -1.00384425 -0.88848523 -0.38350858  1.66850586 -1.12585319
 [25]  1.49473218  0.32576627 -0.34563086 -0.69280834 -2.41986585 -0.07571651
 [31] -0.32768696  1.42575701  0.48224776  0.21067309  0.30979396  1.71392291
 [37]  0.17217039  0.13079414  2.40070320  1.75221037  0.02735658  1.27056685
 [43]  1.09762579  0.24079350  0.51134501 -0.89544809 -0.46128639 -1.71631220
 [49]  1.31144690  0.92899532 -0.73512147  0.45482553  0.11005897 -0.63451293
 [55]  0.79513540 -0.51570204  1.09550972  1.26595773  0.02614560 -0.83328645
 [61]  0.26329115  0.60479799 -0.53662296 -1.81604446 -2.09864664 -0.99446974
 [67]  0.43798850 -2.26363220  1.45736369 -0.50449232  0.81616322 -0.44356455
 [73]  1.36607987  0.53204016  1.09452610  2.70021179  0.87176331  1.54740480
 [79]  0.03874004 -0.42270634  1.77362529  1.49065296 -1.60806550  0.28964705
 [85]  0.20468142  0.57496488 -0.15551790 -1.44189903 -0.86304716  1.19705218
 [91] -1.02454296 -0.67638530 -0.07446313 -1.36877309  0.23703365  1.08892980
 [97]  0.08420625  0.16283119  0.24227418  1.46361667
> colMedians(tmp)
  [1] -0.85556083 -0.55538251  0.31556161 -0.37351147  0.11501822  1.50951741
  [7] -0.70928633  1.09035891  1.71916338 -0.01284316 -0.93363161  0.36510399
 [13]  0.55693555  0.47998905 -0.71536879  1.01263380 -0.10622140  0.36482408
 [19] -1.36018795 -1.00384425 -0.88848523 -0.38350858  1.66850586 -1.12585319
 [25]  1.49473218  0.32576627 -0.34563086 -0.69280834 -2.41986585 -0.07571651
 [31] -0.32768696  1.42575701  0.48224776  0.21067309  0.30979396  1.71392291
 [37]  0.17217039  0.13079414  2.40070320  1.75221037  0.02735658  1.27056685
 [43]  1.09762579  0.24079350  0.51134501 -0.89544809 -0.46128639 -1.71631220
 [49]  1.31144690  0.92899532 -0.73512147  0.45482553  0.11005897 -0.63451293
 [55]  0.79513540 -0.51570204  1.09550972  1.26595773  0.02614560 -0.83328645
 [61]  0.26329115  0.60479799 -0.53662296 -1.81604446 -2.09864664 -0.99446974
 [67]  0.43798850 -2.26363220  1.45736369 -0.50449232  0.81616322 -0.44356455
 [73]  1.36607987  0.53204016  1.09452610  2.70021179  0.87176331  1.54740480
 [79]  0.03874004 -0.42270634  1.77362529  1.49065296 -1.60806550  0.28964705
 [85]  0.20468142  0.57496488 -0.15551790 -1.44189903 -0.86304716  1.19705218
 [91] -1.02454296 -0.67638530 -0.07446313 -1.36877309  0.23703365  1.08892980
 [97]  0.08420625  0.16283119  0.24227418  1.46361667
> colRanges(tmp)
           [,1]       [,2]      [,3]       [,4]      [,5]     [,6]       [,7]
[1,] -0.8555608 -0.5553825 0.3155616 -0.3735115 0.1150182 1.509517 -0.7092863
[2,] -0.8555608 -0.5553825 0.3155616 -0.3735115 0.1150182 1.509517 -0.7092863
         [,8]     [,9]       [,10]      [,11]    [,12]     [,13]     [,14]
[1,] 1.090359 1.719163 -0.01284316 -0.9336316 0.365104 0.5569355 0.4799891
[2,] 1.090359 1.719163 -0.01284316 -0.9336316 0.365104 0.5569355 0.4799891
          [,15]    [,16]      [,17]     [,18]     [,19]     [,20]      [,21]
[1,] -0.7153688 1.012634 -0.1062214 0.3648241 -1.360188 -1.003844 -0.8884852
[2,] -0.7153688 1.012634 -0.1062214 0.3648241 -1.360188 -1.003844 -0.8884852
          [,22]    [,23]     [,24]    [,25]     [,26]      [,27]      [,28]
[1,] -0.3835086 1.668506 -1.125853 1.494732 0.3257663 -0.3456309 -0.6928083
[2,] -0.3835086 1.668506 -1.125853 1.494732 0.3257663 -0.3456309 -0.6928083
         [,29]       [,30]     [,31]    [,32]     [,33]     [,34]    [,35]
[1,] -2.419866 -0.07571651 -0.327687 1.425757 0.4822478 0.2106731 0.309794
[2,] -2.419866 -0.07571651 -0.327687 1.425757 0.4822478 0.2106731 0.309794
        [,36]     [,37]     [,38]    [,39]   [,40]      [,41]    [,42]    [,43]
[1,] 1.713923 0.1721704 0.1307941 2.400703 1.75221 0.02735658 1.270567 1.097626
[2,] 1.713923 0.1721704 0.1307941 2.400703 1.75221 0.02735658 1.270567 1.097626
         [,44]    [,45]      [,46]      [,47]     [,48]    [,49]     [,50]
[1,] 0.2407935 0.511345 -0.8954481 -0.4612864 -1.716312 1.311447 0.9289953
[2,] 0.2407935 0.511345 -0.8954481 -0.4612864 -1.716312 1.311447 0.9289953
          [,51]     [,52]    [,53]      [,54]     [,55]     [,56]   [,57]
[1,] -0.7351215 0.4548255 0.110059 -0.6345129 0.7951354 -0.515702 1.09551
[2,] -0.7351215 0.4548255 0.110059 -0.6345129 0.7951354 -0.515702 1.09551
        [,58]     [,59]      [,60]     [,61]    [,62]     [,63]     [,64]
[1,] 1.265958 0.0261456 -0.8332864 0.2632911 0.604798 -0.536623 -1.816044
[2,] 1.265958 0.0261456 -0.8332864 0.2632911 0.604798 -0.536623 -1.816044
         [,65]      [,66]     [,67]     [,68]    [,69]      [,70]     [,71]
[1,] -2.098647 -0.9944697 0.4379885 -2.263632 1.457364 -0.5044923 0.8161632
[2,] -2.098647 -0.9944697 0.4379885 -2.263632 1.457364 -0.5044923 0.8161632
          [,72]   [,73]     [,74]    [,75]    [,76]     [,77]    [,78]
[1,] -0.4435646 1.36608 0.5320402 1.094526 2.700212 0.8717633 1.547405
[2,] -0.4435646 1.36608 0.5320402 1.094526 2.700212 0.8717633 1.547405
          [,79]      [,80]    [,81]    [,82]     [,83]    [,84]     [,85]
[1,] 0.03874004 -0.4227063 1.773625 1.490653 -1.608066 0.289647 0.2046814
[2,] 0.03874004 -0.4227063 1.773625 1.490653 -1.608066 0.289647 0.2046814
         [,86]      [,87]     [,88]      [,89]    [,90]     [,91]      [,92]
[1,] 0.5749649 -0.1555179 -1.441899 -0.8630472 1.197052 -1.024543 -0.6763853
[2,] 0.5749649 -0.1555179 -1.441899 -0.8630472 1.197052 -1.024543 -0.6763853
           [,93]     [,94]     [,95]   [,96]      [,97]     [,98]     [,99]
[1,] -0.07446313 -1.368773 0.2370336 1.08893 0.08420625 0.1628312 0.2422742
[2,] -0.07446313 -1.368773 0.2370336 1.08893 0.08420625 0.1628312 0.2422742
       [,100]
[1,] 1.463617
[2,] 1.463617
> 
> 
> Max(tmp2)
[1] 2.110904
> Min(tmp2)
[1] -2.429587
> mean(tmp2)
[1] -0.05692503
> Sum(tmp2)
[1] -5.692503
> Var(tmp2)
[1] 0.7775179
> 
> rowMeans(tmp2)
  [1]  0.47787789  1.19771159 -0.09686490 -0.74423531 -1.40270286 -0.34077495
  [7]  0.03319939 -0.41588675  1.36424511  0.09874971 -0.81825212  1.08681309
 [13]  0.09536982 -0.24872474  1.88850459 -1.07059150 -1.35525122 -0.67951850
 [19] -0.58741718 -0.63761871 -1.45289668  0.34497125  0.06351485  0.46547817
 [25] -0.33285899  2.11090369  0.68664150  0.88970045  0.23052625 -0.40018797
 [31]  0.81925503 -0.98162476  0.09712280  1.38784181  1.19144717 -0.07368061
 [37]  0.35439992 -0.06709913 -2.42958663  0.62280975  0.59856200 -0.25320099
 [43] -0.94756042  0.13376824 -2.11275679  0.42992664 -0.27534392 -0.48273778
 [49] -0.12063515  0.60846553  0.20175076 -0.64728703  0.44007644 -0.16405106
 [55] -0.31700601 -0.02731981 -0.16000359 -0.59831818 -1.50649843 -0.69021767
 [61]  0.23458333 -0.01669753  0.36451809 -0.48117029 -0.07620102  1.01487296
 [67] -1.51841327  0.32307773 -1.18830268 -0.33736037 -1.23528997 -1.16240477
 [73]  0.35746367  0.96653405  0.40098487 -0.07305460  0.70958528  0.02188681
 [79] -0.94962728 -0.15383640 -0.69913972  1.48562179 -0.35841640  0.01986986
 [85] -1.53927479 -0.01820191  0.61885101 -1.32695100 -1.87927212  0.77109524
 [91]  0.23597043  0.28838655 -0.19452244  0.52306577 -1.05905415  0.76878114
 [97]  0.20761900  2.04043377  1.36187832  0.37868454
> rowSums(tmp2)
  [1]  0.47787789  1.19771159 -0.09686490 -0.74423531 -1.40270286 -0.34077495
  [7]  0.03319939 -0.41588675  1.36424511  0.09874971 -0.81825212  1.08681309
 [13]  0.09536982 -0.24872474  1.88850459 -1.07059150 -1.35525122 -0.67951850
 [19] -0.58741718 -0.63761871 -1.45289668  0.34497125  0.06351485  0.46547817
 [25] -0.33285899  2.11090369  0.68664150  0.88970045  0.23052625 -0.40018797
 [31]  0.81925503 -0.98162476  0.09712280  1.38784181  1.19144717 -0.07368061
 [37]  0.35439992 -0.06709913 -2.42958663  0.62280975  0.59856200 -0.25320099
 [43] -0.94756042  0.13376824 -2.11275679  0.42992664 -0.27534392 -0.48273778
 [49] -0.12063515  0.60846553  0.20175076 -0.64728703  0.44007644 -0.16405106
 [55] -0.31700601 -0.02731981 -0.16000359 -0.59831818 -1.50649843 -0.69021767
 [61]  0.23458333 -0.01669753  0.36451809 -0.48117029 -0.07620102  1.01487296
 [67] -1.51841327  0.32307773 -1.18830268 -0.33736037 -1.23528997 -1.16240477
 [73]  0.35746367  0.96653405  0.40098487 -0.07305460  0.70958528  0.02188681
 [79] -0.94962728 -0.15383640 -0.69913972  1.48562179 -0.35841640  0.01986986
 [85] -1.53927479 -0.01820191  0.61885101 -1.32695100 -1.87927212  0.77109524
 [91]  0.23597043  0.28838655 -0.19452244  0.52306577 -1.05905415  0.76878114
 [97]  0.20761900  2.04043377  1.36187832  0.37868454
> 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.47787789  1.19771159 -0.09686490 -0.74423531 -1.40270286 -0.34077495
  [7]  0.03319939 -0.41588675  1.36424511  0.09874971 -0.81825212  1.08681309
 [13]  0.09536982 -0.24872474  1.88850459 -1.07059150 -1.35525122 -0.67951850
 [19] -0.58741718 -0.63761871 -1.45289668  0.34497125  0.06351485  0.46547817
 [25] -0.33285899  2.11090369  0.68664150  0.88970045  0.23052625 -0.40018797
 [31]  0.81925503 -0.98162476  0.09712280  1.38784181  1.19144717 -0.07368061
 [37]  0.35439992 -0.06709913 -2.42958663  0.62280975  0.59856200 -0.25320099
 [43] -0.94756042  0.13376824 -2.11275679  0.42992664 -0.27534392 -0.48273778
 [49] -0.12063515  0.60846553  0.20175076 -0.64728703  0.44007644 -0.16405106
 [55] -0.31700601 -0.02731981 -0.16000359 -0.59831818 -1.50649843 -0.69021767
 [61]  0.23458333 -0.01669753  0.36451809 -0.48117029 -0.07620102  1.01487296
 [67] -1.51841327  0.32307773 -1.18830268 -0.33736037 -1.23528997 -1.16240477
 [73]  0.35746367  0.96653405  0.40098487 -0.07305460  0.70958528  0.02188681
 [79] -0.94962728 -0.15383640 -0.69913972  1.48562179 -0.35841640  0.01986986
 [85] -1.53927479 -0.01820191  0.61885101 -1.32695100 -1.87927212  0.77109524
 [91]  0.23597043  0.28838655 -0.19452244  0.52306577 -1.05905415  0.76878114
 [97]  0.20761900  2.04043377  1.36187832  0.37868454
> rowMin(tmp2)
  [1]  0.47787789  1.19771159 -0.09686490 -0.74423531 -1.40270286 -0.34077495
  [7]  0.03319939 -0.41588675  1.36424511  0.09874971 -0.81825212  1.08681309
 [13]  0.09536982 -0.24872474  1.88850459 -1.07059150 -1.35525122 -0.67951850
 [19] -0.58741718 -0.63761871 -1.45289668  0.34497125  0.06351485  0.46547817
 [25] -0.33285899  2.11090369  0.68664150  0.88970045  0.23052625 -0.40018797
 [31]  0.81925503 -0.98162476  0.09712280  1.38784181  1.19144717 -0.07368061
 [37]  0.35439992 -0.06709913 -2.42958663  0.62280975  0.59856200 -0.25320099
 [43] -0.94756042  0.13376824 -2.11275679  0.42992664 -0.27534392 -0.48273778
 [49] -0.12063515  0.60846553  0.20175076 -0.64728703  0.44007644 -0.16405106
 [55] -0.31700601 -0.02731981 -0.16000359 -0.59831818 -1.50649843 -0.69021767
 [61]  0.23458333 -0.01669753  0.36451809 -0.48117029 -0.07620102  1.01487296
 [67] -1.51841327  0.32307773 -1.18830268 -0.33736037 -1.23528997 -1.16240477
 [73]  0.35746367  0.96653405  0.40098487 -0.07305460  0.70958528  0.02188681
 [79] -0.94962728 -0.15383640 -0.69913972  1.48562179 -0.35841640  0.01986986
 [85] -1.53927479 -0.01820191  0.61885101 -1.32695100 -1.87927212  0.77109524
 [91]  0.23597043  0.28838655 -0.19452244  0.52306577 -1.05905415  0.76878114
 [97]  0.20761900  2.04043377  1.36187832  0.37868454
> 
> colMeans(tmp2)
[1] -0.05692503
> colSums(tmp2)
[1] -5.692503
> colVars(tmp2)
[1] 0.7775179
> colSd(tmp2)
[1] 0.8817698
> colMax(tmp2)
[1] 2.110904
> colMin(tmp2)
[1] -2.429587
> colMedians(tmp2)
[1] -0.02276086
> colRanges(tmp2)
          [,1]
[1,] -2.429587
[2,]  2.110904
> 
> 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.2164982 -4.5249469 -3.5319182  4.2377240 -1.3717349  4.7401688
 [7]  6.3225137  1.0911217  1.9666315  5.9318299
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.72564326
[2,] -0.41664208
[3,]  0.05017492
[4,]  0.47023324
[5,]  0.61660498
> 
> rowApply(tmp,sum)
 [1] -1.8801918 -1.1540391 -0.5917600  2.9096708 -0.2796122  0.3417871
 [7]  2.3364104  4.3503659  3.5775413  5.4677152
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    3    4    3    7    7    5    6    6     5
 [2,]    6    1    5    2    2    3    4    5    7     2
 [3,]    5    2    3    5    6    6   10    2    1     6
 [4,]    7    9    8    4    1    8    8    7    8     1
 [5,]    1    6    6    7    3    5    1    8    5     9
 [6,]    9    5    7    8    8    9    3    1   10     4
 [7,]   10    4    9    6    9    1    7   10    4     7
 [8,]    3   10    1    1    4    4    9    4    9     3
 [9,]    8    7    2    9    5   10    2    3    2     8
[10,]    2    8   10   10   10    2    6    9    3    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  5.21521937 -1.76097070  5.50805903  2.83003972  5.94367221  1.50322543
 [7] -3.16539547 -1.47768463 -4.42012123 -0.14547134 -4.18505855  0.14676228
[13]  0.33309496  0.04433698  1.12330595  2.76827997  0.76031363  3.65871760
[19]  1.34234133  1.18990795
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1881699
[2,]  0.1320955
[3,]  1.0687305
[4,]  1.5253360
[5,]  2.6772272
> 
> rowApply(tmp,sum)
[1]  3.396034  6.889411  7.300141 -4.299735  3.926724
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7   18   15   20   10
[2,]    8   12    2    7    7
[3,]   13   20   12   16   20
[4,]   18   19   13   14    4
[5,]   19    5   17   19   19
> 
> 
> as.matrix(tmp)
           [,1]       [,2]      [,3]       [,4]       [,5]        [,6]
[1,] -0.1881699 -0.1424370 0.2326865  1.2817618  1.5613890  2.53903128
[2,]  1.5253360  0.6570494 1.8115655  1.5992623 -0.6050691 -1.18484053
[3,]  1.0687305 -1.0205016 0.5299896  0.6153759  1.5400022 -0.24693105
[4,]  2.6772272 -0.9981666 0.8358420  0.1097681  1.8904792 -0.09213055
[5,]  0.1320955 -0.2569149 2.0979753 -0.7761283  1.5568709  0.48809628
           [,7]        [,8]        [,9]      [,10]      [,11]      [,12]
[1,] -0.3182121  0.04382091 -0.76110688  0.2209047 -0.9761827  0.1099178
[2,] -0.7020436  0.50985886 -0.40050213 -1.1918297 -0.3493285  1.0219695
[3,]  0.2564870 -1.13183809 -0.78242690  1.9767192 -0.9197738  0.4563642
[4,] -0.1687831 -1.14432824 -2.56216014 -0.4090196 -1.0687436 -2.0395615
[5,] -2.2328436  0.24480194  0.08607482 -0.7422458 -0.8710300  0.5980723
          [,13]       [,14]       [,15]      [,16]      [,17]       [,18]
[1,]  1.1728197 -1.02436489 -0.03825263 -0.2677595  0.7620057  0.66452641
[2,] -0.6512967  0.88884483  1.42389344  1.0684075 -0.5132574  0.48157261
[3,] -0.8171388  0.38683313  1.80286121  1.0594608  1.1085097 -0.01372924
[4,]  1.7522116  0.07133448 -1.94312286  0.4313154 -1.9868588  1.20306195
[5,] -1.1235008 -0.27831056 -0.12207321  0.4768558  1.3899144  1.32328588
          [,19]      [,20]
[1,] -1.7540174  0.2776729
[2,]  0.4154859  1.0843335
[3,]  1.5746565 -0.1435097
[4,] -0.2034359 -0.6546644
[5,]  1.3096522  0.6260757
> 
> 
> 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 -1.081643 -3.371951 -1.424617 -0.7319935 -0.8023512 -1.657783 0.4066202
          col8     col9     col10     col11     col12     col13     col14
row1 -1.730136 1.541008 -0.291941 -2.031996 -1.569549 0.7105461 -1.127821
          col15      col16      col17     col18     col19        col20
row1 -0.8100486 -0.6939074 -0.1751673 0.3600653 0.1604633 -0.005905167
> tmp[,"col10"]
           col10
row1 -0.29194099
row2  0.03384845
row3  1.04184937
row4 -1.23777920
row5  0.30775552
> tmp[c("row1","row5"),]
           col1       col2      col3       col4       col5       col6
row1 -1.0816431 -3.3719514 -1.424617 -0.7319935 -0.8023512 -1.6577830
row5  0.7136422  0.6072285  1.812962 -0.4340849  0.2204864 -0.7253097
           col7       col8       col9      col10      col11      col12
row1  0.4066202 -1.7301358  1.5410078 -0.2919410 -2.0319960 -1.5695486
row5 -0.5073899 -0.3193704 -0.1641842  0.3077555 -0.5739378 -0.3103419
          col13      col14      col15      col16      col17      col18
row1  0.7105461 -1.1278215 -0.8100486 -0.6939074 -0.1751673  0.3600653
row5 -0.4830081  0.1275819  1.8969061 -0.9162223 -0.6629977 -0.3658834
          col19        col20
row1  0.1604633 -0.005905167
row5 -1.1793413 -0.096435848
> tmp[,c("col6","col20")]
              col6        col20
row1 -1.6577830074 -0.005905167
row2  0.5288028888  1.518494064
row3 -0.0763199793 -0.592326589
row4  0.0008385636  1.101722118
row5 -0.7253096606 -0.096435848
> tmp[c("row1","row5"),c("col6","col20")]
           col6        col20
row1 -1.6577830 -0.005905167
row5 -0.7253097 -0.096435848
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2   col3    col4     col5     col6    col7     col8
row1 49.03353 49.37513 47.847 50.5488 49.74248 104.0878 49.4387 49.91143
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.72785 50.25267 48.19657 49.32862 51.90244 49.02985 50.39974 50.46421
        col17    col18    col19    col20
row1 49.85924 48.65041 49.64717 104.7869
> tmp[,"col10"]
        col10
row1 50.25267
row2 31.18578
row3 30.96903
row4 30.52643
row5 50.13717
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.03353 49.37513 47.84700 50.54880 49.74248 104.0878 49.43870 49.91143
row5 50.46263 50.09935 49.26583 50.70383 50.32786 106.3051 50.32262 50.29794
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.72785 50.25267 48.19657 49.32862 51.90244 49.02985 50.39974 50.46421
row5 50.48163 50.13717 50.80587 51.62410 51.20759 51.72149 50.37789 47.53124
        col17    col18    col19    col20
row1 49.85924 48.65041 49.64717 104.7869
row5 49.28853 49.61602 49.26163 103.0051
> tmp[,c("col6","col20")]
          col6     col20
row1 104.08784 104.78687
row2  75.14315  74.61602
row3  74.94135  76.01758
row4  74.18077  77.03899
row5 106.30507 103.00513
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.0878 104.7869
row5 106.3051 103.0051
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.0878 104.7869
row5 106.3051 103.0051
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.92824947
[2,]  0.37022439
[3,] -0.40333010
[4,] -0.02470226
[5,]  0.74877741
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.6933786  0.1089321
[2,] -0.2963341 -0.9429138
[3,]  1.4193730  0.2238436
[4,] -1.0713666  0.5872540
[5,]  0.5512176 -1.5502332
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.3567662  1.7177391
[2,] -0.1678385  0.6196940
[3,]  0.6208752 -0.6571554
[4,] -2.0565386 -0.9022938
[5,] -0.1915889 -0.2771544
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3567662
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.3567662
[2,] -0.1678385
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]      [,3]        [,4]      [,5]       [,6]     [,7]
row3 1.99528744 -1.350161 0.7290678 -0.01811664 -1.034553 -0.8236920 1.498659
row1 0.06542641 -0.816270 1.3508293  1.04219707  1.284945 -0.9835039 1.018942
           [,8]       [,9]      [,10]     [,11]      [,12]      [,13]
row3  0.5396676  0.7219186  0.2932345 0.6274699 -2.1086001 -1.2815300
row1 -1.6157885 -1.1946532 -1.7928825 0.2992685  0.2534027 -0.6652745
          [,14]       [,15]      [,16]      [,17]     [,18]       [,19]
row3 -0.8622574  0.07003131 -0.8140957 -0.4801200 0.9637271 -0.37141851
row1 -1.2084120 -0.58432239 -1.4068181  0.5085009 0.8792414 -0.01419661
           [,20]
row3  0.21699878
row1 -0.01124617
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]       [,3]       [,4]      [,5]       [,6]       [,7]
row2 0.476735 -0.1550821 -0.5827744 -0.1544353 0.6828301 -0.9532816 -0.7876988
         [,8]       [,9]     [,10]
row2 1.061061 -0.8906903 0.5824382
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]       [,2]      [,3]       [,4]    [,5]     [,6]      [,7]
row5 -1.88182 0.07135382 -1.316982 -0.1421417 1.62771 1.231425 -1.729071
          [,8]      [,9]     [,10]      [,11]      [,12]     [,13]     [,14]
row5 -1.201718 0.5964317 0.2029275 -0.9529545 -0.2517866 -1.393942 -1.763071
          [,15]     [,16]     [,17]     [,18]     [,19]     [,20]
row5 -0.4151443 -0.829887 -1.248219 0.3737392 0.6094729 -2.220885
> 
> 
> 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: 0x631b6feace40>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d843dbcd5" 
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d84f734b19"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d8f852298" 
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d85ce0d0df"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d86279d48" 
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d86bea89ae"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d853355a40"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d8c34af09" 
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d86e865e30"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d83faae92c"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d87504875a"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d83b12a945"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d82d983912"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d850275c61"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2858d87cc10a26"
> 
> 
> ### 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: 0x631b6f85dd30>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x631b6f85dd30>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x631b6f85dd30>
> rowMedians(tmp)
  [1]  0.338187727  0.233875273 -0.372368701  0.000370937  0.158355296
  [6]  0.581330299  0.089086603  0.097974409 -0.285532386  0.387534589
 [11]  0.210849660  0.244826484  0.003311016  0.090857634  0.078401698
 [16] -0.048728803 -0.210856969 -0.525540952  0.304873362 -0.056230203
 [21]  0.030053158  0.179223412 -0.305745229 -0.067466998 -0.473647328
 [26] -0.001153693  0.173125280 -0.074992504  0.253865296 -0.429403793
 [31]  0.357394109 -0.706570369 -0.603002766  0.363850217  0.089589988
 [36] -0.158030879 -0.091631377 -0.119088970 -0.110695129  0.623528456
 [41] -0.325249883  0.118802752  0.187311893  0.490110009 -0.223270241
 [46]  0.053372924  0.026183380 -0.193707451  0.056170942  0.033932562
 [51] -0.065695759 -0.056292000  0.355416908 -0.045520223  0.013069902
 [56]  0.143650658 -0.199218037 -0.444125024 -0.474673126 -0.152974184
 [61]  0.088151519  0.231991755 -0.192173496  0.302598535 -0.009861880
 [66]  0.011242884  0.308434434 -0.599545702 -0.283375891  0.329975725
 [71] -0.470704543 -0.236754816 -0.401376621 -0.366146011 -0.238870661
 [76] -0.411819019 -0.122981728 -0.090865215 -0.297639980 -0.065647688
 [81]  0.720525263 -0.583481036  0.279162664 -0.221155787 -0.102637556
 [86] -0.073612207 -0.039470295 -0.293957204  0.286216469  0.598129821
 [91]  0.063570833 -0.235859665  0.075631312  0.144248662  0.644494985
 [96] -0.373973475 -0.443301415  0.928792728 -0.611002587 -0.181474176
[101] -0.414263939 -0.143745265 -0.400212050  0.114535607  0.738349285
[106]  0.236512758  0.195532077  0.409119427  0.022198973  0.213444832
[111] -0.368428176  0.196163979  0.106724514  0.724087271 -0.399326776
[116] -0.147082608 -0.158397981 -0.352720560  0.042627399 -0.340264353
[121] -0.027136185  0.338482023  0.063545503  0.023362210 -0.336507060
[126]  0.298763445  0.227896682  0.291220208  0.050511845 -0.037054753
[131]  0.086345199 -0.564822736 -0.038279140  0.056753005 -0.462716032
[136] -0.275194519 -0.117038835  0.170641060  0.116863271  0.037037788
[141] -0.015037780  0.584954225  0.070949152 -0.020628152 -0.272385143
[146] -0.605583718  0.372068699 -0.137119292  0.767089944 -0.176311692
[151]  0.303876705  0.189818696  0.575915911 -0.371579958 -0.460975335
[156] -0.223373693 -0.022015658 -0.119765872  0.384324243  0.217157612
[161]  0.115457407 -0.116487192 -0.138256231 -0.358342294  0.403370092
[166] -0.155436352 -0.537293846  0.040031846  0.090290867 -0.081105247
[171]  0.546733667  0.138935538  0.502321611 -0.185281706  0.556381274
[176]  0.048486338 -0.203373844 -0.047633597 -0.247686466  0.384268061
[181]  0.534870416  0.044754986  0.364270646 -0.407507210 -0.091965310
[186]  0.001928658 -0.367830527  0.063725419  0.324617829  0.500582304
[191] -0.158049606 -0.270048790  0.586871072 -0.315212364 -0.276115967
[196]  0.100772707  0.498307372 -0.268305109 -0.797642005  0.077167480
[201] -0.040997315 -0.051060501 -0.031071000 -0.411966426  0.349951305
[206]  0.042294059 -0.401981243  0.163054965 -0.573107328 -0.244053663
[211] -0.128697397  0.032629572  0.230095530 -0.546793627  0.097537351
[216]  0.202027209 -0.220355246  0.471432315  0.294241354 -0.214188418
[221] -0.203563342  0.195176059 -0.010253152 -0.151563352  0.358333161
[226]  0.314631876 -0.285417439 -0.008235007 -0.002269653 -0.430879922
> 
> proc.time()
   user  system elapsed 
  1.297   1.484   2.770 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x5bc2d3ed55f0>
> .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: 0x5bc2d3ed55f0>
> .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: 0x5bc2d3ed55f0>
> .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: 0x5bc2d3ed55f0>
> 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: 0x5bc2d47532b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc2d47532b0>
> .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: 0x5bc2d47532b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc2d47532b0>
> .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: 0x5bc2d47532b0>
> 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: 0x5bc2d3e36a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc2d3e36a20>
> .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: 0x5bc2d3e36a20>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5bc2d3e36a20>
> .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: 0x5bc2d3e36a20>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5bc2d3e36a20>
> .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: 0x5bc2d3e36a20>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5bc2d3e36a20>
> .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: 0x5bc2d3e36a20>
> 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: 0x5bc2d4613e00>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5bc2d4613e00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc2d4613e00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc2d4613e00>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile28596e1fd955a4" "BufferedMatrixFile28596e52b921cd"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile28596e1fd955a4" "BufferedMatrixFile28596e52b921cd"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc2d451b4c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc2d451b4c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5bc2d451b4c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5bc2d451b4c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5bc2d451b4c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5bc2d451b4c0>
> .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: 0x5bc2d48c47e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bc2d48c47e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5bc2d48c47e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5bc2d48c47e0>
> 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: 0x5bc2d599d520>
> .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: 0x5bc2d599d520>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.260   0.047   0.296 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.247   0.040   0.275 

Example timings