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

This page was generated on 2026-02-12 11:58 -0500 (Thu, 12 Feb 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4889
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-02-09 13:45 -0500 (Mon, 09 Feb 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (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 nebbiolo2

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.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-02-09 22:07:03 -0500 (Mon, 09 Feb 2026)
EndedAt: 2026-02-09 22:07:27 -0500 (Mon, 09 Feb 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* 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.74.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 ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.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.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-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 version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.230   0.048   0.267 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-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 478284 25.6    1046725   56   639600 34.2
Vcells 884773  6.8    8388608   64  2081613 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Feb  9 22:07:18 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Feb  9 22:07:18 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: 0x58434008d370>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Feb  9 22:07:18 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Feb  9 22:07:19 2026"
> 
> ColMode(tmp2)
<pointer: 0x58434008d370>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]       [,4]
[1,] 99.4384605  0.7120208 -0.4235084 -3.5061695
[2,] -0.4989300  0.1038517  0.7159239 -0.9533981
[3,]  0.1634588 -1.0819235 -0.1106358 -1.5311680
[4,] -1.1738366 -0.8329678  0.2049847  0.1970734
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.4384605 0.7120208 0.4235084 3.5061695
[2,]  0.4989300 0.1038517 0.7159239 0.9533981
[3,]  0.1634588 1.0819235 0.1106358 1.5311680
[4,]  1.1738366 0.8329678 0.2049847 0.1970734
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9718835 0.8438133 0.6507752 1.8724768
[2,] 0.7063497 0.3222603 0.8461229 0.9764211
[3,] 0.4043004 1.0401555 0.3326196 1.2374037
[4,] 1.0834374 0.9126707 0.4527524 0.4439295
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.15730 34.15015 31.93126 47.23094
[2,]  32.56243 28.32645 34.17715 35.71761
[3,]  29.20646 36.48348 28.43683 38.90521
[4,]  37.00821 34.95967 29.73251 29.63637
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5843410899b0>
> exp(tmp5)
<pointer: 0x5843410899b0>
> log(tmp5,2)
<pointer: 0x5843410899b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.554
> Min(tmp5)
[1] 52.88341
> mean(tmp5)
[1] 73.11951
> Sum(tmp5)
[1] 14623.9
> Var(tmp5)
[1] 871.0126
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.21562 66.21794 71.43398 72.60867 72.90307 68.76114 70.79593 75.74221
 [9] 69.38402 71.13251
> rowSums(tmp5)
 [1] 1844.312 1324.359 1428.680 1452.173 1458.061 1375.223 1415.919 1514.844
 [9] 1387.680 1422.650
> rowVars(tmp5)
 [1] 7839.94600   85.63015  115.80184   83.23456  106.07435   53.80968
 [7]  102.17905  105.26496   65.43062   76.26943
> rowSd(tmp5)
 [1] 88.543470  9.253656 10.761126  9.123298 10.299240  7.335508 10.108365
 [8] 10.259871  8.088919  8.733237
> rowMax(tmp5)
 [1] 466.55404  88.23968  93.36382  90.61234  92.67311  80.99836  95.36788
 [8] 100.09100  88.83596  85.64991
> rowMin(tmp5)
 [1] 60.57055 54.51876 54.92899 58.73409 55.60542 55.52615 57.72495 60.45803
 [9] 55.47404 52.88341
> 
> colMeans(tmp5)
 [1] 108.37504  68.70378  70.44293  70.41547  68.95939  72.82981  74.89901
 [8]  75.24254  72.08798  73.67998  65.70852  68.17631  67.46976  70.69195
[15]  75.04057  72.46039  68.75761  72.67025  71.25984  74.51909
> colSums(tmp5)
 [1] 1083.7504  687.0378  704.4293  704.1547  689.5939  728.2981  748.9901
 [8]  752.4254  720.8798  736.7998  657.0852  681.7631  674.6976  706.9195
[15]  750.4057  724.6039  687.5761  726.7025  712.5984  745.1909
> colVars(tmp5)
 [1] 15914.90947    65.59549    68.39414   154.56980    75.30117    59.00006
 [7]   149.53380   103.35324    73.29813   141.16994    67.85069   111.00095
[13]    74.72290    85.06460    37.47888    86.95970    84.08785    33.41538
[19]    82.91739   180.08842
> colSd(tmp5)
 [1] 126.154308   8.099104   8.270075  12.432610   8.677625   7.681150
 [7]  12.228401  10.166280   8.561433  11.881496   8.237153  10.535699
[13]   8.644241   9.223047   6.122000   9.325219   9.169943   5.780604
[19]   9.105899  13.419703
> colMax(tmp5)
 [1] 466.55404  84.82195  85.64991  98.30501  82.48884  85.90660  90.61234
 [8]  95.36788  86.05449  92.67311  81.11356  86.32731  86.86380  88.23968
[15]  84.41897  87.11508  88.83596  81.49968  93.36382 100.09100
> colMin(tmp5)
 [1] 55.47404 58.95780 59.18754 52.88341 57.78301 63.27835 58.28222 55.56668
 [9] 56.63364 54.51876 54.92899 55.60542 55.52615 56.71332 64.54693 59.73173
[17] 58.73409 63.21470 63.02185 55.80735
> 
> 
> ### 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] 92.21562       NA 71.43398 72.60867 72.90307 68.76114 70.79593 75.74221
 [9] 69.38402 71.13251
> rowSums(tmp5)
 [1] 1844.312       NA 1428.680 1452.173 1458.061 1375.223 1415.919 1514.844
 [9] 1387.680 1422.650
> rowVars(tmp5)
 [1] 7839.94600   82.38323  115.80184   83.23456  106.07435   53.80968
 [7]  102.17905  105.26496   65.43062   76.26943
> rowSd(tmp5)
 [1] 88.543470  9.076521 10.761126  9.123298 10.299240  7.335508 10.108365
 [8] 10.259871  8.088919  8.733237
> rowMax(tmp5)
 [1] 466.55404        NA  93.36382  90.61234  92.67311  80.99836  95.36788
 [8] 100.09100  88.83596  85.64991
> rowMin(tmp5)
 [1] 60.57055       NA 54.92899 58.73409 55.60542 55.52615 57.72495 60.45803
 [9] 55.47404 52.88341
> 
> colMeans(tmp5)
 [1] 108.37504  68.70378  70.44293  70.41547  68.95939  72.82981  74.89901
 [8]  75.24254  72.08798        NA  65.70852  68.17631  67.46976  70.69195
[15]  75.04057  72.46039  68.75761  72.67025  71.25984  74.51909
> colSums(tmp5)
 [1] 1083.7504  687.0378  704.4293  704.1547  689.5939  728.2981  748.9901
 [8]  752.4254  720.8798        NA  657.0852  681.7631  674.6976  706.9195
[15]  750.4057  724.6039  687.5761  726.7025  712.5984  745.1909
> colVars(tmp5)
 [1] 15914.90947    65.59549    68.39414   154.56980    75.30117    59.00006
 [7]   149.53380   103.35324    73.29813          NA    67.85069   111.00095
[13]    74.72290    85.06460    37.47888    86.95970    84.08785    33.41538
[19]    82.91739   180.08842
> colSd(tmp5)
 [1] 126.154308   8.099104   8.270075  12.432610   8.677625   7.681150
 [7]  12.228401  10.166280   8.561433         NA   8.237153  10.535699
[13]   8.644241   9.223047   6.122000   9.325219   9.169943   5.780604
[19]   9.105899  13.419703
> colMax(tmp5)
 [1] 466.55404  84.82195  85.64991  98.30501  82.48884  85.90660  90.61234
 [8]  95.36788  86.05449        NA  81.11356  86.32731  86.86380  88.23968
[15]  84.41897  87.11508  88.83596  81.49968  93.36382 100.09100
> colMin(tmp5)
 [1] 55.47404 58.95780 59.18754 52.88341 57.78301 63.27835 58.28222 55.56668
 [9] 56.63364       NA 54.92899 55.60542 55.52615 56.71332 64.54693 59.73173
[17] 58.73409 63.21470 63.02185 55.80735
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.554
> Min(tmp5,na.rm=TRUE)
[1] 52.88341
> mean(tmp5,na.rm=TRUE)
[1] 73.21298
> Sum(tmp5,na.rm=TRUE)
[1] 14569.38
> Var(tmp5,na.rm=TRUE)
[1] 873.6555
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.21562 66.83369 71.43398 72.60867 72.90307 68.76114 70.79593 75.74221
 [9] 69.38402 71.13251
> rowSums(tmp5,na.rm=TRUE)
 [1] 1844.312 1269.840 1428.680 1452.173 1458.061 1375.223 1415.919 1514.844
 [9] 1387.680 1422.650
> rowVars(tmp5,na.rm=TRUE)
 [1] 7839.94600   82.38323  115.80184   83.23456  106.07435   53.80968
 [7]  102.17905  105.26496   65.43062   76.26943
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.543470  9.076521 10.761126  9.123298 10.299240  7.335508 10.108365
 [8] 10.259871  8.088919  8.733237
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.55404  88.23968  93.36382  90.61234  92.67311  80.99836  95.36788
 [8] 100.09100  88.83596  85.64991
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.57055 55.80735 54.92899 58.73409 55.60542 55.52615 57.72495 60.45803
 [9] 55.47404 52.88341
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.37504  68.70378  70.44293  70.41547  68.95939  72.82981  74.89901
 [8]  75.24254  72.08798  75.80901  65.70852  68.17631  67.46976  70.69195
[15]  75.04057  72.46039  68.75761  72.67025  71.25984  74.51909
> colSums(tmp5,na.rm=TRUE)
 [1] 1083.7504  687.0378  704.4293  704.1547  689.5939  728.2981  748.9901
 [8]  752.4254  720.8798  682.2811  657.0852  681.7631  674.6976  706.9195
[15]  750.4057  724.6039  687.5761  726.7025  712.5984  745.1909
> colVars(tmp5,na.rm=TRUE)
 [1] 15914.90947    65.59549    68.39414   154.56980    75.30117    59.00006
 [7]   149.53380   103.35324    73.29813   107.82275    67.85069   111.00095
[13]    74.72290    85.06460    37.47888    86.95970    84.08785    33.41538
[19]    82.91739   180.08842
> colSd(tmp5,na.rm=TRUE)
 [1] 126.154308   8.099104   8.270075  12.432610   8.677625   7.681150
 [7]  12.228401  10.166280   8.561433  10.383773   8.237153  10.535699
[13]   8.644241   9.223047   6.122000   9.325219   9.169943   5.780604
[19]   9.105899  13.419703
> colMax(tmp5,na.rm=TRUE)
 [1] 466.55404  84.82195  85.64991  98.30501  82.48884  85.90660  90.61234
 [8]  95.36788  86.05449  92.67311  81.11356  86.32731  86.86380  88.23968
[15]  84.41897  87.11508  88.83596  81.49968  93.36382 100.09100
> colMin(tmp5,na.rm=TRUE)
 [1] 55.47404 58.95780 59.18754 52.88341 57.78301 63.27835 58.28222 55.56668
 [9] 56.63364 62.81564 54.92899 55.60542 55.52615 56.71332 64.54693 59.73173
[17] 58.73409 63.21470 63.02185 55.80735
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.21562      NaN 71.43398 72.60867 72.90307 68.76114 70.79593 75.74221
 [9] 69.38402 71.13251
> rowSums(tmp5,na.rm=TRUE)
 [1] 1844.312    0.000 1428.680 1452.173 1458.061 1375.223 1415.919 1514.844
 [9] 1387.680 1422.650
> rowVars(tmp5,na.rm=TRUE)
 [1] 7839.94600         NA  115.80184   83.23456  106.07435   53.80968
 [7]  102.17905  105.26496   65.43062   76.26943
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.543470        NA 10.761126  9.123298 10.299240  7.335508 10.108365
 [8] 10.259871  8.088919  8.733237
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.55404        NA  93.36382  90.61234  92.67311  80.99836  95.36788
 [8] 100.09100  88.83596  85.64991
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.57055       NA 54.92899 58.73409 55.60542 55.52615 57.72495 60.45803
 [9] 55.47404 52.88341
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.88621  69.78667  70.36600  69.97924  70.20121  72.66645  76.74532
 [8]  75.15070  73.80513       NaN  63.99685  68.81805  68.44170  68.74220
[15]  75.30805  73.22283  69.51248  73.72087  71.96987  76.59817
> colSums(tmp5,na.rm=TRUE)
 [1] 1015.9759  628.0800  633.2940  629.8132  631.8109  653.9981  690.7079
 [8]  676.3563  664.2462    0.0000  575.9717  619.3625  615.9753  618.6798
[15]  677.7724  659.0055  625.6123  663.4878  647.7288  689.3835
> colVars(tmp5,na.rm=TRUE)
 [1] 17675.32740    60.60269    76.87683   171.75020    67.36500    66.07487
 [7]   129.87585   116.17751    49.28862          NA    43.37160   120.24299
[13]    73.43566    52.93061    41.35887    91.28982    88.18816    25.17460
[19]    87.61039   153.97044
> colSd(tmp5,na.rm=TRUE)
 [1] 132.948589   7.784773   8.767943  13.105350   8.207619   8.128645
 [7]  11.396309  10.778567   7.020586         NA   6.585711  10.965536
[13]   8.569461   7.275343   6.431087   9.554571   9.390855   5.017429
[19]   9.360042  12.408483
> colMax(tmp5,na.rm=TRUE)
 [1] 466.55404  84.82195  85.64991  98.30501  82.48884  85.90660  90.61234
 [8]  95.36788  86.05449      -Inf  75.07126  86.32731  86.86380  77.63746
[15]  84.41897  87.11508  88.83596  81.49968  93.36382 100.09100
> colMin(tmp5,na.rm=TRUE)
 [1] 55.47404 60.61156 59.18754 52.88341 60.70127 63.27835 60.38378 55.56668
 [9] 65.07828      Inf 54.92899 55.60542 55.52615 56.71332 64.54693 59.73173
[17] 58.73409 67.68637 63.02185 63.14455
> 
> 
> 
> 
> 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] 270.8242 140.6626 396.0049 190.9865 275.6320 247.1112 151.2192 336.8009
 [9] 347.9787 361.1729
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 270.8242 140.6626 396.0049 190.9865 275.6320 247.1112 151.2192 336.8009
 [9] 347.9787 361.1729
> 
> 
> 
> 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 -1.705303e-13 -5.684342e-14 -1.989520e-13 -1.136868e-13
 [6]  5.684342e-14  0.000000e+00  5.684342e-14 -8.526513e-14  0.000000e+00
[11]  0.000000e+00  1.705303e-13 -9.947598e-14  4.263256e-14 -1.278977e-13
[16] -1.136868e-13 -1.136868e-13  4.263256e-14 -5.684342e-14  7.105427e-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)
+ }
2   3 
4   3 
1   2 
7   13 
3   5 
8   2 
7   14 
7   16 
4   19 
4   17 
9   5 
8   19 
5   14 
5   3 
4   18 
3   10 
6   10 
9   15 
6   17 
10   14 
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.630338
> Min(tmp)
[1] -2.168635
> mean(tmp)
[1] 0.09362162
> Sum(tmp)
[1] 9.362162
> Var(tmp)
[1] 1.060036
> 
> rowMeans(tmp)
[1] 0.09362162
> rowSums(tmp)
[1] 9.362162
> rowVars(tmp)
[1] 1.060036
> rowSd(tmp)
[1] 1.02958
> rowMax(tmp)
[1] 2.630338
> rowMin(tmp)
[1] -2.168635
> 
> colMeans(tmp)
  [1]  1.77826164 -0.20901594  0.03426128 -0.31253462  0.77799407  0.36157945
  [7]  0.73464052 -0.13936457 -0.51500973 -0.72199862  2.15560868  0.30621796
 [13] -0.67230130  1.43709946 -1.36012901  0.04658689 -0.01034769 -1.19815847
 [19]  0.77652916  0.29534697 -0.46700533 -2.03138639 -1.18229877 -1.11183296
 [25] -0.65948964  0.05478557  0.61827290  2.06499232  0.90871857 -0.35177090
 [31] -1.28547065 -0.42776708  1.33754291 -1.01002976 -0.24055733  0.56108702
 [37] -0.70509906  0.32741515  1.39263538  0.59361315  1.64067639 -1.81768838
 [43]  0.51863468 -0.23512471  1.80012032  0.53243799  0.03637735 -0.65235246
 [49] -0.94521449 -0.02567047 -0.62669738  0.65463787  2.43251341 -0.39500587
 [55]  0.53353382 -1.81845241 -0.49826655 -0.83361541  0.91962162 -0.29777201
 [61] -1.30923721  0.46318156 -0.72947426  2.63033760 -0.12095588 -0.60718876
 [67]  1.53071372  0.85753994  2.14267890  1.80797926 -0.23784394 -0.08610658
 [73]  1.00470604 -0.89912976 -1.11954175  1.20178063  0.64921975  0.64158749
 [79] -0.47538227 -0.09820754 -2.16863544  0.29795299  1.62377166 -2.01672755
 [85] -0.39516789  0.65682454  1.03921739  0.14743889  0.08607478  0.67351254
 [91]  0.82713575 -1.10403178  0.39631815 -0.67420178  0.32963465  0.86905475
 [97]  0.22706181 -1.04918372 -0.46200984 -0.06284946
> colSums(tmp)
  [1]  1.77826164 -0.20901594  0.03426128 -0.31253462  0.77799407  0.36157945
  [7]  0.73464052 -0.13936457 -0.51500973 -0.72199862  2.15560868  0.30621796
 [13] -0.67230130  1.43709946 -1.36012901  0.04658689 -0.01034769 -1.19815847
 [19]  0.77652916  0.29534697 -0.46700533 -2.03138639 -1.18229877 -1.11183296
 [25] -0.65948964  0.05478557  0.61827290  2.06499232  0.90871857 -0.35177090
 [31] -1.28547065 -0.42776708  1.33754291 -1.01002976 -0.24055733  0.56108702
 [37] -0.70509906  0.32741515  1.39263538  0.59361315  1.64067639 -1.81768838
 [43]  0.51863468 -0.23512471  1.80012032  0.53243799  0.03637735 -0.65235246
 [49] -0.94521449 -0.02567047 -0.62669738  0.65463787  2.43251341 -0.39500587
 [55]  0.53353382 -1.81845241 -0.49826655 -0.83361541  0.91962162 -0.29777201
 [61] -1.30923721  0.46318156 -0.72947426  2.63033760 -0.12095588 -0.60718876
 [67]  1.53071372  0.85753994  2.14267890  1.80797926 -0.23784394 -0.08610658
 [73]  1.00470604 -0.89912976 -1.11954175  1.20178063  0.64921975  0.64158749
 [79] -0.47538227 -0.09820754 -2.16863544  0.29795299  1.62377166 -2.01672755
 [85] -0.39516789  0.65682454  1.03921739  0.14743889  0.08607478  0.67351254
 [91]  0.82713575 -1.10403178  0.39631815 -0.67420178  0.32963465  0.86905475
 [97]  0.22706181 -1.04918372 -0.46200984 -0.06284946
> 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]  1.77826164 -0.20901594  0.03426128 -0.31253462  0.77799407  0.36157945
  [7]  0.73464052 -0.13936457 -0.51500973 -0.72199862  2.15560868  0.30621796
 [13] -0.67230130  1.43709946 -1.36012901  0.04658689 -0.01034769 -1.19815847
 [19]  0.77652916  0.29534697 -0.46700533 -2.03138639 -1.18229877 -1.11183296
 [25] -0.65948964  0.05478557  0.61827290  2.06499232  0.90871857 -0.35177090
 [31] -1.28547065 -0.42776708  1.33754291 -1.01002976 -0.24055733  0.56108702
 [37] -0.70509906  0.32741515  1.39263538  0.59361315  1.64067639 -1.81768838
 [43]  0.51863468 -0.23512471  1.80012032  0.53243799  0.03637735 -0.65235246
 [49] -0.94521449 -0.02567047 -0.62669738  0.65463787  2.43251341 -0.39500587
 [55]  0.53353382 -1.81845241 -0.49826655 -0.83361541  0.91962162 -0.29777201
 [61] -1.30923721  0.46318156 -0.72947426  2.63033760 -0.12095588 -0.60718876
 [67]  1.53071372  0.85753994  2.14267890  1.80797926 -0.23784394 -0.08610658
 [73]  1.00470604 -0.89912976 -1.11954175  1.20178063  0.64921975  0.64158749
 [79] -0.47538227 -0.09820754 -2.16863544  0.29795299  1.62377166 -2.01672755
 [85] -0.39516789  0.65682454  1.03921739  0.14743889  0.08607478  0.67351254
 [91]  0.82713575 -1.10403178  0.39631815 -0.67420178  0.32963465  0.86905475
 [97]  0.22706181 -1.04918372 -0.46200984 -0.06284946
> colMin(tmp)
  [1]  1.77826164 -0.20901594  0.03426128 -0.31253462  0.77799407  0.36157945
  [7]  0.73464052 -0.13936457 -0.51500973 -0.72199862  2.15560868  0.30621796
 [13] -0.67230130  1.43709946 -1.36012901  0.04658689 -0.01034769 -1.19815847
 [19]  0.77652916  0.29534697 -0.46700533 -2.03138639 -1.18229877 -1.11183296
 [25] -0.65948964  0.05478557  0.61827290  2.06499232  0.90871857 -0.35177090
 [31] -1.28547065 -0.42776708  1.33754291 -1.01002976 -0.24055733  0.56108702
 [37] -0.70509906  0.32741515  1.39263538  0.59361315  1.64067639 -1.81768838
 [43]  0.51863468 -0.23512471  1.80012032  0.53243799  0.03637735 -0.65235246
 [49] -0.94521449 -0.02567047 -0.62669738  0.65463787  2.43251341 -0.39500587
 [55]  0.53353382 -1.81845241 -0.49826655 -0.83361541  0.91962162 -0.29777201
 [61] -1.30923721  0.46318156 -0.72947426  2.63033760 -0.12095588 -0.60718876
 [67]  1.53071372  0.85753994  2.14267890  1.80797926 -0.23784394 -0.08610658
 [73]  1.00470604 -0.89912976 -1.11954175  1.20178063  0.64921975  0.64158749
 [79] -0.47538227 -0.09820754 -2.16863544  0.29795299  1.62377166 -2.01672755
 [85] -0.39516789  0.65682454  1.03921739  0.14743889  0.08607478  0.67351254
 [91]  0.82713575 -1.10403178  0.39631815 -0.67420178  0.32963465  0.86905475
 [97]  0.22706181 -1.04918372 -0.46200984 -0.06284946
> colMedians(tmp)
  [1]  1.77826164 -0.20901594  0.03426128 -0.31253462  0.77799407  0.36157945
  [7]  0.73464052 -0.13936457 -0.51500973 -0.72199862  2.15560868  0.30621796
 [13] -0.67230130  1.43709946 -1.36012901  0.04658689 -0.01034769 -1.19815847
 [19]  0.77652916  0.29534697 -0.46700533 -2.03138639 -1.18229877 -1.11183296
 [25] -0.65948964  0.05478557  0.61827290  2.06499232  0.90871857 -0.35177090
 [31] -1.28547065 -0.42776708  1.33754291 -1.01002976 -0.24055733  0.56108702
 [37] -0.70509906  0.32741515  1.39263538  0.59361315  1.64067639 -1.81768838
 [43]  0.51863468 -0.23512471  1.80012032  0.53243799  0.03637735 -0.65235246
 [49] -0.94521449 -0.02567047 -0.62669738  0.65463787  2.43251341 -0.39500587
 [55]  0.53353382 -1.81845241 -0.49826655 -0.83361541  0.91962162 -0.29777201
 [61] -1.30923721  0.46318156 -0.72947426  2.63033760 -0.12095588 -0.60718876
 [67]  1.53071372  0.85753994  2.14267890  1.80797926 -0.23784394 -0.08610658
 [73]  1.00470604 -0.89912976 -1.11954175  1.20178063  0.64921975  0.64158749
 [79] -0.47538227 -0.09820754 -2.16863544  0.29795299  1.62377166 -2.01672755
 [85] -0.39516789  0.65682454  1.03921739  0.14743889  0.08607478  0.67351254
 [91]  0.82713575 -1.10403178  0.39631815 -0.67420178  0.32963465  0.86905475
 [97]  0.22706181 -1.04918372 -0.46200984 -0.06284946
> colRanges(tmp)
         [,1]       [,2]       [,3]       [,4]      [,5]      [,6]      [,7]
[1,] 1.778262 -0.2090159 0.03426128 -0.3125346 0.7779941 0.3615794 0.7346405
[2,] 1.778262 -0.2090159 0.03426128 -0.3125346 0.7779941 0.3615794 0.7346405
           [,8]       [,9]      [,10]    [,11]    [,12]      [,13]    [,14]
[1,] -0.1393646 -0.5150097 -0.7219986 2.155609 0.306218 -0.6723013 1.437099
[2,] -0.1393646 -0.5150097 -0.7219986 2.155609 0.306218 -0.6723013 1.437099
         [,15]      [,16]       [,17]     [,18]     [,19]    [,20]      [,21]
[1,] -1.360129 0.04658689 -0.01034769 -1.198158 0.7765292 0.295347 -0.4670053
[2,] -1.360129 0.04658689 -0.01034769 -1.198158 0.7765292 0.295347 -0.4670053
         [,22]     [,23]     [,24]      [,25]      [,26]     [,27]    [,28]
[1,] -2.031386 -1.182299 -1.111833 -0.6594896 0.05478557 0.6182729 2.064992
[2,] -2.031386 -1.182299 -1.111833 -0.6594896 0.05478557 0.6182729 2.064992
         [,29]      [,30]     [,31]      [,32]    [,33]    [,34]      [,35]
[1,] 0.9087186 -0.3517709 -1.285471 -0.4277671 1.337543 -1.01003 -0.2405573
[2,] 0.9087186 -0.3517709 -1.285471 -0.4277671 1.337543 -1.01003 -0.2405573
        [,36]      [,37]     [,38]    [,39]     [,40]    [,41]     [,42]
[1,] 0.561087 -0.7050991 0.3274151 1.392635 0.5936132 1.640676 -1.817688
[2,] 0.561087 -0.7050991 0.3274151 1.392635 0.5936132 1.640676 -1.817688
         [,43]      [,44]   [,45]    [,46]      [,47]      [,48]      [,49]
[1,] 0.5186347 -0.2351247 1.80012 0.532438 0.03637735 -0.6523525 -0.9452145
[2,] 0.5186347 -0.2351247 1.80012 0.532438 0.03637735 -0.6523525 -0.9452145
           [,50]      [,51]     [,52]    [,53]      [,54]     [,55]     [,56]
[1,] -0.02567047 -0.6266974 0.6546379 2.432513 -0.3950059 0.5335338 -1.818452
[2,] -0.02567047 -0.6266974 0.6546379 2.432513 -0.3950059 0.5335338 -1.818452
          [,57]      [,58]     [,59]     [,60]     [,61]     [,62]      [,63]
[1,] -0.4982665 -0.8336154 0.9196216 -0.297772 -1.309237 0.4631816 -0.7294743
[2,] -0.4982665 -0.8336154 0.9196216 -0.297772 -1.309237 0.4631816 -0.7294743
        [,64]      [,65]      [,66]    [,67]     [,68]    [,69]    [,70]
[1,] 2.630338 -0.1209559 -0.6071888 1.530714 0.8575399 2.142679 1.807979
[2,] 2.630338 -0.1209559 -0.6071888 1.530714 0.8575399 2.142679 1.807979
          [,71]       [,72]    [,73]      [,74]     [,75]    [,76]     [,77]
[1,] -0.2378439 -0.08610658 1.004706 -0.8991298 -1.119542 1.201781 0.6492197
[2,] -0.2378439 -0.08610658 1.004706 -0.8991298 -1.119542 1.201781 0.6492197
         [,78]      [,79]       [,80]     [,81]    [,82]    [,83]     [,84]
[1,] 0.6415875 -0.4753823 -0.09820754 -2.168635 0.297953 1.623772 -2.016728
[2,] 0.6415875 -0.4753823 -0.09820754 -2.168635 0.297953 1.623772 -2.016728
          [,85]     [,86]    [,87]     [,88]      [,89]     [,90]     [,91]
[1,] -0.3951679 0.6568245 1.039217 0.1474389 0.08607478 0.6735125 0.8271357
[2,] -0.3951679 0.6568245 1.039217 0.1474389 0.08607478 0.6735125 0.8271357
         [,92]     [,93]      [,94]     [,95]     [,96]     [,97]     [,98]
[1,] -1.104032 0.3963181 -0.6742018 0.3296346 0.8690548 0.2270618 -1.049184
[2,] -1.104032 0.3963181 -0.6742018 0.3296346 0.8690548 0.2270618 -1.049184
          [,99]      [,100]
[1,] -0.4620098 -0.06284946
[2,] -0.4620098 -0.06284946
> 
> 
> Max(tmp2)
[1] 2.937364
> Min(tmp2)
[1] -2.298268
> mean(tmp2)
[1] -0.003461012
> Sum(tmp2)
[1] -0.3461012
> Var(tmp2)
[1] 1.12252
> 
> rowMeans(tmp2)
  [1]  0.12149470 -0.59667453  0.63554977 -0.18726198 -0.16196812 -1.60567699
  [7] -0.91818787 -0.12185247 -0.66077357 -2.19093360  1.12666737 -1.26697221
 [13] -0.35128406  1.69408854  0.70668723  0.39595440  1.29298460 -1.05269593
 [19]  0.93868777 -0.70868351  0.34709458 -1.08390295  0.30783437  0.56725657
 [25] -0.16219037  0.30598716  0.19544007  2.45513763 -1.24627808  1.23815232
 [31]  0.73717140  1.44070560  0.50940591  0.04200699 -0.37774337 -0.06107949
 [37]  0.76682085 -0.06222677 -0.45994984  0.90223815 -1.28469393  2.73608413
 [43] -0.87026187  0.24757069 -0.77932057  0.61394658 -1.15920164  1.40246458
 [49] -0.41137086 -0.65373982 -1.44877995 -1.14027581 -0.77742999  1.28359798
 [55]  0.86729408  0.04902258 -0.30750433  0.38587211  0.81397122  0.24687648
 [61] -1.52866073  0.31003378 -0.73608841 -1.59361064 -1.22997401  0.55378530
 [67] -1.92215888 -0.09845352 -1.22264329 -0.75570680  0.68351883  1.32270721
 [73]  1.39224055  0.26279921 -0.40742472  1.17872419  0.52421812 -1.16968452
 [79] -0.02808930 -0.45357662  0.77989689 -0.90159069 -0.88726498 -0.57055781
 [85]  2.05957874 -2.29826771 -0.37118735 -0.27930916 -0.60721932 -1.42983665
 [91] -0.78811224  1.99108180  0.28849245  0.24417419  2.93736390 -0.26069759
 [97]  0.12745035  1.72482154 -0.98389631  0.53187107
> rowSums(tmp2)
  [1]  0.12149470 -0.59667453  0.63554977 -0.18726198 -0.16196812 -1.60567699
  [7] -0.91818787 -0.12185247 -0.66077357 -2.19093360  1.12666737 -1.26697221
 [13] -0.35128406  1.69408854  0.70668723  0.39595440  1.29298460 -1.05269593
 [19]  0.93868777 -0.70868351  0.34709458 -1.08390295  0.30783437  0.56725657
 [25] -0.16219037  0.30598716  0.19544007  2.45513763 -1.24627808  1.23815232
 [31]  0.73717140  1.44070560  0.50940591  0.04200699 -0.37774337 -0.06107949
 [37]  0.76682085 -0.06222677 -0.45994984  0.90223815 -1.28469393  2.73608413
 [43] -0.87026187  0.24757069 -0.77932057  0.61394658 -1.15920164  1.40246458
 [49] -0.41137086 -0.65373982 -1.44877995 -1.14027581 -0.77742999  1.28359798
 [55]  0.86729408  0.04902258 -0.30750433  0.38587211  0.81397122  0.24687648
 [61] -1.52866073  0.31003378 -0.73608841 -1.59361064 -1.22997401  0.55378530
 [67] -1.92215888 -0.09845352 -1.22264329 -0.75570680  0.68351883  1.32270721
 [73]  1.39224055  0.26279921 -0.40742472  1.17872419  0.52421812 -1.16968452
 [79] -0.02808930 -0.45357662  0.77989689 -0.90159069 -0.88726498 -0.57055781
 [85]  2.05957874 -2.29826771 -0.37118735 -0.27930916 -0.60721932 -1.42983665
 [91] -0.78811224  1.99108180  0.28849245  0.24417419  2.93736390 -0.26069759
 [97]  0.12745035  1.72482154 -0.98389631  0.53187107
> 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.12149470 -0.59667453  0.63554977 -0.18726198 -0.16196812 -1.60567699
  [7] -0.91818787 -0.12185247 -0.66077357 -2.19093360  1.12666737 -1.26697221
 [13] -0.35128406  1.69408854  0.70668723  0.39595440  1.29298460 -1.05269593
 [19]  0.93868777 -0.70868351  0.34709458 -1.08390295  0.30783437  0.56725657
 [25] -0.16219037  0.30598716  0.19544007  2.45513763 -1.24627808  1.23815232
 [31]  0.73717140  1.44070560  0.50940591  0.04200699 -0.37774337 -0.06107949
 [37]  0.76682085 -0.06222677 -0.45994984  0.90223815 -1.28469393  2.73608413
 [43] -0.87026187  0.24757069 -0.77932057  0.61394658 -1.15920164  1.40246458
 [49] -0.41137086 -0.65373982 -1.44877995 -1.14027581 -0.77742999  1.28359798
 [55]  0.86729408  0.04902258 -0.30750433  0.38587211  0.81397122  0.24687648
 [61] -1.52866073  0.31003378 -0.73608841 -1.59361064 -1.22997401  0.55378530
 [67] -1.92215888 -0.09845352 -1.22264329 -0.75570680  0.68351883  1.32270721
 [73]  1.39224055  0.26279921 -0.40742472  1.17872419  0.52421812 -1.16968452
 [79] -0.02808930 -0.45357662  0.77989689 -0.90159069 -0.88726498 -0.57055781
 [85]  2.05957874 -2.29826771 -0.37118735 -0.27930916 -0.60721932 -1.42983665
 [91] -0.78811224  1.99108180  0.28849245  0.24417419  2.93736390 -0.26069759
 [97]  0.12745035  1.72482154 -0.98389631  0.53187107
> rowMin(tmp2)
  [1]  0.12149470 -0.59667453  0.63554977 -0.18726198 -0.16196812 -1.60567699
  [7] -0.91818787 -0.12185247 -0.66077357 -2.19093360  1.12666737 -1.26697221
 [13] -0.35128406  1.69408854  0.70668723  0.39595440  1.29298460 -1.05269593
 [19]  0.93868777 -0.70868351  0.34709458 -1.08390295  0.30783437  0.56725657
 [25] -0.16219037  0.30598716  0.19544007  2.45513763 -1.24627808  1.23815232
 [31]  0.73717140  1.44070560  0.50940591  0.04200699 -0.37774337 -0.06107949
 [37]  0.76682085 -0.06222677 -0.45994984  0.90223815 -1.28469393  2.73608413
 [43] -0.87026187  0.24757069 -0.77932057  0.61394658 -1.15920164  1.40246458
 [49] -0.41137086 -0.65373982 -1.44877995 -1.14027581 -0.77742999  1.28359798
 [55]  0.86729408  0.04902258 -0.30750433  0.38587211  0.81397122  0.24687648
 [61] -1.52866073  0.31003378 -0.73608841 -1.59361064 -1.22997401  0.55378530
 [67] -1.92215888 -0.09845352 -1.22264329 -0.75570680  0.68351883  1.32270721
 [73]  1.39224055  0.26279921 -0.40742472  1.17872419  0.52421812 -1.16968452
 [79] -0.02808930 -0.45357662  0.77989689 -0.90159069 -0.88726498 -0.57055781
 [85]  2.05957874 -2.29826771 -0.37118735 -0.27930916 -0.60721932 -1.42983665
 [91] -0.78811224  1.99108180  0.28849245  0.24417419  2.93736390 -0.26069759
 [97]  0.12745035  1.72482154 -0.98389631  0.53187107
> 
> colMeans(tmp2)
[1] -0.003461012
> colSums(tmp2)
[1] -0.3461012
> colVars(tmp2)
[1] 1.12252
> colSd(tmp2)
[1] 1.05949
> colMax(tmp2)
[1] 2.937364
> colMin(tmp2)
[1] -2.298268
> colMedians(tmp2)
[1] -0.06165313
> colRanges(tmp2)
          [,1]
[1,] -2.298268
[2,]  2.937364
> 
> 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.9453990  -1.6398342   1.5275645  -2.0304295   9.8478090  -1.9537001
 [7]  -4.8753028   0.8374111 -11.6730945   5.6090766
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.39046088
[2,] -0.59821679
[3,]  0.06256075
[4,]  0.83927308
[5,]  1.56683509
> 
> rowApply(tmp,sum)
 [1]  1.8037272  2.6651268 -1.3096132  1.9735284  0.7735761  0.8708039
 [7] -5.8185917 -4.4059723  2.4514823 -2.4091685
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    7    4    3    5    4   10    2    6     7
 [2,]    5    3    5    7    4    9    5    5    2     3
 [3,]    6    6    9    6    2    6    1    8    7     8
 [4,]    4    2    6    8    3    8    8    4    8     2
 [5,]    7   10    7   10   10   10    3    9   10     5
 [6,]    1    9    1    4    9    5    4   10    4     6
 [7,]    2    8    2    2    6    7    7    1    3     4
 [8,]    3    5    8    5    8    2    6    7    5     9
 [9,]   10    1    3    1    1    1    2    3    1     1
[10,]    8    4   10    9    7    3    9    6    9    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.6930550  1.1641062  0.9589554 -5.4619246  0.7753789  3.9807598
 [7] -0.8985752 -0.5555108  3.2859425  0.2354088 -0.7680854 -1.3969398
[13]  1.7799303  2.2903071  3.0915993  1.3724191 -0.2461151  0.2044007
[19] -0.3224514  2.0282402
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.98608268
[2,] -0.37045470
[3,] -0.18903550
[4,] -0.08912516
[5,]  0.94164306
> 
> rowApply(tmp,sum)
[1]  9.007147 -3.365213 -4.412862  6.737990  2.857729
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   11   10    6   16
[2,]   12    4   12    9   20
[3,]    7   19   17    3    9
[4,]    3    2   15    1    1
[5,]    8    6    9   14   15
> 
> 
> as.matrix(tmp)
            [,1]        [,2]        [,3]       [,4]       [,5]         [,6]
[1,] -0.98608268  0.51046369 -0.03529608 -0.9196522  0.1086407  0.786911081
[2,] -0.18903550 -0.92941927  0.86405214 -1.4759441 -0.8404104  0.779450476
[3,] -0.08912516 -0.03373067  0.70215431  0.1820546 -0.1808641 -0.836043514
[4,] -0.37045470  0.03216855 -0.61931975 -1.2385246  0.7734134  3.245164941
[5,]  0.94164306  1.58462390  0.04736474 -2.0098583  0.9145993  0.005276773
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  2.2758441  1.2707430 0.42549875  0.39104291 -0.2296959 -0.8072116
[2,] -1.0771926 -0.2268057 1.89794364  0.09232925  0.8064633 -0.8941765
[3,] -0.7706305 -0.9194317 0.09958960 -0.85908718 -2.0713154  1.0699332
[4,] -0.1812060  0.2236422 0.79419686  1.00082968  1.2534457 -1.0084805
[5,] -1.1453903 -0.9036586 0.06871367 -0.38970584 -0.5269831  0.2429956
          [,13]       [,14]       [,15]       [,16]      [,17]      [,18]
[1,]  0.9474698 -0.36017724  2.37715602  0.68050297 -1.5447607  2.2486312
[2,] -2.2792330  0.34216129  0.34815126  0.03883631  0.7243174 -0.3892524
[3,]  1.2464068  0.07121569  0.70413184 -0.07598745 -0.4428191 -1.1760985
[4,]  0.7233316  1.21999459 -0.42438774  0.71671175 -0.2535293 -0.6149844
[5,]  1.1419551  1.01711274  0.08654789  0.01235553  1.2706766  0.1361048
          [,19]      [,20]
[1,]  1.4140420  0.4530773
[2,] -0.7599041 -0.1975443
[3,] -1.2784424  0.2452271
[4,]  0.4767082  0.9892697
[5,] -0.1748550  0.5382104
> 
> 
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-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.5471176 0.5990489 -1.058397 -2.223356 -0.7939639 0.7267729 0.02578209
          col8       col9     col10     col11     col12     col13      col14
row1 -1.785389 -0.1516448 0.1032101 0.1058585 0.4450717 -1.241244 -0.9585729
         col15     col16     col17      col18     col19     col20
row1 -0.848603 -2.033797 0.3192519 -0.6495496 0.6458707 -1.350165
> tmp[,"col10"]
          col10
row1  0.1032101
row2  1.6621609
row3 -0.3197135
row4  0.1342723
row5  1.1781599
> tmp[c("row1","row5"),]
          col1      col2       col3       col4       col5      col6       col7
row1 0.5471176 0.5990489 -1.0583972 -2.2233556 -0.7939639 0.7267729 0.02578209
row5 0.3867571 1.7148798 -0.3945576 -0.7445221  1.2034073 1.5394608 0.68772776
          col8       col9     col10     col11     col12      col13      col14
row1 -1.785389 -0.1516448 0.1032101 0.1058585 0.4450717 -1.2412445 -0.9585729
row5  0.651784  0.2107809 1.1781599 0.9013924 0.4669779 -0.0889289 -0.2762579
         col15     col16     col17      col18     col19      col20
row1 -0.848603 -2.033797 0.3192519 -0.6495496 0.6458707 -1.3501647
row5  0.183746 -1.024675 0.2155788 -0.4927255 0.4108159  0.5057168
> tmp[,c("col6","col20")]
           col6      col20
row1  0.7267729 -1.3501647
row2  1.1040413 -0.4222542
row3  1.0683768  0.3283644
row4 -1.1615370  1.8504596
row5  1.5394608  0.5057168
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.7267729 -1.3501647
row5 1.5394608  0.5057168
> 
> 
> 
> 
> 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 52.63447 52.40121 50.53603 49.02211 50.98796 104.7426 49.018 49.71605
         col9    col10    col11    col12    col13   col14    col15    col16
row1 49.69912 50.01757 50.47407 50.09148 50.59523 49.9247 47.83006 50.74904
        col17    col18    col19    col20
row1 47.24164 49.55025 49.91977 103.2141
> tmp[,"col10"]
        col10
row1 50.01757
row2 31.22449
row3 30.29410
row4 31.05796
row5 50.98308
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 52.63447 52.40121 50.53603 49.02211 50.98796 104.7426 49.01800 49.71605
row5 48.53242 50.28020 50.67796 50.05965 50.60899 103.4411 49.71609 48.87907
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.69912 50.01757 50.47407 50.09148 50.59523 49.92470 47.83006 50.74904
row5 50.30814 50.98308 50.35359 49.31133 50.60917 49.24652 50.48600 48.15522
        col17    col18    col19    col20
row1 47.24164 49.55025 49.91977 103.2141
row5 50.99091 50.39902 50.17436 105.8267
> tmp[,c("col6","col20")]
          col6     col20
row1 104.74257 103.21410
row2  76.08825  76.45532
row3  74.85500  76.06916
row4  75.39796  76.22601
row5 103.44111 105.82673
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7426 103.2141
row5 103.4411 105.8267
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7426 103.2141
row5 103.4411 105.8267
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.9928034
[2,]  0.9948648
[3,] -0.4217847
[4,] -0.3769231
[5,] -0.9787058
> tmp[,c("col17","col7")]
           col17        col7
[1,]  0.68794200 -0.03510972
[2,] -0.46065940 -0.33815410
[3,]  0.16286047 -0.13328438
[4,] -1.33399849 -0.83887489
[5,] -0.09461359  0.74586205
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.6897718  0.6258217
[2,]  0.5021036 -0.7363103
[3,]  0.4727020 -0.3823925
[4,] -0.4087652 -1.7392202
[5,] -1.7642469 -1.6571374
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.689772
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.6897718
[2,]  0.5021036
> 
> 
> 
> 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 0.1143558 1.155725 0.7222836 0.5431301 0.1221271 -2.894832  0.6867369
row1 0.1169726 1.374647 0.8342037 1.0739037 0.3216356 -1.022350 -0.1939420
          [,8]       [,9]     [,10]      [,11]     [,12]      [,13]      [,14]
row3 0.2716423  0.9295255 0.6640439 1.69692128 0.3002938 -0.4153386  0.3915233
row1 0.3612906 -2.0769913 2.0860072 0.01213109 1.2109907 -0.8934260 -0.3686141
          [,15]      [,16]      [,17]     [,18]      [,19]        [,20]
row3 -2.0893014  0.3886413  2.5643753 0.1522270 -1.3957879  0.002587226
row1 -0.8524827 -0.5478495 -0.6477832 0.1755722 -0.6421652 -0.625085737
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]     [,3]      [,4]      [,5]      [,6]      [,7]
row2 -1.744599 -0.5299658 1.135676 0.2240803 -1.375571 0.5708039 -1.088597
           [,8]      [,9]      [,10]
row2 -0.3560342 -1.886366 -0.6783526
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
row5 -0.7723927 0.2949141 0.4466837 0.9035509 -0.4253134 -1.257879 0.7263463
          [,8]      [,9]    [,10]      [,11]     [,12]     [,13]    [,14]
row5 -0.542131 0.8069586 -1.23662 -0.4868603 -1.719193 0.2757881 1.488246
         [,15]     [,16]     [,17]    [,18]     [,19]     [,20]
row5 -1.508604 0.1883839 -1.608886 -1.39036 0.9424588 -0.542216
> 
> 
> 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: 0x5843414200a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b283c7f679d"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b28492e2bb6"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b28ab9e0a7" 
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b2842304794"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b288a87a91" 
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b28722a391b"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b28291aff52"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b28a8aa3bc" 
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b2870080c0e"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b2812938583"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b2834c175b5"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b288d0584e" 
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b2813dffe1d"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b282f88c940"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM383b28626d32eb"
> 
> 
> ### 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: 0x58434136e570>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x58434136e570>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x58434136e570>
> rowMedians(tmp)
  [1]  0.195969249  0.394188446  0.124241104  0.047060095  0.128286857
  [6] -0.459644102 -0.529803203 -0.203320977 -0.386628217  0.076904421
 [11] -0.334733343 -0.064350009  0.525129522  0.256908812  0.021826932
 [16]  0.561444320 -0.324047246  0.086904591  0.707960017  0.514551241
 [21] -0.380266535 -0.356662985 -0.298596649  0.085331586 -0.177911344
 [26] -0.384134233 -0.386311772 -0.311917131 -0.032143832 -0.333588125
 [31] -0.337978290  0.090013935 -0.059773663 -0.145925702 -0.126059303
 [36] -0.003070350  0.535637905  0.461759687  0.282773622  0.517506308
 [41]  0.023368673 -0.185435986 -0.258223321 -0.228626672 -0.031865105
 [46]  0.282618337 -0.452316953  0.281904938 -0.140108505 -0.060162369
 [51]  0.086157944  0.479604002 -0.219507908 -0.589948758 -0.011404339
 [56] -0.480209072  0.497938260 -0.068432747  0.228336027  0.378831648
 [61]  0.047839400 -0.238797821 -0.155995230 -0.419412877  0.127038524
 [66] -0.472998666  0.076664151 -0.338492150  0.189950033  0.072104754
 [71] -0.319086346  0.182733925 -0.284983287 -0.659829628  0.629155747
 [76] -0.509837243  0.727943634  0.539972885  0.164424644 -0.010510082
 [81] -0.214083237  0.049022911 -0.594169255 -0.392291833 -0.132631116
 [86] -0.617580151  0.302232501  0.274712058  0.339087819 -0.405280922
 [91]  0.431745007 -0.117398567  0.204898061 -0.158201557  0.282711757
 [96]  0.138144469  0.352329397 -0.321553469  0.362284130  0.033814152
[101]  0.104653023  0.849766393 -0.580643845  0.577944880 -0.314543882
[106]  0.061473722  0.240887926 -0.233374530  0.008125570  0.393097464
[111] -0.132652061  0.361302768 -0.207342677  0.454815340  0.583840695
[116] -0.014231673  0.121871929  0.139101164 -0.609991604 -0.166280860
[121]  0.509533358 -0.051282946 -0.115454120 -0.296222348 -0.447578326
[126] -0.019378011 -0.356465477 -0.459999426  0.007971803  0.074607213
[131] -0.393440140 -0.124068091  0.398565028 -0.043052193  0.200572035
[136]  0.174305424 -0.125078496 -0.256554268 -0.193226415 -0.252133587
[141] -0.328304786 -0.357112347  0.328485062 -0.207593320  0.023295553
[146]  0.058047127 -0.131302778  0.140529043 -0.131877425  0.120133641
[151] -0.262878217  0.093022665 -0.068932181 -0.291772066 -0.069544220
[156] -0.308029150  0.132712473 -0.554868078  0.415583894 -0.226746264
[161]  0.256194382  0.207460500 -0.319635345 -0.753134069  0.379619142
[166] -0.097443574 -0.087646327  0.081470554  0.170374486 -0.166806692
[171] -0.169177069  0.222301503  0.398808059 -0.478048858  0.598552593
[176] -0.122595499 -0.711675891  0.552383114  0.146951027  0.184497864
[181]  0.065142733  0.054738925  0.178291504  0.270305952  0.072057254
[186]  0.134563508 -0.129426536 -0.630212857  0.004373192 -0.116357201
[191]  0.246522989 -0.233488243  0.011024294  0.702178669 -0.034943737
[196] -0.137067642 -0.152376316  0.632059866 -0.231169923  0.239668915
[201] -0.266651238  0.480631318  0.126512086  0.698974155  0.210052763
[206] -0.034049935  0.315171183 -0.248079269  0.346690726 -0.236444264
[211] -0.505016156 -0.333519471 -0.238512692 -0.372729014  0.794425687
[216]  0.094309749 -0.197786917 -0.040508171 -0.266314263  0.546039228
[221] -0.476140067  0.088961883  0.198554431  0.117822357 -0.094089609
[226] -0.045893655  0.227422892  0.058924964  0.064703067  0.132748369
> 
> proc.time()
   user  system elapsed 
  1.258   0.673   1.915 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x638316301370>
> .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: 0x638316301370>
> .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: 0x638316301370>
> .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: 0x638316301370>
> 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: 0x6383162e91c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6383162e91c0>
> .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: 0x6383162e91c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6383162e91c0>
> .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: 0x6383162e91c0>
> 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: 0x6383165cc120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6383165cc120>
> .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: 0x6383165cc120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6383165cc120>
> .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: 0x6383165cc120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6383165cc120>
> .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: 0x6383165cc120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6383165cc120>
> .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: 0x6383165cc120>
> 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: 0x63831531c390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x63831531c390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63831531c390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63831531c390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile383b6257a2032d" "BufferedMatrixFile383b62aa36688" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile383b6257a2032d" "BufferedMatrixFile383b62aa36688" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6383152133d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6383152133d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6383152133d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6383152133d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6383152133d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6383152133d0>
> .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: 0x638316d48fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x638316d48fa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x638316d48fa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x638316d48fa0>
> 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: 0x638315520ff0>
> .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: 0x638315520ff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.250   0.044   0.282 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

Example timings