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

This page was generated on 2026-02-28 11:57 -0500 (Sat, 28 Feb 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4891
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-02-27 13:45 -0500 (Fri, 27 Feb 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-02-27 21:46:39 -0500 (Fri, 27 Feb 2026)
EndedAt: 2026-02-27 21:47:03 -0500 (Fri, 27 Feb 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

Status: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.256   0.036   0.279 

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 Feb 27 21:46:54 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 Feb 27 21:46:54 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: 0x5a7474829370>
> 
> 
> 
> 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 Feb 27 21:46:55 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 Feb 27 21:46:55 2026"
> 
> ColMode(tmp2)
<pointer: 0x5a7474829370>
> 
> 
> 
> ### 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.94646714 -2.5570710 -1.0291915  1.3402579
[2,]  0.56766265  1.1309035  0.1072498 -0.4512304
[3,] -0.92684604 -1.3679435 -0.9402112  1.2760367
[4,]  0.01885973 -0.4533707 -0.5912261  1.0755011
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 98.94646714 2.5570710 1.0291915 1.3402579
[2,]  0.56766265 1.1309035 0.1072498 0.4512304
[3,]  0.92684604 1.3679435 0.9402112 1.2760367
[4,]  0.01885973 0.4533707 0.5912261 1.0755011
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]      [,3]      [,4]
[1,] 9.9471839 1.599084 1.0144907 1.1576951
[2,] 0.7534339 1.063439 0.3274901 0.6717369
[3,] 0.9627284 1.169591 0.9696449 1.1296180
[4,] 0.1373307 0.673328 0.7689123 1.0370637
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.41831 43.54792 36.17410 37.91721
[2,]  33.10200 36.76530 28.38215 32.16860
[3,]  35.55413 38.06386 35.63666 37.57222
[4,]  26.39217 32.18665 33.28035 36.44614
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5a74758259b0>
> exp(tmp5)
<pointer: 0x5a74758259b0>
> log(tmp5,2)
<pointer: 0x5a74758259b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.0159
> Min(tmp5)
[1] 53.93735
> mean(tmp5)
[1] 72.63479
> Sum(tmp5)
[1] 14526.96
> Var(tmp5)
[1] 846.6182
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.74693 70.60721 69.67674 69.76400 72.37864 71.00433 70.27500 68.71429
 [9] 71.53797 70.64284
> rowSums(tmp5)
 [1] 1834.939 1412.144 1393.535 1395.280 1447.573 1420.087 1405.500 1374.286
 [9] 1430.759 1412.857
> rowVars(tmp5)
 [1] 7805.33106   67.38415   72.20997   47.85148   52.05264   68.23065
 [7]   94.44699   78.73091   65.34513   78.56503
> rowSd(tmp5)
 [1] 88.347785  8.208785  8.497645  6.917477  7.214752  8.260185  9.718384
 [8]  8.873044  8.083633  8.863692
> rowMax(tmp5)
 [1] 465.01593  86.12372  89.09827  80.55850  89.84984  85.22680  91.39037
 [8]  89.07495  87.82744  88.94394
> rowMin(tmp5)
 [1] 57.42254 58.97231 57.77154 54.93184 58.84999 58.66686 55.17759 56.37612
 [9] 61.35022 53.93735
> 
> colMeans(tmp5)
 [1] 109.38904  72.78300  71.46567  74.42178  73.10344  68.01596  68.67709
 [8]  73.82796  71.73673  70.25202  68.62695  68.71344  73.49943  68.37758
[15]  70.12333  71.51517  72.14498  70.11445  70.04049  65.86737
> colSums(tmp5)
 [1] 1093.8904  727.8300  714.6567  744.2178  731.0344  680.1596  686.7709
 [8]  738.2796  717.3673  702.5202  686.2695  687.1344  734.9943  683.7758
[15]  701.2333  715.1517  721.4498  701.1445  700.4049  658.6737
> colVars(tmp5)
 [1] 15678.29164    94.09892    55.87015   110.12705    80.76275    34.18202
 [7]    96.72936    61.83663    69.99453    64.73585    62.41108    48.95746
[13]    86.79876    46.54192   150.21864    45.79741    69.25135    32.48132
[19]    75.46982    68.91868
> colSd(tmp5)
 [1] 125.212985   9.700460   7.474634  10.494144   8.986810   5.846539
 [7]   9.835109   7.863627   8.366273   8.045859   7.900068   6.996961
[13]   9.316585   6.822164  12.256371   6.767378   8.321739   5.699239
[19]   8.687337   8.301728
> colMax(tmp5)
 [1] 465.01593  90.63928  82.20696  89.07495  89.84984  76.73728  87.82744
 [8]  86.12372  83.00201  87.74877  79.16393  81.43992  89.09827  79.50576
[15]  91.39037  83.74811  88.94394  81.29354  89.64578  77.60473
> colMin(tmp5)
 [1] 54.93184 58.66686 59.07373 55.17759 62.03446 59.49681 57.42254 59.90364
 [9] 57.88467 61.80609 57.77154 62.10918 59.58540 58.97231 57.97628 65.18422
[17] 62.06139 62.59684 60.23069 53.93735
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.74693 70.60721 69.67674 69.76400 72.37864 71.00433 70.27500       NA
 [9] 71.53797 70.64284
> rowSums(tmp5)
 [1] 1834.939 1412.144 1393.535 1395.280 1447.573 1420.087 1405.500       NA
 [9] 1430.759 1412.857
> rowVars(tmp5)
 [1] 7805.33106   67.38415   72.20997   47.85148   52.05264   68.23065
 [7]   94.44699   81.42833   65.34513   78.56503
> rowSd(tmp5)
 [1] 88.347785  8.208785  8.497645  6.917477  7.214752  8.260185  9.718384
 [8]  9.023765  8.083633  8.863692
> rowMax(tmp5)
 [1] 465.01593  86.12372  89.09827  80.55850  89.84984  85.22680  91.39037
 [8]        NA  87.82744  88.94394
> rowMin(tmp5)
 [1] 57.42254 58.97231 57.77154 54.93184 58.84999 58.66686 55.17759       NA
 [9] 61.35022 53.93735
> 
> colMeans(tmp5)
 [1] 109.38904  72.78300  71.46567  74.42178  73.10344  68.01596  68.67709
 [8]  73.82796  71.73673        NA  68.62695  68.71344  73.49943  68.37758
[15]  70.12333  71.51517  72.14498  70.11445  70.04049  65.86737
> colSums(tmp5)
 [1] 1093.8904  727.8300  714.6567  744.2178  731.0344  680.1596  686.7709
 [8]  738.2796  717.3673        NA  686.2695  687.1344  734.9943  683.7758
[15]  701.2333  715.1517  721.4498  701.1445  700.4049  658.6737
> colVars(tmp5)
 [1] 15678.29164    94.09892    55.87015   110.12705    80.76275    34.18202
 [7]    96.72936    61.83663    69.99453          NA    62.41108    48.95746
[13]    86.79876    46.54192   150.21864    45.79741    69.25135    32.48132
[19]    75.46982    68.91868
> colSd(tmp5)
 [1] 125.212985   9.700460   7.474634  10.494144   8.986810   5.846539
 [7]   9.835109   7.863627   8.366273         NA   7.900068   6.996961
[13]   9.316585   6.822164  12.256371   6.767378   8.321739   5.699239
[19]   8.687337   8.301728
> colMax(tmp5)
 [1] 465.01593  90.63928  82.20696  89.07495  89.84984  76.73728  87.82744
 [8]  86.12372  83.00201        NA  79.16393  81.43992  89.09827  79.50576
[15]  91.39037  83.74811  88.94394  81.29354  89.64578  77.60473
> colMin(tmp5)
 [1] 54.93184 58.66686 59.07373 55.17759 62.03446 59.49681 57.42254 59.90364
 [9] 57.88467       NA 57.77154 62.10918 59.58540 58.97231 57.97628 65.18422
[17] 62.06139 62.59684 60.23069 53.93735
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.0159
> Min(tmp5,na.rm=TRUE)
[1] 53.93735
> mean(tmp5,na.rm=TRUE)
[1] 72.6814
> Sum(tmp5,na.rm=TRUE)
[1] 14463.6
> Var(tmp5,na.rm=TRUE)
[1] 850.4574
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.74693 70.60721 69.67674 69.76400 72.37864 71.00433 70.27500 68.99609
 [9] 71.53797 70.64284
> rowSums(tmp5,na.rm=TRUE)
 [1] 1834.939 1412.144 1393.535 1395.280 1447.573 1420.087 1405.500 1310.926
 [9] 1430.759 1412.857
> rowVars(tmp5,na.rm=TRUE)
 [1] 7805.33106   67.38415   72.20997   47.85148   52.05264   68.23065
 [7]   94.44699   81.42833   65.34513   78.56503
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.347785  8.208785  8.497645  6.917477  7.214752  8.260185  9.718384
 [8]  9.023765  8.083633  8.863692
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.01593  86.12372  89.09827  80.55850  89.84984  85.22680  91.39037
 [8]  89.07495  87.82744  88.94394
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.42254 58.97231 57.77154 54.93184 58.84999 58.66686 55.17759 56.37612
 [9] 61.35022 53.93735
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.38904  72.78300  71.46567  74.42178  73.10344  68.01596  68.67709
 [8]  73.82796  71.73673  71.01780  68.62695  68.71344  73.49943  68.37758
[15]  70.12333  71.51517  72.14498  70.11445  70.04049  65.86737
> colSums(tmp5,na.rm=TRUE)
 [1] 1093.8904  727.8300  714.6567  744.2178  731.0344  680.1596  686.7709
 [8]  738.2796  717.3673  639.1602  686.2695  687.1344  734.9943  683.7758
[15]  701.2333  715.1517  721.4498  701.1445  700.4049  658.6737
> colVars(tmp5,na.rm=TRUE)
 [1] 15678.29164    94.09892    55.87015   110.12705    80.76275    34.18202
 [7]    96.72936    61.83663    69.99453    66.23058    62.41108    48.95746
[13]    86.79876    46.54192   150.21864    45.79741    69.25135    32.48132
[19]    75.46982    68.91868
> colSd(tmp5,na.rm=TRUE)
 [1] 125.212985   9.700460   7.474634  10.494144   8.986810   5.846539
 [7]   9.835109   7.863627   8.366273   8.138217   7.900068   6.996961
[13]   9.316585   6.822164  12.256371   6.767378   8.321739   5.699239
[19]   8.687337   8.301728
> colMax(tmp5,na.rm=TRUE)
 [1] 465.01593  90.63928  82.20696  89.07495  89.84984  76.73728  87.82744
 [8]  86.12372  83.00201  87.74877  79.16393  81.43992  89.09827  79.50576
[15]  91.39037  83.74811  88.94394  81.29354  89.64578  77.60473
> colMin(tmp5,na.rm=TRUE)
 [1] 54.93184 58.66686 59.07373 55.17759 62.03446 59.49681 57.42254 59.90364
 [9] 57.88467 61.80609 57.77154 62.10918 59.58540 58.97231 57.97628 65.18422
[17] 62.06139 62.59684 60.23069 53.93735
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.74693 70.60721 69.67674 69.76400 72.37864 71.00433 70.27500      NaN
 [9] 71.53797 70.64284
> rowSums(tmp5,na.rm=TRUE)
 [1] 1834.939 1412.144 1393.535 1395.280 1447.573 1420.087 1405.500    0.000
 [9] 1430.759 1412.857
> rowVars(tmp5,na.rm=TRUE)
 [1] 7805.33106   67.38415   72.20997   47.85148   52.05264   68.23065
 [7]   94.44699         NA   65.34513   78.56503
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.347785  8.208785  8.497645  6.917477  7.214752  8.260185  9.718384
 [8]        NA  8.083633  8.863692
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.01593  86.12372  89.09827  80.55850  89.84984  85.22680  91.39037
 [8]        NA  87.82744  88.94394
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.42254 58.97231 57.77154 54.93184 58.84999 58.66686 55.17759       NA
 [9] 61.35022 53.93735
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.45102  73.23045  72.38009  72.79365  74.33333  67.88849  69.52680
 [8]  75.08415  71.43308       NaN  69.21853  69.44285  74.80487  67.14112
[15]  71.03135  70.15595  71.57214  69.54000  69.44048  66.92196
> colSums(tmp5,na.rm=TRUE)
 [1] 1030.0592  659.0740  651.4209  655.1428  669.0000  610.9964  625.7412
 [8]  675.7574  642.8977    0.0000  622.9668  624.9857  673.2439  604.2701
[15]  639.2821  631.4036  644.1493  625.8600  624.9643  602.2976
> colVars(tmp5,na.rm=TRUE)
 [1] 17349.81171   103.60895    53.44693    94.07133    73.84109    38.27197
 [7]   100.69783    51.81346    77.70653          NA    66.27541    49.09173
[13]    78.47658    35.16017   159.72029    30.73808    74.21621    32.82910
[19]    80.85342    65.02187
> colSd(tmp5,na.rm=TRUE)
 [1] 131.718684  10.178848   7.310741   9.699038   8.593084   6.186435
 [7]  10.034831   7.198157   8.815131         NA   8.140971   7.006549
[13]   8.858701   5.929602  12.638049   5.544193   8.614883   5.729669
[19]   8.991853   8.063614
> colMax(tmp5,na.rm=TRUE)
 [1] 465.01593  90.63928  82.20696  85.22680  89.84984  76.73728  87.82744
 [8]  86.12372  83.00201      -Inf  79.16393  81.43992  89.09827  77.21439
[15]  91.39037  80.55850  88.94394  81.29354  89.64578  77.60473
> colMin(tmp5,na.rm=TRUE)
 [1] 54.93184 58.66686 59.07373 55.17759 62.29798 59.49681 57.42254 59.90364
 [9] 57.88467      Inf 57.77154 62.10918 59.58540 58.97231 57.97628 65.18422
[17] 62.06139 62.59684 60.23069 53.93735
> 
> 
> 
> 
> 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] 214.62035 274.67829 252.11450 259.08816 277.51850 250.29012  70.33441
 [8] 176.67983 176.10585 152.09552
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 214.62035 274.67829 252.11450 259.08816 277.51850 250.29012  70.33441
 [8] 176.67983 176.10585 152.09552
> 
> 
> 
> 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]  5.684342e-14  2.131628e-14 -1.136868e-13  1.136868e-13  0.000000e+00
 [6]  1.421085e-14  8.526513e-14  1.136868e-13 -4.263256e-14 -1.705303e-13
[11] -8.526513e-14  1.136868e-13 -5.684342e-14 -1.421085e-14  2.273737e-13
[16]  0.000000e+00  1.705303e-13 -2.842171e-13 -8.526513e-14  7.105427e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   6 
6   16 
4   14 
9   4 
3   9 
8   5 
8   17 
7   3 
2   3 
3   12 
8   5 
8   14 
10   4 
10   10 
10   6 
3   1 
10   10 
4   1 
3   13 
10   4 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.488608
> Min(tmp)
[1] -2.392832
> mean(tmp)
[1] -0.2279927
> Sum(tmp)
[1] -22.79927
> Var(tmp)
[1] 0.9178453
> 
> rowMeans(tmp)
[1] -0.2279927
> rowSums(tmp)
[1] -22.79927
> rowVars(tmp)
[1] 0.9178453
> rowSd(tmp)
[1] 0.9580424
> rowMax(tmp)
[1] 2.488608
> rowMin(tmp)
[1] -2.392832
> 
> colMeans(tmp)
  [1] -0.62383853  1.02142147 -1.41283965 -0.29877534 -1.28791003  1.24256555
  [7]  0.10750991 -0.94369588  0.91433246 -0.56120501 -0.20256064 -1.50736360
 [13]  0.62708704  0.25563442 -1.15366450 -0.40588468  0.23630089  0.58789102
 [19]  1.74737798 -1.39187561  0.73588578 -1.17243291 -1.66053919  0.54135884
 [25] -1.40998388  0.41293444 -0.65871304 -0.33665834  0.55481231 -1.16015125
 [31]  0.26492342  0.23353800  0.23194883 -0.42836382 -0.80321911  0.55502080
 [37]  0.84934630 -0.35401591  0.65838068  1.75983138 -0.82063857  0.12984604
 [43]  0.05658894 -0.49153393 -0.07136706 -0.16067754  0.48706627 -1.69755154
 [49]  0.69524066 -0.64200646 -0.37055476 -0.97010050  2.48860762 -0.10583486
 [55] -1.94144976 -1.25028525 -0.98211624 -0.85579679 -1.22624701 -1.48557817
 [61] -0.92110449 -0.27926288 -0.18650164 -1.06973032  0.20500010  1.94949887
 [67] -0.21794548 -0.40241666 -0.53483079 -0.55495524  0.85698521  1.34719837
 [73] -0.44602803 -0.99804897 -0.76692843 -0.44085171 -2.39283227 -1.47381202
 [79] -1.93236182 -1.31581919  0.65039590  0.04909101  0.51122820  0.21091881
 [85] -0.53034903 -0.02457792 -0.24550093 -0.65403898 -0.17224123  1.18738172
 [91]  0.22622025 -0.96987861 -0.48278220 -2.06838285  0.28240660  0.90026007
 [97]  1.45094113  1.21447867 -1.42824149  0.11812879
> colSums(tmp)
  [1] -0.62383853  1.02142147 -1.41283965 -0.29877534 -1.28791003  1.24256555
  [7]  0.10750991 -0.94369588  0.91433246 -0.56120501 -0.20256064 -1.50736360
 [13]  0.62708704  0.25563442 -1.15366450 -0.40588468  0.23630089  0.58789102
 [19]  1.74737798 -1.39187561  0.73588578 -1.17243291 -1.66053919  0.54135884
 [25] -1.40998388  0.41293444 -0.65871304 -0.33665834  0.55481231 -1.16015125
 [31]  0.26492342  0.23353800  0.23194883 -0.42836382 -0.80321911  0.55502080
 [37]  0.84934630 -0.35401591  0.65838068  1.75983138 -0.82063857  0.12984604
 [43]  0.05658894 -0.49153393 -0.07136706 -0.16067754  0.48706627 -1.69755154
 [49]  0.69524066 -0.64200646 -0.37055476 -0.97010050  2.48860762 -0.10583486
 [55] -1.94144976 -1.25028525 -0.98211624 -0.85579679 -1.22624701 -1.48557817
 [61] -0.92110449 -0.27926288 -0.18650164 -1.06973032  0.20500010  1.94949887
 [67] -0.21794548 -0.40241666 -0.53483079 -0.55495524  0.85698521  1.34719837
 [73] -0.44602803 -0.99804897 -0.76692843 -0.44085171 -2.39283227 -1.47381202
 [79] -1.93236182 -1.31581919  0.65039590  0.04909101  0.51122820  0.21091881
 [85] -0.53034903 -0.02457792 -0.24550093 -0.65403898 -0.17224123  1.18738172
 [91]  0.22622025 -0.96987861 -0.48278220 -2.06838285  0.28240660  0.90026007
 [97]  1.45094113  1.21447867 -1.42824149  0.11812879
> 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.62383853  1.02142147 -1.41283965 -0.29877534 -1.28791003  1.24256555
  [7]  0.10750991 -0.94369588  0.91433246 -0.56120501 -0.20256064 -1.50736360
 [13]  0.62708704  0.25563442 -1.15366450 -0.40588468  0.23630089  0.58789102
 [19]  1.74737798 -1.39187561  0.73588578 -1.17243291 -1.66053919  0.54135884
 [25] -1.40998388  0.41293444 -0.65871304 -0.33665834  0.55481231 -1.16015125
 [31]  0.26492342  0.23353800  0.23194883 -0.42836382 -0.80321911  0.55502080
 [37]  0.84934630 -0.35401591  0.65838068  1.75983138 -0.82063857  0.12984604
 [43]  0.05658894 -0.49153393 -0.07136706 -0.16067754  0.48706627 -1.69755154
 [49]  0.69524066 -0.64200646 -0.37055476 -0.97010050  2.48860762 -0.10583486
 [55] -1.94144976 -1.25028525 -0.98211624 -0.85579679 -1.22624701 -1.48557817
 [61] -0.92110449 -0.27926288 -0.18650164 -1.06973032  0.20500010  1.94949887
 [67] -0.21794548 -0.40241666 -0.53483079 -0.55495524  0.85698521  1.34719837
 [73] -0.44602803 -0.99804897 -0.76692843 -0.44085171 -2.39283227 -1.47381202
 [79] -1.93236182 -1.31581919  0.65039590  0.04909101  0.51122820  0.21091881
 [85] -0.53034903 -0.02457792 -0.24550093 -0.65403898 -0.17224123  1.18738172
 [91]  0.22622025 -0.96987861 -0.48278220 -2.06838285  0.28240660  0.90026007
 [97]  1.45094113  1.21447867 -1.42824149  0.11812879
> colMin(tmp)
  [1] -0.62383853  1.02142147 -1.41283965 -0.29877534 -1.28791003  1.24256555
  [7]  0.10750991 -0.94369588  0.91433246 -0.56120501 -0.20256064 -1.50736360
 [13]  0.62708704  0.25563442 -1.15366450 -0.40588468  0.23630089  0.58789102
 [19]  1.74737798 -1.39187561  0.73588578 -1.17243291 -1.66053919  0.54135884
 [25] -1.40998388  0.41293444 -0.65871304 -0.33665834  0.55481231 -1.16015125
 [31]  0.26492342  0.23353800  0.23194883 -0.42836382 -0.80321911  0.55502080
 [37]  0.84934630 -0.35401591  0.65838068  1.75983138 -0.82063857  0.12984604
 [43]  0.05658894 -0.49153393 -0.07136706 -0.16067754  0.48706627 -1.69755154
 [49]  0.69524066 -0.64200646 -0.37055476 -0.97010050  2.48860762 -0.10583486
 [55] -1.94144976 -1.25028525 -0.98211624 -0.85579679 -1.22624701 -1.48557817
 [61] -0.92110449 -0.27926288 -0.18650164 -1.06973032  0.20500010  1.94949887
 [67] -0.21794548 -0.40241666 -0.53483079 -0.55495524  0.85698521  1.34719837
 [73] -0.44602803 -0.99804897 -0.76692843 -0.44085171 -2.39283227 -1.47381202
 [79] -1.93236182 -1.31581919  0.65039590  0.04909101  0.51122820  0.21091881
 [85] -0.53034903 -0.02457792 -0.24550093 -0.65403898 -0.17224123  1.18738172
 [91]  0.22622025 -0.96987861 -0.48278220 -2.06838285  0.28240660  0.90026007
 [97]  1.45094113  1.21447867 -1.42824149  0.11812879
> colMedians(tmp)
  [1] -0.62383853  1.02142147 -1.41283965 -0.29877534 -1.28791003  1.24256555
  [7]  0.10750991 -0.94369588  0.91433246 -0.56120501 -0.20256064 -1.50736360
 [13]  0.62708704  0.25563442 -1.15366450 -0.40588468  0.23630089  0.58789102
 [19]  1.74737798 -1.39187561  0.73588578 -1.17243291 -1.66053919  0.54135884
 [25] -1.40998388  0.41293444 -0.65871304 -0.33665834  0.55481231 -1.16015125
 [31]  0.26492342  0.23353800  0.23194883 -0.42836382 -0.80321911  0.55502080
 [37]  0.84934630 -0.35401591  0.65838068  1.75983138 -0.82063857  0.12984604
 [43]  0.05658894 -0.49153393 -0.07136706 -0.16067754  0.48706627 -1.69755154
 [49]  0.69524066 -0.64200646 -0.37055476 -0.97010050  2.48860762 -0.10583486
 [55] -1.94144976 -1.25028525 -0.98211624 -0.85579679 -1.22624701 -1.48557817
 [61] -0.92110449 -0.27926288 -0.18650164 -1.06973032  0.20500010  1.94949887
 [67] -0.21794548 -0.40241666 -0.53483079 -0.55495524  0.85698521  1.34719837
 [73] -0.44602803 -0.99804897 -0.76692843 -0.44085171 -2.39283227 -1.47381202
 [79] -1.93236182 -1.31581919  0.65039590  0.04909101  0.51122820  0.21091881
 [85] -0.53034903 -0.02457792 -0.24550093 -0.65403898 -0.17224123  1.18738172
 [91]  0.22622025 -0.96987861 -0.48278220 -2.06838285  0.28240660  0.90026007
 [97]  1.45094113  1.21447867 -1.42824149  0.11812879
> colRanges(tmp)
           [,1]     [,2]     [,3]       [,4]     [,5]     [,6]      [,7]
[1,] -0.6238385 1.021421 -1.41284 -0.2987753 -1.28791 1.242566 0.1075099
[2,] -0.6238385 1.021421 -1.41284 -0.2987753 -1.28791 1.242566 0.1075099
           [,8]      [,9]     [,10]      [,11]     [,12]    [,13]     [,14]
[1,] -0.9436959 0.9143325 -0.561205 -0.2025606 -1.507364 0.627087 0.2556344
[2,] -0.9436959 0.9143325 -0.561205 -0.2025606 -1.507364 0.627087 0.2556344
         [,15]      [,16]     [,17]    [,18]    [,19]     [,20]     [,21]
[1,] -1.153664 -0.4058847 0.2363009 0.587891 1.747378 -1.391876 0.7358858
[2,] -1.153664 -0.4058847 0.2363009 0.587891 1.747378 -1.391876 0.7358858
         [,22]     [,23]     [,24]     [,25]     [,26]     [,27]      [,28]
[1,] -1.172433 -1.660539 0.5413588 -1.409984 0.4129344 -0.658713 -0.3366583
[2,] -1.172433 -1.660539 0.5413588 -1.409984 0.4129344 -0.658713 -0.3366583
         [,29]     [,30]     [,31]    [,32]     [,33]      [,34]      [,35]
[1,] 0.5548123 -1.160151 0.2649234 0.233538 0.2319488 -0.4283638 -0.8032191
[2,] 0.5548123 -1.160151 0.2649234 0.233538 0.2319488 -0.4283638 -0.8032191
         [,36]     [,37]      [,38]     [,39]    [,40]      [,41]    [,42]
[1,] 0.5550208 0.8493463 -0.3540159 0.6583807 1.759831 -0.8206386 0.129846
[2,] 0.5550208 0.8493463 -0.3540159 0.6583807 1.759831 -0.8206386 0.129846
          [,43]      [,44]       [,45]      [,46]     [,47]     [,48]     [,49]
[1,] 0.05658894 -0.4915339 -0.07136706 -0.1606775 0.4870663 -1.697552 0.6952407
[2,] 0.05658894 -0.4915339 -0.07136706 -0.1606775 0.4870663 -1.697552 0.6952407
          [,50]      [,51]      [,52]    [,53]      [,54]    [,55]     [,56]
[1,] -0.6420065 -0.3705548 -0.9701005 2.488608 -0.1058349 -1.94145 -1.250285
[2,] -0.6420065 -0.3705548 -0.9701005 2.488608 -0.1058349 -1.94145 -1.250285
          [,57]      [,58]     [,59]     [,60]      [,61]      [,62]      [,63]
[1,] -0.9821162 -0.8557968 -1.226247 -1.485578 -0.9211045 -0.2792629 -0.1865016
[2,] -0.9821162 -0.8557968 -1.226247 -1.485578 -0.9211045 -0.2792629 -0.1865016
        [,64]     [,65]    [,66]      [,67]      [,68]      [,69]      [,70]
[1,] -1.06973 0.2050001 1.949499 -0.2179455 -0.4024167 -0.5348308 -0.5549552
[2,] -1.06973 0.2050001 1.949499 -0.2179455 -0.4024167 -0.5348308 -0.5549552
         [,71]    [,72]     [,73]     [,74]      [,75]      [,76]     [,77]
[1,] 0.8569852 1.347198 -0.446028 -0.998049 -0.7669284 -0.4408517 -2.392832
[2,] 0.8569852 1.347198 -0.446028 -0.998049 -0.7669284 -0.4408517 -2.392832
         [,78]     [,79]     [,80]     [,81]      [,82]     [,83]     [,84]
[1,] -1.473812 -1.932362 -1.315819 0.6503959 0.04909101 0.5112282 0.2109188
[2,] -1.473812 -1.932362 -1.315819 0.6503959 0.04909101 0.5112282 0.2109188
         [,85]       [,86]      [,87]     [,88]      [,89]    [,90]     [,91]
[1,] -0.530349 -0.02457792 -0.2455009 -0.654039 -0.1722412 1.187382 0.2262203
[2,] -0.530349 -0.02457792 -0.2455009 -0.654039 -0.1722412 1.187382 0.2262203
          [,92]      [,93]     [,94]     [,95]     [,96]    [,97]    [,98]
[1,] -0.9698786 -0.4827822 -2.068383 0.2824066 0.9002601 1.450941 1.214479
[2,] -0.9698786 -0.4827822 -2.068383 0.2824066 0.9002601 1.450941 1.214479
         [,99]    [,100]
[1,] -1.428241 0.1181288
[2,] -1.428241 0.1181288
> 
> 
> Max(tmp2)
[1] 1.744275
> Min(tmp2)
[1] -2.139616
> mean(tmp2)
[1] -0.04747065
> Sum(tmp2)
[1] -4.747065
> Var(tmp2)
[1] 0.7505956
> 
> rowMeans(tmp2)
  [1]  0.416004932 -0.619158224  0.224693712 -0.124255879  0.960415286
  [6]  0.097829522  0.364745521 -1.173949912  0.183231187 -0.473611186
 [11] -0.990352433  0.012442863  1.609131760  0.162402568 -0.454048643
 [16]  0.465459317  0.583892162 -0.756810968  1.434921193  0.836563673
 [21] -0.430738692  0.446644003  0.191367454  0.438449262 -2.139616260
 [26]  0.496198971  0.728414463  0.338909910  0.009578063  1.744274978
 [31]  0.947345849 -0.059338253 -0.086187703  0.072487404 -0.587308701
 [36] -1.326789159 -0.973588763  0.795566168  0.687206892 -0.443358928
 [41] -0.180786227 -1.544661812 -1.383545820  0.193171986 -0.577091819
 [46] -0.157073679  0.270893544 -0.708936043 -0.158850925  0.769025129
 [51]  0.429001086 -0.769931749 -0.743921121  1.190754433  1.689852994
 [56] -0.126154720  0.319272111  0.504063353  1.626702378  0.710473417
 [61]  0.483304712 -1.310787138 -0.724733958  1.394071619  0.555966284
 [66] -0.410736319 -1.194265977  0.165236637  0.605195494  0.118934858
 [71] -1.648851842 -0.599492430 -0.756597981  1.431781531  0.266982997
 [76] -0.725215799  0.754185294 -0.152522662 -0.735486715  0.288065392
 [81] -0.279765455  0.049731806  1.667030659 -1.276009333  0.254570946
 [86] -1.708963014  0.560353661 -0.566286406 -1.014037863 -0.251396613
 [91]  0.112584646 -1.454213622 -0.613136142  0.267935288 -1.256241650
 [96] -1.361217279 -0.214381989 -1.332321803 -0.643682721  1.546028334
> rowSums(tmp2)
  [1]  0.416004932 -0.619158224  0.224693712 -0.124255879  0.960415286
  [6]  0.097829522  0.364745521 -1.173949912  0.183231187 -0.473611186
 [11] -0.990352433  0.012442863  1.609131760  0.162402568 -0.454048643
 [16]  0.465459317  0.583892162 -0.756810968  1.434921193  0.836563673
 [21] -0.430738692  0.446644003  0.191367454  0.438449262 -2.139616260
 [26]  0.496198971  0.728414463  0.338909910  0.009578063  1.744274978
 [31]  0.947345849 -0.059338253 -0.086187703  0.072487404 -0.587308701
 [36] -1.326789159 -0.973588763  0.795566168  0.687206892 -0.443358928
 [41] -0.180786227 -1.544661812 -1.383545820  0.193171986 -0.577091819
 [46] -0.157073679  0.270893544 -0.708936043 -0.158850925  0.769025129
 [51]  0.429001086 -0.769931749 -0.743921121  1.190754433  1.689852994
 [56] -0.126154720  0.319272111  0.504063353  1.626702378  0.710473417
 [61]  0.483304712 -1.310787138 -0.724733958  1.394071619  0.555966284
 [66] -0.410736319 -1.194265977  0.165236637  0.605195494  0.118934858
 [71] -1.648851842 -0.599492430 -0.756597981  1.431781531  0.266982997
 [76] -0.725215799  0.754185294 -0.152522662 -0.735486715  0.288065392
 [81] -0.279765455  0.049731806  1.667030659 -1.276009333  0.254570946
 [86] -1.708963014  0.560353661 -0.566286406 -1.014037863 -0.251396613
 [91]  0.112584646 -1.454213622 -0.613136142  0.267935288 -1.256241650
 [96] -1.361217279 -0.214381989 -1.332321803 -0.643682721  1.546028334
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.416004932 -0.619158224  0.224693712 -0.124255879  0.960415286
  [6]  0.097829522  0.364745521 -1.173949912  0.183231187 -0.473611186
 [11] -0.990352433  0.012442863  1.609131760  0.162402568 -0.454048643
 [16]  0.465459317  0.583892162 -0.756810968  1.434921193  0.836563673
 [21] -0.430738692  0.446644003  0.191367454  0.438449262 -2.139616260
 [26]  0.496198971  0.728414463  0.338909910  0.009578063  1.744274978
 [31]  0.947345849 -0.059338253 -0.086187703  0.072487404 -0.587308701
 [36] -1.326789159 -0.973588763  0.795566168  0.687206892 -0.443358928
 [41] -0.180786227 -1.544661812 -1.383545820  0.193171986 -0.577091819
 [46] -0.157073679  0.270893544 -0.708936043 -0.158850925  0.769025129
 [51]  0.429001086 -0.769931749 -0.743921121  1.190754433  1.689852994
 [56] -0.126154720  0.319272111  0.504063353  1.626702378  0.710473417
 [61]  0.483304712 -1.310787138 -0.724733958  1.394071619  0.555966284
 [66] -0.410736319 -1.194265977  0.165236637  0.605195494  0.118934858
 [71] -1.648851842 -0.599492430 -0.756597981  1.431781531  0.266982997
 [76] -0.725215799  0.754185294 -0.152522662 -0.735486715  0.288065392
 [81] -0.279765455  0.049731806  1.667030659 -1.276009333  0.254570946
 [86] -1.708963014  0.560353661 -0.566286406 -1.014037863 -0.251396613
 [91]  0.112584646 -1.454213622 -0.613136142  0.267935288 -1.256241650
 [96] -1.361217279 -0.214381989 -1.332321803 -0.643682721  1.546028334
> rowMin(tmp2)
  [1]  0.416004932 -0.619158224  0.224693712 -0.124255879  0.960415286
  [6]  0.097829522  0.364745521 -1.173949912  0.183231187 -0.473611186
 [11] -0.990352433  0.012442863  1.609131760  0.162402568 -0.454048643
 [16]  0.465459317  0.583892162 -0.756810968  1.434921193  0.836563673
 [21] -0.430738692  0.446644003  0.191367454  0.438449262 -2.139616260
 [26]  0.496198971  0.728414463  0.338909910  0.009578063  1.744274978
 [31]  0.947345849 -0.059338253 -0.086187703  0.072487404 -0.587308701
 [36] -1.326789159 -0.973588763  0.795566168  0.687206892 -0.443358928
 [41] -0.180786227 -1.544661812 -1.383545820  0.193171986 -0.577091819
 [46] -0.157073679  0.270893544 -0.708936043 -0.158850925  0.769025129
 [51]  0.429001086 -0.769931749 -0.743921121  1.190754433  1.689852994
 [56] -0.126154720  0.319272111  0.504063353  1.626702378  0.710473417
 [61]  0.483304712 -1.310787138 -0.724733958  1.394071619  0.555966284
 [66] -0.410736319 -1.194265977  0.165236637  0.605195494  0.118934858
 [71] -1.648851842 -0.599492430 -0.756597981  1.431781531  0.266982997
 [76] -0.725215799  0.754185294 -0.152522662 -0.735486715  0.288065392
 [81] -0.279765455  0.049731806  1.667030659 -1.276009333  0.254570946
 [86] -1.708963014  0.560353661 -0.566286406 -1.014037863 -0.251396613
 [91]  0.112584646 -1.454213622 -0.613136142  0.267935288 -1.256241650
 [96] -1.361217279 -0.214381989 -1.332321803 -0.643682721  1.546028334
> 
> colMeans(tmp2)
[1] -0.04747065
> colSums(tmp2)
[1] -4.747065
> colVars(tmp2)
[1] 0.7505956
> colSd(tmp2)
[1] 0.8663692
> colMax(tmp2)
[1] 1.744275
> colMin(tmp2)
[1] -2.139616
> colMedians(tmp2)
[1] 0.03108733
> colRanges(tmp2)
          [,1]
[1,] -2.139616
[2,]  1.744275
> 
> 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.7663924  3.6135574 -3.8624263 -0.6787987 -0.3548908 -3.3614122
 [7]  2.8224395 -0.4510922  0.9407430  2.1254972
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7787391
[2,] -0.3347348
[3,]  0.1233143
[4,]  0.4810447
[5,]  0.7838111
> 
> rowApply(tmp,sum)
 [1]  2.7016011  1.7500468  5.1043628 -5.3582546 -4.9751821  3.5041732
 [7] -1.2550383  1.0235414 -1.2158847  0.2806435
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    8    5    5    4    7    7    5    7     6
 [2,]   10    2    8    8    8    9    4    8    3     9
 [3,]    3    3    3    2   10    1    9    4    2     3
 [4,]    5   10    1    1    3   10    5    2    5     1
 [5,]    1    4    9   10    2    3    2    3    6     8
 [6,]    2    9    4    6    5    2    1    6    4     4
 [7,]    8    7    6    4    7    6    3    7    8    10
 [8,]    7    5    7    3    1    5   10   10    1     5
 [9,]    9    6    2    7    6    4    8    9   10     2
[10,]    6    1   10    9    9    8    6    1    9     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.1682075 -1.7898680  0.6649942 -1.4983304 -0.1273914 -0.1339844
 [7]  1.2716699 -1.4006672  2.3075781  0.4917911  4.0988611 -0.2665613
[13] -0.3763888 -0.8660339 -3.4983523 -1.4417484 -2.8445891 -2.2605090
[19] -1.2187590 -0.3984600
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0175594
[2,] -1.0173917
[3,] -0.8492966
[4,] -0.1665819
[5,]  0.8826222
> 
> rowApply(tmp,sum)
[1] -1.431093 -9.143541 -5.977398  7.142186 -2.045110
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    3    6    7    8   17
[2,]    7   13    4    4   16
[3,]   16   15   15   11    9
[4,]   20    7   11    1    3
[5,]    6    4   10   12   19
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.0173917 -0.5017402  0.4848820  2.0066627 -0.6606607  0.3636299
[2,] -1.0175594 -0.1831561  0.1794360 -0.9836434 -1.2738581  0.7999030
[3,] -0.8492966 -1.2053013  0.2136107 -0.1391186 -0.1955148 -1.1261482
[4,] -0.1665819 -0.5370594  0.1886381 -1.2284600  0.4302180 -0.5954749
[5,]  0.8826222  0.6373890 -0.4015726 -1.1537711  1.5724242  0.4241058
           [,7]        [,8]        [,9]      [,10]      [,11]      [,12]
[1,] -0.1293048  1.23492018  1.14591545  0.1702375  0.1381934  0.7407917
[2,]  0.4462717 -0.04485518  0.68292459 -1.9619391 -1.3183545 -0.5824823
[3,]  0.3366522 -1.72370758 -0.47897929  0.1634325 -0.2385763 -1.6662636
[4,]  1.1827440 -0.37140866  0.99162693  1.2363268  3.9099442  0.9791777
[5,] -0.5646931 -0.49561598 -0.03390957  0.8837334  1.6076541  0.2622153
            [,13]       [,14]       [,15]       [,16]      [,17]       [,18]
[1,]  0.059365653 -0.92516486 -0.19995605 -0.05233582 -1.5105152 -0.43968359
[2,] -0.830870227 -0.23886665 -2.01005013 -1.24948638  0.1858561 -0.19967757
[3,]  0.483202760  0.04362732  0.05681777  1.34248212  0.9967771 -1.02244319
[4,] -0.079301176  1.40806369 -0.27883661 -0.18261162 -1.0586070 -0.06330421
[5,] -0.008785817 -1.15369342 -1.06632726 -1.29979670 -1.4581001 -0.53540044
          [,19]      [,20]
[1,] -1.5588164 -0.7801226
[2,] -0.9487197  1.4055860
[3,]  0.5360956 -1.5047461
[4,]  0.6068221  0.7702700
[5,]  0.1458594 -0.2894473
> 
> 
> 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 :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.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.914831 -1.25513 -0.1275973 -1.193022 0.7337835 0.6460699 0.250805
          col8      col9     col10    col11     col12     col13      col14
row1 0.6679118 -2.254408 0.3060149 1.318542 0.2361649 0.8654071 -0.2644399
         col15     col16      col17    col18    col19     col20
row1 -0.181467 -0.581402 -0.3004331 1.103679 1.323738 0.2042724
> tmp[,"col10"]
           col10
row1  0.30601486
row2 -0.99904851
row3 -1.34531392
row4 -0.42367311
row5  0.03569831
> tmp[c("row1","row5"),]
           col1       col2       col3        col4      col5       col6
row1  0.9148310 -1.2551303 -0.1275973 -1.19302195 0.7337835 0.64606985
row5 -0.2083816  0.7781558 -0.1270265 -0.03285054 1.0591361 0.03511549
          col7       col8       col9      col10     col11     col12     col13
row1 0.2508050  0.6679118 -2.2544083 0.30601486 1.3185423 0.2361649 0.8654071
row5 0.1728338 -0.1943329 -0.2610358 0.03569831 0.5944159 0.6698256 0.8545839
           col14     col15      col16      col17      col18      col19
row1 -0.26443988 -0.181467 -0.5814020 -0.3004331  1.1036789  1.3237381
row5  0.08640658 -0.730391 -0.1342089 -0.1040708 -0.8891935 -0.3029283
         col20
row1 0.2042724
row5 0.4835962
> tmp[,c("col6","col20")]
            col6       col20
row1  0.64606985  0.20427240
row2 -0.97136331  1.12000650
row3 -0.50953987  0.46244748
row4  0.81435969 -0.05452471
row5  0.03511549  0.48359624
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 0.64606985 0.2042724
row5 0.03511549 0.4835962
> 
> 
> 
> 
> 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 48.6284 49.76114 52.2423 50.12828 49.47971 105.9124 49.6961 50.19162
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.48541 49.17619 50.62451 49.57936 51.24725 50.63954 48.54481 51.72715
        col17    col18    col19    col20
row1 50.55973 49.22555 48.77963 104.7365
> tmp[,"col10"]
        col10
row1 49.17619
row2 28.69896
row3 31.10498
row4 28.67294
row5 50.18098
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.62840 49.76114 52.24230 50.12828 49.47971 105.9124 49.69610 50.19162
row5 49.60088 50.20452 49.05526 51.04487 49.28144 106.1419 49.79339 49.24048
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.48541 49.17619 50.62451 49.57936 51.24725 50.63954 48.54481 51.72715
row5 50.02341 50.18098 50.53652 51.55824 50.19750 49.34648 49.54091 50.88924
        col17    col18    col19    col20
row1 50.55973 49.22555 48.77963 104.7365
row5 51.01493 50.46204 48.39129 104.4763
> tmp[,c("col6","col20")]
          col6     col20
row1 105.91243 104.73646
row2  74.01068  75.80106
row3  72.51599  73.98089
row4  76.18677  72.81739
row5 106.14191 104.47625
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.9124 104.7365
row5 106.1419 104.4763
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.9124 104.7365
row5 106.1419 104.4763
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.1484487
[2,]  1.1480171
[3,] -0.5204172
[4,] -1.5535025
[5,] -0.7272735
> tmp[,c("col17","col7")]
          col17        col7
[1,] 0.49609492  1.10893211
[2,] 0.73517897 -0.74621114
[3,] 0.51396116 -0.96685889
[4,] 0.05133326  0.02103265
[5,] 0.35756074 -0.43099330
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6        col20
[1,]  0.6479640 -0.086992455
[2,]  0.4418300  0.002628989
[3,]  0.5606543 -0.367587391
[4,] -2.1799957  0.754817673
[5,]  0.5327638 -0.364279770
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.647964
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
         col6
[1,] 0.647964
[2,] 0.441830
> 
> 
> 
> 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.2789024 0.5290548 -1.4949503  1.2920120  1.616695 0.5939806 -0.8502856
row1 1.0467405 0.2553498  0.3138498 -0.9183254 -1.096542 0.3755125  0.1082766
           [,8]      [,9]     [,10]      [,11]     [,12]      [,13]      [,14]
row3  0.8892578  0.953505 0.9641703 -0.5391687 0.2586770 -0.2023462 -0.4417988
row1 -0.3836855 -0.241674 1.0237861 -0.2077215 0.2498816  1.6192114  0.2737242
          [,15]     [,16]     [,17]       [,18]       [,19]      [,20]
row3 -0.4608334 -1.234031 1.9616203 -0.06587895  0.02809888 -0.6983796
row1  0.1917132  1.758221 0.6863547  0.48811852 -1.11297266  0.4182713
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]      [,3]     [,4]      [,5]      [,6]      [,7]
row2 -1.379364 -0.3825567 -1.652808 1.533814 0.1158927 -1.430669 0.3409014
         [,8]       [,9]   [,10]
row2 1.739954 -0.8514876 1.13163
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
row5 0.01928458 -0.2145665 -0.374533 -2.926267 -0.4620017 0.9337004 0.3021034
           [,8]     [,9]      [,10]      [,11]     [,12]     [,13]      [,14]
row5 -0.8695527 1.277334 0.04646882 -0.7183839 0.5674291 0.2597235 -0.8087091
          [,15]      [,16]     [,17]     [,18]     [,19]      [,20]
row5 -0.5600733 -0.6539788 -2.117657 0.6144904 0.7304037 -0.7758941
> 
> 
> 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: 0x5a7475bbc0a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2382082ec0a756"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM238208e6eb0d0" 
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM23820815be71dc"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM238208270836b3"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2382082a517faa"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2382082578fc7d"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM23820844d0c2ad"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM23820841c4ed34"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM238208a5d728d" 
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2382082d22842e"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2382081a9d8080"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM23820860918523"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2382081c85b849"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM238208624748bb"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2382082dcb4586"
> 
> 
> ### 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: 0x5a7475d78090>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5a7475d78090>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5a7475d78090>
> rowMedians(tmp)
  [1]  0.293586594  0.140892474  0.054797711  0.028711393 -0.085851229
  [6] -0.091905803  0.096346794 -0.485627609  0.876562171  0.391186619
 [11]  0.365563005  0.321379909 -0.225416351  0.405026423  0.379630155
 [16] -0.087699693 -0.318015546  0.270685310 -0.186592350 -0.004165359
 [21]  0.190355262 -0.418162951  0.034134300 -0.885979994  0.125074697
 [26]  0.148488398  0.089932645  0.313177108  0.304119549  0.253408789
 [31] -0.354344184  0.054783873 -0.166748446 -0.242891130  0.654053623
 [36] -0.272435329  0.290512748 -0.418353135  0.250180617 -0.118666475
 [41]  0.140751857  0.022173240  0.363039692 -0.052785235  0.368070619
 [46]  0.225318968  0.062108556 -0.019140237 -0.065428887  0.164382515
 [51]  0.228380577  0.279070895 -0.021113074  0.247098105 -0.388973234
 [56] -0.512727693  0.108901428 -0.228263474  0.037452706 -0.303077166
 [61]  0.036540185  0.161415027 -0.249738797  0.328925832  0.221331681
 [66] -0.357069661  0.125916169 -0.102579216  0.091926106  0.261651944
 [71]  0.764487997  0.178045254  0.193465741 -0.570473758  0.452159186
 [76] -0.178225953 -0.177397100  0.129614505  0.039748016 -0.402350402
 [81] -0.331713638  0.252518607 -0.268952164  0.104735867 -0.102511498
 [86] -0.144966518  0.393592817 -0.297575431 -0.680558023 -0.451856202
 [91] -0.375303933 -0.014664824  0.123981142 -0.441459794 -0.352602499
 [96]  0.161075326 -0.226808858  0.054987294  0.755840353  0.433648559
[101]  0.488986974  0.519336890 -0.221321663  0.056822278  0.693783984
[106]  0.055925349  0.206046371  0.636193835 -0.695676262 -0.174071579
[111]  0.022632131 -0.020377904 -0.397841997 -0.276023884 -0.203523018
[116] -0.253065508 -0.067134783  0.433212980 -0.187842717  0.622980699
[121]  0.782399888 -0.212426387 -0.077751073 -0.393350161  0.384469121
[126] -0.098268843  0.295734724  0.044706326  0.522225337  0.158166781
[131] -0.155010729  0.489143434  0.084658360 -0.432353854  0.193897456
[136]  0.305872724 -0.127881726 -0.216661387 -0.027143807 -0.269714379
[141] -0.028313569  0.303061365  0.291217435  0.279364956  0.371440173
[146] -0.352600819  0.234721415  0.067063127 -0.375871350 -0.354927121
[151]  0.027425068 -0.375422335  0.228949338 -0.267224546  0.026593449
[156] -0.282082472 -0.132884617  0.250385712 -0.477374218 -0.059741033
[161]  0.061841168  0.314273498  0.085198131  0.311326133 -0.097722553
[166] -0.200973790 -0.078936367  0.073774047 -0.286162736 -0.034500346
[171]  0.082088102  0.108560900 -0.579086159 -0.100047174  0.066871728
[176] -0.384873536  0.622371782  0.193150609  0.424812925 -0.353591949
[181] -0.455871302  0.059610629  0.445192212 -0.488040965 -0.120792904
[186]  0.519768838  0.269290089  0.286540742  0.325557951 -0.154216435
[191]  0.184909051 -0.507671616  0.507336909 -0.727408209  0.345921419
[196] -0.480375229  0.056890518  0.384483087  0.018576224 -0.254903289
[201] -0.374142253  0.488285569 -0.070858074  0.355140173 -0.185085532
[206]  0.538961295  0.175210168 -0.023532017 -0.439781324  0.672814854
[211] -0.251137599  0.219384571  0.169312131 -0.064981554  0.027027276
[216]  0.349347346  0.250210387  0.018860022  0.685911636  0.368032573
[221]  0.230257682 -0.011043307 -0.051940286  0.191376571  0.130445654
[226] -0.041592866  0.083881464 -0.164447626  0.292802016  0.160611679
> 
> proc.time()
   user  system elapsed 
  1.242   0.664   1.896 

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: 0x5b9cec9ca370>
> .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: 0x5b9cec9ca370>
> .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: 0x5b9cec9ca370>
> .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: 0x5b9cec9ca370>
> 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: 0x5b9cec9b21c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b9cec9b21c0>
> .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: 0x5b9cec9b21c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b9cec9b21c0>
> .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: 0x5b9cec9b21c0>
> 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: 0x5b9cecc95120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b9cecc95120>
> .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: 0x5b9cecc95120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b9cecc95120>
> .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: 0x5b9cecc95120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5b9cecc95120>
> .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: 0x5b9cecc95120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5b9cecc95120>
> .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: 0x5b9cecc95120>
> 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: 0x5b9ceb9e5390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5b9ceb9e5390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b9ceb9e5390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b9ceb9e5390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2383023e6ec08"  "BufferedMatrixFile238302637a9da1"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2383023e6ec08"  "BufferedMatrixFile238302637a9da1"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b9ceb8dc3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b9ceb8dc3d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b9ceb8dc3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b9ceb8dc3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5b9ceb8dc3d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5b9ceb8dc3d0>
> .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: 0x5b9ced411fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b9ced411fa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b9ced411fa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5b9ced411fa0>
> 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: 0x5b9cebbe9ff0>
> .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: 0x5b9cebbe9ff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.267   0.035   0.291 

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.278   0.036   0.303 

Example timings