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

This page was generated on 2025-09-25 11:38 -0400 (Thu, 25 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4827
merida1macOS 12.7.5 Montereyx86_644.5.1 RC (2025-06-05 r88288) -- "Great Square Root" 4608
kjohnson1macOS 13.6.6 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4549
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4581
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 252/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.72.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-09-22 13:40 -0400 (Mon, 22 Sep 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_21
git_last_commit: aa9e634
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.72.0
Command: /home/biocbuild/bbs-3.21-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.21-bioc/R/site-library --timings BufferedMatrix_1.72.0.tar.gz
StartedAt: 2025-09-24 21:52:41 -0400 (Wed, 24 Sep 2025)
EndedAt: 2025-09-24 21:53:06 -0400 (Wed, 24 Sep 2025)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 (2025-06-13)
* 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.72.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.21-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.21-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.72.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.21-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.21-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.21-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.21-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.21-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.21-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.21-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 (2025-06-13) -- "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.244   0.050   0.283 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 (2025-06-13) -- "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.21-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 478417 25.6    1047105   56   639600 34.2
Vcells 885231  6.8    8388608   64  2081598 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] "Wed Sep 24 21:52:56 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] "Wed Sep 24 21:52:56 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: 0x581c4517ead0>
> 
> 
> 
> 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] "Wed Sep 24 21:52:57 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] "Wed Sep 24 21:52:57 2025"
> 
> ColMode(tmp2)
<pointer: 0x581c4517ead0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]     [,3]       [,4]
[1,] 100.1837732 -0.1729032 2.153346  1.1244005
[2,]  -0.7209000  0.2401661 1.108860  0.8627606
[3,]  -0.8194452 -0.1952508 0.439297 -0.5011007
[4,]   0.7481430 -0.2321267 1.681271  1.0120550
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]     [,3]      [,4]
[1,] 100.1837732 0.1729032 2.153346 1.1244005
[2,]   0.7209000 0.2401661 1.108860 0.8627606
[3,]   0.8194452 0.1952508 0.439297 0.5011007
[4,]   0.7481430 0.2321267 1.681271 1.0120550
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0091844 0.4158163 1.4674282 1.0603775
[2,]  0.8490583 0.4900675 1.0530244 0.9288491
[3,]  0.9052321 0.4418720 0.6627948 0.7078847
[4,]  0.8649526 0.4817953 1.2966384 1.0060094
> 
> 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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.27562 29.33107 41.82763 36.72818
[2,]  34.21148 30.14084 36.63910 35.15125
[3,]  34.87177 29.61397 32.06725 32.57995
[4,]  34.39767 30.05008 39.64766 36.07215
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x581c45dba960>
> exp(tmp5)
<pointer: 0x581c45dba960>
> log(tmp5,2)
<pointer: 0x581c45dba960>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.8817
> Min(tmp5)
[1] 53.69848
> mean(tmp5)
[1] 73.06115
> Sum(tmp5)
[1] 14612.23
> Var(tmp5)
[1] 864.2632
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.21168 71.34766 68.81247 71.31663 69.38564 71.98472 69.01841 73.05172
 [9] 71.45265 72.02996
> rowSums(tmp5)
 [1] 1844.234 1426.953 1376.249 1426.333 1387.713 1439.694 1380.368 1461.034
 [9] 1429.053 1440.599
> rowVars(tmp5)
 [1] 7927.19219   46.83729   34.25166   91.76813   57.54208   88.50827
 [7]  101.37199  122.66692   83.08758   50.96671
> rowSd(tmp5)
 [1] 89.034781  6.843778  5.852491  9.579568  7.585650  9.407884 10.068366
 [8] 11.075510  9.115239  7.139097
> rowMax(tmp5)
 [1] 468.88168  86.57996  77.94664  86.53988  86.75179  92.35473  91.48539
 [8]  88.97882  88.34630  85.45040
> rowMin(tmp5)
 [1] 59.48084 59.02423 58.05905 54.40445 54.73314 56.44571 53.69848 56.11213
 [9] 55.47702 60.34932
> 
> colMeans(tmp5)
 [1] 109.46322  67.62572  72.35280  75.94091  70.00792  68.63009  73.29654
 [8]  68.19124  71.14844  71.57751  70.29612  72.10712  67.95089  72.97951
[15]  68.39521  72.44916  75.87548  71.58070  69.78778  71.56674
> colSums(tmp5)
 [1] 1094.6322  676.2572  723.5280  759.4091  700.0792  686.3009  732.9654
 [8]  681.9124  711.4844  715.7751  702.9612  721.0712  679.5089  729.7951
[15]  683.9521  724.4916  758.7548  715.8070  697.8778  715.6674
> colVars(tmp5)
 [1] 15992.19134    48.19718   110.55934    40.25358    80.36920    45.11844
 [7]    87.27804   116.17179    30.96824   149.54785    74.13815    51.06820
[13]    74.93272    88.39752    51.55860   101.99879    68.15475    70.47087
[19]    93.30478    66.34108
> colSd(tmp5)
 [1] 126.460236   6.942419  10.514720   6.344571   8.964887   6.717026
 [7]   9.342272  10.778302   5.564911  12.228976   8.610352   7.146202
[13]   8.656369   9.401995   7.180432  10.099445   8.255589   8.394693
[19]   9.659440   8.145004
> colMax(tmp5)
 [1] 468.88168  80.39454  87.05873  86.38645  84.46205  77.64767  86.73966
 [8]  92.35473  79.97611  91.48539  82.36893  83.79447  84.17304  88.34630
[15]  80.52443  85.39841  86.75179  86.53988  88.43770  86.57996
> colMin(tmp5)
 [1] 55.47702 60.63209 55.82185 67.81089 58.17706 59.75453 59.79488 57.01789
 [9] 60.99922 57.93054 56.44571 61.58426 53.69848 59.11333 57.59058 54.40445
[17] 63.72558 56.90669 54.73314 60.11583
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 92.21168 71.34766 68.81247 71.31663 69.38564 71.98472       NA 73.05172
 [9] 71.45265 72.02996
> rowSums(tmp5)
 [1] 1844.234 1426.953 1376.249 1426.333 1387.713 1439.694       NA 1461.034
 [9] 1429.053 1440.599
> rowVars(tmp5)
 [1] 7927.19219   46.83729   34.25166   91.76813   57.54208   88.50827
 [7]  105.20604  122.66692   83.08758   50.96671
> rowSd(tmp5)
 [1] 89.034781  6.843778  5.852491  9.579568  7.585650  9.407884 10.257000
 [8] 11.075510  9.115239  7.139097
> rowMax(tmp5)
 [1] 468.88168  86.57996  77.94664  86.53988  86.75179  92.35473        NA
 [8]  88.97882  88.34630  85.45040
> rowMin(tmp5)
 [1] 59.48084 59.02423 58.05905 54.40445 54.73314 56.44571       NA 56.11213
 [9] 55.47702 60.34932
> 
> colMeans(tmp5)
 [1] 109.46322  67.62572  72.35280  75.94091  70.00792  68.63009  73.29654
 [8]  68.19124  71.14844  71.57751  70.29612  72.10712  67.95089  72.97951
[15]  68.39521  72.44916  75.87548  71.58070        NA  71.56674
> colSums(tmp5)
 [1] 1094.6322  676.2572  723.5280  759.4091  700.0792  686.3009  732.9654
 [8]  681.9124  711.4844  715.7751  702.9612  721.0712  679.5089  729.7951
[15]  683.9521  724.4916  758.7548  715.8070        NA  715.6674
> colVars(tmp5)
 [1] 15992.19134    48.19718   110.55934    40.25358    80.36920    45.11844
 [7]    87.27804   116.17179    30.96824   149.54785    74.13815    51.06820
[13]    74.93272    88.39752    51.55860   101.99879    68.15475    70.47087
[19]          NA    66.34108
> colSd(tmp5)
 [1] 126.460236   6.942419  10.514720   6.344571   8.964887   6.717026
 [7]   9.342272  10.778302   5.564911  12.228976   8.610352   7.146202
[13]   8.656369   9.401995   7.180432  10.099445   8.255589   8.394693
[19]         NA   8.145004
> colMax(tmp5)
 [1] 468.88168  80.39454  87.05873  86.38645  84.46205  77.64767  86.73966
 [8]  92.35473  79.97611  91.48539  82.36893  83.79447  84.17304  88.34630
[15]  80.52443  85.39841  86.75179  86.53988        NA  86.57996
> colMin(tmp5)
 [1] 55.47702 60.63209 55.82185 67.81089 58.17706 59.75453 59.79488 57.01789
 [9] 60.99922 57.93054 56.44571 61.58426 53.69848 59.11333 57.59058 54.40445
[17] 63.72558 56.90669       NA 60.11583
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.8817
> Min(tmp5,na.rm=TRUE)
[1] 53.69848
> mean(tmp5,na.rm=TRUE)
[1] 73.10933
> Sum(tmp5,na.rm=TRUE)
[1] 14548.76
> Var(tmp5,na.rm=TRUE)
[1] 868.1616
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.21168 71.34766 68.81247 71.31663 69.38564 71.98472 69.31023 73.05172
 [9] 71.45265 72.02996
> rowSums(tmp5,na.rm=TRUE)
 [1] 1844.234 1426.953 1376.249 1426.333 1387.713 1439.694 1316.894 1461.034
 [9] 1429.053 1440.599
> rowVars(tmp5,na.rm=TRUE)
 [1] 7927.19219   46.83729   34.25166   91.76813   57.54208   88.50827
 [7]  105.20604  122.66692   83.08758   50.96671
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.034781  6.843778  5.852491  9.579568  7.585650  9.407884 10.257000
 [8] 11.075510  9.115239  7.139097
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.88168  86.57996  77.94664  86.53988  86.75179  92.35473  91.48539
 [8]  88.97882  88.34630  85.45040
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.48084 59.02423 58.05905 54.40445 54.73314 56.44571 53.69848 56.11213
 [9] 55.47702 60.34932
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.46322  67.62572  72.35280  75.94091  70.00792  68.63009  73.29654
 [8]  68.19124  71.14844  71.57751  70.29612  72.10712  67.95089  72.97951
[15]  68.39521  72.44916  75.87548  71.58070  70.48932  71.56674
> colSums(tmp5,na.rm=TRUE)
 [1] 1094.6322  676.2572  723.5280  759.4091  700.0792  686.3009  732.9654
 [8]  681.9124  711.4844  715.7751  702.9612  721.0712  679.5089  729.7951
[15]  683.9521  724.4916  758.7548  715.8070  634.4038  715.6674
> colVars(tmp5,na.rm=TRUE)
 [1] 15992.19134    48.19718   110.55934    40.25358    80.36920    45.11844
 [7]    87.27804   116.17179    30.96824   149.54785    74.13815    51.06820
[13]    74.93272    88.39752    51.55860   101.99879    68.15475    70.47087
[19]    99.43115    66.34108
> colSd(tmp5,na.rm=TRUE)
 [1] 126.460236   6.942419  10.514720   6.344571   8.964887   6.717026
 [7]   9.342272  10.778302   5.564911  12.228976   8.610352   7.146202
[13]   8.656369   9.401995   7.180432  10.099445   8.255589   8.394693
[19]   9.971517   8.145004
> colMax(tmp5,na.rm=TRUE)
 [1] 468.88168  80.39454  87.05873  86.38645  84.46205  77.64767  86.73966
 [8]  92.35473  79.97611  91.48539  82.36893  83.79447  84.17304  88.34630
[15]  80.52443  85.39841  86.75179  86.53988  88.43770  86.57996
> colMin(tmp5,na.rm=TRUE)
 [1] 55.47702 60.63209 55.82185 67.81089 58.17706 59.75453 59.79488 57.01789
 [9] 60.99922 57.93054 56.44571 61.58426 53.69848 59.11333 57.59058 54.40445
[17] 63.72558 56.90669 54.73314 60.11583
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.21168 71.34766 68.81247 71.31663 69.38564 71.98472      NaN 73.05172
 [9] 71.45265 72.02996
> rowSums(tmp5,na.rm=TRUE)
 [1] 1844.234 1426.953 1376.249 1426.333 1387.713 1439.694    0.000 1461.034
 [9] 1429.053 1440.599
> rowVars(tmp5,na.rm=TRUE)
 [1] 7927.19219   46.83729   34.25166   91.76813   57.54208   88.50827
 [7]         NA  122.66692   83.08758   50.96671
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.034781  6.843778  5.852491  9.579568  7.585650  9.407884        NA
 [8] 11.075510  9.115239  7.139097
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.88168  86.57996  77.94664  86.53988  86.75179  92.35473        NA
 [8]  88.97882  88.34630  85.45040
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.48084 59.02423 58.05905 54.40445 54.73314 56.44571       NA 56.11213
 [9] 55.47702 60.34932
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.28373  68.40279  74.18957  75.55135  68.66996  69.46543  72.41043
 [8]  68.09120  70.76824  69.36552  70.36652  73.27633  69.53449  72.91384
[15]  69.59572  73.51340  77.22547  70.96194       NaN  71.13171
> colSums(tmp5,na.rm=TRUE)
 [1] 1028.5535  615.6251  667.7061  679.9621  618.0296  625.1889  651.6939
 [8]  612.8208  636.9142  624.2897  633.2987  659.4870  625.8104  656.2245
[15]  626.3615  661.6206  695.0292  638.6574    0.0000  640.1854
> colVars(tmp5,na.rm=TRUE)
 [1] 17729.79531    47.42864    86.42478    43.57801    70.27644    42.90799
 [7]    89.35434   130.58067    33.21310   113.19634    83.34967    42.07246
[13]    56.08665    99.39868    41.78952   102.00694    56.17131    74.97252
[19]          NA    72.50466
> colSd(tmp5,na.rm=TRUE)
 [1] 133.153277   6.886845   9.296493   6.601364   8.383104   6.550419
 [7]   9.452742  11.427190   5.763081  10.639377   9.129604   6.486329
[13]   7.489102   9.969889   6.464482  10.099848   7.494752   8.658667
[19]         NA   8.514967
> colMax(tmp5,na.rm=TRUE)
 [1] 468.88168  80.39454  87.05873  86.38645  84.46205  77.64767  86.73966
 [8]  92.35473  79.97611  88.97882  82.36893  83.79447  84.17304  88.34630
[15]  80.52443  85.39841  86.75179  86.53988      -Inf  86.57996
> colMin(tmp5,na.rm=TRUE)
 [1] 55.47702 61.04877 56.11213 67.81089 58.17706 59.75453 59.79488 57.01789
 [9] 60.99922 57.93054 56.44571 65.59674 60.46590 59.11333 60.34510 54.40445
[17] 67.18323 56.90669      Inf 60.11583
> 
> 
> 
> 
> 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] 212.8453 163.5349 297.7904 192.6186 245.7317 196.7129 134.2331 178.0544
 [9] 249.7911 166.1551
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 212.8453 163.5349 297.7904 192.6186 245.7317 196.7129 134.2331 178.0544
 [9] 249.7911 166.1551
> 
> 
> 
> 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] -8.526513e-14  5.684342e-14  8.526513e-14 -5.684342e-14  2.842171e-14
 [6]  8.526513e-14  1.563194e-13  8.526513e-14  1.136868e-13  2.131628e-14
[11]  5.684342e-14 -5.684342e-14  0.000000e+00  7.105427e-14 -1.136868e-13
[16]  0.000000e+00  5.684342e-14  5.684342e-14  0.000000e+00  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
3   18 
5   10 
9   19 
8   16 
4   16 
4   8 
2   12 
9   14 
2   3 
8   14 
8   8 
10   7 
10   1 
4   2 
8   3 
9   8 
2   9 
7   18 
9   11 
9   16 
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.275542
> Min(tmp)
[1] -1.895043
> mean(tmp)
[1] 0.07307407
> Sum(tmp)
[1] 7.307407
> Var(tmp)
[1] 0.7957751
> 
> rowMeans(tmp)
[1] 0.07307407
> rowSums(tmp)
[1] 7.307407
> rowVars(tmp)
[1] 0.7957751
> rowSd(tmp)
[1] 0.8920623
> rowMax(tmp)
[1] 2.275542
> rowMin(tmp)
[1] -1.895043
> 
> colMeans(tmp)
  [1]  0.665409686  1.088818726  1.243414626  0.803531133 -0.000698263
  [6] -0.834704881  0.761433472 -1.578063908  0.127059218  0.200173507
 [11] -0.364529983 -0.499905370  1.149904709 -0.329347352  1.103820277
 [16]  0.347414136 -0.433689168 -0.342538472  0.194236102  0.753166806
 [21] -1.490395540 -1.061591063  0.115948301  0.122238292  0.012600256
 [26]  1.917545602  0.366278067  0.738799805  0.328381837  1.224323578
 [31]  0.520245466  0.694093054  1.414438109  1.279585906  0.378594294
 [36]  0.774978734 -1.082392630  0.008689405  1.071237232  0.063567511
 [41] -1.895042857 -0.739346060  2.013216964 -1.314931194 -0.283739396
 [46] -0.372752870 -0.412826842 -0.159312463 -0.127335663 -1.164570915
 [51]  0.425077343  0.454675201 -0.403478381 -0.504487918 -0.053677979
 [56]  0.739830381 -1.130567784 -0.069717679 -1.056333471 -0.544869060
 [61]  2.275542119  0.559483937  1.430060430 -1.115133306  0.796833579
 [66]  0.647732862  0.874890727  1.697912901 -0.141471235 -0.466059205
 [71]  0.665296622 -0.239843407  0.284195631  0.473626512  0.903573678
 [76] -0.892063358  0.569196401 -1.671882517  1.092067800 -0.925160786
 [81] -0.158013492  1.390376882 -0.680171199 -1.420587175 -0.548727495
 [86] -0.897782061  0.990272258 -0.888357406  0.129042914  0.225755491
 [91] -0.799569813  0.263117022  0.360612964  0.148651062  1.412463379
 [96] -0.907165816 -0.528513732 -1.307370272 -0.433195019 -0.714111720
> colSums(tmp)
  [1]  0.665409686  1.088818726  1.243414626  0.803531133 -0.000698263
  [6] -0.834704881  0.761433472 -1.578063908  0.127059218  0.200173507
 [11] -0.364529983 -0.499905370  1.149904709 -0.329347352  1.103820277
 [16]  0.347414136 -0.433689168 -0.342538472  0.194236102  0.753166806
 [21] -1.490395540 -1.061591063  0.115948301  0.122238292  0.012600256
 [26]  1.917545602  0.366278067  0.738799805  0.328381837  1.224323578
 [31]  0.520245466  0.694093054  1.414438109  1.279585906  0.378594294
 [36]  0.774978734 -1.082392630  0.008689405  1.071237232  0.063567511
 [41] -1.895042857 -0.739346060  2.013216964 -1.314931194 -0.283739396
 [46] -0.372752870 -0.412826842 -0.159312463 -0.127335663 -1.164570915
 [51]  0.425077343  0.454675201 -0.403478381 -0.504487918 -0.053677979
 [56]  0.739830381 -1.130567784 -0.069717679 -1.056333471 -0.544869060
 [61]  2.275542119  0.559483937  1.430060430 -1.115133306  0.796833579
 [66]  0.647732862  0.874890727  1.697912901 -0.141471235 -0.466059205
 [71]  0.665296622 -0.239843407  0.284195631  0.473626512  0.903573678
 [76] -0.892063358  0.569196401 -1.671882517  1.092067800 -0.925160786
 [81] -0.158013492  1.390376882 -0.680171199 -1.420587175 -0.548727495
 [86] -0.897782061  0.990272258 -0.888357406  0.129042914  0.225755491
 [91] -0.799569813  0.263117022  0.360612964  0.148651062  1.412463379
 [96] -0.907165816 -0.528513732 -1.307370272 -0.433195019 -0.714111720
> 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.665409686  1.088818726  1.243414626  0.803531133 -0.000698263
  [6] -0.834704881  0.761433472 -1.578063908  0.127059218  0.200173507
 [11] -0.364529983 -0.499905370  1.149904709 -0.329347352  1.103820277
 [16]  0.347414136 -0.433689168 -0.342538472  0.194236102  0.753166806
 [21] -1.490395540 -1.061591063  0.115948301  0.122238292  0.012600256
 [26]  1.917545602  0.366278067  0.738799805  0.328381837  1.224323578
 [31]  0.520245466  0.694093054  1.414438109  1.279585906  0.378594294
 [36]  0.774978734 -1.082392630  0.008689405  1.071237232  0.063567511
 [41] -1.895042857 -0.739346060  2.013216964 -1.314931194 -0.283739396
 [46] -0.372752870 -0.412826842 -0.159312463 -0.127335663 -1.164570915
 [51]  0.425077343  0.454675201 -0.403478381 -0.504487918 -0.053677979
 [56]  0.739830381 -1.130567784 -0.069717679 -1.056333471 -0.544869060
 [61]  2.275542119  0.559483937  1.430060430 -1.115133306  0.796833579
 [66]  0.647732862  0.874890727  1.697912901 -0.141471235 -0.466059205
 [71]  0.665296622 -0.239843407  0.284195631  0.473626512  0.903573678
 [76] -0.892063358  0.569196401 -1.671882517  1.092067800 -0.925160786
 [81] -0.158013492  1.390376882 -0.680171199 -1.420587175 -0.548727495
 [86] -0.897782061  0.990272258 -0.888357406  0.129042914  0.225755491
 [91] -0.799569813  0.263117022  0.360612964  0.148651062  1.412463379
 [96] -0.907165816 -0.528513732 -1.307370272 -0.433195019 -0.714111720
> colMin(tmp)
  [1]  0.665409686  1.088818726  1.243414626  0.803531133 -0.000698263
  [6] -0.834704881  0.761433472 -1.578063908  0.127059218  0.200173507
 [11] -0.364529983 -0.499905370  1.149904709 -0.329347352  1.103820277
 [16]  0.347414136 -0.433689168 -0.342538472  0.194236102  0.753166806
 [21] -1.490395540 -1.061591063  0.115948301  0.122238292  0.012600256
 [26]  1.917545602  0.366278067  0.738799805  0.328381837  1.224323578
 [31]  0.520245466  0.694093054  1.414438109  1.279585906  0.378594294
 [36]  0.774978734 -1.082392630  0.008689405  1.071237232  0.063567511
 [41] -1.895042857 -0.739346060  2.013216964 -1.314931194 -0.283739396
 [46] -0.372752870 -0.412826842 -0.159312463 -0.127335663 -1.164570915
 [51]  0.425077343  0.454675201 -0.403478381 -0.504487918 -0.053677979
 [56]  0.739830381 -1.130567784 -0.069717679 -1.056333471 -0.544869060
 [61]  2.275542119  0.559483937  1.430060430 -1.115133306  0.796833579
 [66]  0.647732862  0.874890727  1.697912901 -0.141471235 -0.466059205
 [71]  0.665296622 -0.239843407  0.284195631  0.473626512  0.903573678
 [76] -0.892063358  0.569196401 -1.671882517  1.092067800 -0.925160786
 [81] -0.158013492  1.390376882 -0.680171199 -1.420587175 -0.548727495
 [86] -0.897782061  0.990272258 -0.888357406  0.129042914  0.225755491
 [91] -0.799569813  0.263117022  0.360612964  0.148651062  1.412463379
 [96] -0.907165816 -0.528513732 -1.307370272 -0.433195019 -0.714111720
> colMedians(tmp)
  [1]  0.665409686  1.088818726  1.243414626  0.803531133 -0.000698263
  [6] -0.834704881  0.761433472 -1.578063908  0.127059218  0.200173507
 [11] -0.364529983 -0.499905370  1.149904709 -0.329347352  1.103820277
 [16]  0.347414136 -0.433689168 -0.342538472  0.194236102  0.753166806
 [21] -1.490395540 -1.061591063  0.115948301  0.122238292  0.012600256
 [26]  1.917545602  0.366278067  0.738799805  0.328381837  1.224323578
 [31]  0.520245466  0.694093054  1.414438109  1.279585906  0.378594294
 [36]  0.774978734 -1.082392630  0.008689405  1.071237232  0.063567511
 [41] -1.895042857 -0.739346060  2.013216964 -1.314931194 -0.283739396
 [46] -0.372752870 -0.412826842 -0.159312463 -0.127335663 -1.164570915
 [51]  0.425077343  0.454675201 -0.403478381 -0.504487918 -0.053677979
 [56]  0.739830381 -1.130567784 -0.069717679 -1.056333471 -0.544869060
 [61]  2.275542119  0.559483937  1.430060430 -1.115133306  0.796833579
 [66]  0.647732862  0.874890727  1.697912901 -0.141471235 -0.466059205
 [71]  0.665296622 -0.239843407  0.284195631  0.473626512  0.903573678
 [76] -0.892063358  0.569196401 -1.671882517  1.092067800 -0.925160786
 [81] -0.158013492  1.390376882 -0.680171199 -1.420587175 -0.548727495
 [86] -0.897782061  0.990272258 -0.888357406  0.129042914  0.225755491
 [91] -0.799569813  0.263117022  0.360612964  0.148651062  1.412463379
 [96] -0.907165816 -0.528513732 -1.307370272 -0.433195019 -0.714111720
> colRanges(tmp)
          [,1]     [,2]     [,3]      [,4]         [,5]       [,6]      [,7]
[1,] 0.6654097 1.088819 1.243415 0.8035311 -0.000698263 -0.8347049 0.7614335
[2,] 0.6654097 1.088819 1.243415 0.8035311 -0.000698263 -0.8347049 0.7614335
          [,8]      [,9]     [,10]    [,11]      [,12]    [,13]      [,14]
[1,] -1.578064 0.1270592 0.2001735 -0.36453 -0.4999054 1.149905 -0.3293474
[2,] -1.578064 0.1270592 0.2001735 -0.36453 -0.4999054 1.149905 -0.3293474
       [,15]     [,16]      [,17]      [,18]     [,19]     [,20]     [,21]
[1,] 1.10382 0.3474141 -0.4336892 -0.3425385 0.1942361 0.7531668 -1.490396
[2,] 1.10382 0.3474141 -0.4336892 -0.3425385 0.1942361 0.7531668 -1.490396
         [,22]     [,23]     [,24]      [,25]    [,26]     [,27]     [,28]
[1,] -1.061591 0.1159483 0.1222383 0.01260026 1.917546 0.3662781 0.7387998
[2,] -1.061591 0.1159483 0.1222383 0.01260026 1.917546 0.3662781 0.7387998
         [,29]    [,30]     [,31]     [,32]    [,33]    [,34]     [,35]
[1,] 0.3283818 1.224324 0.5202455 0.6940931 1.414438 1.279586 0.3785943
[2,] 0.3283818 1.224324 0.5202455 0.6940931 1.414438 1.279586 0.3785943
         [,36]     [,37]       [,38]    [,39]      [,40]     [,41]      [,42]
[1,] 0.7749787 -1.082393 0.008689405 1.071237 0.06356751 -1.895043 -0.7393461
[2,] 0.7749787 -1.082393 0.008689405 1.071237 0.06356751 -1.895043 -0.7393461
        [,43]     [,44]      [,45]      [,46]      [,47]      [,48]      [,49]
[1,] 2.013217 -1.314931 -0.2837394 -0.3727529 -0.4128268 -0.1593125 -0.1273357
[2,] 2.013217 -1.314931 -0.2837394 -0.3727529 -0.4128268 -0.1593125 -0.1273357
         [,50]     [,51]     [,52]      [,53]      [,54]       [,55]     [,56]
[1,] -1.164571 0.4250773 0.4546752 -0.4034784 -0.5044879 -0.05367798 0.7398304
[2,] -1.164571 0.4250773 0.4546752 -0.4034784 -0.5044879 -0.05367798 0.7398304
         [,57]       [,58]     [,59]      [,60]    [,61]     [,62]   [,63]
[1,] -1.130568 -0.06971768 -1.056333 -0.5448691 2.275542 0.5594839 1.43006
[2,] -1.130568 -0.06971768 -1.056333 -0.5448691 2.275542 0.5594839 1.43006
         [,64]     [,65]     [,66]     [,67]    [,68]      [,69]      [,70]
[1,] -1.115133 0.7968336 0.6477329 0.8748907 1.697913 -0.1414712 -0.4660592
[2,] -1.115133 0.7968336 0.6477329 0.8748907 1.697913 -0.1414712 -0.4660592
         [,71]      [,72]     [,73]     [,74]     [,75]      [,76]     [,77]
[1,] 0.6652966 -0.2398434 0.2841956 0.4736265 0.9035737 -0.8920634 0.5691964
[2,] 0.6652966 -0.2398434 0.2841956 0.4736265 0.9035737 -0.8920634 0.5691964
         [,78]    [,79]      [,80]      [,81]    [,82]      [,83]     [,84]
[1,] -1.671883 1.092068 -0.9251608 -0.1580135 1.390377 -0.6801712 -1.420587
[2,] -1.671883 1.092068 -0.9251608 -0.1580135 1.390377 -0.6801712 -1.420587
          [,85]      [,86]     [,87]      [,88]     [,89]     [,90]      [,91]
[1,] -0.5487275 -0.8977821 0.9902723 -0.8883574 0.1290429 0.2257555 -0.7995698
[2,] -0.5487275 -0.8977821 0.9902723 -0.8883574 0.1290429 0.2257555 -0.7995698
        [,92]    [,93]     [,94]    [,95]      [,96]      [,97]    [,98]
[1,] 0.263117 0.360613 0.1486511 1.412463 -0.9071658 -0.5285137 -1.30737
[2,] 0.263117 0.360613 0.1486511 1.412463 -0.9071658 -0.5285137 -1.30737
         [,99]     [,100]
[1,] -0.433195 -0.7141117
[2,] -0.433195 -0.7141117
> 
> 
> Max(tmp2)
[1] 2.541246
> Min(tmp2)
[1] -2.491714
> mean(tmp2)
[1] -0.07907371
> Sum(tmp2)
[1] -7.907371
> Var(tmp2)
[1] 0.9581165
> 
> rowMeans(tmp2)
  [1]  1.3276968071  0.7325931512  0.6332712729  0.2142934478 -0.6848051904
  [6] -0.3891975042  0.8429504860 -0.4469166886  0.7673229104 -1.0678059504
 [11]  1.3592934791  1.2451184165 -0.7196041667 -1.9668858280 -0.7192854522
 [16]  0.2463333836  1.5792002790  0.0571641096  0.0870272316  0.0006907208
 [21] -0.0907584164 -1.8231009827 -1.1458898536 -0.3956657370  0.7791095852
 [26]  0.5882166416 -0.8163281458 -0.7408090528 -1.0810407751 -0.6118246135
 [31]  0.5827582438 -1.0353742236  0.1190108200  1.8952774486  1.7577921359
 [36]  0.3419766541 -0.8976439941 -0.8900584086  0.0806391717 -0.3315413066
 [41] -0.7509422219  0.9578158102  0.1093710702 -1.0522315107  1.2297803140
 [46]  0.7954943850 -0.6928404200 -0.5439315268 -0.6624256730  0.3356163838
 [51] -1.2305563093 -0.0314580401 -0.1848564581 -0.6606444921  0.7564586002
 [56]  0.7959005625  0.8830729520 -0.5182279712  0.7866802519 -1.0679240356
 [61]  0.5700616774 -0.3750058480 -0.7727692421 -1.3223371468 -0.9017329241
 [66] -1.3071271047  0.3965774700  0.8842827645  2.5412459558  1.5655747239
 [71]  0.3883494151 -0.6921516822 -0.5161117399 -1.5007057132 -1.8869385786
 [76]  0.6958368703 -2.4917138530 -1.1504002085 -1.7259915565 -0.4130994621
 [81]  1.6929190200 -0.0689432612 -0.3457437683 -1.7407470649  0.7135455511
 [86]  1.0910171873 -0.4651489294 -0.3325349319 -0.3920887390  0.1526577719
 [91] -0.2975524272  0.6565460502  0.3364345532  0.8328060581 -0.4462705786
 [96] -0.1453913199 -1.6198578387  1.5967374747 -0.0321620915  0.2832105873
> rowSums(tmp2)
  [1]  1.3276968071  0.7325931512  0.6332712729  0.2142934478 -0.6848051904
  [6] -0.3891975042  0.8429504860 -0.4469166886  0.7673229104 -1.0678059504
 [11]  1.3592934791  1.2451184165 -0.7196041667 -1.9668858280 -0.7192854522
 [16]  0.2463333836  1.5792002790  0.0571641096  0.0870272316  0.0006907208
 [21] -0.0907584164 -1.8231009827 -1.1458898536 -0.3956657370  0.7791095852
 [26]  0.5882166416 -0.8163281458 -0.7408090528 -1.0810407751 -0.6118246135
 [31]  0.5827582438 -1.0353742236  0.1190108200  1.8952774486  1.7577921359
 [36]  0.3419766541 -0.8976439941 -0.8900584086  0.0806391717 -0.3315413066
 [41] -0.7509422219  0.9578158102  0.1093710702 -1.0522315107  1.2297803140
 [46]  0.7954943850 -0.6928404200 -0.5439315268 -0.6624256730  0.3356163838
 [51] -1.2305563093 -0.0314580401 -0.1848564581 -0.6606444921  0.7564586002
 [56]  0.7959005625  0.8830729520 -0.5182279712  0.7866802519 -1.0679240356
 [61]  0.5700616774 -0.3750058480 -0.7727692421 -1.3223371468 -0.9017329241
 [66] -1.3071271047  0.3965774700  0.8842827645  2.5412459558  1.5655747239
 [71]  0.3883494151 -0.6921516822 -0.5161117399 -1.5007057132 -1.8869385786
 [76]  0.6958368703 -2.4917138530 -1.1504002085 -1.7259915565 -0.4130994621
 [81]  1.6929190200 -0.0689432612 -0.3457437683 -1.7407470649  0.7135455511
 [86]  1.0910171873 -0.4651489294 -0.3325349319 -0.3920887390  0.1526577719
 [91] -0.2975524272  0.6565460502  0.3364345532  0.8328060581 -0.4462705786
 [96] -0.1453913199 -1.6198578387  1.5967374747 -0.0321620915  0.2832105873
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.3276968071  0.7325931512  0.6332712729  0.2142934478 -0.6848051904
  [6] -0.3891975042  0.8429504860 -0.4469166886  0.7673229104 -1.0678059504
 [11]  1.3592934791  1.2451184165 -0.7196041667 -1.9668858280 -0.7192854522
 [16]  0.2463333836  1.5792002790  0.0571641096  0.0870272316  0.0006907208
 [21] -0.0907584164 -1.8231009827 -1.1458898536 -0.3956657370  0.7791095852
 [26]  0.5882166416 -0.8163281458 -0.7408090528 -1.0810407751 -0.6118246135
 [31]  0.5827582438 -1.0353742236  0.1190108200  1.8952774486  1.7577921359
 [36]  0.3419766541 -0.8976439941 -0.8900584086  0.0806391717 -0.3315413066
 [41] -0.7509422219  0.9578158102  0.1093710702 -1.0522315107  1.2297803140
 [46]  0.7954943850 -0.6928404200 -0.5439315268 -0.6624256730  0.3356163838
 [51] -1.2305563093 -0.0314580401 -0.1848564581 -0.6606444921  0.7564586002
 [56]  0.7959005625  0.8830729520 -0.5182279712  0.7866802519 -1.0679240356
 [61]  0.5700616774 -0.3750058480 -0.7727692421 -1.3223371468 -0.9017329241
 [66] -1.3071271047  0.3965774700  0.8842827645  2.5412459558  1.5655747239
 [71]  0.3883494151 -0.6921516822 -0.5161117399 -1.5007057132 -1.8869385786
 [76]  0.6958368703 -2.4917138530 -1.1504002085 -1.7259915565 -0.4130994621
 [81]  1.6929190200 -0.0689432612 -0.3457437683 -1.7407470649  0.7135455511
 [86]  1.0910171873 -0.4651489294 -0.3325349319 -0.3920887390  0.1526577719
 [91] -0.2975524272  0.6565460502  0.3364345532  0.8328060581 -0.4462705786
 [96] -0.1453913199 -1.6198578387  1.5967374747 -0.0321620915  0.2832105873
> rowMin(tmp2)
  [1]  1.3276968071  0.7325931512  0.6332712729  0.2142934478 -0.6848051904
  [6] -0.3891975042  0.8429504860 -0.4469166886  0.7673229104 -1.0678059504
 [11]  1.3592934791  1.2451184165 -0.7196041667 -1.9668858280 -0.7192854522
 [16]  0.2463333836  1.5792002790  0.0571641096  0.0870272316  0.0006907208
 [21] -0.0907584164 -1.8231009827 -1.1458898536 -0.3956657370  0.7791095852
 [26]  0.5882166416 -0.8163281458 -0.7408090528 -1.0810407751 -0.6118246135
 [31]  0.5827582438 -1.0353742236  0.1190108200  1.8952774486  1.7577921359
 [36]  0.3419766541 -0.8976439941 -0.8900584086  0.0806391717 -0.3315413066
 [41] -0.7509422219  0.9578158102  0.1093710702 -1.0522315107  1.2297803140
 [46]  0.7954943850 -0.6928404200 -0.5439315268 -0.6624256730  0.3356163838
 [51] -1.2305563093 -0.0314580401 -0.1848564581 -0.6606444921  0.7564586002
 [56]  0.7959005625  0.8830729520 -0.5182279712  0.7866802519 -1.0679240356
 [61]  0.5700616774 -0.3750058480 -0.7727692421 -1.3223371468 -0.9017329241
 [66] -1.3071271047  0.3965774700  0.8842827645  2.5412459558  1.5655747239
 [71]  0.3883494151 -0.6921516822 -0.5161117399 -1.5007057132 -1.8869385786
 [76]  0.6958368703 -2.4917138530 -1.1504002085 -1.7259915565 -0.4130994621
 [81]  1.6929190200 -0.0689432612 -0.3457437683 -1.7407470649  0.7135455511
 [86]  1.0910171873 -0.4651489294 -0.3325349319 -0.3920887390  0.1526577719
 [91] -0.2975524272  0.6565460502  0.3364345532  0.8328060581 -0.4462705786
 [96] -0.1453913199 -1.6198578387  1.5967374747 -0.0321620915  0.2832105873
> 
> colMeans(tmp2)
[1] -0.07907371
> colSums(tmp2)
[1] -7.907371
> colVars(tmp2)
[1] 0.9581165
> colSd(tmp2)
[1] 0.9788343
> colMax(tmp2)
[1] 2.541246
> colMin(tmp2)
[1] -2.491714
> colMedians(tmp2)
[1] -0.1180749
> colRanges(tmp2)
          [,1]
[1,] -2.491714
[2,]  2.541246
> 
> 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.6168058  3.2379150  0.4147943  1.1364270  3.7710869 -0.5334487
 [7] -2.7221456 -2.4483929 -5.2114147 -0.2669312
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1412722
[2,] -0.4569497
[3,]  0.5084700
[4,]  0.9326424
[5,]  1.3751035
> 
> rowApply(tmp,sum)
 [1] -0.6720636  1.2896652  3.0608145  5.0259343 -5.9014011  2.7950686
 [7] -4.0660875 -0.5788947 -1.0992430  0.1409031
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    8    2    9    3    7   10    7    8     8
 [2,]    8    4    9    2    9    6    9    1    7     7
 [3,]   10    9    8    7    4    8    2    4    1     1
 [4,]    5    3    1   10    8    2    8   10    6     9
 [5,]    9    6   10    5   10    9    4    2    9     5
 [6,]    2    1    7    4    5   10    5    5   10    10
 [7,]    7    7    5    1    6    3    1    9    5     4
 [8,]    3    5    6    3    7    5    3    8    2     2
 [9,]    4    2    4    6    1    1    7    6    4     3
[10,]    6   10    3    8    2    4    6    3    3     6
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.62120294  1.23900818  1.30880072  3.29588971 -2.81183984  0.95975203
 [7]  2.10500311 -1.39283587  1.71621478 -0.74652441  1.35923732 -5.21633165
[13] -2.06780302  0.37964232 -2.35235415  4.24987377 -0.02832606 -1.06076951
[19]  0.18721010 -1.44004067
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6714634
[2,]  0.3959087
[3,]  1.1470919
[4,]  1.4665479
[5,]  2.2831178
> 
> rowApply(tmp,sum)
[1] -0.4607034  8.6953951 -6.2494002 -4.3372231  5.6569414
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   14   19   20    2   18
[2,]    9   15   17    9    8
[3,]   19   16   16    4    6
[4,]    7   20   14   19    5
[5,]   12    3    6    7    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,]  0.3959087 -0.1415687  1.5119221 -0.4646957  0.09175462  1.2593571
[2,]  1.4665479  1.1129163  1.1442587  2.8287987 -0.58084008  1.1583084
[3,]  2.2831178  1.0206058  0.5991916  0.1629939 -0.96326623 -0.3947342
[4,] -1.6714634 -0.6093757 -1.4340291  1.3504467 -0.98754058 -0.4356912
[5,]  1.1470919 -0.1435695 -0.5125425 -0.5816539 -0.37194756 -0.6274881
           [,7]       [,8]        [,9]       [,10]        [,11]      [,12]
[1,]  1.7644765 -0.5621609 -0.02690491  0.32608725  0.495595304  0.6905872
[2,]  0.8020696 -0.3356033  0.27021218 -0.21189428 -0.009569136 -2.3487922
[3,]  0.1563253 -0.7139880 -0.47511272 -1.91939083  0.391358817 -2.0408633
[4,] -1.2044931 -0.2967900  1.33108212  1.14961491 -0.333213702 -2.0966780
[5,]  0.5866248  0.5157064  0.61693811 -0.09094147  0.815066039  0.5794146
          [,13]      [,14]      [,15]     [,16]      [,17]      [,18]
[1,] -0.4689154 -0.2170495 -0.1107813 0.4665692 -2.0833494 -0.9902881
[2,]  1.1060262  0.8527878  1.3445054 0.8365117 -0.4290929 -0.6858911
[3,] -2.3903067 -0.5514424 -2.0419012 0.1047393  1.9693039 -1.9033871
[4,]  0.8549334 -0.2187767 -0.9395796 1.1852570  1.2315961  1.5166141
[5,] -1.1695406  0.5141232 -0.6045974 1.6567966 -0.7167837  1.0021827
          [,19]      [,20]
[1,] -0.9430546 -1.4541928
[2,]  0.5891659 -0.2150307
[3,]  1.2077124 -0.7503561
[4,] -1.2887163 -1.4404200
[5,]  0.6221028  2.4199589
> 
> 
> 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.21-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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2     col3       col4       col5       col6       col7
row1 -0.595633 -2.822924 1.438448 -0.8959478 -0.7206594 -0.3246907 -0.3630965
          col8      col9    col10     col11    col12    col13      col14
row1 0.1022423 0.4206607 1.803908 -1.140079 3.247855 1.032721 -0.3355332
         col15       col16     col17     col18      col19       col20
row1 -1.409271 -0.03255137 0.2479349 -1.993956 -0.2872016 -0.04012773
> tmp[,"col10"]
          col10
row1  1.8039078
row2  0.8260606
row3 -0.2838616
row4 -0.6206940
row5  0.2264885
> tmp[c("row1","row5"),]
          col1       col2      col3       col4       col5       col6       col7
row1 -0.595633 -2.8229237 1.4384483 -0.8959478 -0.7206594 -0.3246907 -0.3630965
row5  2.147858 -0.9761865 0.4458536 -0.5079454  1.0096907  0.9717771  1.1281630
            col8       col9     col10      col11     col12      col13
row1  0.10224231  0.4206607 1.8039078 -1.1400793 3.2478551  1.0327214
row5 -0.06117962 -0.2697229 0.2264885  0.1390485 0.7881741 -0.5595042
          col14      col15       col16     col17      col18      col19
row1 -0.3355332 -1.4092711 -0.03255137 0.2479349 -1.9939564 -0.2872016
row5  0.2744887 -0.8658335  0.32821989 0.1093865 -0.8600193 -1.3359910
           col20
row1 -0.04012773
row5  0.61887782
> tmp[,c("col6","col20")]
           col6       col20
row1 -0.3246907 -0.04012773
row2  0.1386150  0.26867300
row3  1.6869615 -2.20553600
row4  0.3913631 -0.15095717
row5  0.9717771  0.61887782
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -0.3246907 -0.04012773
row5  0.9717771  0.61887782
> 
> 
> 
> 
> 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 50.33877 49.94175 49.67209 49.05941 51.26873 103.3879 50.71041 50.44422
         col9    col10   col11    col12    col13    col14    col15    col16
row1 48.01178 50.32394 51.8323 48.54287 50.76502 50.19174 49.98714 48.93452
        col17    col18    col19    col20
row1 49.58218 49.78585 49.01325 105.7196
> tmp[,"col10"]
        col10
row1 50.32394
row2 29.22985
row3 28.81794
row4 28.78185
row5 48.15722
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.33877 49.94175 49.67209 49.05941 51.26873 103.3879 50.71041 50.44422
row5 50.43724 47.86509 49.37746 49.20112 50.62047 106.2022 50.85002 50.87031
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.01178 50.32394 51.83230 48.54287 50.76502 50.19174 49.98714 48.93452
row5 50.57859 48.15722 48.05968 48.86029 49.24761 49.94368 49.72546 50.07436
        col17    col18    col19    col20
row1 49.58218 49.78585 49.01325 105.7196
row5 49.70568 49.17874 51.32522 104.2517
> tmp[,c("col6","col20")]
          col6     col20
row1 103.38795 105.71955
row2  75.01311  75.54315
row3  74.39198  75.65087
row4  74.90873  74.66695
row5 106.20220 104.25174
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.3879 105.7196
row5 106.2022 104.2517
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.3879 105.7196
row5 106.2022 104.2517
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.2341438
[2,] -0.3496644
[3,]  0.9721473
[4,] -1.1392370
[5,] -0.4848378
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.2359182 -1.71312941
[2,] -0.1042621 -0.44701697
[3,] -0.2174564 -0.71568922
[4,] -0.4279870 -0.08756406
[5,] -0.3476050  0.59564278
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.01748006  1.3184900
[2,] -0.83297959 -0.2345454
[3,]  0.31990903 -0.3191476
[4,]  0.20827343 -0.7725443
[5,]  0.44205309 -0.5674013
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.01748006
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.01748006
[2,] -0.83297959
> 
> 
> 
> 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  1.5677466 -1.2934071 -0.921498 0.2648417 -0.3037530  0.9510502  0.196709
row1 -0.8988078 -0.6171002 -1.095219 0.6593104 -0.4647689 -0.3889032 -1.911519
           [,8]       [,9]      [,10]      [,11]     [,12]      [,13]
row3  0.9477200 -0.7162858  1.1203391 -0.7963099 0.5037897  1.4107134
row1 -0.1999368  0.3000859 -0.3589654 -0.3166806 1.7026016 -0.7476292
           [,14]      [,15]    [,16]      [,17]       [,18]      [,19]
row3  1.01680055  1.0074009 2.109989  0.9405640 -0.49449955 -0.4083688
row1 -0.09879325 -0.1451556 1.444783 -0.8491345 -0.07004393  0.4033860
           [,20]
row3 -0.02693719
row1 -1.00684234
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]      [,5]       [,6]       [,7]
row2 1.193889 0.5535718 0.6716336 -1.261257 0.6487617 -0.3349613 -0.0304952
          [,8]      [,9]      [,10]
row2 0.7380569 0.3429206 -0.1128563
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]      [,5]      [,6]      [,7]
row5 -1.065589 0.4181477 -1.152956 -0.5888411 0.4725883 0.5030949 0.9870725
          [,8]     [,9]   [,10]     [,11]      [,12]     [,13]     [,14]
row5 -1.402847 1.139423 1.07175 -1.992128 -0.8086816 0.8076477 0.8712549
           [,15]      [,16]     [,17]       [,18]      [,19]     [,20]
row5 -0.01495701 -0.9644066 0.9585785 -0.08371851 -0.2512457 0.2070194
> 
> 
> 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: 0x581c45ddf5f0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a854bbd5da5"
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a853ff8f9b4"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a85575a7948"
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a853487118e"
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a8532f1dd4e"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a85147e821a"
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a854dc9d28f"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a85414cc339"
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a85320c1267"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a85c03cd2e" 
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a853b52ccd3"
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a852a56f8a7"
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a8521fb5d54"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a855c38ee05"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM262a85732d14f4"
> 
> 
> ### 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: 0x581c466ac360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x581c466ac360>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x581c466ac360>
> rowMedians(tmp)
  [1]  0.361043137 -0.287382758 -0.060189015  0.069037904  0.593791297
  [6] -0.322513320  0.143257462 -0.171233672 -0.248617968  0.065584708
 [11] -0.026910878 -0.380979005 -0.468569974 -0.429148086  0.125708355
 [16] -0.152472387  0.544307533 -0.408026294  0.249452640  0.134381273
 [21]  0.053360099  0.292772278 -0.232448997 -0.333319576 -0.478561494
 [26]  0.218028173  0.531845037  0.045560522  0.615930460 -0.432569801
 [31]  0.010280497  0.625883472 -0.286786348  0.385810093  0.141163308
 [36]  0.496904915  0.008778561 -0.080762196  0.593250750  0.178765079
 [41] -0.065174251  0.040691817 -0.621979323 -0.301395600  0.027057652
 [46] -0.235933985 -0.482315488  0.004052884  0.158289215  0.158306736
 [51] -0.203939637 -0.151374584  0.274437156 -0.175195964  0.374694302
 [56] -0.178268755  0.277997463 -0.072359712 -0.367048970  0.656596997
 [61] -0.188103337 -0.011363062 -0.166136521  0.097839368  0.152024779
 [66] -0.255439930 -0.574534443 -0.427100105 -0.051944078  0.097032678
 [71] -0.059956492 -0.303834704 -0.142836951  0.073197012  0.612136607
 [76] -0.028008430  0.087896806 -0.012314702  0.271221197 -0.581579842
 [81] -0.263685808  0.216257223  0.312253375  0.225440131 -0.221286553
 [86]  0.471356023 -0.137725087 -0.137632697  0.207135428  0.459324720
 [91]  0.020698259  0.295152592  0.280547992  0.358817433  0.011609056
 [96] -0.231712267  0.041611142 -0.150164740 -0.230222833  0.704652236
[101]  0.465794804 -0.291286318 -0.134436034 -0.208274851 -0.345023152
[106] -0.072436991 -0.389376276  0.049678406  0.502755123 -0.347099628
[111]  0.094952358  0.035982981 -0.768414867  0.040686660 -0.221412779
[116]  0.430672234 -0.162206038  0.456440460  0.402769231  0.110891808
[121]  0.179587129 -0.151993439 -0.100268058 -0.469501824  0.194532707
[126] -0.343659067 -0.185457247  0.276199261 -0.084972027  0.290612830
[131]  0.394254979 -0.134651883  0.122404663  0.154039288  0.799518139
[136] -0.158723303 -0.225595169  0.266856793  0.254398050 -0.301366838
[141] -0.071612676 -0.523138152  0.184500347 -0.136222809 -0.257761959
[146]  0.309499095 -0.156217265  0.170153326 -0.230990566 -0.101412335
[151]  0.154453605  0.337492974  0.024480627 -0.228649760 -0.020929614
[156]  0.281501284  0.008514483 -0.493995176  0.025284514  0.533506979
[161] -0.313350798  0.360938331  0.384686570  0.212703225  0.814529901
[166]  0.012041477 -0.284849005  0.195459980 -0.360112930 -0.085956799
[171]  0.250206804 -0.084213463 -0.551031534  0.083610620  0.102081681
[176] -0.471727978 -0.284954676  0.112836267  0.262920539 -0.425807613
[181]  0.276016646 -0.798504216 -0.138822572  0.400653944  0.306086579
[186] -0.422093513  0.176167678 -0.533927389  0.014055382  0.263981591
[191]  0.467324585 -0.140612174  0.016724640 -0.338489981  0.451517395
[196] -0.095994592  0.402330299  0.162503427 -0.176159851 -0.186769999
[201] -0.613060931  0.105876688 -0.462786095  0.546452253  0.244005756
[206] -0.019815307  0.264124425  0.194749531  0.196372544 -0.142612525
[211] -0.424702518  0.013041515  0.274180366 -0.268598963 -0.873311567
[216] -0.114153569 -0.110381382  0.248486142  0.191159717  0.061514130
[221] -0.133657182  0.382284046  0.500847871  0.234414729  0.131042735
[226]  0.467914109 -0.007377844 -0.046808133  0.238003545 -0.003305964
> 
> proc.time()
   user  system elapsed 
  1.309   1.509   2.806 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 (2025-06-13) -- "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: 0x5bbbd12b1ad0>
> .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: 0x5bbbd12b1ad0>
> .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: 0x5bbbd12b1ad0>
> .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: 0x5bbbd12b1ad0>
> 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: 0x5bbbd12a3a30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bbbd12a3a30>
> .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: 0x5bbbd12a3a30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bbbd12a3a30>
> .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: 0x5bbbd12a3a30>
> 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: 0x5bbbd006f870>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bbbd006f870>
> .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: 0x5bbbd006f870>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5bbbd006f870>
> .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: 0x5bbbd006f870>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5bbbd006f870>
> .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: 0x5bbbd006f870>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5bbbd006f870>
> .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: 0x5bbbd006f870>
> 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: 0x5bbbd04801a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5bbbd04801a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bbbd04801a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bbbd04801a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile262d05457e4ca6" "BufferedMatrixFile262d055b2e4efb"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile262d05457e4ca6" "BufferedMatrixFile262d055b2e4efb"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bbbd262a870>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bbbd262a870>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5bbbd262a870>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5bbbd262a870>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5bbbd262a870>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5bbbd262a870>
> .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: 0x5bbbd0a7eca0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5bbbd0a7eca0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5bbbd0a7eca0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5bbbd0a7eca0>
> 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: 0x5bbbd1231a20>
> .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: 0x5bbbd1231a20>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.244   0.051   0.283 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 (2025-06-13) -- "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.234   0.053   0.276 

Example timings