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

This page was generated on 2025-08-11 11:47 -0400 (Mon, 11 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.2 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4823
palomino7Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4565
merida1macOS 12.7.5 Montereyx86_644.5.1 RC (2025-06-05 r88288) -- "Great Square Root" 4603
kjohnson1macOS 13.6.6 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4544
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-07 13:40 -0400 (Thu, 07 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.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    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-08 06:51:18 -0000 (Fri, 08 Aug 2025)
EndedAt: 2025-08-08 06:51:41 -0000 (Fri, 08 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.335   0.040   0.362 

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  8 06:51:35 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  8 06:51:35 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: 0x1c6216e0>
> 
> 
> 
> 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  8 06:51:35 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  8 06:51:36 2025"
> 
> ColMode(tmp2)
<pointer: 0x1c6216e0>
> 
> 
> 
> ### 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.1896908 3.0538752  0.4687137 -2.0958012
[2,]  -0.1334347 0.1243505  0.7110710  0.5853084
[3,]  -0.3143995 0.4546027  0.1125105  0.1801865
[4,]  -0.3123297 1.6072337 -1.5761552 -0.4827834
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.1896908 3.0538752 0.4687137 2.0958012
[2,]   0.1334347 0.1243505 0.7110710 0.5853084
[3,]   0.3143995 0.4546027 0.1125105 0.1801865
[4,]   0.3123297 1.6072337 1.5761552 0.4827834
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0094800 1.7475340 0.6846267 1.4476882
[2,]  0.3652872 0.3526337 0.8432503 0.7650545
[3,]  0.5607134 0.6742423 0.3354258 0.4244838
[4,]  0.5588647 1.2677672 1.2554502 0.6948262
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.28449 45.52922 32.31498 41.57268
[2,]  28.78631 28.65069 34.14357 33.23585
[3,]  30.92153 32.19703 28.46677 29.42502
[4,]  30.90098 39.28491 39.13066 32.43104
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x1abf9520>
> exp(tmp5)
<pointer: 0x1abf9520>
> log(tmp5,2)
<pointer: 0x1abf9520>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.9002
> Min(tmp5)
[1] 53.2765
> mean(tmp5)
[1] 73.1719
> Sum(tmp5)
[1] 14634.38
> Var(tmp5)
[1] 873.6837
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.14931 68.14043 71.49008 74.02829 69.14578 68.59531 73.39713 72.63336
 [9] 70.25408 70.88524
> rowSums(tmp5)
 [1] 1862.986 1362.809 1429.802 1480.566 1382.916 1371.906 1467.943 1452.667
 [9] 1405.082 1417.705
> rowVars(tmp5)
 [1] 7948.04847   69.76775   85.53731   59.86800   61.86016  106.53868
 [7]   70.10485   63.75428  104.42345   76.34981
> rowSd(tmp5)
 [1] 89.151828  8.352709  9.248639  7.737442  7.865123 10.321758  8.372864
 [8]  7.984628 10.218779  8.737838
> rowMax(tmp5)
 [1] 468.90015  86.24933  87.77182  86.13904  89.19224  88.92299  89.49916
 [8]  87.71698  92.96611  86.03247
> rowMin(tmp5)
 [1] 58.14974 55.42118 57.99997 59.99251 58.90157 54.26706 57.19994 58.04838
 [9] 54.86556 53.27650
> 
> colMeans(tmp5)
 [1] 110.98704  71.51234  69.38272  69.17170  75.01836  65.14607  73.25411
 [8]  73.99340  71.53037  71.28621  70.28192  69.31616  71.76443  69.31120
[15]  69.77893  71.29794  75.32015  70.10101  71.16745  73.81652
> colSums(tmp5)
 [1] 1109.8704  715.1234  693.8272  691.7170  750.1836  651.4607  732.5411
 [8]  739.9340  715.3037  712.8621  702.8192  693.1616  717.6443  693.1120
[15]  697.7893  712.9794  753.2015  701.0101  711.6745  738.1652
> colVars(tmp5)
 [1] 15909.94885   209.21062    41.52688   103.42632    62.42251    94.51232
 [7]    70.55601   117.07265    54.46639    76.31596    90.04660    18.09205
[13]    87.31708    54.40087    77.60826    70.63536   124.79969    96.29197
[19]    87.23178    81.72250
> colSd(tmp5)
 [1] 126.134646  14.464115   6.444136  10.169873   7.900792   9.721745
 [7]   8.399762  10.820012   7.380135   8.735900   9.489289   4.253475
[13]   9.344361   7.375694   8.809555   8.404485  11.171378   9.812847
[19]   9.339795   9.040050
> colMax(tmp5)
 [1] 468.90015  94.76310  81.44534  86.52809  86.24933  87.71698  87.36862
 [8]  92.96611  84.03103  82.50486  82.56593  76.67744  86.03247  79.66736
[15]  84.93735  89.49916  96.59126  82.45736  86.13904  88.00886
> colMin(tmp5)
 [1] 58.04838 56.63595 59.24985 53.27650 64.79554 55.42118 57.99997 61.72140
 [9] 58.81842 59.49727 54.26706 61.66744 55.30882 57.13459 58.83744 58.79054
[17] 56.67599 54.86556 57.07067 60.41381
> 
> 
> ### 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] 93.14931 68.14043 71.49008 74.02829 69.14578 68.59531 73.39713 72.63336
 [9] 70.25408       NA
> rowSums(tmp5)
 [1] 1862.986 1362.809 1429.802 1480.566 1382.916 1371.906 1467.943 1452.667
 [9] 1405.082       NA
> rowVars(tmp5)
 [1] 7948.04847   69.76775   85.53731   59.86800   61.86016  106.53868
 [7]   70.10485   63.75428  104.42345   78.65602
> rowSd(tmp5)
 [1] 89.151828  8.352709  9.248639  7.737442  7.865123 10.321758  8.372864
 [8]  7.984628 10.218779  8.868823
> rowMax(tmp5)
 [1] 468.90015  86.24933  87.77182  86.13904  89.19224  88.92299  89.49916
 [8]  87.71698  92.96611        NA
> rowMin(tmp5)
 [1] 58.14974 55.42118 57.99997 59.99251 58.90157 54.26706 57.19994 58.04838
 [9] 54.86556       NA
> 
> colMeans(tmp5)
 [1] 110.98704  71.51234  69.38272  69.17170  75.01836  65.14607  73.25411
 [8]  73.99340  71.53037  71.28621  70.28192  69.31616  71.76443  69.31120
[15]  69.77893  71.29794  75.32015        NA  71.16745  73.81652
> colSums(tmp5)
 [1] 1109.8704  715.1234  693.8272  691.7170  750.1836  651.4607  732.5411
 [8]  739.9340  715.3037  712.8621  702.8192  693.1616  717.6443  693.1120
[15]  697.7893  712.9794  753.2015        NA  711.6745  738.1652
> colVars(tmp5)
 [1] 15909.94885   209.21062    41.52688   103.42632    62.42251    94.51232
 [7]    70.55601   117.07265    54.46639    76.31596    90.04660    18.09205
[13]    87.31708    54.40087    77.60826    70.63536   124.79969          NA
[19]    87.23178    81.72250
> colSd(tmp5)
 [1] 126.134646  14.464115   6.444136  10.169873   7.900792   9.721745
 [7]   8.399762  10.820012   7.380135   8.735900   9.489289   4.253475
[13]   9.344361   7.375694   8.809555   8.404485  11.171378         NA
[19]   9.339795   9.040050
> colMax(tmp5)
 [1] 468.90015  94.76310  81.44534  86.52809  86.24933  87.71698  87.36862
 [8]  92.96611  84.03103  82.50486  82.56593  76.67744  86.03247  79.66736
[15]  84.93735  89.49916  96.59126        NA  86.13904  88.00886
> colMin(tmp5)
 [1] 58.04838 56.63595 59.24985 53.27650 64.79554 55.42118 57.99997 61.72140
 [9] 58.81842 59.49727 54.26706 61.66744 55.30882 57.13459 58.83744 58.79054
[17] 56.67599       NA 57.07067 60.41381
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.9002
> Min(tmp5,na.rm=TRUE)
[1] 53.2765
> mean(tmp5,na.rm=TRUE)
[1] 73.15448
> Sum(tmp5,na.rm=TRUE)
[1] 14557.74
> Var(tmp5,na.rm=TRUE)
[1] 878.0353
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.14931 68.14043 71.49008 74.02829 69.14578 68.59531 73.39713 72.63336
 [9] 70.25408 70.58246
> rowSums(tmp5,na.rm=TRUE)
 [1] 1862.986 1362.809 1429.802 1480.566 1382.916 1371.906 1467.943 1452.667
 [9] 1405.082 1341.067
> rowVars(tmp5,na.rm=TRUE)
 [1] 7948.04847   69.76775   85.53731   59.86800   61.86016  106.53868
 [7]   70.10485   63.75428  104.42345   78.65602
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.151828  8.352709  9.248639  7.737442  7.865123 10.321758  8.372864
 [8]  7.984628 10.218779  8.868823
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.90015  86.24933  87.77182  86.13904  89.19224  88.92299  89.49916
 [8]  87.71698  92.96611  86.03247
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.14974 55.42118 57.99997 59.99251 58.90157 54.26706 57.19994 58.04838
 [9] 54.86556 53.27650
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.98704  71.51234  69.38272  69.17170  75.01836  65.14607  73.25411
 [8]  73.99340  71.53037  71.28621  70.28192  69.31616  71.76443  69.31120
[15]  69.77893  71.29794  75.32015  69.37466  71.16745  73.81652
> colSums(tmp5,na.rm=TRUE)
 [1] 1109.8704  715.1234  693.8272  691.7170  750.1836  651.4607  732.5411
 [8]  739.9340  715.3037  712.8621  702.8192  693.1616  717.6443  693.1120
[15]  697.7893  712.9794  753.2015  624.3720  711.6745  738.1652
> colVars(tmp5,na.rm=TRUE)
 [1] 15909.94885   209.21062    41.52688   103.42632    62.42251    94.51232
 [7]    70.55601   117.07265    54.46639    76.31596    90.04660    18.09205
[13]    87.31708    54.40087    77.60826    70.63536   124.79969   102.39315
[19]    87.23178    81.72250
> colSd(tmp5,na.rm=TRUE)
 [1] 126.134646  14.464115   6.444136  10.169873   7.900792   9.721745
 [7]   8.399762  10.820012   7.380135   8.735900   9.489289   4.253475
[13]   9.344361   7.375694   8.809555   8.404485  11.171378  10.118950
[19]   9.339795   9.040050
> colMax(tmp5,na.rm=TRUE)
 [1] 468.90015  94.76310  81.44534  86.52809  86.24933  87.71698  87.36862
 [8]  92.96611  84.03103  82.50486  82.56593  76.67744  86.03247  79.66736
[15]  84.93735  89.49916  96.59126  82.45736  86.13904  88.00886
> colMin(tmp5,na.rm=TRUE)
 [1] 58.04838 56.63595 59.24985 53.27650 64.79554 55.42118 57.99997 61.72140
 [9] 58.81842 59.49727 54.26706 61.66744 55.30882 57.13459 58.83744 58.79054
[17] 56.67599 54.86556 57.07067 60.41381
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.14931 68.14043 71.49008 74.02829 69.14578 68.59531 73.39713 72.63336
 [9] 70.25408      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1862.986 1362.809 1429.802 1480.566 1382.916 1371.906 1467.943 1452.667
 [9] 1405.082    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7948.04847   69.76775   85.53731   59.86800   61.86016  106.53868
 [7]   70.10485   63.75428  104.42345         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.151828  8.352709  9.248639  7.737442  7.865123 10.321758  8.372864
 [8]  7.984628 10.218779        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.90015  86.24933  87.77182  86.13904  89.19224  88.92299  89.49916
 [8]  87.71698  92.96611        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.14974 55.42118 57.99997 59.99251 58.90157 54.26706 57.19994 58.04838
 [9] 54.86556       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.15606  72.64943  69.23262  70.93784  73.91406  64.76517  73.73649
 [8]  74.21901  70.99173  72.52978  69.98842  69.38467  70.17909  69.12687
[15]  68.09466  72.68765  75.54684       NaN  70.98734  75.01712
> colSums(tmp5,na.rm=TRUE)
 [1] 1036.4046  653.8449  623.0936  638.4406  665.2265  582.8866  663.6284
 [8]  667.9711  638.9256  652.7680  629.8958  624.4620  631.6118  622.1418
[15]  612.8520  654.1889  679.9216    0.0000  638.8860  675.1541
> colVars(tmp5,na.rm=TRUE)
 [1] 17703.15924   220.81596    46.46429    81.26327    56.50613   104.69417
 [7]    76.75775   131.13414    58.01070    68.45770   100.33331    20.30076
[13]    69.95711    60.81875    55.39573    57.73767   139.82153          NA
[19]    97.77077    75.72161
> colSd(tmp5,na.rm=TRUE)
 [1] 133.053220  14.859877   6.816472   9.014615   7.517056  10.232017
 [7]   8.761150  11.451382   7.616475   8.273917  10.016652   4.505636
[13]   8.364037   7.798638   7.442831   7.598531  11.824616         NA
[19]   9.887910   8.701816
> colMax(tmp5,na.rm=TRUE)
 [1] 468.90015  94.76310  81.44534  86.52809  86.24933  87.71698  87.36862
 [8]  92.96611  84.03103  82.50486  82.56593  76.67744  83.51594  79.66736
[15]  80.55213  89.49916  96.59126      -Inf  86.13904  88.00886
> colMin(tmp5,na.rm=TRUE)
 [1] 58.04838 56.63595 59.24985 58.90157 64.79554 55.42118 57.99997 61.72140
 [9] 58.81842 59.49727 54.26706 61.66744 55.30882 57.13459 58.83744 65.89902
[17] 56.67599      Inf 57.07067 60.41381
> 
> 
> 
> 
> 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] 250.9181 235.2103 208.9706 319.3807 257.4950 199.9234 139.0563 234.6415
 [9] 101.8781 312.8749
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 250.9181 235.2103 208.9706 319.3807 257.4950 199.9234 139.0563 234.6415
 [9] 101.8781 312.8749
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.421085e-13 -1.136868e-13  1.421085e-14  0.000000e+00 -8.526513e-14
 [6]  0.000000e+00  0.000000e+00 -8.526513e-14 -2.842171e-14  0.000000e+00
[11] -1.421085e-13  2.842171e-14 -2.842171e-14 -1.136868e-13 -5.684342e-14
[16] -2.842171e-14  0.000000e+00 -8.526513e-14 -5.684342e-14  5.684342e-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)
+ }
5   18 
6   19 
4   7 
9   5 
1   2 
5   2 
1   13 
6   12 
2   7 
4   14 
5   13 
4   10 
1   6 
10   11 
9   14 
8   3 
8   14 
2   12 
5   2 
2   19 
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.383925
> Min(tmp)
[1] -1.96
> mean(tmp)
[1] -0.1452131
> Sum(tmp)
[1] -14.52131
> Var(tmp)
[1] 0.83152
> 
> rowMeans(tmp)
[1] -0.1452131
> rowSums(tmp)
[1] -14.52131
> rowVars(tmp)
[1] 0.83152
> rowSd(tmp)
[1] 0.9118772
> rowMax(tmp)
[1] 2.383925
> rowMin(tmp)
[1] -1.96
> 
> colMeans(tmp)
  [1]  0.313168194 -0.137735438  0.136205270  0.056423399 -0.903814331
  [6] -0.359331869 -0.319166312  0.783658404 -1.618403684  0.448494856
 [11]  0.588200335 -1.839945245 -0.201214156  1.492587582 -0.387160737
 [16] -0.038544160  0.133974132 -0.521401340 -1.183009430 -1.385641284
 [21]  0.591380781 -0.357802988 -0.165904590 -1.690728499  0.369458376
 [26] -1.547098658  0.009429096 -0.453070736 -0.600544947 -0.391649829
 [31] -1.178052784  1.250692077 -0.790704278 -0.363047598  0.925965040
 [36] -1.395412918 -0.902384477  1.508917397  0.831009789 -0.545114754
 [41]  1.011186156 -0.822750219 -0.612431318 -0.213477978 -1.551000519
 [46]  1.061633996  1.096161752 -1.221533021 -1.474885278 -1.349971228
 [51]  0.130905130 -0.578564884 -0.113224467 -0.608827426  0.090453551
 [56] -0.983817377 -0.467153065 -0.823810088  1.435325002  1.660788349
 [61] -0.687309467  1.405872871  0.239185295  0.421465114 -0.820800827
 [66] -0.950585681 -0.492843144 -1.228033390 -0.645237332 -1.684756634
 [71] -0.351089575  0.971739791  0.001655480  1.264360697  0.247546168
 [76] -1.226399129  0.071590253 -0.005703694  0.825923228  0.131466352
 [81]  0.073081116  0.578780119  0.235095842 -0.254559882 -1.353438141
 [86]  1.603838116 -0.239353749 -0.876997141  0.353893736  0.588542622
 [91]  0.197162839 -1.164363858  0.552692799 -0.439193177  2.383925360
 [96]  0.721838188 -0.016970451  0.778765608  0.400212533 -1.960000021
> colSums(tmp)
  [1]  0.313168194 -0.137735438  0.136205270  0.056423399 -0.903814331
  [6] -0.359331869 -0.319166312  0.783658404 -1.618403684  0.448494856
 [11]  0.588200335 -1.839945245 -0.201214156  1.492587582 -0.387160737
 [16] -0.038544160  0.133974132 -0.521401340 -1.183009430 -1.385641284
 [21]  0.591380781 -0.357802988 -0.165904590 -1.690728499  0.369458376
 [26] -1.547098658  0.009429096 -0.453070736 -0.600544947 -0.391649829
 [31] -1.178052784  1.250692077 -0.790704278 -0.363047598  0.925965040
 [36] -1.395412918 -0.902384477  1.508917397  0.831009789 -0.545114754
 [41]  1.011186156 -0.822750219 -0.612431318 -0.213477978 -1.551000519
 [46]  1.061633996  1.096161752 -1.221533021 -1.474885278 -1.349971228
 [51]  0.130905130 -0.578564884 -0.113224467 -0.608827426  0.090453551
 [56] -0.983817377 -0.467153065 -0.823810088  1.435325002  1.660788349
 [61] -0.687309467  1.405872871  0.239185295  0.421465114 -0.820800827
 [66] -0.950585681 -0.492843144 -1.228033390 -0.645237332 -1.684756634
 [71] -0.351089575  0.971739791  0.001655480  1.264360697  0.247546168
 [76] -1.226399129  0.071590253 -0.005703694  0.825923228  0.131466352
 [81]  0.073081116  0.578780119  0.235095842 -0.254559882 -1.353438141
 [86]  1.603838116 -0.239353749 -0.876997141  0.353893736  0.588542622
 [91]  0.197162839 -1.164363858  0.552692799 -0.439193177  2.383925360
 [96]  0.721838188 -0.016970451  0.778765608  0.400212533 -1.960000021
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.313168194 -0.137735438  0.136205270  0.056423399 -0.903814331
  [6] -0.359331869 -0.319166312  0.783658404 -1.618403684  0.448494856
 [11]  0.588200335 -1.839945245 -0.201214156  1.492587582 -0.387160737
 [16] -0.038544160  0.133974132 -0.521401340 -1.183009430 -1.385641284
 [21]  0.591380781 -0.357802988 -0.165904590 -1.690728499  0.369458376
 [26] -1.547098658  0.009429096 -0.453070736 -0.600544947 -0.391649829
 [31] -1.178052784  1.250692077 -0.790704278 -0.363047598  0.925965040
 [36] -1.395412918 -0.902384477  1.508917397  0.831009789 -0.545114754
 [41]  1.011186156 -0.822750219 -0.612431318 -0.213477978 -1.551000519
 [46]  1.061633996  1.096161752 -1.221533021 -1.474885278 -1.349971228
 [51]  0.130905130 -0.578564884 -0.113224467 -0.608827426  0.090453551
 [56] -0.983817377 -0.467153065 -0.823810088  1.435325002  1.660788349
 [61] -0.687309467  1.405872871  0.239185295  0.421465114 -0.820800827
 [66] -0.950585681 -0.492843144 -1.228033390 -0.645237332 -1.684756634
 [71] -0.351089575  0.971739791  0.001655480  1.264360697  0.247546168
 [76] -1.226399129  0.071590253 -0.005703694  0.825923228  0.131466352
 [81]  0.073081116  0.578780119  0.235095842 -0.254559882 -1.353438141
 [86]  1.603838116 -0.239353749 -0.876997141  0.353893736  0.588542622
 [91]  0.197162839 -1.164363858  0.552692799 -0.439193177  2.383925360
 [96]  0.721838188 -0.016970451  0.778765608  0.400212533 -1.960000021
> colMin(tmp)
  [1]  0.313168194 -0.137735438  0.136205270  0.056423399 -0.903814331
  [6] -0.359331869 -0.319166312  0.783658404 -1.618403684  0.448494856
 [11]  0.588200335 -1.839945245 -0.201214156  1.492587582 -0.387160737
 [16] -0.038544160  0.133974132 -0.521401340 -1.183009430 -1.385641284
 [21]  0.591380781 -0.357802988 -0.165904590 -1.690728499  0.369458376
 [26] -1.547098658  0.009429096 -0.453070736 -0.600544947 -0.391649829
 [31] -1.178052784  1.250692077 -0.790704278 -0.363047598  0.925965040
 [36] -1.395412918 -0.902384477  1.508917397  0.831009789 -0.545114754
 [41]  1.011186156 -0.822750219 -0.612431318 -0.213477978 -1.551000519
 [46]  1.061633996  1.096161752 -1.221533021 -1.474885278 -1.349971228
 [51]  0.130905130 -0.578564884 -0.113224467 -0.608827426  0.090453551
 [56] -0.983817377 -0.467153065 -0.823810088  1.435325002  1.660788349
 [61] -0.687309467  1.405872871  0.239185295  0.421465114 -0.820800827
 [66] -0.950585681 -0.492843144 -1.228033390 -0.645237332 -1.684756634
 [71] -0.351089575  0.971739791  0.001655480  1.264360697  0.247546168
 [76] -1.226399129  0.071590253 -0.005703694  0.825923228  0.131466352
 [81]  0.073081116  0.578780119  0.235095842 -0.254559882 -1.353438141
 [86]  1.603838116 -0.239353749 -0.876997141  0.353893736  0.588542622
 [91]  0.197162839 -1.164363858  0.552692799 -0.439193177  2.383925360
 [96]  0.721838188 -0.016970451  0.778765608  0.400212533 -1.960000021
> colMedians(tmp)
  [1]  0.313168194 -0.137735438  0.136205270  0.056423399 -0.903814331
  [6] -0.359331869 -0.319166312  0.783658404 -1.618403684  0.448494856
 [11]  0.588200335 -1.839945245 -0.201214156  1.492587582 -0.387160737
 [16] -0.038544160  0.133974132 -0.521401340 -1.183009430 -1.385641284
 [21]  0.591380781 -0.357802988 -0.165904590 -1.690728499  0.369458376
 [26] -1.547098658  0.009429096 -0.453070736 -0.600544947 -0.391649829
 [31] -1.178052784  1.250692077 -0.790704278 -0.363047598  0.925965040
 [36] -1.395412918 -0.902384477  1.508917397  0.831009789 -0.545114754
 [41]  1.011186156 -0.822750219 -0.612431318 -0.213477978 -1.551000519
 [46]  1.061633996  1.096161752 -1.221533021 -1.474885278 -1.349971228
 [51]  0.130905130 -0.578564884 -0.113224467 -0.608827426  0.090453551
 [56] -0.983817377 -0.467153065 -0.823810088  1.435325002  1.660788349
 [61] -0.687309467  1.405872871  0.239185295  0.421465114 -0.820800827
 [66] -0.950585681 -0.492843144 -1.228033390 -0.645237332 -1.684756634
 [71] -0.351089575  0.971739791  0.001655480  1.264360697  0.247546168
 [76] -1.226399129  0.071590253 -0.005703694  0.825923228  0.131466352
 [81]  0.073081116  0.578780119  0.235095842 -0.254559882 -1.353438141
 [86]  1.603838116 -0.239353749 -0.876997141  0.353893736  0.588542622
 [91]  0.197162839 -1.164363858  0.552692799 -0.439193177  2.383925360
 [96]  0.721838188 -0.016970451  0.778765608  0.400212533 -1.960000021
> colRanges(tmp)
          [,1]       [,2]      [,3]      [,4]       [,5]       [,6]       [,7]
[1,] 0.3131682 -0.1377354 0.1362053 0.0564234 -0.9038143 -0.3593319 -0.3191663
[2,] 0.3131682 -0.1377354 0.1362053 0.0564234 -0.9038143 -0.3593319 -0.3191663
          [,8]      [,9]     [,10]     [,11]     [,12]      [,13]    [,14]
[1,] 0.7836584 -1.618404 0.4484949 0.5882003 -1.839945 -0.2012142 1.492588
[2,] 0.7836584 -1.618404 0.4484949 0.5882003 -1.839945 -0.2012142 1.492588
          [,15]       [,16]     [,17]      [,18]     [,19]     [,20]     [,21]
[1,] -0.3871607 -0.03854416 0.1339741 -0.5214013 -1.183009 -1.385641 0.5913808
[2,] -0.3871607 -0.03854416 0.1339741 -0.5214013 -1.183009 -1.385641 0.5913808
         [,22]      [,23]     [,24]     [,25]     [,26]       [,27]      [,28]
[1,] -0.357803 -0.1659046 -1.690728 0.3694584 -1.547099 0.009429096 -0.4530707
[2,] -0.357803 -0.1659046 -1.690728 0.3694584 -1.547099 0.009429096 -0.4530707
          [,29]      [,30]     [,31]    [,32]      [,33]      [,34]    [,35]
[1,] -0.6005449 -0.3916498 -1.178053 1.250692 -0.7907043 -0.3630476 0.925965
[2,] -0.6005449 -0.3916498 -1.178053 1.250692 -0.7907043 -0.3630476 0.925965
         [,36]      [,37]    [,38]     [,39]      [,40]    [,41]      [,42]
[1,] -1.395413 -0.9023845 1.508917 0.8310098 -0.5451148 1.011186 -0.8227502
[2,] -1.395413 -0.9023845 1.508917 0.8310098 -0.5451148 1.011186 -0.8227502
          [,43]     [,44]     [,45]    [,46]    [,47]     [,48]     [,49]
[1,] -0.6124313 -0.213478 -1.551001 1.061634 1.096162 -1.221533 -1.474885
[2,] -0.6124313 -0.213478 -1.551001 1.061634 1.096162 -1.221533 -1.474885
         [,50]     [,51]      [,52]      [,53]      [,54]      [,55]      [,56]
[1,] -1.349971 0.1309051 -0.5785649 -0.1132245 -0.6088274 0.09045355 -0.9838174
[2,] -1.349971 0.1309051 -0.5785649 -0.1132245 -0.6088274 0.09045355 -0.9838174
          [,57]      [,58]    [,59]    [,60]      [,61]    [,62]     [,63]
[1,] -0.4671531 -0.8238101 1.435325 1.660788 -0.6873095 1.405873 0.2391853
[2,] -0.4671531 -0.8238101 1.435325 1.660788 -0.6873095 1.405873 0.2391853
         [,64]      [,65]      [,66]      [,67]     [,68]      [,69]     [,70]
[1,] 0.4214651 -0.8208008 -0.9505857 -0.4928431 -1.228033 -0.6452373 -1.684757
[2,] 0.4214651 -0.8208008 -0.9505857 -0.4928431 -1.228033 -0.6452373 -1.684757
          [,71]     [,72]      [,73]    [,74]     [,75]     [,76]      [,77]
[1,] -0.3510896 0.9717398 0.00165548 1.264361 0.2475462 -1.226399 0.07159025
[2,] -0.3510896 0.9717398 0.00165548 1.264361 0.2475462 -1.226399 0.07159025
            [,78]     [,79]     [,80]      [,81]     [,82]     [,83]      [,84]
[1,] -0.005703694 0.8259232 0.1314664 0.07308112 0.5787801 0.2350958 -0.2545599
[2,] -0.005703694 0.8259232 0.1314664 0.07308112 0.5787801 0.2350958 -0.2545599
         [,85]    [,86]      [,87]      [,88]     [,89]     [,90]     [,91]
[1,] -1.353438 1.603838 -0.2393537 -0.8769971 0.3538937 0.5885426 0.1971628
[2,] -1.353438 1.603838 -0.2393537 -0.8769971 0.3538937 0.5885426 0.1971628
         [,92]     [,93]      [,94]    [,95]     [,96]       [,97]     [,98]
[1,] -1.164364 0.5526928 -0.4391932 2.383925 0.7218382 -0.01697045 0.7787656
[2,] -1.164364 0.5526928 -0.4391932 2.383925 0.7218382 -0.01697045 0.7787656
         [,99] [,100]
[1,] 0.4002125  -1.96
[2,] 0.4002125  -1.96
> 
> 
> Max(tmp2)
[1] 2.510085
> Min(tmp2)
[1] -2.361179
> mean(tmp2)
[1] 0.05396885
> Sum(tmp2)
[1] 5.396885
> Var(tmp2)
[1] 1.058764
> 
> rowMeans(tmp2)
  [1] -0.0968264294 -0.3969004913 -2.2290593118 -0.9554961393 -0.3516383698
  [6] -0.3825563661  0.2363654403 -0.8212043744  1.8779230073  0.8456320149
 [11] -0.2056484830  1.0939865682  0.0333471435  0.9412126953 -0.2508862438
 [16]  0.1980096056  1.8271287561 -0.0894172080 -0.4162726927  0.5400061227
 [21] -1.0031406905 -2.0240125812  0.1155564507  0.3725280051  0.6856729498
 [26]  0.8062105297  0.3710532977  1.1559464640  1.1049173960 -0.3083429281
 [31] -2.3611785472 -0.9036879699 -0.5393025959  1.7061188739 -1.7142488693
 [36]  0.7206769704 -0.4082647153  0.4158499223 -0.5516363088  2.5100850432
 [41] -0.7767051743 -1.1170439536  0.8949406288  1.5138255947 -0.3438579945
 [46] -0.4053999419  1.1130212072  0.1421627405  2.2379801866 -1.3618017582
 [51]  0.3825189250 -0.5381475577  0.7317143454 -0.9989706880 -1.1217767426
 [56]  1.4103042461  0.4415083825  0.5505899893 -1.2504271349 -0.6320388981
 [61]  1.5838237001  0.2680938883  0.3597902013 -0.2365900422  0.0063228558
 [66]  0.9705917817  0.5415094027  0.4863422119  1.6170378501 -1.2128055041
 [71]  0.5500572496  0.9015246384  0.6351530674 -1.3109719349  0.0005471039
 [76] -0.5722890274  0.2032874453  0.8140383608 -0.2518883413 -0.2568957775
 [81] -0.0276458783  1.1914838241  0.0699814262  1.4734438038 -0.7281023767
 [86] -1.8173722912 -0.8142377531  1.0397209909  1.1732897604  0.3781724431
 [91] -1.4938767256  2.0988904190 -0.1975604819  0.4669563562 -0.0170817160
 [96] -1.6998478844 -0.3655423598 -1.2497393079  0.0403953338 -1.6420237073
> rowSums(tmp2)
  [1] -0.0968264294 -0.3969004913 -2.2290593118 -0.9554961393 -0.3516383698
  [6] -0.3825563661  0.2363654403 -0.8212043744  1.8779230073  0.8456320149
 [11] -0.2056484830  1.0939865682  0.0333471435  0.9412126953 -0.2508862438
 [16]  0.1980096056  1.8271287561 -0.0894172080 -0.4162726927  0.5400061227
 [21] -1.0031406905 -2.0240125812  0.1155564507  0.3725280051  0.6856729498
 [26]  0.8062105297  0.3710532977  1.1559464640  1.1049173960 -0.3083429281
 [31] -2.3611785472 -0.9036879699 -0.5393025959  1.7061188739 -1.7142488693
 [36]  0.7206769704 -0.4082647153  0.4158499223 -0.5516363088  2.5100850432
 [41] -0.7767051743 -1.1170439536  0.8949406288  1.5138255947 -0.3438579945
 [46] -0.4053999419  1.1130212072  0.1421627405  2.2379801866 -1.3618017582
 [51]  0.3825189250 -0.5381475577  0.7317143454 -0.9989706880 -1.1217767426
 [56]  1.4103042461  0.4415083825  0.5505899893 -1.2504271349 -0.6320388981
 [61]  1.5838237001  0.2680938883  0.3597902013 -0.2365900422  0.0063228558
 [66]  0.9705917817  0.5415094027  0.4863422119  1.6170378501 -1.2128055041
 [71]  0.5500572496  0.9015246384  0.6351530674 -1.3109719349  0.0005471039
 [76] -0.5722890274  0.2032874453  0.8140383608 -0.2518883413 -0.2568957775
 [81] -0.0276458783  1.1914838241  0.0699814262  1.4734438038 -0.7281023767
 [86] -1.8173722912 -0.8142377531  1.0397209909  1.1732897604  0.3781724431
 [91] -1.4938767256  2.0988904190 -0.1975604819  0.4669563562 -0.0170817160
 [96] -1.6998478844 -0.3655423598 -1.2497393079  0.0403953338 -1.6420237073
> 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.0968264294 -0.3969004913 -2.2290593118 -0.9554961393 -0.3516383698
  [6] -0.3825563661  0.2363654403 -0.8212043744  1.8779230073  0.8456320149
 [11] -0.2056484830  1.0939865682  0.0333471435  0.9412126953 -0.2508862438
 [16]  0.1980096056  1.8271287561 -0.0894172080 -0.4162726927  0.5400061227
 [21] -1.0031406905 -2.0240125812  0.1155564507  0.3725280051  0.6856729498
 [26]  0.8062105297  0.3710532977  1.1559464640  1.1049173960 -0.3083429281
 [31] -2.3611785472 -0.9036879699 -0.5393025959  1.7061188739 -1.7142488693
 [36]  0.7206769704 -0.4082647153  0.4158499223 -0.5516363088  2.5100850432
 [41] -0.7767051743 -1.1170439536  0.8949406288  1.5138255947 -0.3438579945
 [46] -0.4053999419  1.1130212072  0.1421627405  2.2379801866 -1.3618017582
 [51]  0.3825189250 -0.5381475577  0.7317143454 -0.9989706880 -1.1217767426
 [56]  1.4103042461  0.4415083825  0.5505899893 -1.2504271349 -0.6320388981
 [61]  1.5838237001  0.2680938883  0.3597902013 -0.2365900422  0.0063228558
 [66]  0.9705917817  0.5415094027  0.4863422119  1.6170378501 -1.2128055041
 [71]  0.5500572496  0.9015246384  0.6351530674 -1.3109719349  0.0005471039
 [76] -0.5722890274  0.2032874453  0.8140383608 -0.2518883413 -0.2568957775
 [81] -0.0276458783  1.1914838241  0.0699814262  1.4734438038 -0.7281023767
 [86] -1.8173722912 -0.8142377531  1.0397209909  1.1732897604  0.3781724431
 [91] -1.4938767256  2.0988904190 -0.1975604819  0.4669563562 -0.0170817160
 [96] -1.6998478844 -0.3655423598 -1.2497393079  0.0403953338 -1.6420237073
> rowMin(tmp2)
  [1] -0.0968264294 -0.3969004913 -2.2290593118 -0.9554961393 -0.3516383698
  [6] -0.3825563661  0.2363654403 -0.8212043744  1.8779230073  0.8456320149
 [11] -0.2056484830  1.0939865682  0.0333471435  0.9412126953 -0.2508862438
 [16]  0.1980096056  1.8271287561 -0.0894172080 -0.4162726927  0.5400061227
 [21] -1.0031406905 -2.0240125812  0.1155564507  0.3725280051  0.6856729498
 [26]  0.8062105297  0.3710532977  1.1559464640  1.1049173960 -0.3083429281
 [31] -2.3611785472 -0.9036879699 -0.5393025959  1.7061188739 -1.7142488693
 [36]  0.7206769704 -0.4082647153  0.4158499223 -0.5516363088  2.5100850432
 [41] -0.7767051743 -1.1170439536  0.8949406288  1.5138255947 -0.3438579945
 [46] -0.4053999419  1.1130212072  0.1421627405  2.2379801866 -1.3618017582
 [51]  0.3825189250 -0.5381475577  0.7317143454 -0.9989706880 -1.1217767426
 [56]  1.4103042461  0.4415083825  0.5505899893 -1.2504271349 -0.6320388981
 [61]  1.5838237001  0.2680938883  0.3597902013 -0.2365900422  0.0063228558
 [66]  0.9705917817  0.5415094027  0.4863422119  1.6170378501 -1.2128055041
 [71]  0.5500572496  0.9015246384  0.6351530674 -1.3109719349  0.0005471039
 [76] -0.5722890274  0.2032874453  0.8140383608 -0.2518883413 -0.2568957775
 [81] -0.0276458783  1.1914838241  0.0699814262  1.4734438038 -0.7281023767
 [86] -1.8173722912 -0.8142377531  1.0397209909  1.1732897604  0.3781724431
 [91] -1.4938767256  2.0988904190 -0.1975604819  0.4669563562 -0.0170817160
 [96] -1.6998478844 -0.3655423598 -1.2497393079  0.0403953338 -1.6420237073
> 
> colMeans(tmp2)
[1] 0.05396885
> colSums(tmp2)
[1] 5.396885
> colVars(tmp2)
[1] 1.058764
> colSd(tmp2)
[1] 1.028962
> colMax(tmp2)
[1] 2.510085
> colMin(tmp2)
[1] -2.361179
> colMedians(tmp2)
[1] 0.03687124
> colRanges(tmp2)
          [,1]
[1,] -2.361179
[2,]  2.510085
> 
> 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.4507965 -5.1894963  0.9374622 -4.1831112 -2.6474658  2.4415482
 [7]  7.2615112  0.2058747 -1.9452887 -0.1561129
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.47227383
[2,] -1.04966061
[3,] -0.55823807
[4,] -0.08637328
[5,]  1.65876180
> 
> rowApply(tmp,sum)
 [1] -0.3188697  3.2452848 -1.0062120 -0.2777812 -1.6911811 -0.1287068
 [7] -5.3740737  2.4790046 -3.3540433 -0.2992968
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    2    2    5    2    3    5    2    3     9
 [2,]    2    6    1    1   10    4    9    7    2     3
 [3,]    1    3    6    7    7    5   10    9    4     7
 [4,]    6    1    9    2    9    2    1    6    7     6
 [5,]    4    9   10    3    1    7    8    3    6     4
 [6,]   10    5    8   10    8    6    7    5    1     2
 [7,]    3   10    7    6    3   10    6   10   10     5
 [8,]    5    8    3    4    5    1    3    8    9    10
 [9,]    7    4    5    9    6    9    2    1    5     8
[10,]    9    7    4    8    4    8    4    4    8     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.1099697 -0.5716574  1.1671276  2.8514476 -4.8319651 -1.1610679
 [7]  0.9877887 -1.2852411 -0.6676009  0.3417312 -3.1294255  1.7806748
[13]  2.5374031 -3.6661062 -0.6973124 -3.0348491  2.0128089 -2.8710923
[19]  1.2666993 -0.6460288
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.5386088
[2,] -0.3685121
[3,]  0.1601665
[4,]  0.5192092
[5,]  1.1177756
> 
> rowApply(tmp,sum)
[1] -4.890251 -3.506586  3.793639 -2.646689 -3.476748
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   17   15    1   14    9
[2,]   12    7    9    8   18
[3,]    7   18   18    2   19
[4,]   15   13   17   16   17
[5,]    1    1   10   17    6
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]      [,4]       [,5]       [,6]
[1,]  1.1177756 -0.04359969 -0.8609446 0.4620621 -2.2717309 -0.8664542
[2,]  0.5192092 -0.78926151  1.3789962 0.3819625 -2.7259453  1.0864809
[3,] -2.5386088  0.11239368  1.0923274 1.0892538  0.2207107  0.2592163
[4,]  0.1601665 -0.41027800 -1.5358717 0.5382625  0.5645349 -1.0833469
[5,] -0.3685121  0.55908812  1.0926203 0.3799068 -0.6195345 -0.5569639
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  0.4993852 -0.2330275 -1.7194430 -0.8255991 -0.6691629  0.16983517
[2,]  0.4824638 -1.4744825  1.5279152 -0.1048777 -0.9636534 -0.34239108
[3,] -0.2684274  0.5414023  1.4842462  0.7568522 -0.6284009  0.31945600
[4,]  0.0610081  0.8862882 -0.5682515  0.1720038 -1.0812888  0.08490925
[5,]  0.2133589 -1.0054217 -1.3920678  0.3433520  0.2130806  1.54886543
          [,13]       [,14]      [,15]       [,16]       [,17]       [,18]
[1,]  1.6900072 -0.65732861  0.2097577 -1.21799274  1.17879340 -0.91222100
[2,] -1.0995864 -2.28762117  0.6765402  0.02799607 -0.02672879  0.23792944
[3,]  0.4549891  0.08330567 -0.4676687 -0.31951756  1.27128391 -0.06900847
[4,]  1.7725781 -0.42924266 -0.3159108 -1.59321782 -0.23153454 -1.26587439
[5,] -0.2805849 -0.37521945 -0.8000308  0.06788296 -0.17900504 -0.86191790
           [,19]       [,20]
[1,]  1.30979339 -1.25015645
[2,]  1.93613104 -1.94766278
[3,] -0.44083982  0.84067328
[4,] -0.06514043  1.69351766
[5,] -1.47324488  0.01759951
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2     col3    col4       col5       col6       col7
row1 0.2568129 0.5330751 1.280458 1.91666 -0.3903915 -0.3255015 -0.4661926
          col8       col9     col10     col11      col12    col13      col14
row1 0.8520265 -0.3829074 -0.585689 0.3457069 -0.2285833 1.233534 -0.2087945
         col15    col16     col17    col18     col19      col20
row1 0.6842555 1.785066 -0.102975 1.218584 0.4413522 -0.5770913
> tmp[,"col10"]
          col10
row1 -0.5856890
row2  0.3249115
row3  0.2757611
row4  1.0872009
row5 -0.6003134
> tmp[c("row1","row5"),]
          col1       col2      col3      col4       col5       col6       col7
row1 0.2568129  0.5330751 1.2804578 1.9166602 -0.3903915 -0.3255015 -0.4661926
row5 1.7493120 -1.6447373 0.8926491 0.9677866 -1.6569052 -0.1636127 -0.3888821
          col8       col9      col10      col11      col12     col13      col14
row1 0.8520265 -0.3829074 -0.5856890  0.3457069 -0.2285833  1.233534 -0.2087945
row5 0.3189833 -0.4730685 -0.6003134 -0.4516793  1.2569969 -1.274010 -0.1720620
          col15     col16      col17     col18     col19      col20
row1  0.6842555  1.785066 -0.1029750  1.218584 0.4413522 -0.5770913
row5 -0.2783823 -2.001157  0.3149475 -0.270962 0.4153455 -1.3970491
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.3255015 -0.5770913
row2  0.3150319  1.6548328
row3  0.8749905 -1.4640063
row4 -0.2871948  0.5386146
row5 -0.1636127 -1.3970491
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.3255015 -0.5770913
row5 -0.1636127 -1.3970491
> 
> 
> 
> 
> 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 48.85681 49.90389 50.14703 49.72871 49.16249 103.4956 49.86859 49.38941
         col9    col10    col11    col12    col13    col14   col15   col16
row1 50.52466 51.83445 51.24029 51.64486 49.53177 50.57511 49.4321 50.1156
        col17    col18    col19    col20
row1 50.97577 50.79636 50.94244 104.4968
> tmp[,"col10"]
        col10
row1 51.83445
row2 30.77386
row3 30.38874
row4 30.88545
row5 48.86109
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.85681 49.90389 50.14703 49.72871 49.16249 103.4956 49.86859 49.38941
row5 49.48300 51.31603 48.44900 49.02960 51.57864 104.3855 49.05309 51.06912
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.52466 51.83445 51.24029 51.64486 49.53177 50.57511 49.43210 50.11560
row5 50.33309 48.86109 51.13101 49.50291 51.15118 49.47812 50.83942 50.36853
        col17    col18    col19    col20
row1 50.97577 50.79636 50.94244 104.4968
row5 49.42578 50.03837 50.58365 105.2539
> tmp[,c("col6","col20")]
          col6     col20
row1 103.49565 104.49683
row2  74.94440  74.47055
row3  74.59913  74.25298
row4  76.54821  74.63416
row5 104.38547 105.25389
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.4956 104.4968
row5 104.3855 105.2539
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.4956 104.4968
row5 104.3855 105.2539
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.6520088
[2,]  1.3271233
[3,] -0.4288616
[4,]  1.6702406
[5,] -0.6620026
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.09877343  0.7082076
[2,]  0.31763789 -1.1362741
[3,]  1.46282919  0.1572284
[4,] -0.04723905 -0.8860541
[5,] -1.35069766 -0.1741094
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -2.19644237 -0.4091058
[2,]  0.05844806 -0.7824431
[3,] -0.83659235  0.1789550
[4,] -0.87871619  0.4726888
[5,] -0.37518040  0.9785887
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -2.196442
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -2.19644237
[2,]  0.05844806
> 
> 
> 
> 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.4319631 0.36626644 -1.992466  0.2472436 -0.4648443 -1.727447  0.4971440
row1  1.0101184 0.04046754 -1.806466 -0.3093194  1.0135857  0.186323 -0.4678184
            [,8]      [,9]      [,10]     [,11]      [,12]      [,13]     [,14]
row3 -0.09786023  2.552757 -0.2919742 1.1145783 -0.4593356 -0.0271485 -1.305777
row1  0.10900385 -1.405054  0.1715840 0.1195334  0.5987537  0.4927265 -1.305786
          [,15]    [,16]      [,17]      [,18]     [,19]     [,20]
row3 -1.3095276 2.783681 -0.8307835  0.4574595 -1.138019 0.3763902
row1 -0.8962861 2.573496 -0.5960993 -0.7717493 -2.004071 0.2845357
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]      [,3]      [,4]      [,5]       [,6]       [,7]
row2 0.2915328 1.370238 -1.276331 0.2839889 0.1837705 0.04554639 -0.5229826
            [,8]       [,9]     [,10]
row2 -0.02996518 -0.4758382 -1.893396
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]       [,4]      [,5]       [,6]       [,7]
row5 0.4432285 1.607904 -2.023024 -0.5708816 -1.470965 -0.2255157 -0.9004076
           [,8]       [,9]    [,10]      [,11]      [,12]    [,13]       [,14]
row5 -0.4168382 -0.5208629 1.130996 -0.6894688 -0.3967904 1.726511 -0.02090186
          [,15]     [,16]      [,17]     [,18]     [,19]     [,20]
row5 -0.4462891 0.8652756 -0.5991093 -1.353957 0.7821723 -1.211791
> 
> 
> 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: 0x1cfb0570>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b5eee7225"
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b2b8377ec"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b32e7f760"
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b5e24eb53"
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b7d134c1e"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b425203ae"
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b1daabf98"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b3c8a61a4"
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b73ed9953"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b732aba91"
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b2f9088a6"
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b71d072f8"
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b26e864d2"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b1b6067ee"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1e7c8b193de312"
> 
> 
> ### 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: 0x1d8be880>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x1d8be880>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x1d8be880>
> rowMedians(tmp)
  [1] -0.2222688017 -0.2210072483 -0.2392769537 -0.2738113998  0.2678648289
  [6] -0.2683063653 -0.1692739847  0.1997596666  0.3197632713 -0.1776529667
 [11] -0.3620836702  0.2045047621 -0.0273973450  0.3171527092 -0.0131048432
 [16] -0.0805767703  0.4208735120 -0.2354836013  0.7931541265  0.2792559103
 [21] -0.5518849302 -0.5887212902  0.1909178376 -0.0677187310  0.4568210918
 [26]  0.3503788838  0.3531146409  0.0604691910  0.0142015536 -0.0378912703
 [31] -0.3320600292 -0.4268485879 -0.4186942720  0.0261679784  0.0005686099
 [36]  0.0893436019  0.6328848227 -0.3406739751 -0.0218329337 -0.2316503679
 [41]  0.0593629777 -0.0986830062  0.4716293446 -0.6697543360 -0.0791609311
 [46]  0.1354419772 -0.5077161364  0.3182992872 -0.3959620134 -0.1885347238
 [51] -0.4364283412 -0.3378998217 -0.3680622506  0.0369394431 -0.5468268982
 [56]  0.4909162552 -0.2665937944 -0.0489201206  0.4059015715 -0.4092863996
 [61]  0.1868982487 -0.0938398719  0.0795764991 -0.4344060851  0.1893140420
 [66]  1.0700208463 -0.6273534054 -0.3922043448  0.2539775749  0.3297400652
 [71]  0.2614196171  0.3575900914 -0.2042199528  0.0195545953 -0.0407383810
 [76] -0.3660206553  0.0054257115  0.1444526402 -0.4408882699 -0.0808499645
 [81] -0.0073297209 -0.3192051030  0.1102898141  0.2108221418 -0.3872816620
 [86] -0.4390287467 -0.1298247388 -0.3000669572 -0.2987443311 -0.1728443327
 [91]  0.3089745169  0.3561534475  0.2375656114 -0.4386590574 -0.3858369725
 [96]  0.0947081277  0.4941526052  0.1560608398 -0.4175462774 -0.1891296442
[101]  0.4058171189  0.2411575583  0.1476991202 -0.0560719860  0.0200683865
[106]  0.2355165789 -0.2238279875  0.1875122634  0.3515430649  0.2477837710
[111] -0.0951525458  0.4141676902  0.0109014277 -0.4058104367  0.1633032824
[116] -0.6672192112 -0.0153968073 -0.4341832796  0.7391925518  0.2175751228
[121] -0.0563046978  0.0808877249  0.2036844303 -0.0397705623 -0.1023774572
[126]  0.5897657668 -0.2159667709  0.1993799474  0.2777789466  0.1166209510
[131] -0.1870119014 -0.1451644519 -0.1488480193  0.1051535851 -0.2579510451
[136] -0.1584673377  0.1257337339  0.0576173356  0.3340814139 -0.2637721581
[141] -0.2011705331  0.0893465776 -0.5009079095 -0.0980849529  0.3150945142
[146] -0.2969538085  0.3246925531  0.4902164033 -0.1536837294  0.1287840717
[151] -0.2153058330  0.1458170349 -0.0276249224 -0.3404404639  0.5909321036
[156]  0.0654216939 -0.4640099470  0.0090092512 -0.0965651277  0.0948327559
[161]  0.7192575057  0.1818712146  0.4894866045 -0.2895568245  0.5212333412
[166] -0.0930531615  0.2673320931  0.1051659357  0.1272207457 -0.0729693556
[171]  0.0786686702 -0.2464256570 -0.3083365664  0.1233304911 -0.5171382807
[176] -0.4604883803  0.0371398674 -0.3991585306 -0.2781056393 -0.2105490466
[181] -0.3901073867  0.0945575898 -0.0094120488  0.2704541959 -0.0939600095
[186]  0.4562368975  0.2809152073 -0.3830405952  0.4139797284  0.5093669791
[191]  0.4874214235 -0.2732168134  0.1440795035 -0.2334537418 -0.2574794847
[196] -0.3670809913  0.6789775461  0.6890405914  0.1822957744  0.0724338982
[201] -0.4247077561  0.2831703226 -0.1623584600 -0.1966672678  0.3357671498
[206]  0.5760934368  0.0969835088 -0.2548177815  0.6000786864  0.0643468967
[211]  0.2319575618 -0.3714296079  0.8264797969  0.0462827986 -0.1552580253
[216] -0.1193284358 -0.3090318323  0.1667948651  0.5427672647 -0.1950174724
[221]  0.1615346336  0.1222683248 -0.2222432587 -0.5031093756 -0.0096102650
[226] -0.1029092901 -0.0210346432  0.0502359474 -0.4108752691 -0.1177379039
> 
> proc.time()
   user  system elapsed 
  1.904   0.878   2.807 

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: 0x2c10f6e0>
> .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: 0x2c10f6e0>
> .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: 0x2c10f6e0>
> .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: 0x2c10f6e0>
> 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: 0x2c1576a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2c1576a0>
> .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: 0x2c1576a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2c1576a0>
> .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: 0x2c1576a0>
> 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: 0x2b3137d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2b3137d0>
> .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: 0x2b3137d0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2b3137d0>
> .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: 0x2b3137d0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x2b3137d0>
> .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: 0x2b3137d0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x2b3137d0>
> .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: 0x2b3137d0>
> 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: 0x2be72d70>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x2be72d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2be72d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2be72d70>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1e7f76313ec07c" "BufferedMatrixFile1e7f7645cd82a1"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1e7f76313ec07c" "BufferedMatrixFile1e7f7645cd82a1"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x2ba15cd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2ba15cd0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2ba15cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x2ba15cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x2ba15cd0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x2ba15cd0>
> .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: 0x2a984a10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2a984a10>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2a984a10>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x2a984a10>
> 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: 0x2c89ecc0>
> .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: 0x2c89ecc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.329   0.054   0.370 

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.356   0.029   0.373 

Example timings