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

This page was generated on 2026-03-28 11:57 -0400 (Sat, 28 Mar 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4893
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-03-27 13:45 -0400 (Fri, 27 Mar 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-03-27 21:31:50 -0400 (Fri, 27 Mar 2026)
EndedAt: 2026-03-27 21:32:14 -0400 (Fri, 27 Mar 2026)
EllapsedTime: 24.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.234   0.052   0.276 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478284 25.6    1046725   56   639600 34.2
Vcells 884773  6.8    8388608   64  2081613 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Mar 27 21:32:05 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 Mar 27 21:32:05 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: 0x65148e8dc370>
> 
> 
> 
> 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 Mar 27 21:32:05 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 Mar 27 21:32:05 2026"
> 
> ColMode(tmp2)
<pointer: 0x65148e8dc370>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
              [,1]       [,2]       [,3]       [,4]
[1,] 100.142128370 -0.2442367  1.4269976  0.9731212
[2,]  -0.008531264  0.9370174  0.7328607 -0.5571028
[3,]   0.623540346  0.5224237 -0.8844896  1.2341850
[4,]  -0.954542959  0.4621154 -1.8932767 -1.0290733
> 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,] 1.001421e+02 0.2442367 1.4269976 0.9731212
[2,] 8.531264e-03 0.9370174 0.7328607 0.5571028
[3,] 6.235403e-01 0.5224237 0.8844896 1.2341850
[4,] 9.545430e-01 0.4621154 1.8932767 1.0290733
> 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,] 10.00710390 0.4942031 1.1945701 0.9864691
[2,]  0.09236484 0.9679966 0.8560728 0.7463932
[3,]  0.78964571 0.7227888 0.9404731 1.1109388
[4,]  0.97700714 0.6797907 1.3759639 1.0144325
> 
> 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,] 225.21317 30.18627 38.37270 35.83781
[2,]  25.93218 35.61698 34.29359 33.02103
[3,]  33.52000 32.75031 35.28922 37.34357
[4,]  35.72461 32.26002 40.65292 36.17340
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x65148f8d89b0>
> exp(tmp5)
<pointer: 0x65148f8d89b0>
> log(tmp5,2)
<pointer: 0x65148f8d89b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.7517
> Min(tmp5)
[1] 53.97443
> mean(tmp5)
[1] 73.55218
> Sum(tmp5)
[1] 14710.44
> Var(tmp5)
[1] 855.419
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.69549 72.49293 70.88226 73.82246 70.69597 69.96272 70.44029 73.77070
 [9] 72.66705 71.09192
> rowSums(tmp5)
 [1] 1793.910 1449.859 1417.645 1476.449 1413.919 1399.254 1408.806 1475.414
 [9] 1453.341 1421.838
> rowVars(tmp5)
 [1] 7997.62442  106.92102   60.22842   81.31126   55.83064   38.19523
 [7]   57.55854   86.12277   67.77258   85.14965
> rowSd(tmp5)
 [1] 89.429438 10.340262  7.760697  9.017276  7.471990  6.180229  7.586734
 [8]  9.280235  8.232410  9.227657
> rowMax(tmp5)
 [1] 468.75170  98.90580  85.98103  86.17438  91.65694  81.47855  85.40884
 [8]  89.95685  86.34091  89.52047
> rowMin(tmp5)
 [1] 60.55036 53.97443 58.12235 59.66490 60.75267 57.74806 59.08183 58.84203
 [9] 57.95196 57.01475
> 
> colMeans(tmp5)
 [1] 108.09305  71.37566  73.88774  74.84185  72.39421  70.62815  69.20956
 [8]  74.07320  73.78712  67.60172  69.25495  76.52801  72.22679  67.42705
[15]  70.26525  70.25628  70.83159  69.98283  75.04044  73.33812
> colSums(tmp5)
 [1] 1080.9305  713.7566  738.8774  748.4185  723.9421  706.2815  692.0956
 [8]  740.7320  737.8712  676.0172  692.5495  765.2801  722.2679  674.2705
[15]  702.6525  702.5628  708.3159  699.8283  750.4044  733.3812
> colVars(tmp5)
 [1] 16105.12948    28.25274    84.14010    43.41611    91.44933    55.96172
 [7]    33.25430    74.59021    91.02012    18.57274    50.08798   127.17324
[13]    42.19491    60.65884    59.69077   101.50051    63.56791    46.11011
[19]   114.82364    95.18765
> colSd(tmp5)
 [1] 126.905987   5.315331   9.172791   6.589090   9.562914   7.480756
 [7]   5.766654   8.636562   9.540447   4.309610   7.077286  11.277111
[13]   6.495761   7.788379   7.725980  10.074746   7.972948   6.790443
[19]  10.715579   9.756416
> colMax(tmp5)
 [1] 468.75170  82.73717  89.06455  85.89600  85.77003  84.82027  76.17710
 [8]  86.17438  88.03391  74.89511  85.98678  98.90580  84.01077  85.40884
[15]  86.34091  89.27261  85.98103  81.46489  89.95685  91.65694
> colMin(tmp5)
 [1] 53.97443 62.82876 61.80804 62.67084 57.74806 62.19543 57.01475 58.70238
 [9] 57.95196 61.93243 61.65540 59.54353 62.69828 56.76077 60.55036 58.66238
[17] 60.75267 59.08183 58.12235 58.84203
> 
> 
> ### 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] 89.69549 72.49293 70.88226 73.82246 70.69597 69.96272       NA 73.77070
 [9] 72.66705 71.09192
> rowSums(tmp5)
 [1] 1793.910 1449.859 1417.645 1476.449 1413.919 1399.254       NA 1475.414
 [9] 1453.341 1421.838
> rowVars(tmp5)
 [1] 7997.62442  106.92102   60.22842   81.31126   55.83064   38.19523
 [7]   50.44962   86.12277   67.77258   85.14965
> rowSd(tmp5)
 [1] 89.429438 10.340262  7.760697  9.017276  7.471990  6.180229  7.102790
 [8]  9.280235  8.232410  9.227657
> rowMax(tmp5)
 [1] 468.75170  98.90580  85.98103  86.17438  91.65694  81.47855        NA
 [8]  89.95685  86.34091  89.52047
> rowMin(tmp5)
 [1] 60.55036 53.97443 58.12235 59.66490 60.75267 57.74806       NA 58.84203
 [9] 57.95196 57.01475
> 
> colMeans(tmp5)
 [1] 108.09305  71.37566  73.88774  74.84185  72.39421  70.62815  69.20956
 [8]  74.07320  73.78712  67.60172  69.25495        NA  72.22679  67.42705
[15]  70.26525  70.25628  70.83159  69.98283  75.04044  73.33812
> colSums(tmp5)
 [1] 1080.9305  713.7566  738.8774  748.4185  723.9421  706.2815  692.0956
 [8]  740.7320  737.8712  676.0172  692.5495        NA  722.2679  674.2705
[15]  702.6525  702.5628  708.3159  699.8283  750.4044  733.3812
> colVars(tmp5)
 [1] 16105.12948    28.25274    84.14010    43.41611    91.44933    55.96172
 [7]    33.25430    74.59021    91.02012    18.57274    50.08798          NA
[13]    42.19491    60.65884    59.69077   101.50051    63.56791    46.11011
[19]   114.82364    95.18765
> colSd(tmp5)
 [1] 126.905987   5.315331   9.172791   6.589090   9.562914   7.480756
 [7]   5.766654   8.636562   9.540447   4.309610   7.077286         NA
[13]   6.495761   7.788379   7.725980  10.074746   7.972948   6.790443
[19]  10.715579   9.756416
> colMax(tmp5)
 [1] 468.75170  82.73717  89.06455  85.89600  85.77003  84.82027  76.17710
 [8]  86.17438  88.03391  74.89511  85.98678        NA  84.01077  85.40884
[15]  86.34091  89.27261  85.98103  81.46489  89.95685  91.65694
> colMin(tmp5)
 [1] 53.97443 62.82876 61.80804 62.67084 57.74806 62.19543 57.01475 58.70238
 [9] 57.95196 61.93243 61.65540       NA 62.69828 56.76077 60.55036 58.66238
[17] 60.75267 59.08183 58.12235 58.84203
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.7517
> Min(tmp5,na.rm=TRUE)
[1] 53.97443
> mean(tmp5,na.rm=TRUE)
[1] 73.5011
> Sum(tmp5,na.rm=TRUE)
[1] 14626.72
> Var(tmp5,na.rm=TRUE)
[1] 859.2149
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.69549 72.49293 70.88226 73.82246 70.69597 69.96272 69.74157 73.77070
 [9] 72.66705 71.09192
> rowSums(tmp5,na.rm=TRUE)
 [1] 1793.910 1449.859 1417.645 1476.449 1413.919 1399.254 1325.090 1475.414
 [9] 1453.341 1421.838
> rowVars(tmp5,na.rm=TRUE)
 [1] 7997.62442  106.92102   60.22842   81.31126   55.83064   38.19523
 [7]   50.44962   86.12277   67.77258   85.14965
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.429438 10.340262  7.760697  9.017276  7.471990  6.180229  7.102790
 [8]  9.280235  8.232410  9.227657
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.75170  98.90580  85.98103  86.17438  91.65694  81.47855  85.40884
 [8]  89.95685  86.34091  89.52047
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.55036 53.97443 58.12235 59.66490 60.75267 57.74806 59.08183 58.84203
 [9] 57.95196 57.01475
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.09305  71.37566  73.88774  74.84185  72.39421  70.62815  69.20956
 [8]  74.07320  73.78712  67.60172  69.25495  75.72935  72.22679  67.42705
[15]  70.26525  70.25628  70.83159  69.98283  75.04044  73.33812
> colSums(tmp5,na.rm=TRUE)
 [1] 1080.9305  713.7566  738.8774  748.4185  723.9421  706.2815  692.0956
 [8]  740.7320  737.8712  676.0172  692.5495  681.5641  722.2679  674.2705
[15]  702.6525  702.5628  708.3159  699.8283  750.4044  733.3812
> colVars(tmp5,na.rm=TRUE)
 [1] 16105.12948    28.25274    84.14010    43.41611    91.44933    55.96172
 [7]    33.25430    74.59021    91.02012    18.57274    50.08798   135.89399
[13]    42.19491    60.65884    59.69077   101.50051    63.56791    46.11011
[19]   114.82364    95.18765
> colSd(tmp5,na.rm=TRUE)
 [1] 126.905987   5.315331   9.172791   6.589090   9.562914   7.480756
 [7]   5.766654   8.636562   9.540447   4.309610   7.077286  11.657358
[13]   6.495761   7.788379   7.725980  10.074746   7.972948   6.790443
[19]  10.715579   9.756416
> colMax(tmp5,na.rm=TRUE)
 [1] 468.75170  82.73717  89.06455  85.89600  85.77003  84.82027  76.17710
 [8]  86.17438  88.03391  74.89511  85.98678  98.90580  84.01077  85.40884
[15]  86.34091  89.27261  85.98103  81.46489  89.95685  91.65694
> colMin(tmp5,na.rm=TRUE)
 [1] 53.97443 62.82876 61.80804 62.67084 57.74806 62.19543 57.01475 58.70238
 [9] 57.95196 61.93243 61.65540 59.54353 62.69828 56.76077 60.55036 58.66238
[17] 60.75267 59.08183 58.12235 58.84203
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.69549 72.49293 70.88226 73.82246 70.69597 69.96272      NaN 73.77070
 [9] 72.66705 71.09192
> rowSums(tmp5,na.rm=TRUE)
 [1] 1793.910 1449.859 1417.645 1476.449 1413.919 1399.254    0.000 1475.414
 [9] 1453.341 1421.838
> rowVars(tmp5,na.rm=TRUE)
 [1] 7997.62442  106.92102   60.22842   81.31126   55.83064   38.19523
 [7]         NA   86.12277   67.77258   85.14965
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.429438 10.340262  7.760697  9.017276  7.471990  6.180229        NA
 [8]  9.280235  8.232410  9.227657
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.75170  98.90580  85.98103  86.17438  91.65694  81.47855        NA
 [8]  89.95685  86.34091  89.52047
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.55036 53.97443 58.12235 59.66490 60.75267 57.74806       NA 58.84203
 [9] 57.95196 57.01475
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.75998  70.11327  73.27414  75.22008  72.84819  71.56512  69.09975
 [8]  74.26834  73.99853  67.88574  69.80457       NaN  72.48916  65.42907
[15]  71.12978  69.94120  70.53431  71.19405  76.19960  74.47465
> colSums(tmp5,na.rm=TRUE)
 [1] 1014.8398  631.0194  659.4673  676.9807  655.6337  644.0861  621.8977
 [8]  668.4151  665.9868  610.9716  628.2411    0.0000  652.4024  588.8617
[15]  640.1680  629.4708  634.8088  640.7465  685.7964  670.2718
> colVars(tmp5,na.rm=TRUE)
 [1] 17873.24304    13.85602    90.42190    47.23373   100.56188    53.08045
 [7]    37.27543    83.48559   101.89485    19.98687    52.95060          NA
[13]    46.69483    23.33218    58.74373   113.07127    70.51971    35.36945
[19]   114.06046    92.55460
> colSd(tmp5,na.rm=TRUE)
 [1] 133.690849   3.722368   9.509043   6.872680  10.028055   7.285633
 [7]   6.105361   9.137045  10.094298   4.470668   7.276716         NA
[13]   6.833362   4.830340   7.664446  10.633498   8.397601   5.947222
[19]  10.679909   9.620530
> colMax(tmp5,na.rm=TRUE)
 [1] 468.75170  74.16529  89.06455  85.89600  85.77003  84.82027  76.17710
 [8]  86.17438  88.03391  74.89511  85.98678      -Inf  84.01077  72.44649
[15]  86.34091  89.27261  85.98103  81.46489  89.95685  91.65694
> colMin(tmp5,na.rm=TRUE)
 [1] 53.97443 62.82876 61.80804 62.67084 57.74806 64.51943 57.01475 58.70238
 [9] 57.95196 61.93243 61.65540      Inf 62.69828 56.76077 60.55036 58.66238
[17] 60.75267 61.85874 58.12235 58.84203
> 
> 
> 
> 
> 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] 213.5408 202.9587 209.3224 204.2855 168.2786 262.1138 396.6581 340.8313
 [9] 171.7586 195.1099
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 213.5408 202.9587 209.3224 204.2855 168.2786 262.1138 396.6581 340.8313
 [9] 171.7586 195.1099
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -2.842171e-13 -1.989520e-13  5.684342e-14  2.842171e-14 -8.526513e-14
 [6]  8.526513e-14 -7.105427e-14  0.000000e+00  0.000000e+00  5.684342e-14
[11]  1.421085e-13  2.842171e-14 -1.136868e-13  3.694822e-13 -1.136868e-13
[16]  1.136868e-13 -1.136868e-13 -1.136868e-13  5.684342e-14  3.979039e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   11 
7   3 
1   7 
4   17 
6   18 
1   3 
4   8 
8   18 
5   5 
5   1 
9   3 
5   15 
7   15 
3   7 
6   2 
8   13 
6   20 
4   11 
2   4 
8   6 
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.935885
> Min(tmp)
[1] -2.839439
> mean(tmp)
[1] -0.130311
> Sum(tmp)
[1] -13.0311
> Var(tmp)
[1] 1.271724
> 
> rowMeans(tmp)
[1] -0.130311
> rowSums(tmp)
[1] -13.0311
> rowVars(tmp)
[1] 1.271724
> rowSd(tmp)
[1] 1.127707
> rowMax(tmp)
[1] 2.935885
> rowMin(tmp)
[1] -2.839439
> 
> colMeans(tmp)
  [1]  1.224332013 -1.048779693  0.685835383 -0.027251408 -1.228547516
  [6] -0.300622584  0.272407136 -0.755581494  0.077293788 -0.434769064
 [11] -1.539016737  1.460704352 -0.973724781  0.965343333 -1.905663846
 [16] -0.836053177 -0.148991142 -0.869913438  1.402276665 -1.547380001
 [21] -0.631206211  1.592475825  0.029519451  1.002483237 -2.839438775
 [26]  1.097318980 -0.137893350  2.935884988 -0.012061189  0.331061045
 [31]  0.542748709  0.312860045  2.354616384  0.447634843 -1.909348008
 [36]  0.250222220  0.475458107  0.162789723 -1.462369819 -1.969822606
 [41] -0.081645611 -0.626761054  1.510348966  0.488548010  0.217891024
 [46]  0.883408682  0.205482100 -1.833090844 -0.360412601 -1.322424259
 [51] -0.179567832  0.727090127  1.265254006 -2.196918183 -0.020940069
 [56]  0.501663551 -1.217610625  0.360446305  0.230213164  0.603788662
 [61]  1.114155970 -0.003230589 -0.487628051 -0.890199831  1.931259665
 [66] -0.387791754  0.062254225  0.873104942 -0.249700117  0.332699102
 [71] -0.139818719 -1.891135351 -2.131477696  0.825593104  0.303848440
 [76] -0.593174334 -0.192954039  1.279718511  0.618252600 -0.519520224
 [81] -2.727924893 -0.023162340 -2.233303638  2.077439245  0.598040909
 [86] -0.937305905  0.648613976 -0.147604962 -0.001565387  0.946162595
 [91] -0.089111809 -0.040589582 -1.599463870 -0.223422338 -0.246624868
 [96] -1.103711548 -1.846408658 -0.185648854  0.170592953 -2.119948650
> colSums(tmp)
  [1]  1.224332013 -1.048779693  0.685835383 -0.027251408 -1.228547516
  [6] -0.300622584  0.272407136 -0.755581494  0.077293788 -0.434769064
 [11] -1.539016737  1.460704352 -0.973724781  0.965343333 -1.905663846
 [16] -0.836053177 -0.148991142 -0.869913438  1.402276665 -1.547380001
 [21] -0.631206211  1.592475825  0.029519451  1.002483237 -2.839438775
 [26]  1.097318980 -0.137893350  2.935884988 -0.012061189  0.331061045
 [31]  0.542748709  0.312860045  2.354616384  0.447634843 -1.909348008
 [36]  0.250222220  0.475458107  0.162789723 -1.462369819 -1.969822606
 [41] -0.081645611 -0.626761054  1.510348966  0.488548010  0.217891024
 [46]  0.883408682  0.205482100 -1.833090844 -0.360412601 -1.322424259
 [51] -0.179567832  0.727090127  1.265254006 -2.196918183 -0.020940069
 [56]  0.501663551 -1.217610625  0.360446305  0.230213164  0.603788662
 [61]  1.114155970 -0.003230589 -0.487628051 -0.890199831  1.931259665
 [66] -0.387791754  0.062254225  0.873104942 -0.249700117  0.332699102
 [71] -0.139818719 -1.891135351 -2.131477696  0.825593104  0.303848440
 [76] -0.593174334 -0.192954039  1.279718511  0.618252600 -0.519520224
 [81] -2.727924893 -0.023162340 -2.233303638  2.077439245  0.598040909
 [86] -0.937305905  0.648613976 -0.147604962 -0.001565387  0.946162595
 [91] -0.089111809 -0.040589582 -1.599463870 -0.223422338 -0.246624868
 [96] -1.103711548 -1.846408658 -0.185648854  0.170592953 -2.119948650
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.224332013 -1.048779693  0.685835383 -0.027251408 -1.228547516
  [6] -0.300622584  0.272407136 -0.755581494  0.077293788 -0.434769064
 [11] -1.539016737  1.460704352 -0.973724781  0.965343333 -1.905663846
 [16] -0.836053177 -0.148991142 -0.869913438  1.402276665 -1.547380001
 [21] -0.631206211  1.592475825  0.029519451  1.002483237 -2.839438775
 [26]  1.097318980 -0.137893350  2.935884988 -0.012061189  0.331061045
 [31]  0.542748709  0.312860045  2.354616384  0.447634843 -1.909348008
 [36]  0.250222220  0.475458107  0.162789723 -1.462369819 -1.969822606
 [41] -0.081645611 -0.626761054  1.510348966  0.488548010  0.217891024
 [46]  0.883408682  0.205482100 -1.833090844 -0.360412601 -1.322424259
 [51] -0.179567832  0.727090127  1.265254006 -2.196918183 -0.020940069
 [56]  0.501663551 -1.217610625  0.360446305  0.230213164  0.603788662
 [61]  1.114155970 -0.003230589 -0.487628051 -0.890199831  1.931259665
 [66] -0.387791754  0.062254225  0.873104942 -0.249700117  0.332699102
 [71] -0.139818719 -1.891135351 -2.131477696  0.825593104  0.303848440
 [76] -0.593174334 -0.192954039  1.279718511  0.618252600 -0.519520224
 [81] -2.727924893 -0.023162340 -2.233303638  2.077439245  0.598040909
 [86] -0.937305905  0.648613976 -0.147604962 -0.001565387  0.946162595
 [91] -0.089111809 -0.040589582 -1.599463870 -0.223422338 -0.246624868
 [96] -1.103711548 -1.846408658 -0.185648854  0.170592953 -2.119948650
> colMin(tmp)
  [1]  1.224332013 -1.048779693  0.685835383 -0.027251408 -1.228547516
  [6] -0.300622584  0.272407136 -0.755581494  0.077293788 -0.434769064
 [11] -1.539016737  1.460704352 -0.973724781  0.965343333 -1.905663846
 [16] -0.836053177 -0.148991142 -0.869913438  1.402276665 -1.547380001
 [21] -0.631206211  1.592475825  0.029519451  1.002483237 -2.839438775
 [26]  1.097318980 -0.137893350  2.935884988 -0.012061189  0.331061045
 [31]  0.542748709  0.312860045  2.354616384  0.447634843 -1.909348008
 [36]  0.250222220  0.475458107  0.162789723 -1.462369819 -1.969822606
 [41] -0.081645611 -0.626761054  1.510348966  0.488548010  0.217891024
 [46]  0.883408682  0.205482100 -1.833090844 -0.360412601 -1.322424259
 [51] -0.179567832  0.727090127  1.265254006 -2.196918183 -0.020940069
 [56]  0.501663551 -1.217610625  0.360446305  0.230213164  0.603788662
 [61]  1.114155970 -0.003230589 -0.487628051 -0.890199831  1.931259665
 [66] -0.387791754  0.062254225  0.873104942 -0.249700117  0.332699102
 [71] -0.139818719 -1.891135351 -2.131477696  0.825593104  0.303848440
 [76] -0.593174334 -0.192954039  1.279718511  0.618252600 -0.519520224
 [81] -2.727924893 -0.023162340 -2.233303638  2.077439245  0.598040909
 [86] -0.937305905  0.648613976 -0.147604962 -0.001565387  0.946162595
 [91] -0.089111809 -0.040589582 -1.599463870 -0.223422338 -0.246624868
 [96] -1.103711548 -1.846408658 -0.185648854  0.170592953 -2.119948650
> colMedians(tmp)
  [1]  1.224332013 -1.048779693  0.685835383 -0.027251408 -1.228547516
  [6] -0.300622584  0.272407136 -0.755581494  0.077293788 -0.434769064
 [11] -1.539016737  1.460704352 -0.973724781  0.965343333 -1.905663846
 [16] -0.836053177 -0.148991142 -0.869913438  1.402276665 -1.547380001
 [21] -0.631206211  1.592475825  0.029519451  1.002483237 -2.839438775
 [26]  1.097318980 -0.137893350  2.935884988 -0.012061189  0.331061045
 [31]  0.542748709  0.312860045  2.354616384  0.447634843 -1.909348008
 [36]  0.250222220  0.475458107  0.162789723 -1.462369819 -1.969822606
 [41] -0.081645611 -0.626761054  1.510348966  0.488548010  0.217891024
 [46]  0.883408682  0.205482100 -1.833090844 -0.360412601 -1.322424259
 [51] -0.179567832  0.727090127  1.265254006 -2.196918183 -0.020940069
 [56]  0.501663551 -1.217610625  0.360446305  0.230213164  0.603788662
 [61]  1.114155970 -0.003230589 -0.487628051 -0.890199831  1.931259665
 [66] -0.387791754  0.062254225  0.873104942 -0.249700117  0.332699102
 [71] -0.139818719 -1.891135351 -2.131477696  0.825593104  0.303848440
 [76] -0.593174334 -0.192954039  1.279718511  0.618252600 -0.519520224
 [81] -2.727924893 -0.023162340 -2.233303638  2.077439245  0.598040909
 [86] -0.937305905  0.648613976 -0.147604962 -0.001565387  0.946162595
 [91] -0.089111809 -0.040589582 -1.599463870 -0.223422338 -0.246624868
 [96] -1.103711548 -1.846408658 -0.185648854  0.170592953 -2.119948650
> colRanges(tmp)
         [,1]     [,2]      [,3]        [,4]      [,5]       [,6]      [,7]
[1,] 1.224332 -1.04878 0.6858354 -0.02725141 -1.228548 -0.3006226 0.2724071
[2,] 1.224332 -1.04878 0.6858354 -0.02725141 -1.228548 -0.3006226 0.2724071
           [,8]       [,9]      [,10]     [,11]    [,12]      [,13]     [,14]
[1,] -0.7555815 0.07729379 -0.4347691 -1.539017 1.460704 -0.9737248 0.9653433
[2,] -0.7555815 0.07729379 -0.4347691 -1.539017 1.460704 -0.9737248 0.9653433
         [,15]      [,16]      [,17]      [,18]    [,19]    [,20]      [,21]
[1,] -1.905664 -0.8360532 -0.1489911 -0.8699134 1.402277 -1.54738 -0.6312062
[2,] -1.905664 -0.8360532 -0.1489911 -0.8699134 1.402277 -1.54738 -0.6312062
        [,22]      [,23]    [,24]     [,25]    [,26]      [,27]    [,28]
[1,] 1.592476 0.02951945 1.002483 -2.839439 1.097319 -0.1378934 2.935885
[2,] 1.592476 0.02951945 1.002483 -2.839439 1.097319 -0.1378934 2.935885
           [,29]    [,30]     [,31]   [,32]    [,33]     [,34]     [,35]
[1,] -0.01206119 0.331061 0.5427487 0.31286 2.354616 0.4476348 -1.909348
[2,] -0.01206119 0.331061 0.5427487 0.31286 2.354616 0.4476348 -1.909348
         [,36]     [,37]     [,38]    [,39]     [,40]       [,41]      [,42]
[1,] 0.2502222 0.4754581 0.1627897 -1.46237 -1.969823 -0.08164561 -0.6267611
[2,] 0.2502222 0.4754581 0.1627897 -1.46237 -1.969823 -0.08164561 -0.6267611
        [,43]    [,44]    [,45]     [,46]     [,47]     [,48]      [,49]
[1,] 1.510349 0.488548 0.217891 0.8834087 0.2054821 -1.833091 -0.3604126
[2,] 1.510349 0.488548 0.217891 0.8834087 0.2054821 -1.833091 -0.3604126
         [,50]      [,51]     [,52]    [,53]     [,54]       [,55]     [,56]
[1,] -1.322424 -0.1795678 0.7270901 1.265254 -2.196918 -0.02094007 0.5016636
[2,] -1.322424 -0.1795678 0.7270901 1.265254 -2.196918 -0.02094007 0.5016636
         [,57]     [,58]     [,59]     [,60]    [,61]        [,62]      [,63]
[1,] -1.217611 0.3604463 0.2302132 0.6037887 1.114156 -0.003230589 -0.4876281
[2,] -1.217611 0.3604463 0.2302132 0.6037887 1.114156 -0.003230589 -0.4876281
          [,64]   [,65]      [,66]      [,67]     [,68]      [,69]     [,70]
[1,] -0.8901998 1.93126 -0.3877918 0.06225422 0.8731049 -0.2497001 0.3326991
[2,] -0.8901998 1.93126 -0.3877918 0.06225422 0.8731049 -0.2497001 0.3326991
          [,71]     [,72]     [,73]     [,74]     [,75]      [,76]     [,77]
[1,] -0.1398187 -1.891135 -2.131478 0.8255931 0.3038484 -0.5931743 -0.192954
[2,] -0.1398187 -1.891135 -2.131478 0.8255931 0.3038484 -0.5931743 -0.192954
        [,78]     [,79]      [,80]     [,81]       [,82]     [,83]    [,84]
[1,] 1.279719 0.6182526 -0.5195202 -2.727925 -0.02316234 -2.233304 2.077439
[2,] 1.279719 0.6182526 -0.5195202 -2.727925 -0.02316234 -2.233304 2.077439
         [,85]      [,86]    [,87]     [,88]        [,89]     [,90]       [,91]
[1,] 0.5980409 -0.9373059 0.648614 -0.147605 -0.001565387 0.9461626 -0.08911181
[2,] 0.5980409 -0.9373059 0.648614 -0.147605 -0.001565387 0.9461626 -0.08911181
           [,92]     [,93]      [,94]      [,95]     [,96]     [,97]      [,98]
[1,] -0.04058958 -1.599464 -0.2234223 -0.2466249 -1.103712 -1.846409 -0.1856489
[2,] -0.04058958 -1.599464 -0.2234223 -0.2466249 -1.103712 -1.846409 -0.1856489
        [,99]    [,100]
[1,] 0.170593 -2.119949
[2,] 0.170593 -2.119949
> 
> 
> Max(tmp2)
[1] 3.108192
> Min(tmp2)
[1] -2.568265
> mean(tmp2)
[1] 0.2159037
> Sum(tmp2)
[1] 21.59037
> Var(tmp2)
[1] 1.073317
> 
> rowMeans(tmp2)
  [1] -1.07849841  0.97252139  1.67752539  0.13247123  1.31938694  0.76015945
  [7] -0.02867098  1.23300459  0.17610521 -2.05695188  0.26435483  0.22522615
 [13]  0.94542300  0.34397950  0.28099685  0.53094382  1.37283984  0.38120472
 [19]  1.25281881  0.97920764  0.20402143  0.46161060  1.13380071  0.46694330
 [25]  0.41343904 -0.16880158 -0.25954277  2.02392031  0.58419815  0.78519898
 [31]  0.18167413 -0.06207318  1.34726993 -0.21400540  1.50945323 -0.38914814
 [37] -0.70060268 -0.10276230  2.10425650  0.64716031 -0.02446814  0.73724470
 [43] -0.53402219 -0.35922913  0.85515613  0.28478548  0.45257598  0.27341748
 [49]  1.29918755  0.82278045 -0.39841412  1.22360159  0.43546762 -0.02605712
 [55]  0.58187778  1.50630760  0.37477460  0.28762549  1.78885434  0.54516347
 [61] -1.76526682  0.71632178  1.06611300 -0.34674957 -0.99617567 -1.35437205
 [67]  0.10354350  0.43813934  1.79544749  0.23825270  1.47316922  0.46191701
 [73]  0.96431760  3.10819234 -0.29629704  0.43227533 -0.35531771 -0.21298122
 [79] -2.56826505 -1.03526085 -2.44765038 -1.00553726 -0.64193287  1.40410303
 [85] -1.03630801 -0.54859192 -0.79124761  0.63382476  1.17806901  1.65002719
 [91] -0.74449321 -0.90074721  0.99420818 -0.27688011 -1.06266088 -0.82076217
 [97] -1.98080468 -1.51083111 -1.95500943 -0.19009464
> rowSums(tmp2)
  [1] -1.07849841  0.97252139  1.67752539  0.13247123  1.31938694  0.76015945
  [7] -0.02867098  1.23300459  0.17610521 -2.05695188  0.26435483  0.22522615
 [13]  0.94542300  0.34397950  0.28099685  0.53094382  1.37283984  0.38120472
 [19]  1.25281881  0.97920764  0.20402143  0.46161060  1.13380071  0.46694330
 [25]  0.41343904 -0.16880158 -0.25954277  2.02392031  0.58419815  0.78519898
 [31]  0.18167413 -0.06207318  1.34726993 -0.21400540  1.50945323 -0.38914814
 [37] -0.70060268 -0.10276230  2.10425650  0.64716031 -0.02446814  0.73724470
 [43] -0.53402219 -0.35922913  0.85515613  0.28478548  0.45257598  0.27341748
 [49]  1.29918755  0.82278045 -0.39841412  1.22360159  0.43546762 -0.02605712
 [55]  0.58187778  1.50630760  0.37477460  0.28762549  1.78885434  0.54516347
 [61] -1.76526682  0.71632178  1.06611300 -0.34674957 -0.99617567 -1.35437205
 [67]  0.10354350  0.43813934  1.79544749  0.23825270  1.47316922  0.46191701
 [73]  0.96431760  3.10819234 -0.29629704  0.43227533 -0.35531771 -0.21298122
 [79] -2.56826505 -1.03526085 -2.44765038 -1.00553726 -0.64193287  1.40410303
 [85] -1.03630801 -0.54859192 -0.79124761  0.63382476  1.17806901  1.65002719
 [91] -0.74449321 -0.90074721  0.99420818 -0.27688011 -1.06266088 -0.82076217
 [97] -1.98080468 -1.51083111 -1.95500943 -0.19009464
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.07849841  0.97252139  1.67752539  0.13247123  1.31938694  0.76015945
  [7] -0.02867098  1.23300459  0.17610521 -2.05695188  0.26435483  0.22522615
 [13]  0.94542300  0.34397950  0.28099685  0.53094382  1.37283984  0.38120472
 [19]  1.25281881  0.97920764  0.20402143  0.46161060  1.13380071  0.46694330
 [25]  0.41343904 -0.16880158 -0.25954277  2.02392031  0.58419815  0.78519898
 [31]  0.18167413 -0.06207318  1.34726993 -0.21400540  1.50945323 -0.38914814
 [37] -0.70060268 -0.10276230  2.10425650  0.64716031 -0.02446814  0.73724470
 [43] -0.53402219 -0.35922913  0.85515613  0.28478548  0.45257598  0.27341748
 [49]  1.29918755  0.82278045 -0.39841412  1.22360159  0.43546762 -0.02605712
 [55]  0.58187778  1.50630760  0.37477460  0.28762549  1.78885434  0.54516347
 [61] -1.76526682  0.71632178  1.06611300 -0.34674957 -0.99617567 -1.35437205
 [67]  0.10354350  0.43813934  1.79544749  0.23825270  1.47316922  0.46191701
 [73]  0.96431760  3.10819234 -0.29629704  0.43227533 -0.35531771 -0.21298122
 [79] -2.56826505 -1.03526085 -2.44765038 -1.00553726 -0.64193287  1.40410303
 [85] -1.03630801 -0.54859192 -0.79124761  0.63382476  1.17806901  1.65002719
 [91] -0.74449321 -0.90074721  0.99420818 -0.27688011 -1.06266088 -0.82076217
 [97] -1.98080468 -1.51083111 -1.95500943 -0.19009464
> rowMin(tmp2)
  [1] -1.07849841  0.97252139  1.67752539  0.13247123  1.31938694  0.76015945
  [7] -0.02867098  1.23300459  0.17610521 -2.05695188  0.26435483  0.22522615
 [13]  0.94542300  0.34397950  0.28099685  0.53094382  1.37283984  0.38120472
 [19]  1.25281881  0.97920764  0.20402143  0.46161060  1.13380071  0.46694330
 [25]  0.41343904 -0.16880158 -0.25954277  2.02392031  0.58419815  0.78519898
 [31]  0.18167413 -0.06207318  1.34726993 -0.21400540  1.50945323 -0.38914814
 [37] -0.70060268 -0.10276230  2.10425650  0.64716031 -0.02446814  0.73724470
 [43] -0.53402219 -0.35922913  0.85515613  0.28478548  0.45257598  0.27341748
 [49]  1.29918755  0.82278045 -0.39841412  1.22360159  0.43546762 -0.02605712
 [55]  0.58187778  1.50630760  0.37477460  0.28762549  1.78885434  0.54516347
 [61] -1.76526682  0.71632178  1.06611300 -0.34674957 -0.99617567 -1.35437205
 [67]  0.10354350  0.43813934  1.79544749  0.23825270  1.47316922  0.46191701
 [73]  0.96431760  3.10819234 -0.29629704  0.43227533 -0.35531771 -0.21298122
 [79] -2.56826505 -1.03526085 -2.44765038 -1.00553726 -0.64193287  1.40410303
 [85] -1.03630801 -0.54859192 -0.79124761  0.63382476  1.17806901  1.65002719
 [91] -0.74449321 -0.90074721  0.99420818 -0.27688011 -1.06266088 -0.82076217
 [97] -1.98080468 -1.51083111 -1.95500943 -0.19009464
> 
> colMeans(tmp2)
[1] 0.2159037
> colSums(tmp2)
[1] 21.59037
> colVars(tmp2)
[1] 1.073317
> colSd(tmp2)
[1] 1.03601
> colMax(tmp2)
[1] 3.108192
> colMin(tmp2)
[1] -2.568265
> colMedians(tmp2)
[1] 0.2862055
> colRanges(tmp2)
          [,1]
[1,] -2.568265
[2,]  3.108192
> 
> 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] -2.3272018 -1.5928967  1.9953224  2.7656755  1.6860252 -4.0891587
 [7] -0.6035578 -4.4735060 -0.2218258 -3.8645059
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.02295530
[2,] -0.73921633
[3,] -0.07362537
[4,]  0.52669360
[5,]  1.08963799
> 
> rowApply(tmp,sum)
 [1]  2.2330258 -4.7657496  2.8282665 -0.6874828 -3.1576675  0.1460196
 [7]  0.5232884 -2.3390601 -1.3338494 -4.1724207
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    7    6    8    5   10    9    8    2     1
 [2,]    1    9    2    3    3    9    4    3    9     8
 [3,]   10   10   10    7    4    6    5    2    1     4
 [4,]    6    4    7    5    6    4    8    9   10     7
 [5,]    7    3    9    4   10    5    2   10    4     5
 [6,]    3    1    1    9    2    7    7    4    3     9
 [7,]    9    8    4   10    1    3    1    5    5     6
 [8,]    4    6    3    2    9    2    3    7    8     2
 [9,]    8    2    5    6    8    8   10    6    7     3
[10,]    5    5    8    1    7    1    6    1    6    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.64093204  2.95799289  3.71593635  0.37647082  2.33868599  2.18015145
 [7] -0.22064103  1.84903602  0.79534381 -3.58692665  0.14821554  0.41661909
[13]  2.68051786 -1.20195325  3.79386139  0.39521712 -1.93028998  1.85330797
[19]  0.07810732 -0.43447826
> colApply(tmp,quantile)[,1]
           [,1]
[1,] 0.08336414
[2,] 0.63120130
[3,] 0.91521130
[4,] 0.95807415
[5,] 1.05308115
> 
> rowApply(tmp,sum)
[1] -3.623726  5.301775  6.719838 10.167303  1.280917
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   11   19   14   12   17
[2,]    8   20   15    1   20
[3,]   17    3   16   19   12
[4,]   18    1    2   13   13
[5,]   13   15   18    8    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,] 0.08336414 -0.5812726  0.7948212  0.9779048  0.34872188  1.3967783
[2,] 1.05308115  2.2016563 -0.4724421 -0.6241205  0.51961360  0.2749250
[3,] 0.95807415  1.1362956  1.1420523 -1.1057433  1.85904941  0.0836558
[4,] 0.63120130 -1.0785945  1.8538109  0.6551134  0.05562539  1.1717173
[5,] 0.91521130  1.2799081  0.3976941  0.4733163 -0.44432430 -0.7469250
           [,7]       [,8]        [,9]      [,10]     [,11]      [,12]
[1,] -0.8281760 -0.6022411  0.44808103 -2.7154149  1.257396 -0.4690542
[2,] -0.2078263  0.6475900 -0.61207127  0.3249957  0.718792  0.2181061
[3,] -0.8644405  2.1341675  0.02298839 -0.4382113 -2.208635  0.2767304
[4,]  3.0742533 -0.5268299  0.09178320 -0.1613636  1.471763  1.6303947
[5,] -1.3944514  0.1963495  0.84456245 -0.5969325 -1.091101 -1.2395579
           [,13]      [,14]      [,15]      [,16]      [,17]        [,18]
[1,]  0.34181211 -0.4523202  0.7480438 -1.1600824 -1.7956441 -0.785230190
[2,]  0.05533248 -0.4589065  0.1014291  0.1781606  0.2310431 -0.004391056
[3,]  1.52298341  0.3200116  2.4043445  0.6202372 -0.7489970  0.003411567
[4,] -0.14016979 -0.1788917  1.0241628 -0.3731353  0.1117348  1.721111827
[5,]  0.90055964 -0.4318465 -0.4841188  1.1300371  0.2715732  0.918405818
          [,19]      [,20]
[1,]  0.6401070 -1.2713199
[2,]  0.4517785  0.7050286
[3,]  0.4606806 -0.8588174
[4,] -1.0334860  0.1671014
[5,] -0.4409728  0.8235291
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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 -1.134953 -1.185749 -1.169179 1.031418 0.3806285 0.4058019 -0.1181772
          col8     col9    col10     col11     col12      col13     col14
row1 0.4277884 1.524897 1.101451 0.4913279 0.2644853 -0.7270644 -1.137236
          col15     col16     col17    col18    col19     col20
row1 0.06248261 0.2832514 0.9664387 2.132792 1.482931 -1.817232
> tmp[,"col10"]
           col10
row1  1.10145128
row2 -0.27708927
row3 -0.17598236
row4 -0.09347051
row5  0.82225127
> tmp[c("row1","row5"),]
           col1      col2      col3      col4       col5       col6       col7
row1 -1.1349534 -1.185749 -1.169179  1.031418  0.3806285  0.4058019 -0.1181772
row5 -0.2989438  1.166394  1.254955 -1.662940 -0.1830673 -0.3178712  0.7740699
          col8      col9     col10     col11     col12      col13      col14
row1 0.4277884 1.5248969 1.1014513 0.4913279 0.2644853 -0.7270644 -1.1372362
row5 1.9443520 0.0653305 0.8222513 0.5134618 1.5981045 -2.1119173 -0.6770254
          col15     col16     col17      col18    col19     col20
row1 0.06248261 0.2832514 0.9664387  2.1327925 1.482931 -1.817232
row5 0.24107186 0.2040926 0.5073436 -0.8748657 0.493653  1.384498
> tmp[,c("col6","col20")]
           col6      col20
row1  0.4058019 -1.8172321
row2  1.1248692 -0.1310904
row3 -0.6266119  0.8102029
row4 -0.2862664 -0.7410656
row5 -0.3178712  1.3844984
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  0.4058019 -1.817232
row5 -0.3178712  1.384498
> 
> 
> 
> 
> 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 53.36501 50.86423 49.67843 49.8587 52.32812 105.0908 50.48139 50.03965
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.26914 50.65649 50.68166 48.86529 50.69737 50.51873 50.69444 49.68764
        col17    col18    col19    col20
row1 49.67984 50.35784 49.39567 106.3961
> tmp[,"col10"]
        col10
row1 50.65649
row2 29.93770
row3 31.17399
row4 28.77244
row5 51.41938
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 53.36501 50.86423 49.67843 49.85870 52.32812 105.0908 50.48139 50.03965
row5 50.71075 50.53163 48.97660 50.35023 50.87374 104.0792 50.06809 49.68851
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.26914 50.65649 50.68166 48.86529 50.69737 50.51873 50.69444 49.68764
row5 50.54592 51.41938 50.29653 50.10047 50.34201 51.00025 50.65270 50.28944
        col17    col18    col19    col20
row1 49.67984 50.35784 49.39567 106.3961
row5 50.87221 48.75223 48.95306 105.6394
> tmp[,c("col6","col20")]
          col6     col20
row1 105.09084 106.39609
row2  75.68172  76.16962
row3  76.00518  74.81824
row4  74.33088  75.99112
row5 104.07921 105.63940
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0908 106.3961
row5 104.0792 105.6394
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0908 106.3961
row5 104.0792 105.6394
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.7562959
[2,] -1.0341561
[3,]  1.3400895
[4,] -0.7207185
[5,] -0.6598835
> tmp[,c("col17","col7")]
          col17        col7
[1,]  1.1244925 -0.98443383
[2,] -0.2373432  0.18147772
[3,]  1.1344713  0.04695115
[4,]  0.1178302 -0.36367901
[5,] -1.1450929 -0.95904887
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.7635864 -0.2673039
[2,] -0.5988553  0.3498553
[3,] -0.5208310  0.1808832
[4,]  1.7990321 -2.8033295
[5,] -0.4052516  1.8501486
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.7635864
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.7635864
[2,] -0.5988553
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]      [,3]       [,4]       [,5]       [,6]       [,7]
row3 -2.242181 0.4094070 0.5594772 -0.3309658 0.37196626  2.2659846 -0.3222741
row1 -0.242398 0.3156548 0.5006338 -1.7915415 0.08316888 -0.7530142 -0.3668215
           [,8]        [,9]     [,10]      [,11]        [,12]     [,13]
row3 0.31327207  0.07045103  1.455150  0.4385885  1.117776896 0.1845462
row1 0.08158344 -0.59235823 -1.565212 -1.5466757 -0.001965176 0.1217539
         [,14]     [,15]      [,16]     [,17]     [,18]       [,19]      [,20]
row3  2.223147 -0.937494 -0.3113453 0.8656732 0.5378125  0.06913177  0.1373294
row1 -2.181465  1.693282 -0.3371116 1.7828253 0.7136729 -1.00872135 -1.2904251
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]      [,4]     [,5]       [,6]       [,7]
row2 0.4246416 0.3699834 -0.7775909 0.9133625 -2.15347 -0.6492323 -0.1796635
         [,8]   [,9]      [,10]
row2 1.244099 1.8327 -0.5601595
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
row5 -0.2251437 -0.6459669 -1.851823 0.3388993 -1.058583 -1.286579 -0.1204601
          [,8]      [,9]     [,10]     [,11]      [,12]     [,13]    [,14]
row5 -0.099261 0.4992419 0.1054536 0.8453506 -0.8038399 -1.124231 1.469286
         [,15]    [,16]    [,17]      [,18]       [,19]     [,20]
row5 -2.279349 0.304852 0.719379 -0.4041101 -0.04316917 0.6838007
> 
> 
> 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: 0x65148f593000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e6622c5307"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e62a23b8ee"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e62efebee7"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e61dec0ead"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e6daf57a3" 
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e63ebe3cff"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e668d32f57"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e66f5132eb"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e66a657b25"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e670fc6dad"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e6210fa015"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e625818ad3"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e61a9ab5be"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e6785c0054"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2274e669f1a89e"
> 
> 
> ### 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: 0x65148fbe5250>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x65148fbe5250>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x65148fbe5250>
> rowMedians(tmp)
  [1] -0.253851704  0.032813699 -0.265713192  0.084884151 -0.373657513
  [6]  0.249760728 -0.009519743  0.197733926  0.155592539  0.626147148
 [11] -0.137227628  0.337387929 -0.546346698 -0.605140770  0.313956520
 [16] -0.065094101 -0.566030858 -0.273558858 -0.388698540  0.478653376
 [21]  0.415425294 -0.250284292  0.155031171  0.692893183  0.183105330
 [26]  1.011858875  0.125476258 -0.655136935  0.014334444 -0.321018714
 [31]  0.313026488  0.081226059  0.136903045 -0.113746024  0.018968701
 [36]  0.178090902  0.023369809 -0.045851342  0.134110767 -0.414446260
 [41] -0.284356997 -0.256881351 -0.148538886 -0.400228602  0.044880978
 [46] -0.345913640  0.188773141  0.206355207  0.041065150 -0.721073597
 [51]  0.164216728  0.275184264 -0.212207879 -0.105997889 -0.034250761
 [56] -0.447272033 -0.089656693  0.043118443 -0.163655540  0.195739859
 [61]  0.100727697 -0.501171625 -0.202832868 -0.057937816  0.152547944
 [66]  0.048045646  0.015440731  0.030810532  0.137408412  0.056559109
 [71]  0.243259135 -0.506076082  0.202149744 -0.518762734 -0.163567193
 [76]  0.609835193  0.258466565  0.564843224  0.092600944  0.229445433
 [81]  0.029608314  0.478313440  0.015527712  0.092165427 -0.014709933
 [86]  0.034949057 -0.150775705 -0.085023911 -0.175799405  0.542332064
 [91] -0.183605959  0.063856702  0.293908138  0.457158970 -0.056445019
 [96] -0.027894522  0.159418344 -0.199609974  0.354290066  0.069369489
[101]  0.243524134  0.532517290  0.285937933 -0.258726353  0.359451685
[106]  0.329943115  0.288179451 -0.002865006  0.347906518  0.215995858
[111] -0.416840028 -0.576426685 -0.202852841  0.041602459 -0.197393865
[116] -0.174732986  0.171996855 -0.159541679  0.458143775  0.276517001
[121]  0.244144698 -0.341581751 -0.542096633 -0.160146785  0.204605250
[126]  0.723899593  0.028464729 -0.257710230  0.382864937 -0.446933897
[131]  0.281669779 -0.787938260 -0.758902673  0.542567996 -0.175419542
[136]  0.021538492  0.128661567 -0.159070718  0.105730688 -0.438466817
[141]  0.086423354  0.272153204  0.050445267  0.157647242 -0.501576872
[146] -0.900042989 -0.266473452 -0.341020510  0.092437152  0.032553626
[151]  0.017272452  0.126933503 -0.032411501  0.149633358  0.288539297
[156] -0.069550858 -0.205131010 -0.092114239  0.651702290  0.103566761
[161]  0.122434561  0.108485931  0.305585681 -0.088365321  0.124225133
[166]  0.145822068 -0.126865733 -0.530948669  0.055560764  0.544785607
[171]  0.431899755  0.124076031  0.458998150  0.492776010 -0.032959947
[176] -0.556529012  0.151389870  0.089612196 -0.283879370  0.314790281
[181]  0.359210131 -0.072394424 -0.380459250  0.062359668  0.268346119
[186]  0.317350814 -0.411933772 -0.704671542 -0.279548095  0.115879945
[191]  0.673280490 -0.105015573  0.035691642 -0.679160384  0.300027192
[196]  0.073946191  0.562860138  0.326346637 -0.249111082  0.219651366
[201]  0.002578775  0.079413540 -0.304995236 -0.142643044  0.080812361
[206]  0.009085615 -0.459319488 -0.472744107  0.138867907 -0.422711967
[211]  0.278342171  0.406624462  0.189159343 -0.095150437  0.089183066
[216]  0.311469404  0.718572995  0.009402251  0.494008542 -0.185733478
[221] -0.692615178 -0.155738073 -0.150940711  0.140302771 -0.033068345
[226]  0.458826626  0.286659212  0.507860320 -0.587278836  0.351336941
> 
> proc.time()
   user  system elapsed 
  1.278   0.674   1.940 

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: 0x589079b25370>
> .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: 0x589079b25370>
> .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: 0x589079b25370>
> .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: 0x589079b25370>
> 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: 0x589079b0d1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x589079b0d1c0>
> .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: 0x589079b0d1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x589079b0d1c0>
> .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: 0x589079b0d1c0>
> 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: 0x589079df0120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x589079df0120>
> .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: 0x589079df0120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x589079df0120>
> .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: 0x589079df0120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x589079df0120>
> .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: 0x589079df0120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x589079df0120>
> .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: 0x589079df0120>
> 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: 0x589078b40390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x589078b40390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x589078b40390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x589078b40390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2275f63b159b43" "BufferedMatrixFile2275f6afa9570" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2275f63b159b43" "BufferedMatrixFile2275f6afa9570" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x589078a373d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x589078a373d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x589078a373d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x589078a373d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x589078a373d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x589078a373d0>
> .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: 0x58907a56cfa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58907a56cfa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x58907a56cfa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x58907a56cfa0>
> 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: 0x589078d44ff0>
> .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: 0x589078d44ff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.246   0.051   0.285 

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.240   0.053   0.282 

Example timings