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

This page was generated on 2025-06-19 12:05 -0400 (Thu, 19 Jun 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.2 LTS)x86_644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4810
palomino8Windows Server 2022 Datacenterx644.5.0 (2025-04-11 ucrt) -- "How About a Twenty-Six" 4548
kjohnson3macOS 13.7.1 Venturaarm644.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six" 4528
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4493
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 250/2309HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-06-18 13:25 -0400 (Wed, 18 Jun 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on taishan

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.73.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.73.0.tar.gz
StartedAt: 2025-06-17 05:28:18 -0000 (Tue, 17 Jun 2025)
EndedAt: 2025-06-17 05:28:49 -0000 (Tue, 17 Jun 2025)
EllapsedTime: 31.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.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 (2025-04-11)
* 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)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.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.22-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-4.5.0/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.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-4.5.0/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-4.5.0/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-4.5.0/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-4.5.0/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-4.5.0/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.5.0/lib -lR
installing to /home/biocbuild/R/R-4.5.0/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
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.351   0.016   0.352 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
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.22-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 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 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] "Tue Jun 17 05:28:43 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] "Tue Jun 17 05:28:43 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: 0x1eb30ff0>
> 
> 
> 
> 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] "Tue Jun 17 05:28:44 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] "Tue Jun 17 05:28:44 2025"
> 
> ColMode(tmp2)
<pointer: 0x1eb30ff0>
> 
> 
> 
> ### 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,] 101.0817693 -0.3505741  1.5118946 -0.07217438
[2,]  -1.4632795 -0.7288913 -0.4320967 -0.26927264
[3,]   0.9307134  0.6405087  0.1824915  0.38013196
[4,]   0.5882668 -0.6912847 -0.1847821  0.06261797
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-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,] 101.0817693 0.3505741 1.5118946 0.07217438
[2,]   1.4632795 0.7288913 0.4320967 0.26927264
[3,]   0.9307134 0.6405087 0.1824915 0.38013196
[4,]   0.5882668 0.6912847 0.1847821 0.06261797
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-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.0539430 0.5920930 1.2295912 0.2686529
[2,]  1.2096609 0.8537513 0.6573406 0.5189149
[3,]  0.9647349 0.8003179 0.4271903 0.6165484
[4,]  0.7669855 0.8314353 0.4298628 0.2502358
> 
> 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.22-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,] 226.62120 31.27150 38.80781 27.75870
[2,]  38.55989 34.26640 32.00550 30.45842
[3,]  35.57806 33.64369 29.45439 31.54562
[4,]  33.25812 34.00564 29.48341 27.56498
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x1fd609a0>
> exp(tmp5)
<pointer: 0x1fd609a0>
> log(tmp5,2)
<pointer: 0x1fd609a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.6823
> Min(tmp5)
[1] 54.74394
> mean(tmp5)
[1] 72.79181
> Sum(tmp5)
[1] 14558.36
> Var(tmp5)
[1] 860.8476
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.96162 73.90618 67.58551 70.29925 68.85467 70.69268 70.66180 70.52755
 [9] 73.87812 70.55075
> rowSums(tmp5)
 [1] 1819.232 1478.124 1351.710 1405.985 1377.093 1413.854 1413.236 1410.551
 [9] 1477.562 1411.015
> rowVars(tmp5)
 [1] 8113.45623   54.59101   33.10610   36.15511   75.18619   75.56915
 [7]   59.66161   44.02730   52.42936   50.51067
> rowSd(tmp5)
 [1] 90.074726  7.388573  5.753790  6.012912  8.670997  8.693052  7.724093
 [8]  6.635307  7.240812  7.107086
> rowMax(tmp5)
 [1] 471.68233  86.94600  80.64625  82.29084  85.30322  84.09270  83.74625
 [8]  83.20565  86.64558  85.32239
> rowMin(tmp5)
 [1] 57.77610 60.24011 56.52891 57.37289 56.75631 54.74394 59.92047 58.02017
 [9] 60.67416 57.56247
> 
> colMeans(tmp5)
 [1] 111.98274  70.39325  69.92080  65.71072  68.00073  73.36475  76.34199
 [8]  72.76600  69.64457  72.59101  69.88856  71.81750  73.68831  69.84726
[15]  67.46549  71.90721  72.48945  71.92806  67.99876  68.08909
> colSums(tmp5)
 [1] 1119.8274  703.9325  699.2080  657.1072  680.0073  733.6475  763.4199
 [8]  727.6600  696.4457  725.9101  698.8856  718.1750  736.8831  698.4726
[15]  674.6549  719.0721  724.8945  719.2806  679.9876  680.8909
> colVars(tmp5)
 [1] 16025.27957    50.59875    62.22545    65.36243    44.44463    59.10896
 [7]    36.90448    50.59676    49.58451    69.81346    95.50653    34.91846
[13]    64.82995    88.48926    47.62868    67.34499    90.03252    35.97218
[19]    32.53771    29.97341
> colSd(tmp5)
 [1] 126.590993   7.113280   7.888311   8.084703   6.666680   7.688235
 [7]   6.074906   7.113140   7.041627   8.355445   9.772744   5.909184
[13]   8.051705   9.406873   6.901354   8.206399   9.488547   5.997682
[19]   5.704184   5.474797
> colMax(tmp5)
 [1] 471.68233  80.17632  80.77337  80.86196  78.09365  85.32239  83.20565
 [8]  83.74625  84.00402  82.65151  86.64558  80.09872  84.09270  86.94600
[15]  80.79160  82.29084  85.58087  80.71185  75.90379  76.60799
> colMin(tmp5)
 [1] 61.84943 56.75631 61.30546 57.02810 54.74394 65.03074 65.18350 60.44775
 [9] 57.56247 58.57231 61.92594 62.96347 58.60089 58.08578 59.92047 56.52891
[17] 59.46539 63.22194 58.17543 58.02017
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.96162 73.90618 67.58551 70.29925 68.85467 70.69268       NA 70.52755
 [9] 73.87812 70.55075
> rowSums(tmp5)
 [1] 1819.232 1478.124 1351.710 1405.985 1377.093 1413.854       NA 1410.551
 [9] 1477.562 1411.015
> rowVars(tmp5)
 [1] 8113.45623   54.59101   33.10610   36.15511   75.18619   75.56915
 [7]   62.37062   44.02730   52.42936   50.51067
> rowSd(tmp5)
 [1] 90.074726  7.388573  5.753790  6.012912  8.670997  8.693052  7.897507
 [8]  6.635307  7.240812  7.107086
> rowMax(tmp5)
 [1] 471.68233  86.94600  80.64625  82.29084  85.30322  84.09270        NA
 [8]  83.20565  86.64558  85.32239
> rowMin(tmp5)
 [1] 57.77610 60.24011 56.52891 57.37289 56.75631 54.74394       NA 58.02017
 [9] 60.67416 57.56247
> 
> colMeans(tmp5)
 [1] 111.98274  70.39325  69.92080  65.71072  68.00073  73.36475  76.34199
 [8]  72.76600        NA  72.59101  69.88856  71.81750  73.68831  69.84726
[15]  67.46549  71.90721  72.48945  71.92806  67.99876  68.08909
> colSums(tmp5)
 [1] 1119.8274  703.9325  699.2080  657.1072  680.0073  733.6475  763.4199
 [8]  727.6600        NA  725.9101  698.8856  718.1750  736.8831  698.4726
[15]  674.6549  719.0721  724.8945  719.2806  679.9876  680.8909
> colVars(tmp5)
 [1] 16025.27957    50.59875    62.22545    65.36243    44.44463    59.10896
 [7]    36.90448    50.59676          NA    69.81346    95.50653    34.91846
[13]    64.82995    88.48926    47.62868    67.34499    90.03252    35.97218
[19]    32.53771    29.97341
> colSd(tmp5)
 [1] 126.590993   7.113280   7.888311   8.084703   6.666680   7.688235
 [7]   6.074906   7.113140         NA   8.355445   9.772744   5.909184
[13]   8.051705   9.406873   6.901354   8.206399   9.488547   5.997682
[19]   5.704184   5.474797
> colMax(tmp5)
 [1] 471.68233  80.17632  80.77337  80.86196  78.09365  85.32239  83.20565
 [8]  83.74625        NA  82.65151  86.64558  80.09872  84.09270  86.94600
[15]  80.79160  82.29084  85.58087  80.71185  75.90379  76.60799
> colMin(tmp5)
 [1] 61.84943 56.75631 61.30546 57.02810 54.74394 65.03074 65.18350 60.44775
 [9]       NA 58.57231 61.92594 62.96347 58.60089 58.08578 59.92047 56.52891
[17] 59.46539 63.22194 58.17543 58.02017
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.6823
> Min(tmp5,na.rm=TRUE)
[1] 54.74394
> mean(tmp5,na.rm=TRUE)
[1] 72.78635
> Sum(tmp5,na.rm=TRUE)
[1] 14484.48
> Var(tmp5,na.rm=TRUE)
[1] 865.1893
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.96162 73.90618 67.58551 70.29925 68.85467 70.69268 70.49244 70.52755
 [9] 73.87812 70.55075
> rowSums(tmp5,na.rm=TRUE)
 [1] 1819.232 1478.124 1351.710 1405.985 1377.093 1413.854 1339.356 1410.551
 [9] 1477.562 1411.015
> rowVars(tmp5,na.rm=TRUE)
 [1] 8113.45623   54.59101   33.10610   36.15511   75.18619   75.56915
 [7]   62.37062   44.02730   52.42936   50.51067
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.074726  7.388573  5.753790  6.012912  8.670997  8.693052  7.897507
 [8]  6.635307  7.240812  7.107086
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.68233  86.94600  80.64625  82.29084  85.30322  84.09270  83.74625
 [8]  83.20565  86.64558  85.32239
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.77610 60.24011 56.52891 57.37289 56.75631 54.74394 59.92047 58.02017
 [9] 60.67416 57.56247
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.98274  70.39325  69.92080  65.71072  68.00073  73.36475  76.34199
 [8]  72.76600  69.17401  72.59101  69.88856  71.81750  73.68831  69.84726
[15]  67.46549  71.90721  72.48945  71.92806  67.99876  68.08909
> colSums(tmp5,na.rm=TRUE)
 [1] 1119.8274  703.9325  699.2080  657.1072  680.0073  733.6475  763.4199
 [8]  727.6600  622.5661  725.9101  698.8856  718.1750  736.8831  698.4726
[15]  674.6549  719.0721  724.8945  719.2806  679.9876  680.8909
> colVars(tmp5,na.rm=TRUE)
 [1] 16025.27957    50.59875    62.22545    65.36243    44.44463    59.10896
 [7]    36.90448    50.59676    53.29149    69.81346    95.50653    34.91846
[13]    64.82995    88.48926    47.62868    67.34499    90.03252    35.97218
[19]    32.53771    29.97341
> colSd(tmp5,na.rm=TRUE)
 [1] 126.590993   7.113280   7.888311   8.084703   6.666680   7.688235
 [7]   6.074906   7.113140   7.300102   8.355445   9.772744   5.909184
[13]   8.051705   9.406873   6.901354   8.206399   9.488547   5.997682
[19]   5.704184   5.474797
> colMax(tmp5,na.rm=TRUE)
 [1] 471.68233  80.17632  80.77337  80.86196  78.09365  85.32239  83.20565
 [8]  83.74625  84.00402  82.65151  86.64558  80.09872  84.09270  86.94600
[15]  80.79160  82.29084  85.58087  80.71185  75.90379  76.60799
> colMin(tmp5,na.rm=TRUE)
 [1] 61.84943 56.75631 61.30546 57.02810 54.74394 65.03074 65.18350 60.44775
 [9] 57.56247 58.57231 61.92594 62.96347 58.60089 58.08578 59.92047 56.52891
[17] 59.46539 63.22194 58.17543 58.02017
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.96162 73.90618 67.58551 70.29925 68.85467 70.69268      NaN 70.52755
 [9] 73.87812 70.55075
> rowSums(tmp5,na.rm=TRUE)
 [1] 1819.232 1478.124 1351.710 1405.985 1377.093 1413.854    0.000 1410.551
 [9] 1477.562 1411.015
> rowVars(tmp5,na.rm=TRUE)
 [1] 8113.45623   54.59101   33.10610   36.15511   75.18619   75.56915
 [7]         NA   44.02730   52.42936   50.51067
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.074726  7.388573  5.753790  6.012912  8.670997  8.693052        NA
 [8]  6.635307  7.240812  7.107086
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.68233  86.94600  80.64625  82.29084  85.30322  84.09270        NA
 [8]  83.20565  86.64558  85.32239
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.77610 60.24011 56.52891 57.37289 56.75631 54.74394       NA 58.02017
 [9] 60.67416 57.56247
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.55311  69.59627  70.20734  65.35830  67.35081  73.92866  76.35796
 [8]  71.54597       NaN  71.47318  70.72205  70.89737  72.90445  70.86465
[15]  68.30383  72.66973  73.64587  71.72912  68.33078  67.95618
> colSums(tmp5,na.rm=TRUE)
 [1] 1057.9780  626.3665  631.8661  588.2247  606.1573  665.3579  687.2217
 [8]  643.9137    0.0000  643.2586  636.4985  638.0763  656.1401  637.7819
[15]  614.7345  654.0275  662.8128  645.5621  614.9770  611.6056
> colVars(tmp5,na.rm=TRUE)
 [1] 17679.36329    49.77794    69.07996    72.13545    45.24826    62.92014
 [7]    41.51467    40.17607          NA    64.48269    99.62929    29.75846
[13]    66.02126    87.90564    45.67569    69.22210    86.24198    40.02347
[19]    35.36474    33.52135
> colSd(tmp5,na.rm=TRUE)
 [1] 132.963767   7.055348   8.311435   8.493259   6.726682   7.932222
 [7]   6.443188   6.338460         NA   8.030111   9.981447   5.455132
[13]   8.125347   9.375801   6.758379   8.319982   9.286656   6.326410
[19]   5.946826   5.789762
> colMax(tmp5,na.rm=TRUE)
 [1] 471.68233  80.17632  80.77337  80.86196  78.09365  85.32239  83.20565
 [8]  82.86809      -Inf  81.45748  86.64558  79.07715  84.09270  86.94600
[15]  80.79160  82.29084  85.58087  80.71185  75.90379  76.60799
> colMin(tmp5,na.rm=TRUE)
 [1] 63.78216 56.75631 61.30546 57.02810 54.74394 65.03074 65.18350 60.44775
 [9]      Inf 58.57231 61.92594 62.96347 58.60089 58.08578 60.24011 56.52891
[17] 59.46539 63.22194 58.17543 58.02017
> 
> 
> 
> 
> 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] 221.6380 195.0823 193.8830 288.1184 491.0535 253.6688 231.9016 140.9735
 [9] 213.8383 268.6105
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 221.6380 195.0823 193.8830 288.1184 491.0535 253.6688 231.9016 140.9735
 [9] 213.8383 268.6105
> 
> 
> 
> 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.705303e-13  2.842171e-14 -1.136868e-13  5.684342e-14 -5.684342e-14
 [6]  2.273737e-13  0.000000e+00 -2.842171e-14 -1.705303e-13  0.000000e+00
[11]  0.000000e+00  1.136868e-13 -5.684342e-14 -2.842171e-14 -3.410605e-13
[16]  1.421085e-14 -5.684342e-14 -1.421085e-14  5.684342e-14 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   18 
7   2 
7   1 
5   20 
2   2 
1   17 
2   14 
6   8 
8   5 
7   9 
6   19 
9   16 
6   12 
4   10 
3   13 
5   1 
6   2 
5   15 
9   12 
1   11 
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] 1.991406
> Min(tmp)
[1] -2.664992
> mean(tmp)
[1] 0.0672302
> Sum(tmp)
[1] 6.72302
> Var(tmp)
[1] 0.9079369
> 
> rowMeans(tmp)
[1] 0.0672302
> rowSums(tmp)
[1] 6.72302
> rowVars(tmp)
[1] 0.9079369
> rowSd(tmp)
[1] 0.9528572
> rowMax(tmp)
[1] 1.991406
> rowMin(tmp)
[1] -2.664992
> 
> colMeans(tmp)
  [1]  0.836796350 -0.553520407  0.011929005  0.383488487 -0.431395158
  [6] -0.431547909 -0.756298983 -0.118333278 -1.456467967 -0.106074251
 [11]  0.096770778  0.657389061 -0.552718765  0.161142090  0.345695137
 [16]  0.988389092 -0.068307882 -0.453571941 -0.802505521 -1.277844747
 [21] -0.520660144  0.503282216 -0.645582877  0.614603656 -0.239036949
 [26]  0.102561983  1.065147756 -0.207246555  0.814327212  1.178215480
 [31] -0.440952933 -0.467728843  0.008611898  1.549955613 -1.795246803
 [36] -1.076680558  0.712063073  1.494287209  0.136002126  0.652815451
 [41]  0.143514115 -1.179588551  0.413209188  0.498538355 -0.211801705
 [46]  0.671864768 -0.093910234  1.272774754  1.075306701 -2.539178014
 [51] -2.664991541  0.543660376 -1.690654993  1.854153282  0.197504501
 [56]  1.391076168  1.108921545  1.579352949  1.617653507 -1.684947694
 [61] -0.199177532 -0.211500845  0.813186602 -1.113972031 -0.651475923
 [66]  0.302693884 -0.483631002  0.068077305 -0.630114705  0.102314229
 [71] -1.142620304  1.094572506  0.198478414 -1.123110783  1.796085416
 [76]  0.088466075 -0.153000302  1.578565963  0.470111473  0.590096365
 [81]  1.002656634  0.214911883 -0.028671602 -0.215526316  0.938205722
 [86]  1.239615860 -0.269004729 -0.895951511 -0.380965668  1.044196169
 [91]  0.338153753  0.423701177  0.201840523 -1.312319367 -1.727629936
 [96] -0.348383357 -0.514856708 -0.014581935  1.427969865  1.991405905
> colSums(tmp)
  [1]  0.836796350 -0.553520407  0.011929005  0.383488487 -0.431395158
  [6] -0.431547909 -0.756298983 -0.118333278 -1.456467967 -0.106074251
 [11]  0.096770778  0.657389061 -0.552718765  0.161142090  0.345695137
 [16]  0.988389092 -0.068307882 -0.453571941 -0.802505521 -1.277844747
 [21] -0.520660144  0.503282216 -0.645582877  0.614603656 -0.239036949
 [26]  0.102561983  1.065147756 -0.207246555  0.814327212  1.178215480
 [31] -0.440952933 -0.467728843  0.008611898  1.549955613 -1.795246803
 [36] -1.076680558  0.712063073  1.494287209  0.136002126  0.652815451
 [41]  0.143514115 -1.179588551  0.413209188  0.498538355 -0.211801705
 [46]  0.671864768 -0.093910234  1.272774754  1.075306701 -2.539178014
 [51] -2.664991541  0.543660376 -1.690654993  1.854153282  0.197504501
 [56]  1.391076168  1.108921545  1.579352949  1.617653507 -1.684947694
 [61] -0.199177532 -0.211500845  0.813186602 -1.113972031 -0.651475923
 [66]  0.302693884 -0.483631002  0.068077305 -0.630114705  0.102314229
 [71] -1.142620304  1.094572506  0.198478414 -1.123110783  1.796085416
 [76]  0.088466075 -0.153000302  1.578565963  0.470111473  0.590096365
 [81]  1.002656634  0.214911883 -0.028671602 -0.215526316  0.938205722
 [86]  1.239615860 -0.269004729 -0.895951511 -0.380965668  1.044196169
 [91]  0.338153753  0.423701177  0.201840523 -1.312319367 -1.727629936
 [96] -0.348383357 -0.514856708 -0.014581935  1.427969865  1.991405905
> 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.836796350 -0.553520407  0.011929005  0.383488487 -0.431395158
  [6] -0.431547909 -0.756298983 -0.118333278 -1.456467967 -0.106074251
 [11]  0.096770778  0.657389061 -0.552718765  0.161142090  0.345695137
 [16]  0.988389092 -0.068307882 -0.453571941 -0.802505521 -1.277844747
 [21] -0.520660144  0.503282216 -0.645582877  0.614603656 -0.239036949
 [26]  0.102561983  1.065147756 -0.207246555  0.814327212  1.178215480
 [31] -0.440952933 -0.467728843  0.008611898  1.549955613 -1.795246803
 [36] -1.076680558  0.712063073  1.494287209  0.136002126  0.652815451
 [41]  0.143514115 -1.179588551  0.413209188  0.498538355 -0.211801705
 [46]  0.671864768 -0.093910234  1.272774754  1.075306701 -2.539178014
 [51] -2.664991541  0.543660376 -1.690654993  1.854153282  0.197504501
 [56]  1.391076168  1.108921545  1.579352949  1.617653507 -1.684947694
 [61] -0.199177532 -0.211500845  0.813186602 -1.113972031 -0.651475923
 [66]  0.302693884 -0.483631002  0.068077305 -0.630114705  0.102314229
 [71] -1.142620304  1.094572506  0.198478414 -1.123110783  1.796085416
 [76]  0.088466075 -0.153000302  1.578565963  0.470111473  0.590096365
 [81]  1.002656634  0.214911883 -0.028671602 -0.215526316  0.938205722
 [86]  1.239615860 -0.269004729 -0.895951511 -0.380965668  1.044196169
 [91]  0.338153753  0.423701177  0.201840523 -1.312319367 -1.727629936
 [96] -0.348383357 -0.514856708 -0.014581935  1.427969865  1.991405905
> colMin(tmp)
  [1]  0.836796350 -0.553520407  0.011929005  0.383488487 -0.431395158
  [6] -0.431547909 -0.756298983 -0.118333278 -1.456467967 -0.106074251
 [11]  0.096770778  0.657389061 -0.552718765  0.161142090  0.345695137
 [16]  0.988389092 -0.068307882 -0.453571941 -0.802505521 -1.277844747
 [21] -0.520660144  0.503282216 -0.645582877  0.614603656 -0.239036949
 [26]  0.102561983  1.065147756 -0.207246555  0.814327212  1.178215480
 [31] -0.440952933 -0.467728843  0.008611898  1.549955613 -1.795246803
 [36] -1.076680558  0.712063073  1.494287209  0.136002126  0.652815451
 [41]  0.143514115 -1.179588551  0.413209188  0.498538355 -0.211801705
 [46]  0.671864768 -0.093910234  1.272774754  1.075306701 -2.539178014
 [51] -2.664991541  0.543660376 -1.690654993  1.854153282  0.197504501
 [56]  1.391076168  1.108921545  1.579352949  1.617653507 -1.684947694
 [61] -0.199177532 -0.211500845  0.813186602 -1.113972031 -0.651475923
 [66]  0.302693884 -0.483631002  0.068077305 -0.630114705  0.102314229
 [71] -1.142620304  1.094572506  0.198478414 -1.123110783  1.796085416
 [76]  0.088466075 -0.153000302  1.578565963  0.470111473  0.590096365
 [81]  1.002656634  0.214911883 -0.028671602 -0.215526316  0.938205722
 [86]  1.239615860 -0.269004729 -0.895951511 -0.380965668  1.044196169
 [91]  0.338153753  0.423701177  0.201840523 -1.312319367 -1.727629936
 [96] -0.348383357 -0.514856708 -0.014581935  1.427969865  1.991405905
> colMedians(tmp)
  [1]  0.836796350 -0.553520407  0.011929005  0.383488487 -0.431395158
  [6] -0.431547909 -0.756298983 -0.118333278 -1.456467967 -0.106074251
 [11]  0.096770778  0.657389061 -0.552718765  0.161142090  0.345695137
 [16]  0.988389092 -0.068307882 -0.453571941 -0.802505521 -1.277844747
 [21] -0.520660144  0.503282216 -0.645582877  0.614603656 -0.239036949
 [26]  0.102561983  1.065147756 -0.207246555  0.814327212  1.178215480
 [31] -0.440952933 -0.467728843  0.008611898  1.549955613 -1.795246803
 [36] -1.076680558  0.712063073  1.494287209  0.136002126  0.652815451
 [41]  0.143514115 -1.179588551  0.413209188  0.498538355 -0.211801705
 [46]  0.671864768 -0.093910234  1.272774754  1.075306701 -2.539178014
 [51] -2.664991541  0.543660376 -1.690654993  1.854153282  0.197504501
 [56]  1.391076168  1.108921545  1.579352949  1.617653507 -1.684947694
 [61] -0.199177532 -0.211500845  0.813186602 -1.113972031 -0.651475923
 [66]  0.302693884 -0.483631002  0.068077305 -0.630114705  0.102314229
 [71] -1.142620304  1.094572506  0.198478414 -1.123110783  1.796085416
 [76]  0.088466075 -0.153000302  1.578565963  0.470111473  0.590096365
 [81]  1.002656634  0.214911883 -0.028671602 -0.215526316  0.938205722
 [86]  1.239615860 -0.269004729 -0.895951511 -0.380965668  1.044196169
 [91]  0.338153753  0.423701177  0.201840523 -1.312319367 -1.727629936
 [96] -0.348383357 -0.514856708 -0.014581935  1.427969865  1.991405905
> colRanges(tmp)
          [,1]       [,2]       [,3]      [,4]       [,5]       [,6]      [,7]
[1,] 0.8367964 -0.5535204 0.01192901 0.3834885 -0.4313952 -0.4315479 -0.756299
[2,] 0.8367964 -0.5535204 0.01192901 0.3834885 -0.4313952 -0.4315479 -0.756299
           [,8]      [,9]      [,10]      [,11]     [,12]      [,13]     [,14]
[1,] -0.1183333 -1.456468 -0.1060743 0.09677078 0.6573891 -0.5527188 0.1611421
[2,] -0.1183333 -1.456468 -0.1060743 0.09677078 0.6573891 -0.5527188 0.1611421
         [,15]     [,16]       [,17]      [,18]      [,19]     [,20]      [,21]
[1,] 0.3456951 0.9883891 -0.06830788 -0.4535719 -0.8025055 -1.277845 -0.5206601
[2,] 0.3456951 0.9883891 -0.06830788 -0.4535719 -0.8025055 -1.277845 -0.5206601
         [,22]      [,23]     [,24]      [,25]    [,26]    [,27]      [,28]
[1,] 0.5032822 -0.6455829 0.6146037 -0.2390369 0.102562 1.065148 -0.2072466
[2,] 0.5032822 -0.6455829 0.6146037 -0.2390369 0.102562 1.065148 -0.2072466
         [,29]    [,30]      [,31]      [,32]       [,33]    [,34]     [,35]
[1,] 0.8143272 1.178215 -0.4409529 -0.4677288 0.008611898 1.549956 -1.795247
[2,] 0.8143272 1.178215 -0.4409529 -0.4677288 0.008611898 1.549956 -1.795247
         [,36]     [,37]    [,38]     [,39]     [,40]     [,41]     [,42]
[1,] -1.076681 0.7120631 1.494287 0.1360021 0.6528155 0.1435141 -1.179589
[2,] -1.076681 0.7120631 1.494287 0.1360021 0.6528155 0.1435141 -1.179589
         [,43]     [,44]      [,45]     [,46]       [,47]    [,48]    [,49]
[1,] 0.4132092 0.4985384 -0.2118017 0.6718648 -0.09391023 1.272775 1.075307
[2,] 0.4132092 0.4985384 -0.2118017 0.6718648 -0.09391023 1.272775 1.075307
         [,50]     [,51]     [,52]     [,53]    [,54]     [,55]    [,56]
[1,] -2.539178 -2.664992 0.5436604 -1.690655 1.854153 0.1975045 1.391076
[2,] -2.539178 -2.664992 0.5436604 -1.690655 1.854153 0.1975045 1.391076
        [,57]    [,58]    [,59]     [,60]      [,61]      [,62]     [,63]
[1,] 1.108922 1.579353 1.617654 -1.684948 -0.1991775 -0.2115008 0.8131866
[2,] 1.108922 1.579353 1.617654 -1.684948 -0.1991775 -0.2115008 0.8131866
         [,64]      [,65]     [,66]     [,67]      [,68]      [,69]     [,70]
[1,] -1.113972 -0.6514759 0.3026939 -0.483631 0.06807731 -0.6301147 0.1023142
[2,] -1.113972 -0.6514759 0.3026939 -0.483631 0.06807731 -0.6301147 0.1023142
        [,71]    [,72]     [,73]     [,74]    [,75]      [,76]      [,77]
[1,] -1.14262 1.094573 0.1984784 -1.123111 1.796085 0.08846607 -0.1530003
[2,] -1.14262 1.094573 0.1984784 -1.123111 1.796085 0.08846607 -0.1530003
        [,78]     [,79]     [,80]    [,81]     [,82]      [,83]      [,84]
[1,] 1.578566 0.4701115 0.5900964 1.002657 0.2149119 -0.0286716 -0.2155263
[2,] 1.578566 0.4701115 0.5900964 1.002657 0.2149119 -0.0286716 -0.2155263
         [,85]    [,86]      [,87]      [,88]      [,89]    [,90]     [,91]
[1,] 0.9382057 1.239616 -0.2690047 -0.8959515 -0.3809657 1.044196 0.3381538
[2,] 0.9382057 1.239616 -0.2690047 -0.8959515 -0.3809657 1.044196 0.3381538
         [,92]     [,93]     [,94]    [,95]      [,96]      [,97]       [,98]
[1,] 0.4237012 0.2018405 -1.312319 -1.72763 -0.3483834 -0.5148567 -0.01458194
[2,] 0.4237012 0.2018405 -1.312319 -1.72763 -0.3483834 -0.5148567 -0.01458194
       [,99]   [,100]
[1,] 1.42797 1.991406
[2,] 1.42797 1.991406
> 
> 
> Max(tmp2)
[1] 2.290675
> Min(tmp2)
[1] -3.508958
> mean(tmp2)
[1] -0.1447417
> Sum(tmp2)
[1] -14.47417
> Var(tmp2)
[1] 0.9725881
> 
> rowMeans(tmp2)
  [1]  0.33219775 -1.40892148 -1.76630775  0.56451786 -3.50895799 -1.03180589
  [7] -0.95958127  0.46627862 -0.01221751 -1.02279215  1.05897654  0.32539318
 [13]  0.51423088  1.12785061  0.29230386  0.21396490 -0.64955912 -1.07327653
 [19] -1.18119065  0.28566614 -0.98760727 -1.05805631 -0.52591048  0.74389060
 [25] -0.31695175 -0.65506884 -0.83725553  1.67369277 -0.13009808  1.47531794
 [31] -0.69059857  1.14810033  0.30002987 -0.57013080 -1.27492804  0.62247798
 [37] -1.52977586  0.73750377 -1.12534880  0.11234097  0.63246629 -0.60116059
 [43] -0.21414760 -0.11460136 -0.87777761 -3.32013028  0.57834838 -1.47540004
 [49]  1.29786380 -0.32025830 -0.24299463 -0.04488495 -1.47488203 -0.37765284
 [55]  0.68598572 -1.58204905  0.22778412 -1.06086996  0.72652663 -1.50251964
 [61] -1.62611333 -1.13620604 -0.60399471 -0.36611129  0.39353910  0.26121875
 [67]  0.31384791 -0.29675751 -0.10823797  0.75085774  0.09386280 -0.08539941
 [73]  0.20154502  1.78594295 -0.63495390  0.56502714 -0.94181583  0.51800741
 [79] -1.08949113 -0.62716188  0.90929625  2.29067477 -0.20403129  1.53758119
 [85] -0.03603053 -1.09742306  1.31123066  0.29186058 -0.16257776  0.52045358
 [91] -0.10474988  0.37405535  0.50349332  1.29260191 -0.79895955  0.87680059
 [97]  0.17149064 -0.12642324 -0.26645048  0.25729544
> rowSums(tmp2)
  [1]  0.33219775 -1.40892148 -1.76630775  0.56451786 -3.50895799 -1.03180589
  [7] -0.95958127  0.46627862 -0.01221751 -1.02279215  1.05897654  0.32539318
 [13]  0.51423088  1.12785061  0.29230386  0.21396490 -0.64955912 -1.07327653
 [19] -1.18119065  0.28566614 -0.98760727 -1.05805631 -0.52591048  0.74389060
 [25] -0.31695175 -0.65506884 -0.83725553  1.67369277 -0.13009808  1.47531794
 [31] -0.69059857  1.14810033  0.30002987 -0.57013080 -1.27492804  0.62247798
 [37] -1.52977586  0.73750377 -1.12534880  0.11234097  0.63246629 -0.60116059
 [43] -0.21414760 -0.11460136 -0.87777761 -3.32013028  0.57834838 -1.47540004
 [49]  1.29786380 -0.32025830 -0.24299463 -0.04488495 -1.47488203 -0.37765284
 [55]  0.68598572 -1.58204905  0.22778412 -1.06086996  0.72652663 -1.50251964
 [61] -1.62611333 -1.13620604 -0.60399471 -0.36611129  0.39353910  0.26121875
 [67]  0.31384791 -0.29675751 -0.10823797  0.75085774  0.09386280 -0.08539941
 [73]  0.20154502  1.78594295 -0.63495390  0.56502714 -0.94181583  0.51800741
 [79] -1.08949113 -0.62716188  0.90929625  2.29067477 -0.20403129  1.53758119
 [85] -0.03603053 -1.09742306  1.31123066  0.29186058 -0.16257776  0.52045358
 [91] -0.10474988  0.37405535  0.50349332  1.29260191 -0.79895955  0.87680059
 [97]  0.17149064 -0.12642324 -0.26645048  0.25729544
> 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.33219775 -1.40892148 -1.76630775  0.56451786 -3.50895799 -1.03180589
  [7] -0.95958127  0.46627862 -0.01221751 -1.02279215  1.05897654  0.32539318
 [13]  0.51423088  1.12785061  0.29230386  0.21396490 -0.64955912 -1.07327653
 [19] -1.18119065  0.28566614 -0.98760727 -1.05805631 -0.52591048  0.74389060
 [25] -0.31695175 -0.65506884 -0.83725553  1.67369277 -0.13009808  1.47531794
 [31] -0.69059857  1.14810033  0.30002987 -0.57013080 -1.27492804  0.62247798
 [37] -1.52977586  0.73750377 -1.12534880  0.11234097  0.63246629 -0.60116059
 [43] -0.21414760 -0.11460136 -0.87777761 -3.32013028  0.57834838 -1.47540004
 [49]  1.29786380 -0.32025830 -0.24299463 -0.04488495 -1.47488203 -0.37765284
 [55]  0.68598572 -1.58204905  0.22778412 -1.06086996  0.72652663 -1.50251964
 [61] -1.62611333 -1.13620604 -0.60399471 -0.36611129  0.39353910  0.26121875
 [67]  0.31384791 -0.29675751 -0.10823797  0.75085774  0.09386280 -0.08539941
 [73]  0.20154502  1.78594295 -0.63495390  0.56502714 -0.94181583  0.51800741
 [79] -1.08949113 -0.62716188  0.90929625  2.29067477 -0.20403129  1.53758119
 [85] -0.03603053 -1.09742306  1.31123066  0.29186058 -0.16257776  0.52045358
 [91] -0.10474988  0.37405535  0.50349332  1.29260191 -0.79895955  0.87680059
 [97]  0.17149064 -0.12642324 -0.26645048  0.25729544
> rowMin(tmp2)
  [1]  0.33219775 -1.40892148 -1.76630775  0.56451786 -3.50895799 -1.03180589
  [7] -0.95958127  0.46627862 -0.01221751 -1.02279215  1.05897654  0.32539318
 [13]  0.51423088  1.12785061  0.29230386  0.21396490 -0.64955912 -1.07327653
 [19] -1.18119065  0.28566614 -0.98760727 -1.05805631 -0.52591048  0.74389060
 [25] -0.31695175 -0.65506884 -0.83725553  1.67369277 -0.13009808  1.47531794
 [31] -0.69059857  1.14810033  0.30002987 -0.57013080 -1.27492804  0.62247798
 [37] -1.52977586  0.73750377 -1.12534880  0.11234097  0.63246629 -0.60116059
 [43] -0.21414760 -0.11460136 -0.87777761 -3.32013028  0.57834838 -1.47540004
 [49]  1.29786380 -0.32025830 -0.24299463 -0.04488495 -1.47488203 -0.37765284
 [55]  0.68598572 -1.58204905  0.22778412 -1.06086996  0.72652663 -1.50251964
 [61] -1.62611333 -1.13620604 -0.60399471 -0.36611129  0.39353910  0.26121875
 [67]  0.31384791 -0.29675751 -0.10823797  0.75085774  0.09386280 -0.08539941
 [73]  0.20154502  1.78594295 -0.63495390  0.56502714 -0.94181583  0.51800741
 [79] -1.08949113 -0.62716188  0.90929625  2.29067477 -0.20403129  1.53758119
 [85] -0.03603053 -1.09742306  1.31123066  0.29186058 -0.16257776  0.52045358
 [91] -0.10474988  0.37405535  0.50349332  1.29260191 -0.79895955  0.87680059
 [97]  0.17149064 -0.12642324 -0.26645048  0.25729544
> 
> colMeans(tmp2)
[1] -0.1447417
> colSums(tmp2)
[1] -14.47417
> colVars(tmp2)
[1] 0.9725881
> colSd(tmp2)
[1] 0.9861988
> colMax(tmp2)
[1] 2.290675
> colMin(tmp2)
[1] -3.508958
> colMedians(tmp2)
[1] -0.1064939
> colRanges(tmp2)
          [,1]
[1,] -3.508958
[2,]  2.290675
> 
> 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.3734960 -5.6585556  2.5111403  1.4831756 -1.6494103  0.9169471
 [7]  3.1679023 -1.8802142  0.3823175  1.0952616
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.56296264
[2,] -0.05921687
[3,]  0.30328837
[4,]  0.51806609
[5,]  2.05219829
> 
> rowApply(tmp,sum)
 [1] -1.9165920 -1.6772547  1.3164329 -0.3102137  6.2396757  0.9268454
 [7]  1.1129339 -3.1143637 -1.8827969  3.0473934
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    7    5    3    6    6   10    4    8     4
 [2,]    4    6    2    5    2    7    3    3    2     1
 [3,]    6    9   10    1    5   10    6    8    4     7
 [4,]    5    3    3    6    3    9    9    2   10    10
 [5,]    3   10    7    7    8    3    7    1    1     8
 [6,]    1    2    6    8   10    4    1    9    5     9
 [7,]    8    5    9   10    1    5    5   10    6     2
 [8,]   10    1    1    4    4    2    8    7    3     5
 [9,]    7    4    4    2    9    8    4    6    7     6
[10,]    2    8    8    9    7    1    2    5    9     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.2541438 -1.9411713 -2.6432172  0.6234066 -2.6311295  0.5814988
 [7]  0.2900529  3.4830473 -0.6154717  2.3371519  2.8158757 -0.5779596
[13] -0.2381981 -0.6190822 -4.6021350 -0.2954036 -2.2249637  1.9950191
[19]  3.7430216  2.3888179
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.9573279
[2,] -0.8043151
[3,] -0.2260346
[4,]  0.2200562
[5,]  0.5134775
> 
> rowApply(tmp,sum)
[1]  0.9597140 -0.8212625 -5.3786650 -0.3146953  5.1699250
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   10    5   14   13
[2,]    6    9    6    8    3
[3,]   11   12   12    1    6
[4,]   17    2   13   17   12
[5,]    5    7   16    3    2
> 
> 
> as.matrix(tmp)
           [,1]        [,2]        [,3]       [,4]       [,5]        [,6]
[1,] -1.9573279 -0.42269637  0.20322947  1.3752952 -0.4710860 -0.38814998
[2,] -0.2260346 -0.23112112 -0.06064643 -1.6761693 -0.5662439  0.27237189
[3,] -0.8043151 -0.65655604 -0.23820225 -0.1087146  0.4446121  0.94097192
[4,]  0.5134775 -0.08370002 -2.36878312  0.8661050 -1.3600038 -0.23105895
[5,]  0.2200562 -0.54709778 -0.17881487  0.1668904 -0.6784079 -0.01263613
           [,7]       [,8]        [,9]       [,10]      [,11]      [,12]
[1,] -0.1752126  0.9934740  0.01604955 -1.33948597  1.4664280  1.5565081
[2,]  0.4466913  1.4350039 -0.18545944  1.69384816  1.5364997 -0.3860434
[3,] -0.3161790  1.3986145 -2.89627682 -0.27640215 -1.3771329 -0.4341940
[4,]  0.4259780 -0.9024546  1.29360255  0.09263009  0.1635754 -0.9660534
[5,] -0.0912248  0.5584095  1.15661242  2.16656175  1.0265055 -0.3481769
          [,13]       [,14]     [,15]      [,16]      [,17]      [,18]
[1,]  0.4491505  0.22568605 -2.105327 -0.3359400 -0.9198714  0.9152139
[2,] -0.6184204  0.34443880 -2.076834  0.9455381 -0.8606628 -0.5814681
[3,]  0.6964352  0.05070564  0.433626 -0.3658266 -1.1834319 -1.1627061
[4,] -1.0286937 -1.37963988  0.302260 -0.0804472  0.6724790  0.9913911
[5,]  0.2633303  0.13972722 -1.155860 -0.4587279  0.0665233  1.8325884
         [,19]        [,20]
[1,] 0.3465296  1.527247069
[2,] 0.8314463 -0.857997603
[3,] 0.7675246 -0.291217533
[4,] 0.7573502  2.007290631
[5,] 1.0401710  0.003495364
> 
> 
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-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.22-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 -1.402828 -0.3376578 -0.747345 -0.3520999 0.06330268 0.6850813 1.034634
         col8      col9      col10       col11     col12     col13     col14
row1 0.284861 0.6619149 -0.2325451 -0.05444572 -0.741815 -1.033793 0.6265475
         col15      col16      col17      col18    col19    col20
row1 0.3415314 -0.3646474 -0.3233778 -0.4349394 -1.08598 1.275932
> tmp[,"col10"]
          col10
row1 -0.2325451
row2  0.5070599
row3  0.3735047
row4 -0.5034275
row5 -0.5993644
> tmp[c("row1","row5"),]
           col1       col2       col3       col4        col5       col6
row1 -1.4028276 -0.3376578 -0.7473450 -0.3520999  0.06330268  0.6850813
row5  0.4206945 -1.3186725 -0.3247558 -0.3803636 -1.26615327 -1.6193913
          col7     col8      col9      col10       col11      col12     col13
row1 1.0346340 0.284861 0.6619149 -0.2325451 -0.05444572 -0.7418150 -1.033793
row5 0.8038479 1.070802 0.2931584 -0.5993644  1.36982179  0.3864732  1.658465
          col14     col15       col16      col17      col18      col19
row1  0.6265475 0.3415314 -0.36464735 -0.3233778 -0.4349394 -1.0859797
row5 -0.4036717 0.7924569 -0.08371754  0.6926588  0.3337170 -0.6813091
          col20
row1  1.2759321
row5 -0.5882553
> tmp[,c("col6","col20")]
           col6      col20
row1  0.6850813  1.2759321
row2 -0.6524927 -0.8009700
row3  0.8129793  0.4106845
row4  1.5495350  0.8118927
row5 -1.6193913 -0.5882553
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.6850813  1.2759321
row5 -1.6193913 -0.5882553
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.12661 49.50384 50.63544 48.48869 47.28521 105.7196 51.09441 49.54637
         col9   col10    col11    col12    col13    col14    col15    col16
row1 51.03405 50.7061 48.62871 51.33166 50.10379 48.79647 49.78108 51.66164
        col17    col18   col19    col20
row1 48.83209 50.56093 50.3412 104.3184
> tmp[,"col10"]
        col10
row1 50.70610
row2 29.01813
row3 30.13995
row4 30.01309
row5 49.06323
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.12661 49.50384 50.63544 48.48869 47.28521 105.7196 51.09441 49.54637
row5 49.45650 50.37514 49.80543 49.99626 51.02738 105.4623 50.13371 48.45557
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.03405 50.70610 48.62871 51.33166 50.10379 48.79647 49.78108 51.66164
row5 50.18128 49.06323 49.21297 50.16684 51.02246 48.88208 51.96319 50.81886
        col17    col18    col19    col20
row1 48.83209 50.56093 50.34120 104.3184
row5 50.28391 50.09236 50.26162 102.3242
> tmp[,c("col6","col20")]
          col6     col20
row1 105.71961 104.31844
row2  73.83115  76.01642
row3  74.56451  74.19714
row4  75.14165  75.48821
row5 105.46228 102.32417
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7196 104.3184
row5 105.4623 102.3242
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7196 104.3184
row5 105.4623 102.3242
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
         col13
[1,] 0.3419497
[2,] 0.8853157
[3,] 0.7980341
[4,] 1.2471864
[5,] 0.1804044
> tmp[,c("col17","col7")]
          col17       col7
[1,] 0.74545842  1.7099974
[2,] 0.83948199  1.1542710
[3,] 0.62316665 -0.6209435
[4,] 0.81211285  0.2100435
[5,] 0.05276396  0.2817036
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6     col20
[1,]  1.4939408 1.6365999
[2,] -0.3609606 1.5490626
[3,] -0.4353722 0.2371035
[4,]  1.8896234 0.6760932
[5,]  0.2198584 0.7723762
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.493941
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.4939408
[2,] -0.3609606
> 
> 
> 
> 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.3719403 -1.659909 -0.9589647 -0.1836535 -1.227035 1.346268  0.3208641
row1  0.1245580 -1.418078 -0.1707573  0.2429238  1.382457 1.594216 -0.4738567
           [,8]       [,9]      [,10]       [,11]      [,12]      [,13]
row3  0.9105281 -0.8646553 -0.4976232  0.04028722 -0.3045094  0.4316900
row1 -1.2990300  0.9577346 -0.6599572 -0.77529538 -0.2904259 -0.9475305
          [,14]     [,15]     [,16]      [,17]       [,18]      [,19]
row3 -0.2718215 -2.189275  1.300237 -0.2865163 -0.06983497  0.6005810
row1 -0.8487033 -1.237495 -0.332001  1.1843992 -0.48307640 -0.2390061
            [,20]
row3 -1.133556142
row1 -0.006869029
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]        [,3]     [,4]      [,5]      [,6]     [,7]
row2 -0.807969 0.3320407 -0.07475996 1.355238 0.7743471 0.8277881 1.880066
          [,8]     [,9]    [,10]
row2 -2.026428 1.005491 -0.50112
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]       [,4]       [,5]       [,6]      [,7]
row5 -0.5489934 0.2920707 0.4068885 -0.6972339 -0.4348218 -0.8208905 0.8876476
          [,8]       [,9]     [,10]     [,11]      [,12]     [,13]       [,14]
row5 0.5888276 -0.5215349 0.9611815 0.1056465 0.04708175 -0.096003 -0.04299184
         [,15]     [,16]      [,17]      [,18]      [,19]    [,20]
row5 0.8466214 0.1661258 -0.2023195 -0.5819237 -0.3328998 1.173412
> 
> 
> 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: 0x1dcf7310>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c99053c2dcc6"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c99065bf8cfd"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c99041fa97e6"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c990260a5c46"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c9904d1eca3f"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c99061be34eb"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c990548dcce5"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c99090528ef" 
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c99062c4eecb"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c9906668aa83"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c9901c2b5dee"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c990507c1aa0"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c990194dc8ad"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c9903e9d73f4"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c990758a634f"
> 
> 
> ### 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: 0x1fc40e40>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x1fc40e40>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x1fc40e40>
> rowMedians(tmp)
  [1] -1.879468e-01 -2.228971e-01  6.142354e-01 -3.456786e-01  3.823072e-01
  [6] -2.329173e-02  1.466748e-01  4.009045e-01  3.391569e-01 -3.477577e-01
 [11] -7.173969e-02 -2.507540e-01 -3.357395e-02  2.517658e-01 -3.831342e-01
 [16]  5.165347e-01 -1.459670e-01  3.566620e-01 -1.799839e-01 -4.422339e-01
 [21]  2.619748e-01 -3.181346e-01  4.753967e-01  4.909021e-01 -2.497639e-01
 [26] -5.212997e-01 -3.283123e-01  6.174653e-01 -2.996380e-01  6.730528e-03
 [31] -2.812762e-01  4.291838e-02  3.069442e-01  1.951858e-01  4.738356e-01
 [36]  2.818977e-01  3.852258e-01  1.078722e-01  1.624909e-01  2.407575e-01
 [41] -2.703132e-01 -5.271666e-01 -3.840685e-01 -4.579430e-02 -2.706108e-01
 [46]  1.682945e-01  2.621868e-01 -7.468653e-02  1.770043e-01  1.653621e-01
 [51] -4.917802e-02 -3.960173e-01 -2.515977e-01  2.157553e-01  9.284469e-01
 [56]  2.158591e-01  3.412079e-01  1.980965e-01  1.687705e-01 -1.122053e-01
 [61] -1.536297e-01  7.266382e-02  8.425029e-02  5.039798e-02 -6.097104e-01
 [66]  2.553302e-01  3.828807e-01 -7.570848e-05  7.410192e-02  1.389953e-01
 [71]  1.985836e-01  6.829961e-01  3.362769e-01  1.940277e-01 -2.857831e-01
 [76]  7.541006e-01  3.934617e-01 -2.463969e-01  5.437888e-02 -1.727092e-01
 [81]  2.939688e-01  2.296584e-01 -3.535784e-03  4.646778e-01  1.196203e-01
 [86] -2.518256e-01  3.917648e-01 -1.534204e-02  5.548670e-01  2.669477e-01
 [91] -1.042789e-02 -3.457401e-01  4.933852e-01  1.892811e-01  1.126517e-02
 [96]  7.812395e-02  5.023924e-01 -1.769927e-02 -2.996962e-01  5.203476e-01
[101] -4.964077e-01  8.546247e-02 -2.486589e-01 -4.441693e-01  2.742445e-01
[106] -4.242081e-01  3.066667e-01 -2.761195e-02  1.368010e-01  2.443592e-01
[111] -1.123423e-01 -8.002127e-02  2.072830e-01 -1.081382e-01 -2.701383e-01
[116] -1.449815e-01  1.283783e-01 -5.423627e-02  2.425961e-01 -7.071493e-02
[121] -4.227773e-02  7.523757e-02 -3.941139e-01 -1.914240e-01  3.415740e-01
[126]  7.759114e-03 -1.667091e-01 -5.489876e-01 -1.667091e-01  2.366211e-01
[131] -1.363178e-01 -4.498771e-01  3.601590e-01  3.217614e-01  5.064006e-01
[136]  7.071162e-02 -2.139671e-01  3.346449e-01  1.381059e-01 -1.594126e-01
[141]  1.209047e-01  1.656996e-01  4.669168e-01 -3.533366e-01  1.023593e-01
[146] -7.261792e-02  2.510939e-01 -6.667388e-01 -1.825190e-01  6.810584e-02
[151] -2.072527e-01  3.710140e-01 -1.630987e-01  7.979891e-02 -1.515591e-01
[156]  2.159526e-01  2.178720e-03  1.282511e-01 -1.765189e-01 -3.317567e-01
[161] -1.644468e-01 -2.796382e-01 -5.117689e-01 -3.828628e-01  8.446262e-01
[166] -2.254438e-01  1.813034e-01  1.781859e-01 -2.336157e-01 -2.367314e-02
[171]  1.997599e-01  2.169208e-01 -1.502520e-02  2.509502e-01 -3.098020e-01
[176] -7.043091e-01 -2.055883e-01 -2.277213e-03  5.737492e-02  6.503023e-02
[181]  6.996543e-02  3.438726e-01  1.882404e-01  4.365052e-02  1.214995e-01
[186]  1.528035e-01  5.910940e-01  3.693884e-01 -7.275457e-02 -1.720553e-02
[191] -1.477377e-01  7.453427e-01 -5.373225e-01 -2.525076e-01 -1.971809e-01
[196]  4.708886e-04  1.303435e-02  2.825251e-01  3.436136e-01  3.160184e-01
[201]  1.931282e-01 -1.526694e-01  1.048519e-02 -2.240697e-01 -2.774940e-01
[206] -5.413341e-01 -4.537243e-01 -1.340065e-01 -1.655692e-01 -1.592247e-02
[211]  2.728978e-02 -2.287433e-01  3.992709e-02 -4.731784e-01  3.401906e-01
[216] -1.118349e-01 -3.813101e-01  1.218915e-01 -1.147240e-01 -2.132465e-02
[221]  4.358406e-02 -2.915617e-01 -8.408362e-02 -5.077003e-01 -2.521170e-01
[226]  2.962895e-01 -5.706485e-02  4.180678e-01  9.371482e-02 -2.207375e-01
> 
> proc.time()
   user  system elapsed 
  1.825   0.878   2.729 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
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: 0x3771aff0>
> .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: 0x3771aff0>
> .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: 0x3771aff0>
> .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: 0x3771aff0>
> 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: 0x37625470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x37625470>
> .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: 0x37625470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x37625470>
> .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: 0x37625470>
> 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: 0x376000e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x376000e0>
> .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: 0x376000e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x376000e0>
> .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: 0x376000e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x376000e0>
> .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: 0x376000e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x376000e0>
> .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: 0x376000e0>
> 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: 0x36587520>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x36587520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x36587520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x36587520>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16ca403bd2e178" "BufferedMatrixFile16ca4041920acb"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16ca403bd2e178" "BufferedMatrixFile16ca4041920acb"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x384d0030>
> .Call("R_bm_AddColumn",P)
<pointer: 0x384d0030>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x384d0030>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x384d0030>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x384d0030>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x384d0030>
> .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: 0x36e9b5c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x36e9b5c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x36e9b5c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x36e9b5c0>
> 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: 0x37f7bf30>
> .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: 0x37f7bf30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.336   0.036   0.358 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
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.326   0.035   0.347 

Example timings