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

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

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

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


CHECK results for BufferedMatrix on kunpeng2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.72.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.72.0.tar.gz
StartedAt: 2025-09-26 08:40:51 -0000 (Fri, 26 Sep 2025)
EndedAt: 2025-09-26 08:41:15 -0000 (Fri, 26 Sep 2025)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.335   0.044   0.368 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 477833 25.6    1045337 55.9   639800 34.2
Vcells 884297  6.8    8388608 64.0  2080696 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Sep 26 08:41:09 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 26 08:41:09 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: 0x4d7e6e0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Sep 26 08:41:10 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 26 08:41:10 2025"
> 
> ColMode(tmp2)
<pointer: 0x4d7e6e0>
> 
> 
> 
> ### 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,] 99.9405235 -0.16918930  0.03810670  1.8943219
[2,] -1.1648290  0.40565366 -0.17109657  1.2388776
[3,]  0.5993933 -0.03607926  0.04244763  0.8892439
[4,]  0.5589440  1.62157441 -0.32522830 -0.7823417
> 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,] 99.9405235 0.16918930 0.03810670 1.8943219
[2,]  1.1648290 0.40565366 0.17109657 1.2388776
[3,]  0.5993933 0.03607926 0.04244763 0.8892439
[4,]  0.5589440 1.62157441 0.32522830 0.7823417
> 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.9970257 0.4113263 0.1952094 1.3763437
[2,] 1.0792725 0.6369095 0.4136382 1.1130488
[3,] 0.7742049 0.1899454 0.2060282 0.9429973
[4,] 0.7476256 1.2734105 0.5702879 0.8845008
> 
> 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,] 224.91078 29.28245 26.99020 40.65776
[2,]  36.95755 31.77475 29.30748 37.36937
[3,]  33.34144 26.93553 27.10273 35.31922
[4,]  33.03520 39.35568 31.02811 34.62735
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x3356520>
> exp(tmp5)
<pointer: 0x3356520>
> log(tmp5,2)
<pointer: 0x3356520>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.1223
> Min(tmp5)
[1] 53.67589
> mean(tmp5)
[1] 73.46643
> Sum(tmp5)
[1] 14693.29
> Var(tmp5)
[1] 866.5008
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.90893 70.73646 71.22437 71.42405 76.75539 66.54825 73.75417 69.91327
 [9] 68.38381 75.01564
> rowSums(tmp5)
 [1] 1818.179 1414.729 1424.487 1428.481 1535.108 1330.965 1475.083 1398.265
 [9] 1367.676 1500.313
> rowVars(tmp5)
 [1] 7965.48343   49.08849   94.19443   73.05370   78.40744   70.68148
 [7]   86.25681   98.31137   48.26852   69.06715
> rowSd(tmp5)
 [1] 89.249557  7.006318  9.705381  8.547146  8.854797  8.407228  9.287454
 [8]  9.915209  6.947555  8.310665
> rowMax(tmp5)
 [1] 468.12232  83.41378  89.63719  85.86429  89.70370  84.39170  97.07744
 [8]  87.16219  78.97046  87.58656
> rowMin(tmp5)
 [1] 56.17657 60.99968 56.06278 55.35332 57.61847 53.97807 59.27167 56.54149
 [9] 53.67589 54.94976
> 
> colMeans(tmp5)
 [1] 109.74631  70.81487  69.28598  75.03746  67.86062  71.42262  72.05749
 [8]  70.02897  67.59702  75.95992  67.57166  70.30311  72.10547  72.41008
[15]  76.18008  67.93845  73.68597  73.26848  72.64057  73.41356
> colSums(tmp5)
 [1] 1097.4631  708.1487  692.8598  750.3746  678.6062  714.2262  720.5749
 [8]  700.2897  675.9702  759.5992  675.7166  703.0311  721.0547  724.1008
[15]  761.8008  679.3845  736.8597  732.6848  726.4057  734.1356
> colVars(tmp5)
 [1] 15882.81846    67.44677    93.73069    41.78652    56.98220    62.22370
 [7]    50.97074   104.22295   133.86422   156.02896   118.59388    80.17270
[13]    70.54190    85.50836    99.11493    79.22442   151.33942    19.49813
[19]    49.30419    67.37424
> colSd(tmp5)
 [1] 126.027054   8.212598   9.681461   6.464250   7.548656   7.888200
 [7]   7.139379  10.208964  11.569971  12.491155  10.890082   8.953921
[13]   8.398922   9.247073   9.955648   8.900810  12.302009   4.415668
[19]   7.021694   8.208181
> colMax(tmp5)
 [1] 468.12232  81.91369  85.20431  84.62380  81.11544  89.70370  83.78946
 [8]  86.25507  85.77013  97.07744  85.29462  81.01603  89.65960  83.41378
[15]  84.39170  82.71807  87.58656  84.00999  81.88549  82.46980
> colMin(tmp5)
 [1] 63.26655 56.06278 56.17657 64.86896 54.75045 63.00203 59.42151 57.64789
 [9] 53.67589 57.40539 54.19764 53.97807 63.23997 57.68870 56.54149 56.50933
[17] 55.35332 67.12622 63.39354 59.13463
> 
> 
> ### 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.90893 70.73646 71.22437       NA 76.75539 66.54825 73.75417 69.91327
 [9] 68.38381 75.01564
> rowSums(tmp5)
 [1] 1818.179 1414.729 1424.487       NA 1535.108 1330.965 1475.083 1398.265
 [9] 1367.676 1500.313
> rowVars(tmp5)
 [1] 7965.48343   49.08849   94.19443   64.91806   78.40744   70.68148
 [7]   86.25681   98.31137   48.26852   69.06715
> rowSd(tmp5)
 [1] 89.249557  7.006318  9.705381  8.057175  8.854797  8.407228  9.287454
 [8]  9.915209  6.947555  8.310665
> rowMax(tmp5)
 [1] 468.12232  83.41378  89.63719        NA  89.70370  84.39170  97.07744
 [8]  87.16219  78.97046  87.58656
> rowMin(tmp5)
 [1] 56.17657 60.99968 56.06278       NA 57.61847 53.97807 59.27167 56.54149
 [9] 53.67589 54.94976
> 
> colMeans(tmp5)
 [1] 109.74631  70.81487  69.28598  75.03746  67.86062  71.42262  72.05749
 [8]  70.02897  67.59702        NA  67.57166  70.30311  72.10547  72.41008
[15]  76.18008  67.93845  73.68597  73.26848  72.64057  73.41356
> colSums(tmp5)
 [1] 1097.4631  708.1487  692.8598  750.3746  678.6062  714.2262  720.5749
 [8]  700.2897  675.9702        NA  675.7166  703.0311  721.0547  724.1008
[15]  761.8008  679.3845  736.8597  732.6848  726.4057  734.1356
> colVars(tmp5)
 [1] 15882.81846    67.44677    93.73069    41.78652    56.98220    62.22370
 [7]    50.97074   104.22295   133.86422          NA   118.59388    80.17270
[13]    70.54190    85.50836    99.11493    79.22442   151.33942    19.49813
[19]    49.30419    67.37424
> colSd(tmp5)
 [1] 126.027054   8.212598   9.681461   6.464250   7.548656   7.888200
 [7]   7.139379  10.208964  11.569971         NA  10.890082   8.953921
[13]   8.398922   9.247073   9.955648   8.900810  12.302009   4.415668
[19]   7.021694   8.208181
> colMax(tmp5)
 [1] 468.12232  81.91369  85.20431  84.62380  81.11544  89.70370  83.78946
 [8]  86.25507  85.77013        NA  85.29462  81.01603  89.65960  83.41378
[15]  84.39170  82.71807  87.58656  84.00999  81.88549  82.46980
> colMin(tmp5)
 [1] 63.26655 56.06278 56.17657 64.86896 54.75045 63.00203 59.42151 57.64789
 [9] 53.67589       NA 54.19764 53.97807 63.23997 57.68870 56.54149 56.50933
[17] 55.35332 67.12622 63.39354 59.13463
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.1223
> Min(tmp5,na.rm=TRUE)
[1] 53.67589
> mean(tmp5,na.rm=TRUE)
[1] 73.40413
> Sum(tmp5,na.rm=TRUE)
[1] 14607.42
> Var(tmp5,na.rm=TRUE)
[1] 870.0969
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.90893 70.73646 71.22437 70.66404 76.75539 66.54825 73.75417 69.91327
 [9] 68.38381 75.01564
> rowSums(tmp5,na.rm=TRUE)
 [1] 1818.179 1414.729 1424.487 1342.617 1535.108 1330.965 1475.083 1398.265
 [9] 1367.676 1500.313
> rowVars(tmp5,na.rm=TRUE)
 [1] 7965.48343   49.08849   94.19443   64.91806   78.40744   70.68148
 [7]   86.25681   98.31137   48.26852   69.06715
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.249557  7.006318  9.705381  8.057175  8.854797  8.407228  9.287454
 [8]  9.915209  6.947555  8.310665
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.12232  83.41378  89.63719  84.05366  89.70370  84.39170  97.07744
 [8]  87.16219  78.97046  87.58656
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.17657 60.99968 56.06278 55.35332 57.61847 53.97807 59.27167 56.54149
 [9] 53.67589 54.94976
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.74631  70.81487  69.28598  75.03746  67.86062  71.42262  72.05749
 [8]  70.02897  67.59702  74.85944  67.57166  70.30311  72.10547  72.41008
[15]  76.18008  67.93845  73.68597  73.26848  72.64057  73.41356
> colSums(tmp5,na.rm=TRUE)
 [1] 1097.4631  708.1487  692.8598  750.3746  678.6062  714.2262  720.5749
 [8]  700.2897  675.9702  673.7349  675.7166  703.0311  721.0547  724.1008
[15]  761.8008  679.3845  736.8597  732.6848  726.4057  734.1356
> colVars(tmp5,na.rm=TRUE)
 [1] 15882.81846    67.44677    93.73069    41.78652    56.98220    62.22370
 [7]    50.97074   104.22295   133.86422   161.90807   118.59388    80.17270
[13]    70.54190    85.50836    99.11493    79.22442   151.33942    19.49813
[19]    49.30419    67.37424
> colSd(tmp5,na.rm=TRUE)
 [1] 126.027054   8.212598   9.681461   6.464250   7.548656   7.888200
 [7]   7.139379  10.208964  11.569971  12.724310  10.890082   8.953921
[13]   8.398922   9.247073   9.955648   8.900810  12.302009   4.415668
[19]   7.021694   8.208181
> colMax(tmp5,na.rm=TRUE)
 [1] 468.12232  81.91369  85.20431  84.62380  81.11544  89.70370  83.78946
 [8]  86.25507  85.77013  97.07744  85.29462  81.01603  89.65960  83.41378
[15]  84.39170  82.71807  87.58656  84.00999  81.88549  82.46980
> colMin(tmp5,na.rm=TRUE)
 [1] 63.26655 56.06278 56.17657 64.86896 54.75045 63.00203 59.42151 57.64789
 [9] 53.67589 57.40539 54.19764 53.97807 63.23997 57.68870 56.54149 56.50933
[17] 55.35332 67.12622 63.39354 59.13463
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.90893 70.73646 71.22437      NaN 76.75539 66.54825 73.75417 69.91327
 [9] 68.38381 75.01564
> rowSums(tmp5,na.rm=TRUE)
 [1] 1818.179 1414.729 1424.487    0.000 1535.108 1330.965 1475.083 1398.265
 [9] 1367.676 1500.313
> rowVars(tmp5,na.rm=TRUE)
 [1] 7965.48343   49.08849   94.19443         NA   78.40744   70.68148
 [7]   86.25681   98.31137   48.26852   69.06715
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.249557  7.006318  9.705381        NA  8.854797  8.407228  9.287454
 [8]  9.915209  6.947555  8.310665
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.12232  83.41378  89.63719        NA  89.70370  84.39170  97.07744
 [8]  87.16219  78.97046  87.58656
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.17657 60.99968 56.06278       NA 57.61847 53.97807 59.27167 56.54149
 [9] 53.67589 54.94976
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.30052  69.58167  69.80876  75.36693  67.11225  71.17802  71.70767
 [8]  70.98814  68.22169       NaN  67.31807  69.65846  72.42010  73.54872
[15]  75.30524  68.68559  75.72294  73.64093  71.81874  72.62345
> colSums(tmp5,na.rm=TRUE)
 [1] 1028.7046  626.2350  628.2788  678.3023  604.0102  640.6021  645.3690
 [8]  638.8932  613.9952    0.0000  605.8626  626.9261  651.7809  661.9385
[15]  677.7471  618.1703  681.5064  662.7684  646.3686  653.6110
> colVars(tmp5,na.rm=TRUE)
 [1] 17634.83669    58.76874   102.37239    45.78870    57.80435    69.32858
 [7]    55.96538   106.90076   146.20733          NA   132.69465    85.51912
[13]    78.24598    81.61115   102.89412    82.84755   123.57819    20.37477
[19]    47.86886    68.77290
> colSd(tmp5,na.rm=TRUE)
 [1] 132.796222   7.666077  10.117924   6.766735   7.602917   8.326379
 [7]   7.481002  10.339282  12.091622         NA  11.519316   9.247655
[13]   8.845676   9.033889  10.143674   9.102063  11.116573   4.513842
[19]   6.918732   8.292943
> colMax(tmp5,na.rm=TRUE)
 [1] 468.12232  80.89309  85.20431  84.62380  81.11544  89.70370  83.78946
 [8]  86.25507  85.77013      -Inf  85.29462  81.01603  89.65960  83.41378
[15]  84.39170  82.71807  87.58656  84.00999  81.88549  82.46980
> colMin(tmp5,na.rm=TRUE)
 [1] 63.26655 56.06278 56.17657 64.86896 54.75045 63.00203 59.42151 57.64789
 [9] 53.67589      Inf 54.19764 53.97807 63.23997 57.68870 56.54149 56.50933
[17] 57.61847 67.12622 63.39354 59.13463
> 
> 
> 
> 
> 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] 281.5098 238.1701 170.2466 152.5640 253.2127 135.4348 279.7686 108.3876
 [9] 484.1268 190.6632
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 281.5098 238.1701 170.2466 152.5640 253.2127 135.4348 279.7686 108.3876
 [9] 484.1268 190.6632
> 
> 
> 
> 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] -8.526513e-14  2.842171e-13  0.000000e+00  4.263256e-14 -5.684342e-14
 [6] -2.842171e-14 -1.989520e-13 -2.842171e-14 -5.684342e-14  5.684342e-14
[11] -2.842171e-14 -8.526513e-14 -1.421085e-13  0.000000e+00  1.705303e-13
[16]  0.000000e+00 -2.842171e-14  8.526513e-14 -1.136868e-13  8.526513e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   5 
8   9 
9   11 
4   15 
7   6 
6   7 
5   19 
9   2 
9   5 
10   7 
2   14 
10   14 
4   2 
1   12 
3   12 
8   7 
4   10 
1   12 
1   19 
9   6 
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.345303
> Min(tmp)
[1] -1.730504
> mean(tmp)
[1] -0.1310281
> Sum(tmp)
[1] -13.10281
> Var(tmp)
[1] 0.764912
> 
> rowMeans(tmp)
[1] -0.1310281
> rowSums(tmp)
[1] -13.10281
> rowVars(tmp)
[1] 0.764912
> rowSd(tmp)
[1] 0.8745925
> rowMax(tmp)
[1] 2.345303
> rowMin(tmp)
[1] -1.730504
> 
> colMeans(tmp)
  [1]  1.008366860 -0.660223364 -0.731874816 -1.600511843 -0.726895955
  [6] -0.773116738  1.137189255  1.005466620 -0.748645838  1.282169133
 [11] -0.087082535 -0.086680636 -1.094002457  1.505114111 -1.019362678
 [16] -1.295805848  0.352702192  0.216368219  0.292958439 -1.419715004
 [21]  0.121582550 -0.585383212  0.066332825  1.901214619  0.925064184
 [26] -1.161820824  1.134249549 -0.674626272  0.168486641 -0.322001490
 [31] -1.207697709 -1.380877102 -1.041245248  0.650395835 -0.898665212
 [36] -0.279240257 -0.204305784 -0.422938358  1.423203793  0.191251409
 [41] -0.006559531 -0.243502474 -0.869982269 -0.181879795 -1.068360281
 [46] -1.012797250 -0.745638273  0.424433239  0.887253619  0.382453091
 [51]  0.031444725 -0.347772650 -1.225926689 -1.730504284 -0.269208626
 [56]  0.005994374 -1.002678446  0.185127169  0.765549936  1.844200143
 [61] -0.085365194  0.194945468  0.408103150  0.518909927 -0.858581107
 [66] -0.504214482 -1.575527826  0.782700380 -1.037705977 -1.171474702
 [71] -1.064099843 -0.547789302 -1.341071030  0.574166852 -0.067217270
 [76]  0.217187172 -0.145073727  0.411606773 -0.095351999 -0.414048279
 [81] -0.012071631  0.481374732  0.644976502  0.612140101 -0.350488896
 [86]  0.510780369 -0.563299708 -0.373112267  0.917033381  1.547131231
 [91] -0.688939239 -0.247871708 -1.668748171 -1.079038072  0.080269353
 [96]  0.739135583 -1.022820157  2.345302767 -0.528416745  0.572706763
> colSums(tmp)
  [1]  1.008366860 -0.660223364 -0.731874816 -1.600511843 -0.726895955
  [6] -0.773116738  1.137189255  1.005466620 -0.748645838  1.282169133
 [11] -0.087082535 -0.086680636 -1.094002457  1.505114111 -1.019362678
 [16] -1.295805848  0.352702192  0.216368219  0.292958439 -1.419715004
 [21]  0.121582550 -0.585383212  0.066332825  1.901214619  0.925064184
 [26] -1.161820824  1.134249549 -0.674626272  0.168486641 -0.322001490
 [31] -1.207697709 -1.380877102 -1.041245248  0.650395835 -0.898665212
 [36] -0.279240257 -0.204305784 -0.422938358  1.423203793  0.191251409
 [41] -0.006559531 -0.243502474 -0.869982269 -0.181879795 -1.068360281
 [46] -1.012797250 -0.745638273  0.424433239  0.887253619  0.382453091
 [51]  0.031444725 -0.347772650 -1.225926689 -1.730504284 -0.269208626
 [56]  0.005994374 -1.002678446  0.185127169  0.765549936  1.844200143
 [61] -0.085365194  0.194945468  0.408103150  0.518909927 -0.858581107
 [66] -0.504214482 -1.575527826  0.782700380 -1.037705977 -1.171474702
 [71] -1.064099843 -0.547789302 -1.341071030  0.574166852 -0.067217270
 [76]  0.217187172 -0.145073727  0.411606773 -0.095351999 -0.414048279
 [81] -0.012071631  0.481374732  0.644976502  0.612140101 -0.350488896
 [86]  0.510780369 -0.563299708 -0.373112267  0.917033381  1.547131231
 [91] -0.688939239 -0.247871708 -1.668748171 -1.079038072  0.080269353
 [96]  0.739135583 -1.022820157  2.345302767 -0.528416745  0.572706763
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.008366860 -0.660223364 -0.731874816 -1.600511843 -0.726895955
  [6] -0.773116738  1.137189255  1.005466620 -0.748645838  1.282169133
 [11] -0.087082535 -0.086680636 -1.094002457  1.505114111 -1.019362678
 [16] -1.295805848  0.352702192  0.216368219  0.292958439 -1.419715004
 [21]  0.121582550 -0.585383212  0.066332825  1.901214619  0.925064184
 [26] -1.161820824  1.134249549 -0.674626272  0.168486641 -0.322001490
 [31] -1.207697709 -1.380877102 -1.041245248  0.650395835 -0.898665212
 [36] -0.279240257 -0.204305784 -0.422938358  1.423203793  0.191251409
 [41] -0.006559531 -0.243502474 -0.869982269 -0.181879795 -1.068360281
 [46] -1.012797250 -0.745638273  0.424433239  0.887253619  0.382453091
 [51]  0.031444725 -0.347772650 -1.225926689 -1.730504284 -0.269208626
 [56]  0.005994374 -1.002678446  0.185127169  0.765549936  1.844200143
 [61] -0.085365194  0.194945468  0.408103150  0.518909927 -0.858581107
 [66] -0.504214482 -1.575527826  0.782700380 -1.037705977 -1.171474702
 [71] -1.064099843 -0.547789302 -1.341071030  0.574166852 -0.067217270
 [76]  0.217187172 -0.145073727  0.411606773 -0.095351999 -0.414048279
 [81] -0.012071631  0.481374732  0.644976502  0.612140101 -0.350488896
 [86]  0.510780369 -0.563299708 -0.373112267  0.917033381  1.547131231
 [91] -0.688939239 -0.247871708 -1.668748171 -1.079038072  0.080269353
 [96]  0.739135583 -1.022820157  2.345302767 -0.528416745  0.572706763
> colMin(tmp)
  [1]  1.008366860 -0.660223364 -0.731874816 -1.600511843 -0.726895955
  [6] -0.773116738  1.137189255  1.005466620 -0.748645838  1.282169133
 [11] -0.087082535 -0.086680636 -1.094002457  1.505114111 -1.019362678
 [16] -1.295805848  0.352702192  0.216368219  0.292958439 -1.419715004
 [21]  0.121582550 -0.585383212  0.066332825  1.901214619  0.925064184
 [26] -1.161820824  1.134249549 -0.674626272  0.168486641 -0.322001490
 [31] -1.207697709 -1.380877102 -1.041245248  0.650395835 -0.898665212
 [36] -0.279240257 -0.204305784 -0.422938358  1.423203793  0.191251409
 [41] -0.006559531 -0.243502474 -0.869982269 -0.181879795 -1.068360281
 [46] -1.012797250 -0.745638273  0.424433239  0.887253619  0.382453091
 [51]  0.031444725 -0.347772650 -1.225926689 -1.730504284 -0.269208626
 [56]  0.005994374 -1.002678446  0.185127169  0.765549936  1.844200143
 [61] -0.085365194  0.194945468  0.408103150  0.518909927 -0.858581107
 [66] -0.504214482 -1.575527826  0.782700380 -1.037705977 -1.171474702
 [71] -1.064099843 -0.547789302 -1.341071030  0.574166852 -0.067217270
 [76]  0.217187172 -0.145073727  0.411606773 -0.095351999 -0.414048279
 [81] -0.012071631  0.481374732  0.644976502  0.612140101 -0.350488896
 [86]  0.510780369 -0.563299708 -0.373112267  0.917033381  1.547131231
 [91] -0.688939239 -0.247871708 -1.668748171 -1.079038072  0.080269353
 [96]  0.739135583 -1.022820157  2.345302767 -0.528416745  0.572706763
> colMedians(tmp)
  [1]  1.008366860 -0.660223364 -0.731874816 -1.600511843 -0.726895955
  [6] -0.773116738  1.137189255  1.005466620 -0.748645838  1.282169133
 [11] -0.087082535 -0.086680636 -1.094002457  1.505114111 -1.019362678
 [16] -1.295805848  0.352702192  0.216368219  0.292958439 -1.419715004
 [21]  0.121582550 -0.585383212  0.066332825  1.901214619  0.925064184
 [26] -1.161820824  1.134249549 -0.674626272  0.168486641 -0.322001490
 [31] -1.207697709 -1.380877102 -1.041245248  0.650395835 -0.898665212
 [36] -0.279240257 -0.204305784 -0.422938358  1.423203793  0.191251409
 [41] -0.006559531 -0.243502474 -0.869982269 -0.181879795 -1.068360281
 [46] -1.012797250 -0.745638273  0.424433239  0.887253619  0.382453091
 [51]  0.031444725 -0.347772650 -1.225926689 -1.730504284 -0.269208626
 [56]  0.005994374 -1.002678446  0.185127169  0.765549936  1.844200143
 [61] -0.085365194  0.194945468  0.408103150  0.518909927 -0.858581107
 [66] -0.504214482 -1.575527826  0.782700380 -1.037705977 -1.171474702
 [71] -1.064099843 -0.547789302 -1.341071030  0.574166852 -0.067217270
 [76]  0.217187172 -0.145073727  0.411606773 -0.095351999 -0.414048279
 [81] -0.012071631  0.481374732  0.644976502  0.612140101 -0.350488896
 [86]  0.510780369 -0.563299708 -0.373112267  0.917033381  1.547131231
 [91] -0.688939239 -0.247871708 -1.668748171 -1.079038072  0.080269353
 [96]  0.739135583 -1.022820157  2.345302767 -0.528416745  0.572706763
> colRanges(tmp)
         [,1]       [,2]       [,3]      [,4]      [,5]       [,6]     [,7]
[1,] 1.008367 -0.6602234 -0.7318748 -1.600512 -0.726896 -0.7731167 1.137189
[2,] 1.008367 -0.6602234 -0.7318748 -1.600512 -0.726896 -0.7731167 1.137189
         [,8]       [,9]    [,10]       [,11]       [,12]     [,13]    [,14]
[1,] 1.005467 -0.7486458 1.282169 -0.08708253 -0.08668064 -1.094002 1.505114
[2,] 1.005467 -0.7486458 1.282169 -0.08708253 -0.08668064 -1.094002 1.505114
         [,15]     [,16]     [,17]     [,18]     [,19]     [,20]     [,21]
[1,] -1.019363 -1.295806 0.3527022 0.2163682 0.2929584 -1.419715 0.1215826
[2,] -1.019363 -1.295806 0.3527022 0.2163682 0.2929584 -1.419715 0.1215826
          [,22]      [,23]    [,24]     [,25]     [,26]   [,27]      [,28]
[1,] -0.5853832 0.06633282 1.901215 0.9250642 -1.161821 1.13425 -0.6746263
[2,] -0.5853832 0.06633282 1.901215 0.9250642 -1.161821 1.13425 -0.6746263
         [,29]      [,30]     [,31]     [,32]     [,33]     [,34]      [,35]
[1,] 0.1684866 -0.3220015 -1.207698 -1.380877 -1.041245 0.6503958 -0.8986652
[2,] 0.1684866 -0.3220015 -1.207698 -1.380877 -1.041245 0.6503958 -0.8986652
          [,36]      [,37]      [,38]    [,39]     [,40]        [,41]
[1,] -0.2792403 -0.2043058 -0.4229384 1.423204 0.1912514 -0.006559531
[2,] -0.2792403 -0.2043058 -0.4229384 1.423204 0.1912514 -0.006559531
          [,42]      [,43]      [,44]    [,45]     [,46]      [,47]     [,48]
[1,] -0.2435025 -0.8699823 -0.1818798 -1.06836 -1.012797 -0.7456383 0.4244332
[2,] -0.2435025 -0.8699823 -0.1818798 -1.06836 -1.012797 -0.7456383 0.4244332
         [,49]     [,50]      [,51]      [,52]     [,53]     [,54]      [,55]
[1,] 0.8872536 0.3824531 0.03144473 -0.3477727 -1.225927 -1.730504 -0.2692086
[2,] 0.8872536 0.3824531 0.03144473 -0.3477727 -1.225927 -1.730504 -0.2692086
           [,56]     [,57]     [,58]     [,59]  [,60]       [,61]     [,62]
[1,] 0.005994374 -1.002678 0.1851272 0.7655499 1.8442 -0.08536519 0.1949455
[2,] 0.005994374 -1.002678 0.1851272 0.7655499 1.8442 -0.08536519 0.1949455
         [,63]     [,64]      [,65]      [,66]     [,67]     [,68]     [,69]
[1,] 0.4081031 0.5189099 -0.8585811 -0.5042145 -1.575528 0.7827004 -1.037706
[2,] 0.4081031 0.5189099 -0.8585811 -0.5042145 -1.575528 0.7827004 -1.037706
         [,70]   [,71]      [,72]     [,73]     [,74]       [,75]     [,76]
[1,] -1.171475 -1.0641 -0.5477893 -1.341071 0.5741669 -0.06721727 0.2171872
[2,] -1.171475 -1.0641 -0.5477893 -1.341071 0.5741669 -0.06721727 0.2171872
          [,77]     [,78]     [,79]      [,80]       [,81]     [,82]     [,83]
[1,] -0.1450737 0.4116068 -0.095352 -0.4140483 -0.01207163 0.4813747 0.6449765
[2,] -0.1450737 0.4116068 -0.095352 -0.4140483 -0.01207163 0.4813747 0.6449765
         [,84]      [,85]     [,86]      [,87]      [,88]     [,89]    [,90]
[1,] 0.6121401 -0.3504889 0.5107804 -0.5632997 -0.3731123 0.9170334 1.547131
[2,] 0.6121401 -0.3504889 0.5107804 -0.5632997 -0.3731123 0.9170334 1.547131
          [,91]      [,92]     [,93]     [,94]      [,95]     [,96]    [,97]
[1,] -0.6889392 -0.2478717 -1.668748 -1.079038 0.08026935 0.7391356 -1.02282
[2,] -0.6889392 -0.2478717 -1.668748 -1.079038 0.08026935 0.7391356 -1.02282
        [,98]      [,99]    [,100]
[1,] 2.345303 -0.5284167 0.5727068
[2,] 2.345303 -0.5284167 0.5727068
> 
> 
> Max(tmp2)
[1] 3.22616
> Min(tmp2)
[1] -2.261343
> mean(tmp2)
[1] 0.1672924
> Sum(tmp2)
[1] 16.72924
> Var(tmp2)
[1] 1.020678
> 
> rowMeans(tmp2)
  [1] -0.843131683 -2.261342518  1.360261944 -0.117251787  0.369379507
  [6] -0.796833305  0.573733012  2.281323224  0.300588514 -0.160516493
 [11] -0.008116385  2.158702875  0.745587735 -0.630448007 -2.051004343
 [16] -0.080734091  0.023203405 -0.782256835  0.598588914 -0.296979622
 [21]  1.101818047 -1.152552673  0.045304050  3.226159835  1.190449196
 [26] -0.827313198 -0.772841930 -1.196342814 -0.352328218 -0.185303443
 [31] -1.836558269 -0.137262758 -0.222192320 -1.442788364  0.730199980
 [36] -1.129871280 -0.386922065  1.604000830 -0.589132812  1.070434841
 [41]  0.596984563 -0.810392990  1.549871275  1.718052506  0.115980990
 [46]  2.054429864  0.741450005 -0.814847962  0.144879415 -0.242694136
 [51] -0.126743301  0.189224809  1.323954798  2.686003721  1.012634100
 [56] -0.904981479  0.312398695 -2.054034500 -0.952100109  1.063543800
 [61] -0.166788719 -0.772386506  0.724961017  0.260234603  0.433613843
 [66] -0.084593290  0.738312429  0.614378740 -0.113123237 -0.826814072
 [71]  0.748485986  0.262418513  1.017878506  0.306834156 -0.998142008
 [76]  0.444142725  1.281368752 -0.411084320  1.079599663 -0.485564222
 [81] -0.573476283 -0.267370706  0.302468931  0.692543923  1.026682653
 [86]  0.568594933  0.020109781  0.092441568 -0.380364497  0.533465527
 [91]  0.441993372  0.967769079  0.487094137  0.141801001  0.175642213
 [96]  2.566080642  0.358543919 -0.689539924  0.078883106 -0.591177104
> rowSums(tmp2)
  [1] -0.843131683 -2.261342518  1.360261944 -0.117251787  0.369379507
  [6] -0.796833305  0.573733012  2.281323224  0.300588514 -0.160516493
 [11] -0.008116385  2.158702875  0.745587735 -0.630448007 -2.051004343
 [16] -0.080734091  0.023203405 -0.782256835  0.598588914 -0.296979622
 [21]  1.101818047 -1.152552673  0.045304050  3.226159835  1.190449196
 [26] -0.827313198 -0.772841930 -1.196342814 -0.352328218 -0.185303443
 [31] -1.836558269 -0.137262758 -0.222192320 -1.442788364  0.730199980
 [36] -1.129871280 -0.386922065  1.604000830 -0.589132812  1.070434841
 [41]  0.596984563 -0.810392990  1.549871275  1.718052506  0.115980990
 [46]  2.054429864  0.741450005 -0.814847962  0.144879415 -0.242694136
 [51] -0.126743301  0.189224809  1.323954798  2.686003721  1.012634100
 [56] -0.904981479  0.312398695 -2.054034500 -0.952100109  1.063543800
 [61] -0.166788719 -0.772386506  0.724961017  0.260234603  0.433613843
 [66] -0.084593290  0.738312429  0.614378740 -0.113123237 -0.826814072
 [71]  0.748485986  0.262418513  1.017878506  0.306834156 -0.998142008
 [76]  0.444142725  1.281368752 -0.411084320  1.079599663 -0.485564222
 [81] -0.573476283 -0.267370706  0.302468931  0.692543923  1.026682653
 [86]  0.568594933  0.020109781  0.092441568 -0.380364497  0.533465527
 [91]  0.441993372  0.967769079  0.487094137  0.141801001  0.175642213
 [96]  2.566080642  0.358543919 -0.689539924  0.078883106 -0.591177104
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.843131683 -2.261342518  1.360261944 -0.117251787  0.369379507
  [6] -0.796833305  0.573733012  2.281323224  0.300588514 -0.160516493
 [11] -0.008116385  2.158702875  0.745587735 -0.630448007 -2.051004343
 [16] -0.080734091  0.023203405 -0.782256835  0.598588914 -0.296979622
 [21]  1.101818047 -1.152552673  0.045304050  3.226159835  1.190449196
 [26] -0.827313198 -0.772841930 -1.196342814 -0.352328218 -0.185303443
 [31] -1.836558269 -0.137262758 -0.222192320 -1.442788364  0.730199980
 [36] -1.129871280 -0.386922065  1.604000830 -0.589132812  1.070434841
 [41]  0.596984563 -0.810392990  1.549871275  1.718052506  0.115980990
 [46]  2.054429864  0.741450005 -0.814847962  0.144879415 -0.242694136
 [51] -0.126743301  0.189224809  1.323954798  2.686003721  1.012634100
 [56] -0.904981479  0.312398695 -2.054034500 -0.952100109  1.063543800
 [61] -0.166788719 -0.772386506  0.724961017  0.260234603  0.433613843
 [66] -0.084593290  0.738312429  0.614378740 -0.113123237 -0.826814072
 [71]  0.748485986  0.262418513  1.017878506  0.306834156 -0.998142008
 [76]  0.444142725  1.281368752 -0.411084320  1.079599663 -0.485564222
 [81] -0.573476283 -0.267370706  0.302468931  0.692543923  1.026682653
 [86]  0.568594933  0.020109781  0.092441568 -0.380364497  0.533465527
 [91]  0.441993372  0.967769079  0.487094137  0.141801001  0.175642213
 [96]  2.566080642  0.358543919 -0.689539924  0.078883106 -0.591177104
> rowMin(tmp2)
  [1] -0.843131683 -2.261342518  1.360261944 -0.117251787  0.369379507
  [6] -0.796833305  0.573733012  2.281323224  0.300588514 -0.160516493
 [11] -0.008116385  2.158702875  0.745587735 -0.630448007 -2.051004343
 [16] -0.080734091  0.023203405 -0.782256835  0.598588914 -0.296979622
 [21]  1.101818047 -1.152552673  0.045304050  3.226159835  1.190449196
 [26] -0.827313198 -0.772841930 -1.196342814 -0.352328218 -0.185303443
 [31] -1.836558269 -0.137262758 -0.222192320 -1.442788364  0.730199980
 [36] -1.129871280 -0.386922065  1.604000830 -0.589132812  1.070434841
 [41]  0.596984563 -0.810392990  1.549871275  1.718052506  0.115980990
 [46]  2.054429864  0.741450005 -0.814847962  0.144879415 -0.242694136
 [51] -0.126743301  0.189224809  1.323954798  2.686003721  1.012634100
 [56] -0.904981479  0.312398695 -2.054034500 -0.952100109  1.063543800
 [61] -0.166788719 -0.772386506  0.724961017  0.260234603  0.433613843
 [66] -0.084593290  0.738312429  0.614378740 -0.113123237 -0.826814072
 [71]  0.748485986  0.262418513  1.017878506  0.306834156 -0.998142008
 [76]  0.444142725  1.281368752 -0.411084320  1.079599663 -0.485564222
 [81] -0.573476283 -0.267370706  0.302468931  0.692543923  1.026682653
 [86]  0.568594933  0.020109781  0.092441568 -0.380364497  0.533465527
 [91]  0.441993372  0.967769079  0.487094137  0.141801001  0.175642213
 [96]  2.566080642  0.358543919 -0.689539924  0.078883106 -0.591177104
> 
> colMeans(tmp2)
[1] 0.1672924
> colSums(tmp2)
[1] 16.72924
> colVars(tmp2)
[1] 1.020678
> colSd(tmp2)
[1] 1.010286
> colMax(tmp2)
[1] 3.22616
> colMin(tmp2)
[1] -2.261343
> colMedians(tmp2)
[1] 0.128891
> colRanges(tmp2)
          [,1]
[1,] -2.261343
[2,]  3.226160
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.7287788 -1.2682285  0.7847501  3.7767450 -3.8219407 -6.9765803
 [7]  4.4046977  1.1189583 -4.3527089 -2.9064128
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5825262
[2,] -0.9055092
[3,] -0.5222159
[4,]  0.1172753
[5,]  1.5039468
> 
> rowApply(tmp,sum)
 [1]  2.8759150 -2.3634473  0.9349929 -0.2767253 -3.1983835 -5.6275946
 [7]  3.3391493 -4.8231833 -3.4849229 -0.3452992
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5   10    2    3    4    6    4    4    2     7
 [2,]    1    7    7    8   10    8    2    3    5    10
 [3,]    7    4    8    7    1    9   10    7    7     3
 [4,]    9    6    9    9    9    2    3    5    9     9
 [5,]    6    5    1    1    2    5    7    9    3     8
 [6,]    2    2    4    5    3    1    5    6    1     5
 [7,]    4    9    5    4    8    7    9   10   10     4
 [8,]    3    8    3   10    7    3    6    2    8     1
 [9,]    8    1   10    2    5    4    8    1    6     6
[10,]   10    3    6    6    6   10    1    8    4     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.62963319 -1.09373340  0.32668055  2.82960273  0.39467634  1.77668048
 [7] -3.09920493 -3.68273906  1.07898417 -0.51469219  5.59857071 -4.32515211
[13] -0.24850530  1.80638109 -1.06002245 -1.99677329 -4.26543101  0.60029144
[19]  2.21818102  0.09472125
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.34622502
[2,] -0.01726428
[3,]  0.71378463
[4,]  1.09287334
[5,]  1.18646451
> 
> rowApply(tmp,sum)
[1] -0.2788715 -0.4855312  1.1273810  1.2916259 -2.5864549
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   17   19    8    9   15
[2,]    7    5   15   16    4
[3,]   15    6   13   18    7
[4,]   19    9   10   14   19
[5,]   18    4   12    7   13
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]        [,4]        [,5]       [,6]
[1,]  1.09287334 -0.4049660  0.46988904  1.35310565  1.09409427 0.42418556
[2,]  1.18646451 -0.7159144 -0.55318429 -0.01016668 -0.72170545 0.15970896
[3,] -0.34622502  0.4340147  0.06966468 -0.09505828  0.04769254 0.33781989
[4,] -0.01726428  0.5626867  0.97938714  0.45446579 -0.52645086 0.08282449
[5,]  0.71378463 -0.9695544 -0.63907602  1.12725625  0.50104583 0.77214159
           [,7]       [,8]       [,9]      [,10]     [,11]      [,12]
[1,] -0.1588904 -1.1952181  2.2931616  0.1743775 0.3444362 -2.4114591
[2,] -1.5180636  0.1335503 -1.5863528  0.1049363 0.7556555  0.7402338
[3,] -1.6767685 -0.9678868  1.4452508 -1.6173144 0.9559003 -0.6517510
[4,] -0.0871291 -0.9364420  0.4454513  1.5218697 2.7650169  0.5271120
[5,]  0.3416466 -0.7167425 -1.5185268 -0.6985614 0.7775618 -2.5292877
          [,13]       [,14]      [,15]       [,16]      [,17]      [,18]
[1,]  0.0490764 -0.91896199  0.2072241 -0.57458963  0.5905635 -1.4169251
[2,] -0.5033736  0.22201853  0.9255181  0.58511221 -2.3231731 -0.4551629
[3,]  1.3990106  2.79205061 -0.6032268 -0.01470377 -0.6727847  1.0908578
[4,] -0.7724039  0.09904473 -1.7757052 -0.78023468 -1.3877918  0.8746642
[5,] -0.4208148 -0.38777078  0.1861674 -1.21235744 -0.4722449  0.5068574
            [,19]      [,20]
[1,]  0.006960105 -1.2978085
[2,]  2.018560139  1.0698073
[3,] -0.641421967 -0.1577397
[4,]  0.093783065 -0.8312583
[5,]  0.740299674  1.3117205
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1      col2      col3      col4       col5       col6      col7
row1 1.560761 -2.227638 0.7343003 0.8160182 -0.9531362 -0.8348134 0.5647724
          col8      col9     col10      col11     col12      col13      col14
row1 -1.138229 -0.677785 0.7283742 -0.5289354 -0.513763 -0.8259163 -0.5482636
          col15   col16     col17      col18    col19      col20
row1 -0.9040888 1.75939 0.6889673 -0.1515384 1.010652 -0.9000767
> tmp[,"col10"]
         col10
row1 0.7283742
row2 0.4943754
row3 0.1423927
row4 0.3337747
row5 0.9478585
> tmp[c("row1","row5"),]
           col1       col2       col3      col4       col5       col6      col7
row1 1.56076088 -2.2276377  0.7343003 0.8160182 -0.9531362 -0.8348134 0.5647724
row5 0.07530029 -0.6067194 -1.4228944 0.6121207  0.9489187 -0.6800761 0.7136725
          col8        col9     col10      col11      col12      col13
row1 -1.138229 -0.67778501 0.7283742 -0.5289354 -0.5137630 -0.8259163
row5 -1.119054  0.05039458 0.9478585 -0.5364042  0.4778971 -0.7834050
          col14      col15       col16      col17      col18    col19
row1 -0.5482636 -0.9040888  1.75938954  0.6889673 -0.1515384 1.010652
row5  1.9961514  1.2094478 -0.06692297 -1.2453832 -1.0789843 1.981166
          col20
row1 -0.9000767
row5 -0.8475176
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.8348134 -0.9000767
row2 -0.2688113 -0.6420509
row3  1.2394423  1.8143149
row4  1.9232969 -0.4352030
row5 -0.6800761 -0.8475176
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.8348134 -0.9000767
row5 -0.6800761 -0.8475176
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.42153 52.95247 50.13644 49.92329 49.51604 105.4168 49.01755 49.94726
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.00968 49.29011 49.95791 50.67348 49.11198 50.64576 50.23766 50.28303
        col17    col18    col19    col20
row1 49.86387 51.00736 50.97274 106.2955
> tmp[,"col10"]
        col10
row1 49.29011
row2 30.93523
row3 31.96567
row4 29.70311
row5 50.74541
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.42153 52.95247 50.13644 49.92329 49.51604 105.4168 49.01755 49.94726
row5 51.05350 49.08838 48.80910 50.12460 51.41715 105.6012 50.74717 49.89703
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.00968 49.29011 49.95791 50.67348 49.11198 50.64576 50.23766 50.28303
row5 49.81414 50.74541 50.67842 47.87076 52.00693 50.10250 50.59851 50.58774
        col17    col18    col19    col20
row1 49.86387 51.00736 50.97274 106.2955
row5 49.65112 48.97045 50.80640 105.0310
> tmp[,c("col6","col20")]
          col6     col20
row1 105.41681 106.29551
row2  74.78551  75.49944
row3  75.59092  75.59144
row4  74.91124  74.37031
row5 105.60124 105.03096
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.4168 106.2955
row5 105.6012 105.0310
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.4168 106.2955
row5 105.6012 105.0310
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.2913066
[2,]  0.1573114
[3,]  1.3627402
[4,] -0.5237721
[5,] -1.6638343
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.7478404  2.31109557
[2,]  0.8325439  0.04256513
[3,] -1.3183058  0.44129850
[4,]  0.1789046 -0.29803754
[5,]  1.5855867 -0.94276138
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
              col6      col20
[1,] -0.5846113290 -0.4653897
[2,] -0.2292709531  0.1207144
[3,]  0.2271822366  0.4574996
[4,] -0.0006072697  0.2890214
[5,] -0.6187289691  0.2826924
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5846113
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5846113
[2,] -0.2292710
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]        [,3]       [,4]       [,5]      [,6]      [,7]
row3 -1.133553  0.6032880 0.009040939 -0.8484622  0.9141849 0.8146725 0.7466813
row1 -0.778686 -0.4165583 0.357192048  1.3474496 -0.6458939 1.8905120 1.2997143
          [,8]       [,9]      [,10]      [,11]      [,12]       [,13]
row3 0.8880593  0.4506743 -0.7117383 -0.5410923  0.7979781 -0.08148468
row1 1.0295359 -1.0255631 -1.0474236 -1.1919968 -0.8223794 -0.85168291
          [,14]       [,15]     [,16]       [,17]       [,18]      [,19]
row3 -0.3124691 -2.15311335 -0.473741 -0.04688907 -0.07194105  0.1041203
row1  0.5921093  0.06659216  0.418663  2.17776042 -0.13656299 -0.9160959
          [,20]
row3 -1.3857187
row1  0.0833961
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]      [,3]        [,4]      [,5]       [,6]       [,7]
row2 0.4157898 1.471738 -2.200187 -0.05613088 -0.734187 0.09462525 -0.1957188
           [,8]      [,9]      [,10]
row2 -0.0206465 -1.582721 0.06721803
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]     [,4]    [,5]       [,6]        [,7]
row5 -0.2325008 0.6624616 -1.604254 1.664776 2.06725 -0.4387709 -0.08151472
           [,8]      [,9]     [,10]     [,11]     [,12]     [,13]     [,14]
row5 -0.8394729 0.6830196 -1.208584 -1.056124 0.4880475 -2.646615 0.1627072
        [,15]      [,16]     [,17]      [,18]     [,19]       [,20]
row5 2.234819 -0.4977292 0.8907929 -0.1111734 0.3229479 -0.05897577
> 
> 
> 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: 0x56562b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2150982367bdba"
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM21509814398bf9"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM215098c80b56c" 
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM215098647ef17" 
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2150982de99db9"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM21509836d244b" 
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2150984b305728"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2150982bc9ff50"
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM21509832b0da84"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM2150982f21e6d9"
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM21509857bb56ea"
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM215098788491de"
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM21509849758983"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM21509840eeab44"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM215098db6d66d" 
> 
> 
> ### 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: 0x5a4b680>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5a4b680>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5a4b680>
> rowMedians(tmp)
  [1] -0.2206542308 -0.0037252060  0.3495263659  0.2083355944  0.2995127503
  [6]  0.2302335463 -0.3301870209  0.3297561665  0.0229323747  0.5158983678
 [11]  0.6392083778  0.0158087302 -0.1889215528 -0.4288753421 -0.3189706577
 [16] -0.5358567812  0.2520779081 -0.2364324024 -0.1842036926  0.2115033596
 [21]  0.1474499351  0.3496108161  0.1545086704 -0.2675689858  0.4946839905
 [26] -0.1487936672 -0.3656803293  0.2245176883  0.3620414988 -0.4061240674
 [31]  0.0734648966 -0.2869651997 -0.1135606858  0.3408754235 -0.0515108655
 [36] -0.6676032883  0.5447530742 -0.6200809251 -0.1118164034 -0.0587273736
 [41]  0.1294507068  0.4115257473  0.3109824372  0.1217679293  0.3242659890
 [46] -0.2661394082 -0.1186417516 -0.2662314826  0.0432816994  0.0907928051
 [51]  0.1899799740  0.0699625540  0.1524798367 -0.1254029852  0.2256063616
 [56] -0.0005447252 -0.1202733263 -0.7317062385  0.2471178641  0.2136098496
 [61]  0.1523574206  0.2005978051 -0.5338737828 -0.3642848106  0.4682033376
 [66] -0.0803305846  0.0885024769  0.3516039814 -0.0893127632 -0.2895839853
 [71]  0.0710619143 -0.2441866612  0.1616644277  0.1050957192  0.0330002663
 [76] -0.1766309553  0.1381099238 -0.5324652338  0.0148275864  0.3908542283
 [81] -0.1839325884  0.1501831042  0.3712511170 -0.0321881231  0.3614183463
 [86] -0.1395144759  0.1326255291 -0.0895915082 -0.0260959920  0.6164537025
 [91] -0.3558062866 -0.2695466042 -0.1076949560 -0.4584290654 -0.2024537638
 [96]  0.7104111591 -0.4032783920  0.4862723852  0.0763748414 -0.1759448226
[101]  0.4885864651 -0.0137084742 -0.1322114716  0.3177930074 -0.1574704495
[106]  0.1326130879 -0.1301061760 -0.0970210839 -0.2972497860  0.0143944458
[111]  0.5019884681  0.2026556543  0.0524694068  0.4790781133 -0.1264709025
[116] -0.2630399302  0.4573754521 -0.2635503855  0.3134150405  0.1389880511
[121] -0.0985230694 -0.1705183017  0.3608867646 -0.1986095512  0.5577353417
[126]  0.5692337479  0.0306285404 -0.5933088539 -0.0707446645  0.2461010962
[131]  0.1476342936 -0.5820744245  0.2946942580  0.1533269435  0.4923437084
[136]  0.0151392024  0.1049752543 -0.6032896615 -0.3652442431 -0.3175113998
[141] -0.2240142581 -0.3095755478 -0.1188954770  0.2289781115  0.2886919671
[146]  0.1816824628  0.0579579839  0.3957078607  0.2136582346  0.2960143264
[151] -0.3444590866 -0.3279775440  0.4180775718 -0.3566855078  0.3617914762
[156] -0.1467718366 -0.1215732939 -0.4293108471  0.3063697696  0.1985980080
[161]  0.1857716793 -0.0032364204 -0.6515833570 -0.7343582054  0.2624720461
[166]  0.3546253099 -0.3139491746  0.0642803525  0.2658124194  0.4315959392
[171]  0.0035920945  0.0360929420  0.0182305956  0.2975633754  0.1171720913
[176] -0.2111609685  0.0823498433  0.5131270296 -0.1735584772 -0.1738975290
[181]  0.1772300518 -0.0200352371 -0.1099019926 -0.2098838410  0.7044904951
[186]  0.6652815310 -0.0632629543 -0.5436068859  0.0296241846  0.1535391278
[191]  0.6319666785  0.5759746935  0.4643814552 -0.3721790374 -0.3757122782
[196] -0.2346718639 -0.0671327615  0.2865903860 -0.0689747464 -0.6383043009
[201]  0.4242611673  0.2460195148 -0.3174300476  0.1116085045  0.1174112400
[206] -0.4816459300  0.0412313732 -0.1040720370  0.2078726696  0.2419109921
[211]  0.0626656961  0.5796205141 -0.2545735557 -0.0262663660  0.1028095900
[216]  0.2286656828 -0.3683836790 -0.0549800736  0.3194259149  0.2980102765
[221]  0.6929197771 -0.4744049279 -0.4111181530 -0.2762402351  0.1545020883
[226] -0.0445066934 -0.2162307611 -0.8035602393 -0.1725590711 -0.2545053124
> 
> proc.time()
   user  system elapsed 
  1.915   0.853   2.799 

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: 0x39c036e0>
> .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: 0x39c036e0>
> .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: 0x39c036e0>
> .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: 0x39c036e0>
> 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: 0x39c4b6a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x39c4b6a0>
> .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: 0x39c4b6a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x39c4b6a0>
> .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: 0x39c4b6a0>
> 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: 0x38e077d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x38e077d0>
> .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: 0x38e077d0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x38e077d0>
> .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: 0x38e077d0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x38e077d0>
> .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: 0x38e077d0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x38e077d0>
> .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: 0x38e077d0>
> 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: 0x39966d70>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x39966d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x39966d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x39966d70>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2150d55b6011d7" "BufferedMatrixFile2150d572c4655f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2150d55b6011d7" "BufferedMatrixFile2150d572c4655f"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x39509cd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x39509cd0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x39509cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x39509cd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x39509cd0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x39509cd0>
> .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: 0x38478a10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x38478a10>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x38478a10>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x38478a10>
> 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: 0x3a392cc0>
> .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: 0x3a392cc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.347   0.041   0.373 

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.335   0.037   0.358 

Example timings