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

This page was generated on 2025-03-25 11:46 -0400 (Tue, 25 Mar 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_64R Under development (unstable) (2025-03-13 r87965) -- "Unsuffered Consequences" 4782
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2025-03-01 r87860 ucrt) -- "Unsuffered Consequences" 4552
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences" 4581
kjohnson3macOS 13.7.1 Venturaarm64R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences" 4533
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4463
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 249/2315HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.71.1  (landing page)
Ben Bolstad
Snapshot Date: 2025-03-24 13:40 -0400 (Mon, 24 Mar 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 824836d
git_last_commit_date: 2024-12-14 17:47:34 -0400 (Sat, 14 Dec 2024)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kunpeng2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.71.1
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.71.1.tar.gz
StartedAt: 2025-03-25 04:34:44 -0000 (Tue, 25 Mar 2025)
EndedAt: 2025-03-25 04:35:07 -0000 (Tue, 25 Mar 2025)
EllapsedTime: 23.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/R/R-devel_2025-02-19/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.71.1’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R/lib -lR
installing to /home/biocbuild/R/R-devel_2025-02-19/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.343   0.035   0.364 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 477833 25.6    1045337 55.9   639800 34.2
Vcells 884297  6.8    8388608 64.0  2080696 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Mar 25 04:35:01 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 Mar 25 04:35:01 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: 0x142d4790>
> 
> 
> 
> 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 Mar 25 04:35:02 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 Mar 25 04:35:02 2025"
> 
> ColMode(tmp2)
<pointer: 0x142d4790>
> 
> 
> 
> ### 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,] 97.3820561 -0.0375754 -0.04857732 -0.89253183
[2,]  2.5049851 -0.5431662 -0.49124147 -0.03579974
[3,]  0.1092184 -0.6627278 -1.96703442 -1.13387622
[4,]  1.9081349 -0.3173265  0.55062748 -0.32875398
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]       [,4]
[1,] 97.3820561 0.0375754 0.04857732 0.89253183
[2,]  2.5049851 0.5431662 0.49124147 0.03579974
[3,]  0.1092184 0.6627278 1.96703442 1.13387622
[4,]  1.9081349 0.3173265 0.55062748 0.32875398
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
         [,1]      [,2]      [,3]      [,4]
[1,] 9.868235 0.1938437 0.2204026 0.9447390
[2,] 1.582714 0.7369981 0.7008862 0.1892082
[3,] 0.330482 0.8140810 1.4025100 1.0648362
[4,] 1.381353 0.5633174 0.7420428 0.5733707
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 221.06440 26.97601 27.25260 35.33992
[2,]  43.33213 32.91315 32.50010 26.92788
[3,]  28.41404 33.80354 40.99213 36.78224
[4,]  40.72166 30.95050 32.97106 31.06246
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x13ba5c00>
> exp(tmp5)
<pointer: 0x13ba5c00>
> log(tmp5,2)
<pointer: 0x13ba5c00>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 460.1166
> Min(tmp5)
[1] 52.34635
> mean(tmp5)
[1] 72.98282
> Sum(tmp5)
[1] 14596.56
> Var(tmp5)
[1] 825.804
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.59251 72.14156 72.17087 71.99925 69.36263 72.02806 68.99871 72.59579
 [9] 72.18682 67.75198
> rowSums(tmp5)
 [1] 1811.850 1442.831 1443.417 1439.985 1387.253 1440.561 1379.974 1451.916
 [9] 1443.736 1355.040
> rowVars(tmp5)
 [1] 7623.87327  108.22961  109.80071   91.17208   74.68301   57.79888
 [7]   62.01554   51.01137   35.13501   45.52170
> rowSd(tmp5)
 [1] 87.314794 10.403346 10.478583  9.548407  8.641933  7.602557  7.874995
 [8]  7.142225  5.927479  6.746977
> rowMax(tmp5)
 [1] 460.11659  90.19015  92.88049  89.56887  87.94697  87.19483  84.97795
 [8]  85.92022  81.19411  77.04938
> rowMin(tmp5)
 [1] 56.14704 54.24503 56.21766 56.26582 52.34635 58.68897 57.09382 60.43671
 [9] 56.45006 55.76233
> 
> colMeans(tmp5)
 [1] 110.47092  68.63454  72.06418  72.14628  74.16725  66.35135  73.17190
 [8]  71.76554  69.85788  70.13097  68.74321  72.85123  67.93608  67.39233
[15]  73.62045  72.54684  70.02535  73.39821  69.65327  74.72857
> colSums(tmp5)
 [1] 1104.7092  686.3454  720.6418  721.4628  741.6725  663.5135  731.7190
 [8]  717.6554  698.5788  701.3097  687.4321  728.5123  679.3608  673.9233
[15]  736.2045  725.4684  700.2535  733.9821  696.5327  747.2857
> colVars(tmp5)
 [1] 15195.04151    63.33706    89.49257    89.45082    36.33347    61.82833
 [7]    56.32684    68.53257    45.38550    40.92068    68.89163   185.89100
[13]    60.53301    80.07458    71.96678    91.14533    50.98215    47.24622
[19]    38.59685    51.94739
> colSd(tmp5)
 [1] 123.268169   7.958458   9.460052   9.457845   6.027725   7.863099
 [7]   7.505121   8.278440   6.736876   6.396927   8.300098  13.634185
[13]   7.780296   8.948440   8.483324   9.547006   7.140179   6.873589
[19]   6.212636   7.207454
> colMax(tmp5)
 [1] 460.11659  84.12832  87.19483  85.92022  83.50434  80.95619  88.51235
 [8]  83.62328  80.61589  79.56722  81.33956  92.88049  78.73777  84.53767
[15]  86.86866  87.94697  80.64861  84.36149  79.42635  88.27797
> colMin(tmp5)
 [1] 59.14010 56.14704 56.72272 56.04686 61.90522 57.31244 64.91222 56.21766
 [9] 59.16197 61.81578 54.61663 52.34635 54.24503 55.76233 63.87593 57.09382
[17] 56.26582 59.07363 60.64625 66.30411
> 
> 
> ### 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.59251 72.14156 72.17087 71.99925 69.36263 72.02806 68.99871 72.59579
 [9] 72.18682       NA
> rowSums(tmp5)
 [1] 1811.850 1442.831 1443.417 1439.985 1387.253 1440.561 1379.974 1451.916
 [9] 1443.736       NA
> rowVars(tmp5)
 [1] 7623.87327  108.22961  109.80071   91.17208   74.68301   57.79888
 [7]   62.01554   51.01137   35.13501   47.49893
> rowSd(tmp5)
 [1] 87.314794 10.403346 10.478583  9.548407  8.641933  7.602557  7.874995
 [8]  7.142225  5.927479  6.891947
> rowMax(tmp5)
 [1] 460.11659  90.19015  92.88049  89.56887  87.94697  87.19483  84.97795
 [8]  85.92022  81.19411        NA
> rowMin(tmp5)
 [1] 56.14704 54.24503 56.21766 56.26582 52.34635 58.68897 57.09382 60.43671
 [9] 56.45006       NA
> 
> colMeans(tmp5)
 [1] 110.47092        NA  72.06418  72.14628  74.16725  66.35135  73.17190
 [8]  71.76554  69.85788  70.13097  68.74321  72.85123  67.93608  67.39233
[15]  73.62045  72.54684  70.02535  73.39821  69.65327  74.72857
> colSums(tmp5)
 [1] 1104.7092        NA  720.6418  721.4628  741.6725  663.5135  731.7190
 [8]  717.6554  698.5788  701.3097  687.4321  728.5123  679.3608  673.9233
[15]  736.2045  725.4684  700.2535  733.9821  696.5327  747.2857
> colVars(tmp5)
 [1] 15195.04151          NA    89.49257    89.45082    36.33347    61.82833
 [7]    56.32684    68.53257    45.38550    40.92068    68.89163   185.89100
[13]    60.53301    80.07458    71.96678    91.14533    50.98215    47.24622
[19]    38.59685    51.94739
> colSd(tmp5)
 [1] 123.268169         NA   9.460052   9.457845   6.027725   7.863099
 [7]   7.505121   8.278440   6.736876   6.396927   8.300098  13.634185
[13]   7.780296   8.948440   8.483324   9.547006   7.140179   6.873589
[19]   6.212636   7.207454
> colMax(tmp5)
 [1] 460.11659        NA  87.19483  85.92022  83.50434  80.95619  88.51235
 [8]  83.62328  80.61589  79.56722  81.33956  92.88049  78.73777  84.53767
[15]  86.86866  87.94697  80.64861  84.36149  79.42635  88.27797
> colMin(tmp5)
 [1] 59.14010       NA 56.72272 56.04686 61.90522 57.31244 64.91222 56.21766
 [9] 59.16197 61.81578 54.61663 52.34635 54.24503 55.76233 63.87593 57.09382
[17] 56.26582 59.07363 60.64625 66.30411
> 
> Max(tmp5,na.rm=TRUE)
[1] 460.1166
> Min(tmp5,na.rm=TRUE)
[1] 52.34635
> mean(tmp5,na.rm=TRUE)
[1] 73.02454
> Sum(tmp5,na.rm=TRUE)
[1] 14531.88
> Var(tmp5,na.rm=TRUE)
[1] 829.6249
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.59251 72.14156 72.17087 71.99925 69.36263 72.02806 68.99871 72.59579
 [9] 72.18682 67.91364
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.850 1442.831 1443.417 1439.985 1387.253 1440.561 1379.974 1451.916
 [9] 1443.736 1290.359
> rowVars(tmp5,na.rm=TRUE)
 [1] 7623.87327  108.22961  109.80071   91.17208   74.68301   57.79888
 [7]   62.01554   51.01137   35.13501   47.49893
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.314794 10.403346 10.478583  9.548407  8.641933  7.602557  7.874995
 [8]  7.142225  5.927479  6.891947
> rowMax(tmp5,na.rm=TRUE)
 [1] 460.11659  90.19015  92.88049  89.56887  87.94697  87.19483  84.97795
 [8]  85.92022  81.19411  77.04938
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.14704 54.24503 56.21766 56.26582 52.34635 58.68897 57.09382 60.43671
 [9] 56.45006 55.76233
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.47092  69.07389  72.06418  72.14628  74.16725  66.35135  73.17190
 [8]  71.76554  69.85788  70.13097  68.74321  72.85123  67.93608  67.39233
[15]  73.62045  72.54684  70.02535  73.39821  69.65327  74.72857
> colSums(tmp5,na.rm=TRUE)
 [1] 1104.7092  621.6650  720.6418  721.4628  741.6725  663.5135  731.7190
 [8]  717.6554  698.5788  701.3097  687.4321  728.5123  679.3608  673.9233
[15]  736.2045  725.4684  700.2535  733.9821  696.5327  747.2857
> colVars(tmp5,na.rm=TRUE)
 [1] 15195.04151    69.08257    89.49257    89.45082    36.33347    61.82833
 [7]    56.32684    68.53257    45.38550    40.92068    68.89163   185.89100
[13]    60.53301    80.07458    71.96678    91.14533    50.98215    47.24622
[19]    38.59685    51.94739
> colSd(tmp5,na.rm=TRUE)
 [1] 123.268169   8.311592   9.460052   9.457845   6.027725   7.863099
 [7]   7.505121   8.278440   6.736876   6.396927   8.300098  13.634185
[13]   7.780296   8.948440   8.483324   9.547006   7.140179   6.873589
[19]   6.212636   7.207454
> colMax(tmp5,na.rm=TRUE)
 [1] 460.11659  84.12832  87.19483  85.92022  83.50434  80.95619  88.51235
 [8]  83.62328  80.61589  79.56722  81.33956  92.88049  78.73777  84.53767
[15]  86.86866  87.94697  80.64861  84.36149  79.42635  88.27797
> colMin(tmp5,na.rm=TRUE)
 [1] 59.14010 56.14704 56.72272 56.04686 61.90522 57.31244 64.91222 56.21766
 [9] 59.16197 61.81578 54.61663 52.34635 54.24503 55.76233 63.87593 57.09382
[17] 56.26582 59.07363 60.64625 66.30411
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.59251 72.14156 72.17087 71.99925 69.36263 72.02806 68.99871 72.59579
 [9] 72.18682      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1811.850 1442.831 1443.417 1439.985 1387.253 1440.561 1379.974 1451.916
 [9] 1443.736    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7623.87327  108.22961  109.80071   91.17208   74.68301   57.79888
 [7]   62.01554   51.01137   35.13501         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.314794 10.403346 10.478583  9.548407  8.641933  7.602557  7.874995
 [8]  7.142225  5.927479        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 460.11659  90.19015  92.88049  89.56887  87.94697  87.19483  84.97795
 [8]  85.92022  81.19411        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.14704 54.24503 56.21766 56.26582 52.34635 58.68897 57.09382 60.43671
 [9] 56.45006       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.30420       NaN  73.28360  73.19566  74.32591  67.35567  73.00880
 [8]  71.54020  70.99120  69.50071  67.82030  72.71246  68.61634  68.68455
[15]  74.16041  72.32167  70.94992  73.28244  69.80237  75.35011
> colSums(tmp5,na.rm=TRUE)
 [1] 1037.7378    0.0000  659.5524  658.7609  668.9332  606.2011  657.0792
 [8]  643.8618  638.9208  625.5064  610.3827  654.4121  617.5471  618.1610
[15]  667.4437  650.8950  638.5493  659.5420  628.2213  678.1509
> colVars(tmp5,na.rm=TRUE)
 [1] 16831.61555          NA    83.95059    88.24374    40.59197    58.20938
 [7]    63.06844    76.52789    36.60896    41.56708    67.92079   208.91072
[13]    62.89353    71.29821    77.68259   101.96809    47.73791    53.00123
[19]    43.17135    54.09490
> colSd(tmp5,na.rm=TRUE)
 [1] 129.736716         NA   9.162455   9.393814   6.371183   7.629507
 [7]   7.941564   8.748022   6.050534   6.447254   8.241407  14.453744
[13]   7.930544   8.443827   8.813773  10.097925   6.909262   7.280194
[19]   6.570491   7.354924
> colMax(tmp5,na.rm=TRUE)
 [1] 460.11659      -Inf  87.19483  85.92022  83.50434  80.95619  88.51235
 [8]  83.62328  80.61589  79.56722  81.33956  92.88049  78.73777  84.53767
[15]  86.86866  87.94697  80.64861  84.36149  79.42635  88.27797
> colMin(tmp5,na.rm=TRUE)
 [1] 59.14010      Inf 56.72272 56.04686 61.90522 59.29560 64.91222 56.21766
 [9] 59.16197 61.81578 54.61663 52.34635 54.24503 57.36563 63.87593 57.09382
[17] 56.26582 59.07363 60.64625 66.30411
> 
> 
> 
> 
> 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] 303.6814 181.1677 131.5184 170.2806 207.9096 204.7418 188.9186 156.6227
 [9] 214.7067 138.4113
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 303.6814 181.1677 131.5184 170.2806 207.9096 204.7418 188.9186 156.6227
 [9] 214.7067 138.4113
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.136868e-13  2.842171e-14  0.000000e+00  0.000000e+00  1.136868e-13
 [6]  2.842171e-14 -1.421085e-13  1.421085e-13 -8.526513e-14  8.526513e-14
[11]  0.000000e+00 -1.136868e-13 -2.842171e-13  5.684342e-14  1.136868e-13
[16]  5.684342e-14 -1.136868e-13 -5.684342e-14 -2.842171e-14 -1.421085e-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)
+ }
10   12 
5   8 
6   13 
7   6 
1   2 
4   8 
1   15 
5   1 
10   16 
8   13 
2   10 
5   19 
10   8 
8   17 
10   13 
3   14 
1   1 
5   15 
3   2 
10   19 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.985353
> Min(tmp)
[1] -1.873549
> mean(tmp)
[1] 0.01098573
> Sum(tmp)
[1] 1.098573
> Var(tmp)
[1] 1.034035
> 
> rowMeans(tmp)
[1] 0.01098573
> rowSums(tmp)
[1] 1.098573
> rowVars(tmp)
[1] 1.034035
> rowSd(tmp)
[1] 1.016875
> rowMax(tmp)
[1] 2.985353
> rowMin(tmp)
[1] -1.873549
> 
> colMeans(tmp)
  [1]  0.15732268 -0.68725311  1.03886073 -1.39128864  0.20346164 -0.68352268
  [7]  0.60748417 -0.25663613 -1.87354919 -1.12884822 -0.78784178 -1.19067384
 [13] -0.69456403  0.16522239 -0.63736031 -0.98168279 -0.26339714 -0.50285778
 [19] -0.46849087  0.94094607  0.37811112  1.66771775  0.88376929 -0.74601697
 [25]  0.75219336 -0.16120046 -0.81192732  2.98535269  0.29853174 -0.50746429
 [31] -0.52110755 -0.71339982 -0.42058933  0.31135706 -0.49568096  1.17323853
 [37]  0.34750827  0.49857591 -0.25728936 -0.33420150 -0.97900803 -1.48246172
 [43]  0.60344768 -0.30296384  0.48322224  1.52026978  0.01351950 -1.25834605
 [49] -0.18025030  0.72515188 -1.36967981 -1.17745062 -0.21040310 -1.80828923
 [55] -0.20554916 -1.08339285 -0.59464085  1.26886849  2.55837034  0.27802347
 [61]  0.61465558  0.58916449 -0.84330194  2.04350817  1.25526217  0.79682809
 [67] -1.16916993  0.29126426 -0.71104441  0.45803702  0.40343156 -0.81697717
 [73] -0.51398696  0.73097577  1.36542021  2.68214242 -0.28618476 -0.65822760
 [79] -0.43322779  0.49113852  0.25439775  0.14432000  1.42387555 -1.76098506
 [85]  0.59602106 -1.30950709  0.75955589  0.40440056  0.33269722  0.56370088
 [91]  0.12470622 -0.16308568 -0.43481458 -0.14127048  2.20103363 -1.66495366
 [97] -0.09563006  1.73419495  0.95342999 -1.80446870
> colSums(tmp)
  [1]  0.15732268 -0.68725311  1.03886073 -1.39128864  0.20346164 -0.68352268
  [7]  0.60748417 -0.25663613 -1.87354919 -1.12884822 -0.78784178 -1.19067384
 [13] -0.69456403  0.16522239 -0.63736031 -0.98168279 -0.26339714 -0.50285778
 [19] -0.46849087  0.94094607  0.37811112  1.66771775  0.88376929 -0.74601697
 [25]  0.75219336 -0.16120046 -0.81192732  2.98535269  0.29853174 -0.50746429
 [31] -0.52110755 -0.71339982 -0.42058933  0.31135706 -0.49568096  1.17323853
 [37]  0.34750827  0.49857591 -0.25728936 -0.33420150 -0.97900803 -1.48246172
 [43]  0.60344768 -0.30296384  0.48322224  1.52026978  0.01351950 -1.25834605
 [49] -0.18025030  0.72515188 -1.36967981 -1.17745062 -0.21040310 -1.80828923
 [55] -0.20554916 -1.08339285 -0.59464085  1.26886849  2.55837034  0.27802347
 [61]  0.61465558  0.58916449 -0.84330194  2.04350817  1.25526217  0.79682809
 [67] -1.16916993  0.29126426 -0.71104441  0.45803702  0.40343156 -0.81697717
 [73] -0.51398696  0.73097577  1.36542021  2.68214242 -0.28618476 -0.65822760
 [79] -0.43322779  0.49113852  0.25439775  0.14432000  1.42387555 -1.76098506
 [85]  0.59602106 -1.30950709  0.75955589  0.40440056  0.33269722  0.56370088
 [91]  0.12470622 -0.16308568 -0.43481458 -0.14127048  2.20103363 -1.66495366
 [97] -0.09563006  1.73419495  0.95342999 -1.80446870
> 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.15732268 -0.68725311  1.03886073 -1.39128864  0.20346164 -0.68352268
  [7]  0.60748417 -0.25663613 -1.87354919 -1.12884822 -0.78784178 -1.19067384
 [13] -0.69456403  0.16522239 -0.63736031 -0.98168279 -0.26339714 -0.50285778
 [19] -0.46849087  0.94094607  0.37811112  1.66771775  0.88376929 -0.74601697
 [25]  0.75219336 -0.16120046 -0.81192732  2.98535269  0.29853174 -0.50746429
 [31] -0.52110755 -0.71339982 -0.42058933  0.31135706 -0.49568096  1.17323853
 [37]  0.34750827  0.49857591 -0.25728936 -0.33420150 -0.97900803 -1.48246172
 [43]  0.60344768 -0.30296384  0.48322224  1.52026978  0.01351950 -1.25834605
 [49] -0.18025030  0.72515188 -1.36967981 -1.17745062 -0.21040310 -1.80828923
 [55] -0.20554916 -1.08339285 -0.59464085  1.26886849  2.55837034  0.27802347
 [61]  0.61465558  0.58916449 -0.84330194  2.04350817  1.25526217  0.79682809
 [67] -1.16916993  0.29126426 -0.71104441  0.45803702  0.40343156 -0.81697717
 [73] -0.51398696  0.73097577  1.36542021  2.68214242 -0.28618476 -0.65822760
 [79] -0.43322779  0.49113852  0.25439775  0.14432000  1.42387555 -1.76098506
 [85]  0.59602106 -1.30950709  0.75955589  0.40440056  0.33269722  0.56370088
 [91]  0.12470622 -0.16308568 -0.43481458 -0.14127048  2.20103363 -1.66495366
 [97] -0.09563006  1.73419495  0.95342999 -1.80446870
> colMin(tmp)
  [1]  0.15732268 -0.68725311  1.03886073 -1.39128864  0.20346164 -0.68352268
  [7]  0.60748417 -0.25663613 -1.87354919 -1.12884822 -0.78784178 -1.19067384
 [13] -0.69456403  0.16522239 -0.63736031 -0.98168279 -0.26339714 -0.50285778
 [19] -0.46849087  0.94094607  0.37811112  1.66771775  0.88376929 -0.74601697
 [25]  0.75219336 -0.16120046 -0.81192732  2.98535269  0.29853174 -0.50746429
 [31] -0.52110755 -0.71339982 -0.42058933  0.31135706 -0.49568096  1.17323853
 [37]  0.34750827  0.49857591 -0.25728936 -0.33420150 -0.97900803 -1.48246172
 [43]  0.60344768 -0.30296384  0.48322224  1.52026978  0.01351950 -1.25834605
 [49] -0.18025030  0.72515188 -1.36967981 -1.17745062 -0.21040310 -1.80828923
 [55] -0.20554916 -1.08339285 -0.59464085  1.26886849  2.55837034  0.27802347
 [61]  0.61465558  0.58916449 -0.84330194  2.04350817  1.25526217  0.79682809
 [67] -1.16916993  0.29126426 -0.71104441  0.45803702  0.40343156 -0.81697717
 [73] -0.51398696  0.73097577  1.36542021  2.68214242 -0.28618476 -0.65822760
 [79] -0.43322779  0.49113852  0.25439775  0.14432000  1.42387555 -1.76098506
 [85]  0.59602106 -1.30950709  0.75955589  0.40440056  0.33269722  0.56370088
 [91]  0.12470622 -0.16308568 -0.43481458 -0.14127048  2.20103363 -1.66495366
 [97] -0.09563006  1.73419495  0.95342999 -1.80446870
> colMedians(tmp)
  [1]  0.15732268 -0.68725311  1.03886073 -1.39128864  0.20346164 -0.68352268
  [7]  0.60748417 -0.25663613 -1.87354919 -1.12884822 -0.78784178 -1.19067384
 [13] -0.69456403  0.16522239 -0.63736031 -0.98168279 -0.26339714 -0.50285778
 [19] -0.46849087  0.94094607  0.37811112  1.66771775  0.88376929 -0.74601697
 [25]  0.75219336 -0.16120046 -0.81192732  2.98535269  0.29853174 -0.50746429
 [31] -0.52110755 -0.71339982 -0.42058933  0.31135706 -0.49568096  1.17323853
 [37]  0.34750827  0.49857591 -0.25728936 -0.33420150 -0.97900803 -1.48246172
 [43]  0.60344768 -0.30296384  0.48322224  1.52026978  0.01351950 -1.25834605
 [49] -0.18025030  0.72515188 -1.36967981 -1.17745062 -0.21040310 -1.80828923
 [55] -0.20554916 -1.08339285 -0.59464085  1.26886849  2.55837034  0.27802347
 [61]  0.61465558  0.58916449 -0.84330194  2.04350817  1.25526217  0.79682809
 [67] -1.16916993  0.29126426 -0.71104441  0.45803702  0.40343156 -0.81697717
 [73] -0.51398696  0.73097577  1.36542021  2.68214242 -0.28618476 -0.65822760
 [79] -0.43322779  0.49113852  0.25439775  0.14432000  1.42387555 -1.76098506
 [85]  0.59602106 -1.30950709  0.75955589  0.40440056  0.33269722  0.56370088
 [91]  0.12470622 -0.16308568 -0.43481458 -0.14127048  2.20103363 -1.66495366
 [97] -0.09563006  1.73419495  0.95342999 -1.80446870
> colRanges(tmp)
          [,1]       [,2]     [,3]      [,4]      [,5]       [,6]      [,7]
[1,] 0.1573227 -0.6872531 1.038861 -1.391289 0.2034616 -0.6835227 0.6074842
[2,] 0.1573227 -0.6872531 1.038861 -1.391289 0.2034616 -0.6835227 0.6074842
           [,8]      [,9]     [,10]      [,11]     [,12]     [,13]     [,14]
[1,] -0.2566361 -1.873549 -1.128848 -0.7878418 -1.190674 -0.694564 0.1652224
[2,] -0.2566361 -1.873549 -1.128848 -0.7878418 -1.190674 -0.694564 0.1652224
          [,15]      [,16]      [,17]      [,18]      [,19]     [,20]     [,21]
[1,] -0.6373603 -0.9816828 -0.2633971 -0.5028578 -0.4684909 0.9409461 0.3781111
[2,] -0.6373603 -0.9816828 -0.2633971 -0.5028578 -0.4684909 0.9409461 0.3781111
        [,22]     [,23]     [,24]     [,25]      [,26]      [,27]    [,28]
[1,] 1.667718 0.8837693 -0.746017 0.7521934 -0.1612005 -0.8119273 2.985353
[2,] 1.667718 0.8837693 -0.746017 0.7521934 -0.1612005 -0.8119273 2.985353
         [,29]      [,30]      [,31]      [,32]      [,33]     [,34]     [,35]
[1,] 0.2985317 -0.5074643 -0.5211075 -0.7133998 -0.4205893 0.3113571 -0.495681
[2,] 0.2985317 -0.5074643 -0.5211075 -0.7133998 -0.4205893 0.3113571 -0.495681
        [,36]     [,37]     [,38]      [,39]      [,40]     [,41]     [,42]
[1,] 1.173239 0.3475083 0.4985759 -0.2572894 -0.3342015 -0.979008 -1.482462
[2,] 1.173239 0.3475083 0.4985759 -0.2572894 -0.3342015 -0.979008 -1.482462
         [,43]      [,44]     [,45]   [,46]     [,47]     [,48]      [,49]
[1,] 0.6034477 -0.3029638 0.4832222 1.52027 0.0135195 -1.258346 -0.1802503
[2,] 0.6034477 -0.3029638 0.4832222 1.52027 0.0135195 -1.258346 -0.1802503
         [,50]    [,51]     [,52]      [,53]     [,54]      [,55]     [,56]
[1,] 0.7251519 -1.36968 -1.177451 -0.2104031 -1.808289 -0.2055492 -1.083393
[2,] 0.7251519 -1.36968 -1.177451 -0.2104031 -1.808289 -0.2055492 -1.083393
          [,57]    [,58]   [,59]     [,60]     [,61]     [,62]      [,63]
[1,] -0.5946409 1.268868 2.55837 0.2780235 0.6146556 0.5891645 -0.8433019
[2,] -0.5946409 1.268868 2.55837 0.2780235 0.6146556 0.5891645 -0.8433019
        [,64]    [,65]     [,66]    [,67]     [,68]      [,69]    [,70]
[1,] 2.043508 1.255262 0.7968281 -1.16917 0.2912643 -0.7110444 0.458037
[2,] 2.043508 1.255262 0.7968281 -1.16917 0.2912643 -0.7110444 0.458037
         [,71]      [,72]     [,73]     [,74]   [,75]    [,76]      [,77]
[1,] 0.4034316 -0.8169772 -0.513987 0.7309758 1.36542 2.682142 -0.2861848
[2,] 0.4034316 -0.8169772 -0.513987 0.7309758 1.36542 2.682142 -0.2861848
          [,78]      [,79]     [,80]     [,81]   [,82]    [,83]     [,84]
[1,] -0.6582276 -0.4332278 0.4911385 0.2543977 0.14432 1.423876 -1.760985
[2,] -0.6582276 -0.4332278 0.4911385 0.2543977 0.14432 1.423876 -1.760985
         [,85]     [,86]     [,87]     [,88]     [,89]     [,90]     [,91]
[1,] 0.5960211 -1.309507 0.7595559 0.4044006 0.3326972 0.5637009 0.1247062
[2,] 0.5960211 -1.309507 0.7595559 0.4044006 0.3326972 0.5637009 0.1247062
          [,92]      [,93]      [,94]    [,95]     [,96]       [,97]    [,98]
[1,] -0.1630857 -0.4348146 -0.1412705 2.201034 -1.664954 -0.09563006 1.734195
[2,] -0.1630857 -0.4348146 -0.1412705 2.201034 -1.664954 -0.09563006 1.734195
       [,99]    [,100]
[1,] 0.95343 -1.804469
[2,] 0.95343 -1.804469
> 
> 
> Max(tmp2)
[1] 2.396894
> Min(tmp2)
[1] -3.845115
> mean(tmp2)
[1] 0.002185259
> Sum(tmp2)
[1] 0.2185259
> Var(tmp2)
[1] 1.275774
> 
> rowMeans(tmp2)
  [1] -1.14731838 -0.53337076 -0.73245659 -1.64517866  0.26620319  0.77629991
  [7]  1.34971464  0.75991796  1.01389942  0.54765304 -0.02613105  0.35527699
 [13]  1.00659880  1.78854022  0.33789077  0.64848819 -0.13023681  2.13487862
 [19]  0.19677319 -0.18154440 -0.92531270 -0.55892148  0.37859204  0.95866345
 [25] -2.74751117 -0.44345508 -0.54127633  2.16351799  0.16164728  0.88371672
 [31] -0.05077478  2.33081038 -3.84511492  0.84619760 -0.31609171  1.05784444
 [37]  0.07614767 -1.44339658  0.21107609  0.24779687 -0.91019380 -1.51506944
 [43]  0.25641177  0.68828509  1.64871903  0.11985254  0.37876725  1.24823623
 [49]  0.28740231  0.22719101 -0.99944579 -0.91551620 -1.99258008 -0.05540215
 [55] -1.83479150 -0.96108192 -0.39756937  0.48835288 -0.09954014 -0.51222721
 [61] -0.36145600 -0.55859713 -0.68817502 -2.35476835  0.16534835  1.51063656
 [67]  1.02644661  1.89567461  0.52710075 -0.90893223 -0.17768397  0.96317019
 [73]  0.85589333  0.76311459  0.16264808 -1.08975933 -0.39287353 -1.53940481
 [79]  0.62219145  0.54924703 -0.31663703  0.32615552  0.57792805 -0.51992722
 [85] -1.73416114 -1.93204237  1.32167007  2.39689421 -0.19169478  0.02246076
 [91] -1.69892180  0.15976662  1.44030807  0.62386582 -1.18022613 -0.20190212
 [97]  1.63753407  0.36207500 -0.98985416 -1.23444128
> rowSums(tmp2)
  [1] -1.14731838 -0.53337076 -0.73245659 -1.64517866  0.26620319  0.77629991
  [7]  1.34971464  0.75991796  1.01389942  0.54765304 -0.02613105  0.35527699
 [13]  1.00659880  1.78854022  0.33789077  0.64848819 -0.13023681  2.13487862
 [19]  0.19677319 -0.18154440 -0.92531270 -0.55892148  0.37859204  0.95866345
 [25] -2.74751117 -0.44345508 -0.54127633  2.16351799  0.16164728  0.88371672
 [31] -0.05077478  2.33081038 -3.84511492  0.84619760 -0.31609171  1.05784444
 [37]  0.07614767 -1.44339658  0.21107609  0.24779687 -0.91019380 -1.51506944
 [43]  0.25641177  0.68828509  1.64871903  0.11985254  0.37876725  1.24823623
 [49]  0.28740231  0.22719101 -0.99944579 -0.91551620 -1.99258008 -0.05540215
 [55] -1.83479150 -0.96108192 -0.39756937  0.48835288 -0.09954014 -0.51222721
 [61] -0.36145600 -0.55859713 -0.68817502 -2.35476835  0.16534835  1.51063656
 [67]  1.02644661  1.89567461  0.52710075 -0.90893223 -0.17768397  0.96317019
 [73]  0.85589333  0.76311459  0.16264808 -1.08975933 -0.39287353 -1.53940481
 [79]  0.62219145  0.54924703 -0.31663703  0.32615552  0.57792805 -0.51992722
 [85] -1.73416114 -1.93204237  1.32167007  2.39689421 -0.19169478  0.02246076
 [91] -1.69892180  0.15976662  1.44030807  0.62386582 -1.18022613 -0.20190212
 [97]  1.63753407  0.36207500 -0.98985416 -1.23444128
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.14731838 -0.53337076 -0.73245659 -1.64517866  0.26620319  0.77629991
  [7]  1.34971464  0.75991796  1.01389942  0.54765304 -0.02613105  0.35527699
 [13]  1.00659880  1.78854022  0.33789077  0.64848819 -0.13023681  2.13487862
 [19]  0.19677319 -0.18154440 -0.92531270 -0.55892148  0.37859204  0.95866345
 [25] -2.74751117 -0.44345508 -0.54127633  2.16351799  0.16164728  0.88371672
 [31] -0.05077478  2.33081038 -3.84511492  0.84619760 -0.31609171  1.05784444
 [37]  0.07614767 -1.44339658  0.21107609  0.24779687 -0.91019380 -1.51506944
 [43]  0.25641177  0.68828509  1.64871903  0.11985254  0.37876725  1.24823623
 [49]  0.28740231  0.22719101 -0.99944579 -0.91551620 -1.99258008 -0.05540215
 [55] -1.83479150 -0.96108192 -0.39756937  0.48835288 -0.09954014 -0.51222721
 [61] -0.36145600 -0.55859713 -0.68817502 -2.35476835  0.16534835  1.51063656
 [67]  1.02644661  1.89567461  0.52710075 -0.90893223 -0.17768397  0.96317019
 [73]  0.85589333  0.76311459  0.16264808 -1.08975933 -0.39287353 -1.53940481
 [79]  0.62219145  0.54924703 -0.31663703  0.32615552  0.57792805 -0.51992722
 [85] -1.73416114 -1.93204237  1.32167007  2.39689421 -0.19169478  0.02246076
 [91] -1.69892180  0.15976662  1.44030807  0.62386582 -1.18022613 -0.20190212
 [97]  1.63753407  0.36207500 -0.98985416 -1.23444128
> rowMin(tmp2)
  [1] -1.14731838 -0.53337076 -0.73245659 -1.64517866  0.26620319  0.77629991
  [7]  1.34971464  0.75991796  1.01389942  0.54765304 -0.02613105  0.35527699
 [13]  1.00659880  1.78854022  0.33789077  0.64848819 -0.13023681  2.13487862
 [19]  0.19677319 -0.18154440 -0.92531270 -0.55892148  0.37859204  0.95866345
 [25] -2.74751117 -0.44345508 -0.54127633  2.16351799  0.16164728  0.88371672
 [31] -0.05077478  2.33081038 -3.84511492  0.84619760 -0.31609171  1.05784444
 [37]  0.07614767 -1.44339658  0.21107609  0.24779687 -0.91019380 -1.51506944
 [43]  0.25641177  0.68828509  1.64871903  0.11985254  0.37876725  1.24823623
 [49]  0.28740231  0.22719101 -0.99944579 -0.91551620 -1.99258008 -0.05540215
 [55] -1.83479150 -0.96108192 -0.39756937  0.48835288 -0.09954014 -0.51222721
 [61] -0.36145600 -0.55859713 -0.68817502 -2.35476835  0.16534835  1.51063656
 [67]  1.02644661  1.89567461  0.52710075 -0.90893223 -0.17768397  0.96317019
 [73]  0.85589333  0.76311459  0.16264808 -1.08975933 -0.39287353 -1.53940481
 [79]  0.62219145  0.54924703 -0.31663703  0.32615552  0.57792805 -0.51992722
 [85] -1.73416114 -1.93204237  1.32167007  2.39689421 -0.19169478  0.02246076
 [91] -1.69892180  0.15976662  1.44030807  0.62386582 -1.18022613 -0.20190212
 [97]  1.63753407  0.36207500 -0.98985416 -1.23444128
> 
> colMeans(tmp2)
[1] 0.002185259
> colSums(tmp2)
[1] 0.2185259
> colVars(tmp2)
[1] 1.275774
> colSd(tmp2)
[1] 1.129502
> colMax(tmp2)
[1] 2.396894
> colMin(tmp2)
[1] -3.845115
> colMedians(tmp2)
[1] 0.1607069
> colRanges(tmp2)
          [,1]
[1,] -3.845115
[2,]  2.396894
> 
> 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] -0.05168827  4.49345881  2.22230313  5.56975556 -3.28852855 -2.56991201
 [7] -2.71797053  1.65768636  2.60245165 -2.14242536
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2268521
[2,] -0.7999077
[3,] -0.2302458
[4,]  0.7810979
[5,]  1.9359693
> 
> rowApply(tmp,sum)
 [1] -2.5294540  1.2879072  3.2727438  2.8179289  3.1835278  1.7472026
 [7] -2.8991783  3.4626139 -4.8535971  0.2854359
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    5    8    1    6    2    7    1   10     3
 [2,]    5   10    6    6   10    1    5    4    1    10
 [3,]    7    9    4    9    3    6    9    6    5     1
 [4,]    6    2    7    3    9    9    6   10    6     9
 [5,]    3    4    5    4    7    4    4    2    7     4
 [6,]    1    6    2    8    1    8    2    7    4     8
 [7,]    2    7    1    2    8   10    1    8    3     7
 [8,]   10    1    3   10    4    7    8    9    8     2
 [9,]    8    8   10    7    5    3   10    5    2     6
[10,]    4    3    9    5    2    5    3    3    9     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.8436725713  1.5983340918 -2.1123236746  0.4094623286  0.0907609702
 [6] -2.0847250940  4.8244757951  0.3356579942  0.1296827222 -0.0009741956
[11] -0.7605543691  0.0090233619 -3.7428427862 -1.7736834770 -2.7889643992
[16] -2.2501167070 -1.5331437755  5.2605070714  2.4130230007 -0.9443905620
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8949657
[2,] -0.7400377
[3,] -0.6624530
[4,]  0.6554768
[5,]  0.7983069
> 
> rowApply(tmp,sum)
[1]  5.8346900  1.5627027  0.2730895 -8.0933427 -3.3416039
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    3   15    5    5   16
[2,]    8    8   15   20    6
[3,]   16   14    1    4    5
[4,]    4   18   13    3   17
[5,]   12   16    6    7   13
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.6624530 -0.1353841  1.1389718 -0.6371003  0.3354533 -0.3418853
[2,]  0.6554768 -0.3293191  0.5931608  1.2768207  0.8252951 -2.3585056
[3,] -0.7400377  0.7238143 -1.5718059  0.3345512 -0.6346253 -0.5537707
[4,] -0.8949657  2.0306389 -1.2866958 -1.3849759 -0.7810208  0.9501437
[5,]  0.7983069 -0.6914160 -0.9859546  0.8201667  0.3456587  0.2192929
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  3.2495658  1.5323417  0.3806375  0.04076604  0.4192813  1.6062365
[2,]  0.0358999  0.4313526  0.3415173  1.71586457 -1.1818272 -0.4573824
[3,]  1.4958340 -1.1140561 -0.8492639 -0.50414239  0.9582443 -0.8271337
[4,]  0.4811363  0.1153448 -0.6423282 -0.02033596 -0.4400037 -0.7039051
[5,] -0.4379602 -0.6293250  0.8991201 -1.23312646 -0.5162491  0.3912081
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.4805660 -0.3371853  1.7746254 -1.1799014  0.2011579 0.55528697
[2,] -0.4864276 -0.7372853 -1.7186449 -1.3474176  0.5232655 2.18371607
[3,] -0.4266537 -0.4558108 -0.0375685  1.1479608  0.6050947 1.63672831
[4,] -2.4795104 -0.8741995 -0.7389391  0.3000817 -0.7346468 0.02313512
[5,]  0.1303150  0.6307975 -2.0684372 -1.1708403 -2.1280151 0.86164060
           [,19]       [,20]
[1,] -0.09585218 -1.52930651
[2,]  0.59308668  1.00405665
[3,]  1.02129004  0.06444063
[4,]  0.99016607 -2.00246236
[5,] -0.09566761  1.51888103
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
            col1       col2      col3      col4        col5      col6      col7
row1 -0.04868924 -0.8961639 -0.185176 0.3495093 -0.08696122 -1.518383 0.5239281
           col8       col9    col10      col11    col12       col13     col14
row1 -0.8157675 -0.1110868 0.956445 -0.3444477 2.729747 -0.02006659 -1.517259
          col15    col16       col17     col18     col19    col20
row1 -0.3650726 1.693766 -0.04156363 -1.834262 0.7669325 1.087554
> tmp[,"col10"]
          col10
row1  0.9564450
row2 -0.4428055
row3  0.4259906
row4 -0.6610344
row5  0.5116321
> tmp[c("row1","row5"),]
            col1       col2       col3      col4        col5       col6
row1 -0.04868924 -0.8961639 -0.1851760 0.3495093 -0.08696122 -1.5183829
row5 -0.68333954  0.5828211 -0.1986337 1.5416808 -0.54187096  0.7122984
          col7       col8       col9     col10       col11     col12
row1 0.5239281 -0.8157675 -0.1110868 0.9564450 -0.34444775  2.729747
row5 0.4900659 -2.1944453  0.7640503 0.5116321 -0.01734414 -2.808252
           col13      col14      col15     col16       col17      col18
row1 -0.02006659 -1.5172586 -0.3650726  1.693766 -0.04156363 -1.8342624
row5  1.27501188 -0.4845891  0.1590171 -1.183176  1.43887316  0.8744317
         col19       col20
row1 0.7669325  1.08755444
row5 0.5896023 -0.06513256
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.5183829  1.08755444
row2  0.8263244 -0.52567194
row3  0.5980384 -0.02483075
row4 -0.8638989  1.17009343
row5  0.7122984 -0.06513256
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -1.5183829  1.08755444
row5  0.7122984 -0.06513256
> 
> 
> 
> 
> 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 52.92198 52.23126 50.55984 50.75312 49.23382 105.1078 52.22348 52.27357
         col9    col10    col11   col12    col13    col14    col15    col16
row1 51.31729 48.71874 51.28781 49.7654 49.86354 50.72981 49.98664 49.53848
        col17    col18   col19    col20
row1 49.56313 49.02628 49.7694 103.8345
> tmp[,"col10"]
        col10
row1 48.71874
row2 28.39741
row3 29.80100
row4 30.30511
row5 50.40030
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 52.92198 52.23126 50.55984 50.75312 49.23382 105.1078 52.22348 52.27357
row5 48.46304 48.95584 49.04566 51.92266 49.03581 105.0601 51.14176 48.97093
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.31729 48.71874 51.28781 49.76540 49.86354 50.72981 49.98664 49.53848
row5 50.65004 50.40030 48.99993 52.73802 47.63069 51.57775 50.03733 50.03693
        col17    col18    col19    col20
row1 49.56313 49.02628 49.76940 103.8345
row5 50.70214 48.71008 52.21583 103.6491
> tmp[,c("col6","col20")]
          col6     col20
row1 105.10777 103.83452
row2  75.19311  75.61758
row3  75.02422  76.67487
row4  73.39368  75.58755
row5 105.06008 103.64906
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.1078 103.8345
row5 105.0601 103.6491
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.1078 103.8345
row5 105.0601 103.6491
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.08800743
[2,]  0.35752705
[3,]  0.93199930
[4,] -2.32158205
[5,] -1.96777323
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.0768956  1.3581883
[2,]  0.3856097  0.1357769
[3,] -0.6544106 -0.7097708
[4,] -1.1594106 -0.3860234
[5,]  1.4867884 -1.0177475
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.5335551 -1.5469505
[2,] -1.2827331 -0.7028662
[3,] -0.3299839 -0.5948795
[4,] -1.5957633  0.1446454
[5,]  0.9263206 -0.5660929
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5335551
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5335551
[2,] -1.2827331
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3  0.4064510  0.3871693 -0.3959271 -0.5140676 -0.5901209 -0.0825426
row1 -0.8336909 -1.4576344 -0.1402904  0.9460441 -2.0471624 -1.6591235
          [,7]       [,8]       [,9]     [,10]     [,11]      [,12]       [,13]
row3 0.9188035 -0.8735014 -0.8410569 0.5550805  0.820129 -1.1269978 -0.01441297
row1 0.5272186 -0.3519546 -1.7311685 0.5018616 -1.659633 -0.4905395 -2.39681274
          [,14]     [,15]      [,16]      [,17]      [,18]       [,19]
row3 -1.4148990 0.1335805 -1.3304934 -0.8386892 -0.9578656 -0.09956401
row1 -0.7132966 0.4308139 -0.8971843  0.3298367  0.7367731  1.16676733
          [,20]
row3  1.9958117
row1 -0.1406841
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]       [,3]     [,4]       [,5]       [,6]      [,7]
row2 -0.2120079 -0.1065186 0.03784373 1.739244 -0.9408638 -0.2088327 -1.371565
          [,8]       [,9]     [,10]
row2 -1.400977 -0.1793308 -1.342935
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
            [,1]     [,2]    [,3]        [,4]      [,5]       [,6]      [,7]
row5 -0.08212801 1.839259 -1.1641 -0.05465101 0.5671335 -0.1508619 -1.175158
          [,8]     [,9]     [,10]      [,11]      [,12]   [,13]       [,14]
row5 -1.340364 1.688396 0.1444835 -0.9210965 0.09611273 1.05598 -0.04050086
        [,15]     [,16]    [,17]     [,18]     [,19]     [,20]
row5 1.430849 -1.056187 1.335903 -1.395814 0.2130806 0.7162363
> 
> 
> 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: 0x13b937b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f6185b5a6"
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f7030ef0c"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f68ab2994"
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f1b07a158"
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f1b85be89"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f78de059c"
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f522ea3b3"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f164b9b1d"
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f179aeffb"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f1cbaaffe"
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8ffbf6c6e" 
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f3b26bee7"
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f67085d29"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8f106188ab"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM359f8fdae465d" 
> 
> 
> ### 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: 0x14dc4cb0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x14dc4cb0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x14dc4cb0>
> rowMedians(tmp)
  [1] -0.290055628 -0.125862739 -0.188790372 -0.003569734 -0.074966270
  [6] -0.373172104  0.153613759 -0.215236209 -0.046439341 -0.145124728
 [11] -0.125261550  0.119867205  0.643409682  0.178019045 -0.245815502
 [16]  0.034985845 -0.087135338  0.034121213  0.654822800 -0.309008171
 [21] -0.204053083 -0.024687497 -0.284943892  0.614664789  0.094670981
 [26] -0.381842032 -0.201588008  0.158935069  0.271561637  0.109314986
 [31] -0.001555283 -0.082883990 -0.317117946 -0.373245649 -0.295649860
 [36]  0.643308539  0.035994387 -0.418383871 -0.115453820 -0.351428878
 [41] -0.574006693 -0.187499033  0.109590817 -0.291107520 -0.248782987
 [46]  0.076460021 -0.168520783  0.354545243 -0.080628286 -0.526289888
 [51] -0.479793557 -0.198397208  0.021621355  0.272103624  0.448484153
 [56] -0.034004068  0.414307529  0.324988601  0.351744294 -0.363449431
 [61]  0.113528753 -0.138496088 -0.165544516  0.221381444 -0.532672650
 [66]  0.569921676  0.119872578  0.367992045  0.099189642 -0.282711762
 [71]  0.106595126 -0.147927683 -0.324112416  0.292483964 -0.311398359
 [76]  0.205652720  0.511239644  0.118665372  0.274537834  0.082973301
 [81]  0.585124944 -0.036573032  0.777631159 -0.463005354 -0.344846467
 [86] -0.350439836  0.325453005 -0.122964118 -0.410684536 -0.113666699
 [91] -0.525811710 -0.781596543 -0.092333671  0.278515057 -0.016719339
 [96]  0.204440680  0.433321636 -0.097373950  0.373617120 -0.489301384
[101]  0.201325103 -0.049671246 -0.286017585  0.082256357 -0.579461813
[106]  0.117663878 -0.157082470 -0.473569748 -0.230801895  0.102163717
[111] -0.278268384 -0.542162375  0.521843387  0.046195303  0.257433200
[116] -0.035823009 -0.824671177 -0.090656644 -0.146441745  0.078754019
[121]  0.090445825  0.126082735  0.087251133 -0.138841940  0.064723583
[126] -0.638700993  0.002709265 -0.384070056 -0.685908379  0.165468713
[131]  0.097998408 -0.080566215 -0.316649432 -0.399741072 -0.031820582
[136]  0.387501295  0.010056506 -0.216493620  0.372332307 -0.215768073
[141]  0.066853660 -0.073916388  0.029003340 -0.447356606 -0.251178419
[146]  0.037374572  0.461186420 -0.024981436  0.248411787 -0.182508814
[151]  0.686326878  0.389326363 -0.097772756 -0.070253352  0.051346206
[156]  0.261382659 -0.425703750 -0.070701916  0.085668240 -0.091161283
[161]  0.336777710  0.297188741 -0.315606405  0.415951395 -0.452830281
[166] -0.148651041  0.125053020  0.058834528 -0.067036158 -0.179123502
[171] -0.020193742 -0.026230442  0.252381943  0.090781699  0.228851505
[176] -0.185510273  0.220781996  0.631331509  0.611433602  0.072239412
[181] -0.740942544 -0.613942362  0.097797201 -0.527520249 -0.259492303
[186]  0.290448647 -0.662504352 -0.080225230  0.194107808 -0.424570299
[191]  0.155114337 -0.016491951  0.410993541 -0.222429767 -0.186704372
[196] -0.240771615  0.384843667  0.464068358  0.356697563  0.218121725
[201] -0.039869956  0.731401951  0.309210692  0.342924017 -0.299061453
[206] -0.016796271 -0.308227907 -0.720446754  0.253178620  0.211743799
[211] -0.659035713 -0.285553164 -0.048842136 -0.002525705 -0.281502439
[216]  0.102441401 -0.186404619  0.084725942 -0.145572650  0.415548501
[221] -0.109140884 -0.618432770  0.130559608 -0.104051074  0.049470137
[226] -0.259088220 -0.810131370  0.359088075  0.012739470 -0.325644783
> 
> proc.time()
   user  system elapsed 
  1.981   0.810   2.816 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x1e230790>
> .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: 0x1e230790>
> .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: 0x1e230790>
> .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: 0x1e230790>
> 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: 0x1e4fd3c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e4fd3c0>
> .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: 0x1e4fd3c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e4fd3c0>
> .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: 0x1e4fd3c0>
> 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: 0x1e4da6d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e4da6d0>
> .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: 0x1e4da6d0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x1e4da6d0>
> .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: 0x1e4da6d0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x1e4da6d0>
> .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: 0x1e4da6d0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x1e4da6d0>
> .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: 0x1e4da6d0>
> 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: 0x1e506680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x1e506680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e506680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1e506680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile359fdb16d3f0ee" "BufferedMatrixFile359fdb6a5615a" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile359fdb16d3f0ee" "BufferedMatrixFile359fdb6a5615a" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x1db01c00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1db01c00>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1db01c00>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1db01c00>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x1db01c00>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x1db01c00>
> .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: 0x1ddc4cb0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1ddc4cb0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x1ddc4cb0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x1ddc4cb0>
> 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: 0x1cd33a10>
> .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: 0x1cd33a10>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.353   0.035   0.375 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.336   0.032   0.355 

Example timings