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

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

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

Package 255/2354HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-02-22 13:40 -0500 (Sun, 22 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-22 22:05:30 -0500 (Sun, 22 Feb 2026)
EndedAt: 2026-02-22 22:05:56 -0500 (Sun, 22 Feb 2026)
EllapsedTime: 26.1 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.247   0.053   0.289 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478920 25.6    1048721 56.1   639242 34.2
Vcells 885815  6.8    8388608 64.0  2083259 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Sun Feb 22 22:05:46 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] "Sun Feb 22 22:05:46 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: 0x5dd0479b9c10>
> 
> 
> 
> 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] "Sun Feb 22 22:05:46 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] "Sun Feb 22 22:05:47 2026"
> 
> ColMode(tmp2)
<pointer: 0x5dd0479b9c10>
> 
> 
> 
> ### 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.6244411 -1.1516170 -2.2019052 -0.9621340
[2,]   1.7226612  1.0050771  1.1273750 -0.4065552
[3,]   0.3412982  1.1714847 -0.3877138  0.5206165
[4,]   0.3800815  0.1067987 -0.9395654  0.6792245
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.6244411 1.1516170 2.2019052 0.9621340
[2,]   1.7226612 1.0050771 1.1273750 0.4065552
[3,]   0.3412982 1.1714847 0.3877138 0.5206165
[4,]   0.3800815 0.1067987 0.9395654 0.6792245
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0311735 1.0731342 1.4838818 0.9808843
[2,]  1.3125019 1.0025354 1.0617792 0.6376168
[3,]  0.5842073 1.0823515 0.6226667 0.7215376
[4,]  0.6165075 0.3268007 0.9693118 0.8241508
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.93618 36.88296 42.04072 35.77098
[2,]  39.84768 36.03043 36.74517 31.78272
[3,]  31.18337 36.99500 31.61438 32.73599
[4,]  31.54516 28.37481 35.63268 33.92073
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5dd048810ff0>
> exp(tmp5)
<pointer: 0x5dd048810ff0>
> log(tmp5,2)
<pointer: 0x5dd048810ff0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.2565
> Min(tmp5)
[1] 52.23979
> mean(tmp5)
[1] 72.03835
> Sum(tmp5)
[1] 14407.67
> Var(tmp5)
[1] 866.6972
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.68134 73.63474 69.59743 68.06824 72.05502 68.59927 66.89047 68.48785
 [9] 70.43637 70.93276
> rowSums(tmp5)
 [1] 1833.627 1472.695 1391.949 1361.365 1441.100 1371.985 1337.809 1369.757
 [9] 1408.727 1418.655
> rowVars(tmp5)
 [1] 8000.47908   46.93817   44.09979   74.58186   78.82996   99.07697
 [7]   65.76093   49.65529   50.62897   78.15797
> rowSd(tmp5)
 [1] 89.445397  6.851144  6.640768  8.636079  8.878624  9.953741  8.109311
 [8]  7.046651  7.115404  8.840700
> rowMax(tmp5)
 [1] 470.25655  87.52432  81.16837  89.05374  91.87853  91.56124  84.55285
 [8]  82.04785  81.45013  83.59874
> rowMin(tmp5)
 [1] 57.28468 62.90812 55.90811 55.20710 55.36624 53.93235 52.23979 54.96348
 [9] 54.30705 54.33715
> 
> colMeans(tmp5)
 [1] 107.88295  72.00420  73.17749  70.49730  68.46731  67.00043  71.96435
 [8]  69.69203  68.48278  69.85334  66.92856  69.75008  73.68583  70.20900
[15]  72.13860  66.61229  69.33927  69.09056  72.69373  71.29687
> colSums(tmp5)
 [1] 1078.8295  720.0420  731.7749  704.9730  684.6731  670.0043  719.6435
 [8]  696.9203  684.8278  698.5334  669.2856  697.5008  736.8583  702.0900
[15]  721.3860  666.1229  693.3927  690.9056  726.9373  712.9687
> colVars(tmp5)
 [1] 16251.10465    50.48763   105.96756    23.56465    22.98854    50.59699
 [7]    93.34540   133.49910    85.49682   103.39683    52.72884    71.81358
[13]   125.42932    56.76702    57.79339    99.24404    61.36006    34.30236
[19]    29.87685    61.22792
> colSd(tmp5)
 [1] 127.479821   7.105465  10.294054   4.854343   4.794637   7.113156
 [7]   9.661542  11.554181   9.246449  10.168423   7.261463   8.474289
[13]  11.199523   7.534389   7.602196   9.962130   7.833266   5.856821
[19]   5.465972   7.824827
> colMax(tmp5)
 [1] 470.25655  79.74835  87.50226  77.11305  73.63355  75.67339  91.56124
 [8]  81.63416  87.52432  84.55285  81.16837  83.50245  91.87853  83.59874
[15]  89.05374  82.81489  77.64380  81.40889  79.89241  79.63124
> colMin(tmp5)
 [1] 62.09059 59.05844 52.23979 60.00638 57.28468 54.30705 61.32334 54.96348
 [9] 56.68621 55.90811 56.04922 56.88274 55.20710 55.36624 62.79749 53.93235
[17] 54.33715 59.85700 64.56728 55.88555
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.68134 73.63474 69.59743 68.06824 72.05502 68.59927 66.89047 68.48785
 [9]       NA 70.93276
> rowSums(tmp5)
 [1] 1833.627 1472.695 1391.949 1361.365 1441.100 1371.985 1337.809 1369.757
 [9]       NA 1418.655
> rowVars(tmp5)
 [1] 8000.47908   46.93817   44.09979   74.58186   78.82996   99.07697
 [7]   65.76093   49.65529   52.72945   78.15797
> rowSd(tmp5)
 [1] 89.445397  6.851144  6.640768  8.636079  8.878624  9.953741  8.109311
 [8]  7.046651  7.261505  8.840700
> rowMax(tmp5)
 [1] 470.25655  87.52432  81.16837  89.05374  91.87853  91.56124  84.55285
 [8]  82.04785        NA  83.59874
> rowMin(tmp5)
 [1] 57.28468 62.90812 55.90811 55.20710 55.36624 53.93235 52.23979 54.96348
 [9]       NA 54.33715
> 
> colMeans(tmp5)
 [1] 107.88295  72.00420  73.17749  70.49730  68.46731  67.00043  71.96435
 [8]  69.69203  68.48278  69.85334  66.92856  69.75008  73.68583  70.20900
[15]  72.13860  66.61229  69.33927  69.09056  72.69373        NA
> colSums(tmp5)
 [1] 1078.8295  720.0420  731.7749  704.9730  684.6731  670.0043  719.6435
 [8]  696.9203  684.8278  698.5334  669.2856  697.5008  736.8583  702.0900
[15]  721.3860  666.1229  693.3927  690.9056  726.9373        NA
> colVars(tmp5)
 [1] 16251.10465    50.48763   105.96756    23.56465    22.98854    50.59699
 [7]    93.34540   133.49910    85.49682   103.39683    52.72884    71.81358
[13]   125.42932    56.76702    57.79339    99.24404    61.36006    34.30236
[19]    29.87685          NA
> colSd(tmp5)
 [1] 127.479821   7.105465  10.294054   4.854343   4.794637   7.113156
 [7]   9.661542  11.554181   9.246449  10.168423   7.261463   8.474289
[13]  11.199523   7.534389   7.602196   9.962130   7.833266   5.856821
[19]   5.465972         NA
> colMax(tmp5)
 [1] 470.25655  79.74835  87.50226  77.11305  73.63355  75.67339  91.56124
 [8]  81.63416  87.52432  84.55285  81.16837  83.50245  91.87853  83.59874
[15]  89.05374  82.81489  77.64380  81.40889  79.89241        NA
> colMin(tmp5)
 [1] 62.09059 59.05844 52.23979 60.00638 57.28468 54.30705 61.32334 54.96348
 [9] 56.68621 55.90811 56.04922 56.88274 55.20710 55.36624 62.79749 53.93235
[17] 54.33715 59.85700 64.56728       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.2565
> Min(tmp5,na.rm=TRUE)
[1] 52.23979
> mean(tmp5,na.rm=TRUE)
[1] 72.02886
> Sum(tmp5,na.rm=TRUE)
[1] 14333.74
> Var(tmp5,na.rm=TRUE)
[1] 871.0564
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.68134 73.63474 69.59743 68.06824 72.05502 68.59927 66.89047 68.48785
 [9] 70.25269 70.93276
> rowSums(tmp5,na.rm=TRUE)
 [1] 1833.627 1472.695 1391.949 1361.365 1441.100 1371.985 1337.809 1369.757
 [9] 1334.801 1418.655
> rowVars(tmp5,na.rm=TRUE)
 [1] 8000.47908   46.93817   44.09979   74.58186   78.82996   99.07697
 [7]   65.76093   49.65529   52.72945   78.15797
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.445397  6.851144  6.640768  8.636079  8.878624  9.953741  8.109311
 [8]  7.046651  7.261505  8.840700
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.25655  87.52432  81.16837  89.05374  91.87853  91.56124  84.55285
 [8]  82.04785  81.45013  83.59874
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.28468 62.90812 55.90811 55.20710 55.36624 53.93235 52.23979 54.96348
 [9] 54.30705 54.33715
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.88295  72.00420  73.17749  70.49730  68.46731  67.00043  71.96435
 [8]  69.69203  68.48278  69.85334  66.92856  69.75008  73.68583  70.20900
[15]  72.13860  66.61229  69.33927  69.09056  72.69373  71.00472
> colSums(tmp5,na.rm=TRUE)
 [1] 1078.8295  720.0420  731.7749  704.9730  684.6731  670.0043  719.6435
 [8]  696.9203  684.8278  698.5334  669.2856  697.5008  736.8583  702.0900
[15]  721.3860  666.1229  693.3927  690.9056  726.9373  639.0425
> colVars(tmp5,na.rm=TRUE)
 [1] 16251.10465    50.48763   105.96756    23.56465    22.98854    50.59699
 [7]    93.34540   133.49910    85.49682   103.39683    52.72884    71.81358
[13]   125.42932    56.76702    57.79339    99.24404    61.36006    34.30236
[19]    29.87685    67.92119
> colSd(tmp5,na.rm=TRUE)
 [1] 127.479821   7.105465  10.294054   4.854343   4.794637   7.113156
 [7]   9.661542  11.554181   9.246449  10.168423   7.261463   8.474289
[13]  11.199523   7.534389   7.602196   9.962130   7.833266   5.856821
[19]   5.465972   8.241431
> colMax(tmp5,na.rm=TRUE)
 [1] 470.25655  79.74835  87.50226  77.11305  73.63355  75.67339  91.56124
 [8]  81.63416  87.52432  84.55285  81.16837  83.50245  91.87853  83.59874
[15]  89.05374  82.81489  77.64380  81.40889  79.89241  79.63124
> colMin(tmp5,na.rm=TRUE)
 [1] 62.09059 59.05844 52.23979 60.00638 57.28468 54.30705 61.32334 54.96348
 [9] 56.68621 55.90811 56.04922 56.88274 55.20710 55.36624 62.79749 53.93235
[17] 54.33715 59.85700 64.56728 55.88555
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.68134 73.63474 69.59743 68.06824 72.05502 68.59927 66.89047 68.48785
 [9]      NaN 70.93276
> rowSums(tmp5,na.rm=TRUE)
 [1] 1833.627 1472.695 1391.949 1361.365 1441.100 1371.985 1337.809 1369.757
 [9]    0.000 1418.655
> rowVars(tmp5,na.rm=TRUE)
 [1] 8000.47908   46.93817   44.09979   74.58186   78.82996   99.07697
 [7]   65.76093   49.65529         NA   78.15797
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.445397  6.851144  6.640768  8.636079  8.878624  9.953741  8.109311
 [8]  7.046651        NA  8.840700
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.25655  87.52432  81.16837  89.05374  91.87853  91.56124  84.55285
 [8]  82.04785        NA  83.59874
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.28468 62.90812 55.90811 55.20710 55.36624 53.93235 52.23979 54.96348
 [9]       NA 54.33715
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.32547  71.56859  73.04684  70.42860  68.61084  68.41080  72.84361
 [8]  68.64774  67.52625  69.36110  67.27187  70.95454  72.82313  70.10705
[15]  73.17650  66.47572  68.50813  69.05162  72.18380       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1010.9293  644.1173  657.4215  633.8574  617.4976  615.6972  655.5925
 [8]  617.8297  607.7362  624.2499  605.4469  638.5909  655.4082  630.9634
[15]  658.5885  598.2815  616.5731  621.4646  649.6542    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 18060.46258    54.66378   119.02147    26.45714    25.63035    34.54357
 [7]    96.31610   137.91791    85.89080   113.59563    57.99402    64.46973
[13]   132.73517    63.74596    52.89863   111.43971    61.25858    38.57309
[19]    30.68616          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 134.389220   7.393496  10.909696   5.143650   5.062643   5.877378
 [7]   9.814076  11.743846   9.267729  10.658125   7.615381   8.029305
[13]  11.521075   7.984106   7.273144  10.556501   7.826786   6.210724
[19]   5.539509         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 470.25655  79.74835  87.50226  77.11305  73.63355  75.67339  91.56124
 [8]  81.63416  87.52432  84.55285  81.16837  83.50245  91.87853  83.59874
[15]  89.05374  82.81489  77.64380  81.40889  79.89241      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 62.09059 59.05844 52.23979 60.00638 57.28468 57.15740 61.32334 54.96348
 [9] 56.68621 55.90811 56.04922 56.88274 55.20710 55.36624 64.35140 53.93235
[17] 54.33715 59.85700 64.56728      Inf
> 
> 
> 
> 
> 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] 198.8071 247.6235 206.7018 227.2167 308.8392 181.5160 179.1209 278.1300
 [9] 218.2303 238.8384
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 198.8071 247.6235 206.7018 227.2167 308.8392 181.5160 179.1209 278.1300
 [9] 218.2303 238.8384
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14 -5.684342e-14 -8.526513e-14  0.000000e+00 -5.684342e-14
 [6]  8.526513e-14  1.136868e-13  0.000000e+00 -5.684342e-14 -5.684342e-14
[11]  1.136868e-13 -1.136868e-13  8.526513e-14  5.684342e-14 -5.684342e-14
[16]  8.526513e-14  5.684342e-14 -1.421085e-13  8.526513e-14 -2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   4 
2   11 
2   20 
7   3 
5   17 
10   7 
2   12 
8   16 
2   16 
2   3 
9   3 
10   3 
3   15 
3   12 
2   7 
10   19 
4   17 
4   16 
8   7 
6   11 
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.51284
> Min(tmp)
[1] -1.965364
> mean(tmp)
[1] 0.140833
> Sum(tmp)
[1] 14.0833
> Var(tmp)
[1] 0.8186949
> 
> rowMeans(tmp)
[1] 0.140833
> rowSums(tmp)
[1] 14.0833
> rowVars(tmp)
[1] 0.8186949
> rowSd(tmp)
[1] 0.9048176
> rowMax(tmp)
[1] 2.51284
> rowMin(tmp)
[1] -1.965364
> 
> colMeans(tmp)
  [1] -0.98312271  0.75037505  1.05115201 -0.16156065 -0.78909400  0.59532143
  [7] -0.42207813  1.97794037  0.15459647  0.37696560 -1.71638771  1.84709092
 [13]  0.29873393 -0.29515468  0.96802047  2.12391937  0.26801104  0.77792937
 [19] -1.82487728  0.10090862  1.80903245  0.06901741 -0.43389552 -0.89095969
 [25]  1.11967544 -0.44404801  0.10052919  0.95685048 -0.07959527 -0.14875148
 [31] -0.39554282 -0.64815256  1.42198527  0.57804458 -0.66382733 -1.15453939
 [37] -0.98125986  0.11997616  0.78695277  0.93786658 -0.92009134  0.47180918
 [43] -0.45443982  0.45965562  0.21824088  0.85041307 -0.22508046  2.51283993
 [49]  0.65938835  0.73026975  0.72277362 -1.10514251  0.32498120  1.30643324
 [55] -0.47351456  0.29256488 -0.95574558  1.13880714  1.15063964 -0.03189602
 [61]  0.56526911  0.63903608  0.83430529  1.03844425 -0.62438721 -0.63643076
 [67] -0.48157702  0.99826203 -0.97165655  0.27663681  1.16284459 -0.35761870
 [73] -1.03491592 -1.53129216  0.22839810 -0.01073758  0.43854067 -0.22501992
 [79] -0.44557381 -0.01699379  0.73998206  1.53835182  1.38930263  0.49475941
 [85]  0.17476931 -1.09614303  0.42012231  0.75315482  1.24488590 -1.33433123
 [91]  0.50415275  0.53531744 -0.56100424 -0.68656282 -0.71338280 -0.73955463
 [97] -1.96536354 -0.18535497 -0.63823842  0.53194637
> colSums(tmp)
  [1] -0.98312271  0.75037505  1.05115201 -0.16156065 -0.78909400  0.59532143
  [7] -0.42207813  1.97794037  0.15459647  0.37696560 -1.71638771  1.84709092
 [13]  0.29873393 -0.29515468  0.96802047  2.12391937  0.26801104  0.77792937
 [19] -1.82487728  0.10090862  1.80903245  0.06901741 -0.43389552 -0.89095969
 [25]  1.11967544 -0.44404801  0.10052919  0.95685048 -0.07959527 -0.14875148
 [31] -0.39554282 -0.64815256  1.42198527  0.57804458 -0.66382733 -1.15453939
 [37] -0.98125986  0.11997616  0.78695277  0.93786658 -0.92009134  0.47180918
 [43] -0.45443982  0.45965562  0.21824088  0.85041307 -0.22508046  2.51283993
 [49]  0.65938835  0.73026975  0.72277362 -1.10514251  0.32498120  1.30643324
 [55] -0.47351456  0.29256488 -0.95574558  1.13880714  1.15063964 -0.03189602
 [61]  0.56526911  0.63903608  0.83430529  1.03844425 -0.62438721 -0.63643076
 [67] -0.48157702  0.99826203 -0.97165655  0.27663681  1.16284459 -0.35761870
 [73] -1.03491592 -1.53129216  0.22839810 -0.01073758  0.43854067 -0.22501992
 [79] -0.44557381 -0.01699379  0.73998206  1.53835182  1.38930263  0.49475941
 [85]  0.17476931 -1.09614303  0.42012231  0.75315482  1.24488590 -1.33433123
 [91]  0.50415275  0.53531744 -0.56100424 -0.68656282 -0.71338280 -0.73955463
 [97] -1.96536354 -0.18535497 -0.63823842  0.53194637
> 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.98312271  0.75037505  1.05115201 -0.16156065 -0.78909400  0.59532143
  [7] -0.42207813  1.97794037  0.15459647  0.37696560 -1.71638771  1.84709092
 [13]  0.29873393 -0.29515468  0.96802047  2.12391937  0.26801104  0.77792937
 [19] -1.82487728  0.10090862  1.80903245  0.06901741 -0.43389552 -0.89095969
 [25]  1.11967544 -0.44404801  0.10052919  0.95685048 -0.07959527 -0.14875148
 [31] -0.39554282 -0.64815256  1.42198527  0.57804458 -0.66382733 -1.15453939
 [37] -0.98125986  0.11997616  0.78695277  0.93786658 -0.92009134  0.47180918
 [43] -0.45443982  0.45965562  0.21824088  0.85041307 -0.22508046  2.51283993
 [49]  0.65938835  0.73026975  0.72277362 -1.10514251  0.32498120  1.30643324
 [55] -0.47351456  0.29256488 -0.95574558  1.13880714  1.15063964 -0.03189602
 [61]  0.56526911  0.63903608  0.83430529  1.03844425 -0.62438721 -0.63643076
 [67] -0.48157702  0.99826203 -0.97165655  0.27663681  1.16284459 -0.35761870
 [73] -1.03491592 -1.53129216  0.22839810 -0.01073758  0.43854067 -0.22501992
 [79] -0.44557381 -0.01699379  0.73998206  1.53835182  1.38930263  0.49475941
 [85]  0.17476931 -1.09614303  0.42012231  0.75315482  1.24488590 -1.33433123
 [91]  0.50415275  0.53531744 -0.56100424 -0.68656282 -0.71338280 -0.73955463
 [97] -1.96536354 -0.18535497 -0.63823842  0.53194637
> colMin(tmp)
  [1] -0.98312271  0.75037505  1.05115201 -0.16156065 -0.78909400  0.59532143
  [7] -0.42207813  1.97794037  0.15459647  0.37696560 -1.71638771  1.84709092
 [13]  0.29873393 -0.29515468  0.96802047  2.12391937  0.26801104  0.77792937
 [19] -1.82487728  0.10090862  1.80903245  0.06901741 -0.43389552 -0.89095969
 [25]  1.11967544 -0.44404801  0.10052919  0.95685048 -0.07959527 -0.14875148
 [31] -0.39554282 -0.64815256  1.42198527  0.57804458 -0.66382733 -1.15453939
 [37] -0.98125986  0.11997616  0.78695277  0.93786658 -0.92009134  0.47180918
 [43] -0.45443982  0.45965562  0.21824088  0.85041307 -0.22508046  2.51283993
 [49]  0.65938835  0.73026975  0.72277362 -1.10514251  0.32498120  1.30643324
 [55] -0.47351456  0.29256488 -0.95574558  1.13880714  1.15063964 -0.03189602
 [61]  0.56526911  0.63903608  0.83430529  1.03844425 -0.62438721 -0.63643076
 [67] -0.48157702  0.99826203 -0.97165655  0.27663681  1.16284459 -0.35761870
 [73] -1.03491592 -1.53129216  0.22839810 -0.01073758  0.43854067 -0.22501992
 [79] -0.44557381 -0.01699379  0.73998206  1.53835182  1.38930263  0.49475941
 [85]  0.17476931 -1.09614303  0.42012231  0.75315482  1.24488590 -1.33433123
 [91]  0.50415275  0.53531744 -0.56100424 -0.68656282 -0.71338280 -0.73955463
 [97] -1.96536354 -0.18535497 -0.63823842  0.53194637
> colMedians(tmp)
  [1] -0.98312271  0.75037505  1.05115201 -0.16156065 -0.78909400  0.59532143
  [7] -0.42207813  1.97794037  0.15459647  0.37696560 -1.71638771  1.84709092
 [13]  0.29873393 -0.29515468  0.96802047  2.12391937  0.26801104  0.77792937
 [19] -1.82487728  0.10090862  1.80903245  0.06901741 -0.43389552 -0.89095969
 [25]  1.11967544 -0.44404801  0.10052919  0.95685048 -0.07959527 -0.14875148
 [31] -0.39554282 -0.64815256  1.42198527  0.57804458 -0.66382733 -1.15453939
 [37] -0.98125986  0.11997616  0.78695277  0.93786658 -0.92009134  0.47180918
 [43] -0.45443982  0.45965562  0.21824088  0.85041307 -0.22508046  2.51283993
 [49]  0.65938835  0.73026975  0.72277362 -1.10514251  0.32498120  1.30643324
 [55] -0.47351456  0.29256488 -0.95574558  1.13880714  1.15063964 -0.03189602
 [61]  0.56526911  0.63903608  0.83430529  1.03844425 -0.62438721 -0.63643076
 [67] -0.48157702  0.99826203 -0.97165655  0.27663681  1.16284459 -0.35761870
 [73] -1.03491592 -1.53129216  0.22839810 -0.01073758  0.43854067 -0.22501992
 [79] -0.44557381 -0.01699379  0.73998206  1.53835182  1.38930263  0.49475941
 [85]  0.17476931 -1.09614303  0.42012231  0.75315482  1.24488590 -1.33433123
 [91]  0.50415275  0.53531744 -0.56100424 -0.68656282 -0.71338280 -0.73955463
 [97] -1.96536354 -0.18535497 -0.63823842  0.53194637
> colRanges(tmp)
           [,1]     [,2]     [,3]       [,4]      [,5]      [,6]       [,7]
[1,] -0.9831227 0.750375 1.051152 -0.1615606 -0.789094 0.5953214 -0.4220781
[2,] -0.9831227 0.750375 1.051152 -0.1615606 -0.789094 0.5953214 -0.4220781
        [,8]      [,9]     [,10]     [,11]    [,12]     [,13]      [,14]
[1,] 1.97794 0.1545965 0.3769656 -1.716388 1.847091 0.2987339 -0.2951547
[2,] 1.97794 0.1545965 0.3769656 -1.716388 1.847091 0.2987339 -0.2951547
         [,15]    [,16]    [,17]     [,18]     [,19]     [,20]    [,21]
[1,] 0.9680205 2.123919 0.268011 0.7779294 -1.824877 0.1009086 1.809032
[2,] 0.9680205 2.123919 0.268011 0.7779294 -1.824877 0.1009086 1.809032
          [,22]      [,23]      [,24]    [,25]     [,26]     [,27]     [,28]
[1,] 0.06901741 -0.4338955 -0.8909597 1.119675 -0.444048 0.1005292 0.9568505
[2,] 0.06901741 -0.4338955 -0.8909597 1.119675 -0.444048 0.1005292 0.9568505
           [,29]      [,30]      [,31]      [,32]    [,33]     [,34]      [,35]
[1,] -0.07959527 -0.1487515 -0.3955428 -0.6481526 1.421985 0.5780446 -0.6638273
[2,] -0.07959527 -0.1487515 -0.3955428 -0.6481526 1.421985 0.5780446 -0.6638273
         [,36]      [,37]     [,38]     [,39]     [,40]      [,41]     [,42]
[1,] -1.154539 -0.9812599 0.1199762 0.7869528 0.9378666 -0.9200913 0.4718092
[2,] -1.154539 -0.9812599 0.1199762 0.7869528 0.9378666 -0.9200913 0.4718092
          [,43]     [,44]     [,45]     [,46]      [,47]   [,48]     [,49]
[1,] -0.4544398 0.4596556 0.2182409 0.8504131 -0.2250805 2.51284 0.6593883
[2,] -0.4544398 0.4596556 0.2182409 0.8504131 -0.2250805 2.51284 0.6593883
         [,50]     [,51]     [,52]     [,53]    [,54]      [,55]     [,56]
[1,] 0.7302698 0.7227736 -1.105143 0.3249812 1.306433 -0.4735146 0.2925649
[2,] 0.7302698 0.7227736 -1.105143 0.3249812 1.306433 -0.4735146 0.2925649
          [,57]    [,58]   [,59]       [,60]     [,61]     [,62]     [,63]
[1,] -0.9557456 1.138807 1.15064 -0.03189602 0.5652691 0.6390361 0.8343053
[2,] -0.9557456 1.138807 1.15064 -0.03189602 0.5652691 0.6390361 0.8343053
        [,64]      [,65]      [,66]     [,67]    [,68]      [,69]     [,70]
[1,] 1.038444 -0.6243872 -0.6364308 -0.481577 0.998262 -0.9716566 0.2766368
[2,] 1.038444 -0.6243872 -0.6364308 -0.481577 0.998262 -0.9716566 0.2766368
        [,71]      [,72]     [,73]     [,74]     [,75]       [,76]     [,77]
[1,] 1.162845 -0.3576187 -1.034916 -1.531292 0.2283981 -0.01073758 0.4385407
[2,] 1.162845 -0.3576187 -1.034916 -1.531292 0.2283981 -0.01073758 0.4385407
          [,78]      [,79]       [,80]     [,81]    [,82]    [,83]     [,84]
[1,] -0.2250199 -0.4455738 -0.01699379 0.7399821 1.538352 1.389303 0.4947594
[2,] -0.2250199 -0.4455738 -0.01699379 0.7399821 1.538352 1.389303 0.4947594
         [,85]     [,86]     [,87]     [,88]    [,89]     [,90]     [,91]
[1,] 0.1747693 -1.096143 0.4201223 0.7531548 1.244886 -1.334331 0.5041527
[2,] 0.1747693 -1.096143 0.4201223 0.7531548 1.244886 -1.334331 0.5041527
         [,92]      [,93]      [,94]      [,95]      [,96]     [,97]     [,98]
[1,] 0.5353174 -0.5610042 -0.6865628 -0.7133828 -0.7395546 -1.965364 -0.185355
[2,] 0.5353174 -0.5610042 -0.6865628 -0.7133828 -0.7395546 -1.965364 -0.185355
          [,99]    [,100]
[1,] -0.6382384 0.5319464
[2,] -0.6382384 0.5319464
> 
> 
> Max(tmp2)
[1] 2.617388
> Min(tmp2)
[1] -2.682912
> mean(tmp2)
[1] 0.09216595
> Sum(tmp2)
[1] 9.216595
> Var(tmp2)
[1] 1.167519
> 
> rowMeans(tmp2)
  [1] -0.581094090  1.736909326  0.563638730  0.797768045 -1.257376206
  [6] -0.008763108 -0.908454951  1.545397117 -1.307836421  1.768806557
 [11]  1.499040196  0.269155456 -1.079832193 -2.184541002  0.123956391
 [16] -0.131369048  0.492216826  0.818399860  1.916497949  0.027629151
 [21]  0.851023298 -0.761527835  0.201048977  2.617388165 -0.034466821
 [26]  0.179717631 -0.062488619 -0.478065020 -1.504431209  0.932497607
 [31] -0.690091442  0.089336696 -0.730768793 -1.086336853  1.526926268
 [36]  1.799044983 -0.174563944  0.036286859 -1.152891628  0.751565816
 [41] -0.454182917 -2.058257336  1.617618200 -1.893440713  0.129610234
 [46] -0.180407826 -0.071349269  0.646234212 -1.362335240  0.128396567
 [51] -1.100528656 -0.587892193  0.599566707  1.631304341  1.249896209
 [56]  1.430514481 -0.440920816  0.797874020  0.873551990 -0.587610868
 [61]  0.947229491 -1.576239410  0.335719094  1.305475709  0.425714120
 [66] -0.220909419  0.196525651 -0.260548231  0.765207618  0.808942549
 [71] -0.067245600  0.155893652  1.489346650 -0.964946124 -0.256480864
 [76] -0.426201930 -1.150047496  0.539032863  1.921269168 -0.263669720
 [81] -0.972324893  0.823698117  2.182397342  1.076142916  0.754185302
 [86] -2.682912345  1.194537176  0.093069902  0.718652950  1.325876698
 [91]  1.154099937 -1.295985104 -0.460559852 -0.809635568 -2.333570053
 [96] -0.713267390 -0.347904628 -0.614441531 -0.511812976  0.155287025
> rowSums(tmp2)
  [1] -0.581094090  1.736909326  0.563638730  0.797768045 -1.257376206
  [6] -0.008763108 -0.908454951  1.545397117 -1.307836421  1.768806557
 [11]  1.499040196  0.269155456 -1.079832193 -2.184541002  0.123956391
 [16] -0.131369048  0.492216826  0.818399860  1.916497949  0.027629151
 [21]  0.851023298 -0.761527835  0.201048977  2.617388165 -0.034466821
 [26]  0.179717631 -0.062488619 -0.478065020 -1.504431209  0.932497607
 [31] -0.690091442  0.089336696 -0.730768793 -1.086336853  1.526926268
 [36]  1.799044983 -0.174563944  0.036286859 -1.152891628  0.751565816
 [41] -0.454182917 -2.058257336  1.617618200 -1.893440713  0.129610234
 [46] -0.180407826 -0.071349269  0.646234212 -1.362335240  0.128396567
 [51] -1.100528656 -0.587892193  0.599566707  1.631304341  1.249896209
 [56]  1.430514481 -0.440920816  0.797874020  0.873551990 -0.587610868
 [61]  0.947229491 -1.576239410  0.335719094  1.305475709  0.425714120
 [66] -0.220909419  0.196525651 -0.260548231  0.765207618  0.808942549
 [71] -0.067245600  0.155893652  1.489346650 -0.964946124 -0.256480864
 [76] -0.426201930 -1.150047496  0.539032863  1.921269168 -0.263669720
 [81] -0.972324893  0.823698117  2.182397342  1.076142916  0.754185302
 [86] -2.682912345  1.194537176  0.093069902  0.718652950  1.325876698
 [91]  1.154099937 -1.295985104 -0.460559852 -0.809635568 -2.333570053
 [96] -0.713267390 -0.347904628 -0.614441531 -0.511812976  0.155287025
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.581094090  1.736909326  0.563638730  0.797768045 -1.257376206
  [6] -0.008763108 -0.908454951  1.545397117 -1.307836421  1.768806557
 [11]  1.499040196  0.269155456 -1.079832193 -2.184541002  0.123956391
 [16] -0.131369048  0.492216826  0.818399860  1.916497949  0.027629151
 [21]  0.851023298 -0.761527835  0.201048977  2.617388165 -0.034466821
 [26]  0.179717631 -0.062488619 -0.478065020 -1.504431209  0.932497607
 [31] -0.690091442  0.089336696 -0.730768793 -1.086336853  1.526926268
 [36]  1.799044983 -0.174563944  0.036286859 -1.152891628  0.751565816
 [41] -0.454182917 -2.058257336  1.617618200 -1.893440713  0.129610234
 [46] -0.180407826 -0.071349269  0.646234212 -1.362335240  0.128396567
 [51] -1.100528656 -0.587892193  0.599566707  1.631304341  1.249896209
 [56]  1.430514481 -0.440920816  0.797874020  0.873551990 -0.587610868
 [61]  0.947229491 -1.576239410  0.335719094  1.305475709  0.425714120
 [66] -0.220909419  0.196525651 -0.260548231  0.765207618  0.808942549
 [71] -0.067245600  0.155893652  1.489346650 -0.964946124 -0.256480864
 [76] -0.426201930 -1.150047496  0.539032863  1.921269168 -0.263669720
 [81] -0.972324893  0.823698117  2.182397342  1.076142916  0.754185302
 [86] -2.682912345  1.194537176  0.093069902  0.718652950  1.325876698
 [91]  1.154099937 -1.295985104 -0.460559852 -0.809635568 -2.333570053
 [96] -0.713267390 -0.347904628 -0.614441531 -0.511812976  0.155287025
> rowMin(tmp2)
  [1] -0.581094090  1.736909326  0.563638730  0.797768045 -1.257376206
  [6] -0.008763108 -0.908454951  1.545397117 -1.307836421  1.768806557
 [11]  1.499040196  0.269155456 -1.079832193 -2.184541002  0.123956391
 [16] -0.131369048  0.492216826  0.818399860  1.916497949  0.027629151
 [21]  0.851023298 -0.761527835  0.201048977  2.617388165 -0.034466821
 [26]  0.179717631 -0.062488619 -0.478065020 -1.504431209  0.932497607
 [31] -0.690091442  0.089336696 -0.730768793 -1.086336853  1.526926268
 [36]  1.799044983 -0.174563944  0.036286859 -1.152891628  0.751565816
 [41] -0.454182917 -2.058257336  1.617618200 -1.893440713  0.129610234
 [46] -0.180407826 -0.071349269  0.646234212 -1.362335240  0.128396567
 [51] -1.100528656 -0.587892193  0.599566707  1.631304341  1.249896209
 [56]  1.430514481 -0.440920816  0.797874020  0.873551990 -0.587610868
 [61]  0.947229491 -1.576239410  0.335719094  1.305475709  0.425714120
 [66] -0.220909419  0.196525651 -0.260548231  0.765207618  0.808942549
 [71] -0.067245600  0.155893652  1.489346650 -0.964946124 -0.256480864
 [76] -0.426201930 -1.150047496  0.539032863  1.921269168 -0.263669720
 [81] -0.972324893  0.823698117  2.182397342  1.076142916  0.754185302
 [86] -2.682912345  1.194537176  0.093069902  0.718652950  1.325876698
 [91]  1.154099937 -1.295985104 -0.460559852 -0.809635568 -2.333570053
 [96] -0.713267390 -0.347904628 -0.614441531 -0.511812976  0.155287025
> 
> colMeans(tmp2)
[1] 0.09216595
> colSums(tmp2)
[1] 9.216595
> colVars(tmp2)
[1] 1.167519
> colSd(tmp2)
[1] 1.080518
> colMax(tmp2)
[1] 2.617388
> colMin(tmp2)
[1] -2.682912
> colMedians(tmp2)
[1] 0.0912033
> colRanges(tmp2)
          [,1]
[1,] -2.682912
[2,]  2.617388
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.7246207 -2.6735970 -3.9511100 -2.1581667  0.4395994 -2.3279036
 [7]  2.1327043  1.8046514 -4.6853340  1.0988692
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6052365
[2,] -0.4785906
[3,]  0.1066260
[4,]  0.5591105
[5,]  0.7630342
> 
> rowApply(tmp,sum)
 [1] -1.3430352 -6.6486796  1.2976878 -4.4587768  1.4037419 -0.1612978
 [7] -4.4442022  3.9256341  2.7530995 -3.3690796
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8   10    8    1    2    9    4    7    2     6
 [2,]    1    1    7    5    5   10    3    8   10     2
 [3,]    4    6    4    8    7    7    8    2    1     3
 [4,]    6    9    2    7    4    3    2    4    5     9
 [5,]    7    4    1   10    3    1    9    9    4     7
 [6,]    9    8    6    4    8    4    5    1    6     1
 [7,]    2    7   10    2   10    6    7    6    8     8
 [8,]    5    2    9    9    9    8   10    3    3     4
 [9,]    3    3    3    3    1    5    6    5    9     5
[10,]   10    5    5    6    6    2    1   10    7    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.202612729  1.533137479  3.743468575  4.184588708 -0.508346925
 [6]  1.224083227 -0.900427513 -4.088637046  2.820922283  0.009632494
[11] -2.420776259 -1.051888472 -0.065270893 -0.778801411  1.010725235
[16]  2.266574285  2.357086159  3.246183521  2.669042628  1.848802731
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.87071988
[2,] -0.03323857
[3,]  0.47038130
[4,]  0.53012607
[5,]  1.10606381
> 
> rowApply(tmp,sum)
[1] 6.6062272 4.5796569 0.8847801 2.9005222 3.3315251
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    8   16   16    5   13
[2,]    3   10    9   16   17
[3,]   18    6   13   19   10
[4,]   20   11   15   13   12
[5,]   12    1   20   17    9
> 
> 
> as.matrix(tmp)
            [,1]         [,2]        [,3]      [,4]        [,5]       [,6]
[1,] -0.03323857 -0.507677468  1.65576921 2.4851217  0.39576186  0.2545469
[2,]  1.10606381  0.126971781 -0.17434482 0.2739342 -3.63728421  2.4772064
[3,]  0.47038130 -0.003359701  0.42694161 0.4304889  1.50306346 -0.3305431
[4,] -0.87071988  1.188247579  1.74519683 0.6214647  1.24593171 -1.7962501
[5,]  0.53012607  0.728955287  0.08990575 0.3735792 -0.01581975  0.6191231
            [,7]        [,8]       [,9]       [,10]       [,11]      [,12]
[1,] -0.50642484 -2.54831137  1.2267376 -0.11773497  0.93132768 -0.2993504
[2,]  0.35007311 -0.05213998  1.5418208 -0.62014861  0.08667219 -0.1265750
[3,] -1.07680706 -0.59682038  0.1523771 -0.05479038 -1.68157966  0.4297035
[4,]  0.03475497 -0.72412395  0.3790216  1.12165221 -0.90416671  0.2477687
[5,]  0.29797632 -0.16724136 -0.4790348 -0.31934575 -0.85302976 -1.3034352
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -1.0831735  0.2911938  1.3802037  1.9888485  0.9041148 -0.3459481
[2,]  0.7732595  1.7674583 -0.4009520 -1.3323003  0.5376432  1.3706089
[3,]  0.1269786 -0.6697703 -0.2661879  0.4897391  1.0086657  0.3112586
[4,] -0.4887038 -1.3893363 -0.5331141  1.4046994 -0.7406627  0.8430490
[5,]  0.6063683 -0.7783469  0.8307755 -0.2844124  0.6473252  1.0672151
          [,19]       [,20]
[1,]  0.0967536  0.43770713
[2,]  1.0993235 -0.58763393
[3,]  0.5804046 -0.36536381
[4,] -0.8955585  2.41137155
[5,]  1.7881195 -0.04727821
> 
> 
> 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 :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2     col3      col4      col5      col6      col7
row1 -0.9715206 -1.514058 1.977765 0.7195547 -1.141487 -1.388944 0.8590328
            col8       col9    col10     col11      col12     col13     col14
row1 -0.07621482 -0.9996331 1.242544 0.3259438 -0.7944957 0.4539644 -1.028593
         col15      col16      col17     col18     col19    col20
row1 0.6994725 -0.2399663 -0.7774928 0.2681259 0.4837175 1.206935
> tmp[,"col10"]
           col10
row1  1.24254367
row2  0.09757527
row3 -1.18319692
row4  0.16447512
row5 -1.09674227
> tmp[c("row1","row5"),]
           col1       col2      col3      col4        col5       col6      col7
row1 -0.9715206 -1.5140577  1.977765 0.7195547 -1.14148700 -1.3889436 0.8590328
row5  0.1491772 -0.5709224 -1.915986 0.2395354  0.01195018 -0.2235577 0.9772704
            col8       col9     col10     col11      col12     col13      col14
row1 -0.07621482 -0.9996331  1.242544 0.3259438 -0.7944957 0.4539644 -1.0285934
row5 -1.21832130  1.6762409 -1.096742 0.8317442  1.8841502 0.8064723 -0.4380622
          col15      col16      col17      col18      col19    col20
row1  0.6994725 -0.2399663 -0.7774928  0.2681259  0.4837175 1.206935
row5 -0.3458975 -0.5537049 -0.8360182 -0.4477752 -0.6210836 1.032836
> tmp[,c("col6","col20")]
            col6       col20
row1 -1.38894361  1.20693497
row2 -0.43491634 -0.05419904
row3  0.37846852  1.43396786
row4 -0.02576803  1.34833781
row5 -0.22355766  1.03283553
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1 -1.3889436 1.206935
row5 -0.2235577 1.032836
> 
> 
> 
> 
> 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.08441 49.23696 51.92308 50.06741 51.67601 105.8506 51.14073 50.9087
         col9   col10    col11    col12    col13    col14    col15    col16
row1 50.70361 49.1663 49.74931 52.67608 51.83906 50.34887 50.47196 50.09701
        col17   col18    col19    col20
row1 49.96509 53.0701 49.54128 104.7624
> tmp[,"col10"]
        col10
row1 49.16630
row2 31.24383
row3 29.40722
row4 31.72273
row5 48.62618
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.08441 49.23696 51.92308 50.06741 51.67601 105.8506 51.14073 50.90870
row5 50.27255 50.89541 50.10837 49.07768 48.79891 105.9835 48.86350 51.23797
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.70361 49.16630 49.74931 52.67608 51.83906 50.34887 50.47196 50.09701
row5 51.03295 48.62618 49.03670 49.81684 49.39025 50.47650 49.84349 49.21432
        col17    col18    col19    col20
row1 49.96509 53.07010 49.54128 104.7624
row5 48.38117 48.89342 49.58489 104.9459
> tmp[,c("col6","col20")]
          col6     col20
row1 105.85062 104.76242
row2  75.16979  75.77060
row3  75.85536  74.90982
row4  76.36982  75.84267
row5 105.98352 104.94591
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.8506 104.7624
row5 105.9835 104.9459
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.8506 104.7624
row5 105.9835 104.9459
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  2.6087428
[2,]  2.0095475
[3,]  1.3455392
[4,] -0.3087211
[5,] -0.2392201
> tmp[,c("col17","col7")]
          col17        col7
[1,] -1.5122162  0.04472613
[2,]  0.7393850 -0.52607087
[3,] -1.8005657 -0.97439869
[4,]  1.0637697  0.45021973
[5,] -0.4451424  1.51130044
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  2.0877814  0.3030119
[2,] -1.4722230  1.0173884
[3,] -0.3784547  0.2230977
[4,]  1.7988910 -1.1136781
[5,] -1.3901148  0.7697173
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 2.087781
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  2.087781
[2,] -1.472223
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
row3 -2.110679 -1.350948 -0.7848737 -0.4367119 -0.6514033 -0.2972172 0.1875521
row1 -1.162929 -1.302859 -0.2072968  1.4152241 -2.5421730 -0.9537091 0.1820834
           [,8]      [,9]      [,10]     [,11]       [,12]       [,13]
row3 -0.1753349  1.259741 -0.5385107 0.5394737 -0.06715386  0.09759491
row1 -0.5669146 -0.164611 -0.6537155 0.9953414 -0.70778408 -0.42742040
         [,14]     [,15]      [,16]     [,17]      [,18]      [,19]      [,20]
row3 1.7676101 -2.129823  0.9150942 0.6533831  0.3726901 0.05480014  0.1221550
row1 0.2072263  1.290307 -0.6833244 0.3235595 -1.2625895 1.57632118 -0.3007326
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
row2 -0.3323998 1.083693 0.7432595 -1.615244 -0.1119924 0.1721664 0.2702911
           [,8]    [,9]     [,10]
row2 -0.6047675 1.12037 0.5635139
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]     [,2]       [,3]      [,4]     [,5]       [,6]     [,7]
row5 1.444648 1.269458 -0.7641299 -0.149165 0.110691 -0.8673138 1.978109
         [,8]       [,9]     [,10]    [,11]     [,12]     [,13]      [,14]
row5 1.140827 -0.6018398 0.1306967 1.671494 0.7495539 0.6519787 -0.3282126
          [,15]    [,16]     [,17]     [,18]      [,19]      [,20]
row5 -0.5883399 -0.95159 -1.804267 0.3842758 0.08944929 -0.2452242
> 
> 
> 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: 0x5dd04887fdf0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c1dd5708" 
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c68f22ec0"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c456c2470"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c58dddb0d"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c647e7bf" 
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c4830513d"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c44fab9ec"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c2a14cd06"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c3124b54e"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c151245c1"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c2d57f430"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c58091207"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c42cbe517"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c385846f3"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM36d29c57a21aba"
> 
> 
> ### 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: 0x5dd049f6f2b0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5dd049f6f2b0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5dd049f6f2b0>
> rowMedians(tmp)
  [1] -0.252959922  0.659713690 -0.414291131  0.146531047 -0.516495677
  [6]  0.410890080  0.215049295 -0.003652565  0.396466156 -0.099120050
 [11] -0.438858396 -0.450554765  0.276269141  0.141963566 -0.053619935
 [16] -0.002179471  0.320548669  0.109015691  0.492832377  0.183722271
 [21] -0.048940090  0.229044299  0.107431019 -0.185520619 -0.229561327
 [26]  0.444474733 -0.001692696 -0.079614517  0.275700080 -0.580158189
 [31]  0.087622081 -0.017746374 -0.550694291  0.467182196 -0.320326569
 [36] -0.243633242  0.262909046 -0.040187501 -0.093932254  0.375671392
 [41]  0.557554988  0.186122009  0.321435896 -0.026355458 -0.265414554
 [46] -0.400314031  0.227086969 -0.036627535  0.461382841  0.019635097
 [51] -0.076565903 -0.234886330  0.095794062 -0.484697872  0.354567982
 [56]  0.269762537 -0.356023395 -0.218938407  0.389070491  0.199890157
 [61]  0.553910130 -0.155825208  0.088406283 -0.244143026  0.052154258
 [66] -0.286090224  0.360125231  0.113703686 -0.590643468  0.073254592
 [71]  0.012649393  0.003068444 -0.027847656 -0.073833008 -0.121198649
 [76]  0.187962731  0.244784937 -0.296263294 -0.410599736 -0.095439106
 [81] -0.097280406 -0.723126514  0.271628280  0.525803442  0.284348321
 [86] -0.061796002  0.726499483 -0.040250713 -0.054899755 -0.065173446
 [91]  0.540494564 -0.203494460 -0.097087559  0.451183828 -0.476655019
 [96] -0.057846913 -0.061017717 -0.584962029 -0.336885183 -0.139474521
[101] -0.133646754  0.241236164  0.100272681 -0.178925681  0.172333791
[106] -0.688171350  0.528222472 -0.092756229  0.122785373  0.036630802
[111] -0.556988707  0.102269264 -0.043175572  0.035184333 -0.155398389
[116] -0.041282054  0.397255423 -0.401793226  0.534865063 -0.523854836
[121]  0.501550265 -0.337234212 -0.548017330  0.030481074  0.436274421
[126]  1.239346755 -0.221121202  0.328730743  0.083599948  0.337012888
[131]  0.004816672 -0.432845695 -0.068056482 -0.014577860  0.054354133
[136]  0.077395289 -0.093241849  0.151026684 -0.320481362  0.085780044
[141] -0.563697400 -0.136762949  0.382413270 -0.167075996 -0.138162365
[146] -0.028561962  0.397352749  0.065470367 -0.103928103 -0.114482917
[151]  0.127248151 -0.349330040  0.087689919 -0.298663767 -0.426719153
[156] -0.183215398  0.273065878 -0.123592902 -0.266378000 -0.579855113
[161]  0.158557126 -0.509660309 -0.420604485  0.085462639  0.066104842
[166]  0.198835569  0.095880964  0.226424951  0.345791646  0.586684160
[171] -0.229883468 -0.332988553  0.126339131  0.485087044  0.106881623
[176] -0.404445729  0.198800497 -0.163886961 -0.151128874  0.609798308
[181] -0.180700339  0.655205430 -0.346270378 -0.128419896 -0.041980085
[186]  0.390040379  0.726722233  0.146354479  0.330486170 -0.256237614
[191] -0.504942637  0.571446869 -0.322320854 -0.422489867  0.030074012
[196]  0.072107412 -0.317096824 -0.572905437 -0.039035565  0.467086141
[201]  0.008285080  0.205784920  0.476830004  0.357287745  0.440711714
[206] -0.053404964  0.011929897 -0.787418922 -0.730777527 -0.473899093
[211]  0.059708520 -0.222601235 -0.274667361 -0.141032364 -0.131615687
[216] -0.561245536  0.066447485 -0.322182901  0.032752261  0.011168339
[221] -0.316313936 -0.250035576 -0.075751237 -0.681409971  0.140501390
[226]  0.126969329 -0.002206597  0.122957603 -0.017628667 -0.302648143
> 
> proc.time()
   user  system elapsed 
  1.383   1.452   2.825 

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: 0x60b7afe25c10>
> .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: 0x60b7afe25c10>
> .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: 0x60b7afe25c10>
> .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: 0x60b7afe25c10>
> 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: 0x60b7b0ae82d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b7b0ae82d0>
> .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: 0x60b7b0ae82d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b7b0ae82d0>
> .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: 0x60b7b0ae82d0>
> 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: 0x60b7b11bdd70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b7b11bdd70>
> .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: 0x60b7b11bdd70>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60b7b11bdd70>
> .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: 0x60b7b11bdd70>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60b7b11bdd70>
> .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: 0x60b7b11bdd70>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60b7b11bdd70>
> .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: 0x60b7b11bdd70>
> 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: 0x60b7b0d31370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60b7b0d31370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b7b0d31370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b7b0d31370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36d32a2ea45be0" "BufferedMatrixFile36d32a655ab9e7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36d32a2ea45be0" "BufferedMatrixFile36d32a655ab9e7"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b7b0c7cff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b7b0c7cff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60b7b0c7cff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60b7b0c7cff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60b7b0c7cff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60b7b0c7cff0>
> .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: 0x60b7b0e5f3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b7b0e5f3d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60b7b0e5f3d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60b7b0e5f3d0>
> 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: 0x60b7b2610fb0>
> .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: 0x60b7b2610fb0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.284   0.068   0.331 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

Example timings