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

This page was generated on 2025-09-01 11:42 -0400 (Mon, 01 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4824
merida1macOS 12.7.5 Montereyx86_644.5.1 RC (2025-06-05 r88288) -- "Great Square Root" 4606
kjohnson1macOS 13.6.6 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4547
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4579
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 252/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.72.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-28 13:40 -0400 (Thu, 28 Aug 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_21
git_last_commit: aa9e634
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kunpeng2

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.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.72.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.72.0.tar.gz
StartedAt: 2025-08-29 07:04:58 -0000 (Fri, 29 Aug 2025)
EndedAt: 2025-08-29 07:05:21 -0000 (Fri, 29 Aug 2025)
EllapsedTime: 23.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-02-19 r87757)
* using platform: aarch64-unknown-linux-gnu
* R was compiled by
    aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0
    GNU Fortran (GCC) 14.2.0
* running under: openEuler 24.03 (LTS-SP1)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.72.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/R/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/R/R-devel_2025-02-19/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.72.0’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/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){
      |            ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R/lib -lR
installing to /home/biocbuild/R/R-devel_2025-02-19/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 Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.333   0.032   0.353 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 477833 25.6    1045337 55.9   639800 34.2
Vcells 884297  6.8    8388608 64.0  2080696 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Aug 29 07:05:16 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug 29 07:05:16 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0xde946e0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Aug 29 07:05:16 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug 29 07:05:16 2025"
> 
> ColMode(tmp2)
<pointer: 0xde946e0>
> 
> 
> 
> ### 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.0959841  0.9116966 -0.968570 -0.01785811
[2,]  -0.6726652 -0.3272832 -1.515464  0.07108145
[3,]   0.1625737 -0.6451082  1.384621 -0.93746731
[4,]   0.6693026  0.7065825 -1.563135 -2.36315198
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]     [,3]       [,4]
[1,] 100.0959841 0.9116966 0.968570 0.01785811
[2,]   0.6726652 0.3272832 1.515464 0.07108145
[3,]   0.1625737 0.6451082 1.384621 0.93746731
[4,]   0.6693026 0.7065825 1.563135 2.36315198
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0047981 0.9548281 0.9841596 0.1336343
[2,]  0.8201617 0.5720867 1.2310417 0.2666110
[3,]  0.4032043 0.8031863 1.1766993 0.9682290
[4,]  0.8181092 0.8405846 1.2502539 1.5372547
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.14396 35.45998 35.81017 26.35420
[2,]  33.87428 31.04815 38.82588 27.73719
[3,]  29.19462 33.67697 38.15161 35.61976
[4,]  33.85039 34.11243 39.06567 42.73570
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xc46c520>
> exp(tmp5)
<pointer: 0xc46c520>
> log(tmp5,2)
<pointer: 0xc46c520>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.6077
> Min(tmp5)
[1] 53.47185
> mean(tmp5)
[1] 72.19724
> Sum(tmp5)
[1] 14439.45
> Var(tmp5)
[1] 860.3932
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.19064 66.42517 70.48970 72.36829 69.66420 71.44975 70.65596 70.91274
 [9] 68.42961 72.38632
> rowSums(tmp5)
 [1] 1783.813 1328.503 1409.794 1447.366 1393.284 1428.995 1413.119 1418.255
 [9] 1368.592 1447.726
> rowVars(tmp5)
 [1] 8028.36601   85.32401   68.58041   97.91504   72.97904   43.01053
 [7]   68.73037   55.42029   78.41905   44.03813
> rowSd(tmp5)
 [1] 89.601150  9.237100  8.281329  9.895203  8.542777  6.558241  8.290378
 [8]  7.444480  8.855453  6.636123
> rowMax(tmp5)
 [1] 468.60766  88.43192  86.57259  88.94876  84.41042  81.00451  88.42700
 [8]  86.51790  86.81714  83.96180
> rowMin(tmp5)
 [1] 54.85282 55.09536 58.90065 53.68386 54.16637 55.89166 56.09410 60.13988
 [9] 53.47185 58.56558
> 
> colMeans(tmp5)
 [1] 107.80789  71.04734  72.16597  73.28824  73.73187  67.81919  73.61270
 [8]  67.25553  70.89898  71.61318  70.19092  69.86379  69.92661  69.60793
[15]  69.42690  65.04706  72.62880  68.55558  69.29114  70.16514
> colSums(tmp5)
 [1] 1078.0789  710.4734  721.6597  732.8824  737.3187  678.1919  736.1270
 [8]  672.5553  708.9898  716.1318  701.9092  698.6379  699.2661  696.0793
[15]  694.2690  650.4706  726.2880  685.5558  692.9114  701.6514
> colVars(tmp5)
 [1] 16109.40150    39.56443    66.20466   130.38516    64.27655    81.48014
 [7]    52.39944    94.42486    47.38248    38.18169    54.19181   100.01209
[13]    42.23968    68.15417    97.26436    73.65671    65.72040    80.11270
[19]    88.33077    45.57941
> colSd(tmp5)
 [1] 126.922817   6.290026   8.136624  11.418632   8.017266   9.026635
 [7]   7.238746   9.717245   6.883493   6.179133   7.361509  10.000605
[13]   6.499206   8.255554   9.862270   8.582349   8.106812   8.950570
[19]   9.398445   6.751252
> colMax(tmp5)
 [1] 468.60766  86.51790  81.31008  88.94876  84.41042  77.98238  80.89930
 [8]  85.38571  80.65262  80.47450  86.81714  88.43192  80.22516  86.57259
[15]  83.96180  76.06863  84.15127  83.50426  88.42700  80.84416
> colMin(tmp5)
 [1] 56.09410 63.59515 57.22931 54.85282 60.90970 53.68386 60.48242 53.47185
 [9] 58.56558 60.88434 61.26164 55.89166 62.57692 55.68761 54.16637 54.34033
[17] 60.77616 56.74090 55.70199 61.64097
> 
> 
> ### 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] 89.19064 66.42517       NA 72.36829 69.66420 71.44975 70.65596 70.91274
 [9] 68.42961 72.38632
> rowSums(tmp5)
 [1] 1783.813 1328.503       NA 1447.366 1393.284 1428.995 1413.119 1418.255
 [9] 1368.592 1447.726
> rowVars(tmp5)
 [1] 8028.36601   85.32401   70.00555   97.91504   72.97904   43.01053
 [7]   68.73037   55.42029   78.41905   44.03813
> rowSd(tmp5)
 [1] 89.601150  9.237100  8.366932  9.895203  8.542777  6.558241  8.290378
 [8]  7.444480  8.855453  6.636123
> rowMax(tmp5)
 [1] 468.60766  88.43192        NA  88.94876  84.41042  81.00451  88.42700
 [8]  86.51790  86.81714  83.96180
> rowMin(tmp5)
 [1] 54.85282 55.09536       NA 53.68386 54.16637 55.89166 56.09410 60.13988
 [9] 53.47185 58.56558
> 
> colMeans(tmp5)
 [1] 107.80789  71.04734  72.16597  73.28824  73.73187  67.81919  73.61270
 [8]  67.25553  70.89898  71.61318  70.19092  69.86379  69.92661  69.60793
[15]  69.42690  65.04706  72.62880        NA  69.29114  70.16514
> colSums(tmp5)
 [1] 1078.0789  710.4734  721.6597  732.8824  737.3187  678.1919  736.1270
 [8]  672.5553  708.9898  716.1318  701.9092  698.6379  699.2661  696.0793
[15]  694.2690  650.4706  726.2880        NA  692.9114  701.6514
> colVars(tmp5)
 [1] 16109.40150    39.56443    66.20466   130.38516    64.27655    81.48014
 [7]    52.39944    94.42486    47.38248    38.18169    54.19181   100.01209
[13]    42.23968    68.15417    97.26436    73.65671    65.72040          NA
[19]    88.33077    45.57941
> colSd(tmp5)
 [1] 126.922817   6.290026   8.136624  11.418632   8.017266   9.026635
 [7]   7.238746   9.717245   6.883493   6.179133   7.361509  10.000605
[13]   6.499206   8.255554   9.862270   8.582349   8.106812         NA
[19]   9.398445   6.751252
> colMax(tmp5)
 [1] 468.60766  86.51790  81.31008  88.94876  84.41042  77.98238  80.89930
 [8]  85.38571  80.65262  80.47450  86.81714  88.43192  80.22516  86.57259
[15]  83.96180  76.06863  84.15127        NA  88.42700  80.84416
> colMin(tmp5)
 [1] 56.09410 63.59515 57.22931 54.85282 60.90970 53.68386 60.48242 53.47185
 [9] 58.56558 60.88434 61.26164 55.89166 62.57692 55.68761 54.16637 54.34033
[17] 60.77616       NA 55.70199 61.64097
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.6077
> Min(tmp5,na.rm=TRUE)
[1] 53.47185
> mean(tmp5,na.rm=TRUE)
[1] 72.23791
> Sum(tmp5,na.rm=TRUE)
[1] 14375.34
> Var(tmp5,na.rm=TRUE)
[1] 864.4061
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.19064 66.42517 70.82581 72.36829 69.66420 71.44975 70.65596 70.91274
 [9] 68.42961 72.38632
> rowSums(tmp5,na.rm=TRUE)
 [1] 1783.813 1328.503 1345.690 1447.366 1393.284 1428.995 1413.119 1418.255
 [9] 1368.592 1447.726
> rowVars(tmp5,na.rm=TRUE)
 [1] 8028.36601   85.32401   70.00555   97.91504   72.97904   43.01053
 [7]   68.73037   55.42029   78.41905   44.03813
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.601150  9.237100  8.366932  9.895203  8.542777  6.558241  8.290378
 [8]  7.444480  8.855453  6.636123
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.60766  88.43192  86.57259  88.94876  84.41042  81.00451  88.42700
 [8]  86.51790  86.81714  83.96180
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.85282 55.09536 58.90065 53.68386 54.16637 55.89166 56.09410 60.13988
 [9] 53.47185 58.56558
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.80789  71.04734  72.16597  73.28824  73.73187  67.81919  73.61270
 [8]  67.25553  70.89898  71.61318  70.19092  69.86379  69.92661  69.60793
[15]  69.42690  65.04706  72.62880  69.05024  69.29114  70.16514
> colSums(tmp5,na.rm=TRUE)
 [1] 1078.0789  710.4734  721.6597  732.8824  737.3187  678.1919  736.1270
 [8]  672.5553  708.9898  716.1318  701.9092  698.6379  699.2661  696.0793
[15]  694.2690  650.4706  726.2880  621.4522  692.9114  701.6514
> colVars(tmp5,na.rm=TRUE)
 [1] 16109.40150    39.56443    66.20466   130.38516    64.27655    81.48014
 [7]    52.39944    94.42486    47.38248    38.18169    54.19181   100.01209
[13]    42.23968    68.15417    97.26436    73.65671    65.72040    87.37406
[19]    88.33077    45.57941
> colSd(tmp5,na.rm=TRUE)
 [1] 126.922817   6.290026   8.136624  11.418632   8.017266   9.026635
 [7]   7.238746   9.717245   6.883493   6.179133   7.361509  10.000605
[13]   6.499206   8.255554   9.862270   8.582349   8.106812   9.347409
[19]   9.398445   6.751252
> colMax(tmp5,na.rm=TRUE)
 [1] 468.60766  86.51790  81.31008  88.94876  84.41042  77.98238  80.89930
 [8]  85.38571  80.65262  80.47450  86.81714  88.43192  80.22516  86.57259
[15]  83.96180  76.06863  84.15127  83.50426  88.42700  80.84416
> colMin(tmp5,na.rm=TRUE)
 [1] 56.09410 63.59515 57.22931 54.85282 60.90970 53.68386 60.48242 53.47185
 [9] 58.56558 60.88434 61.26164 55.89166 62.57692 55.68761 54.16637 54.34033
[17] 60.77616 56.74090 55.70199 61.64097
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.19064 66.42517      NaN 72.36829 69.66420 71.44975 70.65596 70.91274
 [9] 68.42961 72.38632
> rowSums(tmp5,na.rm=TRUE)
 [1] 1783.813 1328.503    0.000 1447.366 1393.284 1428.995 1413.119 1418.255
 [9] 1368.592 1447.726
> rowVars(tmp5,na.rm=TRUE)
 [1] 8028.36601   85.32401         NA   97.91504   72.97904   43.01053
 [7]   68.73037   55.42029   78.41905   44.03813
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.601150  9.237100        NA  9.895203  8.542777  6.558241  8.290378
 [8]  7.444480  8.855453  6.636123
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.60766  88.43192        NA  88.94876  84.41042  81.00451  88.42700
 [8]  86.51790  86.81714  83.96180
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.85282 55.09536       NA 53.68386 54.16637 55.89166 56.09410 60.13988
 [9] 53.47185 58.56558
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.03490  71.15324  71.36135  73.19384  73.57772  68.64044  75.07162
 [8]  66.94781  70.76693  71.39584  69.84885  70.79248  70.72048  67.72297
[15]  67.98881  65.72999  71.77337       NaN  68.40675  70.56164
> colSums(tmp5,na.rm=TRUE)
 [1] 1017.3141  640.3792  642.2521  658.7446  662.1995  617.7640  675.6445
 [8]  602.5303  636.9023  642.5626  628.6396  637.1323  636.4844  609.5067
[15]  611.8993  591.5699  645.9603    0.0000  615.6608  635.0548
> colVars(tmp5,na.rm=TRUE)
 [1] 17815.70792    44.38380    67.19677   146.58305    72.04377    84.07748
 [7]    35.00434   105.16269    53.10911    42.42299    59.64941   102.81093
[13]    40.42938    36.70127    86.15634    77.61681    65.70310          NA
[19]    90.57294    49.50820
> colSd(tmp5,na.rm=TRUE)
 [1] 133.475496   6.662117   8.197364  12.107149   8.487860   9.169377
 [7]   5.916447  10.254886   7.287600   6.513293   7.723303  10.139572
[13]   6.358410   6.058157   9.282044   8.810040   8.105745         NA
[19]   9.516982   7.036207
> colMax(tmp5,na.rm=TRUE)
 [1] 468.60766  86.51790  81.31008  88.94876  84.41042  77.98238  80.89930
 [8]  85.38571  80.65262  80.47450  86.81714  88.43192  80.22516  73.99901
[15]  83.96180  76.06863  84.15127      -Inf  88.42700  80.84416
> colMin(tmp5,na.rm=TRUE)
 [1] 56.09410 63.59515 57.22931 54.85282 60.90970 53.68386 64.90204 53.47185
 [9] 58.56558 60.88434 61.26164 55.89166 62.57692 55.68761 54.16637 54.34033
[17] 60.77616      Inf 55.70199 61.64097
> 
> 
> 
> 
> 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] 161.0359 163.3255 225.6928 243.3994 210.8361 199.7685 285.1227 239.0654
 [9] 256.6060 237.4944
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 161.0359 163.3255 225.6928 243.3994 210.8361 199.7685 285.1227 239.0654
 [9] 256.6060 237.4944
> 
> 
> 
> 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]  0.000000e+00  5.684342e-14 -1.136868e-13 -3.410605e-13 -1.136868e-13
 [6] -5.684342e-14  0.000000e+00 -2.273737e-13  6.252776e-13 -5.684342e-14
[11]  8.526513e-14 -1.136868e-13  5.684342e-14  5.684342e-14  2.557954e-13
[16] -1.136868e-13  0.000000e+00 -2.842171e-14  0.000000e+00  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   19 
3   19 
7   18 
1   15 
7   8 
2   1 
7   17 
2   4 
7   19 
1   13 
4   9 
2   13 
1   6 
9   18 
3   13 
5   19 
4   11 
2   12 
2   5 
3   2 
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.840931
> Min(tmp)
[1] -2.958813
> mean(tmp)
[1] 0.1949279
> Sum(tmp)
[1] 19.49279
> Var(tmp)
[1] 1.359678
> 
> rowMeans(tmp)
[1] 0.1949279
> rowSums(tmp)
[1] 19.49279
> rowVars(tmp)
[1] 1.359678
> rowSd(tmp)
[1] 1.166052
> rowMax(tmp)
[1] 2.840931
> rowMin(tmp)
[1] -2.958813
> 
> colMeans(tmp)
  [1]  1.2337589085  0.1461411244 -0.3992480280 -0.0004584311  1.0609199326
  [6]  1.1387939531  0.1689133190  0.3508767006 -0.8707957980  1.0411993589
 [11]  0.7153271817  0.5068969115 -0.0821533808  1.9470908406 -1.6033372203
 [16]  0.8311280264  0.7793561205 -1.6644534045  0.4783146868 -0.0306493939
 [21] -0.7955555956  0.0487775186 -1.2815909800 -0.8148966136  1.0527393676
 [26]  2.2827355317 -0.3045191074 -0.4748196369  1.1872427260  0.0970908777
 [31]  1.0613043250  0.6162074591 -1.0038181737 -0.0733161599  0.9125792820
 [36]  1.6201269959 -0.4786088455  0.6515170777  1.5959578744  0.6528816873
 [41]  1.7089665016  2.1280158818  1.0583204648 -1.0438208693 -0.9386897389
 [46]  0.6686103810 -1.7608222701  1.3121273031  0.4621626236 -0.5929484719
 [51]  0.2987864826  2.7269579246 -1.2964996588  1.0961252265 -0.3585084946
 [56]  1.6773779626  1.5361080549  0.5544288674 -2.9588134656  1.2234526187
 [61]  0.0356537749 -0.9932724072 -1.2450193358 -1.3559031189  0.2833304814
 [66] -0.4525861140  0.1535196302 -0.4321389475  1.1144106885  0.2113117440
 [71]  0.0021675615  0.7907540746  0.2647148117  1.8564332222 -1.5323803162
 [76] -1.0354979064 -2.3708528461  1.4789634830  1.4577589309 -1.0169793143
 [81]  0.2211045759 -0.2447290150  1.5928768753  2.8409309344  1.0416982041
 [86]  2.5107156126 -1.1970739221 -1.0348042891 -1.0597298605  0.4517925320
 [91] -0.8044361981 -1.1283570271  0.9735652503  0.5792160249  0.7437293672
 [96] -1.5593751943 -0.8993396480  0.8732878868  0.3394502393 -1.7631113252
> colSums(tmp)
  [1]  1.2337589085  0.1461411244 -0.3992480280 -0.0004584311  1.0609199326
  [6]  1.1387939531  0.1689133190  0.3508767006 -0.8707957980  1.0411993589
 [11]  0.7153271817  0.5068969115 -0.0821533808  1.9470908406 -1.6033372203
 [16]  0.8311280264  0.7793561205 -1.6644534045  0.4783146868 -0.0306493939
 [21] -0.7955555956  0.0487775186 -1.2815909800 -0.8148966136  1.0527393676
 [26]  2.2827355317 -0.3045191074 -0.4748196369  1.1872427260  0.0970908777
 [31]  1.0613043250  0.6162074591 -1.0038181737 -0.0733161599  0.9125792820
 [36]  1.6201269959 -0.4786088455  0.6515170777  1.5959578744  0.6528816873
 [41]  1.7089665016  2.1280158818  1.0583204648 -1.0438208693 -0.9386897389
 [46]  0.6686103810 -1.7608222701  1.3121273031  0.4621626236 -0.5929484719
 [51]  0.2987864826  2.7269579246 -1.2964996588  1.0961252265 -0.3585084946
 [56]  1.6773779626  1.5361080549  0.5544288674 -2.9588134656  1.2234526187
 [61]  0.0356537749 -0.9932724072 -1.2450193358 -1.3559031189  0.2833304814
 [66] -0.4525861140  0.1535196302 -0.4321389475  1.1144106885  0.2113117440
 [71]  0.0021675615  0.7907540746  0.2647148117  1.8564332222 -1.5323803162
 [76] -1.0354979064 -2.3708528461  1.4789634830  1.4577589309 -1.0169793143
 [81]  0.2211045759 -0.2447290150  1.5928768753  2.8409309344  1.0416982041
 [86]  2.5107156126 -1.1970739221 -1.0348042891 -1.0597298605  0.4517925320
 [91] -0.8044361981 -1.1283570271  0.9735652503  0.5792160249  0.7437293672
 [96] -1.5593751943 -0.8993396480  0.8732878868  0.3394502393 -1.7631113252
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.2337589085  0.1461411244 -0.3992480280 -0.0004584311  1.0609199326
  [6]  1.1387939531  0.1689133190  0.3508767006 -0.8707957980  1.0411993589
 [11]  0.7153271817  0.5068969115 -0.0821533808  1.9470908406 -1.6033372203
 [16]  0.8311280264  0.7793561205 -1.6644534045  0.4783146868 -0.0306493939
 [21] -0.7955555956  0.0487775186 -1.2815909800 -0.8148966136  1.0527393676
 [26]  2.2827355317 -0.3045191074 -0.4748196369  1.1872427260  0.0970908777
 [31]  1.0613043250  0.6162074591 -1.0038181737 -0.0733161599  0.9125792820
 [36]  1.6201269959 -0.4786088455  0.6515170777  1.5959578744  0.6528816873
 [41]  1.7089665016  2.1280158818  1.0583204648 -1.0438208693 -0.9386897389
 [46]  0.6686103810 -1.7608222701  1.3121273031  0.4621626236 -0.5929484719
 [51]  0.2987864826  2.7269579246 -1.2964996588  1.0961252265 -0.3585084946
 [56]  1.6773779626  1.5361080549  0.5544288674 -2.9588134656  1.2234526187
 [61]  0.0356537749 -0.9932724072 -1.2450193358 -1.3559031189  0.2833304814
 [66] -0.4525861140  0.1535196302 -0.4321389475  1.1144106885  0.2113117440
 [71]  0.0021675615  0.7907540746  0.2647148117  1.8564332222 -1.5323803162
 [76] -1.0354979064 -2.3708528461  1.4789634830  1.4577589309 -1.0169793143
 [81]  0.2211045759 -0.2447290150  1.5928768753  2.8409309344  1.0416982041
 [86]  2.5107156126 -1.1970739221 -1.0348042891 -1.0597298605  0.4517925320
 [91] -0.8044361981 -1.1283570271  0.9735652503  0.5792160249  0.7437293672
 [96] -1.5593751943 -0.8993396480  0.8732878868  0.3394502393 -1.7631113252
> colMin(tmp)
  [1]  1.2337589085  0.1461411244 -0.3992480280 -0.0004584311  1.0609199326
  [6]  1.1387939531  0.1689133190  0.3508767006 -0.8707957980  1.0411993589
 [11]  0.7153271817  0.5068969115 -0.0821533808  1.9470908406 -1.6033372203
 [16]  0.8311280264  0.7793561205 -1.6644534045  0.4783146868 -0.0306493939
 [21] -0.7955555956  0.0487775186 -1.2815909800 -0.8148966136  1.0527393676
 [26]  2.2827355317 -0.3045191074 -0.4748196369  1.1872427260  0.0970908777
 [31]  1.0613043250  0.6162074591 -1.0038181737 -0.0733161599  0.9125792820
 [36]  1.6201269959 -0.4786088455  0.6515170777  1.5959578744  0.6528816873
 [41]  1.7089665016  2.1280158818  1.0583204648 -1.0438208693 -0.9386897389
 [46]  0.6686103810 -1.7608222701  1.3121273031  0.4621626236 -0.5929484719
 [51]  0.2987864826  2.7269579246 -1.2964996588  1.0961252265 -0.3585084946
 [56]  1.6773779626  1.5361080549  0.5544288674 -2.9588134656  1.2234526187
 [61]  0.0356537749 -0.9932724072 -1.2450193358 -1.3559031189  0.2833304814
 [66] -0.4525861140  0.1535196302 -0.4321389475  1.1144106885  0.2113117440
 [71]  0.0021675615  0.7907540746  0.2647148117  1.8564332222 -1.5323803162
 [76] -1.0354979064 -2.3708528461  1.4789634830  1.4577589309 -1.0169793143
 [81]  0.2211045759 -0.2447290150  1.5928768753  2.8409309344  1.0416982041
 [86]  2.5107156126 -1.1970739221 -1.0348042891 -1.0597298605  0.4517925320
 [91] -0.8044361981 -1.1283570271  0.9735652503  0.5792160249  0.7437293672
 [96] -1.5593751943 -0.8993396480  0.8732878868  0.3394502393 -1.7631113252
> colMedians(tmp)
  [1]  1.2337589085  0.1461411244 -0.3992480280 -0.0004584311  1.0609199326
  [6]  1.1387939531  0.1689133190  0.3508767006 -0.8707957980  1.0411993589
 [11]  0.7153271817  0.5068969115 -0.0821533808  1.9470908406 -1.6033372203
 [16]  0.8311280264  0.7793561205 -1.6644534045  0.4783146868 -0.0306493939
 [21] -0.7955555956  0.0487775186 -1.2815909800 -0.8148966136  1.0527393676
 [26]  2.2827355317 -0.3045191074 -0.4748196369  1.1872427260  0.0970908777
 [31]  1.0613043250  0.6162074591 -1.0038181737 -0.0733161599  0.9125792820
 [36]  1.6201269959 -0.4786088455  0.6515170777  1.5959578744  0.6528816873
 [41]  1.7089665016  2.1280158818  1.0583204648 -1.0438208693 -0.9386897389
 [46]  0.6686103810 -1.7608222701  1.3121273031  0.4621626236 -0.5929484719
 [51]  0.2987864826  2.7269579246 -1.2964996588  1.0961252265 -0.3585084946
 [56]  1.6773779626  1.5361080549  0.5544288674 -2.9588134656  1.2234526187
 [61]  0.0356537749 -0.9932724072 -1.2450193358 -1.3559031189  0.2833304814
 [66] -0.4525861140  0.1535196302 -0.4321389475  1.1144106885  0.2113117440
 [71]  0.0021675615  0.7907540746  0.2647148117  1.8564332222 -1.5323803162
 [76] -1.0354979064 -2.3708528461  1.4789634830  1.4577589309 -1.0169793143
 [81]  0.2211045759 -0.2447290150  1.5928768753  2.8409309344  1.0416982041
 [86]  2.5107156126 -1.1970739221 -1.0348042891 -1.0597298605  0.4517925320
 [91] -0.8044361981 -1.1283570271  0.9735652503  0.5792160249  0.7437293672
 [96] -1.5593751943 -0.8993396480  0.8732878868  0.3394502393 -1.7631113252
> colRanges(tmp)
         [,1]      [,2]      [,3]          [,4]    [,5]     [,6]      [,7]
[1,] 1.233759 0.1461411 -0.399248 -0.0004584311 1.06092 1.138794 0.1689133
[2,] 1.233759 0.1461411 -0.399248 -0.0004584311 1.06092 1.138794 0.1689133
          [,8]       [,9]    [,10]     [,11]     [,12]       [,13]    [,14]
[1,] 0.3508767 -0.8707958 1.041199 0.7153272 0.5068969 -0.08215338 1.947091
[2,] 0.3508767 -0.8707958 1.041199 0.7153272 0.5068969 -0.08215338 1.947091
         [,15]    [,16]     [,17]     [,18]     [,19]       [,20]      [,21]
[1,] -1.603337 0.831128 0.7793561 -1.664453 0.4783147 -0.03064939 -0.7955556
[2,] -1.603337 0.831128 0.7793561 -1.664453 0.4783147 -0.03064939 -0.7955556
          [,22]     [,23]      [,24]    [,25]    [,26]      [,27]      [,28]
[1,] 0.04877752 -1.281591 -0.8148966 1.052739 2.282736 -0.3045191 -0.4748196
[2,] 0.04877752 -1.281591 -0.8148966 1.052739 2.282736 -0.3045191 -0.4748196
        [,29]      [,30]    [,31]     [,32]     [,33]       [,34]     [,35]
[1,] 1.187243 0.09709088 1.061304 0.6162075 -1.003818 -0.07331616 0.9125793
[2,] 1.187243 0.09709088 1.061304 0.6162075 -1.003818 -0.07331616 0.9125793
        [,36]      [,37]     [,38]    [,39]     [,40]    [,41]    [,42]   [,43]
[1,] 1.620127 -0.4786088 0.6515171 1.595958 0.6528817 1.708967 2.128016 1.05832
[2,] 1.620127 -0.4786088 0.6515171 1.595958 0.6528817 1.708967 2.128016 1.05832
         [,44]      [,45]     [,46]     [,47]    [,48]     [,49]      [,50]
[1,] -1.043821 -0.9386897 0.6686104 -1.760822 1.312127 0.4621626 -0.5929485
[2,] -1.043821 -0.9386897 0.6686104 -1.760822 1.312127 0.4621626 -0.5929485
         [,51]    [,52]   [,53]    [,54]      [,55]    [,56]    [,57]     [,58]
[1,] 0.2987865 2.726958 -1.2965 1.096125 -0.3585085 1.677378 1.536108 0.5544289
[2,] 0.2987865 2.726958 -1.2965 1.096125 -0.3585085 1.677378 1.536108 0.5544289
         [,59]    [,60]      [,61]      [,62]     [,63]     [,64]     [,65]
[1,] -2.958813 1.223453 0.03565377 -0.9932724 -1.245019 -1.355903 0.2833305
[2,] -2.958813 1.223453 0.03565377 -0.9932724 -1.245019 -1.355903 0.2833305
          [,66]     [,67]      [,68]    [,69]     [,70]       [,71]     [,72]
[1,] -0.4525861 0.1535196 -0.4321389 1.114411 0.2113117 0.002167561 0.7907541
[2,] -0.4525861 0.1535196 -0.4321389 1.114411 0.2113117 0.002167561 0.7907541
         [,73]    [,74]    [,75]     [,76]     [,77]    [,78]    [,79]
[1,] 0.2647148 1.856433 -1.53238 -1.035498 -2.370853 1.478963 1.457759
[2,] 0.2647148 1.856433 -1.53238 -1.035498 -2.370853 1.478963 1.457759
         [,80]     [,81]     [,82]    [,83]    [,84]    [,85]    [,86]
[1,] -1.016979 0.2211046 -0.244729 1.592877 2.840931 1.041698 2.510716
[2,] -1.016979 0.2211046 -0.244729 1.592877 2.840931 1.041698 2.510716
         [,87]     [,88]    [,89]     [,90]      [,91]     [,92]     [,93]
[1,] -1.197074 -1.034804 -1.05973 0.4517925 -0.8044362 -1.128357 0.9735653
[2,] -1.197074 -1.034804 -1.05973 0.4517925 -0.8044362 -1.128357 0.9735653
        [,94]     [,95]     [,96]      [,97]     [,98]     [,99]    [,100]
[1,] 0.579216 0.7437294 -1.559375 -0.8993396 0.8732879 0.3394502 -1.763111
[2,] 0.579216 0.7437294 -1.559375 -0.8993396 0.8732879 0.3394502 -1.763111
> 
> 
> Max(tmp2)
[1] 1.831058
> Min(tmp2)
[1] -2.554891
> mean(tmp2)
[1] -0.2333521
> Sum(tmp2)
[1] -23.33521
> Var(tmp2)
[1] 0.9622049
> 
> rowMeans(tmp2)
  [1]  0.009177403 -1.417661109  1.005116862 -1.149546192 -0.140955762
  [6] -0.171180221  1.385095982 -1.153218041  0.733938131  0.971783954
 [11]  1.208080384 -1.080369265  0.257748784 -0.821120184  0.216534972
 [16] -0.044330655 -1.471360095  1.310553576  0.964954296 -1.695393274
 [21] -1.282992920  0.502641369 -1.193929177 -0.126792626  0.149726038
 [26] -1.150042272  0.069727834 -0.219998199 -0.289567543 -0.890603408
 [31] -1.295111794 -1.228447030  1.476907257  0.144615279 -0.507936657
 [36] -1.777206896  0.181114877 -0.143996962  0.114658420 -2.554891317
 [41] -0.101776496 -1.928095097  0.907945617  0.358337254 -0.008465827
 [46] -0.194866165  0.661348734  0.352801268 -1.066439552 -0.214450139
 [51]  0.776184766  1.450156251 -1.176988985  0.517817078  0.591857569
 [56] -0.918194476 -0.190190776  0.656537503 -0.283690849 -1.754289677
 [61] -0.774069197 -1.839048914 -0.313657986  1.064326789  0.751581341
 [66]  1.179560845  0.042653766 -0.960660374  0.243123123 -1.051169922
 [71] -0.571678994  1.831058438  0.499196630  0.584124503 -1.278476820
 [76] -2.367169750 -1.233203425 -0.224449586  0.216184905  0.380671415
 [81] -0.598492202 -0.702730197 -2.067533613 -0.065060222 -0.407428373
 [86]  0.838734211 -2.018377568  1.319396191 -0.022190099 -0.012826914
 [91]  0.988780734 -0.368501795  0.318621346 -1.425134797 -1.158152541
 [96] -0.436543499 -0.499752440 -1.765027647  0.084854990  1.151996679
> rowSums(tmp2)
  [1]  0.009177403 -1.417661109  1.005116862 -1.149546192 -0.140955762
  [6] -0.171180221  1.385095982 -1.153218041  0.733938131  0.971783954
 [11]  1.208080384 -1.080369265  0.257748784 -0.821120184  0.216534972
 [16] -0.044330655 -1.471360095  1.310553576  0.964954296 -1.695393274
 [21] -1.282992920  0.502641369 -1.193929177 -0.126792626  0.149726038
 [26] -1.150042272  0.069727834 -0.219998199 -0.289567543 -0.890603408
 [31] -1.295111794 -1.228447030  1.476907257  0.144615279 -0.507936657
 [36] -1.777206896  0.181114877 -0.143996962  0.114658420 -2.554891317
 [41] -0.101776496 -1.928095097  0.907945617  0.358337254 -0.008465827
 [46] -0.194866165  0.661348734  0.352801268 -1.066439552 -0.214450139
 [51]  0.776184766  1.450156251 -1.176988985  0.517817078  0.591857569
 [56] -0.918194476 -0.190190776  0.656537503 -0.283690849 -1.754289677
 [61] -0.774069197 -1.839048914 -0.313657986  1.064326789  0.751581341
 [66]  1.179560845  0.042653766 -0.960660374  0.243123123 -1.051169922
 [71] -0.571678994  1.831058438  0.499196630  0.584124503 -1.278476820
 [76] -2.367169750 -1.233203425 -0.224449586  0.216184905  0.380671415
 [81] -0.598492202 -0.702730197 -2.067533613 -0.065060222 -0.407428373
 [86]  0.838734211 -2.018377568  1.319396191 -0.022190099 -0.012826914
 [91]  0.988780734 -0.368501795  0.318621346 -1.425134797 -1.158152541
 [96] -0.436543499 -0.499752440 -1.765027647  0.084854990  1.151996679
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.009177403 -1.417661109  1.005116862 -1.149546192 -0.140955762
  [6] -0.171180221  1.385095982 -1.153218041  0.733938131  0.971783954
 [11]  1.208080384 -1.080369265  0.257748784 -0.821120184  0.216534972
 [16] -0.044330655 -1.471360095  1.310553576  0.964954296 -1.695393274
 [21] -1.282992920  0.502641369 -1.193929177 -0.126792626  0.149726038
 [26] -1.150042272  0.069727834 -0.219998199 -0.289567543 -0.890603408
 [31] -1.295111794 -1.228447030  1.476907257  0.144615279 -0.507936657
 [36] -1.777206896  0.181114877 -0.143996962  0.114658420 -2.554891317
 [41] -0.101776496 -1.928095097  0.907945617  0.358337254 -0.008465827
 [46] -0.194866165  0.661348734  0.352801268 -1.066439552 -0.214450139
 [51]  0.776184766  1.450156251 -1.176988985  0.517817078  0.591857569
 [56] -0.918194476 -0.190190776  0.656537503 -0.283690849 -1.754289677
 [61] -0.774069197 -1.839048914 -0.313657986  1.064326789  0.751581341
 [66]  1.179560845  0.042653766 -0.960660374  0.243123123 -1.051169922
 [71] -0.571678994  1.831058438  0.499196630  0.584124503 -1.278476820
 [76] -2.367169750 -1.233203425 -0.224449586  0.216184905  0.380671415
 [81] -0.598492202 -0.702730197 -2.067533613 -0.065060222 -0.407428373
 [86]  0.838734211 -2.018377568  1.319396191 -0.022190099 -0.012826914
 [91]  0.988780734 -0.368501795  0.318621346 -1.425134797 -1.158152541
 [96] -0.436543499 -0.499752440 -1.765027647  0.084854990  1.151996679
> rowMin(tmp2)
  [1]  0.009177403 -1.417661109  1.005116862 -1.149546192 -0.140955762
  [6] -0.171180221  1.385095982 -1.153218041  0.733938131  0.971783954
 [11]  1.208080384 -1.080369265  0.257748784 -0.821120184  0.216534972
 [16] -0.044330655 -1.471360095  1.310553576  0.964954296 -1.695393274
 [21] -1.282992920  0.502641369 -1.193929177 -0.126792626  0.149726038
 [26] -1.150042272  0.069727834 -0.219998199 -0.289567543 -0.890603408
 [31] -1.295111794 -1.228447030  1.476907257  0.144615279 -0.507936657
 [36] -1.777206896  0.181114877 -0.143996962  0.114658420 -2.554891317
 [41] -0.101776496 -1.928095097  0.907945617  0.358337254 -0.008465827
 [46] -0.194866165  0.661348734  0.352801268 -1.066439552 -0.214450139
 [51]  0.776184766  1.450156251 -1.176988985  0.517817078  0.591857569
 [56] -0.918194476 -0.190190776  0.656537503 -0.283690849 -1.754289677
 [61] -0.774069197 -1.839048914 -0.313657986  1.064326789  0.751581341
 [66]  1.179560845  0.042653766 -0.960660374  0.243123123 -1.051169922
 [71] -0.571678994  1.831058438  0.499196630  0.584124503 -1.278476820
 [76] -2.367169750 -1.233203425 -0.224449586  0.216184905  0.380671415
 [81] -0.598492202 -0.702730197 -2.067533613 -0.065060222 -0.407428373
 [86]  0.838734211 -2.018377568  1.319396191 -0.022190099 -0.012826914
 [91]  0.988780734 -0.368501795  0.318621346 -1.425134797 -1.158152541
 [96] -0.436543499 -0.499752440 -1.765027647  0.084854990  1.151996679
> 
> colMeans(tmp2)
[1] -0.2333521
> colSums(tmp2)
[1] -23.33521
> colVars(tmp2)
[1] 0.9622049
> colSd(tmp2)
[1] 0.9809205
> colMax(tmp2)
[1] 1.831058
> colMin(tmp2)
[1] -2.554891
> colMedians(tmp2)
[1] -0.1424764
> colRanges(tmp2)
          [,1]
[1,] -2.554891
[2,]  1.831058
> 
> 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]  3.4152401 -1.9561118 -2.7659873 -2.5580470 -4.6114655 -3.5109113
 [7] -0.9847843  3.9842356 -2.2287558  1.1001562
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8291415
[2,] -0.2313829
[3,]  0.3666052
[4,]  0.8843950
[5,]  1.5076958
> 
> rowApply(tmp,sum)
 [1] -3.0003678 -5.8045322  4.3577478  0.7369102  6.7094559 -2.8127306
 [7] -4.7554942 -6.1801464  0.1828084  0.4499178
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    6    3   10    1    7    4    9    7     8
 [2,]    4    9    1    6    3    9    6    1    6     7
 [3,]   10    1    9    3    5    4    8    2    2     4
 [4,]    2    3    6    9    9    1    5    4    3    10
 [5,]    6    4    7    1    7    2    7    7    5     1
 [6,]    3    2    8    8    6    3    1    8    1     6
 [7,]    8    7    5    4    2   10    3    3    4     5
 [8,]    7   10    4    7    4    8    9   10    8     3
 [9,]    5    5    2    2    8    5   10    6    9     2
[10,]    1    8   10    5   10    6    2    5   10     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.638807727  2.798492189  0.528076383 -2.379813244 -0.277086871
 [6] -4.100615477 -0.700003400 -1.259176496 -2.757924413  2.298819505
[11]  2.672286100 -2.051217625 -0.434251866  2.962097029  0.943445628
[16]  0.280888029 -0.003555411 -0.235943881 -2.980093608 -0.058145630
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8907547
[2,] -0.8580272
[3,]  0.2146409
[4,]  0.3099085
[5,]  0.5854247
> 
> rowApply(tmp,sum)
[1]   9.342060   3.451168  -1.717928 -10.717273  -5.750557
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9   13   16    7    3
[2,]   18    9   15   20   14
[3,]   11    5    7    8   19
[4,]    4    3   12    1   18
[5,]   17   11    8    6    9
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]        [,5]        [,6]
[1,]  0.2146409  1.70294783  0.4289420 -0.5152282  1.68020966 -0.90045835
[2,]  0.3099085 -0.08849923 -0.3581448 -0.6334615 -0.02347308  0.26592017
[3,]  0.5854247  0.55370188 -0.6196960  0.3833135 -0.52068042 -0.83413871
[4,] -0.8907547  0.84928689 -0.3881173 -2.8894578 -0.91170102 -0.03383861
[5,] -0.8580272 -0.21894518  1.4650925  1.2750207 -0.50144200 -2.59809997
           [,7]       [,8]        [,9]       [,10]      [,11]      [,12]
[1,]  1.9836798 -0.7639961 -0.76046442 -0.06968846  2.0410348  0.9463205
[2,] -1.3336736 -0.3039182 -0.09657284  2.04888724  0.9233460 -0.5424447
[3,] -1.4109495  0.8101139 -1.03642173  0.39027186  0.8205308 -0.1675272
[4,] -0.1031522 -0.2411077 -0.36584247  0.42333587 -0.2604117 -1.3513536
[5,]  0.1640921 -0.7602684 -0.49862296 -0.49398700 -0.8522138 -0.9362126
          [,13]       [,14]      [,15]      [,16]      [,17]       [,18]
[1,]  0.2528402  0.48285809 -0.1000649  0.7659587 -0.2240329  1.65410569
[2,]  0.6590928  1.62475656 -0.3122297 -0.7720805  0.8253136 -0.07228075
[3,]  0.4039893  1.00218854  1.0394346  0.3588732  0.1917875 -1.14791374
[4,] -1.1117910 -0.24516964 -1.4333575  0.5322907 -0.2145536 -0.36358010
[5,] -0.6383831  0.09746348  1.7496633 -0.6041540 -0.5820699 -0.30627497
           [,19]       [,20]
[1,]  0.08533384  0.43712145
[2,]  0.32643301  1.00428862
[3,] -1.40042380 -1.11980711
[4,] -1.80218569  0.08418866
[5,] -0.18925097 -0.46393726
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  561  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1       col2      col3     col4     col5      col6     col7
row1 -0.2918086 -0.7243557 0.9090174 0.472968 0.564617 -1.631831 3.028308
            col8     col9    col10    col11   col12     col13       col14
row1 -0.08275555 1.049841 1.932056 0.699986 1.03007 0.5415187 -0.03691932
         col15      col16      col17    col18     col19     col20
row1 0.3586119 -0.5982853 -0.8224129 -1.50271 -1.134935 0.8190534
> tmp[,"col10"]
            col10
row1  1.932056056
row2 -0.006590122
row3 -0.733943958
row4 -0.474725411
row5  0.150364502
> tmp[c("row1","row5"),]
           col1       col2         col3      col4      col5       col6
row1 -0.2918086 -0.7243557  0.909017359 0.4729680 0.5646170 -1.6318315
row5 -0.7796749 -0.3401915 -0.004506808 0.8619262 0.2503895  0.7674142
          col7        col8       col9     col10      col11   col12       col13
row1 3.0283084 -0.08275555  1.0498405 1.9320561  0.6999860 1.03007  0.54151865
row5 0.1742823 -1.01741379 -0.7125421 0.1503645 -0.9225746 1.12126 -0.08538703
           col14     col15      col16      col17      col18        col19
row1 -0.03691932 0.3586119 -0.5982853 -0.8224129 -1.5027102 -1.134935480
row5 -0.86620504 0.1436244  0.4069805 -0.1946362 -0.9203295  0.002387458
          col20
row1 0.81905341
row5 0.07399676
> tmp[,c("col6","col20")]
            col6       col20
row1 -1.63183147  0.81905341
row2 -0.63220208  2.47762802
row3  0.01482008  0.37610504
row4 -0.46123851 -2.19076818
row5  0.76741419  0.07399676
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -1.6318315 0.81905341
row5  0.7674142 0.07399676
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5    col6     col7    col8
row1 50.34215 50.9967 49.58712 50.46606 51.39483 106.347 50.86139 50.6206
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.05311 50.10402 52.80726 48.25368 49.82524 49.16527 51.10444 49.38645
        col17    col18    col19    col20
row1 50.61352 49.15112 49.86392 105.7079
> tmp[,"col10"]
        col10
row1 50.10402
row2 29.62419
row3 29.95562
row4 30.26361
row5 49.95177
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.34215 50.99670 49.58712 50.46606 51.39483 106.3470 50.86139 50.62060
row5 49.79393 50.12988 51.22040 49.46990 49.56597 102.8418 48.23662 51.01313
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.05311 50.10402 52.80726 48.25368 49.82524 49.16527 51.10444 49.38645
row5 49.85804 49.95177 50.02847 50.07205 49.39324 49.81415 50.85221 49.83586
        col17    col18    col19    col20
row1 50.61352 49.15112 49.86392 105.7079
row5 49.13545 51.37690 51.00500 105.3345
> tmp[,c("col6","col20")]
          col6     col20
row1 106.34703 105.70794
row2  74.17161  75.33309
row3  74.00848  73.84941
row4  74.83638  74.27534
row5 102.84185 105.33446
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.3470 105.7079
row5 102.8418 105.3345
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.3470 105.7079
row5 102.8418 105.3345
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.0478666
[2,]  0.4483358
[3,]  2.2496851
[4,] -0.6255842
[5,]  1.8561583
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.8680249 -0.6588790
[2,]  2.5048405  1.4294590
[3,]  0.4703105 -0.6335425
[4,] -0.1207758 -0.4784997
[5,]  0.3178544 -1.1312677
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.7677934 -1.0839017
[2,] -1.8642665 -2.0513714
[3,] -0.4522644 -1.6004073
[4,]  1.6232165 -0.4593323
[5,] -1.4676548 -1.2013490
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.7677934
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.7677934
[2,] -1.8642665
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]      [,3]       [,4]      [,5]       [,6]      [,7]
row3 0.6615734  1.344219 1.4405220 -0.1177452  1.946633 0.40254216 0.2378172
row1 0.9139232 -1.684395 0.5221683  0.4722034 -0.915926 0.01685083 1.2873370
          [,8]       [,9]      [,10]      [,11]     [,12]     [,13]      [,14]
row3 -2.443078 -0.3542457 -0.5372983 -0.8786049 -1.305312 1.2588085  0.2426631
row1  1.583989  2.0407582 -1.1196675 -0.1348495 -2.227705 0.8466317 -0.1492620
          [,15]      [,16]     [,17]      [,18]      [,19]       [,20]
row3  0.2078428 0.05432988  2.309352 -1.4840371 -1.2187213 0.551198344
row1 -0.4692134 0.40714418 -0.631121  0.2147352  0.8500846 0.007989645
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]      [,4]       [,5]      [,6]    [,7]
row2 0.2859995 -1.805117 -0.9391254 -1.449142 -0.3482762 -2.142276 2.12617
          [,8]      [,9]     [,10]
row2 -1.174332 -1.455971 0.3108407
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]       [,4]      [,5]     [,6]       [,7]
row5 0.3955175 1.695866 0.8164367 -0.2911909 0.3946498 0.107373 -0.9524128
          [,8]      [,9]       [,10]    [,11]     [,12]     [,13]     [,14]
row5 0.1704617 0.6501737 -0.09876641 0.160111 0.2740405 0.1462642 -3.238594
         [,15]     [,16]      [,17]     [,18]     [,19]      [,20]
row5 0.5195188 -0.179211 -0.9386438 0.2690749 0.8827865 -0.4933757
> 
> 
> 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: 0xe9361b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e243244b8524"
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e2433fd70234"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e24314a534ee"
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e2434468433f"
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e2431a2ebf90"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e24354ab9647"
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e2435d5fc1c8"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e243156036f" 
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e243760a9b14"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e243ca4f3ec" 
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e24336d605ee"
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e2434b6c0921"
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e2435d32e3ad"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e2437ed63c3c"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2e24352325015"
> 
> 
> ### 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: 0xf0e4d80>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xf0e4d80>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0xf0e4d80>
> rowMedians(tmp)
  [1] -5.782559e-01 -4.243277e-01  4.717668e-01 -6.227202e-03  7.771221e-02
  [6]  7.639480e-02 -1.867118e-01  2.577999e-02 -5.895824e-01  3.981163e-01
 [11] -5.831589e-01  8.576330e-02  1.642585e-01 -3.530224e-02 -1.078438e-01
 [16] -6.220284e-02 -3.242798e-01  2.686594e-01 -1.187729e-01  1.837481e-01
 [21] -1.051353e-01 -2.479670e-01 -5.374408e-01  3.467150e-01  6.792842e-02
 [26] -9.284943e-02  6.552734e-01 -5.836690e-02 -1.551272e-02  4.864432e-01
 [31]  4.791756e-01 -1.393468e-02 -1.234291e-01  3.828202e-01 -5.329014e-02
 [36] -1.203752e-01 -2.499202e-05  2.806752e-01 -5.417512e-01 -1.619985e-01
 [41]  7.066460e-02 -1.667597e-01  1.293238e-01 -8.333817e-01  2.415383e-01
 [46] -6.878454e-01  5.015177e-01 -1.636642e-01 -5.204408e-01  1.304265e-01
 [51]  5.364922e-01 -1.565042e-01 -3.282028e-01  2.130578e-01 -5.280780e-01
 [56] -6.870096e-02 -1.566530e-01 -9.509395e-02 -2.705805e-01 -7.345040e-02
 [61]  5.611928e-02  2.357480e-01 -6.514354e-02  2.770665e-01 -2.570703e-02
 [66]  2.166786e-01 -2.817316e-02 -1.375623e-01  1.924534e-01  1.700297e-02
 [71]  3.853238e-01  1.044542e-01  2.360070e-01 -3.133988e-01  1.504771e-01
 [76] -9.927360e-02 -6.468483e-02 -1.415745e-01  4.795055e-01  3.420896e-01
 [81]  1.315382e-01  2.442022e-01  1.985508e-01 -2.561444e-01 -1.614042e-01
 [86] -2.686415e-01  3.614821e-01  5.977955e-01 -5.946654e-02 -1.370961e-01
 [91]  7.092511e-01  2.324387e-01  2.149054e-02  3.572502e-01  6.462104e-01
 [96] -3.924710e-01  3.485005e-01 -1.974249e-01  3.346002e-01  2.355096e-01
[101] -5.370889e-01  1.695874e-01  6.408193e-01 -2.589645e-01  2.211450e-01
[106] -3.639636e-01  5.535644e-01  1.417500e-01 -1.343321e-01 -1.081323e-01
[111] -3.385101e-01  5.176149e-01  1.760036e-01 -1.998552e-01  2.875084e-01
[116] -4.058174e-01  3.466817e-02  3.104302e-01 -6.004264e-01  1.797808e-01
[121] -3.084739e-01  3.064402e-01  6.043067e-01 -4.716396e-02 -1.515147e-01
[126] -1.954492e-01 -3.047348e-01 -4.085792e-01 -1.755014e-01 -3.588475e-01
[131] -9.836891e-02 -3.554570e-01  2.761490e-01  9.560595e-02 -1.314389e-01
[136] -2.626527e-01 -3.355021e-01 -1.770894e-01  4.904193e-01 -1.797504e-01
[141] -3.846731e-01 -3.210097e-01 -2.709634e-03  2.891850e-01 -1.222028e-01
[146] -8.341600e-02  3.930618e-01 -1.213206e-01  5.569140e-01  2.309238e-02
[151] -1.529349e-01 -1.380514e-01  1.653628e-01 -1.777585e-01 -1.486129e-01
[156] -1.276648e-01  3.656730e-01 -8.579543e-03  1.550840e-01  5.535239e-02
[161]  3.517330e-01 -4.524043e-01 -4.589641e-02  2.800568e-01 -1.642621e-02
[166]  1.845446e-01  3.079261e-01  2.282176e-01  1.062837e-01  3.663627e-02
[171] -3.851450e-01  3.127273e-01  1.196031e-01  3.247468e-01  2.383782e-01
[176]  1.616641e-01 -2.130810e-03  2.990355e-01 -7.112165e-01 -2.665108e-02
[181]  2.401838e-01  1.484985e-01  1.329464e-01  1.717379e-01 -1.595412e-01
[186] -9.013982e-01  3.547787e-01  1.112638e-01  1.316612e-01  1.916469e-01
[191] -7.459686e-02  8.034751e-01 -4.444241e-01  6.592266e-02 -3.580094e-01
[196] -3.243324e-01  1.909480e-01  1.332418e-01  1.953898e-01  9.884464e-02
[201] -6.894613e-03  5.020349e-01  5.625318e-01 -9.501833e-02 -5.761398e-01
[206] -6.909157e-01  3.638353e-02  5.959982e-01 -3.871368e-01 -9.303414e-02
[211]  1.020567e-01 -3.123301e-03  8.298783e-02  5.469480e-02 -4.523607e-01
[216] -1.767917e-01 -8.140686e-02 -1.988410e-01 -2.965652e-01 -5.140381e-02
[221] -5.128028e-01 -3.028148e-02  2.433645e-01 -1.274857e-01 -1.638314e-01
[226]  1.772547e-01  4.628188e-02 -2.849272e-01  8.931314e-02 -3.747760e-01
> 
> proc.time()
   user  system elapsed 
  1.841   0.879   2.745 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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: 0xd2136e0>
> .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: 0xd2136e0>
> .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: 0xd2136e0>
> .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: 0xd2136e0>
> 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: 0xd25b6a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xd25b6a0>
> .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: 0xd25b6a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xd25b6a0>
> .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: 0xd25b6a0>
> 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: 0xc4177d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xc4177d0>
> .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: 0xc4177d0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xc4177d0>
> .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: 0xc4177d0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0xc4177d0>
> .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: 0xc4177d0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0xc4177d0>
> .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: 0xc4177d0>
> 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: 0xcf76d70>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xcf76d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0xcf76d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0xcf76d70>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2e3fa245b785"  "BufferedMatrixFile2e3fa34679e43"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2e3fa245b785"  "BufferedMatrixFile2e3fa34679e43"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xcb19cd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xcb19cd0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xcb19cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xcb19cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xcb19cd0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xcb19cd0>
> .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: 0xba88a10>
> .Call("R_bm_AddColumn",P)
<pointer: 0xba88a10>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xba88a10>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xba88a10>
> 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: 0xd9a2cc0>
> .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: 0xd9a2cc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.354   0.028   0.368 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.324   0.055   0.366 

Example timings