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

This page was generated on 2025-11-11 12:02 -0500 (Tue, 11 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4902
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4638
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: 2025-11-10 13:45 -0500 (Mon, 10 Nov 2025)
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
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    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: 2025-11-10 21:51:43 -0500 (Mon, 10 Nov 2025)
EndedAt: 2025-11-10 21:52:07 -0500 (Mon, 10 Nov 2025)
EllapsedTime: 24.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.1 Patched (2025-08-23 r88802)
* 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.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.233   0.047   0.271 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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 478419 25.6    1047111   56   639600 34.2
Vcells 885237  6.8    8388608   64  2081604 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Nov 10 21:51:58 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Nov 10 21:51:58 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5f123623eb10>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Nov 10 21:51:59 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Nov 10 21:51:59 2025"
> 
> ColMode(tmp2)
<pointer: 0x5f123623eb10>
> 
> 
> 
> ### 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,] 98.0959293 -0.6199386 -0.4718065 -0.6450846
[2,]  0.5901250  1.0940565 -1.5511675  1.6357769
[3,]  0.9950508  0.6063482 -1.8635682  1.3111989
[4,]  0.5219471  0.3280268 -0.8484518  0.6408452
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 98.0959293 0.6199386 0.4718065 0.6450846
[2,]  0.5901250 1.0940565 1.5511675 1.6357769
[3,]  0.9950508 0.6063482 1.8635682 1.3111989
[4,]  0.5219471 0.3280268 0.8484518 0.6408452
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9043389 0.7873618 0.6868818 0.8031716
[2,] 0.7681959 1.0459716 1.2454587 1.2789749
[3,] 0.9975223 0.7786837 1.3651257 1.1450759
[4,] 0.7224590 0.5727363 0.9211144 0.8005281
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 222.13932 33.49356 32.34062 33.67680
[2,]  33.27208 36.55377 39.00575 39.42553
[3,]  35.97027 33.39318 40.51483 37.76196
[4,]  32.74654 31.05539 35.05960 33.64613
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5f12350117c0>
> exp(tmp5)
<pointer: 0x5f12350117c0>
> log(tmp5,2)
<pointer: 0x5f12350117c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 462.3539
> Min(tmp5)
[1] 53.4056
> mean(tmp5)
[1] 72.65399
> Sum(tmp5)
[1] 14530.8
> Var(tmp5)
[1] 830.4122
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.17285 74.05704 74.36742 70.64898 69.41296 67.59313 69.86380 71.06255
 [9] 67.36658 70.99453
> rowSums(tmp5)
 [1] 1823.457 1481.141 1487.348 1412.980 1388.259 1351.863 1397.276 1421.251
 [9] 1347.332 1419.891
> rowVars(tmp5)
 [1] 7696.56955   55.50040   53.88793   52.70057   75.56790   51.59433
 [7]   72.32337   60.67784   41.70492   85.35083
> rowSd(tmp5)
 [1] 87.730095  7.449859  7.340840  7.259516  8.692980  7.182920  8.504315
 [8]  7.789598  6.457935  9.238551
> rowMax(tmp5)
 [1] 462.35389  84.00702  87.78787  94.90732  90.72204  80.03684  83.65318
 [8]  91.74274  80.37407  93.24096
> rowMin(tmp5)
 [1] 57.67840 60.44249 56.55092 62.24514 57.13371 53.40560 54.25652 61.13961
 [9] 55.63916 57.91214
> 
> colMeans(tmp5)
 [1] 108.42737  67.97532  70.98172  71.60352  77.58346  72.87328  68.13503
 [8]  70.05924  69.10838  70.20665  71.95843  72.08480  67.03194  69.71749
[15]  69.80645  68.51611  69.92384  70.20817  74.63507  72.24344
> colSums(tmp5)
 [1] 1084.2737  679.7532  709.8172  716.0352  775.8346  728.7328  681.3503
 [8]  700.5924  691.0838  702.0665  719.5843  720.8480  670.3194  697.1749
[15]  698.0645  685.1611  699.2384  702.0817  746.3507  722.4344
> colVars(tmp5)
 [1] 15476.10609    31.35087    65.01745   114.54734    64.69593   129.48914
 [7]    41.11328    74.24026    55.01659    54.40096    45.41596    36.36967
[13]    85.81180    82.62351    39.35140    42.18368    47.85344    67.21317
[19]    91.72160    95.27523
> colSd(tmp5)
 [1] 124.402999   5.599184   8.063340  10.702679   8.043378  11.379330
 [7]   6.411964   8.616279   7.417317   7.375700   6.739136   6.030727
[13]   9.263466   9.089748   6.273070   6.494896   6.917618   8.198364
[19]   9.577140   9.760903
> colMax(tmp5)
 [1] 462.35389  76.08189  84.32630  93.24096  89.28346  89.78476  80.52645
 [8]  84.00702  83.40491  80.02170  83.65318  80.72169  80.64376  90.72204
[15]  83.07957  75.31224  83.58241  83.48022  94.90732  91.74274
> colMin(tmp5)
 [1] 61.87856 56.08215 61.07744 60.59524 66.09992 56.13594 59.78128 57.91214
 [9] 59.82982 59.39948 62.62181 62.26296 53.40560 59.16485 62.86646 57.67840
[17] 62.18380 54.25652 61.84500 55.63916
> 
> 
> ### 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.17285 74.05704       NA 70.64898 69.41296 67.59313 69.86380 71.06255
 [9] 67.36658 70.99453
> rowSums(tmp5)
 [1] 1823.457 1481.141       NA 1412.980 1388.259 1351.863 1397.276 1421.251
 [9] 1347.332 1419.891
> rowVars(tmp5)
 [1] 7696.56955   55.50040   56.85028   52.70057   75.56790   51.59433
 [7]   72.32337   60.67784   41.70492   85.35083
> rowSd(tmp5)
 [1] 87.730095  7.449859  7.539913  7.259516  8.692980  7.182920  8.504315
 [8]  7.789598  6.457935  9.238551
> rowMax(tmp5)
 [1] 462.35389  84.00702        NA  94.90732  90.72204  80.03684  83.65318
 [8]  91.74274  80.37407  93.24096
> rowMin(tmp5)
 [1] 57.67840 60.44249       NA 62.24514 57.13371 53.40560 54.25652 61.13961
 [9] 55.63916 57.91214
> 
> colMeans(tmp5)
 [1] 108.42737  67.97532  70.98172  71.60352  77.58346  72.87328  68.13503
 [8]  70.05924  69.10838  70.20665  71.95843  72.08480  67.03194  69.71749
[15]  69.80645  68.51611  69.92384  70.20817  74.63507        NA
> colSums(tmp5)
 [1] 1084.2737  679.7532  709.8172  716.0352  775.8346  728.7328  681.3503
 [8]  700.5924  691.0838  702.0665  719.5843  720.8480  670.3194  697.1749
[15]  698.0645  685.1611  699.2384  702.0817  746.3507        NA
> colVars(tmp5)
 [1] 15476.10609    31.35087    65.01745   114.54734    64.69593   129.48914
 [7]    41.11328    74.24026    55.01659    54.40096    45.41596    36.36967
[13]    85.81180    82.62351    39.35140    42.18368    47.85344    67.21317
[19]    91.72160          NA
> colSd(tmp5)
 [1] 124.402999   5.599184   8.063340  10.702679   8.043378  11.379330
 [7]   6.411964   8.616279   7.417317   7.375700   6.739136   6.030727
[13]   9.263466   9.089748   6.273070   6.494896   6.917618   8.198364
[19]   9.577140         NA
> colMax(tmp5)
 [1] 462.35389  76.08189  84.32630  93.24096  89.28346  89.78476  80.52645
 [8]  84.00702  83.40491  80.02170  83.65318  80.72169  80.64376  90.72204
[15]  83.07957  75.31224  83.58241  83.48022  94.90732        NA
> colMin(tmp5)
 [1] 61.87856 56.08215 61.07744 60.59524 66.09992 56.13594 59.78128 57.91214
 [9] 59.82982 59.39948 62.62181 62.26296 53.40560 59.16485 62.86646 57.67840
[17] 62.18380 54.25652 61.84500       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 462.3539
> Min(tmp5,na.rm=TRUE)
[1] 53.4056
> mean(tmp5,na.rm=TRUE)
[1] 72.64169
> Sum(tmp5,na.rm=TRUE)
[1] 14455.7
> Var(tmp5,na.rm=TRUE)
[1] 834.5758
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.17285 74.05704 74.32884 70.64898 69.41296 67.59313 69.86380 71.06255
 [9] 67.36658 70.99453
> rowSums(tmp5,na.rm=TRUE)
 [1] 1823.457 1481.141 1412.248 1412.980 1388.259 1351.863 1397.276 1421.251
 [9] 1347.332 1419.891
> rowVars(tmp5,na.rm=TRUE)
 [1] 7696.56955   55.50040   56.85028   52.70057   75.56790   51.59433
 [7]   72.32337   60.67784   41.70492   85.35083
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.730095  7.449859  7.539913  7.259516  8.692980  7.182920  8.504315
 [8]  7.789598  6.457935  9.238551
> rowMax(tmp5,na.rm=TRUE)
 [1] 462.35389  84.00702  87.78787  94.90732  90.72204  80.03684  83.65318
 [8]  91.74274  80.37407  93.24096
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.67840 60.44249 56.55092 62.24514 57.13371 53.40560 54.25652 61.13961
 [9] 55.63916 57.91214
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.42737  67.97532  70.98172  71.60352  77.58346  72.87328  68.13503
 [8]  70.05924  69.10838  70.20665  71.95843  72.08480  67.03194  69.71749
[15]  69.80645  68.51611  69.92384  70.20817  74.63507  71.92599
> colSums(tmp5,na.rm=TRUE)
 [1] 1084.2737  679.7532  709.8172  716.0352  775.8346  728.7328  681.3503
 [8]  700.5924  691.0838  702.0665  719.5843  720.8480  670.3194  697.1749
[15]  698.0645  685.1611  699.2384  702.0817  746.3507  647.3339
> colVars(tmp5,na.rm=TRUE)
 [1] 15476.10609    31.35087    65.01745   114.54734    64.69593   129.48914
 [7]    41.11328    74.24026    55.01659    54.40096    45.41596    36.36967
[13]    85.81180    82.62351    39.35140    42.18368    47.85344    67.21317
[19]    91.72160   106.05094
> colSd(tmp5,na.rm=TRUE)
 [1] 124.402999   5.599184   8.063340  10.702679   8.043378  11.379330
 [7]   6.411964   8.616279   7.417317   7.375700   6.739136   6.030727
[13]   9.263466   9.089748   6.273070   6.494896   6.917618   8.198364
[19]   9.577140  10.298104
> colMax(tmp5,na.rm=TRUE)
 [1] 462.35389  76.08189  84.32630  93.24096  89.28346  89.78476  80.52645
 [8]  84.00702  83.40491  80.02170  83.65318  80.72169  80.64376  90.72204
[15]  83.07957  75.31224  83.58241  83.48022  94.90732  91.74274
> colMin(tmp5,na.rm=TRUE)
 [1] 61.87856 56.08215 61.07744 60.59524 66.09992 56.13594 59.78128 57.91214
 [9] 59.82982 59.39948 62.62181 62.26296 53.40560 59.16485 62.86646 57.67840
[17] 62.18380 54.25652 61.84500 55.63916
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.17285 74.05704      NaN 70.64898 69.41296 67.59313 69.86380 71.06255
 [9] 67.36658 70.99453
> rowSums(tmp5,na.rm=TRUE)
 [1] 1823.457 1481.141    0.000 1412.980 1388.259 1351.863 1397.276 1421.251
 [9] 1347.332 1419.891
> rowVars(tmp5,na.rm=TRUE)
 [1] 7696.56955   55.50040         NA   52.70057   75.56790   51.59433
 [7]   72.32337   60.67784   41.70492   85.35083
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.730095  7.449859        NA  7.259516  8.692980  7.182920  8.504315
 [8]  7.789598  6.457935  9.238551
> rowMax(tmp5,na.rm=TRUE)
 [1] 462.35389  84.00702        NA  94.90732  90.72204  80.03684  83.65318
 [8]  91.74274  80.37407  93.24096
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.67840 60.44249       NA 62.24514 57.13371 53.40560 54.25652 61.13961
 [9] 55.63916 57.91214
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.15625  67.80551  69.49899  70.82652  76.44964  71.31087  68.23667
 [8]  69.19934  68.87746  69.43847  71.86818  71.38781  68.19650  68.78615
[15]  69.72418  68.61099  70.15891  69.77563  75.03800       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1009.4063  610.2496  625.4909  637.4386  688.0467  641.7979  614.1300
 [8]  622.7941  619.8971  624.9462  646.8137  642.4903  613.7685  619.0753
[15]  627.5177  617.4989  631.4302  627.9807  675.3420    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 17254.19287    34.94535    48.41161   122.07372    58.32043   118.21272
 [7]    46.13621    75.20187    61.29375    54.56239    51.00134    35.45063
[13]    81.28108    83.19318    44.19420    47.35536    53.21345    73.51007
[19]   101.36042          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 131.355216   5.911460   6.957845  11.048698   7.636781  10.872567
 [7]   6.792364   8.671901   7.829033   7.386636   7.141522   5.954043
[13]   9.015602   9.121029   6.647872   6.881523   7.294755   8.573801
[19]  10.067791         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 462.35389  76.08189  81.18537  93.24096  89.28346  89.78476  80.52645
 [8]  84.00702  83.40491  80.02170  83.65318  80.72169  80.64376  90.72204
[15]  83.07957  75.31224  83.58241  83.48022  94.90732      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 61.87856 56.08215 61.07744 60.59524 66.09992 56.13594 59.78128 57.91214
 [9] 59.82982 59.39948 62.62181 62.26296 53.40560 59.16485 62.86646 57.67840
[17] 62.18380 54.25652 61.84500      Inf
> 
> 
> 
> 
> 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] 158.6600 256.8429 230.2013 134.2679 210.5844 205.3260 150.3841 362.2052
 [9] 155.3500 295.5356
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 158.6600 256.8429 230.2013 134.2679 210.5844 205.3260 150.3841 362.2052
 [9] 155.3500 295.5356
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.705303e-13 -2.842171e-13 -1.421085e-14 -5.684342e-14  5.684342e-14
 [6]  1.847411e-13 -2.842171e-14  1.705303e-13  5.684342e-14  1.136868e-13
[11]  1.989520e-13  5.684342e-14  2.557954e-13  1.421085e-14  1.705303e-13
[16] -2.842171e-14  0.000000e+00  4.263256e-14  5.684342e-14  1.136868e-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 
7   12 
3   10 
10   5 
5   11 
5   11 
2   6 
5   3 
2   15 
9   6 
1   11 
2   19 
3   11 
2   18 
5   1 
1   10 
3   5 
3   13 
1   14 
1   3 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.522164
> Min(tmp)
[1] -2.422548
> mean(tmp)
[1] 0.1110618
> Sum(tmp)
[1] 11.10618
> Var(tmp)
[1] 0.9264626
> 
> rowMeans(tmp)
[1] 0.1110618
> rowSums(tmp)
[1] 11.10618
> rowVars(tmp)
[1] 0.9264626
> rowSd(tmp)
[1] 0.9625293
> rowMax(tmp)
[1] 2.522164
> rowMin(tmp)
[1] -2.422548
> 
> colMeans(tmp)
  [1]  0.210839772 -0.672671262  0.859277485  0.788648003  0.154110164
  [6]  0.721931465 -0.068007657  0.808167790 -2.422548405 -0.383769626
 [11]  0.415171848 -0.634350658  1.841378790  0.503373422  0.013805916
 [16] -0.466435515 -0.206200524  0.283633259  0.117419131  1.875525079
 [21]  1.479671422 -1.349627070  0.215575818  1.645349269  0.902476400
 [26] -1.155361441  0.356480495  1.074357749  1.459783543  2.459156115
 [31] -0.466511862  0.789908776 -1.503606925 -0.162615684 -0.361197332
 [36]  0.862327081 -0.734595699  0.500971878 -0.673100714  0.554880540
 [41]  0.890308012  0.308949544 -0.510280116 -0.093369988 -1.162876981
 [46]  0.726502029 -1.699793149  1.340582202  0.736622239 -0.998219107
 [51]  0.372071522 -0.558949160  0.225448417 -0.823284563  1.031290283
 [56] -1.594454540  0.549410453  1.888406153  0.629042118 -0.834976252
 [61] -1.583429841 -0.012751826  2.522164006 -0.807926078  0.145130449
 [66]  1.128620472 -0.437897140  0.345267827  0.114796416  1.541293751
 [71] -0.447521649 -0.155916628 -0.741884498 -0.002493551  0.733791737
 [76]  1.460611840 -1.314409350 -0.737482595  0.040472256 -1.107632680
 [81]  1.264687386  0.664366010 -0.348342245  0.215931974  0.047718229
 [86] -0.037191867  1.626768668  0.013038906 -1.314664183  0.006675326
 [91]  0.095832332 -0.109040274 -0.761557320 -0.513137187 -0.495213527
 [96]  0.310730061 -1.474519435 -0.721869033  0.727150908  1.169963287
> colSums(tmp)
  [1]  0.210839772 -0.672671262  0.859277485  0.788648003  0.154110164
  [6]  0.721931465 -0.068007657  0.808167790 -2.422548405 -0.383769626
 [11]  0.415171848 -0.634350658  1.841378790  0.503373422  0.013805916
 [16] -0.466435515 -0.206200524  0.283633259  0.117419131  1.875525079
 [21]  1.479671422 -1.349627070  0.215575818  1.645349269  0.902476400
 [26] -1.155361441  0.356480495  1.074357749  1.459783543  2.459156115
 [31] -0.466511862  0.789908776 -1.503606925 -0.162615684 -0.361197332
 [36]  0.862327081 -0.734595699  0.500971878 -0.673100714  0.554880540
 [41]  0.890308012  0.308949544 -0.510280116 -0.093369988 -1.162876981
 [46]  0.726502029 -1.699793149  1.340582202  0.736622239 -0.998219107
 [51]  0.372071522 -0.558949160  0.225448417 -0.823284563  1.031290283
 [56] -1.594454540  0.549410453  1.888406153  0.629042118 -0.834976252
 [61] -1.583429841 -0.012751826  2.522164006 -0.807926078  0.145130449
 [66]  1.128620472 -0.437897140  0.345267827  0.114796416  1.541293751
 [71] -0.447521649 -0.155916628 -0.741884498 -0.002493551  0.733791737
 [76]  1.460611840 -1.314409350 -0.737482595  0.040472256 -1.107632680
 [81]  1.264687386  0.664366010 -0.348342245  0.215931974  0.047718229
 [86] -0.037191867  1.626768668  0.013038906 -1.314664183  0.006675326
 [91]  0.095832332 -0.109040274 -0.761557320 -0.513137187 -0.495213527
 [96]  0.310730061 -1.474519435 -0.721869033  0.727150908  1.169963287
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.210839772 -0.672671262  0.859277485  0.788648003  0.154110164
  [6]  0.721931465 -0.068007657  0.808167790 -2.422548405 -0.383769626
 [11]  0.415171848 -0.634350658  1.841378790  0.503373422  0.013805916
 [16] -0.466435515 -0.206200524  0.283633259  0.117419131  1.875525079
 [21]  1.479671422 -1.349627070  0.215575818  1.645349269  0.902476400
 [26] -1.155361441  0.356480495  1.074357749  1.459783543  2.459156115
 [31] -0.466511862  0.789908776 -1.503606925 -0.162615684 -0.361197332
 [36]  0.862327081 -0.734595699  0.500971878 -0.673100714  0.554880540
 [41]  0.890308012  0.308949544 -0.510280116 -0.093369988 -1.162876981
 [46]  0.726502029 -1.699793149  1.340582202  0.736622239 -0.998219107
 [51]  0.372071522 -0.558949160  0.225448417 -0.823284563  1.031290283
 [56] -1.594454540  0.549410453  1.888406153  0.629042118 -0.834976252
 [61] -1.583429841 -0.012751826  2.522164006 -0.807926078  0.145130449
 [66]  1.128620472 -0.437897140  0.345267827  0.114796416  1.541293751
 [71] -0.447521649 -0.155916628 -0.741884498 -0.002493551  0.733791737
 [76]  1.460611840 -1.314409350 -0.737482595  0.040472256 -1.107632680
 [81]  1.264687386  0.664366010 -0.348342245  0.215931974  0.047718229
 [86] -0.037191867  1.626768668  0.013038906 -1.314664183  0.006675326
 [91]  0.095832332 -0.109040274 -0.761557320 -0.513137187 -0.495213527
 [96]  0.310730061 -1.474519435 -0.721869033  0.727150908  1.169963287
> colMin(tmp)
  [1]  0.210839772 -0.672671262  0.859277485  0.788648003  0.154110164
  [6]  0.721931465 -0.068007657  0.808167790 -2.422548405 -0.383769626
 [11]  0.415171848 -0.634350658  1.841378790  0.503373422  0.013805916
 [16] -0.466435515 -0.206200524  0.283633259  0.117419131  1.875525079
 [21]  1.479671422 -1.349627070  0.215575818  1.645349269  0.902476400
 [26] -1.155361441  0.356480495  1.074357749  1.459783543  2.459156115
 [31] -0.466511862  0.789908776 -1.503606925 -0.162615684 -0.361197332
 [36]  0.862327081 -0.734595699  0.500971878 -0.673100714  0.554880540
 [41]  0.890308012  0.308949544 -0.510280116 -0.093369988 -1.162876981
 [46]  0.726502029 -1.699793149  1.340582202  0.736622239 -0.998219107
 [51]  0.372071522 -0.558949160  0.225448417 -0.823284563  1.031290283
 [56] -1.594454540  0.549410453  1.888406153  0.629042118 -0.834976252
 [61] -1.583429841 -0.012751826  2.522164006 -0.807926078  0.145130449
 [66]  1.128620472 -0.437897140  0.345267827  0.114796416  1.541293751
 [71] -0.447521649 -0.155916628 -0.741884498 -0.002493551  0.733791737
 [76]  1.460611840 -1.314409350 -0.737482595  0.040472256 -1.107632680
 [81]  1.264687386  0.664366010 -0.348342245  0.215931974  0.047718229
 [86] -0.037191867  1.626768668  0.013038906 -1.314664183  0.006675326
 [91]  0.095832332 -0.109040274 -0.761557320 -0.513137187 -0.495213527
 [96]  0.310730061 -1.474519435 -0.721869033  0.727150908  1.169963287
> colMedians(tmp)
  [1]  0.210839772 -0.672671262  0.859277485  0.788648003  0.154110164
  [6]  0.721931465 -0.068007657  0.808167790 -2.422548405 -0.383769626
 [11]  0.415171848 -0.634350658  1.841378790  0.503373422  0.013805916
 [16] -0.466435515 -0.206200524  0.283633259  0.117419131  1.875525079
 [21]  1.479671422 -1.349627070  0.215575818  1.645349269  0.902476400
 [26] -1.155361441  0.356480495  1.074357749  1.459783543  2.459156115
 [31] -0.466511862  0.789908776 -1.503606925 -0.162615684 -0.361197332
 [36]  0.862327081 -0.734595699  0.500971878 -0.673100714  0.554880540
 [41]  0.890308012  0.308949544 -0.510280116 -0.093369988 -1.162876981
 [46]  0.726502029 -1.699793149  1.340582202  0.736622239 -0.998219107
 [51]  0.372071522 -0.558949160  0.225448417 -0.823284563  1.031290283
 [56] -1.594454540  0.549410453  1.888406153  0.629042118 -0.834976252
 [61] -1.583429841 -0.012751826  2.522164006 -0.807926078  0.145130449
 [66]  1.128620472 -0.437897140  0.345267827  0.114796416  1.541293751
 [71] -0.447521649 -0.155916628 -0.741884498 -0.002493551  0.733791737
 [76]  1.460611840 -1.314409350 -0.737482595  0.040472256 -1.107632680
 [81]  1.264687386  0.664366010 -0.348342245  0.215931974  0.047718229
 [86] -0.037191867  1.626768668  0.013038906 -1.314664183  0.006675326
 [91]  0.095832332 -0.109040274 -0.761557320 -0.513137187 -0.495213527
 [96]  0.310730061 -1.474519435 -0.721869033  0.727150908  1.169963287
> colRanges(tmp)
          [,1]       [,2]      [,3]     [,4]      [,5]      [,6]        [,7]
[1,] 0.2108398 -0.6726713 0.8592775 0.788648 0.1541102 0.7219315 -0.06800766
[2,] 0.2108398 -0.6726713 0.8592775 0.788648 0.1541102 0.7219315 -0.06800766
          [,8]      [,9]      [,10]     [,11]      [,12]    [,13]     [,14]
[1,] 0.8081678 -2.422548 -0.3837696 0.4151718 -0.6343507 1.841379 0.5033734
[2,] 0.8081678 -2.422548 -0.3837696 0.4151718 -0.6343507 1.841379 0.5033734
          [,15]      [,16]      [,17]     [,18]     [,19]    [,20]    [,21]
[1,] 0.01380592 -0.4664355 -0.2062005 0.2836333 0.1174191 1.875525 1.479671
[2,] 0.01380592 -0.4664355 -0.2062005 0.2836333 0.1174191 1.875525 1.479671
         [,22]     [,23]    [,24]     [,25]     [,26]     [,27]    [,28]
[1,] -1.349627 0.2155758 1.645349 0.9024764 -1.155361 0.3564805 1.074358
[2,] -1.349627 0.2155758 1.645349 0.9024764 -1.155361 0.3564805 1.074358
        [,29]    [,30]      [,31]     [,32]     [,33]      [,34]      [,35]
[1,] 1.459784 2.459156 -0.4665119 0.7899088 -1.503607 -0.1626157 -0.3611973
[2,] 1.459784 2.459156 -0.4665119 0.7899088 -1.503607 -0.1626157 -0.3611973
         [,36]      [,37]     [,38]      [,39]     [,40]    [,41]     [,42]
[1,] 0.8623271 -0.7345957 0.5009719 -0.6731007 0.5548805 0.890308 0.3089495
[2,] 0.8623271 -0.7345957 0.5009719 -0.6731007 0.5548805 0.890308 0.3089495
          [,43]       [,44]     [,45]    [,46]     [,47]    [,48]     [,49]
[1,] -0.5102801 -0.09336999 -1.162877 0.726502 -1.699793 1.340582 0.7366222
[2,] -0.5102801 -0.09336999 -1.162877 0.726502 -1.699793 1.340582 0.7366222
          [,50]     [,51]      [,52]     [,53]      [,54]   [,55]     [,56]
[1,] -0.9982191 0.3720715 -0.5589492 0.2254484 -0.8232846 1.03129 -1.594455
[2,] -0.9982191 0.3720715 -0.5589492 0.2254484 -0.8232846 1.03129 -1.594455
         [,57]    [,58]     [,59]      [,60]    [,61]       [,62]    [,63]
[1,] 0.5494105 1.888406 0.6290421 -0.8349763 -1.58343 -0.01275183 2.522164
[2,] 0.5494105 1.888406 0.6290421 -0.8349763 -1.58343 -0.01275183 2.522164
          [,64]     [,65]   [,66]      [,67]     [,68]     [,69]    [,70]
[1,] -0.8079261 0.1451304 1.12862 -0.4378971 0.3452678 0.1147964 1.541294
[2,] -0.8079261 0.1451304 1.12862 -0.4378971 0.3452678 0.1147964 1.541294
          [,71]      [,72]      [,73]        [,74]     [,75]    [,76]     [,77]
[1,] -0.4475216 -0.1559166 -0.7418845 -0.002493551 0.7337917 1.460612 -1.314409
[2,] -0.4475216 -0.1559166 -0.7418845 -0.002493551 0.7337917 1.460612 -1.314409
          [,78]      [,79]     [,80]    [,81]    [,82]      [,83]    [,84]
[1,] -0.7374826 0.04047226 -1.107633 1.264687 0.664366 -0.3483422 0.215932
[2,] -0.7374826 0.04047226 -1.107633 1.264687 0.664366 -0.3483422 0.215932
          [,85]       [,86]    [,87]      [,88]     [,89]       [,90]
[1,] 0.04771823 -0.03719187 1.626769 0.01303891 -1.314664 0.006675326
[2,] 0.04771823 -0.03719187 1.626769 0.01303891 -1.314664 0.006675326
          [,91]      [,92]      [,93]      [,94]      [,95]     [,96]     [,97]
[1,] 0.09583233 -0.1090403 -0.7615573 -0.5131372 -0.4952135 0.3107301 -1.474519
[2,] 0.09583233 -0.1090403 -0.7615573 -0.5131372 -0.4952135 0.3107301 -1.474519
         [,98]     [,99]   [,100]
[1,] -0.721869 0.7271509 1.169963
[2,] -0.721869 0.7271509 1.169963
> 
> 
> Max(tmp2)
[1] 2.212622
> Min(tmp2)
[1] -2.63007
> mean(tmp2)
[1] -0.1218263
> Sum(tmp2)
[1] -12.18263
> Var(tmp2)
[1] 0.9302152
> 
> rowMeans(tmp2)
  [1] -0.03603396  0.50261004 -0.17689778  0.37670565 -0.36778548 -1.16170979
  [7] -0.14126575 -1.22911054  0.74963784 -0.14079990  0.78917144  0.26726198
 [13]  0.60192336 -1.32063630 -0.19219694 -1.38316881  1.59702696 -1.49741552
 [19]  0.27336465  0.85320697 -0.27220185 -1.18771901 -0.07175656  0.24303190
 [25]  0.63757484 -0.93559171 -0.49910238  0.07757610 -0.83524269 -2.20193828
 [31]  1.00831751  0.08527804 -1.11805349  0.67866755 -1.37297053 -2.40409380
 [37]  0.86556513 -1.71888895  0.47383053  0.95598833 -1.83659742  1.14655317
 [43] -0.69468416 -0.15243530 -0.41563547  0.22970329  1.82728694 -1.60669708
 [49]  0.69618164  0.22494821  1.20664271  0.50952570  0.38556499 -0.27553574
 [55] -0.89302152  0.59714548 -0.01442441 -1.56561710 -0.52303501  0.80646087
 [61]  1.11609192  1.05908539 -0.35115817 -0.97881452  0.49445186 -0.20756799
 [67]  0.41942308  0.85554014 -0.74672212  2.21262191 -0.16649007 -0.25540854
 [73] -2.63007037 -1.27411641  1.11242814 -0.42750377 -0.07724469 -0.59383032
 [79] -0.64243954  0.02609808 -0.74646130 -1.62436494 -0.03660963  0.57541458
 [85]  0.68397739 -0.16886393 -0.40350668 -1.80612577 -1.75611055 -0.07051674
 [91]  1.42656491  0.43280508 -0.53019446  0.91732546  1.04388102  0.46676334
 [97] -0.45766740 -0.40155111  0.66832069  0.23542511
> rowSums(tmp2)
  [1] -0.03603396  0.50261004 -0.17689778  0.37670565 -0.36778548 -1.16170979
  [7] -0.14126575 -1.22911054  0.74963784 -0.14079990  0.78917144  0.26726198
 [13]  0.60192336 -1.32063630 -0.19219694 -1.38316881  1.59702696 -1.49741552
 [19]  0.27336465  0.85320697 -0.27220185 -1.18771901 -0.07175656  0.24303190
 [25]  0.63757484 -0.93559171 -0.49910238  0.07757610 -0.83524269 -2.20193828
 [31]  1.00831751  0.08527804 -1.11805349  0.67866755 -1.37297053 -2.40409380
 [37]  0.86556513 -1.71888895  0.47383053  0.95598833 -1.83659742  1.14655317
 [43] -0.69468416 -0.15243530 -0.41563547  0.22970329  1.82728694 -1.60669708
 [49]  0.69618164  0.22494821  1.20664271  0.50952570  0.38556499 -0.27553574
 [55] -0.89302152  0.59714548 -0.01442441 -1.56561710 -0.52303501  0.80646087
 [61]  1.11609192  1.05908539 -0.35115817 -0.97881452  0.49445186 -0.20756799
 [67]  0.41942308  0.85554014 -0.74672212  2.21262191 -0.16649007 -0.25540854
 [73] -2.63007037 -1.27411641  1.11242814 -0.42750377 -0.07724469 -0.59383032
 [79] -0.64243954  0.02609808 -0.74646130 -1.62436494 -0.03660963  0.57541458
 [85]  0.68397739 -0.16886393 -0.40350668 -1.80612577 -1.75611055 -0.07051674
 [91]  1.42656491  0.43280508 -0.53019446  0.91732546  1.04388102  0.46676334
 [97] -0.45766740 -0.40155111  0.66832069  0.23542511
> 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.03603396  0.50261004 -0.17689778  0.37670565 -0.36778548 -1.16170979
  [7] -0.14126575 -1.22911054  0.74963784 -0.14079990  0.78917144  0.26726198
 [13]  0.60192336 -1.32063630 -0.19219694 -1.38316881  1.59702696 -1.49741552
 [19]  0.27336465  0.85320697 -0.27220185 -1.18771901 -0.07175656  0.24303190
 [25]  0.63757484 -0.93559171 -0.49910238  0.07757610 -0.83524269 -2.20193828
 [31]  1.00831751  0.08527804 -1.11805349  0.67866755 -1.37297053 -2.40409380
 [37]  0.86556513 -1.71888895  0.47383053  0.95598833 -1.83659742  1.14655317
 [43] -0.69468416 -0.15243530 -0.41563547  0.22970329  1.82728694 -1.60669708
 [49]  0.69618164  0.22494821  1.20664271  0.50952570  0.38556499 -0.27553574
 [55] -0.89302152  0.59714548 -0.01442441 -1.56561710 -0.52303501  0.80646087
 [61]  1.11609192  1.05908539 -0.35115817 -0.97881452  0.49445186 -0.20756799
 [67]  0.41942308  0.85554014 -0.74672212  2.21262191 -0.16649007 -0.25540854
 [73] -2.63007037 -1.27411641  1.11242814 -0.42750377 -0.07724469 -0.59383032
 [79] -0.64243954  0.02609808 -0.74646130 -1.62436494 -0.03660963  0.57541458
 [85]  0.68397739 -0.16886393 -0.40350668 -1.80612577 -1.75611055 -0.07051674
 [91]  1.42656491  0.43280508 -0.53019446  0.91732546  1.04388102  0.46676334
 [97] -0.45766740 -0.40155111  0.66832069  0.23542511
> rowMin(tmp2)
  [1] -0.03603396  0.50261004 -0.17689778  0.37670565 -0.36778548 -1.16170979
  [7] -0.14126575 -1.22911054  0.74963784 -0.14079990  0.78917144  0.26726198
 [13]  0.60192336 -1.32063630 -0.19219694 -1.38316881  1.59702696 -1.49741552
 [19]  0.27336465  0.85320697 -0.27220185 -1.18771901 -0.07175656  0.24303190
 [25]  0.63757484 -0.93559171 -0.49910238  0.07757610 -0.83524269 -2.20193828
 [31]  1.00831751  0.08527804 -1.11805349  0.67866755 -1.37297053 -2.40409380
 [37]  0.86556513 -1.71888895  0.47383053  0.95598833 -1.83659742  1.14655317
 [43] -0.69468416 -0.15243530 -0.41563547  0.22970329  1.82728694 -1.60669708
 [49]  0.69618164  0.22494821  1.20664271  0.50952570  0.38556499 -0.27553574
 [55] -0.89302152  0.59714548 -0.01442441 -1.56561710 -0.52303501  0.80646087
 [61]  1.11609192  1.05908539 -0.35115817 -0.97881452  0.49445186 -0.20756799
 [67]  0.41942308  0.85554014 -0.74672212  2.21262191 -0.16649007 -0.25540854
 [73] -2.63007037 -1.27411641  1.11242814 -0.42750377 -0.07724469 -0.59383032
 [79] -0.64243954  0.02609808 -0.74646130 -1.62436494 -0.03660963  0.57541458
 [85]  0.68397739 -0.16886393 -0.40350668 -1.80612577 -1.75611055 -0.07051674
 [91]  1.42656491  0.43280508 -0.53019446  0.91732546  1.04388102  0.46676334
 [97] -0.45766740 -0.40155111  0.66832069  0.23542511
> 
> colMeans(tmp2)
[1] -0.1218263
> colSums(tmp2)
[1] -12.18263
> colVars(tmp2)
[1] 0.9302152
> colSd(tmp2)
[1] 0.9644766
> colMax(tmp2)
[1] 2.212622
> colMin(tmp2)
[1] -2.63007
> colMedians(tmp2)
[1] -0.07450062
> colRanges(tmp2)
          [,1]
[1,] -2.630070
[2,]  2.212622
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.7984989 -2.7039425 -0.6854377  1.5554335  1.9017553 -3.9357773
 [7] -5.0263217 -5.4124724 -2.6709744 -0.3375313
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.89310400
[2,] -0.89912578
[3,] -0.02029182
[4,]  0.33956961
[5,]  1.21828332
> 
> rowApply(tmp,sum)
 [1] -2.847091 -1.869849  4.434711 -7.863586 -3.855640  3.211260 -1.748515
 [8] -5.794349  4.568756 -8.349464
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    8    2    3    8    1    7    1    9     9
 [2,]    1    9    1    6    6    9   10    5    4     5
 [3,]    5    6   10    8    4    7    8    2    1    10
 [4,]    7    5    7    1   10   10    6    9    6     1
 [5,]    3    3    9   10    7    6    9    4    8     7
 [6,]    4    7    4    5    1    8    3    7   10     3
 [7,]    9    2    3    4    3    5    5    8    2     4
 [8,]    2    4    6    7    9    3    1    3    5     2
 [9,]    6    1    5    9    2    2    2    6    7     8
[10,]   10   10    8    2    5    4    4   10    3     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.17489637 -2.78909826 -0.70127887  1.40252346 -2.55076411  1.49547421
 [7] -2.03796641  3.37960515 -2.70587639  3.20132506  2.48173735  1.27777395
[13] -1.05493727 -2.01144370  0.42001918 -1.50033154 -1.05225162  0.03523804
[19]  1.15138064  1.79876845
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.1525922
[2,] -2.1202936
[3,] -0.9008326
[4,]  0.7352414
[5,]  1.2635807
> 
> rowApply(tmp,sum)
[1] -3.4030497  5.5647302 -9.5004107  4.1639905  0.2397407
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1   16    1    5   18
[2,]    8    8    2    2   17
[3,]   16    3    8   19    2
[4,]   13   10    7   18   10
[5,]    9    7   10   14    1
> 
> 
> as.matrix(tmp)
           [,1]         [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -2.1525922 -0.605677687  0.6921131  0.3680889 -0.2965081 -0.9523951
[2,]  0.7352414  0.007758657 -0.8014924  0.2962976 -0.3631768 -0.3689020
[3,] -2.1202936 -1.822737746 -1.1552273 -1.2211206 -0.8003477 -0.6046856
[4,] -0.9008326 -1.529479084  2.0527630  1.8536004  0.6231990  1.0813253
[5,]  1.2635807  1.161037598 -1.4894353  0.1056572 -1.7139305  2.3401315
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.3869015  1.2051877 -1.2365150  0.8094113 -0.2851536  0.9060001
[2,] -0.8383912  0.4915917  0.5841109  1.8197615  0.3717243  1.2284545
[3,]  0.7948051  1.6657600 -1.2467392 -0.2487757 -1.5642739 -1.5395996
[4,] -1.4040677 -0.4247276  0.1123542  0.3246888  2.5761571  0.5380976
[5,] -0.9772140  0.4417933 -0.9190873  0.4962392  1.3832834  0.1448214
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.8672473 -0.8447234  0.3347939 -0.1595179 -0.6633380 -1.5815568
[2,]  0.3541168 -1.2288654  0.4610680  0.1451036 -0.4867113  1.2752902
[3,]  0.1744272  1.3985142 -0.6771236 -1.3819672  0.8439292  0.0759807
[4,] -1.8143152 -1.4485158  0.3436850  0.9626018 -0.3716426  0.1431581
[5,] -0.6364134  0.1121466 -0.0424041 -1.0665519 -0.3744889  0.1223659
          [,19]      [,20]
[1,] -0.7051525  0.5103369
[2,] -0.5587149  2.4404652
[3,]  1.0687420 -1.1396774
[4,]  0.3249949  1.1209457
[5,]  1.0215112 -1.1333018
> 
> 
> 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 :  649  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 :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.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 1.131596 -0.5537046 0.1349303 -0.02255654 -1.853758 1.994611 0.25836
         col8      col9     col10      col11     col12      col13   col14
row1 1.598842 0.4917142 -0.654455 -0.1448858 -0.237381 -0.7115611 1.01357
         col15     col16     col17     col18     col19     col20
row1 0.6515436 -1.274193 -1.827325 0.5101475 -0.208096 0.4933184
> tmp[,"col10"]
          col10
row1 -0.6544550
row2  1.7798104
row3 -0.4687327
row4 -0.2021126
row5 -0.6828148
> tmp[c("row1","row5"),]
          col1        col2       col3        col4       col5      col6     col7
row1 1.1315964 -0.55370458  0.1349303 -0.02255654 -1.8537576 1.9946109 0.258360
row5 0.3688326  0.03383433 -0.7323936 -0.84113038 -0.2333563 0.4058051 1.376437
          col8       col9      col10      col11     col12      col13    col14
row1 1.5988419  0.4917142 -0.6544550 -0.1448858 -0.237381 -0.7115611 1.013570
row5 0.4780034 -1.4602165 -0.6828148  0.7210623 -1.123958  0.9446586 1.506353
         col15      col16       col17      col18       col19     col20
row1 0.6515436 -1.2741926 -1.82732461  0.5101475 -0.20809601 0.4933184
row5 0.2242816 -0.1871638  0.08888565 -0.1330610 -0.03574556 0.4366490
> tmp[,c("col6","col20")]
           col6     col20
row1  1.9946109 0.4933184
row2  1.0733569 0.7923291
row3 -1.5936549 2.1200042
row4 -1.5550798 1.4374421
row5  0.4058051 0.4366490
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1 1.9946109 0.4933184
row5 0.4058051 0.4366490
> 
> 
> 
> 
> 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.17605 49.44392 50.6757 49.68392 51.33344 104.3192 49.80682 49.70911
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.29227 50.71267 48.54222 48.79103 52.80934 49.08554 49.36122 49.19644
        col17    col18    col19    col20
row1 47.22641 49.71431 50.06679 105.5452
> tmp[,"col10"]
        col10
row1 50.71267
row2 31.11795
row3 30.14414
row4 29.85408
row5 48.68463
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.17605 49.44392 50.67570 49.68392 51.33344 104.3192 49.80682 49.70911
row5 52.68850 50.15675 49.86803 51.34728 47.90078 105.2470 50.16047 50.40985
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.29227 50.71267 48.54222 48.79103 52.80934 49.08554 49.36122 49.19644
row5 50.58918 48.68463 49.20730 49.17186 48.79378 49.54849 49.42862 51.40225
        col17    col18    col19    col20
row1 47.22641 49.71431 50.06679 105.5452
row5 49.52948 51.45834 50.83830 103.4207
> tmp[,c("col6","col20")]
          col6     col20
row1 104.31919 105.54521
row2  76.02427  76.74845
row3  74.68017  74.38454
row4  75.19575  76.19184
row5 105.24700 103.42074
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.3192 105.5452
row5 105.2470 103.4207
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.3192 105.5452
row5 105.2470 103.4207
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.27201000
[2,]  0.01313902
[3,]  1.77156748
[4,] -0.43715997
[5,] -0.15586994
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.5959449  0.36375319
[2,]  0.5819852 -0.68007068
[3,]  0.7369181  0.07213719
[4,] -0.5367843  0.94421952
[5,]  1.0907262  0.82331474
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  0.5981262  0.08624581
[2,]  0.6909391  0.58602426
[3,]  0.3531835 -1.02100417
[4,] -0.5869623 -0.87367420
[5,] -0.9544288  0.80951101
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.5981262
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.5981262
[2,] 0.6909391
> 
> 
> 
> 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.3449133 -0.4370775 0.6971822 -1.4848634 -1.181169 -1.3537737 -0.5239185
row1 0.4370526  1.2116711 0.6560827  0.2613064  2.335836 -0.2372879  0.6038468
            [,8]      [,9]      [,10]      [,11]     [,12]      [,13]
row3 -0.85744495 -1.739098  0.3232582 -1.8700981 -1.052164 -0.3070757
row1  0.05949755  0.425930 -0.6334932 -0.5112948  1.370722  0.3935933
          [,14]      [,15]      [,16]      [,17]       [,18]      [,19]
row3 -0.8152991 0.01284606 -0.2052764 -0.7266728 -0.08030652 -0.6168652
row1 -0.4393954 0.03002800  0.3493980 -1.5806449 -2.36079839  2.0892640
          [,20]
row3 -0.1757645
row1  0.3539212
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]     [,5]      [,6]      [,7]
row2 0.020156 0.6025785 0.9983962 0.2171144 0.562768 0.9095752 -1.087631
          [,8]      [,9]      [,10]
row2 -1.455374 0.9709041 -0.6326356
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]      [,4]       [,5]       [,6]       [,7]
row5 -2.295359 -0.5951434 0.3258719 0.1819182 -0.3154107 -0.4867074 0.06588035
           [,8]      [,9]      [,10]    [,11]      [,12]     [,13]    [,14]
row5 -0.4569301 0.8271575 -0.6776861 1.230912 -0.4989101 0.9463323 2.617783
         [,15]       [,16]    [,17]       [,18]      [,19]      [,20]
row5 0.0712379 -0.04232675 -1.24596 -0.04411994 -0.7967016 -0.8279294
> 
> 
> 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: 0x5f123566ace0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36670710467f3"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36670138b2c32"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM366705f8c0703"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM366702c9b4dbc"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM366706bf746fc"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3667054fcba7d"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM366704275ed45"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3667036b2447d"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM366704d6e1a98"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM366705df9747f"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM366703910474a"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3667020a4ecb0"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3667078d8a08a"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36670327d6eb" 
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3667073f0a91e"
> 
> 
> ### 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: 0x5f123569ec10>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5f123569ec10>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5f123569ec10>
> rowMedians(tmp)
  [1] -0.215892387  0.314955671 -0.552076234 -0.126401341 -0.263568178
  [6]  0.287470520  0.299363565  0.089924940  0.163543820  0.816589561
 [11] -0.135862251 -0.198544826  0.025186676 -0.318261577 -0.067216523
 [16] -0.115774320  0.660237530  0.042003935  0.039724101  0.166803601
 [21]  0.627381934  0.306695889  0.010243185  0.242854310  0.128124897
 [26]  0.113830097 -0.329068068  0.027191392 -0.233552907  0.076698198
 [31]  0.172366376 -0.192803473  0.126365741  0.496049608  0.162147157
 [36]  0.052173139 -0.226690772 -0.082367019 -0.333471991 -0.114755831
 [41]  0.162973132 -0.384909260 -0.154064364 -0.306696604 -0.376285992
 [46]  0.230421109  0.417242333  0.444141584  0.187190949 -0.521063629
 [51]  0.096514630  0.278264028 -0.438329459 -0.117969802 -0.018672219
 [56] -0.315760734  0.344042764  0.007185765  0.029239490 -0.126255456
 [61] -0.427268326  0.284952816 -0.014159988 -0.348757713  0.017616022
 [66] -0.210362169  0.013919963 -0.220046384 -0.012972321  0.380393753
 [71]  0.243128406  0.203709461  0.139135183 -0.089069773 -0.676616045
 [76] -0.267453358  0.039288557  0.082676100  0.530237051 -0.105381846
 [81]  0.520203629  0.067283669  0.244831298  0.451983359  0.214773667
 [86] -0.345291829  0.166481391 -0.286243063  0.028762128 -0.101112351
 [91]  0.221453919 -0.174639576 -0.295564247 -0.196851101 -0.125777358
 [96]  0.451130098 -0.006822843 -0.078088799  0.105386336 -0.343740653
[101] -0.736373912 -0.164517444  0.037085072 -0.077115669  0.193501856
[106]  0.502974321  0.061219347 -0.336764557  0.026766790 -0.451515889
[111] -0.775035133  0.006169752  0.084735361  0.240924420  0.501456825
[116]  0.047145967 -0.380255788 -0.228520481  0.240422476 -0.041081700
[121]  0.142546900 -0.383187435 -0.303853187 -0.100348982 -0.952892869
[126] -0.236153501 -0.240057437  0.043618698 -0.228063569  0.392495612
[131]  0.186919836 -0.450500308 -0.522992155 -0.497074171  0.037737099
[136]  0.442835623 -0.278704783  0.057755279  0.365242489 -0.155674392
[141]  0.036241552  0.291319266  0.448892565  0.259333148  0.336579737
[146]  0.031771467 -0.269133601  0.065453996  0.258338572  0.272058826
[151] -0.036447171 -0.256214514  0.575503494 -0.013128763 -0.010215126
[156] -0.166375193 -0.159358798 -0.235395762  0.533133601  0.476000059
[161]  0.178293723  0.537406279 -0.039812948  0.292824839 -0.186904199
[166] -0.186264554 -0.266802150 -0.684497555  0.668599201 -0.328799912
[171]  0.033128282 -0.372070757 -0.616667199 -0.135429747 -0.032755788
[176]  0.189750386 -0.324847819 -0.532821645 -0.096310301  0.016366451
[181]  0.314275878 -0.583580673  0.228234836 -0.380054489 -0.427659345
[186] -0.271206093  0.068882765 -0.197173104 -0.469211775 -0.163312672
[191]  0.047890914 -0.063036976 -0.210761888  0.050014040  0.211031490
[196]  1.149679384 -0.075172684 -0.047842772 -0.013617556 -0.106108633
[201] -0.448540568  0.362996167  0.304656929 -0.150797163 -0.269640964
[206] -0.029035078  0.434169107 -0.405359614 -0.522364794 -0.012220371
[211] -0.243892543 -0.074557663 -0.630470375 -0.183626720  0.079398989
[216] -0.442763676 -0.098569693 -0.422611080  0.061258100 -0.074014732
[221]  0.235679668 -0.005416462  0.080758161 -0.374659676  0.113644816
[226]  0.055359714 -0.180131691  0.201550759 -0.190170709  0.007018281
> 
> proc.time()
   user  system elapsed 
  1.247   0.655   1.892 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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: 0x5f4725f77b10>
> .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: 0x5f4725f77b10>
> .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: 0x5f4725f77b10>
> .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: 0x5f4725f77b10>
> 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: 0x5f4724b5ea00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f4724b5ea00>
> .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: 0x5f4724b5ea00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f4724b5ea00>
> .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: 0x5f4724b5ea00>
> 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: 0x5f4725184fd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f4725184fd0>
> .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: 0x5f4725184fd0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5f4725184fd0>
> .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: 0x5f4725184fd0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5f4725184fd0>
> .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: 0x5f4725184fd0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5f4725184fd0>
> .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: 0x5f4725184fd0>
> 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: 0x5f47272a83b0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5f47272a83b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f47272a83b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f47272a83b0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36804318525b1" "BufferedMatrixFile368047cc21049"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36804318525b1" "BufferedMatrixFile368047cc21049"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f47257a2fe0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f47257a2fe0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5f47257a2fe0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5f47257a2fe0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5f47257a2fe0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5f47257a2fe0>
> .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: 0x5f47259d8060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f47259d8060>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5f47259d8060>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5f47259d8060>
> 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: 0x5f4724c29660>
> .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: 0x5f4724c29660>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.243   0.046   0.278 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.235   0.045   0.269 

Example timings