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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" 4877
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 255/2357HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-02-26 13:40 -0500 (Thu, 26 Feb 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

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

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.248   0.053   0.290 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478920 25.6    1048721 56.1   639242 34.2
Vcells 885815  6.8    8388608 64.0  2083259 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Feb 26 21:51:14 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Feb 26 21:51:15 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: 0x6116c06bac10>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Feb 26 21:51:15 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Feb 26 21:51:15 2026"
> 
> ColMode(tmp2)
<pointer: 0x6116c06bac10>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]        [,2]       [,3]        [,4]
[1,] 100.0918551 -1.39361785 -1.6719121  1.01063263
[2,]   0.6661182  1.75341952  0.5113443  0.62245194
[3,]  -0.1775876  0.09884394  0.3695898  0.72100207
[4,]   0.0461528 -0.92251999 -2.1842854 -0.07890257
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]       [,4]
[1,] 100.0918551 1.39361785 1.6719121 1.01063263
[2,]   0.6661182 1.75341952 0.5113443 0.62245194
[3,]   0.1775876 0.09884394 0.3695898 0.72100207
[4,]   0.0461528 0.92251999 2.1842854 0.07890257
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0045917 1.1805159 1.2930244 1.0053023
[2,]  0.8161607 1.3241675 0.7150834 0.7889562
[3,]  0.4214114 0.3143946 0.6079390 0.8491184
[4,]  0.2148320 0.9604790 1.4779328 0.2808960
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.13777 38.19878 39.60216 36.06366
[2,]  33.82772 39.99509 32.66218 33.51201
[3,]  29.39170 28.24279 31.44898 34.21219
[4,]  27.19447 35.52731 41.96361 27.88786
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6116c11a5820>
> exp(tmp5)
<pointer: 0x6116c11a5820>
> log(tmp5,2)
<pointer: 0x6116c11a5820>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5948
> Min(tmp5)
[1] 53.91789
> mean(tmp5)
[1] 72.08462
> Sum(tmp5)
[1] 14416.92
> Var(tmp5)
[1] 873.2297
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.90755 66.65960 68.22063 69.87295 70.31487 70.95155 70.35810 74.55685
 [9] 67.18807 68.81599
> rowSums(tmp5)
 [1] 1878.151 1333.192 1364.413 1397.459 1406.297 1419.031 1407.162 1491.137
 [9] 1343.761 1376.320
> rowVars(tmp5)
 [1] 7891.96130   68.82633   84.02974   91.09406   61.17113   48.22787
 [7]   70.41035  102.17370   59.95088   64.23216
> rowSd(tmp5)
 [1] 88.836711  8.296163  9.166774  9.544321  7.821197  6.944629  8.391088
 [8] 10.108101  7.742795  8.014497
> rowMax(tmp5)
 [1] 468.59478  83.24455  93.02980  87.74213  80.16578  84.64076  89.82004
 [8]  98.60555  86.12816  88.66250
> rowMin(tmp5)
 [1] 53.91789 54.57586 55.03244 55.11759 59.12462 60.38854 55.99773 57.54799
 [9] 54.73606 56.21615
> 
> colMeans(tmp5)
 [1] 107.27530  71.27896  71.37939  66.64159  70.09854  69.17781  70.57652
 [8]  68.86408  73.74158  68.80010  66.68666  70.28057  70.22888  69.70346
[15]  73.96708  71.82706  66.24254  74.22716  70.09376  70.60129
> colSums(tmp5)
 [1] 1072.7530  712.7896  713.7939  666.4159  700.9854  691.7781  705.7652
 [8]  688.6408  737.4158  688.0010  666.8666  702.8057  702.2888  697.0346
[15]  739.6708  718.2706  662.4254  742.2716  700.9376  706.0129
> colVars(tmp5)
 [1] 16156.19106    49.05610    72.92735    71.92876   221.54035    54.85674
 [7]    55.70246    80.03189    35.22157    75.10287   107.73571    87.51586
[13]    41.40892    73.70235   104.88940   107.06069    62.97336    48.72502
[19]   129.65545   118.81874
> colSd(tmp5)
 [1] 127.107006   7.004006   8.539751   8.481083  14.884232   7.406534
 [7]   7.463408   8.946054   5.934776   8.666191  10.379581   9.354991
[13]   6.434976   8.585007  10.241553  10.347013   7.935576   6.980331
[19]  11.386635  10.900401
> colMax(tmp5)
 [1] 468.59478  83.24455  87.34176  78.83857  98.60555  78.79689  86.27846
 [8]  87.64482  82.58242  84.46851  85.58043  89.25977  77.13803  87.74213
[15]  89.82004  86.12816  80.33623  88.66250  90.63787  84.64076
> colMin(tmp5)
 [1] 56.60173 58.78367 62.27459 55.96015 53.91789 59.46168 59.60615 57.68348
 [9] 66.10625 59.46249 54.57586 58.59928 55.03244 60.38854 60.18244 57.67550
[17] 55.99773 66.33064 55.11759 54.73606
> 
> 
> ### 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] 93.90755 66.65960 68.22063 69.87295 70.31487       NA 70.35810 74.55685
 [9] 67.18807 68.81599
> rowSums(tmp5)
 [1] 1878.151 1333.192 1364.413 1397.459 1406.297       NA 1407.162 1491.137
 [9] 1343.761 1376.320
> rowVars(tmp5)
 [1] 7891.96130   68.82633   84.02974   91.09406   61.17113   49.41095
 [7]   70.41035  102.17370   59.95088   64.23216
> rowSd(tmp5)
 [1] 88.836711  8.296163  9.166774  9.544321  7.821197  7.029292  8.391088
 [8] 10.108101  7.742795  8.014497
> rowMax(tmp5)
 [1] 468.59478  83.24455  93.02980  87.74213  80.16578        NA  89.82004
 [8]  98.60555  86.12816  88.66250
> rowMin(tmp5)
 [1] 53.91789 54.57586 55.03244 55.11759 59.12462       NA 55.99773 57.54799
 [9] 54.73606 56.21615
> 
> colMeans(tmp5)
 [1] 107.27530  71.27896  71.37939  66.64159  70.09854  69.17781        NA
 [8]  68.86408  73.74158  68.80010  66.68666  70.28057  70.22888  69.70346
[15]  73.96708  71.82706  66.24254  74.22716  70.09376  70.60129
> colSums(tmp5)
 [1] 1072.7530  712.7896  713.7939  666.4159  700.9854  691.7781        NA
 [8]  688.6408  737.4158  688.0010  666.8666  702.8057  702.2888  697.0346
[15]  739.6708  718.2706  662.4254  742.2716  700.9376  706.0129
> colVars(tmp5)
 [1] 16156.19106    49.05610    72.92735    71.92876   221.54035    54.85674
 [7]          NA    80.03189    35.22157    75.10287   107.73571    87.51586
[13]    41.40892    73.70235   104.88940   107.06069    62.97336    48.72502
[19]   129.65545   118.81874
> colSd(tmp5)
 [1] 127.107006   7.004006   8.539751   8.481083  14.884232   7.406534
 [7]         NA   8.946054   5.934776   8.666191  10.379581   9.354991
[13]   6.434976   8.585007  10.241553  10.347013   7.935576   6.980331
[19]  11.386635  10.900401
> colMax(tmp5)
 [1] 468.59478  83.24455  87.34176  78.83857  98.60555  78.79689        NA
 [8]  87.64482  82.58242  84.46851  85.58043  89.25977  77.13803  87.74213
[15]  89.82004  86.12816  80.33623  88.66250  90.63787  84.64076
> colMin(tmp5)
 [1] 56.60173 58.78367 62.27459 55.96015 53.91789 59.46168       NA 57.68348
 [9] 66.10625 59.46249 54.57586 58.59928 55.03244 60.38854 60.18244 57.67550
[17] 55.99773 66.33064 55.11759 54.73606
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.5948
> Min(tmp5,na.rm=TRUE)
[1] 53.91789
> mean(tmp5,na.rm=TRUE)
[1] 72.06489
> Sum(tmp5,na.rm=TRUE)
[1] 14340.91
> Var(tmp5,na.rm=TRUE)
[1] 877.5618
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.90755 66.65960 68.22063 69.87295 70.31487 70.68533 70.35810 74.55685
 [9] 67.18807 68.81599
> rowSums(tmp5,na.rm=TRUE)
 [1] 1878.151 1333.192 1364.413 1397.459 1406.297 1343.021 1407.162 1491.137
 [9] 1343.761 1376.320
> rowVars(tmp5,na.rm=TRUE)
 [1] 7891.96130   68.82633   84.02974   91.09406   61.17113   49.41095
 [7]   70.41035  102.17370   59.95088   64.23216
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.836711  8.296163  9.166774  9.544321  7.821197  7.029292  8.391088
 [8] 10.108101  7.742795  8.014497
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.59478  83.24455  93.02980  87.74213  80.16578  84.64076  89.82004
 [8]  98.60555  86.12816  88.66250
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.91789 54.57586 55.03244 55.11759 59.12462 60.38854 55.99773 57.54799
 [9] 54.73606 56.21615
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.27530  71.27896  71.37939  66.64159  70.09854  69.17781  69.97282
 [8]  68.86408  73.74158  68.80010  66.68666  70.28057  70.22888  69.70346
[15]  73.96708  71.82706  66.24254  74.22716  70.09376  70.60129
> colSums(tmp5,na.rm=TRUE)
 [1] 1072.7530  712.7896  713.7939  666.4159  700.9854  691.7781  629.7554
 [8]  688.6408  737.4158  688.0010  666.8666  702.8057  702.2888  697.0346
[15]  739.6708  718.2706  662.4254  742.2716  700.9376  706.0129
> colVars(tmp5,na.rm=TRUE)
 [1] 16156.19106    49.05610    72.92735    71.92876   221.54035    54.85674
 [7]    58.56518    80.03189    35.22157    75.10287   107.73571    87.51586
[13]    41.40892    73.70235   104.88940   107.06069    62.97336    48.72502
[19]   129.65545   118.81874
> colSd(tmp5,na.rm=TRUE)
 [1] 127.107006   7.004006   8.539751   8.481083  14.884232   7.406534
 [7]   7.652789   8.946054   5.934776   8.666191  10.379581   9.354991
[13]   6.434976   8.585007  10.241553  10.347013   7.935576   6.980331
[19]  11.386635  10.900401
> colMax(tmp5,na.rm=TRUE)
 [1] 468.59478  83.24455  87.34176  78.83857  98.60555  78.79689  86.27846
 [8]  87.64482  82.58242  84.46851  85.58043  89.25977  77.13803  87.74213
[15]  89.82004  86.12816  80.33623  88.66250  90.63787  84.64076
> colMin(tmp5,na.rm=TRUE)
 [1] 56.60173 58.78367 62.27459 55.96015 53.91789 59.46168 59.60615 57.68348
 [9] 66.10625 59.46249 54.57586 58.59928 55.03244 60.38854 60.18244 57.67550
[17] 55.99773 66.33064 55.11759 54.73606
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.90755 66.65960 68.22063 69.87295 70.31487      NaN 70.35810 74.55685
 [9] 67.18807 68.81599
> rowSums(tmp5,na.rm=TRUE)
 [1] 1878.151 1333.192 1364.413 1397.459 1406.297    0.000 1407.162 1491.137
 [9] 1343.761 1376.320
> rowVars(tmp5,na.rm=TRUE)
 [1] 7891.96130   68.82633   84.02974   91.09406   61.17113         NA
 [7]   70.41035  102.17370   59.95088   64.23216
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.836711  8.296163  9.166774  9.544321  7.821197        NA  8.391088
 [8] 10.108101  7.742795  8.014497
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.59478  83.24455  93.02980  87.74213  80.16578        NA  89.82004
 [8]  98.60555  86.12816  88.66250
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.91789 54.57586 55.03244 55.11759 59.12462       NA 55.99773 57.54799
 [9] 54.73606 56.21615
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.15057  71.10800  72.29438  65.71258  70.58741  68.39196       NaN
 [8]  69.74296  73.96529  67.95515  66.10297  70.91101  70.43336  70.73845
[15]  73.22730  70.91308  66.04872  74.31766  70.59524  69.04135
> colSums(tmp5,na.rm=TRUE)
 [1] 1009.3551  639.9720  650.6494  591.4132  635.2867  615.5277    0.0000
 [8]  627.6867  665.6876  611.5964  594.9268  638.1991  633.9002  636.6461
[15]  659.0457  638.2177  594.4384  668.8589  635.3572  621.3721
> colVars(tmp5,na.rm=TRUE)
 [1] 17908.32186    54.85930    72.62479    71.21026   246.54429    54.76639
 [7]          NA    81.34595    39.06125    76.45890   117.36990    93.98391
[13]    46.11464    70.86406   111.84380   111.04542    70.42241    54.72352
[19]   143.03318   106.29514
> colSd(tmp5,na.rm=TRUE)
 [1] 133.821978   7.406706   8.522018   8.438617  15.701729   7.400432
 [7]         NA   9.019199   6.249900   8.744078  10.833739   9.694530
[13]   6.790776   8.418079  10.575623  10.537809   8.391806   7.397535
[19]  11.959648  10.309953
> colMax(tmp5,na.rm=TRUE)
 [1] 468.59478  83.24455  87.34176  78.83857  98.60555  78.79689      -Inf
 [8]  87.64482  82.58242  84.46851  85.58043  89.25977  77.13803  87.74213
[15]  89.82004  86.12816  80.33623  88.66250  90.63787  82.59486
> colMin(tmp5,na.rm=TRUE)
 [1] 56.60173 58.78367 62.27459 55.96015 53.91789 59.46168      Inf 57.68348
 [9] 66.10625 59.46249 54.57586 58.59928 55.03244 61.53296 60.18244 57.67550
[17] 55.99773 66.33064 55.11759 54.73606
> 
> 
> 
> 
> 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] 313.33014 254.25234 233.12207  97.88401 360.61645 331.45987 290.85125
 [8] 301.49611 304.89611 251.65194
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 313.33014 254.25234 233.12207  97.88401 360.61645 331.45987 290.85125
 [8] 301.49611 304.89611 251.65194
> 
> 
> 
> 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.136868e-13 -1.705303e-13 -2.842171e-13 -1.421085e-14 -1.136868e-13
 [6] -2.557954e-13  1.136868e-13 -5.684342e-14 -5.684342e-14 -5.684342e-14
[11]  0.000000e+00  5.684342e-14 -5.684342e-14 -1.136868e-13 -5.684342e-14
[16]  2.273737e-13  4.263256e-14 -2.131628e-13 -5.684342e-14 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   10 
7   17 
4   19 
4   3 
3   9 
1   6 
7   6 
10   8 
2   11 
5   8 
1   4 
8   19 
9   14 
9   9 
2   9 
9   7 
3   12 
1   11 
5   3 
9   8 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.016845
> Min(tmp)
[1] -2.154864
> mean(tmp)
[1] -0.07495148
> Sum(tmp)
[1] -7.495148
> Var(tmp)
[1] 0.8004721
> 
> rowMeans(tmp)
[1] -0.07495148
> rowSums(tmp)
[1] -7.495148
> rowVars(tmp)
[1] 0.8004721
> rowSd(tmp)
[1] 0.8946911
> rowMax(tmp)
[1] 2.016845
> rowMin(tmp)
[1] -2.154864
> 
> colMeans(tmp)
  [1]  0.07534757 -0.11062768 -0.25384825  0.81737808 -1.12565192  0.72487247
  [7]  0.63823291 -0.30708462 -0.77730292 -0.19392631  0.27645116 -1.68739637
 [13]  0.47124823  0.16788624  0.79804352 -0.18207134  1.69969081 -0.12653931
 [19]  0.81910839 -0.34468753 -1.24829534 -0.68243626 -0.98744283 -0.14840811
 [25]  0.56240004  0.51450528  0.45500499  0.82405315 -0.61428326  0.65276217
 [31]  0.57833383  0.51893407  0.14541248 -1.55217026  0.92821683 -0.03062525
 [37]  0.23838969 -0.49702727  0.04197453 -2.15220526 -1.01596916 -1.15148292
 [43] -0.15027994  0.15490784 -0.40574101  0.73039861 -0.27039190 -1.16236298
 [49] -0.32633569 -0.79952487 -0.94876346 -0.13089435  0.43214597 -0.56818921
 [55]  2.01684508 -0.82919707  0.85473125  1.64459660  1.27949264  0.35604287
 [61] -0.36903214 -2.11558527 -0.92383611 -2.15486428  0.16846347 -0.69597146
 [67] -0.47219250 -0.14970865 -0.07834935 -1.54346880  1.52148548 -0.11910773
 [73]  0.75005270 -1.51437805  0.47413169  0.95331461  1.83751031  0.19987434
 [79]  0.05371480 -0.64942769 -0.53728274 -0.21584294 -0.14085315 -0.23399484
 [85] -1.69830689 -0.63909399 -0.76948296  0.32579628 -0.25839902  1.28043837
 [91] -0.31170169  0.13348002 -1.46557316  0.86365946 -0.27565459  0.37554626
 [97]  1.89230923 -0.34808095  1.09947815 -0.38045866
> colSums(tmp)
  [1]  0.07534757 -0.11062768 -0.25384825  0.81737808 -1.12565192  0.72487247
  [7]  0.63823291 -0.30708462 -0.77730292 -0.19392631  0.27645116 -1.68739637
 [13]  0.47124823  0.16788624  0.79804352 -0.18207134  1.69969081 -0.12653931
 [19]  0.81910839 -0.34468753 -1.24829534 -0.68243626 -0.98744283 -0.14840811
 [25]  0.56240004  0.51450528  0.45500499  0.82405315 -0.61428326  0.65276217
 [31]  0.57833383  0.51893407  0.14541248 -1.55217026  0.92821683 -0.03062525
 [37]  0.23838969 -0.49702727  0.04197453 -2.15220526 -1.01596916 -1.15148292
 [43] -0.15027994  0.15490784 -0.40574101  0.73039861 -0.27039190 -1.16236298
 [49] -0.32633569 -0.79952487 -0.94876346 -0.13089435  0.43214597 -0.56818921
 [55]  2.01684508 -0.82919707  0.85473125  1.64459660  1.27949264  0.35604287
 [61] -0.36903214 -2.11558527 -0.92383611 -2.15486428  0.16846347 -0.69597146
 [67] -0.47219250 -0.14970865 -0.07834935 -1.54346880  1.52148548 -0.11910773
 [73]  0.75005270 -1.51437805  0.47413169  0.95331461  1.83751031  0.19987434
 [79]  0.05371480 -0.64942769 -0.53728274 -0.21584294 -0.14085315 -0.23399484
 [85] -1.69830689 -0.63909399 -0.76948296  0.32579628 -0.25839902  1.28043837
 [91] -0.31170169  0.13348002 -1.46557316  0.86365946 -0.27565459  0.37554626
 [97]  1.89230923 -0.34808095  1.09947815 -0.38045866
> 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.07534757 -0.11062768 -0.25384825  0.81737808 -1.12565192  0.72487247
  [7]  0.63823291 -0.30708462 -0.77730292 -0.19392631  0.27645116 -1.68739637
 [13]  0.47124823  0.16788624  0.79804352 -0.18207134  1.69969081 -0.12653931
 [19]  0.81910839 -0.34468753 -1.24829534 -0.68243626 -0.98744283 -0.14840811
 [25]  0.56240004  0.51450528  0.45500499  0.82405315 -0.61428326  0.65276217
 [31]  0.57833383  0.51893407  0.14541248 -1.55217026  0.92821683 -0.03062525
 [37]  0.23838969 -0.49702727  0.04197453 -2.15220526 -1.01596916 -1.15148292
 [43] -0.15027994  0.15490784 -0.40574101  0.73039861 -0.27039190 -1.16236298
 [49] -0.32633569 -0.79952487 -0.94876346 -0.13089435  0.43214597 -0.56818921
 [55]  2.01684508 -0.82919707  0.85473125  1.64459660  1.27949264  0.35604287
 [61] -0.36903214 -2.11558527 -0.92383611 -2.15486428  0.16846347 -0.69597146
 [67] -0.47219250 -0.14970865 -0.07834935 -1.54346880  1.52148548 -0.11910773
 [73]  0.75005270 -1.51437805  0.47413169  0.95331461  1.83751031  0.19987434
 [79]  0.05371480 -0.64942769 -0.53728274 -0.21584294 -0.14085315 -0.23399484
 [85] -1.69830689 -0.63909399 -0.76948296  0.32579628 -0.25839902  1.28043837
 [91] -0.31170169  0.13348002 -1.46557316  0.86365946 -0.27565459  0.37554626
 [97]  1.89230923 -0.34808095  1.09947815 -0.38045866
> colMin(tmp)
  [1]  0.07534757 -0.11062768 -0.25384825  0.81737808 -1.12565192  0.72487247
  [7]  0.63823291 -0.30708462 -0.77730292 -0.19392631  0.27645116 -1.68739637
 [13]  0.47124823  0.16788624  0.79804352 -0.18207134  1.69969081 -0.12653931
 [19]  0.81910839 -0.34468753 -1.24829534 -0.68243626 -0.98744283 -0.14840811
 [25]  0.56240004  0.51450528  0.45500499  0.82405315 -0.61428326  0.65276217
 [31]  0.57833383  0.51893407  0.14541248 -1.55217026  0.92821683 -0.03062525
 [37]  0.23838969 -0.49702727  0.04197453 -2.15220526 -1.01596916 -1.15148292
 [43] -0.15027994  0.15490784 -0.40574101  0.73039861 -0.27039190 -1.16236298
 [49] -0.32633569 -0.79952487 -0.94876346 -0.13089435  0.43214597 -0.56818921
 [55]  2.01684508 -0.82919707  0.85473125  1.64459660  1.27949264  0.35604287
 [61] -0.36903214 -2.11558527 -0.92383611 -2.15486428  0.16846347 -0.69597146
 [67] -0.47219250 -0.14970865 -0.07834935 -1.54346880  1.52148548 -0.11910773
 [73]  0.75005270 -1.51437805  0.47413169  0.95331461  1.83751031  0.19987434
 [79]  0.05371480 -0.64942769 -0.53728274 -0.21584294 -0.14085315 -0.23399484
 [85] -1.69830689 -0.63909399 -0.76948296  0.32579628 -0.25839902  1.28043837
 [91] -0.31170169  0.13348002 -1.46557316  0.86365946 -0.27565459  0.37554626
 [97]  1.89230923 -0.34808095  1.09947815 -0.38045866
> colMedians(tmp)
  [1]  0.07534757 -0.11062768 -0.25384825  0.81737808 -1.12565192  0.72487247
  [7]  0.63823291 -0.30708462 -0.77730292 -0.19392631  0.27645116 -1.68739637
 [13]  0.47124823  0.16788624  0.79804352 -0.18207134  1.69969081 -0.12653931
 [19]  0.81910839 -0.34468753 -1.24829534 -0.68243626 -0.98744283 -0.14840811
 [25]  0.56240004  0.51450528  0.45500499  0.82405315 -0.61428326  0.65276217
 [31]  0.57833383  0.51893407  0.14541248 -1.55217026  0.92821683 -0.03062525
 [37]  0.23838969 -0.49702727  0.04197453 -2.15220526 -1.01596916 -1.15148292
 [43] -0.15027994  0.15490784 -0.40574101  0.73039861 -0.27039190 -1.16236298
 [49] -0.32633569 -0.79952487 -0.94876346 -0.13089435  0.43214597 -0.56818921
 [55]  2.01684508 -0.82919707  0.85473125  1.64459660  1.27949264  0.35604287
 [61] -0.36903214 -2.11558527 -0.92383611 -2.15486428  0.16846347 -0.69597146
 [67] -0.47219250 -0.14970865 -0.07834935 -1.54346880  1.52148548 -0.11910773
 [73]  0.75005270 -1.51437805  0.47413169  0.95331461  1.83751031  0.19987434
 [79]  0.05371480 -0.64942769 -0.53728274 -0.21584294 -0.14085315 -0.23399484
 [85] -1.69830689 -0.63909399 -0.76948296  0.32579628 -0.25839902  1.28043837
 [91] -0.31170169  0.13348002 -1.46557316  0.86365946 -0.27565459  0.37554626
 [97]  1.89230923 -0.34808095  1.09947815 -0.38045866
> colRanges(tmp)
           [,1]       [,2]       [,3]      [,4]      [,5]      [,6]      [,7]
[1,] 0.07534757 -0.1106277 -0.2538482 0.8173781 -1.125652 0.7248725 0.6382329
[2,] 0.07534757 -0.1106277 -0.2538482 0.8173781 -1.125652 0.7248725 0.6382329
           [,8]       [,9]      [,10]     [,11]     [,12]     [,13]     [,14]
[1,] -0.3070846 -0.7773029 -0.1939263 0.2764512 -1.687396 0.4712482 0.1678862
[2,] -0.3070846 -0.7773029 -0.1939263 0.2764512 -1.687396 0.4712482 0.1678862
         [,15]      [,16]    [,17]      [,18]     [,19]      [,20]     [,21]
[1,] 0.7980435 -0.1820713 1.699691 -0.1265393 0.8191084 -0.3446875 -1.248295
[2,] 0.7980435 -0.1820713 1.699691 -0.1265393 0.8191084 -0.3446875 -1.248295
          [,22]      [,23]      [,24]  [,25]     [,26]    [,27]     [,28]
[1,] -0.6824363 -0.9874428 -0.1484081 0.5624 0.5145053 0.455005 0.8240532
[2,] -0.6824363 -0.9874428 -0.1484081 0.5624 0.5145053 0.455005 0.8240532
          [,29]     [,30]     [,31]     [,32]     [,33]    [,34]     [,35]
[1,] -0.6142833 0.6527622 0.5783338 0.5189341 0.1454125 -1.55217 0.9282168
[2,] -0.6142833 0.6527622 0.5783338 0.5189341 0.1454125 -1.55217 0.9282168
           [,36]     [,37]      [,38]      [,39]     [,40]     [,41]     [,42]
[1,] -0.03062525 0.2383897 -0.4970273 0.04197453 -2.152205 -1.015969 -1.151483
[2,] -0.03062525 0.2383897 -0.4970273 0.04197453 -2.152205 -1.015969 -1.151483
          [,43]     [,44]     [,45]     [,46]      [,47]     [,48]      [,49]
[1,] -0.1502799 0.1549078 -0.405741 0.7303986 -0.2703919 -1.162363 -0.3263357
[2,] -0.1502799 0.1549078 -0.405741 0.7303986 -0.2703919 -1.162363 -0.3263357
          [,50]      [,51]      [,52]    [,53]      [,54]    [,55]      [,56]
[1,] -0.7995249 -0.9487635 -0.1308944 0.432146 -0.5681892 2.016845 -0.8291971
[2,] -0.7995249 -0.9487635 -0.1308944 0.432146 -0.5681892 2.016845 -0.8291971
         [,57]    [,58]    [,59]     [,60]      [,61]     [,62]      [,63]
[1,] 0.8547313 1.644597 1.279493 0.3560429 -0.3690321 -2.115585 -0.9238361
[2,] 0.8547313 1.644597 1.279493 0.3560429 -0.3690321 -2.115585 -0.9238361
         [,64]     [,65]      [,66]      [,67]      [,68]       [,69]     [,70]
[1,] -2.154864 0.1684635 -0.6959715 -0.4721925 -0.1497086 -0.07834935 -1.543469
[2,] -2.154864 0.1684635 -0.6959715 -0.4721925 -0.1497086 -0.07834935 -1.543469
        [,71]      [,72]     [,73]     [,74]     [,75]     [,76]   [,77]
[1,] 1.521485 -0.1191077 0.7500527 -1.514378 0.4741317 0.9533146 1.83751
[2,] 1.521485 -0.1191077 0.7500527 -1.514378 0.4741317 0.9533146 1.83751
         [,78]     [,79]      [,80]      [,81]      [,82]      [,83]      [,84]
[1,] 0.1998743 0.0537148 -0.6494277 -0.5372827 -0.2158429 -0.1408531 -0.2339948
[2,] 0.1998743 0.0537148 -0.6494277 -0.5372827 -0.2158429 -0.1408531 -0.2339948
         [,85]     [,86]     [,87]     [,88]     [,89]    [,90]      [,91]
[1,] -1.698307 -0.639094 -0.769483 0.3257963 -0.258399 1.280438 -0.3117017
[2,] -1.698307 -0.639094 -0.769483 0.3257963 -0.258399 1.280438 -0.3117017
       [,92]     [,93]     [,94]      [,95]     [,96]    [,97]     [,98]
[1,] 0.13348 -1.465573 0.8636595 -0.2756546 0.3755463 1.892309 -0.348081
[2,] 0.13348 -1.465573 0.8636595 -0.2756546 0.3755463 1.892309 -0.348081
        [,99]     [,100]
[1,] 1.099478 -0.3804587
[2,] 1.099478 -0.3804587
> 
> 
> Max(tmp2)
[1] 2.864222
> Min(tmp2)
[1] -2.358019
> mean(tmp2)
[1] -0.03287578
> Sum(tmp2)
[1] -3.287578
> Var(tmp2)
[1] 0.9382279
> 
> rowMeans(tmp2)
  [1] -1.49809661 -0.12035742 -0.59980597  0.73133225 -0.75608555 -0.72519826
  [7]  0.13559340  2.14633066  0.67086762  0.21938878 -0.53839960 -0.32847232
 [13] -1.16684386 -1.55986656 -0.40126966  0.52165904 -0.48326333  0.61822699
 [19]  2.86422189 -0.03788624  0.78114795 -0.49689596 -2.35801920 -0.83896409
 [25] -0.84433203  0.96873235 -1.80871053 -0.77432806 -1.38324468 -0.51667436
 [31]  0.47430444 -1.68866969  0.26994600 -1.15327233 -0.43022369  0.92504764
 [37]  1.22725294  1.73327979  0.03288979  0.13897043 -0.72580804  1.72942833
 [43] -0.73090635  0.40600212  0.55693334 -0.56738316 -0.38534787  0.43336680
 [49] -0.73219865  0.94220137  0.32799355  0.48788542 -1.06692564 -1.11508067
 [55]  0.69768107  0.44194597 -0.39578552  0.06949378  0.58041903  0.60468718
 [61] -0.24516633  0.56829568 -0.50172596 -0.07952232 -0.88394278 -0.07275446
 [67] -0.94010580  0.35489149 -0.77861937 -0.72219384 -0.30613545  1.44495163
 [73]  0.11212757  0.41355252 -1.38264877 -0.17131239  0.58783163  1.65958785
 [79]  2.26687134  0.52567933 -0.67202468 -0.38692740  0.90025969  0.28400822
 [85] -0.29575545  0.23614044  0.39909610 -0.01388380  0.73204281 -0.26856527
 [91] -2.34594619 -0.18178868 -0.03817704 -2.17754556  0.09370159 -0.27858131
 [97]  0.59467638 -0.26309032  1.18153805  1.85466902
> rowSums(tmp2)
  [1] -1.49809661 -0.12035742 -0.59980597  0.73133225 -0.75608555 -0.72519826
  [7]  0.13559340  2.14633066  0.67086762  0.21938878 -0.53839960 -0.32847232
 [13] -1.16684386 -1.55986656 -0.40126966  0.52165904 -0.48326333  0.61822699
 [19]  2.86422189 -0.03788624  0.78114795 -0.49689596 -2.35801920 -0.83896409
 [25] -0.84433203  0.96873235 -1.80871053 -0.77432806 -1.38324468 -0.51667436
 [31]  0.47430444 -1.68866969  0.26994600 -1.15327233 -0.43022369  0.92504764
 [37]  1.22725294  1.73327979  0.03288979  0.13897043 -0.72580804  1.72942833
 [43] -0.73090635  0.40600212  0.55693334 -0.56738316 -0.38534787  0.43336680
 [49] -0.73219865  0.94220137  0.32799355  0.48788542 -1.06692564 -1.11508067
 [55]  0.69768107  0.44194597 -0.39578552  0.06949378  0.58041903  0.60468718
 [61] -0.24516633  0.56829568 -0.50172596 -0.07952232 -0.88394278 -0.07275446
 [67] -0.94010580  0.35489149 -0.77861937 -0.72219384 -0.30613545  1.44495163
 [73]  0.11212757  0.41355252 -1.38264877 -0.17131239  0.58783163  1.65958785
 [79]  2.26687134  0.52567933 -0.67202468 -0.38692740  0.90025969  0.28400822
 [85] -0.29575545  0.23614044  0.39909610 -0.01388380  0.73204281 -0.26856527
 [91] -2.34594619 -0.18178868 -0.03817704 -2.17754556  0.09370159 -0.27858131
 [97]  0.59467638 -0.26309032  1.18153805  1.85466902
> 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] -1.49809661 -0.12035742 -0.59980597  0.73133225 -0.75608555 -0.72519826
  [7]  0.13559340  2.14633066  0.67086762  0.21938878 -0.53839960 -0.32847232
 [13] -1.16684386 -1.55986656 -0.40126966  0.52165904 -0.48326333  0.61822699
 [19]  2.86422189 -0.03788624  0.78114795 -0.49689596 -2.35801920 -0.83896409
 [25] -0.84433203  0.96873235 -1.80871053 -0.77432806 -1.38324468 -0.51667436
 [31]  0.47430444 -1.68866969  0.26994600 -1.15327233 -0.43022369  0.92504764
 [37]  1.22725294  1.73327979  0.03288979  0.13897043 -0.72580804  1.72942833
 [43] -0.73090635  0.40600212  0.55693334 -0.56738316 -0.38534787  0.43336680
 [49] -0.73219865  0.94220137  0.32799355  0.48788542 -1.06692564 -1.11508067
 [55]  0.69768107  0.44194597 -0.39578552  0.06949378  0.58041903  0.60468718
 [61] -0.24516633  0.56829568 -0.50172596 -0.07952232 -0.88394278 -0.07275446
 [67] -0.94010580  0.35489149 -0.77861937 -0.72219384 -0.30613545  1.44495163
 [73]  0.11212757  0.41355252 -1.38264877 -0.17131239  0.58783163  1.65958785
 [79]  2.26687134  0.52567933 -0.67202468 -0.38692740  0.90025969  0.28400822
 [85] -0.29575545  0.23614044  0.39909610 -0.01388380  0.73204281 -0.26856527
 [91] -2.34594619 -0.18178868 -0.03817704 -2.17754556  0.09370159 -0.27858131
 [97]  0.59467638 -0.26309032  1.18153805  1.85466902
> rowMin(tmp2)
  [1] -1.49809661 -0.12035742 -0.59980597  0.73133225 -0.75608555 -0.72519826
  [7]  0.13559340  2.14633066  0.67086762  0.21938878 -0.53839960 -0.32847232
 [13] -1.16684386 -1.55986656 -0.40126966  0.52165904 -0.48326333  0.61822699
 [19]  2.86422189 -0.03788624  0.78114795 -0.49689596 -2.35801920 -0.83896409
 [25] -0.84433203  0.96873235 -1.80871053 -0.77432806 -1.38324468 -0.51667436
 [31]  0.47430444 -1.68866969  0.26994600 -1.15327233 -0.43022369  0.92504764
 [37]  1.22725294  1.73327979  0.03288979  0.13897043 -0.72580804  1.72942833
 [43] -0.73090635  0.40600212  0.55693334 -0.56738316 -0.38534787  0.43336680
 [49] -0.73219865  0.94220137  0.32799355  0.48788542 -1.06692564 -1.11508067
 [55]  0.69768107  0.44194597 -0.39578552  0.06949378  0.58041903  0.60468718
 [61] -0.24516633  0.56829568 -0.50172596 -0.07952232 -0.88394278 -0.07275446
 [67] -0.94010580  0.35489149 -0.77861937 -0.72219384 -0.30613545  1.44495163
 [73]  0.11212757  0.41355252 -1.38264877 -0.17131239  0.58783163  1.65958785
 [79]  2.26687134  0.52567933 -0.67202468 -0.38692740  0.90025969  0.28400822
 [85] -0.29575545  0.23614044  0.39909610 -0.01388380  0.73204281 -0.26856527
 [91] -2.34594619 -0.18178868 -0.03817704 -2.17754556  0.09370159 -0.27858131
 [97]  0.59467638 -0.26309032  1.18153805  1.85466902
> 
> colMeans(tmp2)
[1] -0.03287578
> colSums(tmp2)
[1] -3.287578
> colVars(tmp2)
[1] 0.9382279
> colSd(tmp2)
[1] 0.9686216
> colMax(tmp2)
[1] 2.864222
> colMin(tmp2)
[1] -2.358019
> colMedians(tmp2)
[1] -0.05546575
> colRanges(tmp2)
          [,1]
[1,] -2.358019
[2,]  2.864222
> 
> 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] -3.64824349 -1.88093816  1.21601178  2.50083657  3.42605264 -0.63429997
 [7]  0.01474606  0.66111938 -7.56476733  4.18575860
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7512594
[2,] -1.0908119
[3,] -0.5171811
[4,]  0.3551628
[5,]  1.3032151
> 
> rowApply(tmp,sum)
 [1]  2.5426256 -1.1083067  0.3015304  0.2374746 -2.3029850 -3.2255095
 [7]  4.6874245 -2.8558892 -1.8746594  1.8745710
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    5    9    8    3    3    4    3    1     1
 [2,]    3    9    3    9    5    4    2    8    3     2
 [3,]    1    2   10    1   10   10    3    7    7     5
 [4,]    8    6    4    4    1    9    5    9    5    10
 [5,]   10    8    5    5    6    8    9    5    6     9
 [6,]    7    4    7    3    4    2    7    4   10     3
 [7,]    5    7    2    7    9    7    8    1    9     6
 [8,]    9    1    1    6    2    6   10   10    8     8
 [9,]    2    3    6    2    8    1    1    2    2     7
[10,]    6   10    8   10    7    5    6    6    4     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.642351013  4.021816165 -2.225233759  1.014801717  2.833163012
 [6]  1.615620282  3.246291749  3.168310690 -2.949095687  2.408616452
[11] -1.172805381  4.180699666 -3.419957932  2.288836715 -0.047927726
[16]  0.032048012 -0.009696865 -2.373277594  0.565666841  3.027119422
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.53305147
[2,] -0.56571816
[3,] -0.52737741
[4,]  0.08656287
[5,]  0.89723317
> 
> rowApply(tmp,sum)
[1]  6.6886383  1.2342646 -0.7402035  0.8088169  6.5711284
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    7    3   16   12
[2,]   13   19   18   13    3
[3,]    3   13    7    3   11
[4,]   16   18    1   12   15
[5,]   19   12    6   18   10
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]       [,4]         [,5]       [,6]
[1,] -0.56571816  0.7243015 -0.68155785  0.8943377  2.048921719 -0.2740790
[2,] -0.52737741  2.5538108  0.16838064  1.1457169  0.117384240  0.6844253
[3,] -1.53305147  1.2983329 -0.60131120 -2.2611002 -0.620299049  0.9856745
[4,]  0.89723317  0.1875925 -1.15599676  0.1562011  1.296275417  1.5907757
[5,]  0.08656287 -0.7422215  0.04525141  1.0796461 -0.009119316 -1.3711763
            [,7]       [,8]        [,9]      [,10]      [,11]     [,12]
[1,]  0.99432685  0.8689216 -2.06915468 -0.3509654  0.3444014 0.7292549
[2,] -0.86678110  2.8062156 -0.03050485 -0.3560999  0.6175077 0.3268111
[3,]  0.91906050  0.7236308  0.07930734  0.8934033 -2.0506527 0.2679229
[4,]  0.01899569 -0.5537763 -0.72076216  0.0178321 -1.3789855 2.2670756
[5,]  2.18068980 -0.6766810 -0.20798134  2.2044463  1.2949237 0.5896351
          [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
[1,] -0.9428099  1.0955735 -0.1933237 -0.1605984 -0.05613488  0.7087054
[2,] -1.2208174  0.3630155 -0.7803596 -0.3816982 -1.10790728 -1.6316658
[3,] -0.5117066  0.2679232  1.8562710 -0.5529202 -0.93975367  0.5435658
[4,] -0.4718753  1.1845739 -0.8839908  0.3120683  0.67165111 -1.2304852
[5,] -0.2727487 -0.6222494 -0.0465247  0.8151964  1.42244786 -0.7633979
          [,19]       [,20]
[1,]  0.6230228  2.95121271
[2,] -0.6129647 -0.03282705
[3,]  1.7470001 -1.25150079
[4,] -0.5863585 -0.80922735
[5,] -0.6050328  2.16946190
> 
> 
> 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 :  648  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 :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2     col3      col4      col5      col6       col7
row1 -1.073889 0.691749 2.165633 0.5899644 -1.212063 -0.532394 -0.1093589
         col8      col9      col10    col11    col12     col13     col14
row1 1.170258 0.8563776 -0.1693227 1.168014 1.893176 0.1027869 -1.345692
          col15    col16       col17     col18     col19      col20
row1 -0.3896698 1.509088 0.004220441 0.5828658 0.8385369 -0.9599046
> tmp[,"col10"]
          col10
row1 -0.1693227
row2 -1.1855229
row3 -0.2344207
row4  1.3398009
row5  0.1699585
> tmp[c("row1","row5"),]
           col1      col2       col3      col4       col5       col6
row1 -1.0738885  0.691749  2.1656332 0.5899644 -1.2120632 -0.5323940
row5 -0.8169617 -1.856841 -0.5842451 0.7466740 -0.3601679  0.5345771
            col7       col8       col9      col10      col11     col12
row1 -0.10935894  1.1702584  0.8563776 -0.1693227  1.1680138 1.8931758
row5 -0.08660928 -0.3319652 -0.7182824  0.1699585 -0.5623554 0.8193051
         col13      col14      col15      col16       col17     col18
row1 0.1027869 -1.3456924 -0.3896698  1.5090884 0.004220441 0.5828658
row5 0.1191387 -0.3049317 -0.2110267 -0.2877401 1.468537500 1.8608722
          col19      col20
row1  0.8385369 -0.9599046
row5 -1.4729275 -0.1945880
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.5323940 -0.9599046
row2 -1.1472812 -0.9835416
row3  1.7353523  0.6492768
row4 -0.1425281  1.6899616
row5  0.5345771 -0.1945880
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.5323940 -0.9599046
row5  0.5345771 -0.1945880
> 
> 
> 
> 
> 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 51.03203 49.72651 48.34079 50.64211 51.67104 105.0219 50.32284 49.41479
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.47488 48.91805 50.81811 51.70026 48.37379 50.55231 50.44247 49.84844
        col17    col18    col19    col20
row1 49.49588 49.20534 50.42777 103.5805
> tmp[,"col10"]
        col10
row1 48.91805
row2 31.19129
row3 31.19948
row4 30.23364
row5 50.93284
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.03203 49.72651 48.34079 50.64211 51.67104 105.0219 50.32284 49.41479
row5 47.01953 50.99273 50.34509 52.91169 50.78409 104.1666 50.16279 49.09439
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.47488 48.91805 50.81811 51.70026 48.37379 50.55231 50.44247 49.84844
row5 50.05638 50.93284 50.62993 49.96563 50.25704 51.12580 49.60001 50.00417
        col17    col18    col19    col20
row1 49.49588 49.20534 50.42777 103.5805
row5 49.87317 49.40914 49.98731 104.3289
> tmp[,c("col6","col20")]
          col6     col20
row1 105.02194 103.58049
row2  74.41069  76.48115
row3  72.63960  75.90645
row4  74.61493  74.43315
row5 104.16665 104.32890
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0219 103.5805
row5 104.1666 104.3289
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0219 103.5805
row5 104.1666 104.3289
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.7724162
[2,] -0.7875699
[3,]  0.3944640
[4,]  0.4764739
[5,]  1.5834252
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.8669721  0.3050475
[2,]  0.2346447 -0.2641803
[3,] -0.2859930 -2.1711408
[4,]  1.1919039  0.2377203
[5,]  1.3760991 -0.8854988
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.7137276  1.8050795
[2,]  0.4822610 -0.8558816
[3,]  1.0324212  1.4519454
[4,] -1.0966919 -1.7725250
[5,]  0.2339739 -0.1422817
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.7137276
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.7137276
[2,] 0.4822610
> 
> 
> 
> 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.4779793 -0.6847213 -0.828244  0.3601158 -1.301784 1.3336943  1.0049660
row1 -0.1819628 -2.7033680 -1.300480 -0.5050594 -1.387780 0.2559511 -0.5314923
           [,8]      [,9]       [,10]    [,11]       [,12]      [,13]
row3  0.2081165 0.4109449 -0.18530528 1.316849  0.05638342 -1.9090360
row1 -0.9515518 0.5649739 -0.01226892 0.200581 -1.67586711  0.5755895
          [,14]     [,15]       [,16]      [,17]      [,18]     [,19]
row3 -1.6142284 0.8777118 -0.06853644 -0.3241232 -0.3303484 -2.189586
row1 -0.9034715 0.4757976 -0.14066797 -1.9780251 -1.3926654 -1.051213
          [,20]
row3 -1.9680920
row1  0.5166566
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]      [,3]     [,4]      [,5]     [,6]       [,7]
row2 0.8129249 -0.2854082 -1.259691 1.404597 0.1683988 1.697922 -0.5451834
          [,8]       [,9]    [,10]
row2 0.8248264 -0.3041702 1.972304
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]       [,4]       [,5]     [,6]     [,7]
row5 -0.2479684 -0.9813747 0.2465047 -0.9778858 0.03892591 1.429801 1.639026
         [,8]      [,9]     [,10]      [,11]     [,12]      [,13]      [,14]
row5 1.113787 0.6833699 0.2849576 -0.7424731 0.4085967 0.04701079 -0.7417351
         [,15]    [,16]      [,17]    [,18]     [,19]      [,20]
row5 0.4654594 1.340949 -0.2140786 0.435357 0.5572172 -0.6657479
> 
> 
> 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: 0x6116c1746a90>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c387c99b213"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c3821c3de41"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c384e3e99d7"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c383a8926b8"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c38be29279" 
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c383dfcc96a"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c3851b4765c"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c385ee781da"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c38d077d05" 
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c3873c98057"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c387528eeaf"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c381c26d5ed"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c38508ea3fe"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c3820a5dc20"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM67c384e04fa09"
> 
> 
> ### 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: 0x6116c3297860>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6116c3297860>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6116c3297860>
> rowMedians(tmp)
  [1]  0.218617891 -0.416229838 -0.503608157 -0.373440759  0.192904416
  [6] -0.075874731  0.321566334 -0.092707900 -0.364154491 -0.031068360
 [11]  0.223921117 -0.187549082 -0.293793015  0.344128994 -0.388951528
 [16]  0.269972151  0.061439141  0.117251901 -0.303039809 -0.347068920
 [21]  0.287501231 -0.361085981  0.411737508  0.022844440  0.296318062
 [26] -0.315061554  0.112656708 -0.498915678 -0.084229804 -0.113991247
 [31]  0.193808935  0.285994378 -0.060319428 -0.081544136  0.264124644
 [36] -0.223317637  0.247253179  0.098651083  0.443353778  0.112159534
 [41] -0.583310470 -0.382122900 -0.111454697 -0.018879248 -0.272026611
 [46] -0.002135320 -0.330193840  0.203049016  0.160248034 -0.392110898
 [51]  0.467630302 -0.007204854 -0.251092709  0.170430016 -0.435481676
 [56]  0.689420901  0.325211835  0.489553466 -0.176161953  0.458718959
 [61] -0.048385398  0.345099530 -0.098042751 -0.654307724 -0.404321371
 [66]  0.509194859 -0.240583170  0.491250386  0.287472598  0.032804921
 [71]  0.074611159  0.298115827 -0.404008341  0.289749838  0.278794792
 [76]  0.146419003 -0.103453516  0.437148712  0.090721733 -0.051615408
 [81] -0.057467958  0.269999486  0.263851187 -0.196619735 -0.116538273
 [86] -0.124171814 -0.262984211 -0.376527165 -0.363594139  0.526583697
 [91] -0.115626693  0.716120264  0.083386339 -0.173104246 -0.285051863
 [96] -0.579447377 -0.671394763  0.037455615 -0.009201505 -0.324369191
[101] -0.346341892  0.296654918  0.005462157 -0.042542205  0.193925107
[106] -0.292687772  0.140181083  0.545635729 -0.239905630 -0.021195270
[111] -0.502718160 -0.130332111  0.223754477 -0.370120902  0.068459282
[116]  0.046276818 -0.354415304 -0.027981894  0.011812329 -0.197559699
[121] -0.569193987 -0.104749273 -0.441868091 -0.131460677  0.078338669
[126]  0.083496066  0.054780519 -0.190587467 -0.054502018  0.308772180
[131]  0.041314565 -0.142957252 -0.079345752  0.007766074 -0.188990814
[136] -0.018764986 -0.338004853 -0.036200474  0.312530676 -0.009698147
[141]  0.030434930  0.046595792 -0.024717115 -0.383568581  0.349469618
[146] -0.022034469  0.392530809 -0.082055177 -0.434019559  0.118727821
[151]  0.168406481 -0.271208854 -0.360830559  0.234227851  0.476199896
[156]  0.211681432 -0.196737871  0.231556600  0.477533846 -0.808808088
[161]  0.466582735  0.541723383 -0.255860302  0.324085186 -0.260987986
[166] -0.293806494 -0.520862681  0.314655271  0.264019569 -0.016153818
[171]  0.773449794  0.268017246 -0.297542320  0.302560339 -0.125337144
[176]  0.124275299  0.757496183  0.339563041  0.058802745 -0.204334036
[181] -0.327233517 -0.093912180  0.269069556  0.365931680  0.307413969
[186] -0.559313077  0.168901325 -0.017708817 -0.044136635  0.057175821
[191]  0.416815686 -0.414801433  0.074760769 -0.099050244 -0.309960636
[196]  0.130874607 -0.464380521  0.217029840  0.485673247 -0.251335534
[201] -0.080716186 -0.112928391  0.654565564  0.206028051 -0.055292673
[206] -0.064827409  0.317166544 -0.311306834 -0.152981840 -0.505496123
[211] -0.135264488  0.622718009 -0.440882960 -0.791477939  0.468451093
[216]  0.098183503  0.071853033 -0.293070768  0.240522566 -0.074463591
[221]  0.145059843 -0.693390396 -0.637148257  0.075218807 -0.180308129
[226]  0.485745610  0.200373179  0.188269115 -0.349325858 -0.391420131
> 
> proc.time()
   user  system elapsed 
  1.389   1.467   2.845 

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: 0x5dc33eabec10>
> .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: 0x5dc33eabec10>
> .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: 0x5dc33eabec10>
> .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: 0x5dc33eabec10>
> 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: 0x5dc33f7812d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dc33f7812d0>
> .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: 0x5dc33f7812d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dc33f7812d0>
> .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: 0x5dc33f7812d0>
> 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: 0x5dc33fe56d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dc33fe56d70>
> .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: 0x5dc33fe56d70>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5dc33fe56d70>
> .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: 0x5dc33fe56d70>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5dc33fe56d70>
> .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: 0x5dc33fe56d70>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5dc33fe56d70>
> .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: 0x5dc33fe56d70>
> 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: 0x5dc33f9ca370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5dc33f9ca370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dc33f9ca370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dc33f9ca370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile67d516744b188" "BufferedMatrixFile67d517b11ac42"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile67d516744b188" "BufferedMatrixFile67d517b11ac42"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dc33f915ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dc33f915ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5dc33f915ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5dc33f915ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5dc33f915ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5dc33f915ff0>
> .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: 0x5dc33faf83d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dc33faf83d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5dc33faf83d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5dc33faf83d0>
> 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: 0x5dc3412a9fb0>
> .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: 0x5dc3412a9fb0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.236   0.062   0.287 

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.243   0.051   0.283 

Example timings