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

This page was generated on 2026-03-16 11:33 -0400 (Mon, 16 Mar 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences" 4837
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2026-03-01 r89506) -- "Unsuffered Consequences" 4053
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 256/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-03-15 13:40 -0400 (Sun, 15 Mar 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  ERROR    ERROR  skippedskipped
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2026-03-15 22:34:14 -0400 (Sun, 15 Mar 2026)
EndedAt: 2026-03-15 22:34:39 -0400 (Sun, 15 Mar 2026)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
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.229   0.056   0.274 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 479482 25.7    1050322 56.1   639251 34.2
Vcells 886403  6.8    8388608 64.0  2083267 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] "Sun Mar 15 22:34:29 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] "Sun Mar 15 22:34:29 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: 0x6155d9ff2ff0>
> 
> 
> 
> 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] "Sun Mar 15 22:34:30 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] "Sun Mar 15 22:34:30 2026"
> 
> ColMode(tmp2)
<pointer: 0x6155d9ff2ff0>
> 
> 
> 
> ### 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.7276543  1.38685583  0.88807496 -1.5128544
[2,] -0.2066953 -0.03782833  1.08933902 -0.4850682
[3,] -0.3676730 -1.04793493 -1.39263107 -0.1334299
[4,] -0.4427473  1.22540803 -0.01245285 -0.3403574
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]      [,4]
[1,] 99.7276543 1.38685583 0.88807496 1.5128544
[2,]  0.2066953 0.03782833 1.08933902 0.4850682
[3,]  0.3676730 1.04793493 1.39263107 0.1334299
[4,]  0.4427473 1.22540803 0.01245285 0.3403574
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9863734 1.1776484 0.9423773 1.2299814
[2,] 0.4546375 0.1944951 1.0437141 0.6964684
[3,] 0.6063605 1.0236869 1.1800979 0.3652806
[4,] 0.6653926 1.1069815 0.1115923 0.5834016
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.59139 38.16334 35.31185 38.81267
[2,]  29.75307 26.98278 36.52648 32.44975
[3,]  31.43128 36.28480 38.19361 28.78624
[4,]  32.09667 37.29522 26.12838 31.17437
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6155d99d9560>
> exp(tmp5)
<pointer: 0x6155d99d9560>
> log(tmp5,2)
<pointer: 0x6155d99d9560>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.4575
> Min(tmp5)
[1] 53.08006
> mean(tmp5)
[1] 72.56833
> Sum(tmp5)
[1] 14513.67
> Var(tmp5)
[1] 853.9482
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.81907 66.77282 69.91715 70.99570 71.11408 70.70138 73.15121 68.71881
 [9] 72.02254 71.47055
> rowSums(tmp5)
 [1] 1816.381 1335.456 1398.343 1419.914 1422.282 1414.028 1463.024 1374.376
 [9] 1440.451 1429.411
> rowVars(tmp5)
 [1] 7959.09509   65.81258   68.35994   58.04926   72.28759   55.63626
 [7]   55.33688   40.27864   55.52471   94.19093
> rowSd(tmp5)
 [1] 89.213761  8.112495  8.268007  7.619006  8.502211  7.458972  7.438876
 [8]  6.346545  7.451491  9.705201
> rowMax(tmp5)
 [1] 467.45755  84.45046  87.20193  82.06908  85.20043  82.44701  80.11539
 [8]  80.49794  85.09464  91.35836
> rowMin(tmp5)
 [1] 53.48222 55.70379 57.63116 54.38279 54.44066 53.08006 54.91202 58.43361
 [9] 55.42649 55.50954
> 
> colMeans(tmp5)
 [1] 106.03433  72.93621  75.69807  71.50650  66.90210  66.77740  67.19582
 [8]  70.85783  71.60345  69.87773  70.08188  74.74581  72.13830  71.04528
[15]  68.52385  71.32636  69.78830  69.89415  72.71034  71.72295
> colSums(tmp5)
 [1] 1060.3433  729.3621  756.9807  715.0650  669.0210  667.7740  671.9582
 [8]  708.5783  716.0345  698.7773  700.8188  747.4581  721.3830  710.4528
[15]  685.2385  713.2636  697.8830  698.9415  727.1034  717.2295
> colVars(tmp5)
 [1] 16163.87096    60.99123    63.69674    49.39725    76.52359    90.07902
 [7]    48.27667   113.08631    38.02077    23.99011    60.05461    87.93825
[13]    64.11085    84.54939    56.99876   148.53117    75.94091    44.25780
[19]    26.24119    78.99265
> colSd(tmp5)
 [1] 127.137213   7.809688   7.981024   7.028318   8.747776   9.490997
 [7]   6.948141  10.634205   6.166099   4.897970   7.749491   9.377540
[13]   8.006925   9.195074   7.549752  12.187336   8.714408   6.652653
[19]   5.122615   8.887781
> colMax(tmp5)
 [1] 467.45755  79.72073  82.44701  80.78348  80.49794  83.06444  77.36545
 [8]  85.09464  79.87883  78.74012  81.09957  87.20193  85.20043  87.28196
[15]  83.10832  91.35836  82.06908  78.35922  83.16632  88.45055
> colMin(tmp5)
 [1] 54.44066 56.16112 54.38279 59.91478 53.48222 53.65418 56.87650 55.50954
 [9] 60.20343 62.98212 55.42649 60.72514 58.43361 58.26624 54.91202 53.08006
[17] 56.86693 59.73215 67.74440 60.34270
> 
> 
> ### 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] 90.81907 66.77282       NA 70.99570 71.11408 70.70138 73.15121 68.71881
 [9] 72.02254 71.47055
> rowSums(tmp5)
 [1] 1816.381 1335.456       NA 1419.914 1422.282 1414.028 1463.024 1374.376
 [9] 1440.451 1429.411
> rowVars(tmp5)
 [1] 7959.09509   65.81258   66.79308   58.04926   72.28759   55.63626
 [7]   55.33688   40.27864   55.52471   94.19093
> rowSd(tmp5)
 [1] 89.213761  8.112495  8.172703  7.619006  8.502211  7.458972  7.438876
 [8]  6.346545  7.451491  9.705201
> rowMax(tmp5)
 [1] 467.45755  84.45046        NA  82.06908  85.20043  82.44701  80.11539
 [8]  80.49794  85.09464  91.35836
> rowMin(tmp5)
 [1] 53.48222 55.70379       NA 54.38279 54.44066 53.08006 54.91202 58.43361
 [9] 55.42649 55.50954
> 
> colMeans(tmp5)
 [1] 106.03433  72.93621        NA  71.50650  66.90210  66.77740  67.19582
 [8]  70.85783  71.60345  69.87773  70.08188  74.74581  72.13830  71.04528
[15]  68.52385  71.32636  69.78830  69.89415  72.71034  71.72295
> colSums(tmp5)
 [1] 1060.3433  729.3621        NA  715.0650  669.0210  667.7740  671.9582
 [8]  708.5783  716.0345  698.7773  700.8188  747.4581  721.3830  710.4528
[15]  685.2385  713.2636  697.8830  698.9415  727.1034  717.2295
> colVars(tmp5)
 [1] 16163.87096    60.99123          NA    49.39725    76.52359    90.07902
 [7]    48.27667   113.08631    38.02077    23.99011    60.05461    87.93825
[13]    64.11085    84.54939    56.99876   148.53117    75.94091    44.25780
[19]    26.24119    78.99265
> colSd(tmp5)
 [1] 127.137213   7.809688         NA   7.028318   8.747776   9.490997
 [7]   6.948141  10.634205   6.166099   4.897970   7.749491   9.377540
[13]   8.006925   9.195074   7.549752  12.187336   8.714408   6.652653
[19]   5.122615   8.887781
> colMax(tmp5)
 [1] 467.45755  79.72073        NA  80.78348  80.49794  83.06444  77.36545
 [8]  85.09464  79.87883  78.74012  81.09957  87.20193  85.20043  87.28196
[15]  83.10832  91.35836  82.06908  78.35922  83.16632  88.45055
> colMin(tmp5)
 [1] 54.44066 56.16112       NA 59.91478 53.48222 53.65418 56.87650 55.50954
 [9] 60.20343 62.98212 55.42649 60.72514 58.43361 58.26624 54.91202 53.08006
[17] 56.86693 59.73215 67.74440 60.34270
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.4575
> Min(tmp5,na.rm=TRUE)
[1] 53.08006
> mean(tmp5,na.rm=TRUE)
[1] 72.53353
> Sum(tmp5,na.rm=TRUE)
[1] 14434.17
> Var(tmp5,na.rm=TRUE)
[1] 858.0175
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.81907 66.77282 69.41305 70.99570 71.11408 70.70138 73.15121 68.71881
 [9] 72.02254 71.47055
> rowSums(tmp5,na.rm=TRUE)
 [1] 1816.381 1335.456 1318.848 1419.914 1422.282 1414.028 1463.024 1374.376
 [9] 1440.451 1429.411
> rowVars(tmp5,na.rm=TRUE)
 [1] 7959.09509   65.81258   66.79308   58.04926   72.28759   55.63626
 [7]   55.33688   40.27864   55.52471   94.19093
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.213761  8.112495  8.172703  7.619006  8.502211  7.458972  7.438876
 [8]  6.346545  7.451491  9.705201
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.45755  84.45046  87.20193  82.06908  85.20043  82.44701  80.11539
 [8]  80.49794  85.09464  91.35836
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.48222 55.70379 57.63116 54.38279 54.44066 53.08006 54.91202 58.43361
 [9] 55.42649 55.50954
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 106.03433  72.93621  75.27619  71.50650  66.90210  66.77740  67.19582
 [8]  70.85783  71.60345  69.87773  70.08188  74.74581  72.13830  71.04528
[15]  68.52385  71.32636  69.78830  69.89415  72.71034  71.72295
> colSums(tmp5,na.rm=TRUE)
 [1] 1060.3433  729.3621  677.4857  715.0650  669.0210  667.7740  671.9582
 [8]  708.5783  716.0345  698.7773  700.8188  747.4581  721.3830  710.4528
[15]  685.2385  713.2636  697.8830  698.9415  727.1034  717.2295
> colVars(tmp5,na.rm=TRUE)
 [1] 16163.87096    60.99123    69.65652    49.39725    76.52359    90.07902
 [7]    48.27667   113.08631    38.02077    23.99011    60.05461    87.93825
[13]    64.11085    84.54939    56.99876   148.53117    75.94091    44.25780
[19]    26.24119    78.99265
> colSd(tmp5,na.rm=TRUE)
 [1] 127.137213   7.809688   8.346048   7.028318   8.747776   9.490997
 [7]   6.948141  10.634205   6.166099   4.897970   7.749491   9.377540
[13]   8.006925   9.195074   7.549752  12.187336   8.714408   6.652653
[19]   5.122615   8.887781
> colMax(tmp5,na.rm=TRUE)
 [1] 467.45755  79.72073  82.44701  80.78348  80.49794  83.06444  77.36545
 [8]  85.09464  79.87883  78.74012  81.09957  87.20193  85.20043  87.28196
[15]  83.10832  91.35836  82.06908  78.35922  83.16632  88.45055
> colMin(tmp5,na.rm=TRUE)
 [1] 54.44066 56.16112 54.38279 59.91478 53.48222 53.65418 56.87650 55.50954
 [9] 60.20343 62.98212 55.42649 60.72514 58.43361 58.26624 54.91202 53.08006
[17] 56.86693 59.73215 67.74440 60.34270
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.81907 66.77282      NaN 70.99570 71.11408 70.70138 73.15121 68.71881
 [9] 72.02254 71.47055
> rowSums(tmp5,na.rm=TRUE)
 [1] 1816.381 1335.456    0.000 1419.914 1422.282 1414.028 1463.024 1374.376
 [9] 1440.451 1429.411
> rowVars(tmp5,na.rm=TRUE)
 [1] 7959.09509   65.81258         NA   58.04926   72.28759   55.63626
 [7]   55.33688   40.27864   55.52471   94.19093
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.213761  8.112495        NA  7.619006  8.502211  7.458972  7.438876
 [8]  6.346545  7.451491  9.705201
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.45755  84.45046        NA  82.06908  85.20043  82.44701  80.11539
 [8]  80.49794  85.09464  91.35836
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.48222 55.70379       NA 54.38279 54.44066 53.08006 54.91202 58.43361
 [9] 55.42649 55.50954
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.54702  72.64890       NaN  72.79447  67.85758  64.96772  67.27360
 [8]  71.20638  71.44558  69.88764  70.33787  73.36180  72.12667  71.92352
[15]  68.49814  70.35869  71.13910  69.38667  73.26211  72.95854
> colSums(tmp5,na.rm=TRUE)
 [1] 994.9232 653.8401   0.0000 655.1502 610.7182 584.7095 605.4624 640.8574
 [9] 643.0103 628.9887 633.0408 660.2562 649.1400 647.3117 616.4833 633.2282
[17] 640.2519 624.4801 659.3590 656.6268
> colVars(tmp5,na.rm=TRUE)
 [1] 17955.25528    67.68643          NA    36.90969    75.81836    64.49613
 [7]    54.24319   125.85539    42.49299    26.98777    66.82421    77.38123
[13]    72.12319    86.44081    64.11616   156.56314    64.90627    46.89277
[19]    26.09626    71.69147
> colSd(tmp5,na.rm=TRUE)
 [1] 133.997221   8.227177         NA   6.075334   8.707374   8.030948
 [7]   7.364998  11.218529   6.518665   5.194975   8.174608   8.796660
[13]   8.492537   9.297355   8.007257  12.512520   8.056443   6.847829
[19]   5.108450   8.467082
> colMax(tmp5,na.rm=TRUE)
 [1] 467.45755  79.72073      -Inf  80.78348  80.49794  74.39379  77.36545
 [8]  85.09464  79.87883  78.74012  81.09957  84.45046  85.20043  87.28196
[15]  83.10832  91.35836  82.06908  78.35922  83.16632  88.45055
> colMin(tmp5,na.rm=TRUE)
 [1] 54.44066 56.16112      Inf 64.88537 53.48222 53.65418 56.87650 55.50954
 [9] 60.20343 62.98212 55.42649 60.72514 58.43361 58.26624 54.91202 53.08006
[17] 56.86693 59.73215 69.05156 60.34270
> 
> 
> 
> 
> 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] 202.4599 257.9731 318.2340 196.4542 164.7265 239.0709 152.6185 323.4194
 [9] 197.9298 176.0219
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 202.4599 257.9731 318.2340 196.4542 164.7265 239.0709 152.6185 323.4194
 [9] 197.9298 176.0219
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14  0.000000e+00 -5.684342e-14  5.684342e-14  1.705303e-13
 [6] -2.842171e-14  4.263256e-14  2.842171e-14  1.421085e-13  0.000000e+00
[11] -5.684342e-14 -2.842171e-14 -2.842171e-14 -1.136868e-13  0.000000e+00
[16] -8.526513e-14  0.000000e+00  0.000000e+00  7.105427e-14  7.105427e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   4 
3   20 
5   19 
8   5 
8   18 
8   8 
6   4 
8   19 
1   6 
3   19 
4   13 
3   5 
8   15 
4   4 
4   7 
7   11 
2   13 
1   4 
3   9 
10   7 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.085111
> Min(tmp)
[1] -2.35551
> mean(tmp)
[1] -0.283236
> Sum(tmp)
[1] -28.3236
> Var(tmp)
[1] 0.9175418
> 
> rowMeans(tmp)
[1] -0.283236
> rowSums(tmp)
[1] -28.3236
> rowVars(tmp)
[1] 0.9175418
> rowSd(tmp)
[1] 0.957884
> rowMax(tmp)
[1] 2.085111
> rowMin(tmp)
[1] -2.35551
> 
> colMeans(tmp)
  [1] -0.85804540 -0.68582384  1.47840369 -0.38462543 -1.08264282 -0.25381910
  [7] -0.03840864  0.43204946 -1.95062604 -0.36543847 -0.12962345 -0.77193399
 [13]  0.56984434 -1.63313225 -0.72460768 -1.63275161 -1.14065941 -1.09309069
 [19] -1.80483333  1.46041483 -0.78766576  0.54021694  0.82223145  0.18473436
 [25] -1.90523714  0.58877440 -0.38728403 -0.44177993 -1.67340527  0.68930325
 [31]  0.96110045 -0.13456023  0.52096092  0.22599886  0.13369532 -0.15341746
 [37] -1.20318216 -0.55135865 -2.14240706  0.53562415 -1.34381031  0.68866629
 [43] -0.12595512  0.87262330 -0.34777501 -2.04723082 -0.34636989 -2.07148363
 [49] -2.35551047 -1.81690506 -0.92111044 -0.54687084 -1.37454708  1.04827270
 [55] -0.70978934 -0.17212625  0.85218953 -0.95259330 -1.66392563  0.25761261
 [61] -0.57133022  0.34770256 -0.17881049  0.16044804 -1.30481497  0.55937758
 [67]  0.19757804 -0.65513603  0.57528962 -1.55201811  0.58806527 -0.18124386
 [73]  0.11128344 -0.44191918  1.40177110 -0.68171644  2.08511103  0.07637645
 [79] -0.58957677 -1.28548694  0.49805599  0.15064732 -1.29405226 -0.69274424
 [85]  0.16011624 -0.77280163  0.52660980  1.71723995 -0.29966627  0.22712113
 [91] -0.66271943  1.33134109  0.46419295 -0.06668299  1.63273817  0.13662994
 [97] -0.07695526 -0.54742458 -1.10144068 -0.45110518
> colSums(tmp)
  [1] -0.85804540 -0.68582384  1.47840369 -0.38462543 -1.08264282 -0.25381910
  [7] -0.03840864  0.43204946 -1.95062604 -0.36543847 -0.12962345 -0.77193399
 [13]  0.56984434 -1.63313225 -0.72460768 -1.63275161 -1.14065941 -1.09309069
 [19] -1.80483333  1.46041483 -0.78766576  0.54021694  0.82223145  0.18473436
 [25] -1.90523714  0.58877440 -0.38728403 -0.44177993 -1.67340527  0.68930325
 [31]  0.96110045 -0.13456023  0.52096092  0.22599886  0.13369532 -0.15341746
 [37] -1.20318216 -0.55135865 -2.14240706  0.53562415 -1.34381031  0.68866629
 [43] -0.12595512  0.87262330 -0.34777501 -2.04723082 -0.34636989 -2.07148363
 [49] -2.35551047 -1.81690506 -0.92111044 -0.54687084 -1.37454708  1.04827270
 [55] -0.70978934 -0.17212625  0.85218953 -0.95259330 -1.66392563  0.25761261
 [61] -0.57133022  0.34770256 -0.17881049  0.16044804 -1.30481497  0.55937758
 [67]  0.19757804 -0.65513603  0.57528962 -1.55201811  0.58806527 -0.18124386
 [73]  0.11128344 -0.44191918  1.40177110 -0.68171644  2.08511103  0.07637645
 [79] -0.58957677 -1.28548694  0.49805599  0.15064732 -1.29405226 -0.69274424
 [85]  0.16011624 -0.77280163  0.52660980  1.71723995 -0.29966627  0.22712113
 [91] -0.66271943  1.33134109  0.46419295 -0.06668299  1.63273817  0.13662994
 [97] -0.07695526 -0.54742458 -1.10144068 -0.45110518
> 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.85804540 -0.68582384  1.47840369 -0.38462543 -1.08264282 -0.25381910
  [7] -0.03840864  0.43204946 -1.95062604 -0.36543847 -0.12962345 -0.77193399
 [13]  0.56984434 -1.63313225 -0.72460768 -1.63275161 -1.14065941 -1.09309069
 [19] -1.80483333  1.46041483 -0.78766576  0.54021694  0.82223145  0.18473436
 [25] -1.90523714  0.58877440 -0.38728403 -0.44177993 -1.67340527  0.68930325
 [31]  0.96110045 -0.13456023  0.52096092  0.22599886  0.13369532 -0.15341746
 [37] -1.20318216 -0.55135865 -2.14240706  0.53562415 -1.34381031  0.68866629
 [43] -0.12595512  0.87262330 -0.34777501 -2.04723082 -0.34636989 -2.07148363
 [49] -2.35551047 -1.81690506 -0.92111044 -0.54687084 -1.37454708  1.04827270
 [55] -0.70978934 -0.17212625  0.85218953 -0.95259330 -1.66392563  0.25761261
 [61] -0.57133022  0.34770256 -0.17881049  0.16044804 -1.30481497  0.55937758
 [67]  0.19757804 -0.65513603  0.57528962 -1.55201811  0.58806527 -0.18124386
 [73]  0.11128344 -0.44191918  1.40177110 -0.68171644  2.08511103  0.07637645
 [79] -0.58957677 -1.28548694  0.49805599  0.15064732 -1.29405226 -0.69274424
 [85]  0.16011624 -0.77280163  0.52660980  1.71723995 -0.29966627  0.22712113
 [91] -0.66271943  1.33134109  0.46419295 -0.06668299  1.63273817  0.13662994
 [97] -0.07695526 -0.54742458 -1.10144068 -0.45110518
> colMin(tmp)
  [1] -0.85804540 -0.68582384  1.47840369 -0.38462543 -1.08264282 -0.25381910
  [7] -0.03840864  0.43204946 -1.95062604 -0.36543847 -0.12962345 -0.77193399
 [13]  0.56984434 -1.63313225 -0.72460768 -1.63275161 -1.14065941 -1.09309069
 [19] -1.80483333  1.46041483 -0.78766576  0.54021694  0.82223145  0.18473436
 [25] -1.90523714  0.58877440 -0.38728403 -0.44177993 -1.67340527  0.68930325
 [31]  0.96110045 -0.13456023  0.52096092  0.22599886  0.13369532 -0.15341746
 [37] -1.20318216 -0.55135865 -2.14240706  0.53562415 -1.34381031  0.68866629
 [43] -0.12595512  0.87262330 -0.34777501 -2.04723082 -0.34636989 -2.07148363
 [49] -2.35551047 -1.81690506 -0.92111044 -0.54687084 -1.37454708  1.04827270
 [55] -0.70978934 -0.17212625  0.85218953 -0.95259330 -1.66392563  0.25761261
 [61] -0.57133022  0.34770256 -0.17881049  0.16044804 -1.30481497  0.55937758
 [67]  0.19757804 -0.65513603  0.57528962 -1.55201811  0.58806527 -0.18124386
 [73]  0.11128344 -0.44191918  1.40177110 -0.68171644  2.08511103  0.07637645
 [79] -0.58957677 -1.28548694  0.49805599  0.15064732 -1.29405226 -0.69274424
 [85]  0.16011624 -0.77280163  0.52660980  1.71723995 -0.29966627  0.22712113
 [91] -0.66271943  1.33134109  0.46419295 -0.06668299  1.63273817  0.13662994
 [97] -0.07695526 -0.54742458 -1.10144068 -0.45110518
> colMedians(tmp)
  [1] -0.85804540 -0.68582384  1.47840369 -0.38462543 -1.08264282 -0.25381910
  [7] -0.03840864  0.43204946 -1.95062604 -0.36543847 -0.12962345 -0.77193399
 [13]  0.56984434 -1.63313225 -0.72460768 -1.63275161 -1.14065941 -1.09309069
 [19] -1.80483333  1.46041483 -0.78766576  0.54021694  0.82223145  0.18473436
 [25] -1.90523714  0.58877440 -0.38728403 -0.44177993 -1.67340527  0.68930325
 [31]  0.96110045 -0.13456023  0.52096092  0.22599886  0.13369532 -0.15341746
 [37] -1.20318216 -0.55135865 -2.14240706  0.53562415 -1.34381031  0.68866629
 [43] -0.12595512  0.87262330 -0.34777501 -2.04723082 -0.34636989 -2.07148363
 [49] -2.35551047 -1.81690506 -0.92111044 -0.54687084 -1.37454708  1.04827270
 [55] -0.70978934 -0.17212625  0.85218953 -0.95259330 -1.66392563  0.25761261
 [61] -0.57133022  0.34770256 -0.17881049  0.16044804 -1.30481497  0.55937758
 [67]  0.19757804 -0.65513603  0.57528962 -1.55201811  0.58806527 -0.18124386
 [73]  0.11128344 -0.44191918  1.40177110 -0.68171644  2.08511103  0.07637645
 [79] -0.58957677 -1.28548694  0.49805599  0.15064732 -1.29405226 -0.69274424
 [85]  0.16011624 -0.77280163  0.52660980  1.71723995 -0.29966627  0.22712113
 [91] -0.66271943  1.33134109  0.46419295 -0.06668299  1.63273817  0.13662994
 [97] -0.07695526 -0.54742458 -1.10144068 -0.45110518
> colRanges(tmp)
           [,1]       [,2]     [,3]       [,4]      [,5]       [,6]        [,7]
[1,] -0.8580454 -0.6858238 1.478404 -0.3846254 -1.082643 -0.2538191 -0.03840864
[2,] -0.8580454 -0.6858238 1.478404 -0.3846254 -1.082643 -0.2538191 -0.03840864
          [,8]      [,9]      [,10]      [,11]     [,12]     [,13]     [,14]
[1,] 0.4320495 -1.950626 -0.3654385 -0.1296234 -0.771934 0.5698443 -1.633132
[2,] 0.4320495 -1.950626 -0.3654385 -0.1296234 -0.771934 0.5698443 -1.633132
          [,15]     [,16]     [,17]     [,18]     [,19]    [,20]      [,21]
[1,] -0.7246077 -1.632752 -1.140659 -1.093091 -1.804833 1.460415 -0.7876658
[2,] -0.7246077 -1.632752 -1.140659 -1.093091 -1.804833 1.460415 -0.7876658
         [,22]     [,23]     [,24]     [,25]     [,26]     [,27]      [,28]
[1,] 0.5402169 0.8222314 0.1847344 -1.905237 0.5887744 -0.387284 -0.4417799
[2,] 0.5402169 0.8222314 0.1847344 -1.905237 0.5887744 -0.387284 -0.4417799
         [,29]     [,30]     [,31]      [,32]     [,33]     [,34]     [,35]
[1,] -1.673405 0.6893033 0.9611005 -0.1345602 0.5209609 0.2259989 0.1336953
[2,] -1.673405 0.6893033 0.9611005 -0.1345602 0.5209609 0.2259989 0.1336953
          [,36]     [,37]      [,38]     [,39]     [,40]    [,41]     [,42]
[1,] -0.1534175 -1.203182 -0.5513586 -2.142407 0.5356241 -1.34381 0.6886663
[2,] -0.1534175 -1.203182 -0.5513586 -2.142407 0.5356241 -1.34381 0.6886663
          [,43]     [,44]     [,45]     [,46]      [,47]     [,48]    [,49]
[1,] -0.1259551 0.8726233 -0.347775 -2.047231 -0.3463699 -2.071484 -2.35551
[2,] -0.1259551 0.8726233 -0.347775 -2.047231 -0.3463699 -2.071484 -2.35551
         [,50]      [,51]      [,52]     [,53]    [,54]      [,55]      [,56]
[1,] -1.816905 -0.9211104 -0.5468708 -1.374547 1.048273 -0.7097893 -0.1721262
[2,] -1.816905 -0.9211104 -0.5468708 -1.374547 1.048273 -0.7097893 -0.1721262
         [,57]      [,58]     [,59]     [,60]      [,61]     [,62]      [,63]
[1,] 0.8521895 -0.9525933 -1.663926 0.2576126 -0.5713302 0.3477026 -0.1788105
[2,] 0.8521895 -0.9525933 -1.663926 0.2576126 -0.5713302 0.3477026 -0.1788105
        [,64]     [,65]     [,66]    [,67]     [,68]     [,69]     [,70]
[1,] 0.160448 -1.304815 0.5593776 0.197578 -0.655136 0.5752896 -1.552018
[2,] 0.160448 -1.304815 0.5593776 0.197578 -0.655136 0.5752896 -1.552018
         [,71]      [,72]     [,73]      [,74]    [,75]      [,76]    [,77]
[1,] 0.5880653 -0.1812439 0.1112834 -0.4419192 1.401771 -0.6817164 2.085111
[2,] 0.5880653 -0.1812439 0.1112834 -0.4419192 1.401771 -0.6817164 2.085111
          [,78]      [,79]     [,80]    [,81]     [,82]     [,83]      [,84]
[1,] 0.07637645 -0.5895768 -1.285487 0.498056 0.1506473 -1.294052 -0.6927442
[2,] 0.07637645 -0.5895768 -1.285487 0.498056 0.1506473 -1.294052 -0.6927442
         [,85]      [,86]     [,87]   [,88]      [,89]     [,90]      [,91]
[1,] 0.1601162 -0.7728016 0.5266098 1.71724 -0.2996663 0.2271211 -0.6627194
[2,] 0.1601162 -0.7728016 0.5266098 1.71724 -0.2996663 0.2271211 -0.6627194
        [,92]     [,93]       [,94]    [,95]     [,96]       [,97]      [,98]
[1,] 1.331341 0.4641929 -0.06668299 1.632738 0.1366299 -0.07695526 -0.5474246
[2,] 1.331341 0.4641929 -0.06668299 1.632738 0.1366299 -0.07695526 -0.5474246
         [,99]     [,100]
[1,] -1.101441 -0.4511052
[2,] -1.101441 -0.4511052
> 
> 
> Max(tmp2)
[1] 2.383243
> Min(tmp2)
[1] -2.016748
> mean(tmp2)
[1] 0.05795553
> Sum(tmp2)
[1] 5.795553
> Var(tmp2)
[1] 0.8242068
> 
> rowMeans(tmp2)
  [1]  0.97942476  0.06673749  0.27384792  0.73362206 -1.46284290  0.99634847
  [7] -1.86896668 -0.32223538  0.97328023 -0.91138464 -0.87361286  1.51821446
 [13]  0.31072453  0.90165888 -1.38950575  0.38640348 -0.33983148 -2.01674773
 [19]  1.18214776  0.32807532 -1.05043825 -1.62599588 -1.54456614 -1.12548882
 [25] -1.01798259 -0.08972927 -0.88881408 -0.68953725  0.67913817 -0.60581855
 [31] -0.79959436  0.20733157 -0.94556026  0.09951913  1.45726954  1.01894641
 [37]  1.39918857  0.44811897  0.17390417  0.25371533 -0.25147748  1.31224593
 [43] -1.01226395  1.16275740  1.04427675  0.32887689 -1.41999717 -1.15568490
 [49] -0.31460325  0.85292392  2.38324333  0.41277228 -0.12901493  1.59369262
 [55] -0.87157162 -0.60709082  0.03617001 -0.66638260  0.54010220 -0.31953269
 [61]  0.33848126 -0.32654753 -0.50688617 -0.84216431  0.27227745 -1.59250301
 [67] -0.20887867 -0.94705554  0.06336143  0.40637301 -0.20286585  0.52013078
 [73]  0.55267514 -1.62333368  0.22881096  1.65303119  0.23064462  0.02732599
 [79]  1.33870766  1.22403939  0.90250386  0.48611387  0.24802790 -0.17377316
 [85]  0.89010143 -0.54059046  0.93461145  0.19992617  0.33191220  0.07996532
 [91]  0.07969607  0.10185860 -0.12225144  1.50317852  0.12917429  0.33411512
 [97]  0.85455230  0.40328299 -0.45115513  1.26027237
> rowSums(tmp2)
  [1]  0.97942476  0.06673749  0.27384792  0.73362206 -1.46284290  0.99634847
  [7] -1.86896668 -0.32223538  0.97328023 -0.91138464 -0.87361286  1.51821446
 [13]  0.31072453  0.90165888 -1.38950575  0.38640348 -0.33983148 -2.01674773
 [19]  1.18214776  0.32807532 -1.05043825 -1.62599588 -1.54456614 -1.12548882
 [25] -1.01798259 -0.08972927 -0.88881408 -0.68953725  0.67913817 -0.60581855
 [31] -0.79959436  0.20733157 -0.94556026  0.09951913  1.45726954  1.01894641
 [37]  1.39918857  0.44811897  0.17390417  0.25371533 -0.25147748  1.31224593
 [43] -1.01226395  1.16275740  1.04427675  0.32887689 -1.41999717 -1.15568490
 [49] -0.31460325  0.85292392  2.38324333  0.41277228 -0.12901493  1.59369262
 [55] -0.87157162 -0.60709082  0.03617001 -0.66638260  0.54010220 -0.31953269
 [61]  0.33848126 -0.32654753 -0.50688617 -0.84216431  0.27227745 -1.59250301
 [67] -0.20887867 -0.94705554  0.06336143  0.40637301 -0.20286585  0.52013078
 [73]  0.55267514 -1.62333368  0.22881096  1.65303119  0.23064462  0.02732599
 [79]  1.33870766  1.22403939  0.90250386  0.48611387  0.24802790 -0.17377316
 [85]  0.89010143 -0.54059046  0.93461145  0.19992617  0.33191220  0.07996532
 [91]  0.07969607  0.10185860 -0.12225144  1.50317852  0.12917429  0.33411512
 [97]  0.85455230  0.40328299 -0.45115513  1.26027237
> 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.97942476  0.06673749  0.27384792  0.73362206 -1.46284290  0.99634847
  [7] -1.86896668 -0.32223538  0.97328023 -0.91138464 -0.87361286  1.51821446
 [13]  0.31072453  0.90165888 -1.38950575  0.38640348 -0.33983148 -2.01674773
 [19]  1.18214776  0.32807532 -1.05043825 -1.62599588 -1.54456614 -1.12548882
 [25] -1.01798259 -0.08972927 -0.88881408 -0.68953725  0.67913817 -0.60581855
 [31] -0.79959436  0.20733157 -0.94556026  0.09951913  1.45726954  1.01894641
 [37]  1.39918857  0.44811897  0.17390417  0.25371533 -0.25147748  1.31224593
 [43] -1.01226395  1.16275740  1.04427675  0.32887689 -1.41999717 -1.15568490
 [49] -0.31460325  0.85292392  2.38324333  0.41277228 -0.12901493  1.59369262
 [55] -0.87157162 -0.60709082  0.03617001 -0.66638260  0.54010220 -0.31953269
 [61]  0.33848126 -0.32654753 -0.50688617 -0.84216431  0.27227745 -1.59250301
 [67] -0.20887867 -0.94705554  0.06336143  0.40637301 -0.20286585  0.52013078
 [73]  0.55267514 -1.62333368  0.22881096  1.65303119  0.23064462  0.02732599
 [79]  1.33870766  1.22403939  0.90250386  0.48611387  0.24802790 -0.17377316
 [85]  0.89010143 -0.54059046  0.93461145  0.19992617  0.33191220  0.07996532
 [91]  0.07969607  0.10185860 -0.12225144  1.50317852  0.12917429  0.33411512
 [97]  0.85455230  0.40328299 -0.45115513  1.26027237
> rowMin(tmp2)
  [1]  0.97942476  0.06673749  0.27384792  0.73362206 -1.46284290  0.99634847
  [7] -1.86896668 -0.32223538  0.97328023 -0.91138464 -0.87361286  1.51821446
 [13]  0.31072453  0.90165888 -1.38950575  0.38640348 -0.33983148 -2.01674773
 [19]  1.18214776  0.32807532 -1.05043825 -1.62599588 -1.54456614 -1.12548882
 [25] -1.01798259 -0.08972927 -0.88881408 -0.68953725  0.67913817 -0.60581855
 [31] -0.79959436  0.20733157 -0.94556026  0.09951913  1.45726954  1.01894641
 [37]  1.39918857  0.44811897  0.17390417  0.25371533 -0.25147748  1.31224593
 [43] -1.01226395  1.16275740  1.04427675  0.32887689 -1.41999717 -1.15568490
 [49] -0.31460325  0.85292392  2.38324333  0.41277228 -0.12901493  1.59369262
 [55] -0.87157162 -0.60709082  0.03617001 -0.66638260  0.54010220 -0.31953269
 [61]  0.33848126 -0.32654753 -0.50688617 -0.84216431  0.27227745 -1.59250301
 [67] -0.20887867 -0.94705554  0.06336143  0.40637301 -0.20286585  0.52013078
 [73]  0.55267514 -1.62333368  0.22881096  1.65303119  0.23064462  0.02732599
 [79]  1.33870766  1.22403939  0.90250386  0.48611387  0.24802790 -0.17377316
 [85]  0.89010143 -0.54059046  0.93461145  0.19992617  0.33191220  0.07996532
 [91]  0.07969607  0.10185860 -0.12225144  1.50317852  0.12917429  0.33411512
 [97]  0.85455230  0.40328299 -0.45115513  1.26027237
> 
> colMeans(tmp2)
[1] 0.05795553
> colSums(tmp2)
[1] 5.795553
> colVars(tmp2)
[1] 0.8242068
> colSd(tmp2)
[1] 0.9078584
> colMax(tmp2)
[1] 2.383243
> colMin(tmp2)
[1] -2.016748
> colMedians(tmp2)
[1] 0.1515392
> colRanges(tmp2)
          [,1]
[1,] -2.016748
[2,]  2.383243
> 
> 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]  1.4730092 -3.7148364 -3.0887814  0.5600148 -0.9989025  5.3547098
 [7]  0.7996411  4.2710467 -3.2441429  1.7771556
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4115023
[2,] -0.1496301
[3,]  0.2801175
[4,]  0.5996459
[5,]  1.1220233
> 
> rowApply(tmp,sum)
 [1]  2.682133 -2.022021  5.299810 -2.110478  2.947063 -2.008808 -6.846106
 [8]  2.425857  6.033046 -3.211581
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6   10    5    7    6    4    3    8    4     5
 [2,]    3    3    1    3    2    8    6    4    7     8
 [3,]    1    6    6    2    9    2    5    3    3     7
 [4,]   10    5    4    5    3    5    9    9    6     1
 [5,]    7    7    3    1    5    3    2    7   10     3
 [6,]    9    2    7    9   10    6    4   10    8    10
 [7,]    4    8    9    8    1    7    8    6    2     6
 [8,]    5    9   10   10    4    9    7    2    1     9
 [9,]    2    1    2    6    8   10    1    1    9     2
[10,]    8    4    8    4    7    1   10    5    5     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.73941465 -2.57251076  2.15455077 -1.67367469  0.30601712  0.98654547
 [7] -1.82354559  0.87260572 -0.02168038  1.28602238  1.51866059 -0.25128096
[13] -0.13549292 -2.28901041 -4.16793703 -1.62868049 -2.50559601  4.30297747
[19] -0.70223238  0.33298211
> colApply(tmp,quantile)[,1]
           [,1]
[1,] 0.07920005
[2,] 0.57818478
[3,] 1.08103346
[4,] 1.08147961
[5,] 1.91951675
> 
> rowApply(tmp,sum)
[1] -3.294638 -3.250268  2.001409 -2.246180  5.517812
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12   19   19   17   14
[2,]    3    3    2    7   11
[3,]   15    4   20    5   16
[4,]    1   13    5   18    6
[5,]   16    9   11    3   17
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,] 0.07920005 -0.8205020  0.4381639 -1.8256511  0.47587104  0.8228231
[2,] 1.08103346 -1.0160418 -0.8526401  0.4164742 -0.21384382  0.8491835
[3,] 1.91951675 -0.7983800  2.1408319 -0.3575537 -0.04571979  0.1133088
[4,] 0.57818478 -0.5846766 -0.7902316  0.8724427 -1.21089804  0.1676683
[5,] 1.08147961  0.6470896  1.2184266 -0.7793869  1.30060773 -0.9664381
           [,7]        [,8]        [,9]       [,10]      [,11]      [,12]
[1,] -0.7350831 -0.08090124  0.42934928 -0.02735309  0.6037154 -0.6281581
[2,]  0.3839427  0.50079775  0.81312639 -0.66484571 -0.6672654 -0.8071639
[3,] -0.6391451  0.08018152 -0.19899582 -0.53269957 -0.2388675 -0.2152149
[4,]  0.1747557 -0.37470976  0.08696149  0.50119519  1.5058184  0.3075800
[5,] -1.0080157  0.74723746 -1.15212171  2.00972556  0.3152597  1.0916760
           [,13]       [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -1.62378532 -0.53791040 -0.4378288  0.7933309  0.1771870 -0.49105003
[2,] -0.01675524 -0.17361995 -2.1691223 -2.1126286  0.4816979  1.16284087
[3,]  0.38148316  0.07585087 -0.1868046  0.1449191 -0.2404779  0.08025589
[4,]  0.11072897 -1.45860989 -0.7137132  0.4217796 -1.1192203  1.39432333
[5,]  1.01283550 -0.19472103 -0.6604681 -0.8760814 -1.8047827  2.15660740
          [,19]      [,20]
[1,] -0.6392188  0.7331630
[2,] -0.7833630  0.5379247
[3,]  1.4940416 -0.9751215
[4,] -0.3871798 -1.7283792
[5,] -0.3865123  1.7653951
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2      col3      col4       col5      col6       col7
row1 -0.5284426 -0.399639 -1.040632 0.5831749 0.07664058 0.9177905 -0.2350749
          col8      col9     col10      col11    col12      col13      col14
row1 0.3236032 0.8122733 -1.537257 -0.3727371 1.493008 -0.5902706 -0.8803162
        col15      col16      col17   col18     col19     col20
row1 0.265805 -0.8651347 -0.5480399 1.55172 0.6599217 0.0564668
> tmp[,"col10"]
          col10
row1 -1.5372573
row2 -1.0632152
row3 -1.3180476
row4  0.2392897
row5 -0.5126502
> tmp[c("row1","row5"),]
            col1      col2      col3        col4       col5       col6
row1 -0.52844260 -0.399639 -1.040632  0.58317494 0.07664058  0.9177905
row5 -0.09334992  1.481098 -1.565592 -0.04533762 3.08818556 -0.7764631
            col7       col8      col9      col10      col11     col12
row1 -0.23507490  0.3236032 0.8122733 -1.5372573 -0.3727371 1.4930078
row5 -0.09486808 -0.6770810 1.0321814 -0.5126502 -1.0238734 0.2190476
          col13      col14     col15      col16      col17     col18      col19
row1 -0.5902706 -0.8803162 0.2658050 -0.8651347 -0.5480399 1.5517198  0.6599217
row5 -0.3549636  0.1622418 0.9556698 -0.5208569  1.5419920 0.2322511 -0.5728321
          col20
row1  0.0564668
row5 -1.7575023
> tmp[,c("col6","col20")]
           col6       col20
row1  0.9177905  0.05646680
row2 -1.8198931  0.19816976
row3  1.6326763 -0.03152154
row4  1.3327580 -0.17246802
row5 -0.7764631 -1.75750227
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.9177905  0.0564668
row5 -0.7764631 -1.7575023
> 
> 
> 
> 
> 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.04537 49.45764 51.45948 50.66747 51.11388 105.3323 50.1159 48.59531
         col9    col10    col11    col12   col13    col14    col15    col16
row1 50.04729 48.81837 51.26516 49.14453 50.0793 50.32813 50.10559 50.47178
        col17   col18    col19    col20
row1 49.28784 51.2867 50.04421 105.8903
> tmp[,"col10"]
        col10
row1 48.81837
row2 31.31852
row3 28.29000
row4 31.29443
row5 52.07455
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.04537 49.45764 51.45948 50.66747 51.11388 105.3323 50.11590 48.59531
row5 49.04569 50.20072 50.95699 53.02277 50.78641 106.9406 49.66156 51.26551
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.04729 48.81837 51.26516 49.14453 50.07930 50.32813 50.10559 50.47178
row5 49.27480 52.07455 50.54387 51.21973 49.04935 50.77444 50.29335 50.25985
        col17    col18    col19    col20
row1 49.28784 51.28670 50.04421 105.8903
row5 49.69971 48.44373 49.65174 105.7714
> tmp[,c("col6","col20")]
          col6     col20
row1 105.33228 105.89027
row2  74.85309  73.39461
row3  75.44545  74.06255
row4  73.67334  74.57114
row5 106.94059 105.77141
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.3323 105.8903
row5 106.9406 105.7714
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.3323 105.8903
row5 106.9406 105.7714
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.4127296
[2,]  0.6391291
[3,]  1.1163746
[4,]  1.2296902
[5,] -1.6282707
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.6119551 -1.0852852
[2,] -0.1008693  0.3582627
[3,] -1.0051549 -0.2113117
[4,]  0.1887043  0.8616609
[5,] -1.7008302  1.0064665
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.3461760  1.3480064
[2,] -0.7008144  0.5506389
[3,] -0.2676918 -0.2992285
[4,]  0.1987774 -0.2383568
[5,]  1.7294838  2.0923967
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.346176
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.3461760
[2,] -0.7008144
> 
> 
> 
> 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]
row3  0.8023841 -1.02930253 -0.4808674 -0.7019512 -0.04372833  0.1893008
row1 -0.9498729  0.06279884  0.8915976  0.4544946  0.34824497 -1.2127253
            [,7]      [,8]      [,9]      [,10]      [,11]     [,12]     [,13]
row3 -0.28761877 0.0244520 -1.355817  0.2088572  0.4605301 0.4551726 -1.315987
row1  0.07988905 0.2065743  1.386576 -0.4063833 -0.4070933 0.0507891 -0.278340
         [,14]      [,15]     [,16]     [,17]      [,18]       [,19]      [,20]
row3 0.1298614 -0.4271317 0.8923769 0.2693856  0.7962524 -0.56660032 -1.4350622
row1 0.7325515 -0.3132844 0.4949333 2.2303692 -0.6214307 -0.09307695  0.1555473
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
row2 -0.3443332 -1.313713 -1.474741 0.9934403 -0.7761203 -1.116498 0.6428028
          [,8]       [,9]      [,10]
row2 -0.386776 -0.3969832 -0.6453466
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]       [,3]      [,4]       [,5]      [,6]      [,7]
row5 -0.5915755 0.03864724 -0.7033599 -1.635788 -0.4153095 0.2017046 0.8738295
           [,8]      [,9]     [,10]    [,11]     [,12]    [,13]    [,14]
row5 -0.3957128 0.1514113 -1.161166 1.228734 -1.413419 1.104333 1.468252
          [,15]     [,16]      [,17]     [,18]    [,19]     [,20]
row5 -0.3183905 -1.073902 -0.1367872 -1.113111 1.846917 0.8949282
> 
> 
> 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: 0x6155db3317a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c04431ad683" 
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c044551e9707"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c0447b2c4424"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c044450ec181"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c04462023da9"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c0443f86e769"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c0443df6b83" 
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c04440bd0ebb"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c0442cbc7971"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c0441b9517fd"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c044578fd732"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c0445815a07" 
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c0441699a090"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c04432e9b855"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c0441d0782ea"
> 
> 
> ### 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: 0x6155da0bbd40>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6155da0bbd40>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6155da0bbd40>
> rowMedians(tmp)
  [1]  0.043375888 -0.205764996  0.290071725 -0.257086084  0.078946202
  [6]  0.116604825 -0.222887306 -0.231109291  0.036329803 -0.054633083
 [11]  0.326960779  0.053421254 -0.117579910  0.434207600 -0.994177925
 [16]  0.082031338  0.370117940 -0.563357785  0.200413609 -0.044728266
 [21]  0.122792666 -0.015596885 -0.119823624 -0.005415343  0.527318630
 [26] -0.113213749 -0.192779982 -0.177669926  0.480730134  0.435370753
 [31]  0.140402926 -0.278410730 -0.662955769 -0.384005141 -0.657734662
 [36] -0.197392618  0.066961393  0.051347995  0.073509906 -0.002484840
 [41]  0.115571722 -0.084398455 -0.268112027 -0.392512250 -0.372186744
 [46]  0.347918859  0.619032797 -0.026046258  0.033376212 -0.118982094
 [51] -0.028364836 -0.286825983  0.556879026 -0.031235435  0.076124452
 [56] -0.073831428  0.453538699  0.195714502 -0.121792092  0.033942901
 [61] -0.394379510 -0.089971057  0.489647442  0.276960626  0.121557063
 [66]  0.141666512  0.133152596  0.119345371 -0.074662285  0.125941858
 [71] -0.219432366 -0.124980522  0.595562236 -0.192456072 -0.108869830
 [76]  0.287895254 -0.376310327 -0.409071193 -0.042974326  0.038090469
 [81] -0.463091143  0.384585140  0.194444189  0.313886702  0.168710034
 [86]  0.116954968  0.106847328  0.089662010 -0.012381226  0.257794932
 [91]  0.020722044 -0.647141560 -0.547168421 -0.379137601 -0.412740906
 [96]  0.344359582  0.023452805 -0.133665351  0.420108720  0.227661969
[101]  0.079671788  0.172013556  0.137245797  0.001118841  0.019535949
[106]  0.025192908 -0.224884110 -0.180020279  0.205593387 -0.049148838
[111]  0.217034886  0.570825277 -0.038824588  0.350309547  0.164834724
[116]  0.746322497  0.617061038  0.031497752  0.273325923  0.022450778
[121] -0.092064484  0.427515345  0.191641492 -0.858081809 -0.426997129
[126] -0.033319410  0.004970518  0.488554936 -0.323531758 -0.806096710
[131]  0.169238744 -0.244793308  0.337208866 -0.124963279  0.203026149
[136] -0.081436559  0.148123986 -0.880206752 -0.173129887 -0.117107197
[141]  0.355836009  0.011741475  0.007719007  0.158336354 -0.131352446
[146] -0.281405323  0.200454805 -0.277413340  0.030216591  0.108487372
[151]  0.113984622  0.573717847  0.204497283 -0.030869729 -0.867402141
[156]  0.359307855  0.122469147 -0.103114901 -0.076673020  0.526901891
[161] -0.147817906  0.054377101  0.423044133 -0.009203509 -0.110171775
[166]  0.097618754  0.245712329  0.249196574  0.258557029 -0.299425560
[171]  0.112320406  0.074423926  0.327099950  0.312340564 -0.291086230
[176]  0.176382273 -0.044755445 -0.042591093 -0.540201148  0.113105900
[181]  0.756603475 -0.218123336  0.097750777  0.174975436  0.012021905
[186]  0.558574763  0.231001642  0.247270084 -0.049422841 -0.120724264
[191]  0.013777056  0.388791604  0.334929367  0.381294008 -0.047746354
[196] -0.256186789  0.316193947  0.166653613  0.167642509 -0.345081803
[201]  0.303503373  0.301631787  0.289033917 -0.448727668  0.237203564
[206]  0.053011144  0.509068524 -0.111797597  0.343541481  0.236238340
[211]  0.004270467  0.254787458  0.419190748  0.196680743  0.229255533
[216]  0.138308698  0.396298902  0.121763667  0.013276390  0.083899369
[221]  0.037959193  0.288539928 -0.390754456 -0.121200311 -0.083368005
[226]  0.104242600 -0.345635148 -0.081182652  0.196791327  0.260343582
> 
> proc.time()
   user  system elapsed 
  1.351   1.480   2.815 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
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: 0x5e02aef22ff0>
> .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: 0x5e02aef22ff0>
> .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: 0x5e02aef22ff0>
> .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: 0x5e02aef22ff0>
> 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: 0x5e02aebce710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e02aebce710>
> .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: 0x5e02aebce710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e02aebce710>
> .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: 0x5e02aebce710>
> 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: 0x5e02aee157d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e02aee157d0>
> .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: 0x5e02aee157d0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e02aee157d0>
> .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: 0x5e02aee157d0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5e02aee157d0>
> .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: 0x5e02aee157d0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5e02aee157d0>
> .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: 0x5e02aee157d0>
> 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: 0x5e02af058830>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5e02af058830>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e02af058830>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e02af058830>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3c07233eb90e4" "BufferedMatrixFile3c0727e2f6b62"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3c07233eb90e4" "BufferedMatrixFile3c0727e2f6b62"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e02b0251e10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e02b0251e10>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e02b0251e10>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e02b0251e10>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5e02b0251e10>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5e02b0251e10>
> .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: 0x5e02b023cc20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e02b023cc20>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e02b023cc20>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5e02b023cc20>
> 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: 0x5e02af4d2e10>
> .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: 0x5e02af4d2e10>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.251   0.051   0.292 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
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.234   0.047   0.270 

Example timings