Back to Build/check report for BioC 3.22:   simplified   long
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2026-01-26 11:57 -0500 (Mon, 26 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4886
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-22 13:45 -0500 (Thu, 22 Jan 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-01-22 21:47:48 -0500 (Thu, 22 Jan 2026)
EndedAt: 2026-01-22 21:48:13 -0500 (Thu, 22 Jan 2026)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* 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.74.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 ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.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.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.231   0.046   0.267 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.22-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 478284 25.6    1046725   56   639600 34.2
Vcells 884773  6.8    8388608   64  2081613 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Jan 22 21:48:05 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Jan 22 21:48:05 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x595c3a8fd370>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Jan 22 21:48:05 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Jan 22 21:48:05 2026"
> 
> ColMode(tmp2)
<pointer: 0x595c3a8fd370>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.6053095 -0.5016036  1.3157878 -0.5922831
[2,]  -0.9322619  1.7267933 -1.6114319  1.1732453
[3,]   1.5412854  1.4847574 -0.8505209 -1.2738011
[4,]  -0.6398159  0.2510101 -0.3182699 -0.9538158
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.6053095 0.5016036 1.3157878 0.5922831
[2,]   0.9322619 1.7267933 1.6114319 1.1732453
[3,]   1.5412854 1.4847574 0.8505209 1.2738011
[4,]   0.6398159 0.2510101 0.3182699 0.9538158
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0302198 0.7082398 1.1470780 0.7695993
[2,]  0.9655371 1.3140751 1.2694219 1.0831645
[3,]  1.2414852 1.2185062 0.9222369 1.1286280
[4,]  0.7998849 0.5010090 0.5641541 0.9766350
> 
> 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.22-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,] 225.90751 32.58400 37.78657 33.28828
[2,]  35.58763 39.86754 39.30565 37.00489
[3,]  38.95614 38.66982 35.07289 37.56008
[4,]  33.63867 30.26110 30.95981 35.72017
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x595c3b8f99b0>
> exp(tmp5)
<pointer: 0x595c3b8f99b0>
> log(tmp5,2)
<pointer: 0x595c3b8f99b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.1969
> Min(tmp5)
[1] 54.49973
> mean(tmp5)
[1] 73.38359
> Sum(tmp5)
[1] 14676.72
> Var(tmp5)
[1] 861.2279
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.25923 72.50711 73.50669 70.84954 69.85025 70.71678 73.02613 69.60858
 [9] 68.89745 73.61417
> rowSums(tmp5)
 [1] 1825.185 1450.142 1470.134 1416.991 1397.005 1414.336 1460.523 1392.172
 [9] 1377.949 1472.283
> rowVars(tmp5)
 [1] 8008.51635   53.04662   40.76026   73.98463   59.63646   81.20508
 [7]   76.08588   97.13782   54.95056   73.96138
> rowSd(tmp5)
 [1] 89.490314  7.283311  6.384376  8.601432  7.722465  9.011386  8.722722
 [8]  9.855852  7.412864  8.600080
> rowMax(tmp5)
 [1] 470.19688  87.51024  81.08210  90.28929  89.72751  88.44154  88.76441
 [8]  83.99595  84.47068  90.69477
> rowMin(tmp5)
 [1] 59.03056 60.86365 62.68597 54.94305 58.95883 56.37914 58.48532 54.49973
 [9] 57.48213 59.52534
> 
> colMeans(tmp5)
 [1] 111.43922  76.38150  75.08062  73.02805  69.65559  69.77417  67.21744
 [8]  74.21348  72.54813  72.05369  73.45099  69.68477  67.17918  72.72721
[15]  72.92045  71.44076  69.93348  72.48639  69.91765  66.53910
> colSums(tmp5)
 [1] 1114.3922  763.8150  750.8062  730.2805  696.5559  697.7417  672.1744
 [8]  742.1348  725.4813  720.5369  734.5099  696.8477  671.7918  727.2721
[15]  729.2045  714.4076  699.3348  724.8639  699.1765  665.3910
> colVars(tmp5)
 [1] 15935.37049    75.41342    68.44644    92.11837    32.87502    69.36198
 [7]    79.71195    86.50458    95.10249    53.31333    46.81425    19.52542
[13]    33.47298    55.39701    80.48944    68.23282    99.50176    72.15928
[19]    97.66283    40.68112
> colSd(tmp5)
 [1] 126.235377   8.684090   8.273236   9.597831   5.733674   8.328384
 [7]   8.928155   9.300784   9.752050   7.301598   6.842094   4.418758
[13]   5.785583   7.442917   8.971591   8.260316   9.975057   8.494662
[19]   9.882451   6.378175
> colMax(tmp5)
 [1] 470.19688  85.76611  89.72751  88.76441  78.82754  78.50000  80.53240
 [8]  88.44154  87.71642  86.66175  86.36025  76.68299  80.32751  83.28138
[15]  90.28929  87.51024  90.69477  86.29382  83.99595  74.89456
> colMin(tmp5)
 [1] 59.42640 62.98452 63.91780 57.48213 59.52534 56.34820 55.14597 54.94305
 [9] 57.71380 61.33120 63.95562 64.93690 61.86239 58.94204 59.03056 61.92148
[17] 58.48532 62.01693 57.94622 54.49973
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.25923 72.50711 73.50669 70.84954 69.85025 70.71678 73.02613 69.60858
 [9] 68.89745       NA
> rowSums(tmp5)
 [1] 1825.185 1450.142 1470.134 1416.991 1397.005 1414.336 1460.523 1392.172
 [9] 1377.949       NA
> rowVars(tmp5)
 [1] 8008.51635   53.04662   40.76026   73.98463   59.63646   81.20508
 [7]   76.08588   97.13782   54.95056   61.00912
> rowSd(tmp5)
 [1] 89.490314  7.283311  6.384376  8.601432  7.722465  9.011386  8.722722
 [8]  9.855852  7.412864  7.810834
> rowMax(tmp5)
 [1] 470.19688  87.51024  81.08210  90.28929  89.72751  88.44154  88.76441
 [8]  83.99595  84.47068        NA
> rowMin(tmp5)
 [1] 59.03056 60.86365 62.68597 54.94305 58.95883 56.37914 58.48532 54.49973
 [9] 57.48213       NA
> 
> colMeans(tmp5)
 [1] 111.43922  76.38150  75.08062  73.02805  69.65559  69.77417  67.21744
 [8]  74.21348  72.54813  72.05369  73.45099  69.68477  67.17918  72.72721
[15]  72.92045  71.44076        NA  72.48639  69.91765  66.53910
> colSums(tmp5)
 [1] 1114.3922  763.8150  750.8062  730.2805  696.5559  697.7417  672.1744
 [8]  742.1348  725.4813  720.5369  734.5099  696.8477  671.7918  727.2721
[15]  729.2045  714.4076        NA  724.8639  699.1765  665.3910
> colVars(tmp5)
 [1] 15935.37049    75.41342    68.44644    92.11837    32.87502    69.36198
 [7]    79.71195    86.50458    95.10249    53.31333    46.81425    19.52542
[13]    33.47298    55.39701    80.48944    68.23282          NA    72.15928
[19]    97.66283    40.68112
> colSd(tmp5)
 [1] 126.235377   8.684090   8.273236   9.597831   5.733674   8.328384
 [7]   8.928155   9.300784   9.752050   7.301598   6.842094   4.418758
[13]   5.785583   7.442917   8.971591   8.260316         NA   8.494662
[19]   9.882451   6.378175
> colMax(tmp5)
 [1] 470.19688  85.76611  89.72751  88.76441  78.82754  78.50000  80.53240
 [8]  88.44154  87.71642  86.66175  86.36025  76.68299  80.32751  83.28138
[15]  90.28929  87.51024        NA  86.29382  83.99595  74.89456
> colMin(tmp5)
 [1] 59.42640 62.98452 63.91780 57.48213 59.52534 56.34820 55.14597 54.94305
 [9] 57.71380 61.33120 63.95562 64.93690 61.86239 58.94204 59.03056 61.92148
[17]       NA 62.01693 57.94622 54.49973
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.1969
> Min(tmp5,na.rm=TRUE)
[1] 54.49973
> mean(tmp5,na.rm=TRUE)
[1] 73.2966
> Sum(tmp5,na.rm=TRUE)
[1] 14586.02
> Var(tmp5,na.rm=TRUE)
[1] 864.0564
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.25923 72.50711 73.50669 70.84954 69.85025 70.71678 73.02613 69.60858
 [9] 68.89745 72.71519
> rowSums(tmp5,na.rm=TRUE)
 [1] 1825.185 1450.142 1470.134 1416.991 1397.005 1414.336 1460.523 1392.172
 [9] 1377.949 1381.589
> rowVars(tmp5,na.rm=TRUE)
 [1] 8008.51635   53.04662   40.76026   73.98463   59.63646   81.20508
 [7]   76.08588   97.13782   54.95056   61.00912
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.490314  7.283311  6.384376  8.601432  7.722465  9.011386  8.722722
 [8]  9.855852  7.412864  7.810834
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.19688  87.51024  81.08210  90.28929  89.72751  88.44154  88.76441
 [8]  83.99595  84.47068  86.36025
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.03056 60.86365 62.68597 54.94305 58.95883 56.37914 58.48532 54.49973
 [9] 57.48213 59.52534
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.43922  76.38150  75.08062  73.02805  69.65559  69.77417  67.21744
 [8]  74.21348  72.54813  72.05369  73.45099  69.68477  67.17918  72.72721
[15]  72.92045  71.44076  67.62667  72.48639  69.91765  66.53910
> colSums(tmp5,na.rm=TRUE)
 [1] 1114.3922  763.8150  750.8062  730.2805  696.5559  697.7417  672.1744
 [8]  742.1348  725.4813  720.5369  734.5099  696.8477  671.7918  727.2721
[15]  729.2045  714.4076  608.6400  724.8639  699.1765  665.3910
> colVars(tmp5,na.rm=TRUE)
 [1] 15935.37049    75.41342    68.44644    92.11837    32.87502    69.36198
 [7]    79.71195    86.50458    95.10249    53.31333    46.81425    19.52542
[13]    33.47298    55.39701    80.48944    68.23282    52.07404    72.15928
[19]    97.66283    40.68112
> colSd(tmp5,na.rm=TRUE)
 [1] 126.235377   8.684090   8.273236   9.597831   5.733674   8.328384
 [7]   8.928155   9.300784   9.752050   7.301598   6.842094   4.418758
[13]   5.785583   7.442917   8.971591   8.260316   7.216234   8.494662
[19]   9.882451   6.378175
> colMax(tmp5,na.rm=TRUE)
 [1] 470.19688  85.76611  89.72751  88.76441  78.82754  78.50000  80.53240
 [8]  88.44154  87.71642  86.66175  86.36025  76.68299  80.32751  83.28138
[15]  90.28929  87.51024  79.92055  86.29382  83.99595  74.89456
> colMin(tmp5,na.rm=TRUE)
 [1] 59.42640 62.98452 63.91780 57.48213 59.52534 56.34820 55.14597 54.94305
 [9] 57.71380 61.33120 63.95562 64.93690 61.86239 58.94204 59.03056 61.92148
[17] 58.48532 62.01693 57.94622 54.49973
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.25923 72.50711 73.50669 70.84954 69.85025 70.71678 73.02613 69.60858
 [9] 68.89745      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1825.185 1450.142 1470.134 1416.991 1397.005 1414.336 1460.523 1392.172
 [9] 1377.949    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8008.51635   53.04662   40.76026   73.98463   59.63646   81.20508
 [7]   76.08588   97.13782   54.95056         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.490314  7.283311  6.384376  8.601432  7.722465  9.011386  8.722722
 [8]  9.855852  7.412864        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.19688  87.51024  81.08210  90.28929  89.72751  88.44154  88.76441
 [8]  83.99595  84.47068        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.03056 60.86365 62.68597 54.94305 58.95883 56.37914 58.48532 54.49973
 [9] 57.48213       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.32877  76.35774  74.28514  72.52087  70.78117  68.86726  65.73800
 [8]  73.45750  72.33178  72.70849  72.01663  69.66567  67.76993  73.27489
[15]  73.01201  71.93707       NaN  73.64966  68.66780  66.16242
> colSums(tmp5,na.rm=TRUE)
 [1] 1046.9589  687.2196  668.5662  652.6878  637.0305  619.8054  591.6420
 [8]  661.1175  650.9860  654.3764  648.1496  626.9911  609.9294  659.4740
[15]  657.1080  647.4337    0.0000  662.8470  618.0102  595.4617
> colVars(tmp5,na.rm=TRUE)
 [1] 17658.33019    84.83374    69.88333   100.73932    22.73136    68.77925
 [7]    65.05260    90.88834   106.46373    55.15396    29.52033    21.96200
[13]    33.73096    58.94714    90.45631    73.99070          NA    65.95564
[19]    92.29679    44.16995
> colSd(tmp5,na.rm=TRUE)
 [1] 132.884650   9.210524   8.359625  10.036898   4.767741   8.293325
 [7]   8.065519   9.533537  10.318126   7.426571   5.433262   4.686363
[13]   5.807836   7.677704   9.510852   8.601785         NA   8.121308
[19]   9.607122   6.646048
> colMax(tmp5,na.rm=TRUE)
 [1] 470.19688  85.76611  89.72751  88.76441  78.82754  78.50000  76.61992
 [8]  88.44154  87.71642  86.66175  80.96155  76.68299  80.32751  83.28138
[15]  90.28929  87.51024      -Inf  86.29382  83.99595  74.89456
> colMin(tmp5,na.rm=TRUE)
 [1] 59.42640 62.98452 63.91780 57.48213 65.60859 56.34820 55.14597 54.94305
 [9] 57.71380 61.33120 63.95562 64.93690 61.86788 58.94204 59.03056 61.92148
[17]      Inf 62.26422 57.94622 54.49973
> 
> 
> 
> 
> 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] 164.36728 221.40767 172.64043 211.52878 291.99381 363.92530 175.65517
 [8]  78.96037 218.68494 218.98672
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 164.36728 221.40767 172.64043 211.52878 291.99381 363.92530 175.65517
 [8]  78.96037 218.68494 218.98672
> 
> 
> 
> 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] -4.263256e-14 -8.526513e-14  5.684342e-14  5.684342e-14  5.684342e-14
 [6] -1.705303e-13  4.547474e-13  2.842171e-14 -1.421085e-13 -2.842171e-14
[11] -1.705303e-13  0.000000e+00  0.000000e+00  0.000000e+00 -2.842171e-14
[16] -2.842171e-14  5.684342e-14 -2.842171e-14 -5.684342e-14 -2.557954e-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   8 
9   6 
9   16 
4   2 
2   4 
6   9 
10   8 
2   6 
8   20 
4   2 
1   19 
8   20 
4   14 
2   10 
3   3 
2   7 
6   4 
5   18 
6   2 
2   18 
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] 1.96479
> Min(tmp)
[1] -3.196978
> mean(tmp)
[1] -0.1130786
> Sum(tmp)
[1] -11.30786
> Var(tmp)
[1] 1.02187
> 
> rowMeans(tmp)
[1] -0.1130786
> rowSums(tmp)
[1] -11.30786
> rowVars(tmp)
[1] 1.02187
> rowSd(tmp)
[1] 1.010876
> rowMax(tmp)
[1] 1.96479
> rowMin(tmp)
[1] -3.196978
> 
> colMeans(tmp)
  [1]  1.45005460 -0.91927751  0.54409643  1.23226428 -1.12385032  1.21595268
  [7] -0.70576578 -1.85528794 -0.72905179 -0.17185110 -1.30943800 -2.38499245
 [13]  0.28863968 -1.50761516 -1.02910371 -0.08635262  0.78459331  1.21966315
 [19] -1.02730259 -0.30181641 -0.96652670 -0.97397855  0.39045405  1.71878830
 [25] -1.51086025  1.55346785 -0.76660749 -0.74832000 -3.19697813  0.79765563
 [31] -1.10735773  0.91528481  0.75202867 -0.46900844 -0.64461330  0.77046953
 [37]  0.18615966  1.43757805 -1.01348469  0.43705775  1.50249332  0.17034911
 [43] -0.82956397 -2.00343901 -0.70892553  1.29313705 -0.91177621  0.68856476
 [49]  0.05215415 -0.25766829  1.18889051 -0.25975703 -0.70346191  0.65894004
 [55] -0.96899034  0.45032779  0.15756694  0.50621706 -0.88599004  0.62932882
 [61]  0.29956093  0.11210977 -2.09750286  0.97419564 -0.41463297 -1.06360884
 [67]  0.53122157 -0.19410805  1.12352835  0.07740225  1.96479016 -0.09832492
 [73] -1.35053380 -0.52366236 -1.52855053 -0.44091322 -1.05849102  1.48027230
 [79] -0.52192627 -0.33218792 -0.16263392 -0.07129991 -0.60386828  0.83553849
 [85]  0.87073361 -0.39635275 -0.66493136  0.12297971  0.69437948 -1.73649131
 [91] -0.90125873  0.93237025  0.93278207 -0.11240088 -0.69917107  0.29555357
 [97]  0.60052593  1.35014194 -0.12289405 -0.32336140
> colSums(tmp)
  [1]  1.45005460 -0.91927751  0.54409643  1.23226428 -1.12385032  1.21595268
  [7] -0.70576578 -1.85528794 -0.72905179 -0.17185110 -1.30943800 -2.38499245
 [13]  0.28863968 -1.50761516 -1.02910371 -0.08635262  0.78459331  1.21966315
 [19] -1.02730259 -0.30181641 -0.96652670 -0.97397855  0.39045405  1.71878830
 [25] -1.51086025  1.55346785 -0.76660749 -0.74832000 -3.19697813  0.79765563
 [31] -1.10735773  0.91528481  0.75202867 -0.46900844 -0.64461330  0.77046953
 [37]  0.18615966  1.43757805 -1.01348469  0.43705775  1.50249332  0.17034911
 [43] -0.82956397 -2.00343901 -0.70892553  1.29313705 -0.91177621  0.68856476
 [49]  0.05215415 -0.25766829  1.18889051 -0.25975703 -0.70346191  0.65894004
 [55] -0.96899034  0.45032779  0.15756694  0.50621706 -0.88599004  0.62932882
 [61]  0.29956093  0.11210977 -2.09750286  0.97419564 -0.41463297 -1.06360884
 [67]  0.53122157 -0.19410805  1.12352835  0.07740225  1.96479016 -0.09832492
 [73] -1.35053380 -0.52366236 -1.52855053 -0.44091322 -1.05849102  1.48027230
 [79] -0.52192627 -0.33218792 -0.16263392 -0.07129991 -0.60386828  0.83553849
 [85]  0.87073361 -0.39635275 -0.66493136  0.12297971  0.69437948 -1.73649131
 [91] -0.90125873  0.93237025  0.93278207 -0.11240088 -0.69917107  0.29555357
 [97]  0.60052593  1.35014194 -0.12289405 -0.32336140
> 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]  1.45005460 -0.91927751  0.54409643  1.23226428 -1.12385032  1.21595268
  [7] -0.70576578 -1.85528794 -0.72905179 -0.17185110 -1.30943800 -2.38499245
 [13]  0.28863968 -1.50761516 -1.02910371 -0.08635262  0.78459331  1.21966315
 [19] -1.02730259 -0.30181641 -0.96652670 -0.97397855  0.39045405  1.71878830
 [25] -1.51086025  1.55346785 -0.76660749 -0.74832000 -3.19697813  0.79765563
 [31] -1.10735773  0.91528481  0.75202867 -0.46900844 -0.64461330  0.77046953
 [37]  0.18615966  1.43757805 -1.01348469  0.43705775  1.50249332  0.17034911
 [43] -0.82956397 -2.00343901 -0.70892553  1.29313705 -0.91177621  0.68856476
 [49]  0.05215415 -0.25766829  1.18889051 -0.25975703 -0.70346191  0.65894004
 [55] -0.96899034  0.45032779  0.15756694  0.50621706 -0.88599004  0.62932882
 [61]  0.29956093  0.11210977 -2.09750286  0.97419564 -0.41463297 -1.06360884
 [67]  0.53122157 -0.19410805  1.12352835  0.07740225  1.96479016 -0.09832492
 [73] -1.35053380 -0.52366236 -1.52855053 -0.44091322 -1.05849102  1.48027230
 [79] -0.52192627 -0.33218792 -0.16263392 -0.07129991 -0.60386828  0.83553849
 [85]  0.87073361 -0.39635275 -0.66493136  0.12297971  0.69437948 -1.73649131
 [91] -0.90125873  0.93237025  0.93278207 -0.11240088 -0.69917107  0.29555357
 [97]  0.60052593  1.35014194 -0.12289405 -0.32336140
> colMin(tmp)
  [1]  1.45005460 -0.91927751  0.54409643  1.23226428 -1.12385032  1.21595268
  [7] -0.70576578 -1.85528794 -0.72905179 -0.17185110 -1.30943800 -2.38499245
 [13]  0.28863968 -1.50761516 -1.02910371 -0.08635262  0.78459331  1.21966315
 [19] -1.02730259 -0.30181641 -0.96652670 -0.97397855  0.39045405  1.71878830
 [25] -1.51086025  1.55346785 -0.76660749 -0.74832000 -3.19697813  0.79765563
 [31] -1.10735773  0.91528481  0.75202867 -0.46900844 -0.64461330  0.77046953
 [37]  0.18615966  1.43757805 -1.01348469  0.43705775  1.50249332  0.17034911
 [43] -0.82956397 -2.00343901 -0.70892553  1.29313705 -0.91177621  0.68856476
 [49]  0.05215415 -0.25766829  1.18889051 -0.25975703 -0.70346191  0.65894004
 [55] -0.96899034  0.45032779  0.15756694  0.50621706 -0.88599004  0.62932882
 [61]  0.29956093  0.11210977 -2.09750286  0.97419564 -0.41463297 -1.06360884
 [67]  0.53122157 -0.19410805  1.12352835  0.07740225  1.96479016 -0.09832492
 [73] -1.35053380 -0.52366236 -1.52855053 -0.44091322 -1.05849102  1.48027230
 [79] -0.52192627 -0.33218792 -0.16263392 -0.07129991 -0.60386828  0.83553849
 [85]  0.87073361 -0.39635275 -0.66493136  0.12297971  0.69437948 -1.73649131
 [91] -0.90125873  0.93237025  0.93278207 -0.11240088 -0.69917107  0.29555357
 [97]  0.60052593  1.35014194 -0.12289405 -0.32336140
> colMedians(tmp)
  [1]  1.45005460 -0.91927751  0.54409643  1.23226428 -1.12385032  1.21595268
  [7] -0.70576578 -1.85528794 -0.72905179 -0.17185110 -1.30943800 -2.38499245
 [13]  0.28863968 -1.50761516 -1.02910371 -0.08635262  0.78459331  1.21966315
 [19] -1.02730259 -0.30181641 -0.96652670 -0.97397855  0.39045405  1.71878830
 [25] -1.51086025  1.55346785 -0.76660749 -0.74832000 -3.19697813  0.79765563
 [31] -1.10735773  0.91528481  0.75202867 -0.46900844 -0.64461330  0.77046953
 [37]  0.18615966  1.43757805 -1.01348469  0.43705775  1.50249332  0.17034911
 [43] -0.82956397 -2.00343901 -0.70892553  1.29313705 -0.91177621  0.68856476
 [49]  0.05215415 -0.25766829  1.18889051 -0.25975703 -0.70346191  0.65894004
 [55] -0.96899034  0.45032779  0.15756694  0.50621706 -0.88599004  0.62932882
 [61]  0.29956093  0.11210977 -2.09750286  0.97419564 -0.41463297 -1.06360884
 [67]  0.53122157 -0.19410805  1.12352835  0.07740225  1.96479016 -0.09832492
 [73] -1.35053380 -0.52366236 -1.52855053 -0.44091322 -1.05849102  1.48027230
 [79] -0.52192627 -0.33218792 -0.16263392 -0.07129991 -0.60386828  0.83553849
 [85]  0.87073361 -0.39635275 -0.66493136  0.12297971  0.69437948 -1.73649131
 [91] -0.90125873  0.93237025  0.93278207 -0.11240088 -0.69917107  0.29555357
 [97]  0.60052593  1.35014194 -0.12289405 -0.32336140
> colRanges(tmp)
         [,1]       [,2]      [,3]     [,4]     [,5]     [,6]       [,7]
[1,] 1.450055 -0.9192775 0.5440964 1.232264 -1.12385 1.215953 -0.7057658
[2,] 1.450055 -0.9192775 0.5440964 1.232264 -1.12385 1.215953 -0.7057658
          [,8]       [,9]      [,10]     [,11]     [,12]     [,13]     [,14]
[1,] -1.855288 -0.7290518 -0.1718511 -1.309438 -2.384992 0.2886397 -1.507615
[2,] -1.855288 -0.7290518 -0.1718511 -1.309438 -2.384992 0.2886397 -1.507615
         [,15]       [,16]     [,17]    [,18]     [,19]      [,20]      [,21]
[1,] -1.029104 -0.08635262 0.7845933 1.219663 -1.027303 -0.3018164 -0.9665267
[2,] -1.029104 -0.08635262 0.7845933 1.219663 -1.027303 -0.3018164 -0.9665267
          [,22]    [,23]    [,24]    [,25]    [,26]      [,27]    [,28]
[1,] -0.9739786 0.390454 1.718788 -1.51086 1.553468 -0.7666075 -0.74832
[2,] -0.9739786 0.390454 1.718788 -1.51086 1.553468 -0.7666075 -0.74832
         [,29]     [,30]     [,31]     [,32]     [,33]      [,34]      [,35]
[1,] -3.196978 0.7976556 -1.107358 0.9152848 0.7520287 -0.4690084 -0.6446133
[2,] -3.196978 0.7976556 -1.107358 0.9152848 0.7520287 -0.4690084 -0.6446133
         [,36]     [,37]    [,38]     [,39]     [,40]    [,41]     [,42]
[1,] 0.7704695 0.1861597 1.437578 -1.013485 0.4370577 1.502493 0.1703491
[2,] 0.7704695 0.1861597 1.437578 -1.013485 0.4370577 1.502493 0.1703491
         [,43]     [,44]      [,45]    [,46]      [,47]     [,48]      [,49]
[1,] -0.829564 -2.003439 -0.7089255 1.293137 -0.9117762 0.6885648 0.05215415
[2,] -0.829564 -2.003439 -0.7089255 1.293137 -0.9117762 0.6885648 0.05215415
          [,50]    [,51]     [,52]      [,53]   [,54]      [,55]     [,56]
[1,] -0.2576683 1.188891 -0.259757 -0.7034619 0.65894 -0.9689903 0.4503278
[2,] -0.2576683 1.188891 -0.259757 -0.7034619 0.65894 -0.9689903 0.4503278
         [,57]     [,58]    [,59]     [,60]     [,61]     [,62]     [,63]
[1,] 0.1575669 0.5062171 -0.88599 0.6293288 0.2995609 0.1121098 -2.097503
[2,] 0.1575669 0.5062171 -0.88599 0.6293288 0.2995609 0.1121098 -2.097503
         [,64]     [,65]     [,66]     [,67]      [,68]    [,69]      [,70]
[1,] 0.9741956 -0.414633 -1.063609 0.5312216 -0.1941081 1.123528 0.07740225
[2,] 0.9741956 -0.414633 -1.063609 0.5312216 -0.1941081 1.123528 0.07740225
       [,71]       [,72]     [,73]      [,74]     [,75]      [,76]     [,77]
[1,] 1.96479 -0.09832492 -1.350534 -0.5236624 -1.528551 -0.4409132 -1.058491
[2,] 1.96479 -0.09832492 -1.350534 -0.5236624 -1.528551 -0.4409132 -1.058491
        [,78]      [,79]      [,80]      [,81]       [,82]      [,83]     [,84]
[1,] 1.480272 -0.5219263 -0.3321879 -0.1626339 -0.07129991 -0.6038683 0.8355385
[2,] 1.480272 -0.5219263 -0.3321879 -0.1626339 -0.07129991 -0.6038683 0.8355385
         [,85]      [,86]      [,87]     [,88]     [,89]     [,90]      [,91]
[1,] 0.8707336 -0.3963527 -0.6649314 0.1229797 0.6943795 -1.736491 -0.9012587
[2,] 0.8707336 -0.3963527 -0.6649314 0.1229797 0.6943795 -1.736491 -0.9012587
         [,92]     [,93]      [,94]      [,95]     [,96]     [,97]    [,98]
[1,] 0.9323702 0.9327821 -0.1124009 -0.6991711 0.2955536 0.6005259 1.350142
[2,] 0.9323702 0.9327821 -0.1124009 -0.6991711 0.2955536 0.6005259 1.350142
         [,99]     [,100]
[1,] -0.122894 -0.3233614
[2,] -0.122894 -0.3233614
> 
> 
> Max(tmp2)
[1] 2.072251
> Min(tmp2)
[1] -2.741714
> mean(tmp2)
[1] 0.07718342
> Sum(tmp2)
[1] 7.718342
> Var(tmp2)
[1] 0.9507778
> 
> rowMeans(tmp2)
  [1]  0.667799399  0.597774054 -0.251628226  0.491699212 -0.587029391
  [6]  0.807812394 -0.138451929 -0.707675938 -0.108120553  0.852350410
 [11] -0.518699823  1.477521742  0.220738511 -0.597895495 -1.839716491
 [16]  1.699678646  0.486370793  0.035479957 -0.813619507  0.265315476
 [21]  1.047633029  1.206310438 -0.107498626 -0.774137592  2.072251370
 [26]  0.579448155  1.290205019 -1.948213480  0.040024435 -0.664447740
 [31] -0.960382283  0.852182964  1.149271999 -0.204198030 -0.187628223
 [36] -0.093135929  0.367215182 -0.198838893  0.172559006  0.051286806
 [41]  0.910184523  0.295488065 -1.078205196 -0.472045400 -1.217157467
 [46] -1.786074492  0.303793030  0.061012124  1.091985059  0.925294559
 [51]  0.236950751  0.522454508  0.116031030  0.192263595  0.057650466
 [56] -2.741713702 -0.114886186 -1.265400998  0.517340705  0.302708716
 [61]  1.877833950 -0.460474222  1.170316106 -0.101904829 -0.174890380
 [66] -0.987697148 -1.070168781  0.833637577  1.139527333  0.195510330
 [71] -1.815976826 -2.367375098 -0.715430750  0.806814967 -0.898954599
 [76] -0.808097479  1.038474461  0.790320008  1.427323192 -0.087854082
 [81] -0.003650934 -0.879575305 -0.337233076  1.031971928  0.752172542
 [86]  0.511139483  0.638919786 -0.065584530  1.281029017  1.476892259
 [91]  0.847222117  0.200656020  1.937939101 -0.404414830 -0.085021072
 [96] -0.861084570 -1.457498228  0.404272920 -1.547727279  1.899698279
> rowSums(tmp2)
  [1]  0.667799399  0.597774054 -0.251628226  0.491699212 -0.587029391
  [6]  0.807812394 -0.138451929 -0.707675938 -0.108120553  0.852350410
 [11] -0.518699823  1.477521742  0.220738511 -0.597895495 -1.839716491
 [16]  1.699678646  0.486370793  0.035479957 -0.813619507  0.265315476
 [21]  1.047633029  1.206310438 -0.107498626 -0.774137592  2.072251370
 [26]  0.579448155  1.290205019 -1.948213480  0.040024435 -0.664447740
 [31] -0.960382283  0.852182964  1.149271999 -0.204198030 -0.187628223
 [36] -0.093135929  0.367215182 -0.198838893  0.172559006  0.051286806
 [41]  0.910184523  0.295488065 -1.078205196 -0.472045400 -1.217157467
 [46] -1.786074492  0.303793030  0.061012124  1.091985059  0.925294559
 [51]  0.236950751  0.522454508  0.116031030  0.192263595  0.057650466
 [56] -2.741713702 -0.114886186 -1.265400998  0.517340705  0.302708716
 [61]  1.877833950 -0.460474222  1.170316106 -0.101904829 -0.174890380
 [66] -0.987697148 -1.070168781  0.833637577  1.139527333  0.195510330
 [71] -1.815976826 -2.367375098 -0.715430750  0.806814967 -0.898954599
 [76] -0.808097479  1.038474461  0.790320008  1.427323192 -0.087854082
 [81] -0.003650934 -0.879575305 -0.337233076  1.031971928  0.752172542
 [86]  0.511139483  0.638919786 -0.065584530  1.281029017  1.476892259
 [91]  0.847222117  0.200656020  1.937939101 -0.404414830 -0.085021072
 [96] -0.861084570 -1.457498228  0.404272920 -1.547727279  1.899698279
> 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.667799399  0.597774054 -0.251628226  0.491699212 -0.587029391
  [6]  0.807812394 -0.138451929 -0.707675938 -0.108120553  0.852350410
 [11] -0.518699823  1.477521742  0.220738511 -0.597895495 -1.839716491
 [16]  1.699678646  0.486370793  0.035479957 -0.813619507  0.265315476
 [21]  1.047633029  1.206310438 -0.107498626 -0.774137592  2.072251370
 [26]  0.579448155  1.290205019 -1.948213480  0.040024435 -0.664447740
 [31] -0.960382283  0.852182964  1.149271999 -0.204198030 -0.187628223
 [36] -0.093135929  0.367215182 -0.198838893  0.172559006  0.051286806
 [41]  0.910184523  0.295488065 -1.078205196 -0.472045400 -1.217157467
 [46] -1.786074492  0.303793030  0.061012124  1.091985059  0.925294559
 [51]  0.236950751  0.522454508  0.116031030  0.192263595  0.057650466
 [56] -2.741713702 -0.114886186 -1.265400998  0.517340705  0.302708716
 [61]  1.877833950 -0.460474222  1.170316106 -0.101904829 -0.174890380
 [66] -0.987697148 -1.070168781  0.833637577  1.139527333  0.195510330
 [71] -1.815976826 -2.367375098 -0.715430750  0.806814967 -0.898954599
 [76] -0.808097479  1.038474461  0.790320008  1.427323192 -0.087854082
 [81] -0.003650934 -0.879575305 -0.337233076  1.031971928  0.752172542
 [86]  0.511139483  0.638919786 -0.065584530  1.281029017  1.476892259
 [91]  0.847222117  0.200656020  1.937939101 -0.404414830 -0.085021072
 [96] -0.861084570 -1.457498228  0.404272920 -1.547727279  1.899698279
> rowMin(tmp2)
  [1]  0.667799399  0.597774054 -0.251628226  0.491699212 -0.587029391
  [6]  0.807812394 -0.138451929 -0.707675938 -0.108120553  0.852350410
 [11] -0.518699823  1.477521742  0.220738511 -0.597895495 -1.839716491
 [16]  1.699678646  0.486370793  0.035479957 -0.813619507  0.265315476
 [21]  1.047633029  1.206310438 -0.107498626 -0.774137592  2.072251370
 [26]  0.579448155  1.290205019 -1.948213480  0.040024435 -0.664447740
 [31] -0.960382283  0.852182964  1.149271999 -0.204198030 -0.187628223
 [36] -0.093135929  0.367215182 -0.198838893  0.172559006  0.051286806
 [41]  0.910184523  0.295488065 -1.078205196 -0.472045400 -1.217157467
 [46] -1.786074492  0.303793030  0.061012124  1.091985059  0.925294559
 [51]  0.236950751  0.522454508  0.116031030  0.192263595  0.057650466
 [56] -2.741713702 -0.114886186 -1.265400998  0.517340705  0.302708716
 [61]  1.877833950 -0.460474222  1.170316106 -0.101904829 -0.174890380
 [66] -0.987697148 -1.070168781  0.833637577  1.139527333  0.195510330
 [71] -1.815976826 -2.367375098 -0.715430750  0.806814967 -0.898954599
 [76] -0.808097479  1.038474461  0.790320008  1.427323192 -0.087854082
 [81] -0.003650934 -0.879575305 -0.337233076  1.031971928  0.752172542
 [86]  0.511139483  0.638919786 -0.065584530  1.281029017  1.476892259
 [91]  0.847222117  0.200656020  1.937939101 -0.404414830 -0.085021072
 [96] -0.861084570 -1.457498228  0.404272920 -1.547727279  1.899698279
> 
> colMeans(tmp2)
[1] 0.07718342
> colSums(tmp2)
[1] 7.718342
> colVars(tmp2)
[1] 0.9507778
> colSd(tmp2)
[1] 0.9750784
> colMax(tmp2)
[1] 2.072251
> colMin(tmp2)
[1] -2.741714
> colMedians(tmp2)
[1] 0.08852158
> colRanges(tmp2)
          [,1]
[1,] -2.741714
[2,]  2.072251
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.6838456  0.9396486 -0.9998865  2.5970892  1.3334478  2.6587151
 [7] -0.9905247 -2.1593628 -0.9137275  5.6327665
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7431164
[2,] -0.3309692
[3,]  0.3874478
[4,]  0.7686816
[5,]  1.2383334
> 
> rowApply(tmp,sum)
 [1] -1.4693029  4.1056822  0.3230407 -1.4494808 -7.2403612  1.5669033
 [7] -2.5149693  3.9629864  6.9455815  5.5519314
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    1    7    4    9    8    1    7    5     8
 [2,]    2    6    8    6    6    3    8    4    6     9
 [3,]    8    3    4    7    8    7    2    1    7     1
 [4,]    5    5    3    8    4    2    9   10    8     2
 [5,]    4    8    5   10   10    6    3    3    3     3
 [6,]    3   10    1    2    5    1    7    9    9    10
 [7,]   10    4    6    1    2    9    5    8    1     4
 [8,]    1    2    2    3    3    5   10    2   10     5
 [9,]    9    7    9    5    1    4    6    5    4     7
[10,]    6    9   10    9    7   10    4    6    2     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.25002924  1.46104294 -2.95506626 -0.53091211 -2.12456756 -0.79532114
 [7]  4.01534984  1.74634288 -0.13171956 -0.11891948 -2.17130836 -1.24629552
[13] -1.62600006 -0.11387821 -0.90800604 -1.58332649 -2.62676369  2.37509661
[19]  2.48743883 -0.04614601
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5104103
[2,] -1.0154007
[3,] -0.4058972
[4,] -0.1874993
[5,] -0.1308218
> 
> rowApply(tmp,sum)
[1]  6.1589075 -3.2620356 -6.8203285 -4.9496142  0.7300821
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    9   13    3    8
[2,]   12   14   11   19    6
[3,]    4    4   20    1    7
[4,]   13   10    8   18    2
[5,]    5   20    4    2   12
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.0154007  0.3717304 -0.7563788  0.3788616 -0.3747230  0.9765721
[2,] -0.4058972  0.4644569 -0.9859378 -0.1815462  1.1861301  0.5795915
[3,] -0.1874993 -0.3256701  1.1915471 -0.3958690 -1.3069767 -0.6489438
[4,] -1.5104103  1.2895461 -2.1941317  0.8119567 -1.7875638 -0.4244238
[5,] -0.1308218 -0.3390204 -0.2101650 -1.1443152  0.1585659 -1.2781171
          [,7]        [,8]         [,9]       [,10]      [,11]       [,12]
[1,] 0.3264474 -0.10070330  0.002006268  0.51821858 -0.3395243 -0.79603438
[2,] 0.3523220  0.91365850  0.448696182 -0.52207442 -2.0405077  0.06317714
[3,] 0.9629796  0.38335729 -0.062854974  0.35553400 -0.3632724 -0.38659291
[4,] 1.4002035  0.62860108 -1.241726184 -0.45087314  0.0378412  0.80069351
[5,] 0.9733974 -0.07857069  0.722159145 -0.01972449  0.5341549 -0.92753889
          [,13]      [,14]      [,15]       [,16]        [,17]      [,18]
[1,]  1.3686302  1.0665692  0.2835235 -0.96849660 -0.023844100  2.2391076
[2,] -1.1114967  0.6787206  0.7776565  0.53713091 -1.935994583 -0.7506252
[3,] -0.4134038 -0.1967202 -1.8205129 -1.43813633  0.009354603 -0.8093216
[4,] -0.5925094 -0.7546975 -0.6486502 -0.01334375 -0.692459932  0.1994134
[5,] -0.8772203 -0.9077502  0.4999771  0.29951928  0.016180326  1.4965224
          [,19]      [,20]
[1,]  1.2553898  1.7469560
[2,] -0.5973867 -0.7321093
[3,]  0.3490227 -1.7163498
[4,] -0.2107171  0.4036373
[5,]  1.6911301  0.2517198
> 
> 
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  564  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2     col3      col4      col5      col6       col7
row1 -0.6681619 -1.962752 -1.17346 0.8289952 0.4767978 0.6474136 0.05885912
           col8     col9      col10    col11     col12      col13 col14
row1 -0.7805542 2.242419 -0.2104928 1.530749 0.6295136 -0.9402991 0.607
        col15      col16   col17      col18      col19      col20
row1 0.604006 -0.8294512 1.51483 -0.3754343 -0.8406598 -0.7791491
> tmp[,"col10"]
          col10
row1 -0.2104928
row2 -1.7803492
row3  1.0352142
row4 -1.6697921
row5 -0.2616765
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5       col6
row1 -0.6681619 -1.9627515 -1.1734604  0.8289952  0.4767978  0.6474136
row5 -0.6936230 -0.7170836 -0.4889842 -0.8185879 -1.2879063 -1.4927310
            col7       col8      col9      col10     col11     col12      col13
row1  0.05885912 -0.7805542 2.2424187 -0.2104928 1.5307492 0.6295136 -0.9402991
row5 -0.30186541 -0.9654073 0.4534674 -0.2616765 0.7753874 0.4807692  0.5536791
         col14    col15      col16     col17      col18      col19      col20
row1 0.6070000 0.604006 -0.8294512 1.5148298 -0.3754343 -0.8406598 -0.7791491
row5 0.1101018 0.584041  0.4101213 0.5958405 -0.5348197 -1.1059380  1.0533864
> tmp[,c("col6","col20")]
           col6       col20
row1  0.6474136 -0.77914907
row2 -0.1677066 -1.30272678
row3  0.8165026  1.78734784
row4  1.2492880 -0.04468671
row5 -1.4927310  1.05338636
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.6474136 -0.7791491
row5 -1.4927310  1.0533864
> 
> 
> 
> 
> 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.85747 50.70465 51.61174 50.87914 51.08433 104.3329 52.63473 47.65275
         col9    col10    col11    col12    col13    col14   col15    col16
row1 49.76558 49.64028 49.00558 47.89334 50.25851 48.51913 50.0881 49.87979
        col17    col18    col19    col20
row1 50.19818 50.01513 50.15119 103.3426
> tmp[,"col10"]
        col10
row1 49.64028
row2 29.63101
row3 30.01465
row4 31.78798
row5 49.79867
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.85747 50.70465 51.61174 50.87914 51.08433 104.3329 52.63473 47.65275
row5 49.71843 49.65924 50.03085 49.72049 50.12140 106.9212 49.34527 50.72163
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.76558 49.64028 49.00558 47.89334 50.25851 48.51913 50.08810 49.87979
row5 50.29784 49.79867 49.93714 49.65544 50.41664 51.03260 50.54465 49.82203
        col17    col18    col19    col20
row1 50.19818 50.01513 50.15119 103.3426
row5 51.39376 50.78076 48.18495 104.2850
> tmp[,c("col6","col20")]
          col6     col20
row1 104.33291 103.34263
row2  73.72834  74.70507
row3  74.81002  73.60445
row4  72.80975  76.71807
row5 106.92115 104.28504
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.3329 103.3426
row5 106.9212 104.2850
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.3329 103.3426
row5 106.9212 104.2850
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.9868945
[2,] -0.3754572
[3,]  2.4004331
[4,] -0.9396909
[5,] -0.1313829
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.2277400 -0.4556394
[2,] -0.7122239  0.2261368
[3,] -0.1208145  1.2878175
[4,] -0.8934299 -0.0356839
[5,]  2.4257056 -0.1439599
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.1927022 -1.1555903
[2,] -0.3108186 -0.8011672
[3,] -1.2031718  0.8128378
[4,] -0.3812943 -0.2334931
[5,]  0.5671989  2.5708012
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.1927022
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.1927022
[2,] -0.3108186
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
row3 -0.2440097  1.167013  0.1924225  1.1166585 -0.2170628  0.6922100 0.5390077
row1  0.2634636 -1.572593 -0.9397214 -0.6093975 -0.2024835 -0.7279255 0.9294834
          [,8]       [,9]     [,10]     [,11]      [,12]      [,13]      [,14]
row3 -1.602692 -0.7421107 1.4260204 0.1121635  0.3228817 -0.4093543 -0.9273632
row1 -1.254318  1.7429808 0.6490989 0.1350815 -0.5998656  1.5917849 -0.8032765
         [,15]     [,16]      [,17]    [,18]     [,19]       [,20]
row3 0.6163656 -2.056493 -0.5769534 2.201686 0.5088278 -0.03962215
row1 1.8970772 -1.114608 -0.4446216 1.820650 0.1987445 -0.09055161
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]      [,4]     [,5]       [,6]      [,7]
row2 -0.2039735 0.6886759 -1.163015 0.5158104 1.214661 -0.1116665 -1.019759
          [,8]       [,9]     [,10]
row2 -1.255661 -0.5886739 0.2792637
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]     [,2]       [,3]       [,4]      [,5]        [,6]       [,7]
row5 0.180738 1.880532 -0.2667233 -0.1772898 -1.213988 -0.08742777 -0.7364433
          [,8]       [,9]      [,10]     [,11]     [,12]      [,13]     [,14]
row5 0.8283139 -0.5666673 -0.3685804 -0.942211 0.8829703 -0.5052418 -0.657079
         [,15]     [,16]     [,17]     [,18]      [,19]    [,20]
row5 0.4011609 0.6879667 -1.486822 0.1402454 -0.2071722 0.330189
> 
> 
> 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: 0x595c3b4fb220>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede1c8e6d18"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede74b46f"  
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede5e298ba7"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede6de7b123"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede54b12a15"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede2ef5738d"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede29a4141d"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede53c2276a"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede6c01722e"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede33ddf3f2"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede3b569189"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede35ecfadf"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede3ece0767"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede61e91658"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c7ede1ccbb4d" 
> 
> 
> ### 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: 0x595c3b880000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x595c3b880000>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x595c3b880000>
> rowMedians(tmp)
  [1] -0.076320709 -0.608349134  0.059165910 -0.384616476  0.122651020
  [6]  0.394166692 -0.035447748  0.159786793 -0.220976761 -0.065842933
 [11] -0.440833684  0.389666873  0.298849414 -0.053924594  0.007864853
 [16] -0.220488329  0.081816299 -0.778001658 -0.384193821  0.071744976
 [21] -0.177966562  0.512587183 -0.085476434  0.299682384 -0.062015767
 [26]  0.127843268  0.420686966  0.430716544 -0.609690298  0.330188490
 [31]  0.315275798 -0.388313150  0.236311618 -0.074944566 -0.359036943
 [36] -0.499413962 -0.260720184 -0.085643336 -0.195277052 -0.170747264
 [41] -0.193632194 -0.062668854 -0.269652830  0.137189449 -0.345797385
 [46]  0.739499690 -0.070138485 -0.005936025  0.344628191  0.330527623
 [51] -0.044532663 -0.494413927  0.746175558  0.245442940  0.091046933
 [56] -0.362169035 -0.400648617 -0.152300311  0.025177182  0.157835036
 [61]  0.047340309  0.352871700 -0.149244412  0.183052885 -0.351333487
 [66] -0.510291984 -0.097989867  0.614756634 -0.270086542  0.230367440
 [71] -0.257387055 -0.078383483 -0.215273338 -0.031974830 -0.437073683
 [76]  0.222734138 -0.040162424 -0.020620618  0.185129264 -0.487978491
 [81]  0.382960291 -0.007659244  0.307276922  0.259078747  0.116591610
 [86]  0.112670411 -0.261863655  0.218809339  0.140395477  0.087995208
 [91]  0.566927732  0.352880458  0.177975985  0.050460626 -0.033707660
 [96]  0.069439531 -0.282430295  0.277665054  0.607701013  0.366777413
[101]  0.201403658 -0.404001657 -0.531202878  0.551951684 -0.326783177
[106] -0.247992363  0.138913609  0.002230599  0.119486184 -0.378016145
[111] -0.096385287  0.122916228  0.137959013 -0.224750350  0.067716960
[116]  0.343713603  0.650118049 -0.027903294 -0.171035806 -0.156643155
[121] -0.023515057 -0.434693728  0.763520717 -0.848732120  0.469818948
[126]  0.187811285 -0.117483715  0.021173961  0.083557881 -0.154776518
[131] -0.004576451  0.424924715  0.115564302  0.225994264 -0.023625498
[136]  0.044975369  0.154871258  0.018926510 -0.622075988  0.062999213
[141]  0.248157527  0.146022724  0.545772999  0.038906366 -0.399730080
[146] -0.014496741 -0.105390861 -0.299722521 -0.137881022 -0.089169338
[151]  0.158756472  0.204609037  0.068092384 -0.089829964  0.104928864
[156]  0.099034426 -0.082438045  0.067056021  0.122025595  0.255353698
[161]  0.196674270 -0.080765445  0.225186989 -0.022747847 -0.124016859
[166] -0.183556082 -0.577396084  0.208261004 -0.245797316  0.532411281
[171]  0.433006678  0.191862142  0.242276196 -0.027783295  0.122669872
[176]  0.231489967 -0.295142051  0.289619440  0.102032633  0.089222754
[181]  0.030644631 -0.214497862  0.235321543  0.453615024  0.224421875
[186] -0.262876993 -0.396529439 -0.010718149  0.193012531  0.089797879
[191] -0.306547660  0.359076753  0.287891643  0.217887954 -0.066852801
[196]  0.455139948 -0.063416671 -0.237036212 -0.012030877  0.043063364
[201]  0.522955698 -0.167372468 -0.067335645 -0.354780751 -0.355243271
[206] -0.166034658 -0.306242996 -0.370270644  0.169370963  0.186384408
[211] -0.482928472 -0.446525706 -0.212810411  0.559246465 -0.085684236
[216] -0.032021566  0.388732748 -0.119431891  0.213912212 -0.054536970
[221]  0.193183200 -0.529373165  0.252472446 -0.232662595 -0.057184545
[226] -0.482565955  0.879816491 -0.127827113 -0.011993475  0.161614087
> 
> proc.time()
   user  system elapsed 
  1.211   0.668   1.865 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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: 0x57846ca97370>
> .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: 0x57846ca97370>
> .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: 0x57846ca97370>
> .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: 0x57846ca97370>
> 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: 0x57846ca7f1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57846ca7f1c0>
> .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: 0x57846ca7f1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57846ca7f1c0>
> .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: 0x57846ca7f1c0>
> 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: 0x57846cd62120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57846cd62120>
> .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: 0x57846cd62120>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x57846cd62120>
> .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: 0x57846cd62120>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x57846cd62120>
> .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: 0x57846cd62120>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x57846cd62120>
> .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: 0x57846cd62120>
> 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: 0x57846bab2390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x57846bab2390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57846bab2390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57846bab2390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3c7f32283eaac3" "BufferedMatrixFile3c7f327ece5285"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3c7f32283eaac3" "BufferedMatrixFile3c7f327ece5285"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x57846b9a93d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57846b9a93d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x57846b9a93d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x57846b9a93d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x57846b9a93d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x57846b9a93d0>
> .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: 0x57846d4defa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57846d4defa0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x57846d4defa0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x57846d4defa0>
> 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: 0x57846bcb6ff0>
> .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: 0x57846bcb6ff0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.243   0.041   0.275 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.231   0.049   0.268 

Example timings