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

This page was generated on 2026-01-16 11:11 -0500 (Fri, 16 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" 4849
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4628
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 253/2343HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-15 13:40 -0500 (Thu, 15 Jan 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 -0500 (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  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


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-01-15 21:51:59 -0500 (Thu, 15 Jan 2026)
EndedAt: 2026-01-15 21:52:24 -0500 (Thu, 15 Jan 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) (2025-12-22 r89219)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.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) 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) 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) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.258   0.047   0.294 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.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 478851 25.6    1048487   56   639317 34.2
Vcells 885659  6.8    8388608   64  2082734 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] "Thu Jan 15 21:52:15 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] "Thu Jan 15 21:52:15 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: 0x5f1d648082b0>
> 
> 
> 
> 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] "Thu Jan 15 21:52:15 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] "Thu Jan 15 21:52:15 2026"
> 
> ColMode(tmp2)
<pointer: 0x5f1d648082b0>
> 
> 
> 
> ### 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.170618094 -1.6699608 -0.4986535  1.3283884
[2,] -0.148110196  1.9410338 -1.8288647  0.3296034
[3,] -0.475480414 -0.1788284  0.8889732  0.6339862
[4,] -0.008737906  2.8781920  3.4547139 -0.5723434
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]      [,2]      [,3]      [,4]
[1,] 99.170618094 1.6699608 0.4986535 1.3283884
[2,]  0.148110196 1.9410338 1.8288647 0.3296034
[3,]  0.475480414 0.1788284 0.8889732 0.6339862
[4,]  0.008737906 2.8781920 3.4547139 0.5723434
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]     [,2]      [,3]      [,4]
[1,] 9.95844456 1.292270 0.7061540 1.1525573
[2,] 0.38485088 1.393210 1.3523552 0.5741110
[3,] 0.68955088 0.422881 0.9428538 0.7962325
[4,] 0.09347677 1.696524 1.8586861 0.7565338
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.75506 39.59266 32.56019 37.85396
[2,]  28.99662 40.87313 40.35242 31.07071
[3,]  32.37099 29.40764 35.31751 33.59631
[4,]  25.94351 44.84343 47.04157 33.13768
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5f1d64f0f500>
> exp(tmp5)
<pointer: 0x5f1d64f0f500>
> log(tmp5,2)
<pointer: 0x5f1d64f0f500>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.7168
> Min(tmp5)
[1] 52.97899
> mean(tmp5)
[1] 73.10064
> Sum(tmp5)
[1] 14620.13
> Var(tmp5)
[1] 856.7302
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.15760 70.52246 68.43460 70.72574 69.35900 74.52175 73.85849 71.35294
 [9] 71.55065 68.52318
> rowSums(tmp5)
 [1] 1843.152 1410.449 1368.692 1414.515 1387.180 1490.435 1477.170 1427.059
 [9] 1431.013 1370.464
> rowVars(tmp5)
 [1] 7815.46458   98.91541   56.73361  133.68093   76.63880   50.21503
 [7]   97.61173   59.34886   48.53913   72.57261
> rowSd(tmp5)
 [1] 88.405116  9.945623  7.532172 11.562047  8.754359  7.086257  9.879865
 [8]  7.703821  6.967003  8.518956
> rowMax(tmp5)
 [1] 465.71685  89.27951  81.02604  97.91087  85.66849  84.39957  91.58084
 [8]  85.82557  87.92001  92.55115
> rowMin(tmp5)
 [1] 55.11813 55.30886 55.71527 53.99801 52.97899 61.64049 53.40392 58.66537
 [9] 60.49533 56.85895
> 
> colMeans(tmp5)
 [1] 107.74795  74.34391  76.01017  72.03378  71.81926  66.04199  66.88058
 [8]  69.75086  74.96076  74.48576  73.98872  71.37314  70.55866  69.85478
[15]  70.76088  70.64615  69.27178  72.59428  67.51158  71.37784
> colSums(tmp5)
 [1] 1077.4795  743.4391  760.1017  720.3378  718.1926  660.4199  668.8058
 [8]  697.5086  749.6076  744.8576  739.8872  713.7314  705.5866  698.5478
[15]  707.6088  706.4615  692.7178  725.9428  675.1158  713.7784
> colVars(tmp5)
 [1] 15921.03951   121.50787   100.66308    99.27262    58.34090    80.77716
 [7]    67.37880   103.82369    93.42736    95.17626    57.73823    45.73318
[13]   116.94406   122.57307    49.17901    44.90270    52.45468    34.24187
[19]    42.71320    80.11091
> colSd(tmp5)
 [1] 126.178602  11.023061  10.033099   9.963565   7.638121   8.987612
 [7]   8.208459  10.189391   9.665783   9.755832   7.598568   6.762631
[13]  10.814068  11.071272   7.012775   6.700948   7.242560   5.851655
[19]   6.535534   8.950470
> colMax(tmp5)
 [1] 465.71685  93.33572  97.91087  87.92001  82.24235  82.42719  79.33314
 [8]  88.65397  91.58084  88.77542  85.66849  82.32567  89.27951  92.55115
[15]  80.95798  79.87485  84.36779  81.02604  79.46001  84.68761
> colMin(tmp5)
 [1] 53.99801 61.20815 62.21984 56.21091 58.21794 53.40392 55.30886 56.83079
 [9] 54.91585 52.97899 62.52982 63.65494 55.11813 55.83330 60.24040 57.19605
[17] 60.46428 64.28291 56.85895 55.96188
> 
> 
> ### 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] 92.15760 70.52246 68.43460 70.72574       NA 74.52175 73.85849 71.35294
 [9] 71.55065 68.52318
> rowSums(tmp5)
 [1] 1843.152 1410.449 1368.692 1414.515       NA 1490.435 1477.170 1427.059
 [9] 1431.013 1370.464
> rowVars(tmp5)
 [1] 7815.46458   98.91541   56.73361  133.68093   77.97596   50.21503
 [7]   97.61173   59.34886   48.53913   72.57261
> rowSd(tmp5)
 [1] 88.405116  9.945623  7.532172 11.562047  8.830400  7.086257  9.879865
 [8]  7.703821  6.967003  8.518956
> rowMax(tmp5)
 [1] 465.71685  89.27951  81.02604  97.91087        NA  84.39957  91.58084
 [8]  85.82557  87.92001  92.55115
> rowMin(tmp5)
 [1] 55.11813 55.30886 55.71527 53.99801       NA 61.64049 53.40392 58.66537
 [9] 60.49533 56.85895
> 
> colMeans(tmp5)
 [1] 107.74795  74.34391  76.01017  72.03378  71.81926  66.04199  66.88058
 [8]        NA  74.96076  74.48576  73.98872  71.37314  70.55866  69.85478
[15]  70.76088  70.64615  69.27178  72.59428  67.51158  71.37784
> colSums(tmp5)
 [1] 1077.4795  743.4391  760.1017  720.3378  718.1926  660.4199  668.8058
 [8]        NA  749.6076  744.8576  739.8872  713.7314  705.5866  698.5478
[15]  707.6088  706.4615  692.7178  725.9428  675.1158  713.7784
> colVars(tmp5)
 [1] 15921.03951   121.50787   100.66308    99.27262    58.34090    80.77716
 [7]    67.37880          NA    93.42736    95.17626    57.73823    45.73318
[13]   116.94406   122.57307    49.17901    44.90270    52.45468    34.24187
[19]    42.71320    80.11091
> colSd(tmp5)
 [1] 126.178602  11.023061  10.033099   9.963565   7.638121   8.987612
 [7]   8.208459         NA   9.665783   9.755832   7.598568   6.762631
[13]  10.814068  11.071272   7.012775   6.700948   7.242560   5.851655
[19]   6.535534   8.950470
> colMax(tmp5)
 [1] 465.71685  93.33572  97.91087  87.92001  82.24235  82.42719  79.33314
 [8]        NA  91.58084  88.77542  85.66849  82.32567  89.27951  92.55115
[15]  80.95798  79.87485  84.36779  81.02604  79.46001  84.68761
> colMin(tmp5)
 [1] 53.99801 61.20815 62.21984 56.21091 58.21794 53.40392 55.30886       NA
 [9] 54.91585 52.97899 62.52982 63.65494 55.11813 55.83330 60.24040 57.19605
[17] 60.46428 64.28291 56.85895 55.96188
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.7168
> Min(tmp5,na.rm=TRUE)
[1] 52.97899
> mean(tmp5,na.rm=TRUE)
[1] 73.08393
> Sum(tmp5,na.rm=TRUE)
[1] 14543.7
> Var(tmp5,na.rm=TRUE)
[1] 861.001
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.15760 70.52246 68.43460 70.72574 68.98706 74.52175 73.85849 71.35294
 [9] 71.55065 68.52318
> rowSums(tmp5,na.rm=TRUE)
 [1] 1843.152 1410.449 1368.692 1414.515 1310.754 1490.435 1477.170 1427.059
 [9] 1431.013 1370.464
> rowVars(tmp5,na.rm=TRUE)
 [1] 7815.46458   98.91541   56.73361  133.68093   77.97596   50.21503
 [7]   97.61173   59.34886   48.53913   72.57261
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.405116  9.945623  7.532172 11.562047  8.830400  7.086257  9.879865
 [8]  7.703821  6.967003  8.518956
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.71685  89.27951  81.02604  97.91087  85.66849  84.39957  91.58084
 [8]  85.82557  87.92001  92.55115
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.11813 55.30886 55.71527 53.99801 52.97899 61.64049 53.40392 58.66537
 [9] 60.49533 56.85895
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.74795  74.34391  76.01017  72.03378  71.81926  66.04199  66.88058
 [8]  69.00919  74.96076  74.48576  73.98872  71.37314  70.55866  69.85478
[15]  70.76088  70.64615  69.27178  72.59428  67.51158  71.37784
> colSums(tmp5,na.rm=TRUE)
 [1] 1077.4795  743.4391  760.1017  720.3378  718.1926  660.4199  668.8058
 [8]  621.0827  749.6076  744.8576  739.8872  713.7314  705.5866  698.5478
[15]  707.6088  706.4615  692.7178  725.9428  675.1158  713.7784
> colVars(tmp5,na.rm=TRUE)
 [1] 15921.03951   121.50787   100.66308    99.27262    58.34090    80.77716
 [7]    67.37880   110.61327    93.42736    95.17626    57.73823    45.73318
[13]   116.94406   122.57307    49.17901    44.90270    52.45468    34.24187
[19]    42.71320    80.11091
> colSd(tmp5,na.rm=TRUE)
 [1] 126.178602  11.023061  10.033099   9.963565   7.638121   8.987612
 [7]   8.208459  10.517284   9.665783   9.755832   7.598568   6.762631
[13]  10.814068  11.071272   7.012775   6.700948   7.242560   5.851655
[19]   6.535534   8.950470
> colMax(tmp5,na.rm=TRUE)
 [1] 465.71685  93.33572  97.91087  87.92001  82.24235  82.42719  79.33314
 [8]  88.65397  91.58084  88.77542  85.66849  82.32567  89.27951  92.55115
[15]  80.95798  79.87485  84.36779  81.02604  79.46001  84.68761
> colMin(tmp5,na.rm=TRUE)
 [1] 53.99801 61.20815 62.21984 56.21091 58.21794 53.40392 55.30886 56.83079
 [9] 54.91585 52.97899 62.52982 63.65494 55.11813 55.83330 60.24040 57.19605
[17] 60.46428 64.28291 56.85895 55.96188
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.15760 70.52246 68.43460 70.72574      NaN 74.52175 73.85849 71.35294
 [9] 71.55065 68.52318
> rowSums(tmp5,na.rm=TRUE)
 [1] 1843.152 1410.449 1368.692 1414.515    0.000 1490.435 1477.170 1427.059
 [9] 1431.013 1370.464
> rowVars(tmp5,na.rm=TRUE)
 [1] 7815.46458   98.91541   56.73361  133.68093         NA   50.21503
 [7]   97.61173   59.34886   48.53913   72.57261
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.405116  9.945623  7.532172 11.562047        NA  7.086257  9.879865
 [8]  7.703821  6.967003  8.518956
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.71685  89.27951  81.02604  97.91087        NA  84.39957  91.58084
 [8]  85.82557  87.92001  92.55115
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.11813 55.30886 55.71527 53.99801       NA 61.64049 53.40392 58.66537
 [9] 60.49533 56.85895
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.80770  75.14632  76.87953  73.79187  71.44253  66.74681  66.41870
 [8]       NaN  74.38504  76.87540  72.69097  72.23072  71.11256  71.33756
[15]  69.78940  70.19315  69.05147  73.50273  67.24742  70.66850
> colSums(tmp5,na.rm=TRUE)
 [1] 1006.2693  676.3169  691.9158  664.1268  642.9828  600.7213  597.7683
 [8]    0.0000  669.4654  691.8786  654.2187  650.0765  640.0130  642.0380
[15]  628.1046  631.7384  621.4632  661.5246  605.2268  636.0165
> colVars(tmp5,na.rm=TRUE)
 [1] 17725.75158   129.45288   104.74333    76.90907    64.03689    85.28552
 [7]    73.40113          NA   101.37695    42.83146    46.00870    43.17614
[13]   128.11053   113.16002    44.70888    48.20702    58.46546    29.23774
[19]    47.26731    84.46420
> colSd(tmp5,na.rm=TRUE)
 [1] 133.138092  11.377736  10.234419   8.769782   8.002305   9.235016
 [7]   8.567446         NA  10.068612   6.544575   6.782971   6.570855
[13]  11.318592  10.637670   6.686470   6.943128   7.646271   5.407193
[19]   6.875122   9.190441
> colMax(tmp5,na.rm=TRUE)
 [1] 465.71685  93.33572  97.91087  87.92001  82.24235  82.42719  79.33314
 [8]      -Inf  91.58084  88.77542  80.37830  82.32567  89.27951  92.55115
[15]  80.95798  79.87485  84.36779  81.02604  79.46001  84.68761
> colMin(tmp5,na.rm=TRUE)
 [1] 53.99801 61.20815 62.21984 61.27745 58.21794 53.40392 55.30886      Inf
 [9] 54.91585 67.87645 62.52982 65.13498 55.11813 55.83330 60.24040 57.19605
[17] 60.46428 64.28291 56.85895 55.96188
> 
> 
> 
> 
> 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] 205.5792 105.1537 234.5121 192.8290 245.6195 193.3858 172.9146 247.2585
 [9] 172.2694 136.7806
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 205.5792 105.1537 234.5121 192.8290 245.6195 193.3858 172.9146 247.2585
 [9] 172.2694 136.7806
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.136868e-13  2.842171e-14 -5.684342e-14 -1.136868e-13  2.842171e-14
 [6]  8.526513e-14 -8.526513e-14  2.842171e-14 -8.526513e-14  0.000000e+00
[11]  1.278977e-13 -2.273737e-13  9.947598e-14 -1.421085e-13 -2.273737e-13
[16]  1.705303e-13 -5.684342e-14  0.000000e+00 -5.684342e-14 -1.705303e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
9   10 
6   17 
10   18 
2   2 
1   3 
2   17 
4   8 
10   9 
4   13 
3   10 
1   11 
10   17 
3   4 
7   9 
4   6 
7   19 
10   1 
1   4 
6   10 
5   6 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.620908
> Min(tmp)
[1] -2.711411
> mean(tmp)
[1] 0.00893978
> Sum(tmp)
[1] 0.893978
> Var(tmp)
[1] 1.318157
> 
> rowMeans(tmp)
[1] 0.00893978
> rowSums(tmp)
[1] 0.893978
> rowVars(tmp)
[1] 1.318157
> rowSd(tmp)
[1] 1.14811
> rowMax(tmp)
[1] 2.620908
> rowMin(tmp)
[1] -2.711411
> 
> colMeans(tmp)
  [1] -0.51619574 -0.36339326 -0.37900726  1.31202700 -2.37769284  0.08742994
  [7]  1.12954752 -1.04150886 -0.04785266  0.60198318  0.87044858 -1.65938761
 [13]  1.81260767 -1.88512922  2.62090812 -0.50848687 -0.03557204 -0.96151065
 [19]  1.18717937 -2.61843477 -0.12499886 -0.61272846 -0.37467261  1.30765011
 [25] -1.64183268  0.21146641  0.33308051 -0.27166274  1.37238926 -0.93330718
 [31]  0.06354339  0.19841855  0.13910901  0.53005046 -0.99336674  0.64316738
 [37] -1.89360418 -0.43822115  1.20829105 -0.45466214  0.16593249 -0.46384621
 [43] -0.36383663 -1.24765795  0.44515588  0.20356401 -1.50573617  0.06930986
 [49]  0.09026001 -0.09310484  2.27567819  0.99959494 -0.93006475  0.67982039
 [55]  0.51106653 -1.91636221 -1.92670573 -0.17051397 -2.71141063  0.04607177
 [61]  1.05364800 -0.51732627 -1.27232238  1.40320415  0.68805372  1.07181823
 [67] -0.58868696  1.30125359  2.14415789  1.87588488 -1.28333261 -1.36467602
 [73]  0.05377782  1.09134357  0.62795587  2.43960682  1.28617023  0.92866035
 [79] -0.21509886  0.33604676  0.35812797  1.87176931 -0.46252234  0.63396059
 [85] -1.53384931  0.48519896  0.72408653  1.01484744 -0.77384178 -0.10586449
 [91] -2.05233762 -1.92244613 -0.22222908 -0.36622229 -0.65149985  0.35843667
 [97]  0.84592154  1.20375732  0.88960818 -0.11434639
> colSums(tmp)
  [1] -0.51619574 -0.36339326 -0.37900726  1.31202700 -2.37769284  0.08742994
  [7]  1.12954752 -1.04150886 -0.04785266  0.60198318  0.87044858 -1.65938761
 [13]  1.81260767 -1.88512922  2.62090812 -0.50848687 -0.03557204 -0.96151065
 [19]  1.18717937 -2.61843477 -0.12499886 -0.61272846 -0.37467261  1.30765011
 [25] -1.64183268  0.21146641  0.33308051 -0.27166274  1.37238926 -0.93330718
 [31]  0.06354339  0.19841855  0.13910901  0.53005046 -0.99336674  0.64316738
 [37] -1.89360418 -0.43822115  1.20829105 -0.45466214  0.16593249 -0.46384621
 [43] -0.36383663 -1.24765795  0.44515588  0.20356401 -1.50573617  0.06930986
 [49]  0.09026001 -0.09310484  2.27567819  0.99959494 -0.93006475  0.67982039
 [55]  0.51106653 -1.91636221 -1.92670573 -0.17051397 -2.71141063  0.04607177
 [61]  1.05364800 -0.51732627 -1.27232238  1.40320415  0.68805372  1.07181823
 [67] -0.58868696  1.30125359  2.14415789  1.87588488 -1.28333261 -1.36467602
 [73]  0.05377782  1.09134357  0.62795587  2.43960682  1.28617023  0.92866035
 [79] -0.21509886  0.33604676  0.35812797  1.87176931 -0.46252234  0.63396059
 [85] -1.53384931  0.48519896  0.72408653  1.01484744 -0.77384178 -0.10586449
 [91] -2.05233762 -1.92244613 -0.22222908 -0.36622229 -0.65149985  0.35843667
 [97]  0.84592154  1.20375732  0.88960818 -0.11434639
> 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.51619574 -0.36339326 -0.37900726  1.31202700 -2.37769284  0.08742994
  [7]  1.12954752 -1.04150886 -0.04785266  0.60198318  0.87044858 -1.65938761
 [13]  1.81260767 -1.88512922  2.62090812 -0.50848687 -0.03557204 -0.96151065
 [19]  1.18717937 -2.61843477 -0.12499886 -0.61272846 -0.37467261  1.30765011
 [25] -1.64183268  0.21146641  0.33308051 -0.27166274  1.37238926 -0.93330718
 [31]  0.06354339  0.19841855  0.13910901  0.53005046 -0.99336674  0.64316738
 [37] -1.89360418 -0.43822115  1.20829105 -0.45466214  0.16593249 -0.46384621
 [43] -0.36383663 -1.24765795  0.44515588  0.20356401 -1.50573617  0.06930986
 [49]  0.09026001 -0.09310484  2.27567819  0.99959494 -0.93006475  0.67982039
 [55]  0.51106653 -1.91636221 -1.92670573 -0.17051397 -2.71141063  0.04607177
 [61]  1.05364800 -0.51732627 -1.27232238  1.40320415  0.68805372  1.07181823
 [67] -0.58868696  1.30125359  2.14415789  1.87588488 -1.28333261 -1.36467602
 [73]  0.05377782  1.09134357  0.62795587  2.43960682  1.28617023  0.92866035
 [79] -0.21509886  0.33604676  0.35812797  1.87176931 -0.46252234  0.63396059
 [85] -1.53384931  0.48519896  0.72408653  1.01484744 -0.77384178 -0.10586449
 [91] -2.05233762 -1.92244613 -0.22222908 -0.36622229 -0.65149985  0.35843667
 [97]  0.84592154  1.20375732  0.88960818 -0.11434639
> colMin(tmp)
  [1] -0.51619574 -0.36339326 -0.37900726  1.31202700 -2.37769284  0.08742994
  [7]  1.12954752 -1.04150886 -0.04785266  0.60198318  0.87044858 -1.65938761
 [13]  1.81260767 -1.88512922  2.62090812 -0.50848687 -0.03557204 -0.96151065
 [19]  1.18717937 -2.61843477 -0.12499886 -0.61272846 -0.37467261  1.30765011
 [25] -1.64183268  0.21146641  0.33308051 -0.27166274  1.37238926 -0.93330718
 [31]  0.06354339  0.19841855  0.13910901  0.53005046 -0.99336674  0.64316738
 [37] -1.89360418 -0.43822115  1.20829105 -0.45466214  0.16593249 -0.46384621
 [43] -0.36383663 -1.24765795  0.44515588  0.20356401 -1.50573617  0.06930986
 [49]  0.09026001 -0.09310484  2.27567819  0.99959494 -0.93006475  0.67982039
 [55]  0.51106653 -1.91636221 -1.92670573 -0.17051397 -2.71141063  0.04607177
 [61]  1.05364800 -0.51732627 -1.27232238  1.40320415  0.68805372  1.07181823
 [67] -0.58868696  1.30125359  2.14415789  1.87588488 -1.28333261 -1.36467602
 [73]  0.05377782  1.09134357  0.62795587  2.43960682  1.28617023  0.92866035
 [79] -0.21509886  0.33604676  0.35812797  1.87176931 -0.46252234  0.63396059
 [85] -1.53384931  0.48519896  0.72408653  1.01484744 -0.77384178 -0.10586449
 [91] -2.05233762 -1.92244613 -0.22222908 -0.36622229 -0.65149985  0.35843667
 [97]  0.84592154  1.20375732  0.88960818 -0.11434639
> colMedians(tmp)
  [1] -0.51619574 -0.36339326 -0.37900726  1.31202700 -2.37769284  0.08742994
  [7]  1.12954752 -1.04150886 -0.04785266  0.60198318  0.87044858 -1.65938761
 [13]  1.81260767 -1.88512922  2.62090812 -0.50848687 -0.03557204 -0.96151065
 [19]  1.18717937 -2.61843477 -0.12499886 -0.61272846 -0.37467261  1.30765011
 [25] -1.64183268  0.21146641  0.33308051 -0.27166274  1.37238926 -0.93330718
 [31]  0.06354339  0.19841855  0.13910901  0.53005046 -0.99336674  0.64316738
 [37] -1.89360418 -0.43822115  1.20829105 -0.45466214  0.16593249 -0.46384621
 [43] -0.36383663 -1.24765795  0.44515588  0.20356401 -1.50573617  0.06930986
 [49]  0.09026001 -0.09310484  2.27567819  0.99959494 -0.93006475  0.67982039
 [55]  0.51106653 -1.91636221 -1.92670573 -0.17051397 -2.71141063  0.04607177
 [61]  1.05364800 -0.51732627 -1.27232238  1.40320415  0.68805372  1.07181823
 [67] -0.58868696  1.30125359  2.14415789  1.87588488 -1.28333261 -1.36467602
 [73]  0.05377782  1.09134357  0.62795587  2.43960682  1.28617023  0.92866035
 [79] -0.21509886  0.33604676  0.35812797  1.87176931 -0.46252234  0.63396059
 [85] -1.53384931  0.48519896  0.72408653  1.01484744 -0.77384178 -0.10586449
 [91] -2.05233762 -1.92244613 -0.22222908 -0.36622229 -0.65149985  0.35843667
 [97]  0.84592154  1.20375732  0.88960818 -0.11434639
> colRanges(tmp)
           [,1]       [,2]       [,3]     [,4]      [,5]       [,6]     [,7]
[1,] -0.5161957 -0.3633933 -0.3790073 1.312027 -2.377693 0.08742994 1.129548
[2,] -0.5161957 -0.3633933 -0.3790073 1.312027 -2.377693 0.08742994 1.129548
          [,8]        [,9]     [,10]     [,11]     [,12]    [,13]     [,14]
[1,] -1.041509 -0.04785266 0.6019832 0.8704486 -1.659388 1.812608 -1.885129
[2,] -1.041509 -0.04785266 0.6019832 0.8704486 -1.659388 1.812608 -1.885129
        [,15]      [,16]       [,17]      [,18]    [,19]     [,20]      [,21]
[1,] 2.620908 -0.5084869 -0.03557204 -0.9615107 1.187179 -2.618435 -0.1249989
[2,] 2.620908 -0.5084869 -0.03557204 -0.9615107 1.187179 -2.618435 -0.1249989
          [,22]      [,23]   [,24]     [,25]     [,26]     [,27]      [,28]
[1,] -0.6127285 -0.3746726 1.30765 -1.641833 0.2114664 0.3330805 -0.2716627
[2,] -0.6127285 -0.3746726 1.30765 -1.641833 0.2114664 0.3330805 -0.2716627
        [,29]      [,30]      [,31]     [,32]    [,33]     [,34]      [,35]
[1,] 1.372389 -0.9333072 0.06354339 0.1984186 0.139109 0.5300505 -0.9933667
[2,] 1.372389 -0.9333072 0.06354339 0.1984186 0.139109 0.5300505 -0.9933667
         [,36]     [,37]      [,38]    [,39]      [,40]     [,41]      [,42]
[1,] 0.6431674 -1.893604 -0.4382212 1.208291 -0.4546621 0.1659325 -0.4638462
[2,] 0.6431674 -1.893604 -0.4382212 1.208291 -0.4546621 0.1659325 -0.4638462
          [,43]     [,44]     [,45]    [,46]     [,47]      [,48]      [,49]
[1,] -0.3638366 -1.247658 0.4451559 0.203564 -1.505736 0.06930986 0.09026001
[2,] -0.3638366 -1.247658 0.4451559 0.203564 -1.505736 0.06930986 0.09026001
           [,50]    [,51]     [,52]      [,53]     [,54]     [,55]     [,56]
[1,] -0.09310484 2.275678 0.9995949 -0.9300648 0.6798204 0.5110665 -1.916362
[2,] -0.09310484 2.275678 0.9995949 -0.9300648 0.6798204 0.5110665 -1.916362
         [,57]     [,58]     [,59]      [,60]    [,61]      [,62]     [,63]
[1,] -1.926706 -0.170514 -2.711411 0.04607177 1.053648 -0.5173263 -1.272322
[2,] -1.926706 -0.170514 -2.711411 0.04607177 1.053648 -0.5173263 -1.272322
        [,64]     [,65]    [,66]     [,67]    [,68]    [,69]    [,70]     [,71]
[1,] 1.403204 0.6880537 1.071818 -0.588687 1.301254 2.144158 1.875885 -1.283333
[2,] 1.403204 0.6880537 1.071818 -0.588687 1.301254 2.144158 1.875885 -1.283333
         [,72]      [,73]    [,74]     [,75]    [,76]   [,77]     [,78]
[1,] -1.364676 0.05377782 1.091344 0.6279559 2.439607 1.28617 0.9286603
[2,] -1.364676 0.05377782 1.091344 0.6279559 2.439607 1.28617 0.9286603
          [,79]     [,80]    [,81]    [,82]      [,83]     [,84]     [,85]
[1,] -0.2150989 0.3360468 0.358128 1.871769 -0.4625223 0.6339606 -1.533849
[2,] -0.2150989 0.3360468 0.358128 1.871769 -0.4625223 0.6339606 -1.533849
        [,86]     [,87]    [,88]      [,89]      [,90]     [,91]     [,92]
[1,] 0.485199 0.7240865 1.014847 -0.7738418 -0.1058645 -2.052338 -1.922446
[2,] 0.485199 0.7240865 1.014847 -0.7738418 -0.1058645 -2.052338 -1.922446
          [,93]      [,94]      [,95]     [,96]     [,97]    [,98]     [,99]
[1,] -0.2222291 -0.3662223 -0.6514998 0.3584367 0.8459215 1.203757 0.8896082
[2,] -0.2222291 -0.3662223 -0.6514998 0.3584367 0.8459215 1.203757 0.8896082
         [,100]
[1,] -0.1143464
[2,] -0.1143464
> 
> 
> Max(tmp2)
[1] 2.411147
> Min(tmp2)
[1] -2.466704
> mean(tmp2)
[1] -0.0754629
> Sum(tmp2)
[1] -7.54629
> Var(tmp2)
[1] 1.068415
> 
> rowMeans(tmp2)
  [1] -1.48448203  0.07990351 -1.22486474  0.49858768  0.62046660  0.43250490
  [7] -0.99758437  0.75626948  0.32817090 -0.38059475 -1.16364295 -1.04980907
 [13]  0.18961877  0.09129711 -0.41112573  0.07150415  0.28665540  1.35457321
 [19] -0.64136440 -0.65126405 -0.49474314  1.76549197  2.04426852 -1.42354579
 [25]  0.49204368 -1.28497965  1.54480805  1.29003638 -0.19163392  1.42787104
 [31]  1.07023291 -0.91132308 -0.72773537 -1.85643042  0.02770917 -0.02253521
 [37] -0.16904133 -1.34240903 -0.37637487  0.90329485  1.18283909  1.53360363
 [43]  0.50609803  1.54146391  1.02757716  1.15943044 -2.46670372  0.57867402
 [49] -0.19692680 -0.59351776 -0.44118895 -0.72432371 -1.96264170 -0.18690945
 [55]  0.03642977 -1.93344204  1.34813094  1.79606423 -1.29512118  0.04493397
 [61]  2.41114727 -1.39028680 -0.49672568  1.64362819 -0.82195892 -0.33640821
 [67]  0.53321650  0.59767851 -0.87160498 -1.40432558  0.65082746 -0.06482052
 [73] -1.03557179 -1.62790325 -0.01638941  0.99199181  1.29900256  0.67624165
 [79] -0.02311490  1.03597807 -1.58690180 -0.37530741  0.20181335  0.43527974
 [85] -1.19443859 -0.60130831  0.32649053 -0.69237298 -1.23884451 -0.79762439
 [91] -0.28562769  0.21504201 -0.43385152  0.94868641 -1.42279879 -0.52607559
 [97] -0.96374520  0.78727015 -0.16110700 -1.35576439
> rowSums(tmp2)
  [1] -1.48448203  0.07990351 -1.22486474  0.49858768  0.62046660  0.43250490
  [7] -0.99758437  0.75626948  0.32817090 -0.38059475 -1.16364295 -1.04980907
 [13]  0.18961877  0.09129711 -0.41112573  0.07150415  0.28665540  1.35457321
 [19] -0.64136440 -0.65126405 -0.49474314  1.76549197  2.04426852 -1.42354579
 [25]  0.49204368 -1.28497965  1.54480805  1.29003638 -0.19163392  1.42787104
 [31]  1.07023291 -0.91132308 -0.72773537 -1.85643042  0.02770917 -0.02253521
 [37] -0.16904133 -1.34240903 -0.37637487  0.90329485  1.18283909  1.53360363
 [43]  0.50609803  1.54146391  1.02757716  1.15943044 -2.46670372  0.57867402
 [49] -0.19692680 -0.59351776 -0.44118895 -0.72432371 -1.96264170 -0.18690945
 [55]  0.03642977 -1.93344204  1.34813094  1.79606423 -1.29512118  0.04493397
 [61]  2.41114727 -1.39028680 -0.49672568  1.64362819 -0.82195892 -0.33640821
 [67]  0.53321650  0.59767851 -0.87160498 -1.40432558  0.65082746 -0.06482052
 [73] -1.03557179 -1.62790325 -0.01638941  0.99199181  1.29900256  0.67624165
 [79] -0.02311490  1.03597807 -1.58690180 -0.37530741  0.20181335  0.43527974
 [85] -1.19443859 -0.60130831  0.32649053 -0.69237298 -1.23884451 -0.79762439
 [91] -0.28562769  0.21504201 -0.43385152  0.94868641 -1.42279879 -0.52607559
 [97] -0.96374520  0.78727015 -0.16110700 -1.35576439
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.48448203  0.07990351 -1.22486474  0.49858768  0.62046660  0.43250490
  [7] -0.99758437  0.75626948  0.32817090 -0.38059475 -1.16364295 -1.04980907
 [13]  0.18961877  0.09129711 -0.41112573  0.07150415  0.28665540  1.35457321
 [19] -0.64136440 -0.65126405 -0.49474314  1.76549197  2.04426852 -1.42354579
 [25]  0.49204368 -1.28497965  1.54480805  1.29003638 -0.19163392  1.42787104
 [31]  1.07023291 -0.91132308 -0.72773537 -1.85643042  0.02770917 -0.02253521
 [37] -0.16904133 -1.34240903 -0.37637487  0.90329485  1.18283909  1.53360363
 [43]  0.50609803  1.54146391  1.02757716  1.15943044 -2.46670372  0.57867402
 [49] -0.19692680 -0.59351776 -0.44118895 -0.72432371 -1.96264170 -0.18690945
 [55]  0.03642977 -1.93344204  1.34813094  1.79606423 -1.29512118  0.04493397
 [61]  2.41114727 -1.39028680 -0.49672568  1.64362819 -0.82195892 -0.33640821
 [67]  0.53321650  0.59767851 -0.87160498 -1.40432558  0.65082746 -0.06482052
 [73] -1.03557179 -1.62790325 -0.01638941  0.99199181  1.29900256  0.67624165
 [79] -0.02311490  1.03597807 -1.58690180 -0.37530741  0.20181335  0.43527974
 [85] -1.19443859 -0.60130831  0.32649053 -0.69237298 -1.23884451 -0.79762439
 [91] -0.28562769  0.21504201 -0.43385152  0.94868641 -1.42279879 -0.52607559
 [97] -0.96374520  0.78727015 -0.16110700 -1.35576439
> rowMin(tmp2)
  [1] -1.48448203  0.07990351 -1.22486474  0.49858768  0.62046660  0.43250490
  [7] -0.99758437  0.75626948  0.32817090 -0.38059475 -1.16364295 -1.04980907
 [13]  0.18961877  0.09129711 -0.41112573  0.07150415  0.28665540  1.35457321
 [19] -0.64136440 -0.65126405 -0.49474314  1.76549197  2.04426852 -1.42354579
 [25]  0.49204368 -1.28497965  1.54480805  1.29003638 -0.19163392  1.42787104
 [31]  1.07023291 -0.91132308 -0.72773537 -1.85643042  0.02770917 -0.02253521
 [37] -0.16904133 -1.34240903 -0.37637487  0.90329485  1.18283909  1.53360363
 [43]  0.50609803  1.54146391  1.02757716  1.15943044 -2.46670372  0.57867402
 [49] -0.19692680 -0.59351776 -0.44118895 -0.72432371 -1.96264170 -0.18690945
 [55]  0.03642977 -1.93344204  1.34813094  1.79606423 -1.29512118  0.04493397
 [61]  2.41114727 -1.39028680 -0.49672568  1.64362819 -0.82195892 -0.33640821
 [67]  0.53321650  0.59767851 -0.87160498 -1.40432558  0.65082746 -0.06482052
 [73] -1.03557179 -1.62790325 -0.01638941  0.99199181  1.29900256  0.67624165
 [79] -0.02311490  1.03597807 -1.58690180 -0.37530741  0.20181335  0.43527974
 [85] -1.19443859 -0.60130831  0.32649053 -0.69237298 -1.23884451 -0.79762439
 [91] -0.28562769  0.21504201 -0.43385152  0.94868641 -1.42279879 -0.52607559
 [97] -0.96374520  0.78727015 -0.16110700 -1.35576439
> 
> colMeans(tmp2)
[1] -0.0754629
> colSums(tmp2)
[1] -7.54629
> colVars(tmp2)
[1] 1.068415
> colSd(tmp2)
[1] 1.033642
> colMax(tmp2)
[1] 2.411147
> colMin(tmp2)
[1] -2.466704
> colMedians(tmp2)
[1] -0.1129638
> colRanges(tmp2)
          [,1]
[1,] -2.466704
[2,]  2.411147
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.9131379  2.0735096 -0.2625320 -2.1689344  2.4665853  1.4224436
 [7]  0.7228202  1.2365399  1.1179545  4.6910834
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.9464925
[2,] -0.3953292
[3,]  0.6014131
[4,]  1.0166475
[5,]  2.0993023
> 
> rowApply(tmp,sum)
 [1]  6.2771993 -1.6556653  3.4022829 -2.5916683 -2.0782842 -0.7013251
 [7]  4.9896109  2.2830196  2.1513550  2.1360834
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    9    1   10    4    7    7    6    2     7
 [2,]    4   10    3    4   10    4    6    4    8     2
 [3,]    2    2    2    6    9    5    4    9   10     1
 [4,]    1    5    4    8    2    8    1   10    6     3
 [5,]    5    8   10    2    8    2    3    1    9    10
 [6,]    3    4    5    9    6    9    2    3    7     4
 [7,]    8    6    6    3    7    6    9    2    5     5
 [8,]    7    1    8    1    3   10    5    8    3     9
 [9,]    6    3    7    7    5    1   10    5    1     8
[10,]   10    7    9    5    1    3    8    7    4     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.0828881  2.3670132 -1.1576157 -0.9702988  2.7332708  1.9472059
 [7] -1.1307223 -0.3448909 -3.5476209  0.4981083 -0.2496375 -0.2715364
[13]  2.7505653  1.5057798 -3.7133362  3.5074589 -2.8202058  0.8611139
[19] -4.4483479 -0.7427098
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6916598
[2,] -0.9083621
[3,] -0.3025544
[4,]  0.2948363
[5,]  0.5248519
> 
> rowApply(tmp,sum)
[1]  4.015892 -5.884412  1.023942 -1.375916 -3.088800
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10   10   15    2    1
[2,]   20    8   16    4   18
[3,]    7   13    1   18   10
[4,]   12    2   12   13   16
[5,]   16   11   20    3   19
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]         [,4]       [,5]        [,6]
[1,]  0.2948363  2.3559873 -0.20190819  0.449474879  1.1876569  0.06012722
[2,] -0.3025544 -0.7181533 -0.03509407 -1.968346644 -0.1761479 -1.01626033
[3,]  0.5248519  0.6708831 -1.76872015  0.028697689  1.7875262 -0.01543013
[4,] -0.9083621 -0.7437713  0.98928492  0.005612917 -0.8901339  1.30080355
[5,] -1.6916598  0.8020674 -0.14117826  0.514262355  0.8243694  1.61796562
            [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.33853069  1.12915920  0.2130416 -0.7564561  0.5254124 -2.9913212
[2,] -0.05544957 -0.01497348 -0.3549755  2.2803350 -1.4896403  1.4323068
[3,] -1.11067229 -0.53765130 -0.6495774 -0.2036002  1.6251391  0.5129389
[4,] -0.12605478 -0.64711408 -1.1783034 -0.2088209 -0.1868007  2.0513003
[5,] -0.17707635 -0.27431125 -1.5778062 -0.6133494 -0.7237481 -1.2767612
          [,13]      [,14]      [,15]      [,16]       [,17]       [,18]
[1,]  1.3778579  1.2888095 -0.4755185  1.6099484 -0.40670585  0.47946473
[2,] -0.8578170  0.6811542 -0.8934470  0.3475170 -2.18722011  0.09601433
[3,]  1.1173979 -0.2235937 -0.7301872  1.7450638 -0.75168195 -0.12277465
[4,]  0.7838253 -0.7133130 -0.6751640 -0.4029122  0.09580959  0.22072948
[5,]  0.3293013  0.4727228 -0.9390194  0.2078418  0.42959251  0.18768004
          [,19]      [,20]
[1,] -0.9044246 -1.5580808
[2,] -1.4928025  0.8411425
[3,]  0.1511575 -1.0258248
[4,] -0.5254760  0.3829444
[5,] -1.6768022  0.6171090
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  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.4467444 -0.1437796 -1.073656 -0.3141058 0.1400491 -1.957522 -1.314811
           col8       col9       col10     col11      col12      col13
row1 -0.6444543 -0.5155733 -0.01456022 -1.441636 -0.4208942 -0.3706918
          col14      col15     col16    col17      col18     col19     col20
row1 -0.9695895 -0.2892358 0.2719186 2.814608 -0.3356069 0.5466233 -1.074117
> tmp[,"col10"]
           col10
row1 -0.01456022
row2  0.06863396
row3  1.53631272
row4  0.41464311
row5 -0.67777589
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5         col6
row1 -0.4467444 -0.1437796 -1.0736564 -0.3141058  0.1400491 -1.957521692
row5 -0.3169627  0.6726612  0.4872839 -0.2274106 -1.0869612  0.004417772
           col7       col8       col9       col10     col11       col12
row1 -1.3148106 -0.6444543 -0.5155733 -0.01456022 -1.441636 -0.42089417
row5 -0.4143085 -0.6035996 -1.2455867 -0.67777589  1.587440 -0.04238367
          col13      col14      col15     col16     col17      col18      col19
row1 -0.3706918 -0.9695895 -0.2892358 0.2719186  2.814608 -0.3356069  0.5466233
row5 -0.6575694  0.3861483  0.2001258 1.3254273 -1.001521  0.7862953 -0.1908364
          col20
row1 -1.0741170
row5  0.9730344
> tmp[,c("col6","col20")]
             col6       col20
row1 -1.957521692 -1.07411705
row2  0.781191232  1.54342387
row3  1.829018865  2.00166310
row4  0.808778344 -0.09702896
row5  0.004417772  0.97303441
> tmp[c("row1","row5"),c("col6","col20")]
             col6      col20
row1 -1.957521692 -1.0741170
row5  0.004417772  0.9730344
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7    col8
row1 48.66063 50.45106 49.90679 49.38548 49.81541 103.4949 50.54729 49.3085
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.50979 49.71552 50.79874 49.73692 50.48535 50.74585 47.54203 48.94239
        col17    col18    col19    col20
row1 50.98597 51.12839 49.90104 104.0584
> tmp[,"col10"]
        col10
row1 49.71552
row2 29.61365
row3 30.66077
row4 29.23898
row5 49.92423
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.66063 50.45106 49.90679 49.38548 49.81541 103.4949 50.54729 49.30850
row5 50.26529 49.44346 50.56688 49.64025 49.14192 104.6656 50.46717 49.80348
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.50979 49.71552 50.79874 49.73692 50.48535 50.74585 47.54203 48.94239
row5 48.78593 49.92423 49.92672 50.44329 49.04703 49.48843 48.49173 49.91866
        col17    col18    col19    col20
row1 50.98597 51.12839 49.90104 104.0584
row5 50.71049 51.40362 51.12595 105.4323
> tmp[,c("col6","col20")]
          col6     col20
row1 103.49488 104.05835
row2  72.84328  75.04503
row3  76.47154  72.66384
row4  74.93466  74.05094
row5 104.66564 105.43228
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.4949 104.0584
row5 104.6656 105.4323
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.4949 104.0584
row5 104.6656 105.4323
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8473518
[2,] -0.6043313
[3,]  0.6817945
[4,] -1.1545162
[5,]  1.6247606
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.08654244  1.2583762
[2,] -2.13535895  0.8302442
[3,]  0.41360559 -0.1735580
[4,] -0.17781574 -0.2874313
[5,]  1.29911361  0.2866664
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  1.2383090 -0.26275896
[2,] -0.9754018  0.41892831
[3,]  0.1706807 -3.18757556
[4,]  0.1289880  1.41373799
[5,] -0.6778711  0.02013494
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.238309
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.2383090
[2,] -0.9754018
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]      [,3]       [,4]       [,5]      [,6]       [,7]
row3  0.2895012 -1.160088 0.1330735  0.8225364  0.3262666 0.5713154 -1.0533995
row1 -1.0740258  0.548273 2.0999416 -1.1797139 -0.5709950 1.1996176  0.2959271
          [,8]       [,9]     [,10]      [,11]      [,12]       [,13]
row3 0.6860366  2.0874622 -1.267870 -1.0695260 -0.1867173  0.03979125
row1 0.4604530 -0.5050237 -1.182623 -0.2833334  0.8762367 -0.01986729
           [,14]      [,15]     [,16]     [,17]      [,18]      [,19]    [,20]
row3 0.004946649 -0.6887939 0.7402649 -1.649001  0.6002067 -0.6744177 1.228707
row1 1.259686808  1.3843288 0.4842659 -0.038172 -0.4047224 -1.2087036 1.450436
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]     [,3]      [,4]       [,5]      [,6]       [,7]
row2 -0.2639625 -1.84451 1.204573 0.3491578 -0.6306395 0.1523949 0.03597256
           [,8]     [,9]      [,10]
row2 -0.8394834 1.535226 -0.2129617
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]       [,3]       [,4]      [,5]       [,6]       [,7]
row5 1.577762 -1.133542 0.08610028 -0.1842672 0.2980328 0.04381496 0.08493343
          [,8]      [,9]     [,10]     [,11]     [,12]      [,13]     [,14]
row5 0.2799189 0.6544814 0.1681582 -1.333344 0.2590964 0.07898774 0.1156201
         [,15]     [,16]     [,17]      [,18]     [,19]     [,20]
row5 0.9731622 -1.108025 -1.528937 0.03651814 -1.174169 0.3868828
> 
> 
> 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: 0x5f1d65a1ff80>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d2424a3cba"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d2a38bb6e" 
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d27d5d509d"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d22ca39f2e"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d2572fb88a"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d247b3c638"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d28741b13" 
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d242df94c9"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d27620112b"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d263c2e201"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d2161c9ba2"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d242934739"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d22ebf02e2"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d27031dfad"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM3198d25ea86bfd"
> 
> 
> ### 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: 0x5f1d646155a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5f1d646155a0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5f1d646155a0>
> rowMedians(tmp)
  [1]  0.399025057  0.215304773 -0.442656227 -0.286585374 -0.269194811
  [6] -0.152672284 -0.215806665  0.923790750  0.002981605  0.022887713
 [11] -0.384476553 -0.604170550 -0.186895505  0.003358959  0.190957284
 [16]  0.109134808  0.649314885  0.314960389  0.169674193 -0.854533419
 [21]  0.293347378  0.520707156 -0.155426586 -0.416209853  0.191240486
 [26] -0.114697494 -0.507056131 -0.069387975  0.307912804  0.019291845
 [31] -0.078809656  0.233064280  0.017590889  0.728789138  0.423056045
 [36] -0.258691388 -0.131276661  0.153634040  0.035511135 -0.252819199
 [41] -0.152230279 -0.325500119  0.345595161  0.175180832  0.319944809
 [46] -0.209708858  0.139766284  0.127782264 -0.323950286  0.084140000
 [51]  0.002368353 -0.134681683  0.129293161 -0.131752335  0.236574955
 [56] -0.123716872  0.196925089 -0.061925115 -0.252279633  0.271326147
 [61]  0.412762422 -0.606258348  0.203142733 -0.266312641 -0.244984237
 [66]  0.369032516  0.165354397 -0.405912657 -0.632328370 -0.021481092
 [71] -0.043147379  0.548924592 -0.283577423  0.374266153 -0.333976230
 [76]  0.219592173 -0.119312078  0.040443804 -0.224789244  0.214892904
 [81] -0.021208730  0.349571777 -0.259001367 -0.495594239 -0.439769327
 [86]  0.065000587  0.034150410  0.137281314 -0.174752644 -0.236345767
 [91]  0.155580372 -0.059653044 -0.003246849 -0.031515868  0.780053445
 [96] -0.684797685 -0.170838242  0.020863777 -0.548154704  0.221113866
[101] -0.128216246 -0.539379308 -0.236396143 -0.077988271  0.352639951
[106] -0.178403627  0.184948092 -0.754156416  0.264863780 -0.253298705
[111]  0.261078898 -0.327494970 -0.002508118 -0.149550910 -0.352977301
[116] -0.246685233  0.444164135 -0.011014567  0.213131592 -0.439501581
[121] -0.018834825 -0.405852844 -0.277549400  0.136780507 -0.034797429
[126]  0.075115271  0.268723318 -0.220542824 -0.335356878 -0.184840115
[131]  0.416274310 -0.191964708 -0.476718847 -0.542019231 -0.219669092
[136]  0.006523882 -0.339137468 -0.499301376  0.275863723  0.465570210
[141] -0.127431541  0.483685476 -0.179386101  0.587184187  0.010567893
[146] -0.115190691  0.228435100 -0.379665638 -0.427550515 -0.283743775
[151]  0.489517481  0.551088446  0.231639955  0.117741049  0.605344984
[156] -0.185855894 -0.203400881  0.158476050  0.212768438  0.007979471
[161] -0.317824417 -0.197692718  0.201174331  0.096530246 -0.289076146
[166] -0.204209623  0.197104655 -0.496329925 -0.110503590  0.291135456
[171]  0.195418956 -0.011957922 -0.042060308  0.045790421 -0.494922479
[176] -0.272474840  0.088229947 -0.271183724 -0.578530039 -0.258754647
[181] -0.069036892 -0.281393172  0.283913058  0.310702596  0.113284165
[186] -0.354795796  0.178360643 -0.495502572 -0.093825890 -0.041594322
[191]  0.050852061 -0.038502771 -0.190389063  0.721574234 -0.452853061
[196] -0.075611460  0.295884510  0.100672242 -0.131549161  0.206272296
[201] -0.222829917  0.048215515 -0.201047290 -0.422843355  0.225113127
[206] -0.053258093  0.515398870 -0.358333423  0.127961724  0.258418748
[211]  0.315029515  0.595136511  0.475488619 -0.350852293 -0.081890609
[216]  0.308063844  0.046868341  0.696719934 -0.132365059 -0.010034368
[221]  0.146106568 -0.312374960  0.309944553  0.061567493  0.099518739
[226]  0.016279098 -0.325086638  0.437851514  0.295249431 -0.691235558
> 
> proc.time()
   user  system elapsed 
  1.395   1.469   2.854 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x5e618fc9e5f0>
> .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: 0x5e618fc9e5f0>
> .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: 0x5e618fc9e5f0>
> .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: 0x5e618fc9e5f0>
> 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: 0x5e619051c2b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e619051c2b0>
> .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: 0x5e619051c2b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e619051c2b0>
> .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: 0x5e619051c2b0>
> 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: 0x5e618fbffa20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e618fbffa20>
> .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: 0x5e618fbffa20>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e618fbffa20>
> .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: 0x5e618fbffa20>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5e618fbffa20>
> .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: 0x5e618fbffa20>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5e618fbffa20>
> .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: 0x5e618fbffa20>
> 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: 0x5e61903dce00>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5e61903dce00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e61903dce00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e61903dce00>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile319aba2b91248d" "BufferedMatrixFile319aba54a37838"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile319aba2b91248d" "BufferedMatrixFile319aba54a37838"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e61902e44c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e61902e44c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e61902e44c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5e61902e44c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5e61902e44c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5e61902e44c0>
> .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: 0x5e619068d7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5e619068d7e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5e619068d7e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5e619068d7e0>
> 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: 0x5e6191766520>
> .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: 0x5e6191766520>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.271   0.056   0.316 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.241   0.050   0.280 

Example timings