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

This page was generated on 2025-12-19 11:34 -0500 (Fri, 19 Dec 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4875
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4593
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/2332HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-12-18 13:40 -0500 (Thu, 18 Dec 2025)
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: 2025-12-18 21:29:33 -0500 (Thu, 18 Dec 2025)
EndedAt: 2025-12-18 21:29:58 -0500 (Thu, 18 Dec 2025)
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-10-20 r88955)
* 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-10-20 r88955) -- "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.253   0.041   0.283 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "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 478818 25.6    1048392   56   639317 34.2
Vcells 885623  6.8    8388608   64  2082728 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 Dec 18 21:29:48 2025"
> 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 Dec 18 21:29:48 2025"
> 
> 
> 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: 0x622a5b49e5e0>
> 
> 
> 
> 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 Dec 18 21:29:49 2025"
> 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 Dec 18 21:29:49 2025"
> 
> ColMode(tmp2)
<pointer: 0x622a5b49e5e0>
> 
> 
> 
> ### 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.65072165  0.3652890  0.39678996  0.7583086
[2,] -0.08567224 -0.6752806 -0.04862778  0.1142983
[3,]  3.19259466  1.4379727 -1.88714768 -1.0365833
[4,]  0.23048639  0.4869015  0.62630238  0.3593289
> 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.65072165 0.3652890 0.39678996 0.7583086
[2,]  0.08567224 0.6752806 0.04862778 0.1142983
[3,]  3.19259466 1.4379727 1.88714768 1.0365833
[4,]  0.23048639 0.4869015 0.62630238 0.3593289
> 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.9825208 0.6043914 0.6299127 0.8708091
[2,] 0.2926982 0.8217546 0.2205171 0.3380803
[3,] 1.7867833 1.1991550 1.3737349 1.0181273
[4,] 0.4800900 0.6977833 0.7913927 0.5994405
> 
> 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,] 224.47593 31.40920 31.69592 34.46640
[2,]  28.01265 33.89283 27.25380 28.49510
[3,]  46.06043 38.42952 40.62450 36.21786
[4,]  30.03139 32.46473 33.54023 31.35373
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x622a5b029840>
> exp(tmp5)
<pointer: 0x622a5b029840>
> log(tmp5,2)
<pointer: 0x622a5b029840>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.2172
> Min(tmp5)
[1] 53.23815
> mean(tmp5)
[1] 73.05885
> Sum(tmp5)
[1] 14611.77
> Var(tmp5)
[1] 850.2311
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.65901 67.90883 73.50269 73.98991 71.72612 72.61781 70.00741 68.89792
 [9] 69.70839 72.57037
> rowSums(tmp5)
 [1] 1793.180 1358.177 1470.054 1479.798 1434.522 1452.356 1400.148 1377.958
 [9] 1394.168 1451.407
> rowVars(tmp5)
 [1] 7944.48985   64.37099   70.20501   68.90584   44.47482   81.31548
 [7]   85.60186   61.48824  101.17383   21.75133
> rowSd(tmp5)
 [1] 89.131868  8.023154  8.378843  8.300954  6.668945  9.017510  9.252128
 [8]  7.841443 10.058520  4.663833
> rowMax(tmp5)
 [1] 467.21724  82.94760  95.86875  89.94879  84.73645  91.94968  86.93971
 [8]  87.34585  90.81621  81.69138
> rowMin(tmp5)
 [1] 59.14452 56.72521 59.28044 62.50640 61.85288 53.34568 54.51364 54.43725
 [9] 53.23815 64.90885
> 
> colMeans(tmp5)
 [1] 111.80662  70.98276  68.88734  70.99768  70.88720  69.60996  74.21486
 [8]  71.37798  72.74218  72.32214  73.59316  68.16312  70.88658  70.47042
[15]  70.95512  71.88115  72.36107  68.94083  68.77251  71.32427
> colSums(tmp5)
 [1] 1118.0662  709.8276  688.8734  709.9768  708.8720  696.0996  742.1486
 [8]  713.7798  727.4218  723.2214  735.9316  681.6312  708.8658  704.7042
[15]  709.5512  718.8115  723.6107  689.4083  687.7251  713.2427
> colVars(tmp5)
 [1] 15746.14533    51.46231    57.36905    76.98065    44.98120    86.32601
 [7]    52.08142    79.97333    30.97772    80.39548    53.16742    34.60446
[13]   101.11583    65.71363    36.70960    75.74622    71.51373    82.43419
[19]    92.29941    69.47283
> colSd(tmp5)
 [1] 125.483646   7.173724   7.574236   8.773862   6.706803   9.291179
 [7]   7.216746   8.942781   5.565763   8.966352   7.291599   5.882556
[13]  10.055637   8.106395   6.058845   8.703230   8.456579   9.079328
[19]   9.607258   8.335036
> colMax(tmp5)
 [1] 467.21724  82.76700  84.55457  91.94968  78.86704  84.47317  82.94760
 [8]  87.34585  80.55030  86.98241  87.28942  74.34379  90.81621  82.90435
[15]  81.49838  84.52048  89.81194  89.94879  86.93971  84.73645
> colMin(tmp5)
 [1] 58.30467 61.04730 56.72521 59.30882 59.14452 53.34568 63.01773 54.51364
 [9] 64.86406 57.05430 66.61574 56.49013 56.94441 54.43725 61.57318 58.29998
[17] 57.63407 59.28044 53.23815 54.43293
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 89.65901 67.90883       NA 73.98991 71.72612 72.61781 70.00741 68.89792
 [9] 69.70839 72.57037
> rowSums(tmp5)
 [1] 1793.180 1358.177       NA 1479.798 1434.522 1452.356 1400.148 1377.958
 [9] 1394.168 1451.407
> rowVars(tmp5)
 [1] 7944.48985   64.37099   66.96237   68.90584   44.47482   81.31548
 [7]   85.60186   61.48824  101.17383   21.75133
> rowSd(tmp5)
 [1] 89.131868  8.023154  8.183054  8.300954  6.668945  9.017510  9.252128
 [8]  7.841443 10.058520  4.663833
> rowMax(tmp5)
 [1] 467.21724  82.94760        NA  89.94879  84.73645  91.94968  86.93971
 [8]  87.34585  90.81621  81.69138
> rowMin(tmp5)
 [1] 59.14452 56.72521       NA 62.50640 61.85288 53.34568 54.51364 54.43725
 [9] 53.23815 64.90885
> 
> colMeans(tmp5)
 [1] 111.80662  70.98276        NA  70.99768  70.88720  69.60996  74.21486
 [8]  71.37798  72.74218  72.32214  73.59316  68.16312  70.88658  70.47042
[15]  70.95512  71.88115  72.36107  68.94083  68.77251  71.32427
> colSums(tmp5)
 [1] 1118.0662  709.8276        NA  709.9768  708.8720  696.0996  742.1486
 [8]  713.7798  727.4218  723.2214  735.9316  681.6312  708.8658  704.7042
[15]  709.5512  718.8115  723.6107  689.4083  687.7251  713.2427
> colVars(tmp5)
 [1] 15746.14533    51.46231          NA    76.98065    44.98120    86.32601
 [7]    52.08142    79.97333    30.97772    80.39548    53.16742    34.60446
[13]   101.11583    65.71363    36.70960    75.74622    71.51373    82.43419
[19]    92.29941    69.47283
> colSd(tmp5)
 [1] 125.483646   7.173724         NA   8.773862   6.706803   9.291179
 [7]   7.216746   8.942781   5.565763   8.966352   7.291599   5.882556
[13]  10.055637   8.106395   6.058845   8.703230   8.456579   9.079328
[19]   9.607258   8.335036
> colMax(tmp5)
 [1] 467.21724  82.76700        NA  91.94968  78.86704  84.47317  82.94760
 [8]  87.34585  80.55030  86.98241  87.28942  74.34379  90.81621  82.90435
[15]  81.49838  84.52048  89.81194  89.94879  86.93971  84.73645
> colMin(tmp5)
 [1] 58.30467 61.04730       NA 59.30882 59.14452 53.34568 63.01773 54.51364
 [9] 64.86406 57.05430 66.61574 56.49013 56.94441 54.43725 61.57318 58.29998
[17] 57.63407 59.28044 53.23815 54.43293
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.2172
> Min(tmp5,na.rm=TRUE)
[1] 53.23815
> mean(tmp5,na.rm=TRUE)
[1] 73.00108
> Sum(tmp5,na.rm=TRUE)
[1] 14527.21
> Var(tmp5,na.rm=TRUE)
[1] 853.8544
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.65901 67.90883 72.92101 73.98991 71.72612 72.61781 70.00741 68.89792
 [9] 69.70839 72.57037
> rowSums(tmp5,na.rm=TRUE)
 [1] 1793.180 1358.177 1385.499 1479.798 1434.522 1452.356 1400.148 1377.958
 [9] 1394.168 1451.407
> rowVars(tmp5,na.rm=TRUE)
 [1] 7944.48985   64.37099   66.96237   68.90584   44.47482   81.31548
 [7]   85.60186   61.48824  101.17383   21.75133
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.131868  8.023154  8.183054  8.300954  6.668945  9.017510  9.252128
 [8]  7.841443 10.058520  4.663833
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.21724  82.94760  95.86875  89.94879  84.73645  91.94968  86.93971
 [8]  87.34585  90.81621  81.69138
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.14452 56.72521 59.28044 62.50640 61.85288 53.34568 54.51364 54.43725
 [9] 53.23815 64.90885
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.80662  70.98276  67.14653  70.99768  70.88720  69.60996  74.21486
 [8]  71.37798  72.74218  72.32214  73.59316  68.16312  70.88658  70.47042
[15]  70.95512  71.88115  72.36107  68.94083  68.77251  71.32427
> colSums(tmp5,na.rm=TRUE)
 [1] 1118.0662  709.8276  604.3188  709.9768  708.8720  696.0996  742.1486
 [8]  713.7798  727.4218  723.2214  735.9316  681.6312  708.8658  704.7042
[15]  709.5512  718.8115  723.6107  689.4083  687.7251  713.2427
> colVars(tmp5,na.rm=TRUE)
 [1] 15746.14533    51.46231    30.44821    76.98065    44.98120    86.32601
 [7]    52.08142    79.97333    30.97772    80.39548    53.16742    34.60446
[13]   101.11583    65.71363    36.70960    75.74622    71.51373    82.43419
[19]    92.29941    69.47283
> colSd(tmp5,na.rm=TRUE)
 [1] 125.483646   7.173724   5.517990   8.773862   6.706803   9.291179
 [7]   7.216746   8.942781   5.565763   8.966352   7.291599   5.882556
[13]  10.055637   8.106395   6.058845   8.703230   8.456579   9.079328
[19]   9.607258   8.335036
> colMax(tmp5,na.rm=TRUE)
 [1] 467.21724  82.76700  76.20750  91.94968  78.86704  84.47317  82.94760
 [8]  87.34585  80.55030  86.98241  87.28942  74.34379  90.81621  82.90435
[15]  81.49838  84.52048  89.81194  89.94879  86.93971  84.73645
> colMin(tmp5,na.rm=TRUE)
 [1] 58.30467 61.04730 56.72521 59.30882 59.14452 53.34568 63.01773 54.51364
 [9] 64.86406 57.05430 66.61574 56.49013 56.94441 54.43725 61.57318 58.29998
[17] 57.63407 59.28044 53.23815 54.43293
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.65901 67.90883      NaN 73.98991 71.72612 72.61781 70.00741 68.89792
 [9] 69.70839 72.57037
> rowSums(tmp5,na.rm=TRUE)
 [1] 1793.180 1358.177    0.000 1479.798 1434.522 1452.356 1400.148 1377.958
 [9] 1394.168 1451.407
> rowVars(tmp5,na.rm=TRUE)
 [1] 7944.48985   64.37099         NA   68.90584   44.47482   81.31548
 [7]   85.60186   61.48824  101.17383   21.75133
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.131868  8.023154        NA  8.300954  6.668945  9.017510  9.252128
 [8]  7.841443 10.058520  4.663833
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.21724  82.94760        NA  89.94879  84.73645  91.94968  86.93971
 [8]  87.34585  90.81621  81.69138
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.14452 56.72521       NA 62.50640 61.85288 53.34568 54.51364 54.43725
 [9] 53.23815 64.90885
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.57749  69.98240       NaN  70.51045  70.62744  68.72587  73.50504
 [8]  71.97030  72.09745  71.50628  74.21884  67.94737  70.64828  70.62097
[15]  71.00397  72.36836  72.82996  70.01421  69.54599  71.34340
> colSums(tmp5,na.rm=TRUE)
 [1] 1022.1974  629.8416    0.0000  634.5941  635.6470  618.5328  661.5454
 [8]  647.7327  648.8770  643.5565  667.9696  611.5264  635.8345  635.5887
[15]  639.0357  651.3153  655.4696  630.1279  625.9139  642.0906
> colVars(tmp5,na.rm=TRUE)
 [1] 17679.13354    46.63695          NA    83.93260    49.84478    88.32365
 [7]    52.92336    86.02314    30.17360    82.95665    55.40919    38.40640
[13]   113.11646    73.67286    41.27146    82.54401    77.97961    79.77691
[19]    97.10621    78.15281
> colSd(tmp5,na.rm=TRUE)
 [1] 132.962903   6.829125         NA   9.161473   7.060084   9.398066
 [7]   7.274844   9.274866   5.493050   9.108054   7.443735   6.197290
[13]  10.635622   8.583290   6.424286   9.085373   8.830606   8.931792
[19]   9.854248   8.840408
> colMax(tmp5,na.rm=TRUE)
 [1] 467.21724  82.76700      -Inf  91.94968  78.86704  84.47317  82.94760
 [8]  87.34585  80.55030  86.98241  87.28942  74.34379  90.81621  82.90435
[15]  81.49838  84.52048  89.81194  89.94879  86.93971  84.73645
> colMin(tmp5,na.rm=TRUE)
 [1] 58.30467 61.04730      Inf 59.30882 59.14452 53.34568 63.01773 54.51364
 [9] 64.86406 57.05430 66.61574 56.49013 56.94441 54.43725 61.57318 58.29998
[17] 57.63407 61.65520 53.23815 54.43293
> 
> 
> 
> 
> 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] 271.0209 136.5900 163.6457 244.4746 182.7457 177.5426 145.3379 124.0244
 [9] 313.3827 245.6494
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 271.0209 136.5900 163.6457 244.4746 182.7457 177.5426 145.3379 124.0244
 [9] 313.3827 245.6494
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14 -5.684342e-14  8.526513e-14 -2.842171e-14 -1.136868e-13
 [6] -8.526513e-14 -1.421085e-13  2.273737e-13  2.842171e-14  5.684342e-14
[11]  5.684342e-14  5.684342e-14  1.136868e-13  0.000000e+00 -4.263256e-14
[16]  8.526513e-14  4.973799e-14  5.684342e-14 -2.273737e-13  1.847411e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   10 
2   17 
6   6 
3   19 
8   15 
1   20 
2   18 
9   1 
2   16 
9   3 
4   12 
6   7 
9   13 
5   13 
2   4 
7   3 
6   8 
9   6 
6   5 
3   4 
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.257079
> Min(tmp)
[1] -2.388025
> mean(tmp)
[1] 0.2740158
> Sum(tmp)
[1] 27.40158
> Var(tmp)
[1] 0.9063356
> 
> rowMeans(tmp)
[1] 0.2740158
> rowSums(tmp)
[1] 27.40158
> rowVars(tmp)
[1] 0.9063356
> rowSd(tmp)
[1] 0.9520166
> rowMax(tmp)
[1] 2.257079
> rowMin(tmp)
[1] -2.388025
> 
> colMeans(tmp)
  [1]  0.310031092 -0.666951333 -0.619955656 -0.349968389  1.590758540
  [6] -0.263884602  1.195025832  1.588469108  1.528196472  1.292413507
 [11] -0.789446089  0.050577400 -0.042047407  0.837681210  0.759402455
 [16] -1.075069084  1.299980473  1.604662643 -0.708724391  1.442982609
 [21]  1.228018104  1.411646199 -0.329588445  0.075497343  0.353306490
 [26]  0.302198760 -0.847559156  0.363935890 -0.130883528 -0.014667672
 [31]  1.659144331  2.257078622  0.143019037  0.638479097  0.769373482
 [36]  0.012739488  1.248828343  0.549185886 -0.063306441  0.882452525
 [41]  1.347825039  0.198512749  0.184581268  1.716850431 -0.548376261
 [46] -0.750170959  1.346090071 -0.092553315 -0.304460091  1.029488185
 [51]  0.873209962  1.826177913  1.257961146 -0.520851964 -1.217276335
 [56]  1.265451731 -0.794232162  0.996665816  0.124812895  0.096076225
 [61] -0.212560985 -0.795843504 -0.230682144  1.139373693 -0.109543885
 [66] -0.651390541  0.081583257 -0.506673869  0.805620818  0.553940616
 [71]  0.188415449 -0.025571725 -0.596395723  1.329292262 -0.587450251
 [76] -0.896562880 -0.105889586 -1.096938024 -0.251972306 -1.502468158
 [81] -0.848783800 -0.379153331 -0.257362927 -1.223053305  0.703640996
 [86] -0.703965670  2.046996649 -2.388024604 -0.856881839  1.797680666
 [91] -0.617142159 -0.170057551  0.940518601  1.798022871  1.630236316
 [96]  0.349212456 -0.003133453 -0.213488756 -0.449890389  2.189114896
> colSums(tmp)
  [1]  0.310031092 -0.666951333 -0.619955656 -0.349968389  1.590758540
  [6] -0.263884602  1.195025832  1.588469108  1.528196472  1.292413507
 [11] -0.789446089  0.050577400 -0.042047407  0.837681210  0.759402455
 [16] -1.075069084  1.299980473  1.604662643 -0.708724391  1.442982609
 [21]  1.228018104  1.411646199 -0.329588445  0.075497343  0.353306490
 [26]  0.302198760 -0.847559156  0.363935890 -0.130883528 -0.014667672
 [31]  1.659144331  2.257078622  0.143019037  0.638479097  0.769373482
 [36]  0.012739488  1.248828343  0.549185886 -0.063306441  0.882452525
 [41]  1.347825039  0.198512749  0.184581268  1.716850431 -0.548376261
 [46] -0.750170959  1.346090071 -0.092553315 -0.304460091  1.029488185
 [51]  0.873209962  1.826177913  1.257961146 -0.520851964 -1.217276335
 [56]  1.265451731 -0.794232162  0.996665816  0.124812895  0.096076225
 [61] -0.212560985 -0.795843504 -0.230682144  1.139373693 -0.109543885
 [66] -0.651390541  0.081583257 -0.506673869  0.805620818  0.553940616
 [71]  0.188415449 -0.025571725 -0.596395723  1.329292262 -0.587450251
 [76] -0.896562880 -0.105889586 -1.096938024 -0.251972306 -1.502468158
 [81] -0.848783800 -0.379153331 -0.257362927 -1.223053305  0.703640996
 [86] -0.703965670  2.046996649 -2.388024604 -0.856881839  1.797680666
 [91] -0.617142159 -0.170057551  0.940518601  1.798022871  1.630236316
 [96]  0.349212456 -0.003133453 -0.213488756 -0.449890389  2.189114896
> 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.310031092 -0.666951333 -0.619955656 -0.349968389  1.590758540
  [6] -0.263884602  1.195025832  1.588469108  1.528196472  1.292413507
 [11] -0.789446089  0.050577400 -0.042047407  0.837681210  0.759402455
 [16] -1.075069084  1.299980473  1.604662643 -0.708724391  1.442982609
 [21]  1.228018104  1.411646199 -0.329588445  0.075497343  0.353306490
 [26]  0.302198760 -0.847559156  0.363935890 -0.130883528 -0.014667672
 [31]  1.659144331  2.257078622  0.143019037  0.638479097  0.769373482
 [36]  0.012739488  1.248828343  0.549185886 -0.063306441  0.882452525
 [41]  1.347825039  0.198512749  0.184581268  1.716850431 -0.548376261
 [46] -0.750170959  1.346090071 -0.092553315 -0.304460091  1.029488185
 [51]  0.873209962  1.826177913  1.257961146 -0.520851964 -1.217276335
 [56]  1.265451731 -0.794232162  0.996665816  0.124812895  0.096076225
 [61] -0.212560985 -0.795843504 -0.230682144  1.139373693 -0.109543885
 [66] -0.651390541  0.081583257 -0.506673869  0.805620818  0.553940616
 [71]  0.188415449 -0.025571725 -0.596395723  1.329292262 -0.587450251
 [76] -0.896562880 -0.105889586 -1.096938024 -0.251972306 -1.502468158
 [81] -0.848783800 -0.379153331 -0.257362927 -1.223053305  0.703640996
 [86] -0.703965670  2.046996649 -2.388024604 -0.856881839  1.797680666
 [91] -0.617142159 -0.170057551  0.940518601  1.798022871  1.630236316
 [96]  0.349212456 -0.003133453 -0.213488756 -0.449890389  2.189114896
> colMin(tmp)
  [1]  0.310031092 -0.666951333 -0.619955656 -0.349968389  1.590758540
  [6] -0.263884602  1.195025832  1.588469108  1.528196472  1.292413507
 [11] -0.789446089  0.050577400 -0.042047407  0.837681210  0.759402455
 [16] -1.075069084  1.299980473  1.604662643 -0.708724391  1.442982609
 [21]  1.228018104  1.411646199 -0.329588445  0.075497343  0.353306490
 [26]  0.302198760 -0.847559156  0.363935890 -0.130883528 -0.014667672
 [31]  1.659144331  2.257078622  0.143019037  0.638479097  0.769373482
 [36]  0.012739488  1.248828343  0.549185886 -0.063306441  0.882452525
 [41]  1.347825039  0.198512749  0.184581268  1.716850431 -0.548376261
 [46] -0.750170959  1.346090071 -0.092553315 -0.304460091  1.029488185
 [51]  0.873209962  1.826177913  1.257961146 -0.520851964 -1.217276335
 [56]  1.265451731 -0.794232162  0.996665816  0.124812895  0.096076225
 [61] -0.212560985 -0.795843504 -0.230682144  1.139373693 -0.109543885
 [66] -0.651390541  0.081583257 -0.506673869  0.805620818  0.553940616
 [71]  0.188415449 -0.025571725 -0.596395723  1.329292262 -0.587450251
 [76] -0.896562880 -0.105889586 -1.096938024 -0.251972306 -1.502468158
 [81] -0.848783800 -0.379153331 -0.257362927 -1.223053305  0.703640996
 [86] -0.703965670  2.046996649 -2.388024604 -0.856881839  1.797680666
 [91] -0.617142159 -0.170057551  0.940518601  1.798022871  1.630236316
 [96]  0.349212456 -0.003133453 -0.213488756 -0.449890389  2.189114896
> colMedians(tmp)
  [1]  0.310031092 -0.666951333 -0.619955656 -0.349968389  1.590758540
  [6] -0.263884602  1.195025832  1.588469108  1.528196472  1.292413507
 [11] -0.789446089  0.050577400 -0.042047407  0.837681210  0.759402455
 [16] -1.075069084  1.299980473  1.604662643 -0.708724391  1.442982609
 [21]  1.228018104  1.411646199 -0.329588445  0.075497343  0.353306490
 [26]  0.302198760 -0.847559156  0.363935890 -0.130883528 -0.014667672
 [31]  1.659144331  2.257078622  0.143019037  0.638479097  0.769373482
 [36]  0.012739488  1.248828343  0.549185886 -0.063306441  0.882452525
 [41]  1.347825039  0.198512749  0.184581268  1.716850431 -0.548376261
 [46] -0.750170959  1.346090071 -0.092553315 -0.304460091  1.029488185
 [51]  0.873209962  1.826177913  1.257961146 -0.520851964 -1.217276335
 [56]  1.265451731 -0.794232162  0.996665816  0.124812895  0.096076225
 [61] -0.212560985 -0.795843504 -0.230682144  1.139373693 -0.109543885
 [66] -0.651390541  0.081583257 -0.506673869  0.805620818  0.553940616
 [71]  0.188415449 -0.025571725 -0.596395723  1.329292262 -0.587450251
 [76] -0.896562880 -0.105889586 -1.096938024 -0.251972306 -1.502468158
 [81] -0.848783800 -0.379153331 -0.257362927 -1.223053305  0.703640996
 [86] -0.703965670  2.046996649 -2.388024604 -0.856881839  1.797680666
 [91] -0.617142159 -0.170057551  0.940518601  1.798022871  1.630236316
 [96]  0.349212456 -0.003133453 -0.213488756 -0.449890389  2.189114896
> colRanges(tmp)
          [,1]       [,2]       [,3]       [,4]     [,5]       [,6]     [,7]
[1,] 0.3100311 -0.6669513 -0.6199557 -0.3499684 1.590759 -0.2638846 1.195026
[2,] 0.3100311 -0.6669513 -0.6199557 -0.3499684 1.590759 -0.2638846 1.195026
         [,8]     [,9]    [,10]      [,11]     [,12]       [,13]     [,14]
[1,] 1.588469 1.528196 1.292414 -0.7894461 0.0505774 -0.04204741 0.8376812
[2,] 1.588469 1.528196 1.292414 -0.7894461 0.0505774 -0.04204741 0.8376812
         [,15]     [,16]   [,17]    [,18]      [,19]    [,20]    [,21]    [,22]
[1,] 0.7594025 -1.075069 1.29998 1.604663 -0.7087244 1.442983 1.228018 1.411646
[2,] 0.7594025 -1.075069 1.29998 1.604663 -0.7087244 1.442983 1.228018 1.411646
          [,23]      [,24]     [,25]     [,26]      [,27]     [,28]      [,29]
[1,] -0.3295884 0.07549734 0.3533065 0.3021988 -0.8475592 0.3639359 -0.1308835
[2,] -0.3295884 0.07549734 0.3533065 0.3021988 -0.8475592 0.3639359 -0.1308835
           [,30]    [,31]    [,32]    [,33]     [,34]     [,35]      [,36]
[1,] -0.01466767 1.659144 2.257079 0.143019 0.6384791 0.7693735 0.01273949
[2,] -0.01466767 1.659144 2.257079 0.143019 0.6384791 0.7693735 0.01273949
        [,37]     [,38]       [,39]     [,40]    [,41]     [,42]     [,43]
[1,] 1.248828 0.5491859 -0.06330644 0.8824525 1.347825 0.1985127 0.1845813
[2,] 1.248828 0.5491859 -0.06330644 0.8824525 1.347825 0.1985127 0.1845813
       [,44]      [,45]     [,46]   [,47]       [,48]      [,49]    [,50]
[1,] 1.71685 -0.5483763 -0.750171 1.34609 -0.09255331 -0.3044601 1.029488
[2,] 1.71685 -0.5483763 -0.750171 1.34609 -0.09255331 -0.3044601 1.029488
       [,51]    [,52]    [,53]     [,54]     [,55]    [,56]      [,57]
[1,] 0.87321 1.826178 1.257961 -0.520852 -1.217276 1.265452 -0.7942322
[2,] 0.87321 1.826178 1.257961 -0.520852 -1.217276 1.265452 -0.7942322
         [,58]     [,59]      [,60]     [,61]      [,62]      [,63]    [,64]
[1,] 0.9966658 0.1248129 0.09607623 -0.212561 -0.7958435 -0.2306821 1.139374
[2,] 0.9966658 0.1248129 0.09607623 -0.212561 -0.7958435 -0.2306821 1.139374
          [,65]      [,66]      [,67]      [,68]     [,69]     [,70]     [,71]
[1,] -0.1095439 -0.6513905 0.08158326 -0.5066739 0.8056208 0.5539406 0.1884154
[2,] -0.1095439 -0.6513905 0.08158326 -0.5066739 0.8056208 0.5539406 0.1884154
           [,72]      [,73]    [,74]      [,75]      [,76]      [,77]     [,78]
[1,] -0.02557173 -0.5963957 1.329292 -0.5874503 -0.8965629 -0.1058896 -1.096938
[2,] -0.02557173 -0.5963957 1.329292 -0.5874503 -0.8965629 -0.1058896 -1.096938
          [,79]     [,80]      [,81]      [,82]      [,83]     [,84]    [,85]
[1,] -0.2519723 -1.502468 -0.8487838 -0.3791533 -0.2573629 -1.223053 0.703641
[2,] -0.2519723 -1.502468 -0.8487838 -0.3791533 -0.2573629 -1.223053 0.703641
          [,86]    [,87]     [,88]      [,89]    [,90]      [,91]      [,92]
[1,] -0.7039657 2.046997 -2.388025 -0.8568818 1.797681 -0.6171422 -0.1700576
[2,] -0.7039657 2.046997 -2.388025 -0.8568818 1.797681 -0.6171422 -0.1700576
         [,93]    [,94]    [,95]     [,96]        [,97]      [,98]      [,99]
[1,] 0.9405186 1.798023 1.630236 0.3492125 -0.003133453 -0.2134888 -0.4498904
[2,] 0.9405186 1.798023 1.630236 0.3492125 -0.003133453 -0.2134888 -0.4498904
       [,100]
[1,] 2.189115
[2,] 2.189115
> 
> 
> Max(tmp2)
[1] 3.463903
> Min(tmp2)
[1] -2.09679
> mean(tmp2)
[1] -0.08867641
> Sum(tmp2)
[1] -8.867641
> Var(tmp2)
[1] 1.132553
> 
> rowMeans(tmp2)
  [1]  0.15284802  0.33751840 -0.12550555  0.09561372 -1.52507200 -0.09366461
  [7]  0.98936416 -1.19274466 -1.09982224 -2.09679039  0.77302973 -0.88278359
 [13]  0.11791004 -0.66376675 -0.74909904 -0.06941809  0.24013679 -2.02849765
 [19]  0.05864279  2.36818542  0.68725252 -0.57689556  0.63529265 -1.35838024
 [25]  0.35971339  3.15044032 -1.25776843 -0.47077291 -0.41232408 -0.18314751
 [31]  0.52976516 -2.08894163 -0.68633490 -0.68700749 -0.79761373 -0.87682781
 [37] -0.02936396 -0.41492807 -0.57199041 -0.43430468  1.99235097 -0.54915321
 [43]  0.65937377  2.72281646  0.09688348  0.68409907  0.16309055  1.58658710
 [49] -0.55676158 -0.20702700  1.05352701  1.11184819 -0.54357635  0.82327609
 [55] -1.10540934 -0.88052153  0.31504283 -0.04631992  0.80032439 -0.36692231
 [61] -0.96770357 -0.21931310  0.03678372  0.08204767 -0.22397044  1.16809039
 [67] -0.92968927  0.04568202 -0.18112761 -0.56609534 -2.09297809 -0.60033653
 [73] -0.55353497 -1.75542932  0.86329466 -0.98825182  0.52740351  0.30393785
 [79] -0.79189150  3.46390284 -0.47857042 -1.51455319 -0.85154423 -0.43369120
 [85]  0.96698819  0.51202693  1.83433184  0.96405591  0.16610332 -0.24094783
 [91] -0.63460855  1.23693292 -0.95365899 -1.31554649  1.22911322 -1.46700589
 [97] -0.13770975 -1.19986617  0.50476908 -0.55055698
> rowSums(tmp2)
  [1]  0.15284802  0.33751840 -0.12550555  0.09561372 -1.52507200 -0.09366461
  [7]  0.98936416 -1.19274466 -1.09982224 -2.09679039  0.77302973 -0.88278359
 [13]  0.11791004 -0.66376675 -0.74909904 -0.06941809  0.24013679 -2.02849765
 [19]  0.05864279  2.36818542  0.68725252 -0.57689556  0.63529265 -1.35838024
 [25]  0.35971339  3.15044032 -1.25776843 -0.47077291 -0.41232408 -0.18314751
 [31]  0.52976516 -2.08894163 -0.68633490 -0.68700749 -0.79761373 -0.87682781
 [37] -0.02936396 -0.41492807 -0.57199041 -0.43430468  1.99235097 -0.54915321
 [43]  0.65937377  2.72281646  0.09688348  0.68409907  0.16309055  1.58658710
 [49] -0.55676158 -0.20702700  1.05352701  1.11184819 -0.54357635  0.82327609
 [55] -1.10540934 -0.88052153  0.31504283 -0.04631992  0.80032439 -0.36692231
 [61] -0.96770357 -0.21931310  0.03678372  0.08204767 -0.22397044  1.16809039
 [67] -0.92968927  0.04568202 -0.18112761 -0.56609534 -2.09297809 -0.60033653
 [73] -0.55353497 -1.75542932  0.86329466 -0.98825182  0.52740351  0.30393785
 [79] -0.79189150  3.46390284 -0.47857042 -1.51455319 -0.85154423 -0.43369120
 [85]  0.96698819  0.51202693  1.83433184  0.96405591  0.16610332 -0.24094783
 [91] -0.63460855  1.23693292 -0.95365899 -1.31554649  1.22911322 -1.46700589
 [97] -0.13770975 -1.19986617  0.50476908 -0.55055698
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.15284802  0.33751840 -0.12550555  0.09561372 -1.52507200 -0.09366461
  [7]  0.98936416 -1.19274466 -1.09982224 -2.09679039  0.77302973 -0.88278359
 [13]  0.11791004 -0.66376675 -0.74909904 -0.06941809  0.24013679 -2.02849765
 [19]  0.05864279  2.36818542  0.68725252 -0.57689556  0.63529265 -1.35838024
 [25]  0.35971339  3.15044032 -1.25776843 -0.47077291 -0.41232408 -0.18314751
 [31]  0.52976516 -2.08894163 -0.68633490 -0.68700749 -0.79761373 -0.87682781
 [37] -0.02936396 -0.41492807 -0.57199041 -0.43430468  1.99235097 -0.54915321
 [43]  0.65937377  2.72281646  0.09688348  0.68409907  0.16309055  1.58658710
 [49] -0.55676158 -0.20702700  1.05352701  1.11184819 -0.54357635  0.82327609
 [55] -1.10540934 -0.88052153  0.31504283 -0.04631992  0.80032439 -0.36692231
 [61] -0.96770357 -0.21931310  0.03678372  0.08204767 -0.22397044  1.16809039
 [67] -0.92968927  0.04568202 -0.18112761 -0.56609534 -2.09297809 -0.60033653
 [73] -0.55353497 -1.75542932  0.86329466 -0.98825182  0.52740351  0.30393785
 [79] -0.79189150  3.46390284 -0.47857042 -1.51455319 -0.85154423 -0.43369120
 [85]  0.96698819  0.51202693  1.83433184  0.96405591  0.16610332 -0.24094783
 [91] -0.63460855  1.23693292 -0.95365899 -1.31554649  1.22911322 -1.46700589
 [97] -0.13770975 -1.19986617  0.50476908 -0.55055698
> rowMin(tmp2)
  [1]  0.15284802  0.33751840 -0.12550555  0.09561372 -1.52507200 -0.09366461
  [7]  0.98936416 -1.19274466 -1.09982224 -2.09679039  0.77302973 -0.88278359
 [13]  0.11791004 -0.66376675 -0.74909904 -0.06941809  0.24013679 -2.02849765
 [19]  0.05864279  2.36818542  0.68725252 -0.57689556  0.63529265 -1.35838024
 [25]  0.35971339  3.15044032 -1.25776843 -0.47077291 -0.41232408 -0.18314751
 [31]  0.52976516 -2.08894163 -0.68633490 -0.68700749 -0.79761373 -0.87682781
 [37] -0.02936396 -0.41492807 -0.57199041 -0.43430468  1.99235097 -0.54915321
 [43]  0.65937377  2.72281646  0.09688348  0.68409907  0.16309055  1.58658710
 [49] -0.55676158 -0.20702700  1.05352701  1.11184819 -0.54357635  0.82327609
 [55] -1.10540934 -0.88052153  0.31504283 -0.04631992  0.80032439 -0.36692231
 [61] -0.96770357 -0.21931310  0.03678372  0.08204767 -0.22397044  1.16809039
 [67] -0.92968927  0.04568202 -0.18112761 -0.56609534 -2.09297809 -0.60033653
 [73] -0.55353497 -1.75542932  0.86329466 -0.98825182  0.52740351  0.30393785
 [79] -0.79189150  3.46390284 -0.47857042 -1.51455319 -0.85154423 -0.43369120
 [85]  0.96698819  0.51202693  1.83433184  0.96405591  0.16610332 -0.24094783
 [91] -0.63460855  1.23693292 -0.95365899 -1.31554649  1.22911322 -1.46700589
 [97] -0.13770975 -1.19986617  0.50476908 -0.55055698
> 
> colMeans(tmp2)
[1] -0.08867641
> colSums(tmp2)
[1] -8.867641
> colVars(tmp2)
[1] 1.132553
> colSd(tmp2)
[1] 1.064215
> colMax(tmp2)
[1] 3.463903
> colMin(tmp2)
[1] -2.09679
> colMedians(tmp2)
[1] -0.1950873
> colRanges(tmp2)
          [,1]
[1,] -2.096790
[2,]  3.463903
> 
> 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]  0.2214069  2.6954545  6.2642849  3.9479466 -0.8287750 -3.4399040
 [7] -0.8552084 -1.0331956 -1.4321793 -4.0578517
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3327337
[2,] -0.5845336
[3,]  0.1004869
[4,]  0.6769875
[5,]  1.3782887
> 
> rowApply(tmp,sum)
 [1] -1.82113328  2.76598888  0.98365145 -0.52397657  1.08421630 -2.01610947
 [7]  0.07411327  1.14391452  1.10445879 -1.31314486
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    8    6    3    8    7    9    1    8     5
 [2,]   10    4   10    8    4    6    8    4    9     6
 [3,]    6   10    7   10    7    2    7    3    3     9
 [4,]    8    6    3    7   10   10    2    6   10     2
 [5,]    4    7    1    4    9    9    1    5    7     7
 [6,]    5    1    4    6    3    3    6   10    2     4
 [7,]    9    5    2    1    5    1    5    7    6    10
 [8,]    2    9    9    5    6    4    4    8    5     3
 [9,]    3    2    5    9    2    8   10    9    1     1
[10,]    7    3    8    2    1    5    3    2    4     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.6489466 -1.4603399 -2.7730250  1.4752166 -2.5337610  1.1591447
 [7]  0.6696855  0.7021324 -1.6446078 -0.0085474  0.3193015  0.6571275
[13] -0.1953682  2.3430406  0.5912405  2.8215018 -2.9906051 -0.6532125
[19]  3.4426740 -2.5341373
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1738251
[2,]  0.1094063
[3,]  0.3325728
[4,]  0.9918320
[5,]  1.3889607
> 
> rowApply(tmp,sum)
[1]  4.1437293  5.4252282 -1.5982926 -0.9967706 -4.9374867
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    8   16   11   14   20
[2,]    6   14    4    3   12
[3,]   14    2   12    1    4
[4,]    9   17   13    8   10
[5,]    1   11    7   12    6
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]       [,6]
[1,] -0.1738251 -0.3767754  0.7679343 -0.02811315 -1.5103982  0.9566959
[2,]  1.3889607  1.1137246 -1.4994592  1.40138443  0.3467380  1.5269132
[3,]  0.1094063 -1.0611519  0.2553999  0.36105405 -0.5780087 -0.8411176
[4,]  0.3325728 -1.2720379 -1.4178288 -0.28402880 -0.1275444  1.6023623
[5,]  0.9918320  0.1359008 -0.8790711  0.02492006 -0.6645477 -2.0857091
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,] -1.1612114  0.9812253 -1.07436958  0.2296351 -0.8990791  0.9290272
[2,]  1.8168806  0.5858289 -0.08705121  0.6425134  1.2306966 -0.3220679
[3,]  0.5460500 -0.5754412 -1.86009788 -0.9065625 -0.4118858 -1.5036787
[4,] -0.6317621  1.1386940  1.15219530 -0.9282844  0.9540368  1.3705985
[5,]  0.0997285 -1.4281746  0.22471555  0.9541509 -0.5544670  0.1832484
           [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,] -0.56331895  1.5546947  0.33104369  1.8333660  0.3979095 -0.3305886
[2,] -0.02980051 -0.2264378  0.04416805 -0.4977852 -2.9198080 -1.2987963
[3,] -0.01728097 -1.2587294  0.73532817  2.2741787  0.5023804  0.8301627
[4,]  0.03593808  1.3261002 -1.23035521 -0.2640108 -0.1948154 -0.2734250
[5,]  0.37909418  0.9474129  0.71105580 -0.5242469 -0.7762715  0.4194347
          [,19]       [,20]
[1,]  2.3012823 -0.02140518
[2,]  1.9626014  0.24602449
[3,]  1.2465323  0.55516967
[4,] -1.4117157 -0.87345991
[5,] -0.6560262 -2.44046632
> 
> 
> 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 :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2       col3      col4       col5       col6       col7
row1 -2.311659 -0.335495 0.09283585 -1.815897 -0.1931759 -0.8077127 -0.4606314
          col8       col9      col10      col11     col12     col13     col14
row1 -2.171529 -0.2631767 0.02724195 -0.2837446 0.4769765 -0.615386 0.1376329
          col15    col16     col17     col18      col19      col20
row1 -0.9133729 1.240194 0.8368631 -1.077174 -0.5734245 -0.2498644
> tmp[,"col10"]
           col10
row1  0.02724195
row2 -0.08440750
row3  0.05950070
row4  0.22970198
row5  0.96294547
> tmp[c("row1","row5"),]
           col1      col2        col3      col4       col5       col6
row1 -2.3116593 -0.335495  0.09283585 -1.815897 -0.1931759 -0.8077127
row5 -0.3450312  0.984365 -0.03681031  1.722528  0.9463209 -1.0810595
           col7       col8       col9      col10      col11     col12
row1 -0.4606314 -2.1715290 -0.2631767 0.02724195 -0.2837446 0.4769765
row5 -0.3777690  0.6984258 -0.1277039 0.96294547  1.4189545 1.4885585
          col13     col14      col15      col16      col17     col18      col19
row1 -0.6153860 0.1376329 -0.9133729  1.2401945  0.8368631 -1.077174 -0.5734245
row5  0.7116104 1.3518729  0.1796379 -0.1715397 -1.9842253 -1.092318  0.6786082
          col20
row1 -0.2498644
row5 -0.2512467
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.8077127 -0.2498644
row2  0.5468776 -0.8417646
row3  0.7416699  2.2870489
row4 -0.9751919  1.2652637
row5 -1.0810595 -0.2512467
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.8077127 -0.2498644
row5 -1.0810595 -0.2512467
> 
> 
> 
> 
> 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 49.92333 51.00966 51.46569 47.98092 49.69801 104.9324 50.37772 49.67265
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.37122 50.59614 49.50986 51.65959 49.26073 50.82206 49.79906 51.47118
        col17    col18    col19    col20
row1 51.26675 50.91692 47.54382 106.4785
> tmp[,"col10"]
        col10
row1 50.59614
row2 27.42500
row3 29.95575
row4 29.42943
row5 50.03756
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.92333 51.00966 51.46569 47.98092 49.69801 104.9324 50.37772 49.67265
row5 48.76970 48.97835 50.76167 49.83723 50.58793 104.9918 48.96338 50.52598
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.37122 50.59614 49.50986 51.65959 49.26073 50.82206 49.79906 51.47118
row5 49.62943 50.03756 50.55988 51.11079 48.00829 49.77676 49.36306 48.90732
        col17    col18    col19    col20
row1 51.26675 50.91692 47.54382 106.4785
row5 50.14668 52.38236 49.76001 105.1224
> tmp[,c("col6","col20")]
          col6     col20
row1 104.93244 106.47851
row2  75.18925  74.31148
row3  73.52258  75.49868
row4  74.96397  74.91370
row5 104.99184 105.12241
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9324 106.4785
row5 104.9918 105.1224
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9324 106.4785
row5 104.9918 105.1224
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.61464625
[2,]  0.75908976
[3,]  0.49108124
[4,] -0.03074334
[5,]  1.17762862
> tmp[,c("col17","col7")]
           col17        col7
[1,] -0.09374732 -0.95579223
[2,] -0.81655083  1.38728820
[3,] -0.57970759 -1.05994333
[4,]  1.48147182 -0.05907501
[5,]  1.64657458  0.45731219
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.2857574 -2.6091026
[2,]  0.7258365 -0.8819032
[3,]  0.8332350  0.3907582
[4,] -0.7497180 -0.2252303
[5,]  0.3222156 -0.3621574
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.2857574
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.2857574
[2,]  0.7258365
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3 -1.0228236 -1.9229633 -1.0029962 -1.8112315 -0.4598106 -0.4098779
row1 -0.3588993 -0.6237908  0.1092309  0.4154351  0.1468775  1.0557996
           [,7]      [,8]       [,9]     [,10]     [,11]     [,12]     [,13]
row3 -1.2823926  1.285204  1.3279299 0.0673348 0.1829306 0.1974493 0.6808382
row1 -0.4795901 -1.464311 -0.4895617 1.9289059 0.6282398 0.2582166 1.5622703
         [,14]      [,15]      [,16]       [,17]    [,18]     [,19]      [,20]
row3 2.1148397 -0.1180293 -1.2830384 -0.02784826 1.811780 0.7100430 1.14933757
row1 0.5926047 -1.3879413 -0.2960245 -0.81892958 1.818839 0.9458595 0.09932169
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]      [,4]     [,5]      [,6]       [,7]
row2 -1.371584 -0.7333335 0.07408451 -1.614412 1.517493 0.2251056 -0.6458895
          [,8]       [,9]      [,10]
row2 -1.256709 -0.7629564 -0.8274805
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]       [,3]       [,4]     [,5]      [,6]       [,7]
row5 -0.1449652 -0.1365755 -0.2888116 -0.9542493 1.608527 0.2308421 -0.4816925
           [,8]      [,9]     [,10]      [,11]    [,12]     [,13]      [,14]
row5 -0.7690891 0.1070344 -3.853905 -0.3070939 1.521166 0.1191197 0.02682055
          [,15]     [,16]     [,17]     [,18]     [,19]     [,20]
row5 -0.7674011 0.9959915 0.2209925 0.7705701 0.2413142 -1.070913
> 
> 
> 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: 0x622a5c120eb0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe45a962dcd"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe466812407"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe45d0bfef2"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe44eb66c61"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe46ab52fd6"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe46366af20"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe41dc8f8af"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe4264bf9dd"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe4471a537b"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe47c5caa8f"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe41de3d982"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe41b49f32c"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe432e1c2a" 
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe444d5da61"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM285fe4651ba74c"
> 
> 
> ### 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: 0x622a5c42d440>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x622a5c42d440>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x622a5c42d440>
> rowMedians(tmp)
  [1] -0.336884296  0.111695037 -0.266761996  0.041634257  0.060004766
  [6] -0.711079918  0.406977853 -0.415110283  0.186956274  0.243795631
 [11] -0.087834789  0.582485387  0.413613416  0.325926084  0.468458603
 [16] -0.412271863 -0.300399354 -0.115487667 -0.387501550 -0.041226562
 [21]  0.166199720  0.396217546  0.342298553 -0.507300703 -0.038827007
 [26]  0.101947031  0.012966283  0.559161828  0.284504265  0.445915595
 [31]  0.065146743 -0.139397557  0.194111123  0.075278520 -0.120840760
 [36] -0.158649384  0.208723084  0.032754249  0.112351355 -0.207243356
 [41]  0.306450706  0.351654359 -0.157326577  0.157307890  0.035000560
 [46]  0.011641895  0.241968328  0.243487868  0.111586671  0.495048794
 [51] -0.130404257  0.340622442  0.068946309  0.296244779 -0.159655185
 [56]  0.471480379  0.181261212  0.019594729 -0.222785184  0.059853926
 [61] -0.317639181  0.355413373 -0.066495144 -0.587057281  0.116347054
 [66] -0.033810883  0.157933073 -0.132553383  0.291942737 -0.302386420
 [71] -0.362728866  0.373356407  0.368428307  0.378699479  0.061173300
 [76] -0.264568661 -0.469411483  0.146365338 -0.121837048 -0.001277223
 [81]  0.467038326  0.138888460 -0.466887419 -0.493182633 -0.253212159
 [86] -0.308874950 -0.042154868  0.636181933 -0.035067265  0.123048697
 [91] -0.479966130  0.370748111 -0.179912824  0.305801552  0.460930023
 [96]  0.539008885  0.298735494 -0.219306648 -0.106854846 -0.028750272
[101]  0.238811127 -0.076360493 -0.090342635 -0.131034993  0.232443468
[106]  0.015366385 -0.387502761  0.240199193 -0.103792131  0.218292224
[111]  0.426146463  0.226217831 -0.162691669  0.807445013 -0.015480057
[116] -0.231792552  0.126178086 -0.353819223  0.075373183  0.197596583
[121] -0.266317764  0.395138217  0.357385026  0.766909322 -0.222548409
[126]  0.713927535  0.206271046  0.231694746 -0.076874009 -0.303590432
[131]  0.294931812  0.319595677  0.248732470  0.131201574 -0.386725094
[136]  0.388489455  0.450228552 -0.108236197 -0.618675504  0.064861255
[141]  0.011242528  0.022329896 -0.179449150 -0.135433442  0.208461316
[146]  0.178579976 -0.003701889 -0.337463722  0.283667699 -0.115698592
[151]  0.300096438 -0.327598189  0.185599310 -0.103935832 -0.042968963
[156]  0.229160938 -0.145569692 -0.102707631 -0.547005996 -0.431140325
[161] -0.592475471 -0.040785204 -0.480690572 -0.315475067  0.013372331
[166] -0.114473725 -0.716745053  0.445485453 -0.252700876 -0.722785198
[171] -0.045983735  0.425511901 -0.089606475 -0.373608904 -0.063050043
[176] -0.114964461  0.252313920 -0.050852830 -0.087043159 -0.133690832
[181]  0.461309770  0.299208470 -0.169698419  0.213433434 -0.331830436
[186]  0.078313479 -0.188880180 -0.078852069  0.272781906 -0.014848157
[191] -0.212074924  0.138425091  0.085958752  0.013941747  0.456383363
[196]  0.026136491 -0.498941149  0.235625332  0.190003972  0.341976851
[201]  0.617721830  0.176719702  0.123908733 -0.186678955  0.250855371
[206] -0.147491145 -0.128972089  0.332129625 -0.645376690  0.326860879
[211]  0.556729681 -0.410334210 -0.278642551  0.072442493  0.323578851
[216] -0.274953474  0.265276329  0.366432065  0.128217100 -0.535709444
[221] -0.532648892 -0.487719732  0.411571268  0.410815374 -0.266145545
[226] -0.109326152  0.627358111  0.085585582 -0.030660092  0.480374699
> 
> proc.time()
   user  system elapsed 
  1.307   1.485   2.781 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "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: 0x632fcb9eab20>
> .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: 0x632fcb9eab20>
> .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: 0x632fcb9eab20>
> .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: 0x632fcb9eab20>
> 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: 0x632fcb9cb410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632fcb9cb410>
> .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: 0x632fcb9cb410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632fcb9cb410>
> .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: 0x632fcb9cb410>
> 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: 0x632fca2787a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632fca2787a0>
> .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: 0x632fca2787a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x632fca2787a0>
> .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: 0x632fca2787a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x632fca2787a0>
> .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: 0x632fca2787a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x632fca2787a0>
> .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: 0x632fca2787a0>
> 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: 0x632fcb24a680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x632fcb24a680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632fcb24a680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632fcb24a680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2860c326b3bb5b" "BufferedMatrixFile2860c360d5da56"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2860c326b3bb5b" "BufferedMatrixFile2860c360d5da56"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x632fcafde490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632fcafde490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x632fcafde490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x632fcafde490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x632fcafde490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x632fcafde490>
> .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: 0x632fcc63a110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632fcc63a110>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x632fcc63a110>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x632fcc63a110>
> 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: 0x632fcc6dd5e0>
> .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: 0x632fcc6dd5e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.252   0.052   0.291 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "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.240   0.043   0.272 

Example timings