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

This page was generated on 2026-05-02 11:34 -0400 (Sat, 02 May 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4988
kjohnson3macOS 13.7.7 Venturaarm644.6.0 Patched (2026-04-24 r89963) -- "Because it was There" 4718
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 262/2418HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.76.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-05-01 13:40 -0400 (Fri, 01 May 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_23
git_last_commit: 9d72964
git_last_commit_date: 2026-04-28 08:32:08 -0400 (Tue, 28 Apr 2026)
nebbiolo1Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.76.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz
StartedAt: 2026-05-01 22:14:54 -0400 (Fri, 01 May 2026)
EndedAt: 2026-05-01 22:15:20 -0400 (Fri, 01 May 2026)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-05-02 02:14:55 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.253   0.040   0.282 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 480233 25.7    1053308 56.3   637571 34.1
Vcells 887253  6.8    8388608 64.0  2083896 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 May  1 22:15:10 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 May  1 22:15:10 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: 0x5d69a3043690>
> 
> 
> 
> 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 May  1 22:15:10 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 May  1 22:15:11 2026"
> 
> ColMode(tmp2)
<pointer: 0x5d69a3043690>
> 
> 
> 
> ### 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.7907236  0.17820405  0.5190097 0.12431698
[2,]  -1.4831904 -2.86548889  0.7534370 1.21125890
[3,]  -0.5915942 -0.02539844  1.9948173 0.09739178
[4,]   0.3549836 -0.33590215 -0.1102209 1.47607603
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]       [,4]
[1,] 100.7907236 0.17820405 0.5190097 0.12431698
[2,]   1.4831904 2.86548889 0.7534370 1.21125890
[3,]   0.5915942 0.02539844 1.9948173 0.09739178
[4,]   0.3549836 0.33590215 0.1102209 1.47607603
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0394583 0.4221422 0.7204233 0.3525861
[2,]  1.2178631 1.6927755 0.8680075 1.1005721
[3,]  0.7691516 0.1593689 1.4123800 0.3120766
[4,]  0.5958050 0.5795707 0.3319954 1.2149387
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.18531 29.39963 32.72324 28.65018
[2,]  38.66182 44.79324 34.43351 37.21698
[3,]  33.28311 26.61909 41.11862 28.21816
[4,]  31.31303 31.13161 28.43017 38.62546
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5d69a43f70c0>
> exp(tmp5)
<pointer: 0x5d69a43f70c0>
> log(tmp5,2)
<pointer: 0x5d69a43f70c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.7751
> Min(tmp5)
[1] 53.29145
> mean(tmp5)
[1] 73.01763
> Sum(tmp5)
[1] 14603.53
> Var(tmp5)
[1] 880.3501
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.99846 71.55786 67.85971 73.65826 73.28246 69.71466 71.99304 68.60461
 [9] 66.59765 74.90964
> rowSums(tmp5)
 [1] 1839.969 1431.157 1357.194 1473.165 1465.649 1394.293 1439.861 1372.092
 [9] 1331.953 1498.193
> rowVars(tmp5)
 [1] 8021.07595  105.91907   89.60614   73.60446   40.23134  108.87917
 [7]   82.73328   51.87297   52.08570  104.27169
> rowSd(tmp5)
 [1] 89.560460 10.291699  9.466052  8.579304  6.342818 10.434518  9.095784
 [8]  7.202289  7.217042 10.211351
> rowMax(tmp5)
 [1] 470.77508  93.23127  88.23612  89.06471  86.58928  87.83771  87.36332
 [8]  79.73690  78.01813  93.02754
> rowMin(tmp5)
 [1] 59.04061 55.77439 53.70719 59.17368 58.81408 55.11986 54.61418 57.80456
 [9] 53.29145 55.99435
> 
> colMeans(tmp5)
 [1] 108.21769  68.67432  72.39173  68.25534  72.61696  68.65007  67.43574
 [8]  73.57554  67.66438  70.30818  71.67860  69.06656  74.34746  71.18355
[15]  72.76997  74.61434  72.74653  72.32382  72.18200  71.64990
> colSums(tmp5)
 [1] 1082.1769  686.7432  723.9173  682.5534  726.1696  686.5007  674.3574
 [8]  735.7554  676.6438  703.0818  716.7860  690.6656  743.4746  711.8355
[15]  727.6997  746.1434  727.4653  723.2382  721.8200  716.4990
> colVars(tmp5)
 [1] 16289.38892   158.55020    80.20517   133.50903    59.55674    65.10099
 [7]    91.96314    53.82541    61.37482   118.99464   118.51435   126.16376
[13]   113.75970    86.53496    64.55281    46.19926    37.05351    76.83067
[19]    60.81522    71.56474
> colSd(tmp5)
 [1] 127.629890  12.591672   8.955734  11.554611   7.717302   8.068518
 [7]   9.589741   7.336580   7.834208  10.908467  10.886429  11.232264
[13]  10.665819   9.302417   8.034476   6.797004   6.087159   8.765311
[19]   7.798411   8.459595
> colMax(tmp5)
 [1] 470.77508  93.23127  87.36332  87.34938  85.93655  80.28693  78.29409
 [8]  88.34551  78.55300  89.24694  88.84534  89.06471  93.02754  87.14775
[15]  87.83771  86.58928  84.95332  83.33524  84.51311  85.98893
> colMin(tmp5)
 [1] 54.61418 55.11986 59.17368 56.39731 60.14392 58.19752 53.70719 61.98084
 [9] 59.04061 53.29145 54.93590 55.99435 60.17825 59.82035 61.66691 64.43360
[17] 61.61179 60.15433 56.89717 57.80456
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.99846 71.55786 67.85971 73.65826 73.28246 69.71466 71.99304 68.60461
 [9]       NA 74.90964
> rowSums(tmp5)
 [1] 1839.969 1431.157 1357.194 1473.165 1465.649 1394.293 1439.861 1372.092
 [9]       NA 1498.193
> rowVars(tmp5)
 [1] 8021.07595  105.91907   89.60614   73.60446   40.23134  108.87917
 [7]   82.73328   51.87297   47.02635  104.27169
> rowSd(tmp5)
 [1] 89.560460 10.291699  9.466052  8.579304  6.342818 10.434518  9.095784
 [8]  7.202289  6.857576 10.211351
> rowMax(tmp5)
 [1] 470.77508  93.23127  88.23612  89.06471  86.58928  87.83771  87.36332
 [8]  79.73690        NA  93.02754
> rowMin(tmp5)
 [1] 59.04061 55.77439 53.70719 59.17368 58.81408 55.11986 54.61418 57.80456
 [9]       NA 55.99435
> 
> colMeans(tmp5)
 [1] 108.21769  68.67432  72.39173  68.25534  72.61696  68.65007  67.43574
 [8]  73.57554  67.66438  70.30818        NA  69.06656  74.34746  71.18355
[15]  72.76997  74.61434  72.74653  72.32382  72.18200  71.64990
> colSums(tmp5)
 [1] 1082.1769  686.7432  723.9173  682.5534  726.1696  686.5007  674.3574
 [8]  735.7554  676.6438  703.0818        NA  690.6656  743.4746  711.8355
[15]  727.6997  746.1434  727.4653  723.2382  721.8200  716.4990
> colVars(tmp5)
 [1] 16289.38892   158.55020    80.20517   133.50903    59.55674    65.10099
 [7]    91.96314    53.82541    61.37482   118.99464          NA   126.16376
[13]   113.75970    86.53496    64.55281    46.19926    37.05351    76.83067
[19]    60.81522    71.56474
> colSd(tmp5)
 [1] 127.629890  12.591672   8.955734  11.554611   7.717302   8.068518
 [7]   9.589741   7.336580   7.834208  10.908467         NA  11.232264
[13]  10.665819   9.302417   8.034476   6.797004   6.087159   8.765311
[19]   7.798411   8.459595
> colMax(tmp5)
 [1] 470.77508  93.23127  87.36332  87.34938  85.93655  80.28693  78.29409
 [8]  88.34551  78.55300  89.24694        NA  89.06471  93.02754  87.14775
[15]  87.83771  86.58928  84.95332  83.33524  84.51311  85.98893
> colMin(tmp5)
 [1] 54.61418 55.11986 59.17368 56.39731 60.14392 58.19752 53.70719 61.98084
 [9] 59.04061 53.29145       NA 55.99435 60.17825 59.82035 61.66691 64.43360
[17] 61.61179 60.15433 56.89717 57.80456
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.7751
> Min(tmp5,na.rm=TRUE)
[1] 53.29145
> mean(tmp5,na.rm=TRUE)
[1] 73.1085
> Sum(tmp5,na.rm=TRUE)
[1] 14548.59
> Var(tmp5,na.rm=TRUE)
[1] 883.1367
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.99846 71.55786 67.85971 73.65826 73.28246 69.71466 71.99304 68.60461
 [9] 67.21142 74.90964
> rowSums(tmp5,na.rm=TRUE)
 [1] 1839.969 1431.157 1357.194 1473.165 1465.649 1394.293 1439.861 1372.092
 [9] 1277.017 1498.193
> rowVars(tmp5,na.rm=TRUE)
 [1] 8021.07595  105.91907   89.60614   73.60446   40.23134  108.87917
 [7]   82.73328   51.87297   47.02635  104.27169
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.560460 10.291699  9.466052  8.579304  6.342818 10.434518  9.095784
 [8]  7.202289  6.857576 10.211351
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.77508  93.23127  88.23612  89.06471  86.58928  87.83771  87.36332
 [8]  79.73690  78.01813  93.02754
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.04061 55.77439 53.70719 59.17368 58.81408 55.11986 54.61418 57.80456
 [9] 53.29145 55.99435
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.21769  68.67432  72.39173  68.25534  72.61696  68.65007  67.43574
 [8]  73.57554  67.66438  70.30818  73.53890  69.06656  74.34746  71.18355
[15]  72.76997  74.61434  72.74653  72.32382  72.18200  71.64990
> colSums(tmp5,na.rm=TRUE)
 [1] 1082.1769  686.7432  723.9173  682.5534  726.1696  686.5007  674.3574
 [8]  735.7554  676.6438  703.0818  661.8501  690.6656  743.4746  711.8355
[15]  727.6997  746.1434  727.4653  723.2382  721.8200  716.4990
> colVars(tmp5,na.rm=TRUE)
 [1] 16289.38892   158.55020    80.20517   133.50903    59.55674    65.10099
 [7]    91.96314    53.82541    61.37482   118.99464    94.39557   126.16376
[13]   113.75970    86.53496    64.55281    46.19926    37.05351    76.83067
[19]    60.81522    71.56474
> colSd(tmp5,na.rm=TRUE)
 [1] 127.629890  12.591672   8.955734  11.554611   7.717302   8.068518
 [7]   9.589741   7.336580   7.834208  10.908467   9.715738  11.232264
[13]  10.665819   9.302417   8.034476   6.797004   6.087159   8.765311
[19]   7.798411   8.459595
> colMax(tmp5,na.rm=TRUE)
 [1] 470.77508  93.23127  87.36332  87.34938  85.93655  80.28693  78.29409
 [8]  88.34551  78.55300  89.24694  88.84534  89.06471  93.02754  87.14775
[15]  87.83771  86.58928  84.95332  83.33524  84.51311  85.98893
> colMin(tmp5,na.rm=TRUE)
 [1] 54.61418 55.11986 59.17368 56.39731 60.14392 58.19752 53.70719 61.98084
 [9] 59.04061 53.29145 59.60749 55.99435 60.17825 59.82035 61.66691 64.43360
[17] 61.61179 60.15433 56.89717 57.80456
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.99846 71.55786 67.85971 73.65826 73.28246 69.71466 71.99304 68.60461
 [9]      NaN 74.90964
> rowSums(tmp5,na.rm=TRUE)
 [1] 1839.969 1431.157 1357.194 1473.165 1465.649 1394.293 1439.861 1372.092
 [9]    0.000 1498.193
> rowVars(tmp5,na.rm=TRUE)
 [1] 8021.07595  105.91907   89.60614   73.60446   40.23134  108.87917
 [7]   82.73328   51.87297         NA  104.27169
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.560460 10.291699  9.466052  8.579304  6.342818 10.434518  9.095784
 [8]  7.202289        NA 10.211351
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.77508  93.23127  88.23612  89.06471  86.58928  87.83771  87.36332
 [8]  79.73690        NA  93.02754
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.04061 55.77439 53.70719 59.17368 58.81408 55.11986 54.61418 57.80456
 [9]       NA 55.99435
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.57320  68.88334  72.37340  69.24672  72.88220  67.79741  67.57615
 [8]  74.31163  68.44663  72.19893       NaN  68.65180  75.88720  71.93037
[15]  72.64439  74.65640  73.05564  73.23403  73.88031  71.85068
> colSums(tmp5,na.rm=TRUE)
 [1] 1004.1588  619.9500  651.3606  623.2205  655.9398  610.1767  608.1854
 [8]  668.8046  616.0197  649.7903    0.0000  617.8662  682.9848  647.3734
[15]  653.7995  671.9076  657.5008  659.1063  664.9228  646.6561
> colVars(tmp5,na.rm=TRUE)
 [1] 18198.89399   177.87748    90.22704   139.14083    66.20988    65.05949
 [7]   103.23674    54.45813    62.16265    93.65104          NA   139.99890
[13]   101.30818    91.07727    72.44448    51.95426    40.61023    77.11413
[19]    35.96909    80.05682
> colSd(tmp5,na.rm=TRUE)
 [1] 134.903276  13.337071   9.498791  11.795797   8.136945   8.065946
 [7]  10.160548   7.379575   7.884329   9.677347         NA  11.832113
[13]  10.065197   9.543441   8.511432   7.207930   6.372615   8.781465
[19]   5.997423   8.947447
> colMax(tmp5,na.rm=TRUE)
 [1] 470.77508  93.23127  87.36332  87.34938  85.93655  80.28693  78.29409
 [8]  88.34551  78.55300  89.24694      -Inf  89.06471  93.02754  87.14775
[15]  87.83771  86.58928  84.95332  83.33524  84.51311  85.98893
> colMin(tmp5,na.rm=TRUE)
 [1] 54.61418 55.11986 59.17368 56.39731 60.14392 58.19752 53.70719 61.98084
 [9] 59.04061 55.77439      Inf 55.99435 60.17825 59.82035 61.66691 64.43360
[17] 61.61179 60.15433 66.68423 57.80456
> 
> 
> 
> 
> 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] 216.01336 214.45521  97.29971 249.25817 147.49823 122.19664 130.60267
 [8] 205.44034 183.91136 133.54030
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 216.01336 214.45521  97.29971 249.25817 147.49823 122.19664 130.60267
 [8] 205.44034 183.91136 133.54030
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -5.684342e-14  1.136868e-13  0.000000e+00  1.136868e-13 -1.705303e-13
 [6]  1.421085e-13 -1.705303e-13  1.989520e-13  0.000000e+00  0.000000e+00
[11]  1.136868e-13  1.136868e-13  5.684342e-14  7.105427e-14  3.410605e-13
[16]  1.705303e-13  0.000000e+00 -1.421085e-13 -5.684342e-14  1.421085e-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)
+ }
8   15 
8   11 
8   6 
10   8 
4   14 
9   16 
10   4 
7   4 
3   7 
2   4 
7   1 
4   14 
2   7 
3   14 
10   2 
9   1 
7   18 
1   5 
3   2 
3   7 
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.756983
> Min(tmp)
[1] -2.041116
> mean(tmp)
[1] 0.1760855
> Sum(tmp)
[1] 17.60855
> Var(tmp)
[1] 0.9141502
> 
> rowMeans(tmp)
[1] 0.1760855
> rowSums(tmp)
[1] 17.60855
> rowVars(tmp)
[1] 0.9141502
> rowSd(tmp)
[1] 0.956112
> rowMax(tmp)
[1] 2.756983
> rowMin(tmp)
[1] -2.041116
> 
> colMeans(tmp)
  [1] -0.11837767 -0.19172614 -0.22598059 -2.04111628  0.53678285 -0.29258192
  [7]  0.62610853  0.33014335  1.38792437  0.13024985  0.41637784  0.12825567
 [13] -1.40101929 -0.63067924  1.46125728  0.02415404  0.89227566 -0.39860235
 [19] -0.41684848 -1.08822483 -0.09952648 -1.17057262  1.11107025  0.86336212
 [25]  0.71846538 -0.11556604 -1.02038646  0.47150746 -0.25810882  1.91600085
 [31] -0.74904874 -0.78695378  2.75698337  1.36182001  0.24736200  1.84610475
 [37]  1.65747704  0.52560241  0.25245418 -0.23125188  0.70212801  2.63001967
 [43]  1.28961659 -0.42798357  0.07071461 -0.88580075  0.70575833  0.28669500
 [49]  2.20224233 -0.56491680  0.85784190 -1.32459820  1.47049980  1.20728569
 [55]  1.88161667 -0.01184464  0.48902322  1.16768147 -0.65666754  0.59495776
 [61]  0.56185176  1.79767555 -0.24915188  1.13518533  0.27000341 -1.30109683
 [67]  0.82982415 -0.23558285  0.80496294  0.29317558 -0.63522394 -1.16005464
 [73]  0.44209479  0.14802564 -1.34614178 -1.26458672 -1.06469198 -1.55971894
 [79]  0.31180471 -0.17987575 -1.57836115 -0.24168343  0.01335301  0.10861332
 [85] -0.54465992  0.25917771  0.67348637  0.68345815 -0.59787919 -0.25484005
 [91] -0.15978624 -0.26200385 -0.96816892  0.05574547  0.65914232  1.08864471
 [97]  0.90969220 -0.34687597  0.63644323 -0.23285899
> colSums(tmp)
  [1] -0.11837767 -0.19172614 -0.22598059 -2.04111628  0.53678285 -0.29258192
  [7]  0.62610853  0.33014335  1.38792437  0.13024985  0.41637784  0.12825567
 [13] -1.40101929 -0.63067924  1.46125728  0.02415404  0.89227566 -0.39860235
 [19] -0.41684848 -1.08822483 -0.09952648 -1.17057262  1.11107025  0.86336212
 [25]  0.71846538 -0.11556604 -1.02038646  0.47150746 -0.25810882  1.91600085
 [31] -0.74904874 -0.78695378  2.75698337  1.36182001  0.24736200  1.84610475
 [37]  1.65747704  0.52560241  0.25245418 -0.23125188  0.70212801  2.63001967
 [43]  1.28961659 -0.42798357  0.07071461 -0.88580075  0.70575833  0.28669500
 [49]  2.20224233 -0.56491680  0.85784190 -1.32459820  1.47049980  1.20728569
 [55]  1.88161667 -0.01184464  0.48902322  1.16768147 -0.65666754  0.59495776
 [61]  0.56185176  1.79767555 -0.24915188  1.13518533  0.27000341 -1.30109683
 [67]  0.82982415 -0.23558285  0.80496294  0.29317558 -0.63522394 -1.16005464
 [73]  0.44209479  0.14802564 -1.34614178 -1.26458672 -1.06469198 -1.55971894
 [79]  0.31180471 -0.17987575 -1.57836115 -0.24168343  0.01335301  0.10861332
 [85] -0.54465992  0.25917771  0.67348637  0.68345815 -0.59787919 -0.25484005
 [91] -0.15978624 -0.26200385 -0.96816892  0.05574547  0.65914232  1.08864471
 [97]  0.90969220 -0.34687597  0.63644323 -0.23285899
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.11837767 -0.19172614 -0.22598059 -2.04111628  0.53678285 -0.29258192
  [7]  0.62610853  0.33014335  1.38792437  0.13024985  0.41637784  0.12825567
 [13] -1.40101929 -0.63067924  1.46125728  0.02415404  0.89227566 -0.39860235
 [19] -0.41684848 -1.08822483 -0.09952648 -1.17057262  1.11107025  0.86336212
 [25]  0.71846538 -0.11556604 -1.02038646  0.47150746 -0.25810882  1.91600085
 [31] -0.74904874 -0.78695378  2.75698337  1.36182001  0.24736200  1.84610475
 [37]  1.65747704  0.52560241  0.25245418 -0.23125188  0.70212801  2.63001967
 [43]  1.28961659 -0.42798357  0.07071461 -0.88580075  0.70575833  0.28669500
 [49]  2.20224233 -0.56491680  0.85784190 -1.32459820  1.47049980  1.20728569
 [55]  1.88161667 -0.01184464  0.48902322  1.16768147 -0.65666754  0.59495776
 [61]  0.56185176  1.79767555 -0.24915188  1.13518533  0.27000341 -1.30109683
 [67]  0.82982415 -0.23558285  0.80496294  0.29317558 -0.63522394 -1.16005464
 [73]  0.44209479  0.14802564 -1.34614178 -1.26458672 -1.06469198 -1.55971894
 [79]  0.31180471 -0.17987575 -1.57836115 -0.24168343  0.01335301  0.10861332
 [85] -0.54465992  0.25917771  0.67348637  0.68345815 -0.59787919 -0.25484005
 [91] -0.15978624 -0.26200385 -0.96816892  0.05574547  0.65914232  1.08864471
 [97]  0.90969220 -0.34687597  0.63644323 -0.23285899
> colMin(tmp)
  [1] -0.11837767 -0.19172614 -0.22598059 -2.04111628  0.53678285 -0.29258192
  [7]  0.62610853  0.33014335  1.38792437  0.13024985  0.41637784  0.12825567
 [13] -1.40101929 -0.63067924  1.46125728  0.02415404  0.89227566 -0.39860235
 [19] -0.41684848 -1.08822483 -0.09952648 -1.17057262  1.11107025  0.86336212
 [25]  0.71846538 -0.11556604 -1.02038646  0.47150746 -0.25810882  1.91600085
 [31] -0.74904874 -0.78695378  2.75698337  1.36182001  0.24736200  1.84610475
 [37]  1.65747704  0.52560241  0.25245418 -0.23125188  0.70212801  2.63001967
 [43]  1.28961659 -0.42798357  0.07071461 -0.88580075  0.70575833  0.28669500
 [49]  2.20224233 -0.56491680  0.85784190 -1.32459820  1.47049980  1.20728569
 [55]  1.88161667 -0.01184464  0.48902322  1.16768147 -0.65666754  0.59495776
 [61]  0.56185176  1.79767555 -0.24915188  1.13518533  0.27000341 -1.30109683
 [67]  0.82982415 -0.23558285  0.80496294  0.29317558 -0.63522394 -1.16005464
 [73]  0.44209479  0.14802564 -1.34614178 -1.26458672 -1.06469198 -1.55971894
 [79]  0.31180471 -0.17987575 -1.57836115 -0.24168343  0.01335301  0.10861332
 [85] -0.54465992  0.25917771  0.67348637  0.68345815 -0.59787919 -0.25484005
 [91] -0.15978624 -0.26200385 -0.96816892  0.05574547  0.65914232  1.08864471
 [97]  0.90969220 -0.34687597  0.63644323 -0.23285899
> colMedians(tmp)
  [1] -0.11837767 -0.19172614 -0.22598059 -2.04111628  0.53678285 -0.29258192
  [7]  0.62610853  0.33014335  1.38792437  0.13024985  0.41637784  0.12825567
 [13] -1.40101929 -0.63067924  1.46125728  0.02415404  0.89227566 -0.39860235
 [19] -0.41684848 -1.08822483 -0.09952648 -1.17057262  1.11107025  0.86336212
 [25]  0.71846538 -0.11556604 -1.02038646  0.47150746 -0.25810882  1.91600085
 [31] -0.74904874 -0.78695378  2.75698337  1.36182001  0.24736200  1.84610475
 [37]  1.65747704  0.52560241  0.25245418 -0.23125188  0.70212801  2.63001967
 [43]  1.28961659 -0.42798357  0.07071461 -0.88580075  0.70575833  0.28669500
 [49]  2.20224233 -0.56491680  0.85784190 -1.32459820  1.47049980  1.20728569
 [55]  1.88161667 -0.01184464  0.48902322  1.16768147 -0.65666754  0.59495776
 [61]  0.56185176  1.79767555 -0.24915188  1.13518533  0.27000341 -1.30109683
 [67]  0.82982415 -0.23558285  0.80496294  0.29317558 -0.63522394 -1.16005464
 [73]  0.44209479  0.14802564 -1.34614178 -1.26458672 -1.06469198 -1.55971894
 [79]  0.31180471 -0.17987575 -1.57836115 -0.24168343  0.01335301  0.10861332
 [85] -0.54465992  0.25917771  0.67348637  0.68345815 -0.59787919 -0.25484005
 [91] -0.15978624 -0.26200385 -0.96816892  0.05574547  0.65914232  1.08864471
 [97]  0.90969220 -0.34687597  0.63644323 -0.23285899
> colRanges(tmp)
           [,1]       [,2]       [,3]      [,4]      [,5]       [,6]      [,7]
[1,] -0.1183777 -0.1917261 -0.2259806 -2.041116 0.5367828 -0.2925819 0.6261085
[2,] -0.1183777 -0.1917261 -0.2259806 -2.041116 0.5367828 -0.2925819 0.6261085
          [,8]     [,9]     [,10]     [,11]     [,12]     [,13]      [,14]
[1,] 0.3301434 1.387924 0.1302499 0.4163778 0.1282557 -1.401019 -0.6306792
[2,] 0.3301434 1.387924 0.1302499 0.4163778 0.1282557 -1.401019 -0.6306792
        [,15]      [,16]     [,17]      [,18]      [,19]     [,20]       [,21]
[1,] 1.461257 0.02415404 0.8922757 -0.3986024 -0.4168485 -1.088225 -0.09952648
[2,] 1.461257 0.02415404 0.8922757 -0.3986024 -0.4168485 -1.088225 -0.09952648
         [,22]   [,23]     [,24]     [,25]     [,26]     [,27]     [,28]
[1,] -1.170573 1.11107 0.8633621 0.7184654 -0.115566 -1.020386 0.4715075
[2,] -1.170573 1.11107 0.8633621 0.7184654 -0.115566 -1.020386 0.4715075
          [,29]    [,30]      [,31]      [,32]    [,33]   [,34]    [,35]
[1,] -0.2581088 1.916001 -0.7490487 -0.7869538 2.756983 1.36182 0.247362
[2,] -0.2581088 1.916001 -0.7490487 -0.7869538 2.756983 1.36182 0.247362
        [,36]    [,37]     [,38]     [,39]      [,40]    [,41]   [,42]    [,43]
[1,] 1.846105 1.657477 0.5256024 0.2524542 -0.2312519 0.702128 2.63002 1.289617
[2,] 1.846105 1.657477 0.5256024 0.2524542 -0.2312519 0.702128 2.63002 1.289617
          [,44]      [,45]      [,46]     [,47]    [,48]    [,49]      [,50]
[1,] -0.4279836 0.07071461 -0.8858007 0.7057583 0.286695 2.202242 -0.5649168
[2,] -0.4279836 0.07071461 -0.8858007 0.7057583 0.286695 2.202242 -0.5649168
         [,51]     [,52]  [,53]    [,54]    [,55]       [,56]     [,57]
[1,] 0.8578419 -1.324598 1.4705 1.207286 1.881617 -0.01184464 0.4890232
[2,] 0.8578419 -1.324598 1.4705 1.207286 1.881617 -0.01184464 0.4890232
        [,58]      [,59]     [,60]     [,61]    [,62]      [,63]    [,64]
[1,] 1.167681 -0.6566675 0.5949578 0.5618518 1.797676 -0.2491519 1.135185
[2,] 1.167681 -0.6566675 0.5949578 0.5618518 1.797676 -0.2491519 1.135185
         [,65]     [,66]     [,67]      [,68]     [,69]     [,70]      [,71]
[1,] 0.2700034 -1.301097 0.8298242 -0.2355829 0.8049629 0.2931756 -0.6352239
[2,] 0.2700034 -1.301097 0.8298242 -0.2355829 0.8049629 0.2931756 -0.6352239
         [,72]     [,73]     [,74]     [,75]     [,76]     [,77]     [,78]
[1,] -1.160055 0.4420948 0.1480256 -1.346142 -1.264587 -1.064692 -1.559719
[2,] -1.160055 0.4420948 0.1480256 -1.346142 -1.264587 -1.064692 -1.559719
         [,79]      [,80]     [,81]      [,82]      [,83]     [,84]      [,85]
[1,] 0.3118047 -0.1798758 -1.578361 -0.2416834 0.01335301 0.1086133 -0.5446599
[2,] 0.3118047 -0.1798758 -1.578361 -0.2416834 0.01335301 0.1086133 -0.5446599
         [,86]     [,87]     [,88]      [,89]      [,90]      [,91]      [,92]
[1,] 0.2591777 0.6734864 0.6834582 -0.5978792 -0.2548401 -0.1597862 -0.2620039
[2,] 0.2591777 0.6734864 0.6834582 -0.5978792 -0.2548401 -0.1597862 -0.2620039
          [,93]      [,94]     [,95]    [,96]     [,97]     [,98]     [,99]
[1,] -0.9681689 0.05574547 0.6591423 1.088645 0.9096922 -0.346876 0.6364432
[2,] -0.9681689 0.05574547 0.6591423 1.088645 0.9096922 -0.346876 0.6364432
        [,100]
[1,] -0.232859
[2,] -0.232859
> 
> 
> Max(tmp2)
[1] 2.556131
> Min(tmp2)
[1] -3.146281
> mean(tmp2)
[1] -0.1086454
> Sum(tmp2)
[1] -10.86454
> Var(tmp2)
[1] 1.064975
> 
> rowMeans(tmp2)
  [1] -1.305723227  0.967515236  0.026285936 -0.575849655  0.492548203
  [6]  0.095297115  0.140908640  1.413136884 -0.906009122  0.979026865
 [11]  1.164393119 -2.834647694  0.843238329  1.024945693 -0.247392015
 [16]  0.824754080 -0.360883978  1.147811486  0.578289372  0.201330360
 [21]  0.228162176  2.556131441 -1.856157807 -0.229409743 -0.718158293
 [26] -0.618729273  0.374399704 -0.621423053  1.738085099 -0.907460392
 [31] -0.683177422  1.161395836 -0.312497069  0.280056480 -0.537780904
 [36] -0.434384781 -1.139875180  0.831833650  1.502855373 -0.864580541
 [41] -0.448214589 -0.463246259 -0.349032539 -1.018754410 -0.086173655
 [46]  0.621704331  0.531158971  0.526622001 -1.483237627 -0.169971563
 [51]  0.094778226 -1.690215757  0.005271669 -1.488329491  0.164247272
 [56] -0.603370337  0.369641692 -2.325988303 -0.295113144 -0.385915672
 [61] -0.765296517 -1.228488747 -0.021166091  0.209469669  0.935265803
 [66] -0.242522049  0.128697424  0.416761912  1.188457060  1.205837138
 [71]  1.007215016  0.996769862 -0.180611652 -0.943245760  1.752988697
 [76] -0.431706196 -1.603868231 -0.059356850 -0.332878467  0.378985914
 [81]  0.661503806 -0.246220770 -1.133498229 -0.631096957 -2.064482850
 [86]  0.274386931 -1.306963256  0.918222564  0.150118923  0.999875577
 [91] -0.866954227 -0.430419938 -1.003353282  1.809172049 -3.146280769
 [96] -0.191038041 -2.218643915 -0.684495167 -0.194312731  1.104510904
> rowSums(tmp2)
  [1] -1.305723227  0.967515236  0.026285936 -0.575849655  0.492548203
  [6]  0.095297115  0.140908640  1.413136884 -0.906009122  0.979026865
 [11]  1.164393119 -2.834647694  0.843238329  1.024945693 -0.247392015
 [16]  0.824754080 -0.360883978  1.147811486  0.578289372  0.201330360
 [21]  0.228162176  2.556131441 -1.856157807 -0.229409743 -0.718158293
 [26] -0.618729273  0.374399704 -0.621423053  1.738085099 -0.907460392
 [31] -0.683177422  1.161395836 -0.312497069  0.280056480 -0.537780904
 [36] -0.434384781 -1.139875180  0.831833650  1.502855373 -0.864580541
 [41] -0.448214589 -0.463246259 -0.349032539 -1.018754410 -0.086173655
 [46]  0.621704331  0.531158971  0.526622001 -1.483237627 -0.169971563
 [51]  0.094778226 -1.690215757  0.005271669 -1.488329491  0.164247272
 [56] -0.603370337  0.369641692 -2.325988303 -0.295113144 -0.385915672
 [61] -0.765296517 -1.228488747 -0.021166091  0.209469669  0.935265803
 [66] -0.242522049  0.128697424  0.416761912  1.188457060  1.205837138
 [71]  1.007215016  0.996769862 -0.180611652 -0.943245760  1.752988697
 [76] -0.431706196 -1.603868231 -0.059356850 -0.332878467  0.378985914
 [81]  0.661503806 -0.246220770 -1.133498229 -0.631096957 -2.064482850
 [86]  0.274386931 -1.306963256  0.918222564  0.150118923  0.999875577
 [91] -0.866954227 -0.430419938 -1.003353282  1.809172049 -3.146280769
 [96] -0.191038041 -2.218643915 -0.684495167 -0.194312731  1.104510904
> 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.305723227  0.967515236  0.026285936 -0.575849655  0.492548203
  [6]  0.095297115  0.140908640  1.413136884 -0.906009122  0.979026865
 [11]  1.164393119 -2.834647694  0.843238329  1.024945693 -0.247392015
 [16]  0.824754080 -0.360883978  1.147811486  0.578289372  0.201330360
 [21]  0.228162176  2.556131441 -1.856157807 -0.229409743 -0.718158293
 [26] -0.618729273  0.374399704 -0.621423053  1.738085099 -0.907460392
 [31] -0.683177422  1.161395836 -0.312497069  0.280056480 -0.537780904
 [36] -0.434384781 -1.139875180  0.831833650  1.502855373 -0.864580541
 [41] -0.448214589 -0.463246259 -0.349032539 -1.018754410 -0.086173655
 [46]  0.621704331  0.531158971  0.526622001 -1.483237627 -0.169971563
 [51]  0.094778226 -1.690215757  0.005271669 -1.488329491  0.164247272
 [56] -0.603370337  0.369641692 -2.325988303 -0.295113144 -0.385915672
 [61] -0.765296517 -1.228488747 -0.021166091  0.209469669  0.935265803
 [66] -0.242522049  0.128697424  0.416761912  1.188457060  1.205837138
 [71]  1.007215016  0.996769862 -0.180611652 -0.943245760  1.752988697
 [76] -0.431706196 -1.603868231 -0.059356850 -0.332878467  0.378985914
 [81]  0.661503806 -0.246220770 -1.133498229 -0.631096957 -2.064482850
 [86]  0.274386931 -1.306963256  0.918222564  0.150118923  0.999875577
 [91] -0.866954227 -0.430419938 -1.003353282  1.809172049 -3.146280769
 [96] -0.191038041 -2.218643915 -0.684495167 -0.194312731  1.104510904
> rowMin(tmp2)
  [1] -1.305723227  0.967515236  0.026285936 -0.575849655  0.492548203
  [6]  0.095297115  0.140908640  1.413136884 -0.906009122  0.979026865
 [11]  1.164393119 -2.834647694  0.843238329  1.024945693 -0.247392015
 [16]  0.824754080 -0.360883978  1.147811486  0.578289372  0.201330360
 [21]  0.228162176  2.556131441 -1.856157807 -0.229409743 -0.718158293
 [26] -0.618729273  0.374399704 -0.621423053  1.738085099 -0.907460392
 [31] -0.683177422  1.161395836 -0.312497069  0.280056480 -0.537780904
 [36] -0.434384781 -1.139875180  0.831833650  1.502855373 -0.864580541
 [41] -0.448214589 -0.463246259 -0.349032539 -1.018754410 -0.086173655
 [46]  0.621704331  0.531158971  0.526622001 -1.483237627 -0.169971563
 [51]  0.094778226 -1.690215757  0.005271669 -1.488329491  0.164247272
 [56] -0.603370337  0.369641692 -2.325988303 -0.295113144 -0.385915672
 [61] -0.765296517 -1.228488747 -0.021166091  0.209469669  0.935265803
 [66] -0.242522049  0.128697424  0.416761912  1.188457060  1.205837138
 [71]  1.007215016  0.996769862 -0.180611652 -0.943245760  1.752988697
 [76] -0.431706196 -1.603868231 -0.059356850 -0.332878467  0.378985914
 [81]  0.661503806 -0.246220770 -1.133498229 -0.631096957 -2.064482850
 [86]  0.274386931 -1.306963256  0.918222564  0.150118923  0.999875577
 [91] -0.866954227 -0.430419938 -1.003353282  1.809172049 -3.146280769
 [96] -0.191038041 -2.218643915 -0.684495167 -0.194312731  1.104510904
> 
> colMeans(tmp2)
[1] -0.1086454
> colSums(tmp2)
[1] -10.86454
> colVars(tmp2)
[1] 1.064975
> colSd(tmp2)
[1] 1.031976
> colMax(tmp2)
[1] 2.556131
> colMin(tmp2)
[1] -3.146281
> colMedians(tmp2)
[1] -0.1752916
> colRanges(tmp2)
          [,1]
[1,] -3.146281
[2,]  2.556131
> 
> 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.4200226  2.4489532  7.0492706 -4.7851361  5.7978042 -0.0540844
 [7]  0.8021530 -2.0723221  1.6946429 -1.8210594
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6029888
[2,] -0.8116309
[3,] -0.2596295
[4,]  0.1412665
[5,]  1.8594450
> 
> rowApply(tmp,sum)
 [1] -2.7919011  0.5903618  0.8741322  2.8217019 -2.5243976  2.9430120
 [7]  2.2461711 -2.4537435  3.4396985  1.4951640
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    6    5    5    2    5    5    4   10     1
 [2,]   10    1    3    9    6    3    7    2    7     9
 [3,]    6    9    7   10    8    8    8    5    3    10
 [4,]    1    3    2    2    1    9    2    3    6     5
 [5,]    2   10    1    4   10    7   10   10    9     6
 [6,]    4    8    6    3    7    6    1    8    8     8
 [7,]    7    7    9    1    9   10    6    9    2     2
 [8,]    8    2    8    6    3    2    3    6    4     3
 [9,]    9    5   10    7    5    4    9    1    1     7
[10,]    5    4    4    8    4    1    4    7    5     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.94058248 -1.20884661  1.76086308 -1.19216009  3.96325981 -3.24559327
 [7] -4.24340107  0.20458675  5.03305214  0.82642698  5.31167376  0.05171861
[13] -0.42620684 -2.55481940  1.88027747 -1.49403904 -2.65843048 -4.12329591
[19] -2.65838854 -3.99888624
> colApply(tmp,quantile)[,1]
           [,1]
[1,] 0.07712106
[2,] 0.25165561
[3,] 0.31211175
[4,] 0.41859083
[5,] 0.88110323
> 
> rowApply(tmp,sum)
[1] -3.015982 -5.688567 -2.566223  1.548837  2.890308
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   11   15   12   17   10
[2,]    5   12   16    9    5
[3,]   13    5   14   18   15
[4,]    4    7    6   16   16
[5,]   20   17   15   19    6
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] 0.07712106 -1.33098333  0.2202052 -1.3542634  2.1152244 -0.2787504
[2,] 0.41859083 -0.02104005 -0.8975801 -0.7426516  0.6316361 -2.3204362
[3,] 0.25165561  0.96901486  0.2972315 -0.9697426  0.3371991  0.2893740
[4,] 0.88110323  0.17618363  1.1076408  0.8148127  1.4442160  0.2544171
[5,] 0.31211175 -1.00202172  1.0333656  1.0596848 -0.5650159 -1.1901978
           [,7]       [,8]       [,9]      [,10]     [,11]      [,12]
[1,] -0.3142115 -1.8531708  0.9592921  0.7194641 1.8316041 -0.4004971
[2,] -0.5283528  0.5541777  0.6885777  0.2468361 0.6462692 -0.9576330
[3,] -1.6658185 -0.8518432  2.1299894  1.2960918 0.9852173  0.1741673
[4,]  0.5600904  2.0531661 -0.4892470 -1.6189293 0.4518818  0.7237566
[5,] -2.2951088  0.3022569  1.7444401  0.1829642 1.3967014  0.5119248
          [,13]       [,14]      [,15]       [,16]      [,17]      [,18]
[1,] -1.0859602  0.20252535  0.4982612  0.70238636  1.8641972 -3.3502097
[2,]  1.1116800  0.01281738 -0.1363310 -1.50767854 -0.8264189 -0.1259636
[3,] -0.3713662 -1.19452625  1.2336947 -0.05707332 -1.5681433 -1.7290524
[4,] -0.6364861 -0.08930951 -1.0608066  0.54123829 -2.6692088  0.4204196
[5,]  0.5559256 -1.48632637  1.3454592 -1.17291182  0.5411433  0.6615102
           [,19]      [,20]
[1,] -0.19368910 -2.0445275
[2,] -1.48250131 -0.4525648
[3,] -0.06025662 -2.0620365
[4,] -0.45984064 -0.8562609
[5,] -0.46210086  1.4165035
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2       col3      col4     col5     col6       col7
row1 0.5500864 -0.1930665 -0.4967342 0.4144091 1.143031 1.923756 -0.3157482
          col8      col9     col10      col11     col12     col13     col14
row1 -1.465757 -1.458607 -1.714323 -0.7267976 0.5499303 0.8797812 0.2768584
        col15     col16    col17     col18     col19     col20
row1 1.223874 0.1752388 1.519179 0.4475276 -1.174762 0.5538453
> tmp[,"col10"]
          col10
row1 -1.7143228
row2  0.4220037
row3 -0.2530549
row4  1.6639287
row5 -0.4594253
> tmp[c("row1","row5"),]
           col1       col2       col3       col4     col5       col6       col7
row1  0.5500864 -0.1930665 -0.4967342  0.4144091 1.143031  1.9237557 -0.3157482
row5 -0.2309596  0.2322773  1.0155286 -0.2339955 1.779828 -0.5426777 -0.7115973
           col8       col9      col10      col11      col12      col13
row1 -1.4657574 -1.4586065 -1.7143228 -0.7267976  0.5499303  0.8797812
row5  0.9510468 -0.7947709 -0.4594253 -0.9245502 -1.3206286 -0.3271831
          col14      col15     col16     col17     col18     col19     col20
row1  0.2768584  1.2238737 0.1752388  1.519179 0.4475276 -1.174762 0.5538453
row5 -0.2135732 -0.2800396 0.5316035 -1.077768 0.4829820  2.145112 1.3252572
> tmp[,c("col6","col20")]
           col6      col20
row1  1.9237557  0.5538453
row2  0.2645631  0.7881648
row3 -1.1606174  0.4158708
row4 -0.9826736 -0.1895990
row5 -0.5426777  1.3252572
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  1.9237557 0.5538453
row5 -0.5426777 1.3252572
> 
> 
> 
> 
> 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 50.24002 50.50266 51.53668 49.60473 49.80486 104.9393 48.62259 49.06963
        col9    col10    col11   col12    col13    col14    col15    col16
row1 49.8747 50.07161 50.58713 47.9224 49.58141 50.75654 49.23088 49.37735
        col17    col18    col19    col20
row1 50.46591 49.00661 50.19784 105.7341
> tmp[,"col10"]
        col10
row1 50.07161
row2 30.27279
row3 32.14992
row4 30.95313
row5 48.73848
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.24002 50.50266 51.53668 49.60473 49.80486 104.9393 48.62259 49.06963
row5 49.57084 51.44496 50.87121 49.02961 51.56830 107.8111 47.91614 48.73796
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.87470 50.07161 50.58713 47.92240 49.58141 50.75654 49.23088 49.37735
row5 51.25726 48.73848 49.99041 48.49016 50.51173 48.68191 49.00917 47.37621
        col17    col18    col19    col20
row1 50.46591 49.00661 50.19784 105.7341
row5 49.06885 50.40985 48.76783 105.6581
> tmp[,c("col6","col20")]
          col6     col20
row1 104.93934 105.73413
row2  74.23997  77.11643
row3  74.10718  76.34406
row4  75.43948  73.99687
row5 107.81114 105.65808
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9393 105.7341
row5 107.8111 105.6581
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9393 105.7341
row5 107.8111 105.6581
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.1834391
[2,] -1.2593163
[3,]  0.7536344
[4,] -1.3712694
[5,] -0.3188324
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.4565334 0.12651809
[2,] -0.5706404 1.47450703
[3,] -0.2056369 1.45048225
[4,] -1.1246397 0.03362381
[5,] -1.4717456 0.40386674
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.6727332  0.4477057
[2,] -1.3390737  0.3119131
[3,]  1.2271258 -1.1934003
[4,]  0.2214509  0.6834657
[5,]  0.2269805 -0.4222216
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.6727332
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.6727332
[2,] -1.3390737
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]       [,4]      [,5]       [,6]      [,7]
row3 -0.9742988 0.6840310 -1.2696063  0.7826641  1.265547 -0.9121573 -1.544795
row1 -0.5093915 0.6144267  0.2494923 -0.8647914 -1.055280 -0.5046613 -1.085806
           [,8]       [,9]      [,10]      [,11]      [,12]      [,13]
row3 0.91666972  1.2545328 -1.1409261 -1.4742148 -2.2596270 -1.5692942
row1 0.06922017 -0.1508492 -0.1523743  0.7844815  0.3494478 -0.9172973
          [,14]      [,15]      [,16]      [,17]       [,18]      [,19]
row3 -1.1154464 0.07628607 -0.4349292  1.0203261  1.35171939 -0.3885036
row1  0.4971636 0.76624794  0.6716894 -0.5585122 -0.04818671  0.7142126
          [,20]
row3 0.89909581
row1 0.02687699
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]       [,3]       [,4]       [,5]      [,6]       [,7]
row2 1.137191 -1.134077 -0.1033408 -0.8545187 -0.2053735 0.2600403 -0.4318999
           [,8]     [,9]     [,10]
row2 -0.3264265 1.049186 0.3047114
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]      [,4]       [,5]      [,6]     [,7]
row5 -1.122591 -0.2844012 -1.905261 0.0422294 -0.8043969 -1.438712 1.532202
           [,8]      [,9]     [,10]      [,11]      [,12]    [,13]       [,14]
row5 -0.3830088 0.3179606 -1.150317 0.02139624 -0.2576819 1.082989 -0.07471329
         [,15]     [,16]     [,17]    [,18]     [,19]    [,20]
row5 -0.516744 0.3100019 -1.182406 0.250835 -1.760695 1.108825
> 
> 
> 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: 0x5d69a4348040>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc8603bcdcaf6"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc8602c13b549"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc86023f2fee0"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc86031064680"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc86029982c13"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc8605dad4ca9"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc8607d28064e"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc8603740018a"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc86060d359e9"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc860614513b9"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc8601d16577d"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc860513ffba2"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc8604915d7ea"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc86014203ef6"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fc860799e4329"
> 
> 
> ### 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: 0x5d69a48f0660>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5d69a48f0660>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5d69a48f0660>
> rowMedians(tmp)
  [1] -0.043582254 -0.149305210  0.199930001 -0.100901579 -0.414958305
  [6]  0.376662991  0.075932043  0.279680916  0.032977027 -0.150505579
 [11] -0.223172440 -0.072646725 -0.240656743 -0.119646922 -0.257322433
 [16]  0.018104674 -0.425781174  0.486288618 -0.483804932 -0.395627713
 [21]  0.016941443  0.136722364  0.017135558  0.041646322 -0.758958296
 [26] -0.180134054  0.896363146 -0.310401398  0.190364668  0.475863872
 [31] -0.286316354 -0.372465758 -0.231305953 -0.371963447 -0.080901792
 [36]  0.001902417 -0.411711788  0.032091859  0.603524108 -0.630889330
 [41]  0.307180056  0.027447221 -0.469482101  0.287462515 -0.306994617
 [46]  0.213896282 -0.159409907 -0.536470861 -0.075247836 -0.162670065
 [51]  0.500398287  0.030213409  0.120340061 -0.157028418 -0.268668140
 [56] -0.135270760 -0.346635096  0.674238885  0.536152588 -0.291007558
 [61] -0.045074627 -0.254494182  0.217320656  0.059878205 -0.064746462
 [66] -0.483274350 -0.536644469  0.833612778  0.240742207  0.022671695
 [71]  0.621261272 -0.416619188 -0.017022171 -0.271836157  0.451164581
 [76] -0.692343471 -0.535178294  0.431400595  0.243791754 -0.326581799
 [81] -0.170806175  0.554749259 -0.078070622 -0.082285433  0.511488523
 [86]  0.261594592 -0.087926510 -0.116360864 -0.360970176 -0.424033160
 [91]  0.337715182 -0.054454161 -0.301460813  0.374360227  0.126119552
 [96]  0.398919811 -0.253333725  0.103191182  0.652094219  0.104212088
[101] -0.655998016  0.071292980 -0.129243825  0.389471249 -0.230494413
[106]  0.010318611 -0.133323003  0.319746292  0.046354403 -0.199086901
[111] -0.162864128 -0.442586325  0.393556049 -0.306855865  0.329553848
[116] -0.702344445 -0.144593445  0.431115820 -0.626830019 -0.550204011
[121] -0.699376634 -0.287610549 -0.639750211 -0.359357725 -0.162169810
[126] -0.121109197  0.106373557 -0.018870687  0.117821924  0.277765078
[131]  0.065822281 -0.250421148 -0.158730457  0.066098449 -0.094718477
[136] -0.592417782  0.513653185  0.093374322  0.060827058  0.094768094
[141] -0.153807461  0.636346475  0.165914854 -0.270266162 -0.231480247
[146] -0.097288704  0.044935851 -0.697737262  0.381199056  0.014415132
[151] -0.293245968 -0.444472517  0.551072436  0.558285949 -0.220706972
[156] -0.067846166  0.311610603 -0.358759646  0.018436310  0.435599354
[161]  0.339692230  0.260692914 -0.047222699 -0.499078835 -0.441618994
[166] -0.516099462  0.233496681 -0.123797845  0.127165514  0.158447482
[171] -0.089558048 -0.302134487  0.028648889  0.413642484 -0.201520660
[176] -0.070033133  0.314390807 -0.845521642  0.278320774 -0.316285777
[181]  0.269571580 -0.577588383  0.123411532  0.254449329 -0.076887054
[186]  0.490654913 -0.167421122 -0.147390787 -0.237502817  0.169318715
[191]  0.040895328 -0.273550724  0.250688469 -0.366363658  0.082567991
[196]  0.437999779  0.108379926 -0.172413906 -0.009183286 -0.899493048
[201] -0.193967400 -0.177589497  0.225428315 -0.489196171 -0.498421617
[206]  0.300024537  0.286948075 -0.123280263 -0.023211452  0.269222168
[211] -0.057022749 -0.245080560  0.190697299  0.020832589 -0.067313025
[216]  0.658180724  0.812645789 -0.158950807 -0.109499229 -0.113055370
[221]  0.330007538 -0.244994078  0.147489499 -0.062937839 -0.124793925
[226]  0.005283141  0.124281499  0.154010275  0.207448458  0.062639808
> 
> proc.time()
   user  system elapsed 
  1.276   1.599   2.864 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x62bffc51b0f0>
> .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: 0x62bffc51b0f0>
> .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: 0x62bffc51b0f0>
> .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: 0x62bffc51b0f0>
> 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: 0x62bffd369690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62bffd369690>
> .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: 0x62bffd369690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62bffd369690>
> .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: 0x62bffd369690>
> 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: 0x62bffeda3010>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62bffeda3010>
> .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: 0x62bffeda3010>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62bffeda3010>
> .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: 0x62bffeda3010>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x62bffeda3010>
> .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: 0x62bffeda3010>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x62bffeda3010>
> .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: 0x62bffeda3010>
> 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: 0x62bffedf3070>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x62bffedf3070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62bffedf3070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62bffedf3070>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2fd8b7718ef9a3" "BufferedMatrixFile2fd8b77c371cb9"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2fd8b7718ef9a3" "BufferedMatrixFile2fd8b77c371cb9"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x62bffcaad7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62bffcaad7e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62bffcaad7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62bffcaad7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x62bffcaad7e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x62bffcaad7e0>
> .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: 0x62bffea493b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62bffea493b0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62bffea493b0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x62bffea493b0>
> 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: 0x62bffcc0f520>
> .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: 0x62bffcc0f520>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.249   0.053   0.291 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

Example timings