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

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

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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.243   0.059   0.289 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478920 25.6    1048721 56.1   639242 34.2
Vcells 885815  6.8    8388608 64.0  2083259 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Jan 23 21:45:53 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Jan 23 21:45:53 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x652c40e91c10>
> 
> 
> 
> 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] "Fri Jan 23 21:45:53 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Jan 23 21:45:53 2026"
> 
> ColMode(tmp2)
<pointer: 0x652c40e91c10>
> 
> 
> 
> ### 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.2864375  0.7883820 -0.1094032 -0.6199689
[2,] -0.1742292  0.6842540 -1.3617122 -0.6141546
[3,]  0.3320032 -0.4268767  0.4910896  0.4276826
[4,] -0.7142146  0.5829643 -0.3292520 -0.7593766
> 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.2864375 0.7883820 0.1094032 0.6199689
[2,]  0.1742292 0.6842540 1.3617122 0.6141546
[3,]  0.3320032 0.4268767 0.4910896 0.4276826
[4,]  0.7142146 0.5829643 0.3292520 0.7593766
> 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.9642580 0.8879088 0.3307615 0.7873810
[2,] 0.4174077 0.8271964 1.1669242 0.7836802
[3,] 0.5761972 0.6533581 0.7007778 0.6539745
[4,] 0.8451122 0.7635210 0.5738049 0.8714221
> 
> 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,] 223.92902 34.66747 28.41702 33.49378
[2,]  29.34831 33.95622 38.03095 33.45096
[3,]  31.09397 31.96046 32.49887 31.96743
[4,]  34.16534 33.21817 31.06730 34.47360
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x652c41ce8ff0>
> exp(tmp5)
<pointer: 0x652c41ce8ff0>
> log(tmp5,2)
<pointer: 0x652c41ce8ff0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.0789
> Min(tmp5)
[1] 53.4416
> mean(tmp5)
[1] 73.84173
> Sum(tmp5)
[1] 14768.35
> Var(tmp5)
[1] 845.9071
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.34709 73.63271 70.69340 69.93145 72.17190 70.32533 71.95914 72.71766
 [9] 72.93988 72.69873
> rowSums(tmp5)
 [1] 1826.942 1472.654 1413.868 1398.629 1443.438 1406.507 1439.183 1454.353
 [9] 1458.798 1453.975
> rowVars(tmp5)
 [1] 7857.61829   67.41496   67.63754   74.85949   59.92721   73.62497
 [7]   40.61514   66.60192  116.25832   62.82234
> rowSd(tmp5)
 [1] 88.643208  8.210661  8.224205  8.652138  7.741267  8.580499  6.373001
 [8]  8.161000 10.782315  7.926054
> rowMax(tmp5)
 [1] 466.07891  87.44337  87.93732  87.88016  87.82758  88.53986  81.57020
 [8]  84.60140  95.67369  87.01759
> rowMin(tmp5)
 [1] 59.14630 57.76024 56.13793 55.48098 54.89986 54.88915 53.44160 54.58319
 [9] 56.49711 54.77476
> 
> colMeans(tmp5)
 [1] 108.59828  74.59648  72.26688  69.80625  74.57764  73.96031  72.74077
 [8]  72.23984  71.63307  72.04728  72.65858  72.82062  73.00005  67.76687
[15]  69.19675  69.73220  71.96209  72.42574  74.02921  70.77567
> colSums(tmp5)
 [1] 1085.9828  745.9648  722.6688  698.0625  745.7764  739.6031  727.4077
 [8]  722.3984  716.3307  720.4728  726.5858  728.2062  730.0005  677.6687
[15]  691.9675  697.3220  719.6209  724.2574  740.2921  707.7567
> colVars(tmp5)
 [1] 15821.61102   131.00682    65.20879    37.57023    52.37294    51.29802
 [7]    51.18816    81.43864   112.60798   154.68405    20.99246   120.02587
[13]    63.13429    27.09896    65.27210    44.79692    68.99203    93.31217
[19]   103.61097    56.30346
> colSd(tmp5)
 [1] 125.783986  11.445821   8.075196   6.129456   7.236915   7.162263
 [7]   7.154590   9.024336  10.611691  12.437204   4.581753  10.955632
[13]   7.945709   5.205666   8.079115   6.693050   8.306144   9.659822
[19]  10.178947   7.503563
> colMax(tmp5)
 [1] 466.07891  91.41139  87.82758  78.99715  88.37525  87.88016  84.81997
 [8]  86.88204  88.53986  92.14277  77.90322  90.01038  87.44337  75.45898
[15]  80.11875  81.57020  83.37825  83.13710  95.67369  79.02944
> colMin(tmp5)
 [1] 54.77476 53.44160 59.14630 58.01266 62.71386 66.47534 62.90499 56.49711
 [9] 54.58319 54.88915 65.60619 60.88544 63.30199 57.73515 55.48098 57.76024
[17] 60.16170 54.89986 61.40263 59.58361
> 
> 
> ### 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] 91.34709 73.63271 70.69340 69.93145 72.17190 70.32533 71.95914 72.71766
 [9]       NA 72.69873
> rowSums(tmp5)
 [1] 1826.942 1472.654 1413.868 1398.629 1443.438 1406.507 1439.183 1454.353
 [9]       NA 1453.975
> rowVars(tmp5)
 [1] 7857.61829   67.41496   67.63754   74.85949   59.92721   73.62497
 [7]   40.61514   66.60192   92.49338   62.82234
> rowSd(tmp5)
 [1] 88.643208  8.210661  8.224205  8.652138  7.741267  8.580499  6.373001
 [8]  8.161000  9.617348  7.926054
> rowMax(tmp5)
 [1] 466.07891  87.44337  87.93732  87.88016  87.82758  88.53986  81.57020
 [8]  84.60140        NA  87.01759
> rowMin(tmp5)
 [1] 59.14630 57.76024 56.13793 55.48098 54.89986 54.88915 53.44160 54.58319
 [9]       NA 54.77476
> 
> colMeans(tmp5)
 [1] 108.59828  74.59648  72.26688  69.80625  74.57764  73.96031  72.74077
 [8]  72.23984  71.63307  72.04728  72.65858  72.82062  73.00005  67.76687
[15]  69.19675  69.73220  71.96209  72.42574        NA  70.77567
> colSums(tmp5)
 [1] 1085.9828  745.9648  722.6688  698.0625  745.7764  739.6031  727.4077
 [8]  722.3984  716.3307  720.4728  726.5858  728.2062  730.0005  677.6687
[15]  691.9675  697.3220  719.6209  724.2574        NA  707.7567
> colVars(tmp5)
 [1] 15821.61102   131.00682    65.20879    37.57023    52.37294    51.29802
 [7]    51.18816    81.43864   112.60798   154.68405    20.99246   120.02587
[13]    63.13429    27.09896    65.27210    44.79692    68.99203    93.31217
[19]          NA    56.30346
> colSd(tmp5)
 [1] 125.783986  11.445821   8.075196   6.129456   7.236915   7.162263
 [7]   7.154590   9.024336  10.611691  12.437204   4.581753  10.955632
[13]   7.945709   5.205666   8.079115   6.693050   8.306144   9.659822
[19]         NA   7.503563
> colMax(tmp5)
 [1] 466.07891  91.41139  87.82758  78.99715  88.37525  87.88016  84.81997
 [8]  86.88204  88.53986  92.14277  77.90322  90.01038  87.44337  75.45898
[15]  80.11875  81.57020  83.37825  83.13710        NA  79.02944
> colMin(tmp5)
 [1] 54.77476 53.44160 59.14630 58.01266 62.71386 66.47534 62.90499 56.49711
 [9] 54.58319 54.88915 65.60619 60.88544 63.30199 57.73515 55.48098 57.76024
[17] 60.16170 54.89986       NA 59.58361
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.0789
> Min(tmp5,na.rm=TRUE)
[1] 53.4416
> mean(tmp5,na.rm=TRUE)
[1] 73.73202
> Sum(tmp5,na.rm=TRUE)
[1] 14672.67
> Var(tmp5,na.rm=TRUE)
[1] 847.76
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.34709 73.63271 70.69340 69.93145 72.17190 70.32533 71.95914 72.71766
 [9] 71.74337 72.69873
> rowSums(tmp5,na.rm=TRUE)
 [1] 1826.942 1472.654 1413.868 1398.629 1443.438 1406.507 1439.183 1454.353
 [9] 1363.124 1453.975
> rowVars(tmp5,na.rm=TRUE)
 [1] 7857.61829   67.41496   67.63754   74.85949   59.92721   73.62497
 [7]   40.61514   66.60192   92.49338   62.82234
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.643208  8.210661  8.224205  8.652138  7.741267  8.580499  6.373001
 [8]  8.161000  9.617348  7.926054
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.07891  87.44337  87.93732  87.88016  87.82758  88.53986  81.57020
 [8]  84.60140  91.41139  87.01759
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.14630 57.76024 56.13793 55.48098 54.89986 54.88915 53.44160 54.58319
 [9] 56.49711 54.77476
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.59828  74.59648  72.26688  69.80625  74.57764  73.96031  72.74077
 [8]  72.23984  71.63307  72.04728  72.65858  72.82062  73.00005  67.76687
[15]  69.19675  69.73220  71.96209  72.42574  71.62426  70.77567
> colSums(tmp5,na.rm=TRUE)
 [1] 1085.9828  745.9648  722.6688  698.0625  745.7764  739.6031  727.4077
 [8]  722.3984  716.3307  720.4728  726.5858  728.2062  730.0005  677.6687
[15]  691.9675  697.3220  719.6209  724.2574  644.6184  707.7567
> colVars(tmp5,na.rm=TRUE)
 [1] 15821.61102   131.00682    65.20879    37.57023    52.37294    51.29802
 [7]    51.18816    81.43864   112.60798   154.68405    20.99246   120.02587
[13]    63.13429    27.09896    65.27210    44.79692    68.99203    93.31217
[19]    51.49517    56.30346
> colSd(tmp5,na.rm=TRUE)
 [1] 125.783986  11.445821   8.075196   6.129456   7.236915   7.162263
 [7]   7.154590   9.024336  10.611691  12.437204   4.581753  10.955632
[13]   7.945709   5.205666   8.079115   6.693050   8.306144   9.659822
[19]   7.176014   7.503563
> colMax(tmp5,na.rm=TRUE)
 [1] 466.07891  91.41139  87.82758  78.99715  88.37525  87.88016  84.81997
 [8]  86.88204  88.53986  92.14277  77.90322  90.01038  87.44337  75.45898
[15]  80.11875  81.57020  83.37825  83.13710  82.61329  79.02944
> colMin(tmp5,na.rm=TRUE)
 [1] 54.77476 53.44160 59.14630 58.01266 62.71386 66.47534 62.90499 56.49711
 [9] 54.58319 54.88915 65.60619 60.88544 63.30199 57.73515 55.48098 57.76024
[17] 60.16170 54.89986 61.40263 59.58361
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.34709 73.63271 70.69340 69.93145 72.17190 70.32533 71.95914 72.71766
 [9]      NaN 72.69873
> rowSums(tmp5,na.rm=TRUE)
 [1] 1826.942 1472.654 1413.868 1398.629 1443.438 1406.507 1439.183 1454.353
 [9]    0.000 1453.975
> rowVars(tmp5,na.rm=TRUE)
 [1] 7857.61829   67.41496   67.63754   74.85949   59.92721   73.62497
 [7]   40.61514   66.60192         NA   62.82234
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.643208  8.210661  8.224205  8.652138  7.741267  8.580499  6.373001
 [8]  8.161000        NA  7.926054
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.07891  87.44337  87.93732  87.88016  87.82758  88.53986  81.57020
 [8]  84.60140        NA  87.01759
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.14630 57.76024 56.13793 55.48098 54.89986 54.88915 53.44160 54.58319
 [9]       NA 54.77476
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.21425  72.72816  72.57548  71.11665  73.04457  74.38191  73.32999
 [8]  73.98903  71.94077  71.89375  72.65529  73.70181  72.20934  68.88151
[15]  69.62233  68.87962  72.54542  71.64596       NaN  69.85859
> colSums(tmp5,na.rm=TRUE)
 [1] 1009.9283  654.5534  653.1794  640.0498  657.4012  669.4372  659.9699
 [8]  665.9013  647.4669  647.0438  653.8976  663.3163  649.8840  619.9335
[15]  626.6010  619.9165  652.9088  644.8136    0.0000  628.7273
> colVars(tmp5,na.rm=TRUE)
 [1] 17652.21568   108.11306    72.28850    22.94864    32.47873    55.71061
 [7]    53.68093    57.19712   125.61886   173.75439    23.61640   126.29340
[13]    63.99229    16.50919    71.39353    42.21881    73.78792    98.13541
[19]          NA    53.87964
> colSd(tmp5,na.rm=TRUE)
 [1] 132.861641  10.397743   8.502264   4.790474   5.699012   7.463954
 [7]   7.326727   7.562878  11.207982  13.181593   4.859671  11.238033
[13]   7.999518   4.063150   8.449469   6.497600   8.589990   9.906332
[19]         NA   7.340275
> colMax(tmp5,na.rm=TRUE)
 [1] 466.07891  87.01759  87.82758  78.99715  80.62032  87.88016  84.81997
 [8]  86.88204  88.53986  92.14277  77.90322  90.01038  87.44337  75.45898
[15]  80.11875  81.57020  83.37825  83.13710      -Inf  78.21839
> colMin(tmp5,na.rm=TRUE)
 [1] 54.77476 53.44160 59.14630 65.10154 62.71386 66.47534 62.90499 62.84534
 [9] 54.58319 54.88915 65.60619 60.88544 63.30199 62.04520 55.48098 57.76024
[17] 60.16170 54.89986      Inf 59.58361
> 
> 
> 
> 
> 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] 251.6566 151.7583 259.2681 237.7480 197.2513 373.4753 125.3404 207.6722
 [9] 217.0477 256.5612
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 251.6566 151.7583 259.2681 237.7480 197.2513 373.4753 125.3404 207.6722
 [9] 217.0477 256.5612
> 
> 
> 
> 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]  1.421085e-14  0.000000e+00  2.842171e-14 -1.136868e-13  1.705303e-13
 [6]  5.684342e-14  8.526513e-14 -1.136868e-13  0.000000e+00 -5.684342e-14
[11] -5.684342e-14  5.684342e-14  1.136868e-13  0.000000e+00 -1.705303e-13
[16] -2.842171e-14 -1.278977e-13  0.000000e+00  1.421085e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
8   3 
8   14 
10   5 
7   16 
8   13 
3   8 
4   3 
7   6 
4   5 
2   11 
7   13 
1   19 
7   17 
1   3 
5   14 
3   19 
1   15 
8   8 
7   18 
2   6 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.960312
> Min(tmp)
[1] -2.550811
> mean(tmp)
[1] 0.1383207
> Sum(tmp)
[1] 13.83207
> Var(tmp)
[1] 1.124216
> 
> rowMeans(tmp)
[1] 0.1383207
> rowSums(tmp)
[1] 13.83207
> rowVars(tmp)
[1] 1.124216
> rowSd(tmp)
[1] 1.060291
> rowMax(tmp)
[1] 2.960312
> rowMin(tmp)
[1] -2.550811
> 
> colMeans(tmp)
  [1] -0.68370431 -0.24958552  0.28952207  1.50380555 -0.21429282 -0.76680839
  [7] -1.50290800  0.68705161 -0.83886490 -1.02733602 -1.49873823 -1.80914455
 [13]  1.18794084  0.83594263  0.93056006 -0.25062916 -1.45524535  0.68105774
 [19] -1.09769542  0.70181781 -1.78793100  2.23798240 -0.57317418  0.90007212
 [25]  0.68118891  1.04532661  0.58648963 -0.93617278 -1.04363653  0.65948302
 [31] -0.46433896 -0.84477550  1.56114476 -0.45576881  0.29915881 -0.48202218
 [37]  0.73471062  0.28215728  0.36175172 -0.45606089 -2.55081140 -0.15691426
 [43] -1.35266612  0.36613132  1.14686775 -0.39963109  2.01364012 -0.74369076
 [49]  0.42578933 -0.19612281  1.44582773 -0.35095211 -1.10339158 -0.55139529
 [55]  1.96241757  0.27543796 -0.29906383  1.13436379  0.81875910  0.42418260
 [61]  0.97031731  2.37376734  0.40694563  0.28806723  0.29213068  2.96031175
 [67] -0.09519560 -0.32349796 -1.16567367 -1.44636321  1.34361797 -0.15530375
 [73]  0.86859348  0.46565977  0.46803053 -0.90791714  1.92499423  1.03862941
 [79]  1.73225534 -1.19695157  0.58407780 -0.47996831  0.29337460  0.27832733
 [85]  1.00815240  0.03156674 -0.33769471  0.95586633 -0.67600930 -1.48949133
 [91] -1.72113037  0.55378746  0.08670226  0.23517044  2.33972557  1.23517576
 [97]  0.70088801  0.15304714 -0.43192336  0.63290097
> colSums(tmp)
  [1] -0.68370431 -0.24958552  0.28952207  1.50380555 -0.21429282 -0.76680839
  [7] -1.50290800  0.68705161 -0.83886490 -1.02733602 -1.49873823 -1.80914455
 [13]  1.18794084  0.83594263  0.93056006 -0.25062916 -1.45524535  0.68105774
 [19] -1.09769542  0.70181781 -1.78793100  2.23798240 -0.57317418  0.90007212
 [25]  0.68118891  1.04532661  0.58648963 -0.93617278 -1.04363653  0.65948302
 [31] -0.46433896 -0.84477550  1.56114476 -0.45576881  0.29915881 -0.48202218
 [37]  0.73471062  0.28215728  0.36175172 -0.45606089 -2.55081140 -0.15691426
 [43] -1.35266612  0.36613132  1.14686775 -0.39963109  2.01364012 -0.74369076
 [49]  0.42578933 -0.19612281  1.44582773 -0.35095211 -1.10339158 -0.55139529
 [55]  1.96241757  0.27543796 -0.29906383  1.13436379  0.81875910  0.42418260
 [61]  0.97031731  2.37376734  0.40694563  0.28806723  0.29213068  2.96031175
 [67] -0.09519560 -0.32349796 -1.16567367 -1.44636321  1.34361797 -0.15530375
 [73]  0.86859348  0.46565977  0.46803053 -0.90791714  1.92499423  1.03862941
 [79]  1.73225534 -1.19695157  0.58407780 -0.47996831  0.29337460  0.27832733
 [85]  1.00815240  0.03156674 -0.33769471  0.95586633 -0.67600930 -1.48949133
 [91] -1.72113037  0.55378746  0.08670226  0.23517044  2.33972557  1.23517576
 [97]  0.70088801  0.15304714 -0.43192336  0.63290097
> 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.68370431 -0.24958552  0.28952207  1.50380555 -0.21429282 -0.76680839
  [7] -1.50290800  0.68705161 -0.83886490 -1.02733602 -1.49873823 -1.80914455
 [13]  1.18794084  0.83594263  0.93056006 -0.25062916 -1.45524535  0.68105774
 [19] -1.09769542  0.70181781 -1.78793100  2.23798240 -0.57317418  0.90007212
 [25]  0.68118891  1.04532661  0.58648963 -0.93617278 -1.04363653  0.65948302
 [31] -0.46433896 -0.84477550  1.56114476 -0.45576881  0.29915881 -0.48202218
 [37]  0.73471062  0.28215728  0.36175172 -0.45606089 -2.55081140 -0.15691426
 [43] -1.35266612  0.36613132  1.14686775 -0.39963109  2.01364012 -0.74369076
 [49]  0.42578933 -0.19612281  1.44582773 -0.35095211 -1.10339158 -0.55139529
 [55]  1.96241757  0.27543796 -0.29906383  1.13436379  0.81875910  0.42418260
 [61]  0.97031731  2.37376734  0.40694563  0.28806723  0.29213068  2.96031175
 [67] -0.09519560 -0.32349796 -1.16567367 -1.44636321  1.34361797 -0.15530375
 [73]  0.86859348  0.46565977  0.46803053 -0.90791714  1.92499423  1.03862941
 [79]  1.73225534 -1.19695157  0.58407780 -0.47996831  0.29337460  0.27832733
 [85]  1.00815240  0.03156674 -0.33769471  0.95586633 -0.67600930 -1.48949133
 [91] -1.72113037  0.55378746  0.08670226  0.23517044  2.33972557  1.23517576
 [97]  0.70088801  0.15304714 -0.43192336  0.63290097
> colMin(tmp)
  [1] -0.68370431 -0.24958552  0.28952207  1.50380555 -0.21429282 -0.76680839
  [7] -1.50290800  0.68705161 -0.83886490 -1.02733602 -1.49873823 -1.80914455
 [13]  1.18794084  0.83594263  0.93056006 -0.25062916 -1.45524535  0.68105774
 [19] -1.09769542  0.70181781 -1.78793100  2.23798240 -0.57317418  0.90007212
 [25]  0.68118891  1.04532661  0.58648963 -0.93617278 -1.04363653  0.65948302
 [31] -0.46433896 -0.84477550  1.56114476 -0.45576881  0.29915881 -0.48202218
 [37]  0.73471062  0.28215728  0.36175172 -0.45606089 -2.55081140 -0.15691426
 [43] -1.35266612  0.36613132  1.14686775 -0.39963109  2.01364012 -0.74369076
 [49]  0.42578933 -0.19612281  1.44582773 -0.35095211 -1.10339158 -0.55139529
 [55]  1.96241757  0.27543796 -0.29906383  1.13436379  0.81875910  0.42418260
 [61]  0.97031731  2.37376734  0.40694563  0.28806723  0.29213068  2.96031175
 [67] -0.09519560 -0.32349796 -1.16567367 -1.44636321  1.34361797 -0.15530375
 [73]  0.86859348  0.46565977  0.46803053 -0.90791714  1.92499423  1.03862941
 [79]  1.73225534 -1.19695157  0.58407780 -0.47996831  0.29337460  0.27832733
 [85]  1.00815240  0.03156674 -0.33769471  0.95586633 -0.67600930 -1.48949133
 [91] -1.72113037  0.55378746  0.08670226  0.23517044  2.33972557  1.23517576
 [97]  0.70088801  0.15304714 -0.43192336  0.63290097
> colMedians(tmp)
  [1] -0.68370431 -0.24958552  0.28952207  1.50380555 -0.21429282 -0.76680839
  [7] -1.50290800  0.68705161 -0.83886490 -1.02733602 -1.49873823 -1.80914455
 [13]  1.18794084  0.83594263  0.93056006 -0.25062916 -1.45524535  0.68105774
 [19] -1.09769542  0.70181781 -1.78793100  2.23798240 -0.57317418  0.90007212
 [25]  0.68118891  1.04532661  0.58648963 -0.93617278 -1.04363653  0.65948302
 [31] -0.46433896 -0.84477550  1.56114476 -0.45576881  0.29915881 -0.48202218
 [37]  0.73471062  0.28215728  0.36175172 -0.45606089 -2.55081140 -0.15691426
 [43] -1.35266612  0.36613132  1.14686775 -0.39963109  2.01364012 -0.74369076
 [49]  0.42578933 -0.19612281  1.44582773 -0.35095211 -1.10339158 -0.55139529
 [55]  1.96241757  0.27543796 -0.29906383  1.13436379  0.81875910  0.42418260
 [61]  0.97031731  2.37376734  0.40694563  0.28806723  0.29213068  2.96031175
 [67] -0.09519560 -0.32349796 -1.16567367 -1.44636321  1.34361797 -0.15530375
 [73]  0.86859348  0.46565977  0.46803053 -0.90791714  1.92499423  1.03862941
 [79]  1.73225534 -1.19695157  0.58407780 -0.47996831  0.29337460  0.27832733
 [85]  1.00815240  0.03156674 -0.33769471  0.95586633 -0.67600930 -1.48949133
 [91] -1.72113037  0.55378746  0.08670226  0.23517044  2.33972557  1.23517576
 [97]  0.70088801  0.15304714 -0.43192336  0.63290097
> colRanges(tmp)
           [,1]       [,2]      [,3]     [,4]       [,5]       [,6]      [,7]
[1,] -0.6837043 -0.2495855 0.2895221 1.503806 -0.2142928 -0.7668084 -1.502908
[2,] -0.6837043 -0.2495855 0.2895221 1.503806 -0.2142928 -0.7668084 -1.502908
          [,8]       [,9]     [,10]     [,11]     [,12]    [,13]     [,14]
[1,] 0.6870516 -0.8388649 -1.027336 -1.498738 -1.809145 1.187941 0.8359426
[2,] 0.6870516 -0.8388649 -1.027336 -1.498738 -1.809145 1.187941 0.8359426
         [,15]      [,16]     [,17]     [,18]     [,19]     [,20]     [,21]
[1,] 0.9305601 -0.2506292 -1.455245 0.6810577 -1.097695 0.7018178 -1.787931
[2,] 0.9305601 -0.2506292 -1.455245 0.6810577 -1.097695 0.7018178 -1.787931
        [,22]      [,23]     [,24]     [,25]    [,26]     [,27]      [,28]
[1,] 2.237982 -0.5731742 0.9000721 0.6811889 1.045327 0.5864896 -0.9361728
[2,] 2.237982 -0.5731742 0.9000721 0.6811889 1.045327 0.5864896 -0.9361728
         [,29]    [,30]     [,31]      [,32]    [,33]      [,34]     [,35]
[1,] -1.043637 0.659483 -0.464339 -0.8447755 1.561145 -0.4557688 0.2991588
[2,] -1.043637 0.659483 -0.464339 -0.8447755 1.561145 -0.4557688 0.2991588
          [,36]     [,37]     [,38]     [,39]      [,40]     [,41]      [,42]
[1,] -0.4820222 0.7347106 0.2821573 0.3617517 -0.4560609 -2.550811 -0.1569143
[2,] -0.4820222 0.7347106 0.2821573 0.3617517 -0.4560609 -2.550811 -0.1569143
         [,43]     [,44]    [,45]      [,46]   [,47]      [,48]     [,49]
[1,] -1.352666 0.3661313 1.146868 -0.3996311 2.01364 -0.7436908 0.4257893
[2,] -1.352666 0.3661313 1.146868 -0.3996311 2.01364 -0.7436908 0.4257893
          [,50]    [,51]      [,52]     [,53]      [,54]    [,55]    [,56]
[1,] -0.1961228 1.445828 -0.3509521 -1.103392 -0.5513953 1.962418 0.275438
[2,] -0.1961228 1.445828 -0.3509521 -1.103392 -0.5513953 1.962418 0.275438
          [,57]    [,58]     [,59]     [,60]     [,61]    [,62]     [,63]
[1,] -0.2990638 1.134364 0.8187591 0.4241826 0.9703173 2.373767 0.4069456
[2,] -0.2990638 1.134364 0.8187591 0.4241826 0.9703173 2.373767 0.4069456
         [,64]     [,65]    [,66]      [,67]     [,68]     [,69]     [,70]
[1,] 0.2880672 0.2921307 2.960312 -0.0951956 -0.323498 -1.165674 -1.446363
[2,] 0.2880672 0.2921307 2.960312 -0.0951956 -0.323498 -1.165674 -1.446363
        [,71]      [,72]     [,73]     [,74]     [,75]      [,76]    [,77]
[1,] 1.343618 -0.1553038 0.8685935 0.4656598 0.4680305 -0.9079171 1.924994
[2,] 1.343618 -0.1553038 0.8685935 0.4656598 0.4680305 -0.9079171 1.924994
        [,78]    [,79]     [,80]     [,81]      [,82]     [,83]     [,84]
[1,] 1.038629 1.732255 -1.196952 0.5840778 -0.4799683 0.2933746 0.2783273
[2,] 1.038629 1.732255 -1.196952 0.5840778 -0.4799683 0.2933746 0.2783273
        [,85]      [,86]      [,87]     [,88]      [,89]     [,90]    [,91]
[1,] 1.008152 0.03156674 -0.3376947 0.9558663 -0.6760093 -1.489491 -1.72113
[2,] 1.008152 0.03156674 -0.3376947 0.9558663 -0.6760093 -1.489491 -1.72113
         [,92]      [,93]     [,94]    [,95]    [,96]    [,97]     [,98]
[1,] 0.5537875 0.08670226 0.2351704 2.339726 1.235176 0.700888 0.1530471
[2,] 0.5537875 0.08670226 0.2351704 2.339726 1.235176 0.700888 0.1530471
          [,99]   [,100]
[1,] -0.4319234 0.632901
[2,] -0.4319234 0.632901
> 
> 
> Max(tmp2)
[1] 2.083306
> Min(tmp2)
[1] -2.590189
> mean(tmp2)
[1] -0.06709755
> Sum(tmp2)
[1] -6.709755
> Var(tmp2)
[1] 1.01216
> 
> rowMeans(tmp2)
  [1] -0.040592910  0.224317768 -0.191830124 -0.641394724  0.295250672
  [6] -1.292282844 -0.354345004  0.512535298  2.083305788  0.181591938
 [11] -0.815462336 -1.879040628  0.664317054 -1.589382925  0.075481156
 [16] -0.108598367  0.268126923 -0.333888399 -0.136317675 -1.677529590
 [21] -0.965779629  0.399874194 -0.843027243  0.385697818 -0.792783083
 [26] -0.010534463 -0.117583122  0.712026978 -1.720756315  1.145042255
 [31]  1.283228176 -0.431629277 -0.642064217 -0.137772964 -1.292197472
 [36] -0.686692531  1.579856886  0.271708641  1.479242677 -1.178951641
 [41]  1.816018473 -2.358465056 -1.234307077  1.152168017  0.283069975
 [46] -0.451199406 -0.755547644  0.288067062 -1.418017414 -1.386327299
 [51] -0.170014790 -0.671534644 -0.072455696  1.116133273  0.785427058
 [56]  0.020046246  0.680755885 -0.971082073  0.324868615  0.494157004
 [61]  0.138426664  0.381438667 -2.258144557 -0.275689354  1.170637587
 [66] -1.009908678  0.596703745 -1.514020123  1.445283886 -0.509385984
 [71] -1.229806639  0.975267964 -1.221279408  0.043774593  0.831779301
 [76] -1.124133438 -0.937587153  0.756831133  0.824837685 -0.834763884
 [81]  1.731152045  0.084777931 -0.673462193  1.460943018  0.118015338
 [86]  0.161153720 -0.255530736  0.521890212  1.244559526 -0.601964445
 [91] -2.590189027 -1.101725216 -0.382466605  0.643430671  0.403255678
 [96]  1.295658409  1.235407910  0.006396791  0.916989728  1.668763325
> rowSums(tmp2)
  [1] -0.040592910  0.224317768 -0.191830124 -0.641394724  0.295250672
  [6] -1.292282844 -0.354345004  0.512535298  2.083305788  0.181591938
 [11] -0.815462336 -1.879040628  0.664317054 -1.589382925  0.075481156
 [16] -0.108598367  0.268126923 -0.333888399 -0.136317675 -1.677529590
 [21] -0.965779629  0.399874194 -0.843027243  0.385697818 -0.792783083
 [26] -0.010534463 -0.117583122  0.712026978 -1.720756315  1.145042255
 [31]  1.283228176 -0.431629277 -0.642064217 -0.137772964 -1.292197472
 [36] -0.686692531  1.579856886  0.271708641  1.479242677 -1.178951641
 [41]  1.816018473 -2.358465056 -1.234307077  1.152168017  0.283069975
 [46] -0.451199406 -0.755547644  0.288067062 -1.418017414 -1.386327299
 [51] -0.170014790 -0.671534644 -0.072455696  1.116133273  0.785427058
 [56]  0.020046246  0.680755885 -0.971082073  0.324868615  0.494157004
 [61]  0.138426664  0.381438667 -2.258144557 -0.275689354  1.170637587
 [66] -1.009908678  0.596703745 -1.514020123  1.445283886 -0.509385984
 [71] -1.229806639  0.975267964 -1.221279408  0.043774593  0.831779301
 [76] -1.124133438 -0.937587153  0.756831133  0.824837685 -0.834763884
 [81]  1.731152045  0.084777931 -0.673462193  1.460943018  0.118015338
 [86]  0.161153720 -0.255530736  0.521890212  1.244559526 -0.601964445
 [91] -2.590189027 -1.101725216 -0.382466605  0.643430671  0.403255678
 [96]  1.295658409  1.235407910  0.006396791  0.916989728  1.668763325
> 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.040592910  0.224317768 -0.191830124 -0.641394724  0.295250672
  [6] -1.292282844 -0.354345004  0.512535298  2.083305788  0.181591938
 [11] -0.815462336 -1.879040628  0.664317054 -1.589382925  0.075481156
 [16] -0.108598367  0.268126923 -0.333888399 -0.136317675 -1.677529590
 [21] -0.965779629  0.399874194 -0.843027243  0.385697818 -0.792783083
 [26] -0.010534463 -0.117583122  0.712026978 -1.720756315  1.145042255
 [31]  1.283228176 -0.431629277 -0.642064217 -0.137772964 -1.292197472
 [36] -0.686692531  1.579856886  0.271708641  1.479242677 -1.178951641
 [41]  1.816018473 -2.358465056 -1.234307077  1.152168017  0.283069975
 [46] -0.451199406 -0.755547644  0.288067062 -1.418017414 -1.386327299
 [51] -0.170014790 -0.671534644 -0.072455696  1.116133273  0.785427058
 [56]  0.020046246  0.680755885 -0.971082073  0.324868615  0.494157004
 [61]  0.138426664  0.381438667 -2.258144557 -0.275689354  1.170637587
 [66] -1.009908678  0.596703745 -1.514020123  1.445283886 -0.509385984
 [71] -1.229806639  0.975267964 -1.221279408  0.043774593  0.831779301
 [76] -1.124133438 -0.937587153  0.756831133  0.824837685 -0.834763884
 [81]  1.731152045  0.084777931 -0.673462193  1.460943018  0.118015338
 [86]  0.161153720 -0.255530736  0.521890212  1.244559526 -0.601964445
 [91] -2.590189027 -1.101725216 -0.382466605  0.643430671  0.403255678
 [96]  1.295658409  1.235407910  0.006396791  0.916989728  1.668763325
> rowMin(tmp2)
  [1] -0.040592910  0.224317768 -0.191830124 -0.641394724  0.295250672
  [6] -1.292282844 -0.354345004  0.512535298  2.083305788  0.181591938
 [11] -0.815462336 -1.879040628  0.664317054 -1.589382925  0.075481156
 [16] -0.108598367  0.268126923 -0.333888399 -0.136317675 -1.677529590
 [21] -0.965779629  0.399874194 -0.843027243  0.385697818 -0.792783083
 [26] -0.010534463 -0.117583122  0.712026978 -1.720756315  1.145042255
 [31]  1.283228176 -0.431629277 -0.642064217 -0.137772964 -1.292197472
 [36] -0.686692531  1.579856886  0.271708641  1.479242677 -1.178951641
 [41]  1.816018473 -2.358465056 -1.234307077  1.152168017  0.283069975
 [46] -0.451199406 -0.755547644  0.288067062 -1.418017414 -1.386327299
 [51] -0.170014790 -0.671534644 -0.072455696  1.116133273  0.785427058
 [56]  0.020046246  0.680755885 -0.971082073  0.324868615  0.494157004
 [61]  0.138426664  0.381438667 -2.258144557 -0.275689354  1.170637587
 [66] -1.009908678  0.596703745 -1.514020123  1.445283886 -0.509385984
 [71] -1.229806639  0.975267964 -1.221279408  0.043774593  0.831779301
 [76] -1.124133438 -0.937587153  0.756831133  0.824837685 -0.834763884
 [81]  1.731152045  0.084777931 -0.673462193  1.460943018  0.118015338
 [86]  0.161153720 -0.255530736  0.521890212  1.244559526 -0.601964445
 [91] -2.590189027 -1.101725216 -0.382466605  0.643430671  0.403255678
 [96]  1.295658409  1.235407910  0.006396791  0.916989728  1.668763325
> 
> colMeans(tmp2)
[1] -0.06709755
> colSums(tmp2)
[1] -6.709755
> colVars(tmp2)
[1] 1.01216
> colSd(tmp2)
[1] 1.006061
> colMax(tmp2)
[1] 2.083306
> colMin(tmp2)
[1] -2.590189
> colMedians(tmp2)
[1] -0.002068836
> colRanges(tmp2)
          [,1]
[1,] -2.590189
[2,]  2.083306
> 
> 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] -6.3549695  2.1075221 -2.8221226  0.5402177  2.9794878 -3.3201786
 [7] -0.7963076  2.3233685 -6.1274242 -4.2143215
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.83751863
[2,] -0.59474548
[3,] -0.45967783
[4,] -0.29574709
[5,] -0.04951573
> 
> rowApply(tmp,sum)
 [1] -1.0500747 -2.0972398 -1.2865455  2.7736148 -1.8618518  0.5849697
 [7] -2.9836033 -2.8971431 -2.9902297 -3.8766245
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    1    4    2    5    3    4    5    8     5
 [2,]   10    5    9    3    6    2    5   10    4    10
 [3,]    9    7    6    9    1    1    9    9    2     1
 [4,]    2    9    3    8    7   10    3    7    5     9
 [5,]    4    2   10   10   10    6    7    6   10     4
 [6,]    3    3    7    5    2    7    8    1    9     3
 [7,]    8    6    1    1    8    5    6    8    7     7
 [8,]    5   10    5    4    9    9   10    3    3     8
 [9,]    7    8    2    6    4    4    1    2    6     2
[10,]    6    4    8    7    3    8    2    4    1     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.86418302 -2.39483382 -1.48829399  0.40008901 -2.76711700 -2.24298028
 [7] -4.77130176  2.79300156  0.21829615 -1.48399823  3.00096140 -1.34254488
[13]  2.04670866  0.87497784 -1.58477318 -1.28043021 -2.82333282  2.03289375
[19]  0.08513228 -2.45648276
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0588652
[2,] -0.2041863
[3,] -0.1233030
[4,]  0.4823344
[5,]  1.7682031
> 
> rowApply(tmp,sum)
[1] -0.4008875 -6.0529947  0.2999947  0.4125322 -6.5784899
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    8   19   20   11    8
[2,]    5   13    2    3   16
[3,]   13    4    8    6   14
[4,]   17    8   10   20    4
[5,]   12    2    7   10   11
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.2041863 -0.81390569  0.2729418  0.7642490  0.1360659 -0.3751442
[2,]  0.4823344 -0.07364258 -1.0325254 -0.8503891 -1.1203147 -1.0465045
[3,]  1.7682031 -1.04577116 -0.1744110  0.0485975 -0.5350048 -0.5522337
[4,] -0.1233030 -1.03655261 -0.8085169  1.6336696 -0.3790710  1.0526255
[5,] -1.0588652  0.57503823  0.2542176 -1.1960380 -0.8687924 -1.3217235
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -0.8556651  1.3521663 -0.8140001 -0.31150150  0.6721598  0.7845440
[2,] -0.6916369 -0.7324989  0.3532096 -0.33819099  0.4160546  0.1906520
[3,] -0.6526802  0.3513380  0.2069207 -0.55399001  1.5521391 -3.4368141
[4,] -1.2885321  1.3127569  1.5919402  0.09414528 -0.5847713 -0.7891377
[5,] -1.2827874  0.5092394 -1.1197743 -0.37446101  0.9453793  1.9082109
          [,13]       [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.1265190  0.10566152 -1.1931786 -1.3725079  0.2811453  0.4677704
[2,] -0.9152266 -0.07149094  0.1006155 -0.5196159 -0.8556620  2.7866825
[3,]  0.5761930  0.94276145 -0.1428232  0.5848938  1.1175412  0.9759308
[4,]  1.3798686  1.03891892  0.5436651 -0.8667768 -2.1810916 -0.9757014
[5,]  1.1323926 -1.14087312 -0.8930519  0.8935765 -1.1852657 -1.2217886
          [,19]      [,20]
[1,]  1.0171838 -0.1881670
[2,] -1.2542070 -0.8806377
[3,] -0.9832054  0.2524095
[4,]  1.5204404 -0.7220440
[5,] -0.2150796 -0.9180436
> 
> 
> 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 :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2     col3       col4       col5       col6      col7
row1 -0.491384 0.2487541 0.771703 -0.1191654 -0.2520603 -0.4877969 -1.322267
         col8      col9     col10      col11     col12    col13      col14
row1 1.046764 0.5926951 0.9609079 -0.4887292 0.9881413 1.664143 -0.4199622
         col15     col16     col17      col18     col19     col20
row1 0.8146144 0.3639426 -1.634184 -0.8063812 -1.919052 -1.471008
> tmp[,"col10"]
          col10
row1  0.9609079
row2  0.6219918
row3  1.1624975
row4 -1.7290439
row5 -0.5888557
> tmp[c("row1","row5"),]
          col1      col2     col3       col4       col5       col6       col7
row1 -0.491384 0.2487541 0.771703 -0.1191654 -0.2520603 -0.4877969 -1.3222668
row5 -1.049628 0.3550367 1.100680 -1.4284730 -1.0827708  0.5177299 -0.5741672
         col8       col9      col10      col11     col12      col13      col14
row1 1.046764  0.5926951  0.9609079 -0.4887292 0.9881413  1.6641429 -0.4199622
row5 1.228790 -0.4148064 -0.5888557  0.6712632 0.6704486 -0.3476054  0.4402577
         col15      col16     col17      col18      col19      col20
row1 0.8146144  0.3639426 -1.634184 -0.8063812 -1.9190520 -1.4710082
row5 0.4520755 -0.6754959 -1.151478  0.5219970  0.2745087 -0.6120719
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.48779693 -1.4710082
row2 -0.69679403  0.1307797
row3  0.91760283 -0.7113237
row4 -0.09481259 -0.7592146
row5  0.51772989 -0.6120719
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.4877969 -1.4710082
row5  0.5177299 -0.6120719
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.16169 49.46811 48.83827 49.24709 50.50374 106.2381 50.16408 49.67889
         col9    col10    col11    col12    col13   col14    col15    col16
row1 49.19326 49.11588 48.69798 49.21879 49.87629 51.1256 50.91463 50.18555
        col17   col18    col19    col20
row1 47.07501 49.8569 48.78883 106.1679
> tmp[,"col10"]
        col10
row1 49.11588
row2 29.80776
row3 29.45048
row4 29.22406
row5 49.70989
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.16169 49.46811 48.83827 49.24709 50.50374 106.2381 50.16408 49.67889
row5 52.83625 47.33660 51.39828 50.78314 50.54523 105.0126 48.90391 52.49870
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.19326 49.11588 48.69798 49.21879 49.87629 51.12560 50.91463 50.18555
row5 49.32493 49.70989 50.27400 49.64468 49.34256 51.02661 49.27473 50.20798
        col17   col18    col19    col20
row1 47.07501 49.8569 48.78883 106.1679
row5 49.16082 52.6739 48.91027 106.3433
> tmp[,c("col6","col20")]
          col6     col20
row1 106.23807 106.16789
row2  75.25164  73.65166
row3  72.79441  74.98462
row4  74.65785  75.65219
row5 105.01262 106.34333
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.2381 106.1679
row5 105.0126 106.3433
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.2381 106.1679
row5 105.0126 106.3433
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.8398215
[2,] -0.1389551
[3,] -0.2709417
[4,]  1.7148703
[5,]  1.0019614
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.3517145 -0.6883192
[2,]  0.1663088  0.5617482
[3,]  1.7621956  0.8008345
[4,] -1.0946122 -1.3364975
[5,]  1.7349638 -0.7217401
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  1.0729028  1.1945488
[2,]  1.5734360 -0.8398886
[3,] -0.3853566 -0.4985761
[4,]  0.9223673 -0.4645365
[5,] -0.2996008  0.4749761
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.072903
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
         col6
[1,] 1.072903
[2,] 1.573436
> 
> 
> 
> 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.3007496 1.854830  0.209864 0.9246329  0.37513623  0.73993802 0.6307686
row1 0.3028815 2.001538 -0.614225 0.1476934 -0.08443549 -0.05833709 0.6827859
           [,8]      [,9]      [,10]      [,11]        [,12]      [,13]
row3 -0.2039753 1.2056981 -2.0687336  1.6511979 -0.008529647 -0.4976214
row1  0.8448393 0.9548297  0.3196559 -0.1224375 -1.513957316  0.6394027
         [,14]      [,15]     [,16]     [,17]      [,18]     [,19]     [,20]
row3 0.1771869 -0.2657386  0.230073 -2.075738 -0.1398332 -2.137420 1.4032149
row1 0.3417668 -0.5825140 -1.164548 -1.038030 -0.6589746 -1.003396 0.3528918
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]     [,3]       [,4]       [,5]      [,6]      [,7]
row2 0.8252857 0.6246664 1.723123 -0.1486555 -0.5012698 0.6194912 0.2332493
          [,8]       [,9]     [,10]
row2 -1.058397 -0.9702602 -1.624804
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]     [,3]       [,4]     [,5]      [,6]      [,7]
row5 0.2567446 2.397114 2.828594 -0.2136263 1.697419 0.5958167 -1.850846
         [,8]       [,9]      [,10]      [,11]      [,12]      [,13]    [,14]
row5 1.173729 0.07593449 -0.9468648 -0.6118351 -0.1528877 -0.3599739 1.748214
           [,15]     [,16]      [,17]       [,18]     [,19]     [,20]
row5 -0.06737064 0.8391402 0.04667738 -0.05487024 -1.270096 -1.289013
> 
> 
> 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: 0x652c4102d3a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a02e32f82c"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a09ad0c2b" 
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a0268d253" 
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a043e9c142"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a032229c91"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a03f13fa77"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a01c7892d3"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a046ab9e6" 
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a06bbd6a43"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a045886218"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a060d44ae2"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a03f0128ae"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a061ecc0b1"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a012c29af6"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3897a0512d470b"
> 
> 
> ### 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: 0x652c41dc5d70>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x652c41dc5d70>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x652c41dc5d70>
> rowMedians(tmp)
  [1] -0.248737314 -0.306042605 -0.150641128  0.279756459 -0.101996290
  [6]  0.409633416 -0.268194878 -0.276417557 -0.076798695  0.164985854
 [11] -0.402719456 -0.994205632  0.117894379 -0.464797167  0.027257282
 [16]  0.527588718 -0.275836773 -0.107236956 -0.408406947  0.822513777
 [21] -0.280310974  0.313490057 -0.104558474  0.553793970  0.092652617
 [26]  0.005421543 -0.031335277 -0.417221242 -0.172777258 -0.206073836
 [31] -0.286331539  0.752004214  0.035804550  0.126028503 -0.343404248
 [36]  0.026531081 -0.386255416  0.488213146  0.097455832 -0.185924626
 [41] -0.149979268 -0.663903362 -0.148366622 -0.311783936  0.013514557
 [46]  0.062894215 -0.237446104  0.021320005 -0.415827690  0.160610620
 [51]  0.088930406  0.145050142 -0.461139422  0.053061012  0.592189205
 [56]  0.057740786  0.492197314  0.189735785  0.187350494 -0.446198345
 [61] -0.135914852  0.315476498 -0.056505083  0.227299905  0.018375596
 [66] -0.324311865  0.487020432 -0.134306500 -0.507129695 -0.056355399
 [71]  0.384833451  0.190786898  0.413891471 -0.276927763  0.474786661
 [76] -0.691936610  0.292498824  0.134669416  0.441130331  0.278237441
 [81] -0.676892624  0.292272304  0.144423305  0.086670160  0.424935213
 [86]  0.089686354 -0.220373230 -0.139273651  0.208256398  0.298962828
 [91] -0.205610705  0.120964544 -0.095285172  0.029953863  0.256272289
 [96]  0.100937503 -0.384097537 -0.228534688  0.042587168 -0.149172994
[101] -0.010864736  0.388859869 -0.022072189 -0.678353479 -0.477225916
[106]  0.095966685  0.337436623  0.262427560  0.096487718  0.205487886
[111] -0.467989289 -0.267787401  0.271419535 -0.265028553 -0.069897705
[116] -0.148589831  0.199111960  0.172662336  0.431962571  0.101174397
[121] -0.565846252 -0.157984320  0.139064468 -0.110491015  0.193424428
[126]  0.234125816  0.426886998 -0.477417165  0.017933743  0.275793055
[131] -0.064299536  0.391081579 -0.107638456  0.218733769  0.196682498
[136] -0.275627429  0.428402656 -0.556975406 -0.588866191 -0.120300978
[141] -0.320894467 -0.189675744 -0.069482122 -0.300908950 -0.237718809
[146]  0.521819849 -0.323248459 -0.189133855 -0.106275020 -0.256498054
[151] -0.660403383  0.685891852 -0.034919609  0.140512515 -0.459542257
[156]  0.016654260 -0.293468346  0.037809712 -0.236535223  0.367172848
[161] -0.073482985 -0.226935739  0.310521723  0.362572597  0.423781624
[166] -0.266189514 -0.070057095 -0.180399965 -0.165742088  0.093144638
[171]  0.398793016 -0.238759039  0.196728501  0.695187120  0.015948070
[176] -0.802962891 -0.589040144 -0.595373850 -0.050375392 -0.096678710
[181] -0.168478271 -0.182554029 -0.041348187  0.308478090  0.149981796
[186] -0.036522224 -0.105934451  0.113353167  0.347614760 -0.087060070
[191] -0.066150269 -0.036104710 -0.169176114  0.330063546  0.487156999
[196]  0.397581973  0.527769023 -0.257154661 -0.332810329  0.100246983
[201] -0.204163151  0.269427261 -0.367005848  0.718642568  0.190471620
[206] -0.330517520 -0.078677483  0.335328827  0.664954858 -0.114123363
[211]  0.224448920  0.766839518 -0.517542511 -0.226198556  0.130761003
[216] -0.265829187 -0.120386773  0.224190308  0.080468214 -0.024356890
[221] -0.133114430 -0.521700766 -0.003716234 -0.751059231  0.007290106
[226] -0.423714281 -0.129137368 -0.056340903  0.587136272 -0.360466497
> 
> proc.time()
   user  system elapsed 
  1.315   1.466   2.770 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x6125b2c9dc10>
> .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: 0x6125b2c9dc10>
> .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: 0x6125b2c9dc10>
> .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: 0x6125b2c9dc10>
> 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: 0x6125b39602d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6125b39602d0>
> .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: 0x6125b39602d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6125b39602d0>
> .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: 0x6125b39602d0>
> 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: 0x6125b4035d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6125b4035d70>
> .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: 0x6125b4035d70>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6125b4035d70>
> .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: 0x6125b4035d70>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6125b4035d70>
> .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: 0x6125b4035d70>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6125b4035d70>
> .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: 0x6125b4035d70>
> 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: 0x6125b3ba9370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6125b3ba9370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6125b3ba9370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6125b3ba9370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile38983a2064a74d" "BufferedMatrixFile38983a5de4e4b4"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile38983a2064a74d" "BufferedMatrixFile38983a5de4e4b4"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6125b3af4ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6125b3af4ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6125b3af4ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6125b3af4ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6125b3af4ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6125b3af4ff0>
> .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: 0x6125b3cd73d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6125b3cd73d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6125b3cd73d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6125b3cd73d0>
> 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: 0x6125b5488fb0>
> .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: 0x6125b5488fb0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.249   0.049   0.284 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.258   0.045   0.290 

Example timings