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

This page was generated on 2026-05-12 11:33 -0400 (Tue, 12 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" 4892
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 / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.77.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-05-11 13:45 -0400 (Mon, 11 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  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-11 21:52:22 -0400 (Mon, 11 May 2026)
EndedAt: 2026-05-11 21:52:47 -0400 (Mon, 11 May 2026)
EllapsedTime: 25.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-12 01:52:22 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.247   0.046   0.281 

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] "Mon May 11 21:52:38 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] "Mon May 11 21:52:38 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: 0x5d81d1d14520>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon May 11 21:52:38 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] "Mon May 11 21:52:38 2026"
> 
> ColMode(tmp2)
<pointer: 0x5d81d1d14520>
> 
> 
> 
> ### 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.4069153 -0.1135637  1.5463871  0.006530448
[2,]  -1.6731648 -1.0120143  0.4687453 -0.788139499
[3,]  -1.1489729 -0.3035485 -1.9114222 -0.884065538
[4,]  -0.4930314  0.2244759 -0.8462809 -1.285411528
> 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.4069153 0.1135637 1.5463871 0.006530448
[2,]   1.6731648 1.0120143 0.4687453 0.788139499
[3,]   1.1489729 0.3035485 1.9114222 0.884065538
[4,]   0.4930314 0.2244759 0.8462809 1.285411528
> 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.020325 0.3369921 1.2435381 0.08081119
[2,]  1.293509 1.0059892 0.6846497 0.88777221
[3,]  1.071902 0.5509523 1.3825419 0.94024759
[4,]  0.702162 0.4737889 0.9199353 1.13375991
> 
> 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.61017 28.48348 38.98177 25.81464
[2,]  39.60825 36.07191 32.31524 34.66586
[3,]  36.86799 30.81307 40.73684 35.28654
[4,]  32.51465 29.96236 35.04563 37.62301
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5d81d2aff8f0>
> exp(tmp5)
<pointer: 0x5d81d2aff8f0>
> log(tmp5,2)
<pointer: 0x5d81d2aff8f0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.578
> Min(tmp5)
[1] 53.63673
> mean(tmp5)
[1] 72.80211
> Sum(tmp5)
[1] 14560.42
> Var(tmp5)
[1] 863.795
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.94741 72.39226 70.23901 71.17389 70.89252 70.77664 70.55414 70.55349
 [9] 71.54842 67.94331
> rowSums(tmp5)
 [1] 1838.948 1447.845 1404.780 1423.478 1417.850 1415.533 1411.083 1411.070
 [9] 1430.968 1358.866
> rowVars(tmp5)
 [1] 7991.43730   81.68817   90.94851   59.55089   49.62955  109.09749
 [7]   48.93767   44.09825   53.24438   77.46335
> rowSd(tmp5)
 [1] 89.394839  9.038151  9.536693  7.716922  7.044824 10.444974  6.995547
 [8]  6.640651  7.296875  8.801327
> rowMax(tmp5)
 [1] 469.57800  87.82566  86.37417  82.52209  82.91594  88.45784  83.34956
 [8]  80.84842  84.98416  90.28333
> rowMin(tmp5)
 [1] 53.72980 54.16950 56.63783 53.63673 56.62179 56.44691 59.04265 57.30193
 [9] 61.19134 55.19159
> 
> colMeans(tmp5)
 [1] 107.94324  68.26354  70.91157  69.68689  73.71815  70.01564  72.29865
 [8]  72.11887  71.07164  73.16610  69.22035  73.84820  71.32267  69.79337
[15]  71.60844  70.66987  70.80054  66.30276  72.30605  70.97564
> colSums(tmp5)
 [1] 1079.4324  682.6354  709.1157  696.8689  737.1815  700.1564  722.9865
 [8]  721.1887  710.7164  731.6610  692.2035  738.4820  713.2267  697.9337
[15]  716.0844  706.6987  708.0054  663.0276  723.0605  709.7564
> colVars(tmp5)
 [1] 16205.03175    45.05294    51.33449    78.83829    85.77728    81.68464
 [7]    88.20615    91.04633   101.08493    84.53200    96.31192   115.84129
[13]   100.58536    46.84648    35.07172    27.70364    64.31899    65.53355
[19]    98.48476    22.63362
> colSd(tmp5)
 [1] 127.298986   6.712149   7.164809   8.879093   9.261602   9.037956
 [7]   9.391813   9.541820  10.054100   9.194129   9.813864  10.762959
[13]  10.029225   6.844449   5.922138   5.263424   8.019912   8.095279
[19]   9.923949   4.757480
> colMax(tmp5)
 [1] 469.57800  76.55843  84.78840  80.78522  88.45784  82.22152  85.98387
 [8]  83.75871  87.82566  87.62746  83.67418  90.28333  92.02253  81.67371
[15]  81.78485  79.18336  80.56712  81.00825  86.37417  74.54043
> colMin(tmp5)
 [1] 56.62179 59.22313 63.17645 53.72980 56.90451 56.63783 61.19134 53.63673
 [9] 57.04308 59.02096 57.30193 54.16950 60.59602 59.32319 61.73928 63.33402
[17] 55.19159 57.42536 57.03415 61.07226
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.94741 72.39226 70.23901 71.17389 70.89252 70.77664       NA 70.55349
 [9] 71.54842 67.94331
> rowSums(tmp5)
 [1] 1838.948 1447.845 1404.780 1423.478 1417.850 1415.533       NA 1411.070
 [9] 1430.968 1358.866
> rowVars(tmp5)
 [1] 7991.43730   81.68817   90.94851   59.55089   49.62955  109.09749
 [7]   42.08201   44.09825   53.24438   77.46335
> rowSd(tmp5)
 [1] 89.394839  9.038151  9.536693  7.716922  7.044824 10.444974  6.487064
 [8]  6.640651  7.296875  8.801327
> rowMax(tmp5)
 [1] 469.57800  87.82566  86.37417  82.52209  82.91594  88.45784        NA
 [8]  80.84842  84.98416  90.28333
> rowMin(tmp5)
 [1] 53.72980 54.16950 56.63783 53.63673 56.62179 56.44691       NA 57.30193
 [9] 61.19134 55.19159
> 
> colMeans(tmp5)
 [1] 107.94324  68.26354  70.91157  69.68689  73.71815  70.01564  72.29865
 [8]  72.11887        NA  73.16610  69.22035  73.84820  71.32267  69.79337
[15]  71.60844  70.66987  70.80054  66.30276  72.30605  70.97564
> colSums(tmp5)
 [1] 1079.4324  682.6354  709.1157  696.8689  737.1815  700.1564  722.9865
 [8]  721.1887        NA  731.6610  692.2035  738.4820  713.2267  697.9337
[15]  716.0844  706.6987  708.0054  663.0276  723.0605  709.7564
> colVars(tmp5)
 [1] 16205.03175    45.05294    51.33449    78.83829    85.77728    81.68464
 [7]    88.20615    91.04633          NA    84.53200    96.31192   115.84129
[13]   100.58536    46.84648    35.07172    27.70364    64.31899    65.53355
[19]    98.48476    22.63362
> colSd(tmp5)
 [1] 127.298986   6.712149   7.164809   8.879093   9.261602   9.037956
 [7]   9.391813   9.541820         NA   9.194129   9.813864  10.762959
[13]  10.029225   6.844449   5.922138   5.263424   8.019912   8.095279
[19]   9.923949   4.757480
> colMax(tmp5)
 [1] 469.57800  76.55843  84.78840  80.78522  88.45784  82.22152  85.98387
 [8]  83.75871        NA  87.62746  83.67418  90.28333  92.02253  81.67371
[15]  81.78485  79.18336  80.56712  81.00825  86.37417  74.54043
> colMin(tmp5)
 [1] 56.62179 59.22313 63.17645 53.72980 56.90451 56.63783 61.19134 53.63673
 [9]       NA 59.02096 57.30193 54.16950 60.59602 59.32319 61.73928 63.33402
[17] 55.19159 57.42536 57.03415 61.07226
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.578
> Min(tmp5,na.rm=TRUE)
[1] 53.63673
> mean(tmp5,na.rm=TRUE)
[1] 72.74911
> Sum(tmp5,na.rm=TRUE)
[1] 14477.07
> Var(tmp5,na.rm=TRUE)
[1] 867.5929
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.94741 72.39226 70.23901 71.17389 70.89252 70.77664 69.88070 70.55349
 [9] 71.54842 67.94331
> rowSums(tmp5,na.rm=TRUE)
 [1] 1838.948 1447.845 1404.780 1423.478 1417.850 1415.533 1327.733 1411.070
 [9] 1430.968 1358.866
> rowVars(tmp5,na.rm=TRUE)
 [1] 7991.43730   81.68817   90.94851   59.55089   49.62955  109.09749
 [7]   42.08201   44.09825   53.24438   77.46335
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.394839  9.038151  9.536693  7.716922  7.044824 10.444974  6.487064
 [8]  6.640651  7.296875  8.801327
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.57800  87.82566  86.37417  82.52209  82.91594  88.45784  81.78485
 [8]  80.84842  84.98416  90.28333
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.72980 54.16950 56.63783 53.63673 56.62179 56.44691 59.04265 57.30193
 [9] 61.19134 55.19159
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.94324  68.26354  70.91157  69.68689  73.71815  70.01564  72.29865
 [8]  72.11887  69.70742  73.16610  69.22035  73.84820  71.32267  69.79337
[15]  71.60844  70.66987  70.80054  66.30276  72.30605  70.97564
> colSums(tmp5,na.rm=TRUE)
 [1] 1079.4324  682.6354  709.1157  696.8689  737.1815  700.1564  722.9865
 [8]  721.1887  627.3668  731.6610  692.2035  738.4820  713.2267  697.9337
[15]  716.0844  706.6987  708.0054  663.0276  723.0605  709.7564
> colVars(tmp5,na.rm=TRUE)
 [1] 16205.03175    45.05294    51.33449    78.83829    85.77728    81.68464
 [7]    88.20615    91.04633    92.78341    84.53200    96.31192   115.84129
[13]   100.58536    46.84648    35.07172    27.70364    64.31899    65.53355
[19]    98.48476    22.63362
> colSd(tmp5,na.rm=TRUE)
 [1] 127.298986   6.712149   7.164809   8.879093   9.261602   9.037956
 [7]   9.391813   9.541820   9.632414   9.194129   9.813864  10.762959
[13]  10.029225   6.844449   5.922138   5.263424   8.019912   8.095279
[19]   9.923949   4.757480
> colMax(tmp5,na.rm=TRUE)
 [1] 469.57800  76.55843  84.78840  80.78522  88.45784  82.22152  85.98387
 [8]  83.75871  87.82566  87.62746  83.67418  90.28333  92.02253  81.67371
[15]  81.78485  79.18336  80.56712  81.00825  86.37417  74.54043
> colMin(tmp5,na.rm=TRUE)
 [1] 56.62179 59.22313 63.17645 53.72980 56.90451 56.63783 61.19134 53.63673
 [9] 57.04308 59.02096 57.30193 54.16950 60.59602 59.32319 61.73928 63.33402
[17] 55.19159 57.42536 57.03415 61.07226
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.94741 72.39226 70.23901 71.17389 70.89252 70.77664      NaN 70.55349
 [9] 71.54842 67.94331
> rowSums(tmp5,na.rm=TRUE)
 [1] 1838.948 1447.845 1404.780 1423.478 1417.850 1415.533    0.000 1411.070
 [9] 1430.968 1358.866
> rowVars(tmp5,na.rm=TRUE)
 [1] 7991.43730   81.68817   90.94851   59.55089   49.62955  109.09749
 [7]         NA   44.09825   53.24438   77.46335
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.394839  9.038151  9.536693  7.716922  7.044824 10.444974        NA
 [8]  6.640651  7.296875  8.801327
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.57800  87.82566  86.37417  82.52209  82.91594  88.45784        NA
 [8]  80.84842  84.98416  90.28333
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.72980 54.16950 56.63783 53.63673 56.62179 56.44691       NA 57.30193
 [9] 61.19134 55.19159
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.08230  67.37926  71.55379  69.83234  74.13601  70.15653  73.25076
 [8]  73.25299       NaN  73.07199  70.35121  73.21192  70.85499  69.75013
[15]  70.47773  70.22190  71.40471  65.65222  71.91871  71.77074
> colSums(tmp5,na.rm=TRUE)
 [1] 1017.7407  606.4134  643.9841  628.4910  667.2241  631.4088  659.2568
 [8]  659.2769    0.0000  657.6479  633.1609  658.9073  637.6949  627.7512
[15]  634.2996  631.9971  642.6424  590.8700  647.2684  645.9367
> colVars(tmp5,na.rm=TRUE)
 [1] 17933.54802    41.88765    53.11122    88.45508    94.53513    91.67192
 [7]    89.03379    87.95709          NA    94.99885    93.96402   125.76685
[13]   110.69787    52.68125    25.07246    28.90905    68.25243    68.96431
[19]   109.10757    18.35076
> colSd(tmp5,na.rm=TRUE)
 [1] 133.916198   6.472067   7.287745   9.405056   9.722918   9.574545
 [7]   9.435772   9.378544         NA   9.746735   9.693504  11.214582
[13]  10.521306   7.258185   5.007241   5.376714   8.261503   8.304475
[19]  10.445457   4.283778
> colMax(tmp5,na.rm=TRUE)
 [1] 469.57800  76.55843  84.78840  80.78522  88.45784  82.22152  85.98387
 [8]  83.75871      -Inf  87.62746  83.67418  90.28333  92.02253  81.67371
[15]  76.20246  79.18336  80.56712  81.00825  86.37417  74.54043
> colMin(tmp5,na.rm=TRUE)
 [1] 56.62179 59.22313 63.17645 53.72980 56.90451 56.63783 61.19134 53.63673
 [9]      Inf 59.02096 57.30193 54.16950 60.59602 59.32319 61.73928 63.33402
[17] 55.19159 57.42536 57.03415 61.07226
> 
> 
> 
> 
> 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] 170.1898 218.7582 270.9490 253.8147 159.8183 173.6181 235.0807 261.2088
 [9] 248.8481 210.1361
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 170.1898 218.7582 270.9490 253.8147 159.8183 173.6181 235.0807 261.2088
 [9] 248.8481 210.1361
> 
> 
> 
> 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  0.000000e+00 -3.552714e-14  4.263256e-14 -5.684342e-14
 [6]  5.684342e-14 -4.263256e-14  0.000000e+00  1.847411e-13  1.421085e-13
[11] -1.136868e-13  5.684342e-14  0.000000e+00  0.000000e+00 -1.136868e-13
[16] -2.842171e-14  5.684342e-14 -5.684342e-14  2.842171e-14  2.842171e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   7 
1   13 
8   16 
8   3 
9   14 
6   12 
10   12 
4   1 
2   20 
7   9 
2   12 
9   12 
6   11 
3   18 
5   20 
8   5 
2   20 
4   11 
6   15 
4   14 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.270706
> Min(tmp)
[1] -2.597547
> mean(tmp)
[1] 0.0009744189
> Sum(tmp)
[1] 0.09744189
> Var(tmp)
[1] 1.259551
> 
> rowMeans(tmp)
[1] 0.0009744189
> rowSums(tmp)
[1] 0.09744189
> rowVars(tmp)
[1] 1.259551
> rowSd(tmp)
[1] 1.122297
> rowMax(tmp)
[1] 2.270706
> rowMin(tmp)
[1] -2.597547
> 
> colMeans(tmp)
  [1] -0.17913029  0.65885809 -0.53369404 -0.45904651 -1.23235925  0.72302756
  [7]  1.51197171 -0.97814874 -1.49906167  1.78887163  0.62658924 -0.40186984
 [13] -1.23019400 -1.31834686  0.38015897  0.54718447  1.95517573 -0.48035954
 [19]  0.57707154 -0.64405769 -1.32496136  0.96095710 -2.51996993 -1.84070013
 [25]  1.50144188 -0.51366059  0.65458830 -0.97309233 -0.59686345 -0.04739436
 [31] -0.86622362  0.56606649  0.08128688  1.80848808 -1.40045187 -0.60098368
 [37]  1.12563736  0.17197510 -0.29662298 -2.59754746  1.39653348  0.81321568
 [43]  0.18871536 -0.92502935 -0.64254280  1.65744993  1.97259252  0.58661336
 [49] -0.39258001  0.65862643  1.41316227 -0.76551376  0.50446039 -0.21221513
 [55]  0.42926184  0.18369927 -2.14729646  2.06200869 -0.42159544  0.89161370
 [61]  0.12948989  1.66554390  0.43428688 -1.24428562  1.07751734 -1.04302969
 [67] -1.17981402  1.50650856  0.53981802  0.58566260 -1.86998668 -0.65951885
 [73] -1.30901810  0.84759173  0.09264923  0.16741164  1.14858364 -1.05938782
 [79]  1.26239208  0.54281986 -0.08309549 -1.09160543 -0.30360574  0.90530081
 [85]  1.31972215  2.02077159  0.99016623 -1.69386097 -0.31124920 -1.96310380
 [91] -0.23829587 -0.63527642  0.93391882 -0.35037317 -0.73111386 -1.40560905
 [97] -1.04377703 -0.55097103  0.06776898  2.27070591
> colSums(tmp)
  [1] -0.17913029  0.65885809 -0.53369404 -0.45904651 -1.23235925  0.72302756
  [7]  1.51197171 -0.97814874 -1.49906167  1.78887163  0.62658924 -0.40186984
 [13] -1.23019400 -1.31834686  0.38015897  0.54718447  1.95517573 -0.48035954
 [19]  0.57707154 -0.64405769 -1.32496136  0.96095710 -2.51996993 -1.84070013
 [25]  1.50144188 -0.51366059  0.65458830 -0.97309233 -0.59686345 -0.04739436
 [31] -0.86622362  0.56606649  0.08128688  1.80848808 -1.40045187 -0.60098368
 [37]  1.12563736  0.17197510 -0.29662298 -2.59754746  1.39653348  0.81321568
 [43]  0.18871536 -0.92502935 -0.64254280  1.65744993  1.97259252  0.58661336
 [49] -0.39258001  0.65862643  1.41316227 -0.76551376  0.50446039 -0.21221513
 [55]  0.42926184  0.18369927 -2.14729646  2.06200869 -0.42159544  0.89161370
 [61]  0.12948989  1.66554390  0.43428688 -1.24428562  1.07751734 -1.04302969
 [67] -1.17981402  1.50650856  0.53981802  0.58566260 -1.86998668 -0.65951885
 [73] -1.30901810  0.84759173  0.09264923  0.16741164  1.14858364 -1.05938782
 [79]  1.26239208  0.54281986 -0.08309549 -1.09160543 -0.30360574  0.90530081
 [85]  1.31972215  2.02077159  0.99016623 -1.69386097 -0.31124920 -1.96310380
 [91] -0.23829587 -0.63527642  0.93391882 -0.35037317 -0.73111386 -1.40560905
 [97] -1.04377703 -0.55097103  0.06776898  2.27070591
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.17913029  0.65885809 -0.53369404 -0.45904651 -1.23235925  0.72302756
  [7]  1.51197171 -0.97814874 -1.49906167  1.78887163  0.62658924 -0.40186984
 [13] -1.23019400 -1.31834686  0.38015897  0.54718447  1.95517573 -0.48035954
 [19]  0.57707154 -0.64405769 -1.32496136  0.96095710 -2.51996993 -1.84070013
 [25]  1.50144188 -0.51366059  0.65458830 -0.97309233 -0.59686345 -0.04739436
 [31] -0.86622362  0.56606649  0.08128688  1.80848808 -1.40045187 -0.60098368
 [37]  1.12563736  0.17197510 -0.29662298 -2.59754746  1.39653348  0.81321568
 [43]  0.18871536 -0.92502935 -0.64254280  1.65744993  1.97259252  0.58661336
 [49] -0.39258001  0.65862643  1.41316227 -0.76551376  0.50446039 -0.21221513
 [55]  0.42926184  0.18369927 -2.14729646  2.06200869 -0.42159544  0.89161370
 [61]  0.12948989  1.66554390  0.43428688 -1.24428562  1.07751734 -1.04302969
 [67] -1.17981402  1.50650856  0.53981802  0.58566260 -1.86998668 -0.65951885
 [73] -1.30901810  0.84759173  0.09264923  0.16741164  1.14858364 -1.05938782
 [79]  1.26239208  0.54281986 -0.08309549 -1.09160543 -0.30360574  0.90530081
 [85]  1.31972215  2.02077159  0.99016623 -1.69386097 -0.31124920 -1.96310380
 [91] -0.23829587 -0.63527642  0.93391882 -0.35037317 -0.73111386 -1.40560905
 [97] -1.04377703 -0.55097103  0.06776898  2.27070591
> colMin(tmp)
  [1] -0.17913029  0.65885809 -0.53369404 -0.45904651 -1.23235925  0.72302756
  [7]  1.51197171 -0.97814874 -1.49906167  1.78887163  0.62658924 -0.40186984
 [13] -1.23019400 -1.31834686  0.38015897  0.54718447  1.95517573 -0.48035954
 [19]  0.57707154 -0.64405769 -1.32496136  0.96095710 -2.51996993 -1.84070013
 [25]  1.50144188 -0.51366059  0.65458830 -0.97309233 -0.59686345 -0.04739436
 [31] -0.86622362  0.56606649  0.08128688  1.80848808 -1.40045187 -0.60098368
 [37]  1.12563736  0.17197510 -0.29662298 -2.59754746  1.39653348  0.81321568
 [43]  0.18871536 -0.92502935 -0.64254280  1.65744993  1.97259252  0.58661336
 [49] -0.39258001  0.65862643  1.41316227 -0.76551376  0.50446039 -0.21221513
 [55]  0.42926184  0.18369927 -2.14729646  2.06200869 -0.42159544  0.89161370
 [61]  0.12948989  1.66554390  0.43428688 -1.24428562  1.07751734 -1.04302969
 [67] -1.17981402  1.50650856  0.53981802  0.58566260 -1.86998668 -0.65951885
 [73] -1.30901810  0.84759173  0.09264923  0.16741164  1.14858364 -1.05938782
 [79]  1.26239208  0.54281986 -0.08309549 -1.09160543 -0.30360574  0.90530081
 [85]  1.31972215  2.02077159  0.99016623 -1.69386097 -0.31124920 -1.96310380
 [91] -0.23829587 -0.63527642  0.93391882 -0.35037317 -0.73111386 -1.40560905
 [97] -1.04377703 -0.55097103  0.06776898  2.27070591
> colMedians(tmp)
  [1] -0.17913029  0.65885809 -0.53369404 -0.45904651 -1.23235925  0.72302756
  [7]  1.51197171 -0.97814874 -1.49906167  1.78887163  0.62658924 -0.40186984
 [13] -1.23019400 -1.31834686  0.38015897  0.54718447  1.95517573 -0.48035954
 [19]  0.57707154 -0.64405769 -1.32496136  0.96095710 -2.51996993 -1.84070013
 [25]  1.50144188 -0.51366059  0.65458830 -0.97309233 -0.59686345 -0.04739436
 [31] -0.86622362  0.56606649  0.08128688  1.80848808 -1.40045187 -0.60098368
 [37]  1.12563736  0.17197510 -0.29662298 -2.59754746  1.39653348  0.81321568
 [43]  0.18871536 -0.92502935 -0.64254280  1.65744993  1.97259252  0.58661336
 [49] -0.39258001  0.65862643  1.41316227 -0.76551376  0.50446039 -0.21221513
 [55]  0.42926184  0.18369927 -2.14729646  2.06200869 -0.42159544  0.89161370
 [61]  0.12948989  1.66554390  0.43428688 -1.24428562  1.07751734 -1.04302969
 [67] -1.17981402  1.50650856  0.53981802  0.58566260 -1.86998668 -0.65951885
 [73] -1.30901810  0.84759173  0.09264923  0.16741164  1.14858364 -1.05938782
 [79]  1.26239208  0.54281986 -0.08309549 -1.09160543 -0.30360574  0.90530081
 [85]  1.31972215  2.02077159  0.99016623 -1.69386097 -0.31124920 -1.96310380
 [91] -0.23829587 -0.63527642  0.93391882 -0.35037317 -0.73111386 -1.40560905
 [97] -1.04377703 -0.55097103  0.06776898  2.27070591
> colRanges(tmp)
           [,1]      [,2]      [,3]       [,4]      [,5]      [,6]     [,7]
[1,] -0.1791303 0.6588581 -0.533694 -0.4590465 -1.232359 0.7230276 1.511972
[2,] -0.1791303 0.6588581 -0.533694 -0.4590465 -1.232359 0.7230276 1.511972
           [,8]      [,9]    [,10]     [,11]      [,12]     [,13]     [,14]
[1,] -0.9781487 -1.499062 1.788872 0.6265892 -0.4018698 -1.230194 -1.318347
[2,] -0.9781487 -1.499062 1.788872 0.6265892 -0.4018698 -1.230194 -1.318347
        [,15]     [,16]    [,17]      [,18]     [,19]      [,20]     [,21]
[1,] 0.380159 0.5471845 1.955176 -0.4803595 0.5770715 -0.6440577 -1.324961
[2,] 0.380159 0.5471845 1.955176 -0.4803595 0.5770715 -0.6440577 -1.324961
         [,22]    [,23]   [,24]    [,25]      [,26]     [,27]      [,28]
[1,] 0.9609571 -2.51997 -1.8407 1.501442 -0.5136606 0.6545883 -0.9730923
[2,] 0.9609571 -2.51997 -1.8407 1.501442 -0.5136606 0.6545883 -0.9730923
          [,29]       [,30]      [,31]     [,32]      [,33]    [,34]     [,35]
[1,] -0.5968634 -0.04739436 -0.8662236 0.5660665 0.08128688 1.808488 -1.400452
[2,] -0.5968634 -0.04739436 -0.8662236 0.5660665 0.08128688 1.808488 -1.400452
          [,36]    [,37]     [,38]     [,39]     [,40]    [,41]     [,42]
[1,] -0.6009837 1.125637 0.1719751 -0.296623 -2.597547 1.396533 0.8132157
[2,] -0.6009837 1.125637 0.1719751 -0.296623 -2.597547 1.396533 0.8132157
         [,43]      [,44]      [,45]   [,46]    [,47]     [,48]    [,49]
[1,] 0.1887154 -0.9250293 -0.6425428 1.65745 1.972593 0.5866134 -0.39258
[2,] 0.1887154 -0.9250293 -0.6425428 1.65745 1.972593 0.5866134 -0.39258
         [,50]    [,51]      [,52]     [,53]      [,54]     [,55]     [,56]
[1,] 0.6586264 1.413162 -0.7655138 0.5044604 -0.2122151 0.4292618 0.1836993
[2,] 0.6586264 1.413162 -0.7655138 0.5044604 -0.2122151 0.4292618 0.1836993
         [,57]    [,58]      [,59]     [,60]     [,61]    [,62]     [,63]
[1,] -2.147296 2.062009 -0.4215954 0.8916137 0.1294899 1.665544 0.4342869
[2,] -2.147296 2.062009 -0.4215954 0.8916137 0.1294899 1.665544 0.4342869
         [,64]    [,65]    [,66]     [,67]    [,68]    [,69]     [,70]
[1,] -1.244286 1.077517 -1.04303 -1.179814 1.506509 0.539818 0.5856626
[2,] -1.244286 1.077517 -1.04303 -1.179814 1.506509 0.539818 0.5856626
         [,71]      [,72]     [,73]     [,74]      [,75]     [,76]    [,77]
[1,] -1.869987 -0.6595189 -1.309018 0.8475917 0.09264923 0.1674116 1.148584
[2,] -1.869987 -0.6595189 -1.309018 0.8475917 0.09264923 0.1674116 1.148584
         [,78]    [,79]     [,80]       [,81]     [,82]      [,83]     [,84]
[1,] -1.059388 1.262392 0.5428199 -0.08309549 -1.091605 -0.3036057 0.9053008
[2,] -1.059388 1.262392 0.5428199 -0.08309549 -1.091605 -0.3036057 0.9053008
        [,85]    [,86]     [,87]     [,88]      [,89]     [,90]      [,91]
[1,] 1.319722 2.020772 0.9901662 -1.693861 -0.3112492 -1.963104 -0.2382959
[2,] 1.319722 2.020772 0.9901662 -1.693861 -0.3112492 -1.963104 -0.2382959
          [,92]     [,93]      [,94]      [,95]     [,96]     [,97]     [,98]
[1,] -0.6352764 0.9339188 -0.3503732 -0.7311139 -1.405609 -1.043777 -0.550971
[2,] -0.6352764 0.9339188 -0.3503732 -0.7311139 -1.405609 -1.043777 -0.550971
          [,99]   [,100]
[1,] 0.06776898 2.270706
[2,] 0.06776898 2.270706
> 
> 
> Max(tmp2)
[1] 1.746526
> Min(tmp2)
[1] -2.673062
> mean(tmp2)
[1] -0.1308301
> Sum(tmp2)
[1] -13.08301
> Var(tmp2)
[1] 0.8931725
> 
> rowMeans(tmp2)
  [1]  3.858641e-01  1.619721e+00  1.746526e+00 -1.417940e+00 -2.370330e+00
  [6]  5.944804e-01 -2.013676e+00 -6.149356e-01  4.144252e-01  7.464354e-02
 [11] -9.705934e-01 -1.909176e+00 -5.568803e-01 -7.167668e-01 -5.292290e-01
 [16]  8.557351e-01 -4.582693e-01  5.582048e-01  6.629538e-01 -9.340223e-01
 [21]  7.972077e-01 -2.058545e+00  1.828682e-01  8.418722e-01 -1.352056e+00
 [26] -4.299695e-01 -2.673062e+00  4.767215e-03  4.652389e-01 -1.997644e-01
 [31]  7.793827e-01  5.410987e-01  7.936509e-01  6.560559e-01 -7.651179e-01
 [36]  4.653154e-01 -9.030531e-01  1.856543e-01  8.196208e-05 -1.559462e-01
 [41]  4.294476e-01 -1.235964e+00  1.040592e+00 -3.234893e-01 -2.048398e+00
 [46]  6.196489e-01  4.256485e-01 -3.791503e-02  6.978660e-01  5.405540e-02
 [51] -1.298972e+00 -5.283295e-01  1.183029e+00  1.148859e-01 -2.347056e+00
 [56] -3.232798e-01 -9.319883e-01 -3.810943e-01  4.148422e-01 -3.681987e-01
 [61] -5.399368e-01  2.709758e-01  2.462084e-01  8.062316e-01 -4.519421e-01
 [66] -4.534202e-01  1.601833e+00 -3.684354e-01 -1.944407e-01 -1.234179e+00
 [71]  1.156988e+00  3.587568e-01 -2.349249e-01 -3.760873e-01 -6.120112e-01
 [76] -1.322644e+00 -1.236821e+00  2.585833e-01  7.139903e-02  8.677318e-01
 [81] -1.268125e-01 -6.847910e-01  6.649586e-01 -1.272895e+00  1.244573e+00
 [86] -1.302930e-01 -5.171878e-02  9.254684e-01  6.910573e-01 -6.572820e-01
 [91] -1.726795e-01 -6.249220e-01  5.392100e-01  1.020831e+00 -8.903763e-01
 [96]  1.282430e+00  1.437504e+00  5.091749e-02 -1.504226e+00 -1.895779e-01
> rowSums(tmp2)
  [1]  3.858641e-01  1.619721e+00  1.746526e+00 -1.417940e+00 -2.370330e+00
  [6]  5.944804e-01 -2.013676e+00 -6.149356e-01  4.144252e-01  7.464354e-02
 [11] -9.705934e-01 -1.909176e+00 -5.568803e-01 -7.167668e-01 -5.292290e-01
 [16]  8.557351e-01 -4.582693e-01  5.582048e-01  6.629538e-01 -9.340223e-01
 [21]  7.972077e-01 -2.058545e+00  1.828682e-01  8.418722e-01 -1.352056e+00
 [26] -4.299695e-01 -2.673062e+00  4.767215e-03  4.652389e-01 -1.997644e-01
 [31]  7.793827e-01  5.410987e-01  7.936509e-01  6.560559e-01 -7.651179e-01
 [36]  4.653154e-01 -9.030531e-01  1.856543e-01  8.196208e-05 -1.559462e-01
 [41]  4.294476e-01 -1.235964e+00  1.040592e+00 -3.234893e-01 -2.048398e+00
 [46]  6.196489e-01  4.256485e-01 -3.791503e-02  6.978660e-01  5.405540e-02
 [51] -1.298972e+00 -5.283295e-01  1.183029e+00  1.148859e-01 -2.347056e+00
 [56] -3.232798e-01 -9.319883e-01 -3.810943e-01  4.148422e-01 -3.681987e-01
 [61] -5.399368e-01  2.709758e-01  2.462084e-01  8.062316e-01 -4.519421e-01
 [66] -4.534202e-01  1.601833e+00 -3.684354e-01 -1.944407e-01 -1.234179e+00
 [71]  1.156988e+00  3.587568e-01 -2.349249e-01 -3.760873e-01 -6.120112e-01
 [76] -1.322644e+00 -1.236821e+00  2.585833e-01  7.139903e-02  8.677318e-01
 [81] -1.268125e-01 -6.847910e-01  6.649586e-01 -1.272895e+00  1.244573e+00
 [86] -1.302930e-01 -5.171878e-02  9.254684e-01  6.910573e-01 -6.572820e-01
 [91] -1.726795e-01 -6.249220e-01  5.392100e-01  1.020831e+00 -8.903763e-01
 [96]  1.282430e+00  1.437504e+00  5.091749e-02 -1.504226e+00 -1.895779e-01
> 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]  3.858641e-01  1.619721e+00  1.746526e+00 -1.417940e+00 -2.370330e+00
  [6]  5.944804e-01 -2.013676e+00 -6.149356e-01  4.144252e-01  7.464354e-02
 [11] -9.705934e-01 -1.909176e+00 -5.568803e-01 -7.167668e-01 -5.292290e-01
 [16]  8.557351e-01 -4.582693e-01  5.582048e-01  6.629538e-01 -9.340223e-01
 [21]  7.972077e-01 -2.058545e+00  1.828682e-01  8.418722e-01 -1.352056e+00
 [26] -4.299695e-01 -2.673062e+00  4.767215e-03  4.652389e-01 -1.997644e-01
 [31]  7.793827e-01  5.410987e-01  7.936509e-01  6.560559e-01 -7.651179e-01
 [36]  4.653154e-01 -9.030531e-01  1.856543e-01  8.196208e-05 -1.559462e-01
 [41]  4.294476e-01 -1.235964e+00  1.040592e+00 -3.234893e-01 -2.048398e+00
 [46]  6.196489e-01  4.256485e-01 -3.791503e-02  6.978660e-01  5.405540e-02
 [51] -1.298972e+00 -5.283295e-01  1.183029e+00  1.148859e-01 -2.347056e+00
 [56] -3.232798e-01 -9.319883e-01 -3.810943e-01  4.148422e-01 -3.681987e-01
 [61] -5.399368e-01  2.709758e-01  2.462084e-01  8.062316e-01 -4.519421e-01
 [66] -4.534202e-01  1.601833e+00 -3.684354e-01 -1.944407e-01 -1.234179e+00
 [71]  1.156988e+00  3.587568e-01 -2.349249e-01 -3.760873e-01 -6.120112e-01
 [76] -1.322644e+00 -1.236821e+00  2.585833e-01  7.139903e-02  8.677318e-01
 [81] -1.268125e-01 -6.847910e-01  6.649586e-01 -1.272895e+00  1.244573e+00
 [86] -1.302930e-01 -5.171878e-02  9.254684e-01  6.910573e-01 -6.572820e-01
 [91] -1.726795e-01 -6.249220e-01  5.392100e-01  1.020831e+00 -8.903763e-01
 [96]  1.282430e+00  1.437504e+00  5.091749e-02 -1.504226e+00 -1.895779e-01
> rowMin(tmp2)
  [1]  3.858641e-01  1.619721e+00  1.746526e+00 -1.417940e+00 -2.370330e+00
  [6]  5.944804e-01 -2.013676e+00 -6.149356e-01  4.144252e-01  7.464354e-02
 [11] -9.705934e-01 -1.909176e+00 -5.568803e-01 -7.167668e-01 -5.292290e-01
 [16]  8.557351e-01 -4.582693e-01  5.582048e-01  6.629538e-01 -9.340223e-01
 [21]  7.972077e-01 -2.058545e+00  1.828682e-01  8.418722e-01 -1.352056e+00
 [26] -4.299695e-01 -2.673062e+00  4.767215e-03  4.652389e-01 -1.997644e-01
 [31]  7.793827e-01  5.410987e-01  7.936509e-01  6.560559e-01 -7.651179e-01
 [36]  4.653154e-01 -9.030531e-01  1.856543e-01  8.196208e-05 -1.559462e-01
 [41]  4.294476e-01 -1.235964e+00  1.040592e+00 -3.234893e-01 -2.048398e+00
 [46]  6.196489e-01  4.256485e-01 -3.791503e-02  6.978660e-01  5.405540e-02
 [51] -1.298972e+00 -5.283295e-01  1.183029e+00  1.148859e-01 -2.347056e+00
 [56] -3.232798e-01 -9.319883e-01 -3.810943e-01  4.148422e-01 -3.681987e-01
 [61] -5.399368e-01  2.709758e-01  2.462084e-01  8.062316e-01 -4.519421e-01
 [66] -4.534202e-01  1.601833e+00 -3.684354e-01 -1.944407e-01 -1.234179e+00
 [71]  1.156988e+00  3.587568e-01 -2.349249e-01 -3.760873e-01 -6.120112e-01
 [76] -1.322644e+00 -1.236821e+00  2.585833e-01  7.139903e-02  8.677318e-01
 [81] -1.268125e-01 -6.847910e-01  6.649586e-01 -1.272895e+00  1.244573e+00
 [86] -1.302930e-01 -5.171878e-02  9.254684e-01  6.910573e-01 -6.572820e-01
 [91] -1.726795e-01 -6.249220e-01  5.392100e-01  1.020831e+00 -8.903763e-01
 [96]  1.282430e+00  1.437504e+00  5.091749e-02 -1.504226e+00 -1.895779e-01
> 
> colMeans(tmp2)
[1] -0.1308301
> colSums(tmp2)
[1] -13.08301
> colVars(tmp2)
[1] 0.8931725
> colSd(tmp2)
[1] 0.9450781
> colMax(tmp2)
[1] 1.746526
> colMin(tmp2)
[1] -2.673062
> colMedians(tmp2)
[1] -0.08926566
> colRanges(tmp2)
          [,1]
[1,] -2.673062
[2,]  1.746526
> 
> 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.00156797   1.80993888   2.67077127 -10.69021644   1.68514255
 [6]   0.04959628  -0.29200559  -5.20698967   5.34718044  -0.39572558
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1827843
[2,] -0.6624793
[3,] -0.1484910
[4,]  0.1133019
[5,]  0.9481356
> 
> rowApply(tmp,sum)
 [1] -4.1979724 -0.3522029 -3.3223195  4.2121780 -2.5301568  0.4902081
 [7] -0.3940919 -1.4552461 -4.3467831  4.8725106
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    8    3    3    6    2    6    5    9     1
 [2,]    2    2   10   10    2    7    3    9   10     7
 [3,]    3   10    7    2    8    8   10    7    3     6
 [4,]    1    1    4    1    1    6    4    2    6     9
 [5,]    9    3    9    8    3    4    7    8    5     2
 [6,]    6    5    8    7    5   10    5    6    1     4
 [7,]    4    6    6    9    9    3    1    1    8     8
 [8,]    7    4    2    4    4    1    9    3    4     5
 [9,]   10    7    5    5   10    5    8   10    7     3
[10,]    8    9    1    6    7    9    2    4    2    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.26103993  1.22629817  2.09406050 -0.22959782 -1.58446985 -0.66658633
 [7]  0.47909407 -2.07026370  0.65197412  2.72275277  3.70606687 -2.11866603
[13] -0.83508019  0.50233007  2.38300342 -0.09115523 -1.30302357 -2.82619922
[19] -3.90189077  3.66734138
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2615561
[2,] -0.6784983
[3,] -0.6404975
[4,] -0.2446615
[5,]  1.5641735
> 
> rowApply(tmp,sum)
[1] -6.608518  1.484624 -3.342145  5.873714  3.137274
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10   19    5    6    5
[2,]   15   15    8    8   15
[3,]   12   20    6    5   20
[4,]   19    9    4   19    3
[5,]    7    2   13   12   10
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]        [,5]       [,6]
[1,] -0.6784983  0.23327274 -0.2226886  1.0389990 -0.85285273 -1.1478244
[2,]  1.5641735  1.00950076  1.7076713 -0.4754941 -1.27794059  1.1970888
[3,] -1.2615561 -0.71145027 -0.8414850 -1.2772557 -0.01583927 -1.5414024
[4,] -0.2446615  0.02695701 -0.2805738  1.6576339  0.37673889  0.3949809
[5,] -0.6404975  0.66801793  1.7311366 -1.1734809  0.18542385  0.4305707
            [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -0.05490519 -0.8537526  0.1498426  1.2983367  0.7525778 -1.7147034
[2,] -0.79642955 -0.4805707 -0.8713207 -0.7827037 -0.1876567  1.4416776
[3,] -0.76304719 -0.2891381  1.1010779  1.3298972 -0.3708715 -1.4286698
[4,]  1.32589937  0.8063590 -0.3503557  1.0798703  2.1453040 -0.7541734
[5,]  0.76757663 -1.2531612  0.6227301 -0.2026478  1.3667132  0.3372030
          [,13]      [,14]      [,15]       [,16]       [,17]       [,18]
[1,] -0.8334487 -0.4054984  1.0172664 -0.70245264 -0.86096727 -2.08652614
[2,] -0.4808546 -0.2794579  1.3343058 -0.76304590 -1.34722999  0.56695886
[3,] -0.5963183  1.0294396  1.1382524  0.40099633  1.69305103 -0.04135345
[4,]  0.8221100  0.3845336 -0.2402108  0.02873357 -0.85633332  0.26557076
[5,]  0.2534315 -0.2266868 -0.8666103  0.94461341  0.06845597 -1.53084925
           [,19]     [,20]
[1,] -1.48105206 0.7963568
[2,] -0.14472252 0.5506741
[3,] -1.32574797 0.4292757
[4,] -0.99027493 0.2756066
[5,]  0.03990672 1.6154283
> 
> 
> 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 :  652  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 :  565  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.5645488 -1.220748 -0.4537028 -2.961407 -0.4214979 1.101894 -1.918756
         col8     col9    col10     col11    col12     col13     col14    col15
row1 1.719162 1.738465 1.173142 0.1064714 1.398459 0.1071391 0.7656237 1.661827
         col16     col17      col18       col19     col20
row1 -0.155351 0.8961089 -0.4084821 -0.02562199 -1.636817
> tmp[,"col10"]
            col10
row1  1.173141992
row2 -1.066663426
row3  0.285632152
row4  0.002733051
row5 -0.960884164
> tmp[c("row1","row5"),]
           col1      col2         col3       col4       col5       col6
row1 -0.5645488 -1.220748 -0.453702786 -2.9614068 -0.4214979  1.1018941
row5  0.7725137 -1.541792 -0.005883233 -0.5357445 -0.1786832 -0.5189345
            col7      col8       col9      col10      col11     col12     col13
row1 -1.91875616  1.719162  1.7384647  1.1731420  0.1064714  1.398459 0.1071391
row5  0.07787817 -1.005118 -0.2264344 -0.9608842 -0.1130470 -1.007701 0.7994430
         col14     col15      col16      col17         col18       col19
row1 0.7656237 1.6618266 -0.1553510  0.8961089 -0.4084821379 -0.02562199
row5 0.6441422 0.3807968  0.4980107 -0.8445696 -0.0007572463 -0.85394328
          col20
row1 -1.6368166
row5  0.9737929
> tmp[,c("col6","col20")]
            col6      col20
row1  1.10189406 -1.6368166
row2 -0.37913551 -0.3925038
row3  0.05958938  0.7642195
row4 -0.12022385 -1.5341709
row5 -0.51893447  0.9737929
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  1.1018941 -1.6368166
row5 -0.5189345  0.9737929
> 
> 
> 
> 
> 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.56799 49.2134 48.92857 50.67056 48.32524 105.3726 49.33985 49.98765
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.92564 50.56615 50.93977 51.41769 48.52127 49.14028 49.69006 48.56717
        col17    col18    col19    col20
row1 50.78182 49.60974 49.92146 105.0127
> tmp[,"col10"]
        col10
row1 50.56615
row2 28.40475
row3 30.82845
row4 29.55063
row5 50.99999
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.56799 49.21340 48.92857 50.67056 48.32524 105.3726 49.33985 49.98765
row5 49.93904 48.50246 51.19993 50.36403 49.83399 104.4019 52.24712 49.80817
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.92564 50.56615 50.93977 51.41769 48.52127 49.14028 49.69006 48.56717
row5 49.43924 50.99999 50.70652 50.43036 48.91645 50.63135 50.17556 49.20719
        col17    col18    col19    col20
row1 50.78182 49.60974 49.92146 105.0127
row5 50.45185 51.98883 49.85115 105.0944
> tmp[,c("col6","col20")]
          col6     col20
row1 105.37262 105.01267
row2  76.92105  74.81752
row3  73.45719  75.27659
row4  74.59306  75.81961
row5 104.40194 105.09438
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.3726 105.0127
row5 104.4019 105.0944
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.3726 105.0127
row5 104.4019 105.0944
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.1962776
[2,]  0.3914357
[3,] -0.1511086
[4,]  0.6844817
[5,] -0.2433633
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.2833688 -2.0432718
[2,] -0.0175350  0.6413176
[3,]  0.1508105  0.2359237
[4,]  0.7214196 -0.8416849
[5,] -0.1691560  0.9951240
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.6963820  0.3594457
[2,]  2.1605043  1.8912647
[3,]  1.0990996 -1.2560568
[4,]  0.3661544  0.1967333
[5,]  0.1830968  0.2385324
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -0.696382
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -0.696382
[2,]  2.160504
> 
> 
> 
> 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 0.357462418 -0.03779598 -0.5811724 -1.188493 -0.1649985 -0.002053512
row1 0.001175732  0.90482873  0.3838776  1.115308 -0.5491493 -0.834067533
           [,7]       [,8]       [,9]      [,10]      [,11]     [,12]     [,13]
row3 -0.8297631 -0.5063651 -1.7668171 -0.6411599 -0.4640322 0.4347643 -2.246021
row1 -0.3902969 -1.6775313  0.6961772  1.0513656  0.3695795 1.4223950  0.353592
         [,14]    [,15]     [,16]     [,17]     [,18]      [,19]      [,20]
row3 1.1678786 1.823644 0.1383263  1.105327 0.9787646 -0.5326735  0.3496535
row1 0.2137679 1.881822 0.5394174 -0.572164 1.3566367 -0.8621308 -0.2711682
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]       [,3]        [,4]       [,5]      [,6]       [,7]
row2 1.650404 -0.4855045 -0.9101826 -0.05203287 -0.3023268 -1.435308 -0.5885178
          [,8]      [,9]      [,10]
row2 -1.215372 0.9208791 -0.7610822
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]       [,5]     [,6]      [,7]
row5 0.8606067 0.5098366 0.8795061 -0.4672874 -0.3822962 1.792888 0.3585347
         [,8]     [,9]     [,10]      [,11]      [,12]     [,13]     [,14]
row5 1.353983 1.658272 -0.971786 -0.2791835 -0.4314227 -1.574451 0.4295808
         [,15]    [,16]      [,17]    [,18]     [,19]      [,20]
row5 -1.623429 -1.08981 -0.1710165 -1.13607 -1.087032 -0.2635294
> 
> 
> 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: 0x5d81d3704290>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a124633d490"
 [2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a12327589fc"
 [3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a12388a0825"
 [4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a1245fecd2f"
 [5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a1212514037"
 [6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a129374684" 
 [7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a122ff6a6f4"
 [8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a127f73cca0"
 [9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a121b640c8f"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a1246f5d281"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a126534d2e0"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a126c5acbc" 
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a12f50ea04" 
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a126a048cff"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1c2a125c97a9f9"
> 
> 
> ### 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: 0x5d81d3afdcd0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5d81d3afdcd0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5d81d3afdcd0>
> rowMedians(tmp)
  [1]  0.2160891674 -0.0670095762 -0.0081076590  0.1024692133 -0.0446868006
  [6] -0.2191216715 -0.0564542444  0.2252997059  0.0173193834 -0.3508659707
 [11] -0.0781161743 -0.0692039121  0.4102201855  0.0405840522 -0.3764197037
 [16] -0.0514613730 -0.0016056658  0.5426806264 -0.1461302517 -0.0206732893
 [21] -0.2804453059 -0.0101897707  0.2116087729  0.3678064149 -0.2701410690
 [26] -0.2953857418  0.6938900781 -0.3927696611 -0.0921491742 -0.5913131688
 [31] -0.0338324642 -0.1796601280  0.4025458074  0.0453955878 -0.2140990725
 [36]  0.1662296530  0.4290664658  0.6409376837  0.3441876484  0.0672884074
 [41]  0.2288339199 -0.0969824533 -0.6851242521 -0.0752300498 -0.2487788672
 [46]  0.0580056924  0.4956461796  0.2722490612 -0.5399919413 -0.1810749447
 [51] -0.1094179633 -0.3780823418 -0.4326907401 -0.3656406464  0.1350078827
 [56]  0.0664000148  0.7870821304  0.0432434005  0.2125980342  0.1553809551
 [61]  0.1030665924 -0.1878184076  0.5350291942 -0.2708712360 -0.4594914431
 [66]  0.2388121191 -0.2981714829  0.2571951026  0.4376324891 -0.3745662043
 [71] -0.2711344527  0.2484158794 -0.2519367801 -0.1646335867  0.8263057215
 [76] -0.1062928487 -0.1204962168 -0.0682893515  0.2623884280  0.0955411539
 [81]  0.6342637818  0.6052288353  0.4840036043 -0.2220683259 -0.2443223484
 [86] -0.1498513544  0.3836467956  0.5109058150 -0.2615059045 -0.4857548527
 [91]  0.2123379880 -0.1009831088  0.1957380122 -0.0429666966  0.0410819571
 [96]  0.2378732168 -0.0226237559  0.0856499735 -0.3014037800  0.0246709160
[101]  0.4120798052  0.1984968911  0.0348956396  0.2636174929 -0.5040929387
[106] -0.5728667061 -0.1605734122 -0.1816006976 -0.1337897321 -0.3061513848
[111]  0.1617472219 -0.2296597726 -0.4182932250  0.1571289816  0.1558685963
[116]  0.0710199968 -0.6151533832 -0.1769368832 -0.4319160479 -0.2981838942
[121]  0.2284223174 -0.7929441440  0.1820142672 -0.4846848130  0.1154495047
[126]  0.3480156550  0.1186521218 -0.3559901680 -0.3932360501  0.1702110106
[131] -0.1631685785 -0.0700829210 -0.0318673200 -0.5261051449 -0.4985599181
[136]  0.1797339230 -0.1992798356 -0.3732467896 -0.2985247653 -0.4736348062
[141]  0.3169871577 -0.1163551649 -0.2716699510 -0.3465150423 -0.7635521090
[146] -0.0434152761 -0.2706434196 -0.0135726457  0.1057336147 -0.0104693172
[151] -0.6722707648 -0.5249571341  0.8388212632 -0.2776630393  0.0591540111
[156] -0.2425488462  0.0044285118  0.2276371779  0.1614059005 -0.7267595574
[161] -0.0577626162  0.1930372594 -0.1131761263 -0.5667548433  0.1218522156
[166]  0.1980784795  0.3533915069 -0.1593678626 -0.1862025526 -0.0080864305
[171] -0.3325075579 -0.0133209916  0.4094862172  0.2301169478  0.2268172030
[176]  0.0440982462 -0.0625470406 -0.1362874077 -0.7451278065  0.1133183081
[181]  0.5387783693 -0.3006692643 -0.1051884738 -0.2099458758 -0.1484834142
[186] -0.0222867267 -0.1052116098 -0.5257304184 -0.9177748046  0.3530404874
[191]  0.9658105535 -0.2593494869 -0.3126556068 -0.6687765958 -0.2709364672
[196] -0.4427834105 -0.0478847004 -0.5177682198 -0.2486567320  0.5063377415
[201] -0.0836715004  0.0883528373 -0.4712185167  0.5917496685  0.1995524697
[206]  0.4768429672 -0.2111314065 -0.4640041255  0.0354334318 -0.2411238379
[211]  0.6533141979  0.2521292325 -0.4668414974 -0.6171892588 -0.0569392805
[216]  0.1446938106  0.0463270933  0.0008338704 -0.1335492711 -0.3788424287
[221]  0.3996934770  0.2606597882 -0.3279831821  0.1444640344  0.0768539412
[226]  0.3862374058  0.0257812804  0.2009502847 -0.2413977778  0.0529790289
> 
> proc.time()
   user  system elapsed 
  1.305   0.690   1.982 

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: 0x64e47cff6520>
> .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: 0x64e47cff6520>
> .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: 0x64e47cff6520>
> .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: 0x64e47cff6520>
> 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: 0x64e47cb9ff60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64e47cb9ff60>
> .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: 0x64e47cb9ff60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64e47cb9ff60>
> .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: 0x64e47cb9ff60>
> 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: 0x64e47d749b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64e47d749b40>
> .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: 0x64e47d749b40>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x64e47d749b40>
> .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: 0x64e47d749b40>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x64e47d749b40>
> .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: 0x64e47d749b40>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x64e47d749b40>
> .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: 0x64e47d749b40>
> 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: 0x64e47d786bc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x64e47d786bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64e47d786bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64e47d786bc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1c2aa217e8b370" "BufferedMatrixFile1c2aa21df90517"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1c2aa217e8b370" "BufferedMatrixFile1c2aa21df90517"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x64e47d720000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64e47d720000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x64e47d720000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x64e47d720000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x64e47d720000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x64e47d720000>
> .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: 0x64e47c853e30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x64e47c853e30>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x64e47c853e30>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x64e47c853e30>
> 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: 0x64e47ce7da50>
> .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: 0x64e47ce7da50>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.259   0.054   0.302 

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.260   0.042   0.290 

Example timings