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

This page was generated on 2026-04-04 11:57 -0400 (Sat, 04 Apr 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4897
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-04-03 13:45 -0400 (Fri, 03 Apr 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 -0400 (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-04-03 21:35:18 -0400 (Fri, 03 Apr 2026)
EndedAt: 2026-04-03 21:35:42 -0400 (Fri, 03 Apr 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.4 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.1) 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.1) 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.247   0.038   0.276 

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] "Fri Apr  3 21:35:33 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Apr  3 21:35:33 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: 0x58f12751d1c0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Apr  3 21:35:34 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Apr  3 21:35:34 2026"
> 
> ColMode(tmp2)
<pointer: 0x58f12751d1c0>
> 
> 
> 
> ### 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,] 98.6509750  0.2034275  0.9536659 -0.1744629
[2,]  0.9840820  0.8120968 -0.2997725  0.4560195
[3,]  0.3641736 -0.3661409  0.6429093 -0.2693986
[4,]  1.1005297 -1.0008869  1.6690506 -0.3101617
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 98.6509750 0.2034275 0.9536659 0.1744629
[2,]  0.9840820 0.8120968 0.2997725 0.4560195
[3,]  0.3641736 0.3661409 0.6429093 0.2693986
[4,]  1.1005297 1.0008869 1.6690506 0.3101617
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9323197 0.4510294 0.9765582 0.4176875
[2,] 0.9920091 0.9011641 0.5475149 0.6752922
[3,] 0.6034680 0.6050958 0.8018162 0.5190362
[4,] 1.0490614 1.0004433 1.2919174 0.5569216
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 222.97417 29.71372 35.71925 29.35134
[2,]  35.90417 34.82374 30.77492 32.20894
[3,]  31.39885 31.41710 33.66107 30.45976
[4,]  36.59114 36.00532 39.58822 30.87938
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x58f1281238b0>
> exp(tmp5)
<pointer: 0x58f1281238b0>
> log(tmp5,2)
<pointer: 0x58f1281238b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.0915
> Min(tmp5)
[1] 53.75548
> mean(tmp5)
[1] 73.51978
> Sum(tmp5)
[1] 14703.96
> Var(tmp5)
[1] 841.7246
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.31622 72.28859 72.61719 71.30100 72.80312 70.43651 71.04884 70.48685
 [9] 74.68566 71.21385
> rowSums(tmp5)
 [1] 1766.324 1445.772 1452.344 1426.020 1456.062 1408.730 1420.977 1409.737
 [9] 1493.713 1424.277
> rowVars(tmp5)
 [1] 7875.71059   94.21798   78.25636   36.29137   79.66910   66.37717
 [7]   75.59537  105.41909   78.12484   54.51813
> rowSd(tmp5)
 [1] 88.745200  9.706595  8.846262  6.024232  8.925755  8.147218  8.694560
 [8] 10.267380  8.838826  7.383639
> rowMax(tmp5)
 [1] 464.09153  90.81793  90.96510  82.39770  91.49576  87.30004  86.49421
 [8]  88.12020  92.43885  83.76616
> rowMin(tmp5)
 [1] 56.06291 53.75548 60.53412 61.28409 57.60986 55.08755 55.65290 56.52651
 [9] 61.63894 56.70492
> 
> colMeans(tmp5)
 [1] 110.87886  68.31180  70.98173  68.27239  71.94665  72.60411  67.12922
 [8]  72.93269  71.27713  71.59736  73.02395  74.10693  74.75080  71.71287
[15]  70.74094  68.21505  75.46100  75.16769  72.09233  69.19214
> colSums(tmp5)
 [1] 1108.7886  683.1180  709.8173  682.7239  719.4665  726.0411  671.2922
 [8]  729.3269  712.7713  715.9736  730.2395  741.0693  747.5080  717.1287
[15]  707.4094  682.1505  754.6100  751.6769  720.9233  691.9214
> colVars(tmp5)
 [1] 15440.36477    70.05770    51.14918    27.67309    53.12453    54.27459
 [7]    13.38999   125.47112    91.45868   102.91633   111.74138    63.47477
[13]    66.18475    57.96478   103.66226    66.56098    97.48818   118.95719
[19]    27.69834   113.95799
> colSd(tmp5)
 [1] 124.259264   8.370048   7.151865   5.260522   7.288657   7.367129
 [7]   3.659233  11.201389   9.563403  10.144769  10.570779   7.967106
[13]   8.135401   7.613461  10.181467   8.158491   9.873611  10.906750
[19]   5.262921  10.675111
> colMax(tmp5)
 [1] 464.09153  85.14123  82.39770  77.40231  82.11319  90.81793  73.43942
 [8]  85.51094  91.05468  88.93336  88.12020  82.78659  87.30004  83.61109
[15]  86.49421  83.30314  90.96510  92.43885  79.62450  83.76616
> colMin(tmp5)
 [1] 57.60986 56.52651 61.27379 61.09096 59.94173 65.77545 62.35500 53.75548
 [9] 61.73536 57.11269 55.08755 58.91640 62.66511 60.04278 59.82470 56.70492
[17] 62.38349 61.73116 63.45138 56.06291
> 
> 
> ### 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] 88.31622 72.28859 72.61719 71.30100 72.80312 70.43651 71.04884 70.48685
 [9]       NA 71.21385
> rowSums(tmp5)
 [1] 1766.324 1445.772 1452.344 1426.020 1456.062 1408.730 1420.977 1409.737
 [9]       NA 1424.277
> rowVars(tmp5)
 [1] 7875.71059   94.21798   78.25636   36.29137   79.66910   66.37717
 [7]   75.59537  105.41909   82.46497   54.51813
> rowSd(tmp5)
 [1] 88.745200  9.706595  8.846262  6.024232  8.925755  8.147218  8.694560
 [8] 10.267380  9.081023  7.383639
> rowMax(tmp5)
 [1] 464.09153  90.81793  90.96510  82.39770  91.49576  87.30004  86.49421
 [8]  88.12020        NA  83.76616
> rowMin(tmp5)
 [1] 56.06291 53.75548 60.53412 61.28409 57.60986 55.08755 55.65290 56.52651
 [9]       NA 56.70492
> 
> colMeans(tmp5)
 [1]       NA 68.31180 70.98173 68.27239 71.94665 72.60411 67.12922 72.93269
 [9] 71.27713 71.59736 73.02395 74.10693 74.75080 71.71287 70.74094 68.21505
[17] 75.46100 75.16769 72.09233 69.19214
> colSums(tmp5)
 [1]       NA 683.1180 709.8173 682.7239 719.4665 726.0411 671.2922 729.3269
 [9] 712.7713 715.9736 730.2395 741.0693 747.5080 717.1287 707.4094 682.1505
[17] 754.6100 751.6769 720.9233 691.9214
> colVars(tmp5)
 [1]        NA  70.05770  51.14918  27.67309  53.12453  54.27459  13.38999
 [8] 125.47112  91.45868 102.91633 111.74138  63.47477  66.18475  57.96478
[15] 103.66226  66.56098  97.48818 118.95719  27.69834 113.95799
> colSd(tmp5)
 [1]        NA  8.370048  7.151865  5.260522  7.288657  7.367129  3.659233
 [8] 11.201389  9.563403 10.144769 10.570779  7.967106  8.135401  7.613461
[15] 10.181467  8.158491  9.873611 10.906750  5.262921 10.675111
> colMax(tmp5)
 [1]       NA 85.14123 82.39770 77.40231 82.11319 90.81793 73.43942 85.51094
 [9] 91.05468 88.93336 88.12020 82.78659 87.30004 83.61109 86.49421 83.30314
[17] 90.96510 92.43885 79.62450 83.76616
> colMin(tmp5)
 [1]       NA 56.52651 61.27379 61.09096 59.94173 65.77545 62.35500 53.75548
 [9] 61.73536 57.11269 55.08755 58.91640 62.66511 60.04278 59.82470 56.70492
[17] 62.38349 61.73116 63.45138 56.06291
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.0915
> Min(tmp5,na.rm=TRUE)
[1] 53.75548
> mean(tmp5,na.rm=TRUE)
[1] 73.51417
> Sum(tmp5,na.rm=TRUE)
[1] 14629.32
> Var(tmp5,na.rm=TRUE)
[1] 845.9694
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.31622 72.28859 72.61719 71.30100 72.80312 70.43651 71.04884 70.48685
 [9] 74.68820 71.21385
> rowSums(tmp5,na.rm=TRUE)
 [1] 1766.324 1445.772 1452.344 1426.020 1456.062 1408.730 1420.977 1409.737
 [9] 1419.076 1424.277
> rowVars(tmp5,na.rm=TRUE)
 [1] 7875.71059   94.21798   78.25636   36.29137   79.66910   66.37717
 [7]   75.59537  105.41909   82.46497   54.51813
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.745200  9.706595  8.846262  6.024232  8.925755  8.147218  8.694560
 [8] 10.267380  9.081023  7.383639
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.09153  90.81793  90.96510  82.39770  91.49576  87.30004  86.49421
 [8]  88.12020  92.43885  83.76616
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.06291 53.75548 60.53412 61.28409 57.60986 55.08755 55.65290 56.52651
 [9] 61.63894 56.70492
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.90569  68.31180  70.98173  68.27239  71.94665  72.60411  67.12922
 [8]  72.93269  71.27713  71.59736  73.02395  74.10693  74.75080  71.71287
[15]  70.74094  68.21505  75.46100  75.16769  72.09233  69.19214
> colSums(tmp5,na.rm=TRUE)
 [1] 1034.1512  683.1180  709.8173  682.7239  719.4665  726.0411  671.2922
 [8]  729.3269  712.7713  715.9736  730.2395  741.0693  747.5080  717.1287
[15]  707.4094  682.1505  754.6100  751.6769  720.9233  691.9214
> colVars(tmp5,na.rm=TRUE)
 [1] 17187.98815    70.05770    51.14918    27.67309    53.12453    54.27459
 [7]    13.38999   125.47112    91.45868   102.91633   111.74138    63.47477
[13]    66.18475    57.96478   103.66226    66.56098    97.48818   118.95719
[19]    27.69834   113.95799
> colSd(tmp5,na.rm=TRUE)
 [1] 131.102968   8.370048   7.151865   5.260522   7.288657   7.367129
 [7]   3.659233  11.201389   9.563403  10.144769  10.570779   7.967106
[13]   8.135401   7.613461  10.181467   8.158491   9.873611  10.906750
[19]   5.262921  10.675111
> colMax(tmp5,na.rm=TRUE)
 [1] 464.09153  85.14123  82.39770  77.40231  82.11319  90.81793  73.43942
 [8]  85.51094  91.05468  88.93336  88.12020  82.78659  87.30004  83.61109
[15]  86.49421  83.30314  90.96510  92.43885  79.62450  83.76616
> colMin(tmp5,na.rm=TRUE)
 [1] 57.60986 56.52651 61.27379 61.09096 59.94173 65.77545 62.35500 53.75548
 [9] 61.73536 57.11269 55.08755 58.91640 62.66511 60.04278 59.82470 56.70492
[17] 62.38349 61.73116 63.45138 56.06291
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.31622 72.28859 72.61719 71.30100 72.80312 70.43651 71.04884 70.48685
 [9]      NaN 71.21385
> rowSums(tmp5,na.rm=TRUE)
 [1] 1766.324 1445.772 1452.344 1426.020 1456.062 1408.730 1420.977 1409.737
 [9]    0.000 1424.277
> rowVars(tmp5,na.rm=TRUE)
 [1] 7875.71059   94.21798   78.25636   36.29137   79.66910   66.37717
 [7]   75.59537  105.41909         NA   54.51813
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.745200  9.706595  8.846262  6.024232  8.925755  8.147218  8.694560
 [8] 10.267380        NA  7.383639
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.09153  90.81793  90.96510  82.39770  91.49576  87.30004  86.49421
 [8]  88.12020        NA  83.76616
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.06291 53.75548 60.53412 61.28409 57.60986 55.08755 55.65290 56.52651
 [9]       NA 56.70492
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 66.44186 71.29579 68.02584 72.59115 71.87454 66.93002 73.40678
 [9] 69.07963 70.83568 73.67258 73.14253 74.18414 71.00781 71.75228 68.67247
[17] 75.60431 73.24867 72.92272 68.21032
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 597.9768 641.6621 612.2326 653.3203 646.8709 602.3702 660.6611
 [9] 621.7167 637.5211 663.0532 658.2827 667.6573 639.0703 645.7705 618.0523
[17] 680.4388 659.2380 656.3045 613.8928
> colVars(tmp5,na.rm=TRUE)
 [1]        NA  39.47745  56.43320  30.44838  55.09217  55.07097  14.61734
 [8] 138.62641  48.56442 109.25411 120.97592  60.94572  70.84545  59.61787
[15] 105.11359  72.52716 109.44315  92.39724  23.40325 117.35809
> colSd(tmp5,na.rm=TRUE)
 [1]        NA  6.283108  7.512203  5.518005  7.422410  7.420982  3.823263
 [8] 11.773972  6.968818 10.452469 10.998906  7.806774  8.416974  7.721261
[15] 10.252492  8.516288 10.461508  9.612348  4.837690 10.833194
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 74.94036 82.39770 77.40231 82.11319 90.81793 73.43942 85.51094
 [9] 80.33588 88.93336 88.12020 78.48917 87.30004 83.61109 86.49421 83.30314
[17] 90.96510 91.49576 79.62450 83.76616
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 56.52651 61.27379 61.09096 59.94173 65.77545 62.35500 53.75548
 [9] 61.73536 57.11269 55.08755 58.91640 62.66511 60.04278 59.82470 56.70492
[17] 62.38349 61.73116 63.45138 56.06291
> 
> 
> 
> 
> 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] 433.24207 140.00413 222.02059 125.96200 146.52873 321.51734  87.89325
 [8] 170.90202 108.79786 181.68400
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 433.24207 140.00413 222.02059 125.96200 146.52873 321.51734  87.89325
 [8] 170.90202 108.79786 181.68400
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.421085e-13  2.842171e-14 -1.136868e-13 -1.278977e-13  0.000000e+00
 [6] -1.705303e-13 -1.136868e-13  1.421085e-14 -5.684342e-14  5.684342e-14
[11]  5.684342e-14 -1.136868e-13 -1.136868e-13  5.684342e-14  0.000000e+00
[16] -2.273737e-13  5.684342e-14  2.842171e-14 -2.842171e-13 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   4 
4   4 
8   1 
5   5 
10   19 
8   14 
3   7 
9   14 
6   6 
1   5 
6   19 
5   18 
6   1 
3   17 
4   1 
1   3 
7   12 
5   17 
10   7 
9   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] 1.764075
> Min(tmp)
[1] -1.938143
> mean(tmp)
[1] -0.01979604
> Sum(tmp)
[1] -1.979604
> Var(tmp)
[1] 0.794736
> 
> rowMeans(tmp)
[1] -0.01979604
> rowSums(tmp)
[1] -1.979604
> rowVars(tmp)
[1] 0.794736
> rowSd(tmp)
[1] 0.8914797
> rowMax(tmp)
[1] 1.764075
> rowMin(tmp)
[1] -1.938143
> 
> colMeans(tmp)
  [1]  0.63274850  0.78235330 -1.39110494  1.49899076  0.44107394 -0.81738890
  [7] -1.03945831 -1.93814303 -0.59619868  0.19650997  1.41081040  1.19634858
 [13] -0.53429213 -0.96577833 -0.16483652  0.31542813  0.95054533  0.69311989
 [19] -1.40358248  0.73128504 -0.49427624 -0.09573619  1.33572533  1.23508863
 [25] -1.37247113  0.70954297 -0.75672880  0.31841357 -1.39676708 -1.75540150
 [31]  1.26823817  0.49342338  0.68502404  0.41281770 -0.33228226 -0.67731242
 [37]  0.83184916  0.89569914  0.14364255  0.13094382  0.21312081  0.08012731
 [43] -0.28238351  0.07830084 -0.57243772  0.59634393 -0.73857959 -0.90891809
 [49] -1.32449997  0.87534839  1.26066862 -0.04730559  0.30087255 -1.20310829
 [55] -1.20635958 -0.45927365  0.16210814  1.76407451  0.54457673 -1.51591143
 [61]  0.31983174 -0.43326290  0.03960714 -1.18061358 -0.05200660  1.12838302
 [67] -1.32332187  1.34507016 -0.24076895 -1.45964853  0.82461043  0.39327851
 [73]  0.48284805  0.11774545  1.10347071 -0.28790063 -0.75959406  0.55208718
 [79]  0.43824169 -1.41826445 -0.40905745 -0.54613167  0.57674370  0.10504222
 [85] -0.62325893 -1.10944949 -0.11140188  1.17726843 -0.90773768 -0.59587076
 [91]  0.04726533 -0.36407513  1.74584858  1.34483994 -0.20429239  0.83160011
 [97] -0.69393679 -0.45595381  0.58668863 -1.15815536
> colSums(tmp)
  [1]  0.63274850  0.78235330 -1.39110494  1.49899076  0.44107394 -0.81738890
  [7] -1.03945831 -1.93814303 -0.59619868  0.19650997  1.41081040  1.19634858
 [13] -0.53429213 -0.96577833 -0.16483652  0.31542813  0.95054533  0.69311989
 [19] -1.40358248  0.73128504 -0.49427624 -0.09573619  1.33572533  1.23508863
 [25] -1.37247113  0.70954297 -0.75672880  0.31841357 -1.39676708 -1.75540150
 [31]  1.26823817  0.49342338  0.68502404  0.41281770 -0.33228226 -0.67731242
 [37]  0.83184916  0.89569914  0.14364255  0.13094382  0.21312081  0.08012731
 [43] -0.28238351  0.07830084 -0.57243772  0.59634393 -0.73857959 -0.90891809
 [49] -1.32449997  0.87534839  1.26066862 -0.04730559  0.30087255 -1.20310829
 [55] -1.20635958 -0.45927365  0.16210814  1.76407451  0.54457673 -1.51591143
 [61]  0.31983174 -0.43326290  0.03960714 -1.18061358 -0.05200660  1.12838302
 [67] -1.32332187  1.34507016 -0.24076895 -1.45964853  0.82461043  0.39327851
 [73]  0.48284805  0.11774545  1.10347071 -0.28790063 -0.75959406  0.55208718
 [79]  0.43824169 -1.41826445 -0.40905745 -0.54613167  0.57674370  0.10504222
 [85] -0.62325893 -1.10944949 -0.11140188  1.17726843 -0.90773768 -0.59587076
 [91]  0.04726533 -0.36407513  1.74584858  1.34483994 -0.20429239  0.83160011
 [97] -0.69393679 -0.45595381  0.58668863 -1.15815536
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.63274850  0.78235330 -1.39110494  1.49899076  0.44107394 -0.81738890
  [7] -1.03945831 -1.93814303 -0.59619868  0.19650997  1.41081040  1.19634858
 [13] -0.53429213 -0.96577833 -0.16483652  0.31542813  0.95054533  0.69311989
 [19] -1.40358248  0.73128504 -0.49427624 -0.09573619  1.33572533  1.23508863
 [25] -1.37247113  0.70954297 -0.75672880  0.31841357 -1.39676708 -1.75540150
 [31]  1.26823817  0.49342338  0.68502404  0.41281770 -0.33228226 -0.67731242
 [37]  0.83184916  0.89569914  0.14364255  0.13094382  0.21312081  0.08012731
 [43] -0.28238351  0.07830084 -0.57243772  0.59634393 -0.73857959 -0.90891809
 [49] -1.32449997  0.87534839  1.26066862 -0.04730559  0.30087255 -1.20310829
 [55] -1.20635958 -0.45927365  0.16210814  1.76407451  0.54457673 -1.51591143
 [61]  0.31983174 -0.43326290  0.03960714 -1.18061358 -0.05200660  1.12838302
 [67] -1.32332187  1.34507016 -0.24076895 -1.45964853  0.82461043  0.39327851
 [73]  0.48284805  0.11774545  1.10347071 -0.28790063 -0.75959406  0.55208718
 [79]  0.43824169 -1.41826445 -0.40905745 -0.54613167  0.57674370  0.10504222
 [85] -0.62325893 -1.10944949 -0.11140188  1.17726843 -0.90773768 -0.59587076
 [91]  0.04726533 -0.36407513  1.74584858  1.34483994 -0.20429239  0.83160011
 [97] -0.69393679 -0.45595381  0.58668863 -1.15815536
> colMin(tmp)
  [1]  0.63274850  0.78235330 -1.39110494  1.49899076  0.44107394 -0.81738890
  [7] -1.03945831 -1.93814303 -0.59619868  0.19650997  1.41081040  1.19634858
 [13] -0.53429213 -0.96577833 -0.16483652  0.31542813  0.95054533  0.69311989
 [19] -1.40358248  0.73128504 -0.49427624 -0.09573619  1.33572533  1.23508863
 [25] -1.37247113  0.70954297 -0.75672880  0.31841357 -1.39676708 -1.75540150
 [31]  1.26823817  0.49342338  0.68502404  0.41281770 -0.33228226 -0.67731242
 [37]  0.83184916  0.89569914  0.14364255  0.13094382  0.21312081  0.08012731
 [43] -0.28238351  0.07830084 -0.57243772  0.59634393 -0.73857959 -0.90891809
 [49] -1.32449997  0.87534839  1.26066862 -0.04730559  0.30087255 -1.20310829
 [55] -1.20635958 -0.45927365  0.16210814  1.76407451  0.54457673 -1.51591143
 [61]  0.31983174 -0.43326290  0.03960714 -1.18061358 -0.05200660  1.12838302
 [67] -1.32332187  1.34507016 -0.24076895 -1.45964853  0.82461043  0.39327851
 [73]  0.48284805  0.11774545  1.10347071 -0.28790063 -0.75959406  0.55208718
 [79]  0.43824169 -1.41826445 -0.40905745 -0.54613167  0.57674370  0.10504222
 [85] -0.62325893 -1.10944949 -0.11140188  1.17726843 -0.90773768 -0.59587076
 [91]  0.04726533 -0.36407513  1.74584858  1.34483994 -0.20429239  0.83160011
 [97] -0.69393679 -0.45595381  0.58668863 -1.15815536
> colMedians(tmp)
  [1]  0.63274850  0.78235330 -1.39110494  1.49899076  0.44107394 -0.81738890
  [7] -1.03945831 -1.93814303 -0.59619868  0.19650997  1.41081040  1.19634858
 [13] -0.53429213 -0.96577833 -0.16483652  0.31542813  0.95054533  0.69311989
 [19] -1.40358248  0.73128504 -0.49427624 -0.09573619  1.33572533  1.23508863
 [25] -1.37247113  0.70954297 -0.75672880  0.31841357 -1.39676708 -1.75540150
 [31]  1.26823817  0.49342338  0.68502404  0.41281770 -0.33228226 -0.67731242
 [37]  0.83184916  0.89569914  0.14364255  0.13094382  0.21312081  0.08012731
 [43] -0.28238351  0.07830084 -0.57243772  0.59634393 -0.73857959 -0.90891809
 [49] -1.32449997  0.87534839  1.26066862 -0.04730559  0.30087255 -1.20310829
 [55] -1.20635958 -0.45927365  0.16210814  1.76407451  0.54457673 -1.51591143
 [61]  0.31983174 -0.43326290  0.03960714 -1.18061358 -0.05200660  1.12838302
 [67] -1.32332187  1.34507016 -0.24076895 -1.45964853  0.82461043  0.39327851
 [73]  0.48284805  0.11774545  1.10347071 -0.28790063 -0.75959406  0.55208718
 [79]  0.43824169 -1.41826445 -0.40905745 -0.54613167  0.57674370  0.10504222
 [85] -0.62325893 -1.10944949 -0.11140188  1.17726843 -0.90773768 -0.59587076
 [91]  0.04726533 -0.36407513  1.74584858  1.34483994 -0.20429239  0.83160011
 [97] -0.69393679 -0.45595381  0.58668863 -1.15815536
> colRanges(tmp)
          [,1]      [,2]      [,3]     [,4]      [,5]       [,6]      [,7]
[1,] 0.6327485 0.7823533 -1.391105 1.498991 0.4410739 -0.8173889 -1.039458
[2,] 0.6327485 0.7823533 -1.391105 1.498991 0.4410739 -0.8173889 -1.039458
          [,8]       [,9]   [,10]   [,11]    [,12]      [,13]      [,14]
[1,] -1.938143 -0.5961987 0.19651 1.41081 1.196349 -0.5342921 -0.9657783
[2,] -1.938143 -0.5961987 0.19651 1.41081 1.196349 -0.5342921 -0.9657783
          [,15]     [,16]     [,17]     [,18]     [,19]    [,20]      [,21]
[1,] -0.1648365 0.3154281 0.9505453 0.6931199 -1.403582 0.731285 -0.4942762
[2,] -0.1648365 0.3154281 0.9505453 0.6931199 -1.403582 0.731285 -0.4942762
           [,22]    [,23]    [,24]     [,25]    [,26]      [,27]     [,28]
[1,] -0.09573619 1.335725 1.235089 -1.372471 0.709543 -0.7567288 0.3184136
[2,] -0.09573619 1.335725 1.235089 -1.372471 0.709543 -0.7567288 0.3184136
         [,29]     [,30]    [,31]     [,32]    [,33]     [,34]      [,35]
[1,] -1.396767 -1.755401 1.268238 0.4934234 0.685024 0.4128177 -0.3322823
[2,] -1.396767 -1.755401 1.268238 0.4934234 0.685024 0.4128177 -0.3322823
          [,36]     [,37]     [,38]     [,39]     [,40]     [,41]      [,42]
[1,] -0.6773124 0.8318492 0.8956991 0.1436425 0.1309438 0.2131208 0.08012731
[2,] -0.6773124 0.8318492 0.8956991 0.1436425 0.1309438 0.2131208 0.08012731
          [,43]      [,44]      [,45]     [,46]      [,47]      [,48]   [,49]
[1,] -0.2823835 0.07830084 -0.5724377 0.5963439 -0.7385796 -0.9089181 -1.3245
[2,] -0.2823835 0.07830084 -0.5724377 0.5963439 -0.7385796 -0.9089181 -1.3245
         [,50]    [,51]       [,52]     [,53]     [,54]    [,55]      [,56]
[1,] 0.8753484 1.260669 -0.04730559 0.3008725 -1.203108 -1.20636 -0.4592737
[2,] 0.8753484 1.260669 -0.04730559 0.3008725 -1.203108 -1.20636 -0.4592737
         [,57]    [,58]     [,59]     [,60]     [,61]      [,62]      [,63]
[1,] 0.1621081 1.764075 0.5445767 -1.515911 0.3198317 -0.4332629 0.03960714
[2,] 0.1621081 1.764075 0.5445767 -1.515911 0.3198317 -0.4332629 0.03960714
         [,64]      [,65]    [,66]     [,67]   [,68]      [,69]     [,70]
[1,] -1.180614 -0.0520066 1.128383 -1.323322 1.34507 -0.2407689 -1.459649
[2,] -1.180614 -0.0520066 1.128383 -1.323322 1.34507 -0.2407689 -1.459649
         [,71]     [,72]    [,73]     [,74]    [,75]      [,76]      [,77]
[1,] 0.8246104 0.3932785 0.482848 0.1177455 1.103471 -0.2879006 -0.7595941
[2,] 0.8246104 0.3932785 0.482848 0.1177455 1.103471 -0.2879006 -0.7595941
         [,78]     [,79]     [,80]      [,81]      [,82]     [,83]     [,84]
[1,] 0.5520872 0.4382417 -1.418264 -0.4090574 -0.5461317 0.5767437 0.1050422
[2,] 0.5520872 0.4382417 -1.418264 -0.4090574 -0.5461317 0.5767437 0.1050422
          [,85]     [,86]      [,87]    [,88]      [,89]      [,90]      [,91]
[1,] -0.6232589 -1.109449 -0.1114019 1.177268 -0.9077377 -0.5958708 0.04726533
[2,] -0.6232589 -1.109449 -0.1114019 1.177268 -0.9077377 -0.5958708 0.04726533
          [,92]    [,93]   [,94]      [,95]     [,96]      [,97]      [,98]
[1,] -0.3640751 1.745849 1.34484 -0.2042924 0.8316001 -0.6939368 -0.4559538
[2,] -0.3640751 1.745849 1.34484 -0.2042924 0.8316001 -0.6939368 -0.4559538
         [,99]    [,100]
[1,] 0.5866886 -1.158155
[2,] 0.5866886 -1.158155
> 
> 
> Max(tmp2)
[1] 3.155901
> Min(tmp2)
[1] -2.436868
> mean(tmp2)
[1] 0.0008964379
> Sum(tmp2)
[1] 0.08964379
> Var(tmp2)
[1] 0.9166761
> 
> rowMeans(tmp2)
  [1]  1.078969270  1.024172370  0.916631281 -1.072321109 -1.174542630
  [6] -0.860233257  1.509981179 -0.802045304  1.479163385 -0.291353202
 [11]  0.017511968  0.417997654 -0.783149834 -0.640411749  0.612656218
 [16]  0.121643058  1.585361747 -0.061371715  0.051437669 -1.451846907
 [21] -0.404562652  0.753617437  0.154514211 -2.436867557 -0.063316081
 [26] -0.372938395  0.237260216  0.311333764  0.426822266 -0.339366110
 [31] -0.165720049  1.279335459 -1.165751469  1.764145393  0.271937651
 [36] -1.549710132 -0.808223076 -0.821370278 -0.410388455  1.636164591
 [41] -1.170722011 -1.285554583 -0.872285611 -0.316729208 -0.966382390
 [46] -0.135068111 -0.625126863  0.727694918 -1.418927271  0.012737714
 [51] -0.147939513 -0.338589397 -0.955146681  0.276337237 -1.471092563
 [56]  0.191400209 -0.249699743 -1.158121090  0.921125631  0.206192629
 [61] -1.620075628 -0.419192592  0.200752549  1.954992416  3.155900730
 [66]  0.206507617  0.465332100 -1.141673455  0.035007001 -1.059044463
 [71] -1.506414854 -0.478946332  0.059450828  0.232193708  0.622939247
 [76]  0.909533767 -1.096843292  0.206797493 -0.739160009  0.417201631
 [81]  0.484013834  0.006716657  0.783361189  0.252018866 -0.330347299
 [86] -0.140718245  0.167100287 -0.704148888  0.475005754  0.682127733
 [91]  0.374888673  0.285517039 -0.014089608  1.364641250  0.671338614
 [96]  0.700287194  1.081633572 -0.303570855  2.817236816 -0.167897381
> rowSums(tmp2)
  [1]  1.078969270  1.024172370  0.916631281 -1.072321109 -1.174542630
  [6] -0.860233257  1.509981179 -0.802045304  1.479163385 -0.291353202
 [11]  0.017511968  0.417997654 -0.783149834 -0.640411749  0.612656218
 [16]  0.121643058  1.585361747 -0.061371715  0.051437669 -1.451846907
 [21] -0.404562652  0.753617437  0.154514211 -2.436867557 -0.063316081
 [26] -0.372938395  0.237260216  0.311333764  0.426822266 -0.339366110
 [31] -0.165720049  1.279335459 -1.165751469  1.764145393  0.271937651
 [36] -1.549710132 -0.808223076 -0.821370278 -0.410388455  1.636164591
 [41] -1.170722011 -1.285554583 -0.872285611 -0.316729208 -0.966382390
 [46] -0.135068111 -0.625126863  0.727694918 -1.418927271  0.012737714
 [51] -0.147939513 -0.338589397 -0.955146681  0.276337237 -1.471092563
 [56]  0.191400209 -0.249699743 -1.158121090  0.921125631  0.206192629
 [61] -1.620075628 -0.419192592  0.200752549  1.954992416  3.155900730
 [66]  0.206507617  0.465332100 -1.141673455  0.035007001 -1.059044463
 [71] -1.506414854 -0.478946332  0.059450828  0.232193708  0.622939247
 [76]  0.909533767 -1.096843292  0.206797493 -0.739160009  0.417201631
 [81]  0.484013834  0.006716657  0.783361189  0.252018866 -0.330347299
 [86] -0.140718245  0.167100287 -0.704148888  0.475005754  0.682127733
 [91]  0.374888673  0.285517039 -0.014089608  1.364641250  0.671338614
 [96]  0.700287194  1.081633572 -0.303570855  2.817236816 -0.167897381
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.078969270  1.024172370  0.916631281 -1.072321109 -1.174542630
  [6] -0.860233257  1.509981179 -0.802045304  1.479163385 -0.291353202
 [11]  0.017511968  0.417997654 -0.783149834 -0.640411749  0.612656218
 [16]  0.121643058  1.585361747 -0.061371715  0.051437669 -1.451846907
 [21] -0.404562652  0.753617437  0.154514211 -2.436867557 -0.063316081
 [26] -0.372938395  0.237260216  0.311333764  0.426822266 -0.339366110
 [31] -0.165720049  1.279335459 -1.165751469  1.764145393  0.271937651
 [36] -1.549710132 -0.808223076 -0.821370278 -0.410388455  1.636164591
 [41] -1.170722011 -1.285554583 -0.872285611 -0.316729208 -0.966382390
 [46] -0.135068111 -0.625126863  0.727694918 -1.418927271  0.012737714
 [51] -0.147939513 -0.338589397 -0.955146681  0.276337237 -1.471092563
 [56]  0.191400209 -0.249699743 -1.158121090  0.921125631  0.206192629
 [61] -1.620075628 -0.419192592  0.200752549  1.954992416  3.155900730
 [66]  0.206507617  0.465332100 -1.141673455  0.035007001 -1.059044463
 [71] -1.506414854 -0.478946332  0.059450828  0.232193708  0.622939247
 [76]  0.909533767 -1.096843292  0.206797493 -0.739160009  0.417201631
 [81]  0.484013834  0.006716657  0.783361189  0.252018866 -0.330347299
 [86] -0.140718245  0.167100287 -0.704148888  0.475005754  0.682127733
 [91]  0.374888673  0.285517039 -0.014089608  1.364641250  0.671338614
 [96]  0.700287194  1.081633572 -0.303570855  2.817236816 -0.167897381
> rowMin(tmp2)
  [1]  1.078969270  1.024172370  0.916631281 -1.072321109 -1.174542630
  [6] -0.860233257  1.509981179 -0.802045304  1.479163385 -0.291353202
 [11]  0.017511968  0.417997654 -0.783149834 -0.640411749  0.612656218
 [16]  0.121643058  1.585361747 -0.061371715  0.051437669 -1.451846907
 [21] -0.404562652  0.753617437  0.154514211 -2.436867557 -0.063316081
 [26] -0.372938395  0.237260216  0.311333764  0.426822266 -0.339366110
 [31] -0.165720049  1.279335459 -1.165751469  1.764145393  0.271937651
 [36] -1.549710132 -0.808223076 -0.821370278 -0.410388455  1.636164591
 [41] -1.170722011 -1.285554583 -0.872285611 -0.316729208 -0.966382390
 [46] -0.135068111 -0.625126863  0.727694918 -1.418927271  0.012737714
 [51] -0.147939513 -0.338589397 -0.955146681  0.276337237 -1.471092563
 [56]  0.191400209 -0.249699743 -1.158121090  0.921125631  0.206192629
 [61] -1.620075628 -0.419192592  0.200752549  1.954992416  3.155900730
 [66]  0.206507617  0.465332100 -1.141673455  0.035007001 -1.059044463
 [71] -1.506414854 -0.478946332  0.059450828  0.232193708  0.622939247
 [76]  0.909533767 -1.096843292  0.206797493 -0.739160009  0.417201631
 [81]  0.484013834  0.006716657  0.783361189  0.252018866 -0.330347299
 [86] -0.140718245  0.167100287 -0.704148888  0.475005754  0.682127733
 [91]  0.374888673  0.285517039 -0.014089608  1.364641250  0.671338614
 [96]  0.700287194  1.081633572 -0.303570855  2.817236816 -0.167897381
> 
> colMeans(tmp2)
[1] 0.0008964379
> colSums(tmp2)
[1] 0.08964379
> colVars(tmp2)
[1] 0.9166761
> colSd(tmp2)
[1] 0.9574321
> colMax(tmp2)
[1] 3.155901
> colMin(tmp2)
[1] -2.436868
> colMedians(tmp2)
[1] 0.01512484
> colRanges(tmp2)
          [,1]
[1,] -2.436868
[2,]  3.155901
> 
> 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.47709549 -5.80477312 -2.37816008  8.60913685 -4.60859341  0.06759068
 [7] -1.29941004 -4.96434610  1.31432339  1.68887155
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5569632
[2,] -0.3714357
[3,] -0.2528812
[4,]  0.3759180
[5,]  0.5927817
> 
> rowApply(tmp,sum)
 [1]  3.7541431  2.2501152 -4.2402714 -1.8424903 -6.9640531 -2.6330094
 [7]  3.1060680 -0.7633501  0.5414019 -1.0610097
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    4    9    4    6    4    3    8    6     5
 [2,]    1    8    4    3    4    5    1    6    1     3
 [3,]    8    7    5    7    2    2    7    3    3     1
 [4,]    6   10    8    8    7   10   10   10    8     9
 [5,]    2    1    2    6    9    7    2    4    4     8
 [6,]    4    9    6    5   10    3    9    1   10     2
 [7,]    3    3    1   10    8    8    6    5    2    10
 [8,]    9    6    3    2    1    1    5    2    5     4
 [9,]    7    2    7    9    5    9    4    7    7     7
[10,]   10    5   10    1    3    6    8    9    9     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.8006381 -3.1156538  2.1375625  3.4220125 -0.3051558  2.3010519
 [7]  4.9611267 -1.4161897 -1.3920122  2.8773232  0.7348776  1.8348509
[13] -1.6354401 -0.7926676 -3.9455759  3.7718460 -3.6940557  1.4099657
[19]  1.5845939 -2.1557692
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1867829
[2,] -0.8565729
[3,] -0.7104209
[4,] -0.6695515
[5,] -0.3773100
> 
> rowApply(tmp,sum)
[1] -2.1302840  2.9791095 -0.5162424  6.5486216 -4.0991519
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    3    4    6    3    7
[2,]    8   15    3    5    1
[3,]    9   18   13   12   15
[4,]   13   16   12   19   17
[5,]    1   11    4   20   14
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]      [,4]       [,5]        [,6]
[1,] -1.1867829 -0.61575099 -0.3819414 0.4530520 -1.5549613  0.36620604
[2,] -0.8565729  0.89439582  1.0367609 0.8947493  0.3603644  0.88854172
[3,] -0.7104209 -1.20171981  0.2860665 0.2494595 -1.1146468  1.20369227
[4,] -0.6695515 -0.06882626  0.6873510 1.2295464  1.4988125  0.09208136
[5,] -0.3773100 -2.12375258  0.5093254 0.5952053  0.5052753 -0.24946946
          [,7]       [,8]       [,9]     [,10]        [,11]        [,12]
[1,] 0.4747803 -0.8008532  1.1755544 0.7089931  0.003396685  0.455729114
[2,] 1.5749839 -0.2986415 -1.3920667 0.4194690  0.084330808  0.525619806
[3,] 1.4746115 -0.1347670 -0.4538101 0.9738610  1.622090262  0.001523227
[4,] 0.4560634 -0.7266297  0.4385332 0.4240895 -2.338800937  0.905409426
[5,] 0.9806876  0.5447018 -1.1602230 0.3509107  1.363860773 -0.053430672
          [,13]       [,14]      [,15]       [,16]      [,17]      [,18]
[1,]  0.5629003  0.08818773 -1.1720043  1.32294600 -1.3008107  1.0357956
[2,]  0.9445846 -1.47686769 -0.4670648  2.38776122 -0.8527891  0.1440925
[3,] -1.9001900 -0.53666618 -2.4183793 -0.16159160 -0.7608778  1.0945986
[4,]  0.6943694  0.10739500 -0.2237203  0.16134511  0.9319895  1.0629255
[5,] -1.9371045  1.02528350  0.3355928  0.06138524 -1.7115675 -1.9274465
          [,19]      [,20]
[1,] -0.6347341 -1.1299865
[2,] -0.1202610 -1.7122808
[3,]  0.8495077  1.1214163
[4,]  1.0956687  0.7905704
[5,]  0.3944126 -1.2254887
> 
> 
> 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 :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  559  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.6798317 0.7378112 -2.467304 0.4969277 -0.402309 2.155684 -1.652942
         col8      col9     col10    col11     col12     col13      col14
row1 1.144718 -2.564575 0.6390779 1.541609 0.4878025 0.2353455 0.06179008
        col15     col16      col17      col18     col19      col20
row1 1.862484 -1.933635 -0.4028223 -0.6665062 0.4656399 -0.3678849
> tmp[,"col10"]
          col10
row1  0.6390779
row2  1.7635125
row3 -1.8124033
row4  1.1744353
row5 -0.2872774
> tmp[c("row1","row5"),]
           col1      col2       col3      col4       col5       col6       col7
row1 -0.6798317 0.7378112 -2.4673041 0.4969277 -0.4023090  2.1556843 -1.6529420
row5  3.1473883 0.7488615  0.3638003 0.5623590 -0.4056956 -0.5448667 -0.4940343
          col8       col9      col10    col11     col12     col13      col14
row1 1.1447181 -2.5645750  0.6390779 1.541609 0.4878025 0.2353455 0.06179008
row5 0.4461133  0.1847636 -0.2872774 2.015750 0.7545827 0.5863286 0.61950882
        col15     col16      col17      col18      col19      col20
row1 1.862484 -1.933635 -0.4028223 -0.6665062 0.46563987 -0.3678849
row5 0.113131  1.440835  0.5563735  0.9825117 0.09903923  0.6582724
> tmp[,c("col6","col20")]
           col6       col20
row1  2.1556843 -0.36788486
row2  0.7946526  0.84180806
row3  0.1919684 -0.02693014
row4  0.3764184  0.55524964
row5 -0.5448667  0.65827243
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  2.1556843 -0.3678849
row5 -0.5448667  0.6582724
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.80941 49.73149 49.66505 50.54481 51.76572 105.5605 49.60851 49.56442
         col9    col10    col11    col12    col13   col14    col15    col16
row1 49.64374 49.20121 51.37657 49.97456 51.13172 46.9322 48.81661 50.26219
        col17   col18    col19    col20
row1 49.39725 47.9402 48.34741 103.6764
> tmp[,"col10"]
        col10
row1 49.20121
row2 32.41489
row3 30.82969
row4 29.97279
row5 51.04704
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.80941 49.73149 49.66505 50.54481 51.76572 105.5605 49.60851 49.56442
row5 51.20789 49.68793 49.31758 49.59088 49.97494 105.4823 49.95532 50.53932
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.64374 49.20121 51.37657 49.97456 51.13172 46.93220 48.81661 50.26219
row5 51.09365 51.04704 47.95915 48.96950 50.25644 50.11659 50.28077 51.79550
        col17   col18    col19    col20
row1 49.39725 47.9402 48.34741 103.6764
row5 49.12424 50.8165 49.13268 104.8310
> tmp[,c("col6","col20")]
          col6     col20
row1 105.56051 103.67636
row2  73.55167  75.43622
row3  73.34370  73.22461
row4  74.38090  75.04920
row5 105.48230 104.83099
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.5605 103.6764
row5 105.4823 104.8310
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.5605 103.6764
row5 105.4823 104.8310
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.5890813
[2,]  0.2344832
[3,] -0.8049236
[4,]  1.7110926
[5,] -0.1200574
> tmp[,c("col17","col7")]
          col17        col7
[1,]  1.5474859  1.16881842
[2,] -1.5716895  0.65646174
[3,] -0.4996638  1.64717800
[4,] -0.6004760  0.91519079
[5,] -0.3705608 -0.07074425
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,]  1.74950242 -0.69447289
[2,]  0.04324524 -0.09873394
[3,] -0.47863052  1.28764743
[4,]  0.34075108  1.05462568
[5,] -1.31419513 -1.41773851
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.749502
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] 1.74950242
[2,] 0.04324524
> 
> 
> 
> 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.9449842745 -0.2995303 -0.31642175 0.1797161 0.184861 0.9962404 3.133284
row1  0.0006616044  0.1327245 -0.01379417 0.2540239 1.730395 0.2939690 1.166923
          [,8]       [,9]      [,10]     [,11]      [,12]     [,13]     [,14]
row3 0.3830815 -0.7257851  0.1002805 -1.684042  0.9430979  1.402441 0.4092999
row1 0.9299910  0.1618153 -0.3419574  1.302514 -0.6009165 -1.184326 2.9608308
         [,15]     [,16]     [,17]      [,18]      [,19]      [,20]
row3 0.0719587 -1.585231 1.1399083 -0.4269127  1.4010948 0.06354949
row1 0.5138512 -1.229380 0.2721563  0.2253244 -0.4740252 1.27473492
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]     [,2]      [,3]      [,4]      [,5]     [,6]      [,7]
row2 1.843411 1.460503 -1.636092 0.1052209 0.4157919 1.378133 0.2922931
          [,8]       [,9]    [,10]
row2 -2.005656 -0.8410026 1.786399
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]      [,3]       [,4]      [,5]       [,6]       [,7]
row5 1.835598 0.2023996 0.5435394 -0.4065458 0.3122503 -0.6804478 -0.3991666
           [,8]         [,9]     [,10]     [,11]    [,12]     [,13]    [,14]
row5 -0.6091442 -0.006163035 0.9952835 0.5647492 1.472934 -1.160567 2.329168
         [,15]     [,16]    [,17]     [,18]      [,19]      [,20]
row5 0.4755681 -0.176416 1.460012 0.2690806 -0.2943364 -0.1912999
> 
> 
> 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: 0x58f126ec6f20>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b663f0ad8c"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b6f841321" 
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b65d45558a"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b65e3821c7"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b674c12020"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b67167b2d6"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b644214097"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b67cfd3559"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b65821d2c5"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b61de8d8bc"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b66bfc9fe0"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b623ac25de"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b626812dd0"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b6221a402c"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM989b6475158d7"
> 
> 
> ### 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: 0x58f12626c590>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x58f12626c590>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x58f12626c590>
> rowMedians(tmp)
  [1] -0.3609099112 -0.0337439595  0.2978222856  0.1170558539 -0.3693137129
  [6] -0.2565673738 -1.0069113610 -0.7058289380  0.2849150678  0.2124687167
 [11] -0.2265406026  0.4875231638 -0.0792004454  0.5164708891  0.0199515663
 [16]  0.4643912667  0.3326482051  0.4077136797  0.0324930507 -0.1465045800
 [21] -0.4551985396  0.5258146583 -0.1270171276  0.0532918410  0.7459178456
 [26] -0.3114071920 -0.4049999344 -0.2701446024  0.3646549428  0.0705429973
 [31]  0.3528494205  0.5708427052 -0.1422101365 -0.0119632714 -0.5814201140
 [36] -0.2701661041 -0.2572632146 -0.4072332874 -0.0938265049 -0.4254094116
 [41] -0.3428352572 -0.4033215081  0.0438486530 -0.4105565585 -0.5021043042
 [46] -0.5227729336  0.5325813174 -0.3295811829  0.2674977624  0.2704603063
 [51]  0.4146452954 -0.2560076683 -0.0903220967  0.2704319623 -0.5722821171
 [56] -0.3398610860  0.1179963059 -0.0050245482 -0.5729427667  0.1350019171
 [61] -0.2930100207 -0.0113440248  0.7343566233 -0.2035107847 -0.2021817835
 [66]  0.2169086236  0.2264823099 -0.5530584874 -0.1819797870  0.3981512352
 [71] -0.8173936399  0.0518915006 -0.2287115571  0.0631910548  0.1188361989
 [76]  0.2561737106  0.1163119624  0.0635341801  0.2618737448 -0.1658804075
 [81] -0.3211075263  0.2780369204 -0.3051016321 -0.1058006778 -0.0258018831
 [86] -0.5941105297  0.1645773040 -0.5100977384  0.1603919543 -0.3567824556
 [91] -0.0337684788  0.6028010586  0.6624869745 -0.4551780486 -0.5402033319
 [96]  0.3141454300  0.2028909846 -0.0684980264  0.0517161825  0.1195163485
[101] -0.0647983003 -0.2215580106  0.4025328355 -0.8946081767  0.2002396804
[106]  0.6784967261 -0.1990044381 -0.2998079190  0.3443257394 -0.2893433011
[111] -0.6328615683 -0.0257975521 -0.3948298356 -0.0933491291  0.0414941184
[116] -0.0672365352 -0.2493523019 -0.2744946410  0.0249831109 -0.8077988107
[121]  0.2449294766  0.0656736654  0.0227586656  0.0706678654 -0.5739548903
[126] -0.0647622224  0.3140097066 -0.5942563414  0.1552122350  0.1714062147
[131]  0.0770406296  0.1483338736  0.5600684615  0.1863641463  0.0423229589
[136] -0.2575704927  0.1104495084  0.3719943334 -0.0543971401  0.2538948917
[141] -0.0829508199  0.1360388598 -0.0411222545 -0.0831697167 -0.2349698572
[146] -0.0973970654 -0.2757215540  0.5843628791 -0.0521620540 -0.1274227695
[151]  0.1315943044 -0.1134708515 -0.6692863556  0.2699620934  0.3755830788
[156] -0.0006221325 -0.3916688748  0.1973366824 -0.0863904695 -0.7150075819
[161]  0.2355639539 -0.4204110857  0.0646691327 -0.2233863368  0.0083413230
[166]  0.0274767811 -0.2940353751  0.0895900547 -0.5351700216  0.2068976917
[171] -0.0300367655 -0.1843699394  0.3573142018  0.0350469219 -0.3724193268
[176] -0.4398842117 -0.3390223639  0.1476192663 -0.1823023992  0.4161045774
[181]  0.3276325104  0.3081994706  0.2192162922  0.0383247040 -0.0607808077
[186] -0.1130195980 -0.3348625715 -0.4949389553  0.6616712326 -0.4660289845
[191] -0.1780149280 -0.1023674857 -0.5729267821 -0.3443731866 -0.2311779642
[196] -0.3762014075  0.7434864088  0.1554210268 -0.3769321399 -0.5151407311
[201] -0.2014132751 -0.2989350555  0.1023069742 -0.1956866857 -0.1278108019
[206] -0.0605221332  0.1179018427 -0.1005354327  0.3578786683  0.1431595018
[211] -0.0927496801  0.0599204950  0.4052862475 -0.0110017714 -0.3408477805
[216]  0.5525887727 -0.2887045469 -0.2664475865 -0.3572204742  0.1300545335
[221] -0.1485353726 -0.1801110601 -0.1578721429  0.0504920045  0.1748592715
[226] -0.2887727023 -0.1317226969  0.2754690414 -0.2577232808 -0.0525704383
> 
> proc.time()
   user  system elapsed 
  1.266   0.636   1.891 

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: 0x56a41e1411c0>
> .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: 0x56a41e1411c0>
> .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: 0x56a41e1411c0>
> .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: 0x56a41e1411c0>
> 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: 0x56a41e424120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56a41e424120>
> .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: 0x56a41e424120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56a41e424120>
> .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: 0x56a41e424120>
> 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: 0x56a41d0d84a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56a41d0d84a0>
> .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: 0x56a41d0d84a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x56a41d0d84a0>
> .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: 0x56a41d0d84a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x56a41d0d84a0>
> .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: 0x56a41d0d84a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x56a41d0d84a0>
> .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: 0x56a41d0d84a0>
> 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: 0x56a41d174390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x56a41d174390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56a41d174390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56a41d174390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile98afb5c728306" "BufferedMatrixFile98afb7f22796f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile98afb5c728306" "BufferedMatrixFile98afb7f22796f"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x56a41d9f3650>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56a41d9f3650>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x56a41d9f3650>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x56a41d9f3650>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x56a41d9f3650>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x56a41d9f3650>
> .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: 0x56a41eb7a430>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56a41eb7a430>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x56a41eb7a430>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x56a41eb7a430>
> 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: 0x56a41ee6f250>
> .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: 0x56a41ee6f250>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.256   0.046   0.290 

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.238   0.048   0.273 

Example timings