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

This page was generated on 2026-05-09 15:11 -0400 (Sat, 09 May 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.4 LTS)x86_644.6.0 RC (2026-04-17 r89917) -- "Because it was There" 4890
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 259/2374HostnameOS / ArchINSTALLBUILDCHECKBIOCCHECKBUILD BIN
BufferedMatrix 1.77.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-05-08 13:45 -0400 (Fri, 08 May 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 2d99771
git_last_commit_date: 2026-04-28 08:32:08 -0400 (Tue, 28 Apr 2026)
nebbiolo2Linux (Ubuntu 24.04.4 LTS) / x86_64  OK    OK    OK    ERRORS  UNNEEDED, same version is already published
See other builds for BufferedMatrix in R Universe.


CHECK results for BufferedMatrix on nebbiolo2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.77.0
Command: /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.77.0.tar.gz
StartedAt: 2026-05-08 21:52:50 -0400 (Fri, 08 May 2026)
EndedAt: 2026-05-08 21:53:14 -0400 (Fri, 08 May 2026)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-05-09 01:52:50 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.77.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.1) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.24-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.77.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-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.24-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.24-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.24-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.24-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.24-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.24-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.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.246   0.039   0.272 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.24-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 480233 25.7    1053308 56.3   637571 34.1
Vcells 887253  6.8    8388608 64.0  2083896 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] "Fri May  8 21:53:05 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  8 21:53:05 2026"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5c96b4647520>
> 
> 
> 
> 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] "Fri May  8 21:53:05 2026"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri May  8 21:53:05 2026"
> 
> ColMode(tmp2)
<pointer: 0x5c96b4647520>
> 
> 
> 
> ### 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.3215614  0.8220234  0.04966470 -0.1853398
[2,]   0.9157669 -0.6548107 -0.06884171 -0.8085489
[3,]   0.1763804 -0.2204784  0.36670048 -0.1505062
[4,]   0.7233769 -1.0514484 -1.19458136  2.1126644
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-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.3215614 0.8220234 0.04966470 0.1853398
[2,]   0.9157669 0.6548107 0.06884171 0.8085489
[3,]   0.1763804 0.2204784 0.36670048 0.1505062
[4,]   0.7233769 1.0514484 1.19458136 2.1126644
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-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.0160652 0.9066551 0.2228558 0.4305111
[2,]  0.9569571 0.8092037 0.2623770 0.8991935
[3,]  0.4199766 0.4695513 0.6055580 0.3879513
[4,]  0.8505156 1.0254016 1.0929691 1.4535007
> 
> 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.24-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.48221 34.88857 27.27822 29.49045
[2,]  35.48534 33.74685 27.69261 34.80048
[3,]  29.37615 29.91599 31.42228 29.03002
[4,]  34.22853 36.30546 37.12427 41.64767
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5c96b54328f0>
> exp(tmp5)
<pointer: 0x5c96b54328f0>
> log(tmp5,2)
<pointer: 0x5c96b54328f0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.3117
> Min(tmp5)
[1] 52.91672
> mean(tmp5)
[1] 71.81762
> Sum(tmp5)
[1] 14363.52
> Var(tmp5)
[1] 864.6173
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.47958 70.75030 67.19250 71.12310 70.07226 70.42343 69.05126 66.89823
 [9] 70.87553 71.30999
> rowSums(tmp5)
 [1] 1809.592 1415.006 1343.850 1422.462 1401.445 1408.469 1381.025 1337.965
 [9] 1417.511 1426.200
> rowVars(tmp5)
 [1] 8071.30401   76.08687   53.12614   55.08330   72.03447   93.62235
 [7]   46.23002   31.26110   79.30208   46.86741
> rowSd(tmp5)
 [1] 89.840436  8.722779  7.288768  7.421812  8.487312  9.675864  6.799266
 [8]  5.591163  8.905172  6.845978
> rowMax(tmp5)
 [1] 469.31168  85.77935  83.28911  86.68417  87.06476  92.98963  82.12845
 [8]  77.21652  88.72242  84.88749
> rowMin(tmp5)
 [1] 56.77605 57.47349 55.96097 55.40768 57.15100 52.91672 58.00339 57.18830
 [9] 55.06347 61.87567
> 
> colMeans(tmp5)
 [1] 107.42925  70.06018  67.96701  67.85846  66.28125  70.78239  70.66772
 [8]  74.48567  70.03689  69.21587  67.97222  70.30606  70.42534  70.70516
[15]  69.93343  73.59775  64.23826  70.21179  69.71194  74.46574
> colSums(tmp5)
 [1] 1074.2925  700.6018  679.6701  678.5846  662.8125  707.8239  706.6772
 [8]  744.8567  700.3689  692.1587  679.7222  703.0606  704.2534  707.0516
[15]  699.3343  735.9775  642.3826  702.1179  697.1194  744.6574
> colVars(tmp5)
 [1] 16187.53425    39.52999    89.97112   113.36738    89.60460    66.95455
 [7]    57.38628    74.49246    18.21074    54.19560    74.91419   109.54106
[13]   181.35177    69.70097    58.03039    55.44070    20.06962    71.67236
[19]    25.45518    48.75738
> colSd(tmp5)
 [1] 127.230241   6.287288   9.485311  10.647412   9.465971   8.182576
 [7]   7.575373   8.630902   4.267405   7.361766   8.655298  10.466186
[13]  13.466691   8.348711   7.617768   7.445851   4.479913   8.465953
[19]   5.045313   6.982648
> colMax(tmp5)
 [1] 469.31168  76.44400  81.45748  86.68417  82.12845  82.85400  81.66363
 [8]  88.72242  76.41505  78.21416  86.29438  92.98963  95.19383  84.13447
[15]  82.68907  83.28911  70.65797  85.86812  80.17364  86.13429
> colMin(tmp5)
 [1] 61.14260 61.65104 56.77605 57.04346 52.91672 59.40706 58.62017 63.49084
 [9] 62.78105 58.89951 55.06347 57.47349 58.00339 59.70832 57.15100 61.59233
[17] 55.40768 57.79697 64.17336 62.36187
> 
> 
> ### 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] 90.47958 70.75030 67.19250 71.12310       NA 70.42343 69.05126 66.89823
 [9] 70.87553 71.30999
> rowSums(tmp5)
 [1] 1809.592 1415.006 1343.850 1422.462       NA 1408.469 1381.025 1337.965
 [9] 1417.511 1426.200
> rowVars(tmp5)
 [1] 8071.30401   76.08687   53.12614   55.08330   71.45860   93.62235
 [7]   46.23002   31.26110   79.30208   46.86741
> rowSd(tmp5)
 [1] 89.840436  8.722779  7.288768  7.421812  8.453319  9.675864  6.799266
 [8]  5.591163  8.905172  6.845978
> rowMax(tmp5)
 [1] 469.31168  85.77935  83.28911  86.68417        NA  92.98963  82.12845
 [8]  77.21652  88.72242  84.88749
> rowMin(tmp5)
 [1] 56.77605 57.47349 55.96097 55.40768       NA 52.91672 58.00339 57.18830
 [9] 55.06347 61.87567
> 
> colMeans(tmp5)
 [1] 107.42925  70.06018  67.96701  67.85846  66.28125        NA  70.66772
 [8]  74.48567  70.03689  69.21587  67.97222  70.30606  70.42534  70.70516
[15]  69.93343  73.59775  64.23826  70.21179  69.71194  74.46574
> colSums(tmp5)
 [1] 1074.2925  700.6018  679.6701  678.5846  662.8125        NA  706.6772
 [8]  744.8567  700.3689  692.1587  679.7222  703.0606  704.2534  707.0516
[15]  699.3343  735.9775  642.3826  702.1179  697.1194  744.6574
> colVars(tmp5)
 [1] 16187.53425    39.52999    89.97112   113.36738    89.60460          NA
 [7]    57.38628    74.49246    18.21074    54.19560    74.91419   109.54106
[13]   181.35177    69.70097    58.03039    55.44070    20.06962    71.67236
[19]    25.45518    48.75738
> colSd(tmp5)
 [1] 127.230241   6.287288   9.485311  10.647412   9.465971         NA
 [7]   7.575373   8.630902   4.267405   7.361766   8.655298  10.466186
[13]  13.466691   8.348711   7.617768   7.445851   4.479913   8.465953
[19]   5.045313   6.982648
> colMax(tmp5)
 [1] 469.31168  76.44400  81.45748  86.68417  82.12845        NA  81.66363
 [8]  88.72242  76.41505  78.21416  86.29438  92.98963  95.19383  84.13447
[15]  82.68907  83.28911  70.65797  85.86812  80.17364  86.13429
> colMin(tmp5)
 [1] 61.14260 61.65104 56.77605 57.04346 52.91672       NA 58.62017 63.49084
 [9] 62.78105 58.89951 55.06347 57.47349 58.00339 59.70832 57.15100 61.59233
[17] 55.40768 57.79697 64.17336 62.36187
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.3117
> Min(tmp5,na.rm=TRUE)
[1] 52.91672
> mean(tmp5,na.rm=TRUE)
[1] 71.78193
> Sum(tmp5,na.rm=TRUE)
[1] 14284.6
> Var(tmp5,na.rm=TRUE)
[1] 868.728
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.47958 70.75030 67.19250 71.12310 69.60660 70.42343 69.05126 66.89823
 [9] 70.87553 71.30999
> rowSums(tmp5,na.rm=TRUE)
 [1] 1809.592 1415.006 1343.850 1422.462 1322.525 1408.469 1381.025 1337.965
 [9] 1417.511 1426.200
> rowVars(tmp5,na.rm=TRUE)
 [1] 8071.30401   76.08687   53.12614   55.08330   71.45860   93.62235
 [7]   46.23002   31.26110   79.30208   46.86741
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.840436  8.722779  7.288768  7.421812  8.453319  9.675864  6.799266
 [8]  5.591163  8.905172  6.845978
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.31168  85.77935  83.28911  86.68417  87.06476  92.98963  82.12845
 [8]  77.21652  88.72242  84.88749
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.77605 57.47349 55.96097 55.40768 57.15100 52.91672 58.00339 57.18830
 [9] 55.06347 61.87567
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.42925  70.06018  67.96701  67.85846  66.28125  69.87822  70.66772
 [8]  74.48567  70.03689  69.21587  67.97222  70.30606  70.42534  70.70516
[15]  69.93343  73.59775  64.23826  70.21179  69.71194  74.46574
> colSums(tmp5,na.rm=TRUE)
 [1] 1074.2925  700.6018  679.6701  678.5846  662.8125  628.9040  706.6772
 [8]  744.8567  700.3689  692.1587  679.7222  703.0606  704.2534  707.0516
[15]  699.3343  735.9775  642.3826  702.1179  697.1194  744.6574
> colVars(tmp5,na.rm=TRUE)
 [1] 16187.53425    39.52999    89.97112   113.36738    89.60460    66.12685
 [7]    57.38628    74.49246    18.21074    54.19560    74.91419   109.54106
[13]   181.35177    69.70097    58.03039    55.44070    20.06962    71.67236
[19]    25.45518    48.75738
> colSd(tmp5,na.rm=TRUE)
 [1] 127.230241   6.287288   9.485311  10.647412   9.465971   8.131842
 [7]   7.575373   8.630902   4.267405   7.361766   8.655298  10.466186
[13]  13.466691   8.348711   7.617768   7.445851   4.479913   8.465953
[19]   5.045313   6.982648
> colMax(tmp5,na.rm=TRUE)
 [1] 469.31168  76.44400  81.45748  86.68417  82.12845  82.85400  81.66363
 [8]  88.72242  76.41505  78.21416  86.29438  92.98963  95.19383  84.13447
[15]  82.68907  83.28911  70.65797  85.86812  80.17364  86.13429
> colMin(tmp5,na.rm=TRUE)
 [1] 61.14260 61.65104 56.77605 57.04346 52.91672 59.40706 58.62017 63.49084
 [9] 62.78105 58.89951 55.06347 57.47349 58.00339 59.70832 57.15100 61.59233
[17] 55.40768 57.79697 64.17336 62.36187
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.47958 70.75030 67.19250 71.12310      NaN 70.42343 69.05126 66.89823
 [9] 70.87553 71.30999
> rowSums(tmp5,na.rm=TRUE)
 [1] 1809.592 1415.006 1343.850 1422.462    0.000 1408.469 1381.025 1337.965
 [9] 1417.511 1426.200
> rowVars(tmp5,na.rm=TRUE)
 [1] 8071.30401   76.08687   53.12614   55.08330         NA   93.62235
 [7]   46.23002   31.26110   79.30208   46.86741
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.840436  8.722779  7.288768  7.421812        NA  9.675864  6.799266
 [8]  5.591163  8.905172  6.845978
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.31168  85.77935  83.28911  86.68417        NA  92.98963  82.12845
 [8]  77.21652  88.72242  84.88749
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.77605 57.47349 55.96097 55.40768       NA 52.91672 58.00339 57.18830
 [9] 55.06347 61.87567
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.95227  69.36425  68.90509  68.34999  66.84334       NaN  71.02923
 [8]  73.87164  70.18000  68.21606  68.07763  69.37382  68.57652  71.44699
[15]  71.35370  74.93168  64.08327  69.63941  70.32734  73.83048
> colSums(tmp5,na.rm=TRUE)
 [1] 1007.5704  624.2782  620.1458  615.1499  601.5900    0.0000  639.2631
 [8]  664.8448  631.6200  613.9446  612.6987  624.3644  617.1886  643.0229
[15]  642.1833  674.3851  576.7494  626.7547  632.9460  664.4743
> colVars(tmp5,na.rm=TRUE)
 [1] 17980.82717    39.02256    91.31755   124.82029    97.25081          NA
 [7]    63.08926    79.56241    20.25667    49.72433    84.15345   113.45669
[13]   165.56652    72.22257    42.59106    42.35271    22.30807    76.94574
[19]    24.37654    50.31203
> colSd(tmp5,na.rm=TRUE)
 [1] 134.092607   6.246804   9.556022  11.172300   9.861582         NA
 [7]   7.942875   8.919777   4.500741   7.051548   9.173519  10.651605
[13]  12.867265   8.498386   6.526183   6.507896   4.723142   8.771872
[19]   4.937260   7.093097
> colMax(tmp5,na.rm=TRUE)
 [1] 469.31168  76.44400  81.45748  86.68417  82.12845      -Inf  81.66363
 [8]  88.72242  76.41505  77.12586  86.29438  92.98963  95.19383  84.13447
[15]  82.68907  83.28911  70.65797  85.86812  80.17364  86.13429
> colMin(tmp5,na.rm=TRUE)
 [1] 61.14260 61.65104 56.77605 57.04346 52.91672      Inf 58.62017 63.49084
 [9] 62.78105 58.89951 55.06347 57.47349 58.00339 59.70832 62.33112 66.37427
[17] 55.40768 57.79697 64.31375 62.36187
> 
> 
> 
> 
> 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] 441.84683 415.42486 177.47564 186.71324 414.79441 240.92336 198.12310
 [8]  72.25563 115.46247 186.94250
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 441.84683 415.42486 177.47564 186.71324 414.79441 240.92336 198.12310
 [8]  72.25563 115.46247 186.94250
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.136868e-13  5.684342e-14 -2.842171e-14 -1.136868e-13  2.842171e-14
 [6] -5.684342e-14  1.136868e-13  5.684342e-14  1.421085e-13  0.000000e+00
[11] -1.989520e-13  2.842171e-14 -8.526513e-14  5.684342e-14 -5.684342e-14
[16]  0.000000e+00 -5.684342e-14  5.684342e-14  1.136868e-13  3.552714e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
8   6 
9   16 
10   16 
7   2 
1   11 
5   15 
3   11 
8   2 
2   1 
1   4 
1   13 
1   19 
1   20 
8   7 
2   11 
6   14 
2   10 
7   11 
7   6 
4   13 
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] 3.447499
> Min(tmp)
[1] -2.135993
> mean(tmp)
[1] -0.1161473
> Sum(tmp)
[1] -11.61473
> Var(tmp)
[1] 1.108369
> 
> rowMeans(tmp)
[1] -0.1161473
> rowSums(tmp)
[1] -11.61473
> rowVars(tmp)
[1] 1.108369
> rowSd(tmp)
[1] 1.052791
> rowMax(tmp)
[1] 3.447499
> rowMin(tmp)
[1] -2.135993
> 
> colMeans(tmp)
  [1] -1.43005392 -1.06254889 -1.33908377  0.67412609  0.86042477  0.20530428
  [7] -0.12613618  0.18232360 -0.59158429 -1.37738792 -0.47667344  0.21062821
 [13] -1.07970948 -0.76752848 -1.02612292 -0.85402295 -0.37255026 -0.70144278
 [19] -0.45570336 -1.32050719 -0.48455264  0.98794220  2.13578438  0.35351042
 [25]  0.78857958  0.06953550 -1.16836335 -0.80259072  3.44749872 -0.73836080
 [31]  0.60483082  0.75043598  2.41863291 -0.72627038  0.08194523 -0.30694708
 [37] -0.53175787  0.70691792 -0.28716086 -0.14643420  0.45323509  2.19516040
 [43] -0.74101643 -1.36870443 -0.39506221 -0.05122619 -1.62330585  0.84494821
 [49]  0.60220952 -0.68531037  1.44626354  1.18244260 -1.99020087 -2.13599301
 [55] -0.33312725  0.23014343 -0.30548586 -0.62826055  0.63085981 -1.07926364
 [61] -0.17234820  0.82628398 -0.64334720  0.87199185  1.45010879 -0.11656597
 [67]  0.23611047 -0.40289121  1.02185662  0.44080198 -0.98394440 -0.35536935
 [73] -1.04860402  0.47313115 -1.98012096  0.40833997 -0.73087657  0.87533633
 [79] -0.06745004 -0.51703977  0.82916982  1.94841476 -1.07821685  0.20579781
 [85] -1.13496423 -0.12237210 -1.25933684  0.81421018 -0.39754751 -1.12308516
 [91] -0.95328410  1.91065282  0.31874195 -1.99279247 -1.50632767  0.72551098
 [97] -1.95772320  0.85986552 -0.51347947  0.67339457
> colSums(tmp)
  [1] -1.43005392 -1.06254889 -1.33908377  0.67412609  0.86042477  0.20530428
  [7] -0.12613618  0.18232360 -0.59158429 -1.37738792 -0.47667344  0.21062821
 [13] -1.07970948 -0.76752848 -1.02612292 -0.85402295 -0.37255026 -0.70144278
 [19] -0.45570336 -1.32050719 -0.48455264  0.98794220  2.13578438  0.35351042
 [25]  0.78857958  0.06953550 -1.16836335 -0.80259072  3.44749872 -0.73836080
 [31]  0.60483082  0.75043598  2.41863291 -0.72627038  0.08194523 -0.30694708
 [37] -0.53175787  0.70691792 -0.28716086 -0.14643420  0.45323509  2.19516040
 [43] -0.74101643 -1.36870443 -0.39506221 -0.05122619 -1.62330585  0.84494821
 [49]  0.60220952 -0.68531037  1.44626354  1.18244260 -1.99020087 -2.13599301
 [55] -0.33312725  0.23014343 -0.30548586 -0.62826055  0.63085981 -1.07926364
 [61] -0.17234820  0.82628398 -0.64334720  0.87199185  1.45010879 -0.11656597
 [67]  0.23611047 -0.40289121  1.02185662  0.44080198 -0.98394440 -0.35536935
 [73] -1.04860402  0.47313115 -1.98012096  0.40833997 -0.73087657  0.87533633
 [79] -0.06745004 -0.51703977  0.82916982  1.94841476 -1.07821685  0.20579781
 [85] -1.13496423 -0.12237210 -1.25933684  0.81421018 -0.39754751 -1.12308516
 [91] -0.95328410  1.91065282  0.31874195 -1.99279247 -1.50632767  0.72551098
 [97] -1.95772320  0.85986552 -0.51347947  0.67339457
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.43005392 -1.06254889 -1.33908377  0.67412609  0.86042477  0.20530428
  [7] -0.12613618  0.18232360 -0.59158429 -1.37738792 -0.47667344  0.21062821
 [13] -1.07970948 -0.76752848 -1.02612292 -0.85402295 -0.37255026 -0.70144278
 [19] -0.45570336 -1.32050719 -0.48455264  0.98794220  2.13578438  0.35351042
 [25]  0.78857958  0.06953550 -1.16836335 -0.80259072  3.44749872 -0.73836080
 [31]  0.60483082  0.75043598  2.41863291 -0.72627038  0.08194523 -0.30694708
 [37] -0.53175787  0.70691792 -0.28716086 -0.14643420  0.45323509  2.19516040
 [43] -0.74101643 -1.36870443 -0.39506221 -0.05122619 -1.62330585  0.84494821
 [49]  0.60220952 -0.68531037  1.44626354  1.18244260 -1.99020087 -2.13599301
 [55] -0.33312725  0.23014343 -0.30548586 -0.62826055  0.63085981 -1.07926364
 [61] -0.17234820  0.82628398 -0.64334720  0.87199185  1.45010879 -0.11656597
 [67]  0.23611047 -0.40289121  1.02185662  0.44080198 -0.98394440 -0.35536935
 [73] -1.04860402  0.47313115 -1.98012096  0.40833997 -0.73087657  0.87533633
 [79] -0.06745004 -0.51703977  0.82916982  1.94841476 -1.07821685  0.20579781
 [85] -1.13496423 -0.12237210 -1.25933684  0.81421018 -0.39754751 -1.12308516
 [91] -0.95328410  1.91065282  0.31874195 -1.99279247 -1.50632767  0.72551098
 [97] -1.95772320  0.85986552 -0.51347947  0.67339457
> colMin(tmp)
  [1] -1.43005392 -1.06254889 -1.33908377  0.67412609  0.86042477  0.20530428
  [7] -0.12613618  0.18232360 -0.59158429 -1.37738792 -0.47667344  0.21062821
 [13] -1.07970948 -0.76752848 -1.02612292 -0.85402295 -0.37255026 -0.70144278
 [19] -0.45570336 -1.32050719 -0.48455264  0.98794220  2.13578438  0.35351042
 [25]  0.78857958  0.06953550 -1.16836335 -0.80259072  3.44749872 -0.73836080
 [31]  0.60483082  0.75043598  2.41863291 -0.72627038  0.08194523 -0.30694708
 [37] -0.53175787  0.70691792 -0.28716086 -0.14643420  0.45323509  2.19516040
 [43] -0.74101643 -1.36870443 -0.39506221 -0.05122619 -1.62330585  0.84494821
 [49]  0.60220952 -0.68531037  1.44626354  1.18244260 -1.99020087 -2.13599301
 [55] -0.33312725  0.23014343 -0.30548586 -0.62826055  0.63085981 -1.07926364
 [61] -0.17234820  0.82628398 -0.64334720  0.87199185  1.45010879 -0.11656597
 [67]  0.23611047 -0.40289121  1.02185662  0.44080198 -0.98394440 -0.35536935
 [73] -1.04860402  0.47313115 -1.98012096  0.40833997 -0.73087657  0.87533633
 [79] -0.06745004 -0.51703977  0.82916982  1.94841476 -1.07821685  0.20579781
 [85] -1.13496423 -0.12237210 -1.25933684  0.81421018 -0.39754751 -1.12308516
 [91] -0.95328410  1.91065282  0.31874195 -1.99279247 -1.50632767  0.72551098
 [97] -1.95772320  0.85986552 -0.51347947  0.67339457
> colMedians(tmp)
  [1] -1.43005392 -1.06254889 -1.33908377  0.67412609  0.86042477  0.20530428
  [7] -0.12613618  0.18232360 -0.59158429 -1.37738792 -0.47667344  0.21062821
 [13] -1.07970948 -0.76752848 -1.02612292 -0.85402295 -0.37255026 -0.70144278
 [19] -0.45570336 -1.32050719 -0.48455264  0.98794220  2.13578438  0.35351042
 [25]  0.78857958  0.06953550 -1.16836335 -0.80259072  3.44749872 -0.73836080
 [31]  0.60483082  0.75043598  2.41863291 -0.72627038  0.08194523 -0.30694708
 [37] -0.53175787  0.70691792 -0.28716086 -0.14643420  0.45323509  2.19516040
 [43] -0.74101643 -1.36870443 -0.39506221 -0.05122619 -1.62330585  0.84494821
 [49]  0.60220952 -0.68531037  1.44626354  1.18244260 -1.99020087 -2.13599301
 [55] -0.33312725  0.23014343 -0.30548586 -0.62826055  0.63085981 -1.07926364
 [61] -0.17234820  0.82628398 -0.64334720  0.87199185  1.45010879 -0.11656597
 [67]  0.23611047 -0.40289121  1.02185662  0.44080198 -0.98394440 -0.35536935
 [73] -1.04860402  0.47313115 -1.98012096  0.40833997 -0.73087657  0.87533633
 [79] -0.06745004 -0.51703977  0.82916982  1.94841476 -1.07821685  0.20579781
 [85] -1.13496423 -0.12237210 -1.25933684  0.81421018 -0.39754751 -1.12308516
 [91] -0.95328410  1.91065282  0.31874195 -1.99279247 -1.50632767  0.72551098
 [97] -1.95772320  0.85986552 -0.51347947  0.67339457
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
[1,] -1.430054 -1.062549 -1.339084 0.6741261 0.8604248 0.2053043 -0.1261362
[2,] -1.430054 -1.062549 -1.339084 0.6741261 0.8604248 0.2053043 -0.1261362
          [,8]       [,9]     [,10]      [,11]     [,12]     [,13]      [,14]
[1,] 0.1823236 -0.5915843 -1.377388 -0.4766734 0.2106282 -1.079709 -0.7675285
[2,] 0.1823236 -0.5915843 -1.377388 -0.4766734 0.2106282 -1.079709 -0.7675285
         [,15]     [,16]      [,17]      [,18]      [,19]     [,20]      [,21]
[1,] -1.026123 -0.854023 -0.3725503 -0.7014428 -0.4557034 -1.320507 -0.4845526
[2,] -1.026123 -0.854023 -0.3725503 -0.7014428 -0.4557034 -1.320507 -0.4845526
         [,22]    [,23]     [,24]     [,25]     [,26]     [,27]      [,28]
[1,] 0.9879422 2.135784 0.3535104 0.7885796 0.0695355 -1.168363 -0.8025907
[2,] 0.9879422 2.135784 0.3535104 0.7885796 0.0695355 -1.168363 -0.8025907
        [,29]      [,30]     [,31]    [,32]    [,33]      [,34]      [,35]
[1,] 3.447499 -0.7383608 0.6048308 0.750436 2.418633 -0.7262704 0.08194523
[2,] 3.447499 -0.7383608 0.6048308 0.750436 2.418633 -0.7262704 0.08194523
          [,36]      [,37]     [,38]      [,39]      [,40]     [,41]   [,42]
[1,] -0.3069471 -0.5317579 0.7069179 -0.2871609 -0.1464342 0.4532351 2.19516
[2,] -0.3069471 -0.5317579 0.7069179 -0.2871609 -0.1464342 0.4532351 2.19516
          [,43]     [,44]      [,45]       [,46]     [,47]     [,48]     [,49]
[1,] -0.7410164 -1.368704 -0.3950622 -0.05122619 -1.623306 0.8449482 0.6022095
[2,] -0.7410164 -1.368704 -0.3950622 -0.05122619 -1.623306 0.8449482 0.6022095
          [,50]    [,51]    [,52]     [,53]     [,54]      [,55]     [,56]
[1,] -0.6853104 1.446264 1.182443 -1.990201 -2.135993 -0.3331272 0.2301434
[2,] -0.6853104 1.446264 1.182443 -1.990201 -2.135993 -0.3331272 0.2301434
          [,57]      [,58]     [,59]     [,60]      [,61]    [,62]      [,63]
[1,] -0.3054859 -0.6282606 0.6308598 -1.079264 -0.1723482 0.826284 -0.6433472
[2,] -0.3054859 -0.6282606 0.6308598 -1.079264 -0.1723482 0.826284 -0.6433472
         [,64]    [,65]     [,66]     [,67]      [,68]    [,69]    [,70]
[1,] 0.8719918 1.450109 -0.116566 0.2361105 -0.4028912 1.021857 0.440802
[2,] 0.8719918 1.450109 -0.116566 0.2361105 -0.4028912 1.021857 0.440802
          [,71]      [,72]     [,73]     [,74]     [,75]   [,76]      [,77]
[1,] -0.9839444 -0.3553694 -1.048604 0.4731311 -1.980121 0.40834 -0.7308766
[2,] -0.9839444 -0.3553694 -1.048604 0.4731311 -1.980121 0.40834 -0.7308766
         [,78]       [,79]      [,80]     [,81]    [,82]     [,83]     [,84]
[1,] 0.8753363 -0.06745004 -0.5170398 0.8291698 1.948415 -1.078217 0.2057978
[2,] 0.8753363 -0.06745004 -0.5170398 0.8291698 1.948415 -1.078217 0.2057978
         [,85]      [,86]     [,87]     [,88]      [,89]     [,90]      [,91]
[1,] -1.134964 -0.1223721 -1.259337 0.8142102 -0.3975475 -1.123085 -0.9532841
[2,] -1.134964 -0.1223721 -1.259337 0.8142102 -0.3975475 -1.123085 -0.9532841
        [,92]    [,93]     [,94]     [,95]    [,96]     [,97]     [,98]
[1,] 1.910653 0.318742 -1.992792 -1.506328 0.725511 -1.957723 0.8598655
[2,] 1.910653 0.318742 -1.992792 -1.506328 0.725511 -1.957723 0.8598655
          [,99]    [,100]
[1,] -0.5134795 0.6733946
[2,] -0.5134795 0.6733946
> 
> 
> Max(tmp2)
[1] 2.117983
> Min(tmp2)
[1] -3.56878
> mean(tmp2)
[1] -0.1044022
> Sum(tmp2)
[1] -10.44022
> Var(tmp2)
[1] 0.950732
> 
> rowMeans(tmp2)
  [1] -1.700995e-01 -1.397626e+00  7.983791e-01 -3.908791e-01 -1.510049e+00
  [6] -8.915340e-01  7.149807e-01  4.222027e-01 -1.768552e-01 -1.897894e-02
 [11] -6.955095e-01 -1.784935e+00  1.623653e+00 -1.418964e+00  7.201805e-01
 [16]  3.965414e-01 -1.266830e+00  7.733708e-01  1.579746e+00  6.544821e-01
 [21] -5.833932e-01  1.974495e+00  1.081543e+00  7.828448e-01  5.989989e-02
 [26]  2.855754e-01 -4.734362e-01  9.750865e-01 -9.732691e-01  2.859960e-01
 [31] -2.127845e-01 -2.266339e-01  4.421499e-01 -4.077315e-01 -8.915807e-02
 [36] -8.235276e-01 -3.315506e-01  2.117983e+00  6.379205e-01 -1.203581e+00
 [41] -9.798754e-01 -9.303492e-01  6.595000e-01 -3.907162e-01  6.354305e-01
 [46]  1.527187e+00  2.806945e-01  5.860732e-01  3.702054e-01 -3.341883e-01
 [51]  4.804779e-01 -3.948805e-01 -7.741939e-01  8.443188e-01  2.953133e-01
 [56] -2.142959e-02 -2.453386e-01 -1.387181e+00  1.212000e+00 -3.492982e-01
 [61] -1.489229e+00 -1.669160e+00 -1.088342e-01  1.369291e+00  5.079356e-03
 [66] -1.673806e+00 -8.597320e-01 -9.958964e-01 -6.249871e-01 -4.521293e-01
 [71]  9.600009e-01 -3.568780e+00 -4.332945e-01 -2.973140e-01 -1.767601e+00
 [76]  8.249182e-01  1.674598e-01 -6.790238e-01 -9.167846e-01 -1.208187e+00
 [81]  9.024156e-05  9.379851e-01 -8.512729e-01 -1.982568e-01 -1.891544e+00
 [86]  1.979279e-01  1.173015e+00 -1.601507e-01  6.616128e-01  4.762449e-01
 [91] -5.536731e-01 -3.537824e-01  1.127651e+00 -1.111129e+00  1.812459e-01
 [96] -1.514821e+00  3.735870e-01  1.061909e+00  1.012024e+00  4.567852e-02
> rowSums(tmp2)
  [1] -1.700995e-01 -1.397626e+00  7.983791e-01 -3.908791e-01 -1.510049e+00
  [6] -8.915340e-01  7.149807e-01  4.222027e-01 -1.768552e-01 -1.897894e-02
 [11] -6.955095e-01 -1.784935e+00  1.623653e+00 -1.418964e+00  7.201805e-01
 [16]  3.965414e-01 -1.266830e+00  7.733708e-01  1.579746e+00  6.544821e-01
 [21] -5.833932e-01  1.974495e+00  1.081543e+00  7.828448e-01  5.989989e-02
 [26]  2.855754e-01 -4.734362e-01  9.750865e-01 -9.732691e-01  2.859960e-01
 [31] -2.127845e-01 -2.266339e-01  4.421499e-01 -4.077315e-01 -8.915807e-02
 [36] -8.235276e-01 -3.315506e-01  2.117983e+00  6.379205e-01 -1.203581e+00
 [41] -9.798754e-01 -9.303492e-01  6.595000e-01 -3.907162e-01  6.354305e-01
 [46]  1.527187e+00  2.806945e-01  5.860732e-01  3.702054e-01 -3.341883e-01
 [51]  4.804779e-01 -3.948805e-01 -7.741939e-01  8.443188e-01  2.953133e-01
 [56] -2.142959e-02 -2.453386e-01 -1.387181e+00  1.212000e+00 -3.492982e-01
 [61] -1.489229e+00 -1.669160e+00 -1.088342e-01  1.369291e+00  5.079356e-03
 [66] -1.673806e+00 -8.597320e-01 -9.958964e-01 -6.249871e-01 -4.521293e-01
 [71]  9.600009e-01 -3.568780e+00 -4.332945e-01 -2.973140e-01 -1.767601e+00
 [76]  8.249182e-01  1.674598e-01 -6.790238e-01 -9.167846e-01 -1.208187e+00
 [81]  9.024156e-05  9.379851e-01 -8.512729e-01 -1.982568e-01 -1.891544e+00
 [86]  1.979279e-01  1.173015e+00 -1.601507e-01  6.616128e-01  4.762449e-01
 [91] -5.536731e-01 -3.537824e-01  1.127651e+00 -1.111129e+00  1.812459e-01
 [96] -1.514821e+00  3.735870e-01  1.061909e+00  1.012024e+00  4.567852e-02
> 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.700995e-01 -1.397626e+00  7.983791e-01 -3.908791e-01 -1.510049e+00
  [6] -8.915340e-01  7.149807e-01  4.222027e-01 -1.768552e-01 -1.897894e-02
 [11] -6.955095e-01 -1.784935e+00  1.623653e+00 -1.418964e+00  7.201805e-01
 [16]  3.965414e-01 -1.266830e+00  7.733708e-01  1.579746e+00  6.544821e-01
 [21] -5.833932e-01  1.974495e+00  1.081543e+00  7.828448e-01  5.989989e-02
 [26]  2.855754e-01 -4.734362e-01  9.750865e-01 -9.732691e-01  2.859960e-01
 [31] -2.127845e-01 -2.266339e-01  4.421499e-01 -4.077315e-01 -8.915807e-02
 [36] -8.235276e-01 -3.315506e-01  2.117983e+00  6.379205e-01 -1.203581e+00
 [41] -9.798754e-01 -9.303492e-01  6.595000e-01 -3.907162e-01  6.354305e-01
 [46]  1.527187e+00  2.806945e-01  5.860732e-01  3.702054e-01 -3.341883e-01
 [51]  4.804779e-01 -3.948805e-01 -7.741939e-01  8.443188e-01  2.953133e-01
 [56] -2.142959e-02 -2.453386e-01 -1.387181e+00  1.212000e+00 -3.492982e-01
 [61] -1.489229e+00 -1.669160e+00 -1.088342e-01  1.369291e+00  5.079356e-03
 [66] -1.673806e+00 -8.597320e-01 -9.958964e-01 -6.249871e-01 -4.521293e-01
 [71]  9.600009e-01 -3.568780e+00 -4.332945e-01 -2.973140e-01 -1.767601e+00
 [76]  8.249182e-01  1.674598e-01 -6.790238e-01 -9.167846e-01 -1.208187e+00
 [81]  9.024156e-05  9.379851e-01 -8.512729e-01 -1.982568e-01 -1.891544e+00
 [86]  1.979279e-01  1.173015e+00 -1.601507e-01  6.616128e-01  4.762449e-01
 [91] -5.536731e-01 -3.537824e-01  1.127651e+00 -1.111129e+00  1.812459e-01
 [96] -1.514821e+00  3.735870e-01  1.061909e+00  1.012024e+00  4.567852e-02
> rowMin(tmp2)
  [1] -1.700995e-01 -1.397626e+00  7.983791e-01 -3.908791e-01 -1.510049e+00
  [6] -8.915340e-01  7.149807e-01  4.222027e-01 -1.768552e-01 -1.897894e-02
 [11] -6.955095e-01 -1.784935e+00  1.623653e+00 -1.418964e+00  7.201805e-01
 [16]  3.965414e-01 -1.266830e+00  7.733708e-01  1.579746e+00  6.544821e-01
 [21] -5.833932e-01  1.974495e+00  1.081543e+00  7.828448e-01  5.989989e-02
 [26]  2.855754e-01 -4.734362e-01  9.750865e-01 -9.732691e-01  2.859960e-01
 [31] -2.127845e-01 -2.266339e-01  4.421499e-01 -4.077315e-01 -8.915807e-02
 [36] -8.235276e-01 -3.315506e-01  2.117983e+00  6.379205e-01 -1.203581e+00
 [41] -9.798754e-01 -9.303492e-01  6.595000e-01 -3.907162e-01  6.354305e-01
 [46]  1.527187e+00  2.806945e-01  5.860732e-01  3.702054e-01 -3.341883e-01
 [51]  4.804779e-01 -3.948805e-01 -7.741939e-01  8.443188e-01  2.953133e-01
 [56] -2.142959e-02 -2.453386e-01 -1.387181e+00  1.212000e+00 -3.492982e-01
 [61] -1.489229e+00 -1.669160e+00 -1.088342e-01  1.369291e+00  5.079356e-03
 [66] -1.673806e+00 -8.597320e-01 -9.958964e-01 -6.249871e-01 -4.521293e-01
 [71]  9.600009e-01 -3.568780e+00 -4.332945e-01 -2.973140e-01 -1.767601e+00
 [76]  8.249182e-01  1.674598e-01 -6.790238e-01 -9.167846e-01 -1.208187e+00
 [81]  9.024156e-05  9.379851e-01 -8.512729e-01 -1.982568e-01 -1.891544e+00
 [86]  1.979279e-01  1.173015e+00 -1.601507e-01  6.616128e-01  4.762449e-01
 [91] -5.536731e-01 -3.537824e-01  1.127651e+00 -1.111129e+00  1.812459e-01
 [96] -1.514821e+00  3.735870e-01  1.061909e+00  1.012024e+00  4.567852e-02
> 
> colMeans(tmp2)
[1] -0.1044022
> colSums(tmp2)
[1] -10.44022
> colVars(tmp2)
[1] 0.950732
> colSd(tmp2)
[1] 0.9750549
> colMax(tmp2)
[1] 2.117983
> colMin(tmp2)
[1] -3.56878
> colMedians(tmp2)
[1] -0.1344924
> colRanges(tmp2)
          [,1]
[1,] -3.568780
[2,]  2.117983
> 
> 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.3726942 -0.7753888 -2.9660243 -1.9047910  1.0726043 -0.8343036
 [7] -4.0915400  1.3275896  2.0660821 -8.8765106
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.20724580
[2,] -0.34427188
[3,]  0.02491546
[4,]  0.46532542
[5,]  2.61470933
> 
> rowApply(tmp,sum)
 [1]  2.7990656 -0.6049611  1.1176679 -1.7502578 -1.0669696 -2.2002256
 [7] -0.9603540  2.0431718 -5.3834578 -6.6032676
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    6    6    6    4    9    3   10    5     6
 [2,]    8    3    9    8    2    8    8    3    1     8
 [3,]    6    7    3    5    8    1    2    9    6     3
 [4,]   10    9    4    1    9    4    1    2    7     9
 [5,]    2    8    8    9    7    2    4    7    8     7
 [6,]    1    2   10   10    5    7    7    4    2     4
 [7,]    9    1    1    7    6    6    6    8   10     2
 [8,]    3    5    2    3   10    5   10    5    4    10
 [9,]    5   10    7    4    3   10    5    6    9     5
[10,]    4    4    5    2    1    3    9    1    3     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.30032550  0.77824736  0.07833314  2.04580563  1.85267765  3.00926412
 [7]  3.35801282  1.59877786  1.22108552  0.26210454  0.80975809 -1.20399655
[13] -3.25476758  3.13719272 -0.80933577  1.86562637  3.37186766  2.23007419
[19]  1.00031673 -0.07028547
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8843718
[2,] -0.6731470
[3,]  0.4155725
[4,]  0.6147273
[5,]  0.8275444
> 
> rowApply(tmp,sum)
[1]  5.7029712  5.3370625 -1.1924894 11.0344876  0.6990527
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12   15   16    3    4
[2,]    8   17    3    6   16
[3,]   20    3    8   10   12
[4,]   18    8    7    9   19
[5,]    1   10   19   17   10
> 
> 
> as.matrix(tmp)
           [,1]         [,2]        [,3]       [,4]       [,5]        [,6]
[1,]  0.4155725  0.038215269  1.34398778  1.1885393 -0.8914244  0.09959662
[2,]  0.8275444  1.354005136 -1.43120531 -0.3119674  0.1434301  2.58685357
[3,]  0.6147273 -1.344348336 -0.24523199 -0.5066622  1.3791118 -0.53693532
[4,] -0.8843718 -0.009691903  0.39109747  0.3860180  1.3871903  1.31480027
[5,] -0.6731470  0.740067189  0.01968517  1.2898778 -0.1656301 -0.45505101
           [,7]        [,8]        [,9]       [,10]      [,11]       [,12]
[1,] 0.99684877  0.91226979 -0.30697748  1.24514002 -0.2135092  0.24105501
[2,] 0.19703914 -0.28047765 -0.38391642  1.74296018  0.5574608 -0.73906957
[3,] 0.02136665 -0.07655800  0.08200774 -1.49506499  1.1488140  0.06095761
[4,] 0.17217225  1.13081384  2.00775451  0.04844396  0.6404745 -1.01706407
[5,] 1.97058601 -0.08727012 -0.17778283 -1.27937463 -1.3234821  0.25012448
          [,13]       [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.6615317  0.56433667 -0.7447203  0.4045561 -0.1335697  0.6920081
[2,] -1.6560654  0.45937255  2.9245850 -0.7312140  0.8062784  1.1375128
[3,]  0.1439199  1.40765292 -1.8590608 -0.8079817  0.6040084 -0.8583746
[4,] -1.3274892 -0.09863103 -0.7183344  2.8251866  1.1215982  1.4246304
[5,] -1.0766645  0.80446161 -0.4118052  0.1750793  0.9735523 -0.1657025
          [,19]       [,20]
[1,] -0.3241412 -0.48634434
[2,] -0.3918951 -1.47416883
[3,]  1.1221258 -0.04696354
[4,]  0.9638287  1.27606103
[5,] -0.3696014  0.66113021
> 
> 
> 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.24-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.24-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.24-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.24-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.6375389 -2.173006 -0.4591961 -1.382354 -1.856363 0.01026112 0.9366904
          col8       col9       col10   col11     col12     col13     col14
row1 0.4779869 -0.4665185 -0.09963238 1.40072 0.3329165 0.1502016 0.6395316
         col15     col16     col17     col18     col19    col20
row1 -1.185877 -1.353638 0.6612386 0.5588698 -1.785651 1.343538
> tmp[,"col10"]
           col10
row1 -0.09963238
row2 -1.08273751
row3 -1.00906049
row4 -0.22740504
row5 -2.07283804
> tmp[c("row1","row5"),]
           col1        col2       col3       col4       col5       col6
row1 -0.6375389 -2.17300585 -0.4591961 -1.3823540 -1.8563633 0.01026112
row5  0.4049494  0.04924446  0.4116856  0.2678276 -0.7968215 1.31560341
           col7      col8       col9       col10      col11     col12     col13
row1  0.9366904 0.4779869 -0.4665185 -0.09963238  1.4007196 0.3329165 0.1502016
row5 -0.6996724 0.1082674 -1.5408081 -2.07283804 -0.9608861 1.6082509 1.2054027
         col14     col15       col16     col17      col18       col19    col20
row1 0.6395316 -1.185877 -1.35363784 0.6612386  0.5588698 -1.78565082 1.343538
row5 0.6163790  1.127536 -0.03283985 2.5818109 -2.1220639  0.01759554 1.037641
> tmp[,c("col6","col20")]
            col6       col20
row1  0.01026112  1.34353842
row2  1.29151844 -0.49477074
row3 -0.19925417  0.02248057
row4 -0.96094076 -1.60830737
row5  1.31560341  1.03764116
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1 0.01026112 1.343538
row5 1.31560341 1.037641
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2    col3     col4     col5     col6     col7     col8
row1 49.50176 49.69019 48.4067 49.72611 50.19354 103.9034 49.19656 50.87248
         col9   col10    col11    col12   col13    col14    col15    col16
row1 49.07852 50.6383 49.28114 50.58598 49.7735 50.04925 51.32352 49.83255
        col17    col18    col19    col20
row1 48.90977 51.10244 48.22002 106.9566
> tmp[,"col10"]
        col10
row1 50.63830
row2 31.36428
row3 28.37180
row4 29.38258
row5 50.62493
> tmp[c("row1","row5"),]
         col1     col2    col3     col4     col5     col6     col7     col8
row1 49.50176 49.69019 48.4067 49.72611 50.19354 103.9034 49.19656 50.87248
row5 49.06832 48.98691 50.6760 50.30790 48.63281 105.0469 49.66731 49.40348
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.07852 50.63830 49.28114 50.58598 49.77350 50.04925 51.32352 49.83255
row5 48.99098 50.62493 49.75524 52.00740 50.53419 49.38691 49.23050 49.93362
        col17    col18    col19    col20
row1 48.90977 51.10244 48.22002 106.9566
row5 51.62625 48.81355 50.24776 103.9596
> tmp[,c("col6","col20")]
          col6     col20
row1 103.90340 106.95658
row2  74.76623  75.08195
row3  76.60979  76.88693
row4  76.44182  73.95273
row5 105.04692 103.95962
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.9034 106.9566
row5 105.0469 103.9596
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.9034 106.9566
row5 105.0469 103.9596
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.9913022
[2,]  0.0760323
[3,] -1.2034094
[4,]  0.2790740
[5,] -0.5499238
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.1407099 -0.3882910
[2,]  0.4155168  0.7673597
[3,]  0.9914963 -1.4282940
[4,] -0.6480649 -0.8524134
[5,] -0.4376567  1.2430411
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.1246940  1.1374002
[2,] -2.0034234  0.2001076
[3,] -0.3276706  0.5916083
[4,]  0.5456904 -1.9754408
[5,]  0.1541333  2.1001727
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.124694
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  0.124694
[2,] -2.003423
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
row3 -1.039634 -0.1092909  0.3039786 -0.8490561  0.28903205  0.7052605
row1 -1.199066  1.1363109 -0.1569031  0.5955052 -0.02185543 -1.5433401
          [,7]      [,8]      [,9]     [,10]     [,11]      [,12]      [,13]
row3 1.3231669 -1.145619  1.243873 1.8927549 -1.485401 -0.4611124 -0.1533536
row1 0.4388214 -2.232687 -1.123725 0.8471912  1.606438  0.5820173 -0.2408033
          [,14]      [,15]      [,16]     [,17]     [,18]     [,19]      [,20]
row3 -0.1211721 0.08717274  0.5533179 -1.572656  1.355439  1.539631 -0.2967114
row1 -1.3726437 0.47628681 -0.0829202 -1.702241 -1.976716 -1.109068  1.0898640
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
row2 0.187045 0.6577503 0.8974188 -1.728554 0.02823415 0.3356992 -2.750518
         [,8]      [,9]      [,10]
row2 1.480776 0.9634296 -0.3086222
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]      [,4]      [,5]     [,6]      [,7]
row5 0.08393177 -1.250108 -0.327245 0.2477638 0.2447457 1.327232 0.9972341
          [,8]      [,9]     [,10]     [,11]     [,12]    [,13]     [,14]
row5 0.9057554 0.7288376 0.3070051 0.2880922 0.2819805 1.715376 0.4926124
           [,15]      [,16]     [,17]    [,18]     [,19]      [,20]
row5 -0.07979107 -0.7090734 -2.280539 1.620384 -0.667457 -0.6162265
> 
> 
> 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: 0x5c96b4f5d670>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5527b9a69f1"
 [2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5522267a833"
 [3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e552d020fa1" 
 [4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5523f2b990e"
 [5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5521ceb9920"
 [6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e55243b4315c"
 [7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5528d5f0ce" 
 [8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5523fe00172"
 [9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5526746cb69"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5523f15bcb3"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e55250429844"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5527b9e50d6"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5522c8fc40e"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e5522c67614d"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM20e55220591402"
> 
> 
> ### 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: 0x5c96b50d12e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5c96b50d12e0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5c96b50d12e0>
> rowMedians(tmp)
  [1] -0.7156915307  0.1921229740  0.0797124475  0.0608450593  0.2279284126
  [6] -0.4928999302  0.0687184037  0.3422761073 -0.1930910034 -0.1695536848
 [11]  0.2257656286  0.4951413612  0.0720080856  0.4705310370  0.0576428986
 [16] -0.5231248046  0.1082352977 -0.3763357360 -0.2039091683  0.2853559070
 [21]  0.0259515313 -0.2257386386 -0.1194541673  0.4770758126  0.3970127747
 [26] -0.1375297824  0.1537207922  0.0191849825  0.1003954930  0.0094861631
 [31]  0.5742443272 -0.2420016343 -0.4016926564  0.2605506916  0.3520101466
 [36]  0.0445685780 -0.7406868029 -0.0793406868  0.0861560025  0.7240399244
 [41]  0.1375537168 -0.2337859341  0.0413044925 -0.2451483591 -0.4524620006
 [46] -0.2499116924 -0.1515119629  0.1129126848 -0.3111962218  0.0606807823
 [51] -0.7231760607  0.4446495899 -0.6545629366  0.5988763378 -0.2606806191
 [56] -0.4882789240 -0.2942786328 -0.2419838833  0.3392308657 -0.4922777665
 [61] -0.5519957923  0.3202758324  0.0085827322 -0.2611132178 -0.2054288908
 [66] -0.1524774356  0.1543989990  0.3031107854  0.1768497321  0.0524948623
 [71]  0.1707409093  0.6164445637  0.4549650310 -0.3028406090 -0.1243735528
 [76]  0.1933555976  0.1537347428 -0.3223479881 -0.3995873852 -0.0954833673
 [81]  0.0692274277  0.0968559454  0.1745169675 -0.1629303373  0.4213583334
 [86]  0.3872403855  0.2879713023 -0.3558654143 -0.7761802755  0.4556760355
 [91] -0.4466696036  0.3901622768 -0.1051312056 -0.2873722468  0.0531841041
 [96]  0.2895050817  0.2094698652 -0.5487185754 -0.0715179711 -0.4489465709
[101] -0.1044875659  0.4199323060  0.8238311232 -0.4109308205 -0.0502884138
[106]  0.4105393705  0.6225690733  0.3252228765  0.2552471477 -0.1356490181
[111]  0.2988245044  0.3591182406 -0.0034217022 -0.0809817913  0.2024342531
[116] -0.0058709974  0.1461583888  0.1759775228  0.2289595151  0.1854205942
[121] -0.3503506071 -0.1913212932  0.2544137144 -0.0856812119  0.3834944714
[126] -0.0163576984  0.5052833716 -0.1084532112  0.4112784934 -0.2326298008
[131]  0.2535677912  0.1617390413  0.0931280280  0.0592273139 -0.0615145452
[136]  0.1770734392  0.2217209663  0.0363625207  0.5287914792  0.2313896905
[141]  0.0638856357 -0.4607799621  0.3525087177 -0.4685601302  0.1914935976
[146] -0.3668025058 -0.0269483468 -0.3096033614 -0.1207014131 -0.3096313502
[151]  0.6213874883 -0.6911003326 -0.1330467022 -0.3463978389  0.6094713472
[156] -0.3753544598  0.0389198299  0.3278739070  0.1435919627 -0.3868022275
[161]  0.0844921678  0.2796109460 -0.5307663556 -0.2229866734 -0.2283664566
[166]  0.3851387576 -0.0041975573 -0.2187196833 -0.0115814789 -0.0740841067
[171]  0.4565796739  0.2460218293 -0.0067828838 -0.5644842787  0.0982185008
[176] -0.4612836591 -0.1898517697  0.5378434625 -0.5018944515  0.0052774506
[181]  0.2912256267  0.7005702611 -0.4008309671  0.2267229026  0.2495401133
[186]  0.1012497542  0.2429328729  0.0670644072  0.5909201958  0.5808429795
[191]  0.1077224883 -0.5971137833 -0.1007679088 -0.3679010063  0.3179275994
[196]  0.3898972373  0.1378284434  0.3453313758 -0.0093676052  0.0931558360
[201] -0.3352690343 -0.6918731400  0.0230355766 -0.0978426351 -0.3879790544
[206] -0.4165114567  0.0660026612 -0.1037618552  0.0678111313 -0.2015878096
[211]  0.0741578103  0.0008828509 -0.6662098533  0.0165271538  0.1697607268
[216] -0.0092985297 -0.2996143089 -0.2537409681  0.0164432055 -0.1527134286
[221] -0.0470704806  0.0152736610  0.0861497447  0.3067683542  0.1982521566
[226] -0.1614079803  0.1810099291 -0.0062821888  0.3143102744 -0.1870013219
> 
> proc.time()
   user  system elapsed 
  1.244   0.689   1.920 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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: 0x5c38ecbd5520>
> .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: 0x5c38ecbd5520>
> .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: 0x5c38ecbd5520>
> .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: 0x5c38ecbd5520>
> 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: 0x5c38ec77ef60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c38ec77ef60>
> .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: 0x5c38ec77ef60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c38ec77ef60>
> .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: 0x5c38ec77ef60>
> 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: 0x5c38ed328b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c38ed328b40>
> .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: 0x5c38ed328b40>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5c38ed328b40>
> .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: 0x5c38ed328b40>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5c38ed328b40>
> .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: 0x5c38ed328b40>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5c38ed328b40>
> .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: 0x5c38ed328b40>
> 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: 0x5c38ed365bc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5c38ed365bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c38ed365bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c38ed365bc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile20e5993fc7d5fa" "BufferedMatrixFile20e5997138af91"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile20e5993fc7d5fa" "BufferedMatrixFile20e5997138af91"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c38ed2ff000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c38ed2ff000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5c38ed2ff000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5c38ed2ff000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5c38ed2ff000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5c38ed2ff000>
> .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: 0x5c38ec432e30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5c38ec432e30>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5c38ec432e30>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5c38ec432e30>
> 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: 0x5c38eca5ca50>
> .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: 0x5c38eca5ca50>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.244   0.039   0.273 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.236   0.051   0.274 

Example timings