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

This page was generated on 2026-05-19 12:53 -0400 (Tue, 19 May 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4898
kjohnson3macOS 13.7.7 Venturaarm644.6.0 Patched (2026-05-01 r89994) -- "Because it was There" 4617
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 259/2377HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.77.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-05-18 13:45 -0400 (Mon, 18 May 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 2d99771
git_last_commit_date: 2026-04-28 08:32:08 -0400 (Tue, 28 Apr 2026)
nebbiolo2Linux (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  YES
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.77.0
Command: /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.77.0.tar.gz
StartedAt: 2026-05-18 21:59:33 -0400 (Mon, 18 May 2026)
EndedAt: 2026-05-18 21:59:57 -0400 (Mon, 18 May 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.24-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-19 01:59:33 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.77.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.24-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.24-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.77.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.24-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.24-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.24-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.24-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.24-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.24-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.24-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.260   0.040   0.289 

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.24-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] "Mon May 18 21:59:49 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon May 18 21:59:49 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: 0x5c5b8964b520>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon May 18 21:59:49 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon May 18 21:59:49 2026"
> 
> ColMode(tmp2)
<pointer: 0x5c5b8964b520>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]        [,2]       [,3]       [,4]
[1,] 99.6831453 -0.74421040  0.2953940 -0.2936851
[2,]  0.7062871  0.08115516 -1.1338998  0.3627855
[3,] -0.5774128  1.17427480 -1.4909219  0.5085795
[4,]  0.2591689 -0.68914952 -0.2889444 -1.7883478
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]      [,4]
[1,] 99.6831453 0.74421040 0.2953940 0.2936851
[2,]  0.7062871 0.08115516 1.1338998 0.3627855
[3,]  0.5774128 1.17427480 1.4909219 0.5085795
[4,]  0.2591689 0.68914952 0.2889444 1.7883478
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9841447 0.8626763 0.5435016 0.5419272
[2,] 0.8404089 0.2848774 1.0648473 0.6023168
[3,] 0.7598769 1.0836396 1.2210331 0.7131476
[4,] 0.5090863 0.8301503 0.5375355 1.3372912
> 
> 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.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.52459 34.37097 30.73041 30.71296
[2,]  34.11038 27.92993 36.78237 31.38595
[3,]  33.17618 37.01067 38.70125 32.64006
[4,]  30.35003 33.99065 30.66430 40.16126
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5c5b8a4368f0>
> exp(tmp5)
<pointer: 0x5c5b8a4368f0>
> log(tmp5,2)
<pointer: 0x5c5b8a4368f0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.3185
> Min(tmp5)
[1] 52.99141
> mean(tmp5)
[1] 74.0518
> Sum(tmp5)
[1] 14810.36
> Var(tmp5)
[1] 853.2342
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.00306 72.78500 74.27737 72.60297 69.24608 74.92479 71.62998 72.43810
 [9] 70.56304 73.04758
> rowSums(tmp5)
 [1] 1780.061 1455.700 1485.547 1452.059 1384.922 1498.496 1432.600 1448.762
 [9] 1411.261 1460.952
> rowVars(tmp5)
 [1] 7970.60186   66.66825   75.04259   88.97456   93.23269   50.14597
 [7]   66.39243   55.22031  110.43670   72.63155
> rowSd(tmp5)
 [1] 89.278227  8.165063  8.662713  9.432633  9.655708  7.081382  8.148155
 [8]  7.431037 10.508887  8.522415
> rowMax(tmp5)
 [1] 467.31852  88.04601  92.36526  89.32295  85.88809  88.07885  90.80982
 [8]  88.89700  94.19904  88.96629
> rowMin(tmp5)
 [1] 53.98219 57.91003 58.99530 57.40918 53.00624 64.97898 56.65114 57.91566
 [9] 52.99141 56.58280
> 
> colMeans(tmp5)
 [1] 106.80231  70.56671  73.82504  74.13236  76.51659  76.51697  76.80148
 [8]  74.27745  71.71968  69.76180  67.28458  73.55083  70.45487  69.83819
[15]  67.71331  73.37438  72.86158  71.41336  69.75393  73.87049
> colSums(tmp5)
 [1] 1068.0231  705.6671  738.2504  741.3236  765.1659  765.1697  768.0148
 [8]  742.7745  717.1968  697.6180  672.8458  735.5083  704.5487  698.3819
[15]  677.1331  733.7438  728.6158  714.1336  697.5393  738.7049
> colVars(tmp5)
 [1] 16087.49784    33.76448   115.45579    53.33163    24.94234    45.56570
 [7]    75.45552    62.29785    69.14148    72.86035    51.74277    75.28753
[13]    75.82802    89.17516    77.64134    68.63914    50.24584   145.25618
[19]    87.47865    90.27914
> colSd(tmp5)
 [1] 126.836500   5.810721  10.745036   7.302851   4.994230   6.750237
 [7]   8.686514   7.892899   8.315136   8.535828   7.193244   8.676839
[13]   8.707929   9.443260   8.811432   8.284874   7.088430  12.052227
[19]   9.353002   9.501534
> colMax(tmp5)
 [1] 467.31852  77.60897  88.96629  84.58081  83.34476  88.89700  92.36526
 [8]  89.32295  87.33520  83.98074  79.05126  94.19904  84.12421  84.80211
[15]  80.02894  85.88809  85.47975  90.80982  84.92279  87.15430
> colMin(tmp5)
 [1] 57.29556 58.13249 59.56903 63.92500 68.89318 67.60252 62.64681 62.34828
 [9] 59.20911 58.49558 57.91003 63.50237 57.82252 57.40918 53.98219 62.65708
[17] 65.10145 52.99141 53.00624 56.58280
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 89.00306 72.78500 74.27737 72.60297 69.24608 74.92479       NA 72.43810
 [9] 70.56304 73.04758
> rowSums(tmp5)
 [1] 1780.061 1455.700 1485.547 1452.059 1384.922 1498.496       NA 1448.762
 [9] 1411.261 1460.952
> rowVars(tmp5)
 [1] 7970.60186   66.66825   75.04259   88.97456   93.23269   50.14597
 [7]   67.73702   55.22031  110.43670   72.63155
> rowSd(tmp5)
 [1] 89.278227  8.165063  8.662713  9.432633  9.655708  7.081382  8.230250
 [8]  7.431037 10.508887  8.522415
> rowMax(tmp5)
 [1] 467.31852  88.04601  92.36526  89.32295  85.88809  88.07885        NA
 [8]  88.89700  94.19904  88.96629
> rowMin(tmp5)
 [1] 53.98219 57.91003 58.99530 57.40918 53.00624 64.97898       NA 57.91566
 [9] 52.99141 56.58280
> 
> colMeans(tmp5)
 [1] 106.80231  70.56671  73.82504  74.13236  76.51659  76.51697  76.80148
 [8]  74.27745  71.71968  69.76180  67.28458  73.55083  70.45487  69.83819
[15]  67.71331  73.37438  72.86158  71.41336        NA  73.87049
> colSums(tmp5)
 [1] 1068.0231  705.6671  738.2504  741.3236  765.1659  765.1697  768.0148
 [8]  742.7745  717.1968  697.6180  672.8458  735.5083  704.5487  698.3819
[15]  677.1331  733.7438  728.6158  714.1336        NA  738.7049
> colVars(tmp5)
 [1] 16087.49784    33.76448   115.45579    53.33163    24.94234    45.56570
 [7]    75.45552    62.29785    69.14148    72.86035    51.74277    75.28753
[13]    75.82802    89.17516    77.64134    68.63914    50.24584   145.25618
[19]          NA    90.27914
> colSd(tmp5)
 [1] 126.836500   5.810721  10.745036   7.302851   4.994230   6.750237
 [7]   8.686514   7.892899   8.315136   8.535828   7.193244   8.676839
[13]   8.707929   9.443260   8.811432   8.284874   7.088430  12.052227
[19]         NA   9.501534
> colMax(tmp5)
 [1] 467.31852  77.60897  88.96629  84.58081  83.34476  88.89700  92.36526
 [8]  89.32295  87.33520  83.98074  79.05126  94.19904  84.12421  84.80211
[15]  80.02894  85.88809  85.47975  90.80982        NA  87.15430
> colMin(tmp5)
 [1] 57.29556 58.13249 59.56903 63.92500 68.89318 67.60252 62.64681 62.34828
 [9] 59.20911 58.49558 57.91003 63.50237 57.82252 57.40918 53.98219 62.65708
[17] 65.10145 52.99141       NA 56.58280
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.3185
> Min(tmp5,na.rm=TRUE)
[1] 52.99141
> mean(tmp5,na.rm=TRUE)
[1] 74.03215
> Sum(tmp5,na.rm=TRUE)
[1] 14732.4
> Var(tmp5,na.rm=TRUE)
[1] 857.4659
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.00306 72.78500 74.27737 72.60297 69.24608 74.92479 71.29678 72.43810
 [9] 70.56304 73.04758
> rowSums(tmp5,na.rm=TRUE)
 [1] 1780.061 1455.700 1485.547 1452.059 1384.922 1498.496 1354.639 1448.762
 [9] 1411.261 1460.952
> rowVars(tmp5,na.rm=TRUE)
 [1] 7970.60186   66.66825   75.04259   88.97456   93.23269   50.14597
 [7]   67.73702   55.22031  110.43670   72.63155
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.278227  8.165063  8.662713  9.432633  9.655708  7.081382  8.230250
 [8]  7.431037 10.508887  8.522415
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.31852  88.04601  92.36526  89.32295  85.88809  88.07885  90.80982
 [8]  88.89700  94.19904  88.96629
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.98219 57.91003 58.99530 57.40918 53.00624 64.97898 56.65114 57.91566
 [9] 52.99141 56.58280
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 106.80231  70.56671  73.82504  74.13236  76.51659  76.51697  76.80148
 [8]  74.27745  71.71968  69.76180  67.28458  73.55083  70.45487  69.83819
[15]  67.71331  73.37438  72.86158  71.41336  68.84205  73.87049
> colSums(tmp5,na.rm=TRUE)
 [1] 1068.0231  705.6671  738.2504  741.3236  765.1659  765.1697  768.0148
 [8]  742.7745  717.1968  697.6180  672.8458  735.5083  704.5487  698.3819
[15]  677.1331  733.7438  728.6158  714.1336  619.5784  738.7049
> colVars(tmp5,na.rm=TRUE)
 [1] 16087.49784    33.76448   115.45579    53.33163    24.94234    45.56570
 [7]    75.45552    62.29785    69.14148    72.86035    51.74277    75.28753
[13]    75.82802    89.17516    77.64134    68.63914    50.24584   145.25618
[19]    89.05876    90.27914
> colSd(tmp5,na.rm=TRUE)
 [1] 126.836500   5.810721  10.745036   7.302851   4.994230   6.750237
 [7]   8.686514   7.892899   8.315136   8.535828   7.193244   8.676839
[13]   8.707929   9.443260   8.811432   8.284874   7.088430  12.052227
[19]   9.437095   9.501534
> colMax(tmp5,na.rm=TRUE)
 [1] 467.31852  77.60897  88.96629  84.58081  83.34476  88.89700  92.36526
 [8]  89.32295  87.33520  83.98074  79.05126  94.19904  84.12421  84.80211
[15]  80.02894  85.88809  85.47975  90.80982  84.92279  87.15430
> colMin(tmp5,na.rm=TRUE)
 [1] 57.29556 58.13249 59.56903 63.92500 68.89318 67.60252 62.64681 62.34828
 [9] 59.20911 58.49558 57.91003 63.50237 57.82252 57.40918 53.98219 62.65708
[17] 65.10145 52.99141 53.00624 56.58280
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.00306 72.78500 74.27737 72.60297 69.24608 74.92479      NaN 72.43810
 [9] 70.56304 73.04758
> rowSums(tmp5,na.rm=TRUE)
 [1] 1780.061 1455.700 1485.547 1452.059 1384.922 1498.496    0.000 1448.762
 [9] 1411.261 1460.952
> rowVars(tmp5,na.rm=TRUE)
 [1] 7970.60186   66.66825   75.04259   88.97456   93.23269   50.14597
 [7]         NA   55.22031  110.43670   72.63155
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.278227  8.165063  8.662713  9.432633  9.655708  7.081382        NA
 [8]  7.431037 10.508887  8.522415
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.31852  88.04601  92.36526  89.32295  85.88809  88.07885        NA
 [8]  88.89700  94.19904  88.96629
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.98219 57.91003 58.99530 57.40918 53.00624 64.97898       NA 57.91566
 [9] 52.99141 56.58280
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.08510  70.45566  74.95503  73.66766  76.58582  77.50747  76.77826
 [8]  74.63844  71.42605  70.18607  68.20008  73.53010  70.15175  68.17553
[15]  68.94244  74.29329  73.07275  69.25820       NaN  74.66599
> colSums(tmp5,na.rm=TRUE)
 [1] 999.7659 634.1009 674.5952 663.0089 689.2723 697.5672 691.0043 671.7460
 [9] 642.8345 631.6746 613.8007 661.7709 631.3658 613.5798 620.4819 668.6397
[17] 657.6548 623.3238   0.0000 671.9939
> colVars(tmp5,na.rm=TRUE)
 [1] 17892.08414    37.84630   115.52300    57.56862    28.00622    40.22426
 [7]    84.88139    68.61907    76.81425    79.94288    48.78158    84.69364
[13]    84.27288    69.22221    70.35045    67.71941    56.02491   111.16009
[19]          NA    94.44482
> colSd(tmp5,na.rm=TRUE)
 [1] 133.761295   6.151935  10.748163   7.587399   5.292090   6.342260
 [7]   9.213110   8.283663   8.764374   8.941078   6.984381   9.202915
[13]   9.180026   8.319989   8.387517   8.229180   7.484979  10.543249
[19]         NA   9.718272
> colMax(tmp5,na.rm=TRUE)
 [1] 467.31852  77.60897  88.96629  84.58081  83.34476  88.89700  92.36526
 [8]  89.32295  87.33520  83.98074  79.05126  94.19904  84.12421  82.71444
[15]  80.02894  85.88809  85.47975  84.75840      -Inf  87.15430
> colMin(tmp5,na.rm=TRUE)
 [1] 57.29556 58.13249 59.56903 63.92500 68.89318 69.41241 62.64681 62.34828
 [9] 59.20911 58.49558 57.91003 63.50237 57.82252 57.40918 53.98219 62.65708
[17] 65.10145 52.99141      Inf 56.58280
> 
> 
> 
> 
> 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] 125.1557 168.0463 317.2513 288.0665 294.7349 148.2140 149.3680 268.5271
 [9] 289.4084 184.2607
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 125.1557 168.0463 317.2513 288.0665 294.7349 148.2140 149.3680 268.5271
 [9] 289.4084 184.2607
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.136868e-13 -1.705303e-13  0.000000e+00  5.684342e-14 -1.421085e-13
 [6]  5.684342e-14 -5.684342e-14  1.421085e-13 -2.131628e-13 -5.684342e-14
[11] -5.684342e-14  2.842171e-14 -5.684342e-14 -1.705303e-13 -2.842171e-13
[16]  2.842171e-14  1.421085e-13 -1.421085e-13 -2.842171e-14  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   6 
10   8 
9   9 
10   20 
4   13 
6   14 
5   6 
8   8 
2   13 
1   2 
10   19 
6   20 
6   13 
4   2 
2   16 
1   3 
2   10 
8   8 
4   10 
3   19 
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.615869
> Min(tmp)
[1] -2.035163
> mean(tmp)
[1] 0.07208461
> Sum(tmp)
[1] 7.208461
> Var(tmp)
[1] 1.094898
> 
> rowMeans(tmp)
[1] 0.07208461
> rowSums(tmp)
[1] 7.208461
> rowVars(tmp)
[1] 1.094898
> rowSd(tmp)
[1] 1.046374
> rowMax(tmp)
[1] 2.615869
> rowMin(tmp)
[1] -2.035163
> 
> colMeans(tmp)
  [1] -0.16860423 -0.25338462 -0.97856396 -1.24913394 -0.39691609 -0.49948730
  [7]  0.21835670 -0.73127196 -2.03516263 -0.99308631  1.94033063  0.46114970
 [13]  1.66677752 -0.67257621  1.39903265 -0.10362911 -0.74399321  0.60020839
 [19] -1.18872241  0.96684778  0.40402982  0.68795927  0.44342184 -0.89635554
 [25]  0.90228949 -0.37774612  0.59863631  1.20559285  0.25762912  0.88735754
 [31]  1.51703823 -0.07870158  0.86497400  0.74395105 -0.01006623 -0.32873282
 [37] -0.72769368 -1.07048910  0.31427420 -0.19685248 -0.66353176 -0.49354501
 [43]  0.54399413 -0.59103986  1.49055372 -1.05954487  0.12706467  0.10872732
 [49]  1.70496916  0.84999520  0.64353018  0.58098686 -1.22985453 -1.20496846
 [55] -0.04615696  1.86960321 -0.25090782 -1.22564837  1.66630022  0.19535162
 [61] -1.29538081 -1.04925551  1.32355070  1.24412351 -1.25324346 -0.72955096
 [67] -1.81693500  2.60883759 -0.98432812  0.39247586  1.65496871 -0.94417294
 [73]  0.32342117 -1.75589938 -0.44846809 -1.11136769 -0.11230738 -0.03442046
 [79]  0.04489403 -0.45114442 -0.24613298  1.76801212 -0.26182998  1.01950249
 [85] -0.11587895 -0.43052350  0.86874991 -0.58656134  0.14392270  0.27062937
 [91] -0.26461618 -1.08789550  0.90744953  0.95473114  1.99299592 -1.76064341
 [97]  1.58698397  0.71303240  2.61586880 -1.87969958
> colSums(tmp)
  [1] -0.16860423 -0.25338462 -0.97856396 -1.24913394 -0.39691609 -0.49948730
  [7]  0.21835670 -0.73127196 -2.03516263 -0.99308631  1.94033063  0.46114970
 [13]  1.66677752 -0.67257621  1.39903265 -0.10362911 -0.74399321  0.60020839
 [19] -1.18872241  0.96684778  0.40402982  0.68795927  0.44342184 -0.89635554
 [25]  0.90228949 -0.37774612  0.59863631  1.20559285  0.25762912  0.88735754
 [31]  1.51703823 -0.07870158  0.86497400  0.74395105 -0.01006623 -0.32873282
 [37] -0.72769368 -1.07048910  0.31427420 -0.19685248 -0.66353176 -0.49354501
 [43]  0.54399413 -0.59103986  1.49055372 -1.05954487  0.12706467  0.10872732
 [49]  1.70496916  0.84999520  0.64353018  0.58098686 -1.22985453 -1.20496846
 [55] -0.04615696  1.86960321 -0.25090782 -1.22564837  1.66630022  0.19535162
 [61] -1.29538081 -1.04925551  1.32355070  1.24412351 -1.25324346 -0.72955096
 [67] -1.81693500  2.60883759 -0.98432812  0.39247586  1.65496871 -0.94417294
 [73]  0.32342117 -1.75589938 -0.44846809 -1.11136769 -0.11230738 -0.03442046
 [79]  0.04489403 -0.45114442 -0.24613298  1.76801212 -0.26182998  1.01950249
 [85] -0.11587895 -0.43052350  0.86874991 -0.58656134  0.14392270  0.27062937
 [91] -0.26461618 -1.08789550  0.90744953  0.95473114  1.99299592 -1.76064341
 [97]  1.58698397  0.71303240  2.61586880 -1.87969958
> 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.16860423 -0.25338462 -0.97856396 -1.24913394 -0.39691609 -0.49948730
  [7]  0.21835670 -0.73127196 -2.03516263 -0.99308631  1.94033063  0.46114970
 [13]  1.66677752 -0.67257621  1.39903265 -0.10362911 -0.74399321  0.60020839
 [19] -1.18872241  0.96684778  0.40402982  0.68795927  0.44342184 -0.89635554
 [25]  0.90228949 -0.37774612  0.59863631  1.20559285  0.25762912  0.88735754
 [31]  1.51703823 -0.07870158  0.86497400  0.74395105 -0.01006623 -0.32873282
 [37] -0.72769368 -1.07048910  0.31427420 -0.19685248 -0.66353176 -0.49354501
 [43]  0.54399413 -0.59103986  1.49055372 -1.05954487  0.12706467  0.10872732
 [49]  1.70496916  0.84999520  0.64353018  0.58098686 -1.22985453 -1.20496846
 [55] -0.04615696  1.86960321 -0.25090782 -1.22564837  1.66630022  0.19535162
 [61] -1.29538081 -1.04925551  1.32355070  1.24412351 -1.25324346 -0.72955096
 [67] -1.81693500  2.60883759 -0.98432812  0.39247586  1.65496871 -0.94417294
 [73]  0.32342117 -1.75589938 -0.44846809 -1.11136769 -0.11230738 -0.03442046
 [79]  0.04489403 -0.45114442 -0.24613298  1.76801212 -0.26182998  1.01950249
 [85] -0.11587895 -0.43052350  0.86874991 -0.58656134  0.14392270  0.27062937
 [91] -0.26461618 -1.08789550  0.90744953  0.95473114  1.99299592 -1.76064341
 [97]  1.58698397  0.71303240  2.61586880 -1.87969958
> colMin(tmp)
  [1] -0.16860423 -0.25338462 -0.97856396 -1.24913394 -0.39691609 -0.49948730
  [7]  0.21835670 -0.73127196 -2.03516263 -0.99308631  1.94033063  0.46114970
 [13]  1.66677752 -0.67257621  1.39903265 -0.10362911 -0.74399321  0.60020839
 [19] -1.18872241  0.96684778  0.40402982  0.68795927  0.44342184 -0.89635554
 [25]  0.90228949 -0.37774612  0.59863631  1.20559285  0.25762912  0.88735754
 [31]  1.51703823 -0.07870158  0.86497400  0.74395105 -0.01006623 -0.32873282
 [37] -0.72769368 -1.07048910  0.31427420 -0.19685248 -0.66353176 -0.49354501
 [43]  0.54399413 -0.59103986  1.49055372 -1.05954487  0.12706467  0.10872732
 [49]  1.70496916  0.84999520  0.64353018  0.58098686 -1.22985453 -1.20496846
 [55] -0.04615696  1.86960321 -0.25090782 -1.22564837  1.66630022  0.19535162
 [61] -1.29538081 -1.04925551  1.32355070  1.24412351 -1.25324346 -0.72955096
 [67] -1.81693500  2.60883759 -0.98432812  0.39247586  1.65496871 -0.94417294
 [73]  0.32342117 -1.75589938 -0.44846809 -1.11136769 -0.11230738 -0.03442046
 [79]  0.04489403 -0.45114442 -0.24613298  1.76801212 -0.26182998  1.01950249
 [85] -0.11587895 -0.43052350  0.86874991 -0.58656134  0.14392270  0.27062937
 [91] -0.26461618 -1.08789550  0.90744953  0.95473114  1.99299592 -1.76064341
 [97]  1.58698397  0.71303240  2.61586880 -1.87969958
> colMedians(tmp)
  [1] -0.16860423 -0.25338462 -0.97856396 -1.24913394 -0.39691609 -0.49948730
  [7]  0.21835670 -0.73127196 -2.03516263 -0.99308631  1.94033063  0.46114970
 [13]  1.66677752 -0.67257621  1.39903265 -0.10362911 -0.74399321  0.60020839
 [19] -1.18872241  0.96684778  0.40402982  0.68795927  0.44342184 -0.89635554
 [25]  0.90228949 -0.37774612  0.59863631  1.20559285  0.25762912  0.88735754
 [31]  1.51703823 -0.07870158  0.86497400  0.74395105 -0.01006623 -0.32873282
 [37] -0.72769368 -1.07048910  0.31427420 -0.19685248 -0.66353176 -0.49354501
 [43]  0.54399413 -0.59103986  1.49055372 -1.05954487  0.12706467  0.10872732
 [49]  1.70496916  0.84999520  0.64353018  0.58098686 -1.22985453 -1.20496846
 [55] -0.04615696  1.86960321 -0.25090782 -1.22564837  1.66630022  0.19535162
 [61] -1.29538081 -1.04925551  1.32355070  1.24412351 -1.25324346 -0.72955096
 [67] -1.81693500  2.60883759 -0.98432812  0.39247586  1.65496871 -0.94417294
 [73]  0.32342117 -1.75589938 -0.44846809 -1.11136769 -0.11230738 -0.03442046
 [79]  0.04489403 -0.45114442 -0.24613298  1.76801212 -0.26182998  1.01950249
 [85] -0.11587895 -0.43052350  0.86874991 -0.58656134  0.14392270  0.27062937
 [91] -0.26461618 -1.08789550  0.90744953  0.95473114  1.99299592 -1.76064341
 [97]  1.58698397  0.71303240  2.61586880 -1.87969958
> colRanges(tmp)
           [,1]       [,2]      [,3]      [,4]       [,5]       [,6]      [,7]
[1,] -0.1686042 -0.2533846 -0.978564 -1.249134 -0.3969161 -0.4994873 0.2183567
[2,] -0.1686042 -0.2533846 -0.978564 -1.249134 -0.3969161 -0.4994873 0.2183567
          [,8]      [,9]      [,10]    [,11]     [,12]    [,13]      [,14]
[1,] -0.731272 -2.035163 -0.9930863 1.940331 0.4611497 1.666778 -0.6725762
[2,] -0.731272 -2.035163 -0.9930863 1.940331 0.4611497 1.666778 -0.6725762
        [,15]      [,16]      [,17]     [,18]     [,19]     [,20]     [,21]
[1,] 1.399033 -0.1036291 -0.7439932 0.6002084 -1.188722 0.9668478 0.4040298
[2,] 1.399033 -0.1036291 -0.7439932 0.6002084 -1.188722 0.9668478 0.4040298
         [,22]     [,23]      [,24]     [,25]      [,26]     [,27]    [,28]
[1,] 0.6879593 0.4434218 -0.8963555 0.9022895 -0.3777461 0.5986363 1.205593
[2,] 0.6879593 0.4434218 -0.8963555 0.9022895 -0.3777461 0.5986363 1.205593
         [,29]     [,30]    [,31]       [,32]    [,33]    [,34]       [,35]
[1,] 0.2576291 0.8873575 1.517038 -0.07870158 0.864974 0.743951 -0.01006623
[2,] 0.2576291 0.8873575 1.517038 -0.07870158 0.864974 0.743951 -0.01006623
          [,36]      [,37]     [,38]     [,39]      [,40]      [,41]     [,42]
[1,] -0.3287328 -0.7276937 -1.070489 0.3142742 -0.1968525 -0.6635318 -0.493545
[2,] -0.3287328 -0.7276937 -1.070489 0.3142742 -0.1968525 -0.6635318 -0.493545
         [,43]      [,44]    [,45]     [,46]     [,47]     [,48]    [,49]
[1,] 0.5439941 -0.5910399 1.490554 -1.059545 0.1270647 0.1087273 1.704969
[2,] 0.5439941 -0.5910399 1.490554 -1.059545 0.1270647 0.1087273 1.704969
         [,50]     [,51]     [,52]     [,53]     [,54]       [,55]    [,56]
[1,] 0.8499952 0.6435302 0.5809869 -1.229855 -1.204968 -0.04615696 1.869603
[2,] 0.8499952 0.6435302 0.5809869 -1.229855 -1.204968 -0.04615696 1.869603
          [,57]     [,58]  [,59]     [,60]     [,61]     [,62]    [,63]
[1,] -0.2509078 -1.225648 1.6663 0.1953516 -1.295381 -1.049256 1.323551
[2,] -0.2509078 -1.225648 1.6663 0.1953516 -1.295381 -1.049256 1.323551
        [,64]     [,65]     [,66]     [,67]    [,68]      [,69]     [,70]
[1,] 1.244124 -1.253243 -0.729551 -1.816935 2.608838 -0.9843281 0.3924759
[2,] 1.244124 -1.253243 -0.729551 -1.816935 2.608838 -0.9843281 0.3924759
        [,71]      [,72]     [,73]     [,74]      [,75]     [,76]      [,77]
[1,] 1.654969 -0.9441729 0.3234212 -1.755899 -0.4484681 -1.111368 -0.1123074
[2,] 1.654969 -0.9441729 0.3234212 -1.755899 -0.4484681 -1.111368 -0.1123074
           [,78]      [,79]      [,80]     [,81]    [,82]    [,83]    [,84]
[1,] -0.03442046 0.04489403 -0.4511444 -0.246133 1.768012 -0.26183 1.019502
[2,] -0.03442046 0.04489403 -0.4511444 -0.246133 1.768012 -0.26183 1.019502
          [,85]      [,86]     [,87]      [,88]     [,89]     [,90]      [,91]
[1,] -0.1158789 -0.4305235 0.8687499 -0.5865613 0.1439227 0.2706294 -0.2646162
[2,] -0.1158789 -0.4305235 0.8687499 -0.5865613 0.1439227 0.2706294 -0.2646162
         [,92]     [,93]     [,94]    [,95]     [,96]    [,97]     [,98]
[1,] -1.087895 0.9074495 0.9547311 1.992996 -1.760643 1.586984 0.7130324
[2,] -1.087895 0.9074495 0.9547311 1.992996 -1.760643 1.586984 0.7130324
        [,99]  [,100]
[1,] 2.615869 -1.8797
[2,] 2.615869 -1.8797
> 
> 
> Max(tmp2)
[1] 2.191594
> Min(tmp2)
[1] -1.978204
> mean(tmp2)
[1] 0.07559345
> Sum(tmp2)
[1] 7.559345
> Var(tmp2)
[1] 0.8991536
> 
> rowMeans(tmp2)
  [1]  0.48554701 -0.26134168 -0.11901455  1.70352963 -0.49309909 -0.19420126
  [7] -1.01477874 -0.92645159 -0.45077198 -0.07511806  0.18397878 -0.68867692
 [13] -1.64807083 -0.25789998  1.57064258 -1.38949021  0.37993912  0.47070716
 [19] -0.39164683 -1.40320882  1.09916200 -0.05481566 -0.02373888  1.57464326
 [25]  0.44917105 -0.85765262  1.18123451 -1.67494619 -1.64821753  0.70316638
 [31] -0.21205352 -1.36595522 -1.25358764  1.14768751 -0.65348364  0.26795263
 [37]  1.30006520 -0.10828147 -1.97820364  0.05304341 -0.12190904 -1.11897826
 [43] -1.23603862  1.02898669 -0.29668354  0.46532178  0.76184948  0.37069145
 [49] -0.57880945  0.77677723 -0.69744365  1.02509597  0.24752524  1.58677089
 [55]  0.28276446  1.12961687 -0.90055756 -0.21943906  0.48185062  0.56395656
 [61]  0.75956904 -0.60974223 -0.25590366  2.15628460  0.06164394  0.69577425
 [67]  1.70086214  0.59249402  0.81846352 -1.30778509 -0.97070162  0.03684836
 [73]  0.85789355  1.16763561  0.96084938 -0.50801242 -1.09168487 -0.73987915
 [79]  0.46149006  0.17111711 -0.40496106 -0.56250960  1.32558057  1.83203907
 [85]  0.95328079  0.69603475 -0.75333790  1.60307610 -0.11911660 -1.67656526
 [91] -0.21253904 -0.12623139  0.80591493 -0.27393005 -0.80006141  0.32577739
 [97] -0.24385874  0.89824206  2.19159420  0.16658825
> rowSums(tmp2)
  [1]  0.48554701 -0.26134168 -0.11901455  1.70352963 -0.49309909 -0.19420126
  [7] -1.01477874 -0.92645159 -0.45077198 -0.07511806  0.18397878 -0.68867692
 [13] -1.64807083 -0.25789998  1.57064258 -1.38949021  0.37993912  0.47070716
 [19] -0.39164683 -1.40320882  1.09916200 -0.05481566 -0.02373888  1.57464326
 [25]  0.44917105 -0.85765262  1.18123451 -1.67494619 -1.64821753  0.70316638
 [31] -0.21205352 -1.36595522 -1.25358764  1.14768751 -0.65348364  0.26795263
 [37]  1.30006520 -0.10828147 -1.97820364  0.05304341 -0.12190904 -1.11897826
 [43] -1.23603862  1.02898669 -0.29668354  0.46532178  0.76184948  0.37069145
 [49] -0.57880945  0.77677723 -0.69744365  1.02509597  0.24752524  1.58677089
 [55]  0.28276446  1.12961687 -0.90055756 -0.21943906  0.48185062  0.56395656
 [61]  0.75956904 -0.60974223 -0.25590366  2.15628460  0.06164394  0.69577425
 [67]  1.70086214  0.59249402  0.81846352 -1.30778509 -0.97070162  0.03684836
 [73]  0.85789355  1.16763561  0.96084938 -0.50801242 -1.09168487 -0.73987915
 [79]  0.46149006  0.17111711 -0.40496106 -0.56250960  1.32558057  1.83203907
 [85]  0.95328079  0.69603475 -0.75333790  1.60307610 -0.11911660 -1.67656526
 [91] -0.21253904 -0.12623139  0.80591493 -0.27393005 -0.80006141  0.32577739
 [97] -0.24385874  0.89824206  2.19159420  0.16658825
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.48554701 -0.26134168 -0.11901455  1.70352963 -0.49309909 -0.19420126
  [7] -1.01477874 -0.92645159 -0.45077198 -0.07511806  0.18397878 -0.68867692
 [13] -1.64807083 -0.25789998  1.57064258 -1.38949021  0.37993912  0.47070716
 [19] -0.39164683 -1.40320882  1.09916200 -0.05481566 -0.02373888  1.57464326
 [25]  0.44917105 -0.85765262  1.18123451 -1.67494619 -1.64821753  0.70316638
 [31] -0.21205352 -1.36595522 -1.25358764  1.14768751 -0.65348364  0.26795263
 [37]  1.30006520 -0.10828147 -1.97820364  0.05304341 -0.12190904 -1.11897826
 [43] -1.23603862  1.02898669 -0.29668354  0.46532178  0.76184948  0.37069145
 [49] -0.57880945  0.77677723 -0.69744365  1.02509597  0.24752524  1.58677089
 [55]  0.28276446  1.12961687 -0.90055756 -0.21943906  0.48185062  0.56395656
 [61]  0.75956904 -0.60974223 -0.25590366  2.15628460  0.06164394  0.69577425
 [67]  1.70086214  0.59249402  0.81846352 -1.30778509 -0.97070162  0.03684836
 [73]  0.85789355  1.16763561  0.96084938 -0.50801242 -1.09168487 -0.73987915
 [79]  0.46149006  0.17111711 -0.40496106 -0.56250960  1.32558057  1.83203907
 [85]  0.95328079  0.69603475 -0.75333790  1.60307610 -0.11911660 -1.67656526
 [91] -0.21253904 -0.12623139  0.80591493 -0.27393005 -0.80006141  0.32577739
 [97] -0.24385874  0.89824206  2.19159420  0.16658825
> rowMin(tmp2)
  [1]  0.48554701 -0.26134168 -0.11901455  1.70352963 -0.49309909 -0.19420126
  [7] -1.01477874 -0.92645159 -0.45077198 -0.07511806  0.18397878 -0.68867692
 [13] -1.64807083 -0.25789998  1.57064258 -1.38949021  0.37993912  0.47070716
 [19] -0.39164683 -1.40320882  1.09916200 -0.05481566 -0.02373888  1.57464326
 [25]  0.44917105 -0.85765262  1.18123451 -1.67494619 -1.64821753  0.70316638
 [31] -0.21205352 -1.36595522 -1.25358764  1.14768751 -0.65348364  0.26795263
 [37]  1.30006520 -0.10828147 -1.97820364  0.05304341 -0.12190904 -1.11897826
 [43] -1.23603862  1.02898669 -0.29668354  0.46532178  0.76184948  0.37069145
 [49] -0.57880945  0.77677723 -0.69744365  1.02509597  0.24752524  1.58677089
 [55]  0.28276446  1.12961687 -0.90055756 -0.21943906  0.48185062  0.56395656
 [61]  0.75956904 -0.60974223 -0.25590366  2.15628460  0.06164394  0.69577425
 [67]  1.70086214  0.59249402  0.81846352 -1.30778509 -0.97070162  0.03684836
 [73]  0.85789355  1.16763561  0.96084938 -0.50801242 -1.09168487 -0.73987915
 [79]  0.46149006  0.17111711 -0.40496106 -0.56250960  1.32558057  1.83203907
 [85]  0.95328079  0.69603475 -0.75333790  1.60307610 -0.11911660 -1.67656526
 [91] -0.21253904 -0.12623139  0.80591493 -0.27393005 -0.80006141  0.32577739
 [97] -0.24385874  0.89824206  2.19159420  0.16658825
> 
> colMeans(tmp2)
[1] 0.07559345
> colSums(tmp2)
[1] 7.559345
> colVars(tmp2)
[1] 0.8991536
> colSd(tmp2)
[1] 0.9482371
> colMax(tmp2)
[1] 2.191594
> colMin(tmp2)
[1] -1.978204
> colMedians(tmp2)
[1] 0.006554737
> colRanges(tmp2)
          [,1]
[1,] -1.978204
[2,]  2.191594
> 
> 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.5284594 -3.2269845  2.6882196  3.5332889  0.3566165 -2.6159471
 [7] -3.2445580 -2.5329181  3.6021777  1.6759943
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.58940426
[2,] -0.05455284
[3,]  0.38895357
[4,]  0.77522106
[5,]  1.63040854
> 
> rowApply(tmp,sum)
 [1]  0.5784177 -3.1726079 -0.8646685  3.5332564  0.7615375  0.1756185
 [7]  1.1053581 -0.6157776 -1.6229461  2.8861605
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    2    9    9    3    6    6   10    8     9
 [2,]    8    1    1    2   10    1    4    5    9     1
 [3,]    9   10    7    8    5    3    1    9    3     8
 [4,]    6    9    6    7    4    9   10    4    7     5
 [5,]    2    7    3    3    1    4    7    8    4    10
 [6,]    4    8    8    4    6    2    8    3    1     3
 [7,]    3    4    2   10    2    5    5    1   10     2
 [8,]    7    5    5    1    7    7    9    2    2     6
 [9,]   10    6    4    5    9    8    2    7    6     7
[10,]    1    3   10    6    8   10    3    6    5     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.4636224  0.1983926  0.7871211  2.1546196 -0.6055133  0.4086660
 [7] -4.0610491 -2.2927583  1.3178376  2.7114510  4.0555420 -3.2656652
[13] -2.2395707 -1.2228593 -3.0177487  1.1865098 -2.1175008  5.0352706
[19]  1.1583759  3.0167188
> colApply(tmp,quantile)[,1]
          [,1]
[1,] -1.587275
[2,] -1.291102
[3,] -0.680251
[4,] -0.595192
[5,]  1.690197
> 
> rowApply(tmp,sum)
[1] -3.533139  1.638147 -2.177167  7.441998 -2.625621
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    5    3   20    4    7
[2,]   19   15   12   10    2
[3,]   18    2   11   11   18
[4,]   11   17   13    6   17
[5,]   16    9    9   16    1
> 
> 
> as.matrix(tmp)
          [,1]       [,2]        [,3]        [,4]        [,5]        [,6]
[1,] -1.291102  1.4504238  1.16437044  0.03555616  0.90031824 -1.51171499
[2,] -1.587275  0.7527364 -1.69394409  1.24274399 -0.02623788 -0.02060883
[3,]  1.690197  0.1306156  0.03845752  0.30839581 -0.43603225  0.63716026
[4,] -0.595192  0.1644162  0.24948916 -0.45545550  1.36482777  1.63337991
[5,] -0.680251 -2.2997994  1.02874806  1.02337915 -2.40838914 -0.32955039
           [,7]         [,8]        [,9]       [,10]      [,11]      [,12]
[1,] -1.6590616 -1.149453522  0.67616346  0.10000187  1.5746911 -0.1849646
[2,] -0.3251871 -1.430853230 -0.04247478  0.38054619  1.3083509 -1.8057210
[3,] -1.5021050  0.522234276  1.05907517  1.24550946  1.2109617  0.3205185
[4,]  0.6120162 -0.228948696 -1.13636763  1.02662819 -0.2719763 -0.5619005
[5,] -1.1867115 -0.005737165  0.76144137 -0.04123467  0.2335147 -1.0335976
           [,13]      [,14]     [,15]      [,16]       [,17]      [,18]
[1,] -0.53645836 -2.0897329 -1.443029 -0.8452152 -0.47382736  1.1167712
[2,]  0.55871776 -0.8456958 -0.190997  1.7628809  0.49564382  1.1232932
[3,] -1.13068472 -0.1482199 -1.220378 -0.7596414 -1.92951835 -0.4976663
[4,] -1.19549483  2.6286938 -1.624662  0.4900041  0.08653093  3.0511737
[5,]  0.06434944 -0.7679045  1.461317  0.5384813 -0.29632982  0.2416988
           [,19]      [,20]
[1,]  0.07747199  0.5556519
[2,]  1.65314045  0.3290875
[3,] -1.23705952 -0.4789876
[4,]  1.53698876  0.6678472
[5,] -0.87216576  1.9431198
> 
> 
> 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.24-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.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  561  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-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.5294824 0.794313 -1.312226 0.1247548 0.8004124 1.257781 -1.112924
           col8    col9     col10     col11     col12     col13     col14
row1 -0.3776779 1.52543 0.7717775 0.5698215 0.4705643 -0.153216 0.3841461
          col15   col16      col17     col18     col19     col20
row1 -0.7728364 1.27183 -0.1751105 0.6979195 -1.104883 0.1842273
> tmp[,"col10"]
          col10
row1  0.7717775
row2 -0.1535135
row3 -0.2181898
row4 -0.3586848
row5  0.7293609
> tmp[c("row1","row5"),]
          col1       col2      col3      col4      col5      col6      col7
row1 0.5294824  0.7943130 -1.312226 0.1247548 0.8004124  1.257781 -1.112924
row5 1.2515601 -0.2830896 -1.008849 1.3385663 0.6187030 -1.386610  1.191403
           col8      col9     col10     col11       col12     col13      col14
row1 -0.3776779 1.5254297 0.7717775 0.5698215  0.47056432 -0.153216  0.3841461
row5  0.8698636 0.1493195 0.7293609 0.9834546 -0.04474905 -1.662933 -0.5480298
           col15      col16       col17      col18      col19      col20
row1 -0.77283645  1.2718304 -0.17511050  0.6979195 -1.1048831  0.1842273
row5  0.06311951 -0.2475855 -0.08898952 -1.1087335 -0.5978891 -0.2691482
> tmp[,c("col6","col20")]
           col6      col20
row1  1.2577812  0.1842273
row2 -0.1282417 -0.5550121
row3 -0.4724795 -1.4112842
row4 -0.7087122  0.5632599
row5 -1.3866100 -0.2691482
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1  1.257781  0.1842273
row5 -1.386610 -0.2691482
> 
> 
> 
> 
> 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 51.3954 49.33861 49.82442 50.77704 51.3067 105.9349 49.50107 49.50983
         col9    col10   col11    col12    col13    col14    col15   col16
row1 51.17374 48.57188 49.8291 51.49149 50.29342 50.97175 50.35973 48.5311
        col17    col18    col19    col20
row1 49.29711 49.90287 48.79289 104.7378
> tmp[,"col10"]
        col10
row1 48.57188
row2 32.04098
row3 30.14558
row4 29.12791
row5 52.12536
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.39540 49.33861 49.82442 50.77704 51.30670 105.9349 49.50107 49.50983
row5 49.81266 48.85462 49.97816 49.27676 48.82913 103.9715 48.62463 48.62660
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.17374 48.57188 49.82910 51.49149 50.29342 50.97175 50.35973 48.53110
row5 49.87056 52.12536 49.90163 49.30759 50.18487 50.08955 50.59335 50.33898
        col17    col18    col19    col20
row1 49.29711 49.90287 48.79289 104.7378
row5 50.82179 49.93615 50.30555 105.9770
> tmp[,c("col6","col20")]
          col6     col20
row1 105.93490 104.73779
row2  74.16482  75.69841
row3  76.32022  74.36164
row4  74.29616  73.86658
row5 103.97151 105.97700
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.9349 104.7378
row5 103.9715 105.9770
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.9349 104.7378
row5 103.9715 105.9770
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.9191751
[2,] -0.7135263
[3,] -1.5131170
[4,]  1.1819609
[5,] -0.5268648
> tmp[,c("col17","col7")]
          col17          col7
[1,] -0.5524104  2.930804e-01
[2,]  0.5345207 -7.378410e-01
[3,] -1.7268897  2.371718e-05
[4,]  1.2292716  7.758614e-02
[5,] -0.4303050  1.485450e+00
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.7963489  1.5723279
[2,] -2.0967968  0.6757630
[3,]  2.3117922 -0.9587219
[4,]  0.2349292 -0.9018480
[5,]  0.4937116 -1.1967356
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.796349
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.796349
[2,] -2.096797
> 
> 
> 
> 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.6125679 -0.2533223 -2.146108 -1.316382 0.1439404  1.043663 0.2036509
row1  1.2260517  0.5871612  2.327472  1.017790 0.1444817 -2.036734 1.3100622
          [,8]        [,9]       [,10]      [,11]     [,12]       [,13]
row3 0.3951827  0.08100023 -1.19704048 0.07696547 -1.410358 -0.91506667
row1 0.4239335 -0.30174354  0.07377748 0.36049342  1.155204  0.03611427
         [,14]      [,15]       [,16]       [,17]      [,18]      [,19]
row3 0.0244044 -0.5280295  0.09599462 -0.12408256 -1.1473469 -1.1721715
row1 0.6529640  0.4896323 -1.34543872 -0.07186937  0.4481582  0.9106388
          [,20]
row3  0.4177458
row1 -0.0371768
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]     [,5]      [,6]     [,7]
row2 -0.6081075 -2.781969 -1.354078 -0.3051125 1.670168 -1.194604 0.918543
         [,8]     [,9]     [,10]
row2 1.230746 1.233628 -1.278913
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]     [,3]      [,4]      [,5]       [,6]       [,7]
row5 0.8356406 0.6578619 1.383511 -0.707937 0.4312642 0.07630564 -0.8701632
           [,8]      [,9]      [,10]      [,11]     [,12]    [,13]       [,14]
row5 -0.4801068 0.7765024 -0.6264263 -0.4852825 0.5930061 1.061794 -0.09710771
          [,15]       [,16]    [,17]      [,18]      [,19]     [,20]
row5 -0.3176584 -0.01170839 1.029578 -0.1859247 -0.3205252 0.5355399
> 
> 
> 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: 0x5c5b89170940>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc4918470b"
 [2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc554efd2a"
 [3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc34906129"
 [4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc58836634"
 [5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc8fde5b2" 
 [6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc66610101"
 [7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc33505238"
 [8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc266869b3"
 [9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc2afd9877"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc543bc318"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc4c94b505"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc43eed23f"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc3aca2150"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc4ae3910b"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM9ebfc5505bf97"
> 
> 
> ### 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: 0x5c5b8b8c36d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5c5b8b8c36d0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5c5b8b8c36d0>
> rowMedians(tmp)
  [1]  0.443679570  0.061555753 -0.131692746 -0.197800357  0.043968049
  [6]  0.459844718 -0.096473338  0.624169324 -0.182760602 -0.135650587
 [11]  0.055495538 -0.119997799 -0.010325837 -0.013399683  0.577437679
 [16]  0.046500419 -0.026458414  0.543873285 -0.119339076  0.122791979
 [21]  0.092936213 -0.421502093 -0.261969405  0.924672565 -0.611804094
 [26]  0.015937777  0.273324888  0.254456061 -0.216936512  0.019732993
 [31] -0.075059144 -0.184488129 -0.191505121  0.186865361  0.680368031
 [36] -0.047557720 -0.483239399 -0.238247335 -0.258327696  0.137158435
 [41]  0.524123803 -0.491938429 -0.127213749  0.127565610 -0.105658172
 [46]  0.394184435 -0.165170226  0.048589475 -0.060136636  0.289674320
 [51] -0.017169990  0.217474597  0.003012767 -0.117861917  0.122592894
 [56]  0.171381665 -0.400148112  0.418642668 -0.015442748  0.068834010
 [61]  0.030774968  0.429475209 -0.163402069 -0.208323997  0.133258301
 [66]  0.663296005  0.491193965  0.105804988 -0.047703108 -0.068927761
 [71] -0.040707853 -0.076053659  0.019027683  0.637409301  0.298046383
 [76] -0.598480617 -0.701394656  0.341452096  0.072356610  0.112497892
 [81] -0.013711086  0.239622443 -0.492426799  0.015539398  0.551741286
 [86] -0.001784213 -0.139449160 -0.183741027 -0.401923516  0.382211828
 [91]  0.124305347  0.032228137  0.268215117  0.536536390 -0.398402169
 [96]  0.164968137  0.776054632 -0.095999710 -0.222611399 -0.058643521
[101]  0.123952427  0.313989419  0.120947939 -0.120454612 -0.182504886
[106] -0.355515009 -0.266448729 -0.084358210 -0.086740094  0.124204820
[111]  0.028597618  0.002277847  0.202113606  0.159035461  0.319254029
[116] -0.284306869 -0.210730520 -0.284557556  0.678921937  0.118977015
[121] -0.121552230  0.112330781  0.355956278 -0.093468123 -0.032993608
[126]  0.844678812  0.035491273 -0.340699699 -0.014452808 -0.662601910
[131] -0.256910605  0.373051191 -0.041454757 -0.312752365  0.117516011
[136]  0.204371867  0.114049905  0.214916943  0.085398180  0.312606713
[141]  0.554738027 -0.255195281  0.001718399  0.288302808 -0.062110612
[146]  0.128527204 -0.312633438  0.721525299 -0.048691167 -0.242323772
[151]  0.505216607  0.441123384 -0.390736565 -0.120291257  0.190331477
[156]  0.162237244  0.299652302 -0.185486015  0.547302114 -0.278143890
[161] -0.024592214 -0.256089948  0.044231093 -0.622982966  0.240671540
[166] -0.473806275  0.060724421  0.336401516 -0.714539367 -0.136352161
[171] -0.391606422  0.045505601 -0.506739634  0.232320129  0.177523830
[176] -0.293369571 -0.226090169  0.189634474 -0.311250188  0.056744792
[181]  0.204018299  0.071883212 -0.291164955  0.046938060  0.235079545
[186] -0.621363228  0.227969602  0.102288829 -0.123930000  0.028551972
[191] -0.570137034 -0.496685368  0.423743525  0.098398696 -0.013454394
[196] -0.342046568  0.195691951 -0.117526618  0.043579230  0.150766136
[201] -0.332386192 -0.216308468 -0.194172292  0.233091569 -0.283260467
[206] -0.064267547 -0.222144981  0.529729211 -0.421533595  0.140085586
[211]  0.030865583  0.137259240  0.088639710  0.389374788  0.313212670
[216] -0.315811592 -0.231324587 -0.384720058 -0.599793187  0.433774177
[221] -0.049412227 -0.125811788 -0.405985125  0.401009817 -0.253693496
[226] -0.205760149  0.581863202 -0.150021899 -0.427569427  0.237718155
> 
> proc.time()
   user  system elapsed 
  1.271   0.674   1.931 

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: 0x59b577b9e520>
> .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: 0x59b577b9e520>
> .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: 0x59b577b9e520>
> .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: 0x59b577b9e520>
> 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: 0x59b577747f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b577747f60>
> .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: 0x59b577747f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b577747f60>
> .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: 0x59b577747f60>
> 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: 0x59b5782f1b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b5782f1b40>
> .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: 0x59b5782f1b40>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x59b5782f1b40>
> .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: 0x59b5782f1b40>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x59b5782f1b40>
> .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: 0x59b5782f1b40>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x59b5782f1b40>
> .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: 0x59b5782f1b40>
> 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: 0x59b57832ebc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x59b57832ebc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b57832ebc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b57832ebc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile9ed6145371630" "BufferedMatrixFile9ed61c0581f8" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile9ed6145371630" "BufferedMatrixFile9ed61c0581f8" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b5782c8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b5782c8000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x59b5782c8000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x59b5782c8000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x59b5782c8000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x59b5782c8000>
> .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: 0x59b5773fbe30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b5773fbe30>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x59b5773fbe30>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x59b5773fbe30>
> 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: 0x59b577a25a50>
> .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: 0x59b577a25a50>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.252   0.044   0.285 

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.248   0.043   0.279 

Example timings