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

This page was generated on 2025-08-22 12:06 -0400 (Fri, 22 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4821
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4599
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4541
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4539
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/2319HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-21 13:45 -0400 (Thu, 21 Aug 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson3

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.

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-08-21 18:26:56 -0400 (Thu, 21 Aug 2025)
EndedAt: 2025-08-21 18:27:13 -0400 (Thu, 21 Aug 2025)
EllapsedTime: 16.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-06-14 r88325)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.7
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.sdk’
* 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 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 sizes of PDF files under ‘inst/doc’ ... OK
* 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: 1 WARNING, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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.119   0.036   0.152 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480828 25.7    1056621 56.5         NA   634345 33.9
Vcells 891019  6.8    8388608 64.0     196608  2109860 16.1
> 
> 
> 
> 
> ##
> ## 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] "Thu Aug 21 18:27:05 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] "Thu Aug 21 18:27:05 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: 0x600002ce8000>
> 
> 
> 
> 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] "Thu Aug 21 18:27:06 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] "Thu Aug 21 18:27:07 2025"
> 
> ColMode(tmp2)
<pointer: 0x600002ce8000>
> 
> 
> 
> ### 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.5821344  0.35395647  0.1305382  0.7253107
[2,] -0.4216381  0.80109307  2.5521365 -0.4404414
[3,] -0.7776395 -0.06729214 -1.4953353 -1.4865712
[4,] -0.2135513 -0.12370911  0.8417434 -0.6278315
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]      [,4]
[1,] 99.5821344 0.35395647 0.1305382 0.7253107
[2,]  0.4216381 0.80109307 2.5521365 0.4404414
[3,]  0.7776395 0.06729214 1.4953353 1.4865712
[4,]  0.2135513 0.12370911 0.8417434 0.6278315
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9790848 0.5949424 0.3613007 0.8516517
[2,] 0.6493366 0.8950380 1.5975408 0.6636576
[3,] 0.8818387 0.2594073 1.2228390 1.2192503
[4,] 0.4621161 0.3517231 0.9174657 0.7923582
> 
> 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:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.37298 31.30338 28.74355 34.24183
[2,]  31.91500 34.75147 43.52754 32.07702
[3,]  34.59603 27.66137 38.72373 38.67907
[4,]  29.83471 28.64094 35.01640 33.55141
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002cfc300>
> exp(tmp5)
<pointer: 0x600002cfc300>
> log(tmp5,2)
<pointer: 0x600002cfc300>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.003
> Min(tmp5)
[1] 54.32841
> mean(tmp5)
[1] 72.30324
> Sum(tmp5)
[1] 14460.65
> Var(tmp5)
[1] 858.0132
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.71339 69.50624 69.92938 67.63221 72.43514 70.74718 68.20302 71.80963
 [9] 72.41236 71.64386
> rowSums(tmp5)
 [1] 1774.268 1390.125 1398.588 1352.644 1448.703 1414.944 1364.060 1436.193
 [9] 1448.247 1432.877
> rowVars(tmp5)
 [1] 7969.59415   56.83063   96.78305   52.53864  100.41874   70.49949
 [7]   64.58613   67.17111  116.00817   50.53838
> rowSd(tmp5)
 [1] 89.272583  7.538610  9.837838  7.248354 10.020915  8.396397  8.036550
 [8]  8.195798 10.770709  7.109035
> rowMax(tmp5)
 [1] 467.00297  90.59688  90.86169  82.11805  91.66360  88.44808  84.21163
 [8]  89.61913  90.95653  82.48526
> rowMin(tmp5)
 [1] 57.85217 60.10992 54.50615 54.64201 54.47242 57.86681 57.16068 59.35394
 [9] 54.32841 60.22232
> 
> colMeans(tmp5)
 [1] 104.72932  67.89867  76.79592  72.16639  70.40079  68.22939  72.05781
 [8]  69.43152  70.22019  69.61190  70.82327  73.06843  67.32642  71.92486
[15]  66.82799  67.91943  71.97914  74.83276  68.41889  71.40175
> colSums(tmp5)
 [1] 1047.2932  678.9867  767.9592  721.6639  704.0079  682.2939  720.5781
 [8]  694.3152  702.2019  696.1190  708.2327  730.6843  673.2642  719.2486
[15]  668.2799  679.1943  719.7914  748.3276  684.1889  714.0175
> colVars(tmp5)
 [1] 16257.30143    73.14632   135.16807    34.63085    40.90978   104.94285
 [7]    84.77728    40.86483    80.12812    45.64330    74.40222    74.32357
[13]   141.74244    42.80450    30.11218    56.04017    64.50142    62.23071
[19]   109.43593    51.35488
> colSd(tmp5)
 [1] 127.504123   8.552562  11.626180   5.884798   6.396075  10.244162
 [7]   9.207458   6.392560   8.951431   6.755982   8.625672   8.621112
[13]  11.905563   6.542515   5.487457   7.485998   8.031278   7.888644
[19]  10.461163   7.166232
> colMax(tmp5)
 [1] 467.00297  87.43833  90.59688  80.50542  79.12932  89.61913  86.12021
 [8]  79.70780  90.86169  82.22077  88.47921  90.95653  91.66360  82.61182
[15]  78.31775  81.68184  81.07161  84.21163  82.41080  84.11144
> colMin(tmp5)
 [1] 54.32841 57.57351 59.82592 65.05159 61.41229 57.85217 54.47242 57.55173
 [9] 59.12232 61.76682 59.72033 62.69676 54.50615 60.86959 57.97181 59.10172
[17] 60.14474 61.12814 54.64201 59.72968
> 
> 
> ### 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] 88.71339 69.50624 69.92938 67.63221 72.43514 70.74718       NA 71.80963
 [9] 72.41236 71.64386
> rowSums(tmp5)
 [1] 1774.268 1390.125 1398.588 1352.644 1448.703 1414.944       NA 1436.193
 [9] 1448.247 1432.877
> rowVars(tmp5)
 [1] 7969.59415   56.83063   96.78305   52.53864  100.41874   70.49949
 [7]   65.75175   67.17111  116.00817   50.53838
> rowSd(tmp5)
 [1] 89.272583  7.538610  9.837838  7.248354 10.020915  8.396397  8.108745
 [8]  8.195798 10.770709  7.109035
> rowMax(tmp5)
 [1] 467.00297  90.59688  90.86169  82.11805  91.66360  88.44808        NA
 [8]  89.61913  90.95653  82.48526
> rowMin(tmp5)
 [1] 57.85217 60.10992 54.50615 54.64201 54.47242 57.86681       NA 59.35394
 [9] 54.32841 60.22232
> 
> colMeans(tmp5)
 [1] 104.72932  67.89867  76.79592  72.16639  70.40079  68.22939  72.05781
 [8]  69.43152  70.22019        NA  70.82327  73.06843  67.32642  71.92486
[15]  66.82799  67.91943  71.97914  74.83276  68.41889  71.40175
> colSums(tmp5)
 [1] 1047.2932  678.9867  767.9592  721.6639  704.0079  682.2939  720.5781
 [8]  694.3152  702.2019        NA  708.2327  730.6843  673.2642  719.2486
[15]  668.2799  679.1943  719.7914  748.3276  684.1889  714.0175
> colVars(tmp5)
 [1] 16257.30143    73.14632   135.16807    34.63085    40.90978   104.94285
 [7]    84.77728    40.86483    80.12812          NA    74.40222    74.32357
[13]   141.74244    42.80450    30.11218    56.04017    64.50142    62.23071
[19]   109.43593    51.35488
> colSd(tmp5)
 [1] 127.504123   8.552562  11.626180   5.884798   6.396075  10.244162
 [7]   9.207458   6.392560   8.951431         NA   8.625672   8.621112
[13]  11.905563   6.542515   5.487457   7.485998   8.031278   7.888644
[19]  10.461163   7.166232
> colMax(tmp5)
 [1] 467.00297  87.43833  90.59688  80.50542  79.12932  89.61913  86.12021
 [8]  79.70780  90.86169        NA  88.47921  90.95653  91.66360  82.61182
[15]  78.31775  81.68184  81.07161  84.21163  82.41080  84.11144
> colMin(tmp5)
 [1] 54.32841 57.57351 59.82592 65.05159 61.41229 57.85217 54.47242 57.55173
 [9] 59.12232       NA 59.72033 62.69676 54.50615 60.86959 57.97181 59.10172
[17] 60.14474 61.12814 54.64201 59.72968
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.003
> Min(tmp5,na.rm=TRUE)
[1] 54.32841
> mean(tmp5,na.rm=TRUE)
[1] 72.35619
> Sum(tmp5,na.rm=TRUE)
[1] 14398.88
> Var(tmp5,na.rm=TRUE)
[1] 861.7831
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.71339 69.50624 69.92938 67.63221 72.43514 70.74718 68.54177 71.80963
 [9] 72.41236 71.64386
> rowSums(tmp5,na.rm=TRUE)
 [1] 1774.268 1390.125 1398.588 1352.644 1448.703 1414.944 1302.294 1436.193
 [9] 1448.247 1432.877
> rowVars(tmp5,na.rm=TRUE)
 [1] 7969.59415   56.83063   96.78305   52.53864  100.41874   70.49949
 [7]   65.75175   67.17111  116.00817   50.53838
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.272583  7.538610  9.837838  7.248354 10.020915  8.396397  8.108745
 [8]  8.195798 10.770709  7.109035
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.00297  90.59688  90.86169  82.11805  91.66360  88.44808  84.21163
 [8]  89.61913  90.95653  82.48526
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.85217 60.10992 54.50615 54.64201 54.47242 57.86681 57.16068 59.35394
 [9] 54.32841 60.22232
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 104.72932  67.89867  76.79592  72.16639  70.40079  68.22939  72.05781
 [8]  69.43152  70.22019  70.48358  70.82327  73.06843  67.32642  71.92486
[15]  66.82799  67.91943  71.97914  74.83276  68.41889  71.40175
> colSums(tmp5,na.rm=TRUE)
 [1] 1047.2932  678.9867  767.9592  721.6639  704.0079  682.2939  720.5781
 [8]  694.3152  702.2019  634.3522  708.2327  730.6843  673.2642  719.2486
[15]  668.2799  679.1943  719.7914  748.3276  684.1889  714.0175
> colVars(tmp5,na.rm=TRUE)
 [1] 16257.30143    73.14632   135.16807    34.63085    40.90978   104.94285
 [7]    84.77728    40.86483    80.12812    42.80075    74.40222    74.32357
[13]   141.74244    42.80450    30.11218    56.04017    64.50142    62.23071
[19]   109.43593    51.35488
> colSd(tmp5,na.rm=TRUE)
 [1] 127.504123   8.552562  11.626180   5.884798   6.396075  10.244162
 [7]   9.207458   6.392560   8.951431   6.542228   8.625672   8.621112
[13]  11.905563   6.542515   5.487457   7.485998   8.031278   7.888644
[19]  10.461163   7.166232
> colMax(tmp5,na.rm=TRUE)
 [1] 467.00297  87.43833  90.59688  80.50542  79.12932  89.61913  86.12021
 [8]  79.70780  90.86169  82.22077  88.47921  90.95653  91.66360  82.61182
[15]  78.31775  81.68184  81.07161  84.21163  82.41080  84.11144
> colMin(tmp5,na.rm=TRUE)
 [1] 54.32841 57.57351 59.82592 65.05159 61.41229 57.85217 54.47242 57.55173
 [9] 59.12232 64.22805 59.72033 62.69676 54.50615 60.86959 57.97181 59.10172
[17] 60.14474 61.12814 54.64201 59.72968
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.71339 69.50624 69.92938 67.63221 72.43514 70.74718      NaN 71.80963
 [9] 72.41236 71.64386
> rowSums(tmp5,na.rm=TRUE)
 [1] 1774.268 1390.125 1398.588 1352.644 1448.703 1414.944    0.000 1436.193
 [9] 1448.247 1432.877
> rowVars(tmp5,na.rm=TRUE)
 [1] 7969.59415   56.83063   96.78305   52.53864  100.41874   70.49949
 [7]         NA   67.17111  116.00817   50.53838
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.272583  7.538610  9.837838  7.248354 10.020915  8.396397        NA
 [8]  8.195798 10.770709  7.109035
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.00297  90.59688  90.86169  82.11805  91.66360  88.44808        NA
 [8]  89.61913  90.95653  82.48526
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.85217 60.10992 54.50615 54.64201 54.47242 57.86681       NA 59.35394
 [9] 54.32841 60.22232
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.78497  68.66521  78.56049  72.53985  70.09281  68.56927  72.10530
 [8]  70.33000  70.13027       NaN  71.70809  71.91709  68.45595  71.83392
[15]  66.82480  68.48892  72.80090  73.79067  67.07427  71.02010
> colSums(tmp5,na.rm=TRUE)
 [1] 988.0647 617.9869 707.0444 652.8586 630.8353 617.1234 648.9477 632.9700
 [9] 631.1724   0.0000 645.3728 647.2538 616.1035 646.5053 601.4232 616.4003
[17] 655.2081 664.1160 603.6684 639.1809
> colVars(tmp5,na.rm=TRUE)
 [1] 18001.91890    75.67928   117.03513    37.39067    44.95643   116.76111
 [7]    95.34907    36.89113    90.05317          NA    74.89468    68.70120
[13]   145.10714    48.06203    33.87609    59.39659    64.96719    57.79244
[19]   102.77552    56.13556
> colSd(tmp5,na.rm=TRUE)
 [1] 134.171230   8.699384  10.818278   6.114791   6.704956  10.805606
 [7]   9.764685   6.073807   9.489635         NA   8.654171   8.288619
[13]  12.046043   6.932678   5.820317   7.706919   8.060222   7.602134
[19]  10.137826   7.492366
> colMax(tmp5,na.rm=TRUE)
 [1] 467.00297  87.43833  90.59688  80.50542  79.12932  89.61913  86.12021
 [8]  79.70780  90.86169      -Inf  88.47921  90.95653  91.66360  82.61182
[15]  78.31775  81.68184  81.07161  83.29926  82.41080  84.11144
> colMin(tmp5,na.rm=TRUE)
 [1] 54.32841 57.57351 59.82592 65.05159 61.41229 57.85217 54.47242 57.55173
 [9] 59.12232      Inf 59.72033 62.69676 54.50615 60.86959 57.97181 59.10172
[17] 60.14474 61.12814 54.64201 59.72968
> 
> 
> 
> 
> 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] 267.74655 152.86204 242.83759 218.62334 401.15855  88.15682 186.44418
 [8] 268.34667 169.86912 173.72098
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 267.74655 152.86204 242.83759 218.62334 401.15855  88.15682 186.44418
 [8] 268.34667 169.86912 173.72098
> 
> 
> 
> 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]  2.842171e-14  1.136868e-13 -2.842171e-14 -2.842171e-14  5.684342e-14
 [6] -1.705303e-13 -2.842171e-14 -2.273737e-13  2.842171e-14 -1.705303e-13
[11]  0.000000e+00 -1.136868e-13 -2.842171e-14  0.000000e+00 -1.989520e-13
[16] -2.842171e-14 -5.684342e-14  1.136868e-13 -1.136868e-13  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
6   10 
4   15 
5   10 
4   7 
3   1 
2   19 
10   15 
6   1 
7   1 
2   14 
4   2 
4   9 
6   12 
7   14 
8   8 
9   10 
7   5 
4   9 
1   2 
3   9 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 1.99248
> Min(tmp)
[1] -2.490274
> mean(tmp)
[1] -0.02694016
> Sum(tmp)
[1] -2.694016
> Var(tmp)
[1] 0.797784
> 
> rowMeans(tmp)
[1] -0.02694016
> rowSums(tmp)
[1] -2.694016
> rowVars(tmp)
[1] 0.797784
> rowSd(tmp)
[1] 0.8931876
> rowMax(tmp)
[1] 1.99248
> rowMin(tmp)
[1] -2.490274
> 
> colMeans(tmp)
  [1]  0.438612461 -0.011014176 -0.036662539 -0.250662134  1.283470284
  [6] -0.743108110 -0.475930969 -0.154234061 -0.909799698  0.120066385
 [11] -0.471146328 -1.306078701 -0.359347827  1.588919607  0.609650490
 [16] -0.041970825 -0.519045792 -0.299927236 -1.915487019  0.891487310
 [21]  0.118554174 -0.457402191  0.464127502  0.159476958  0.431911800
 [26] -0.130894068  0.025232167  0.258570058  1.054101727 -0.715630977
 [31] -1.035540802  0.162845902  0.204477320  0.303049111  0.743628618
 [36]  0.036040889  1.892024592  0.103452055  0.621386237  0.658532551
 [41] -0.562782587  0.853123845 -0.584105063  0.851076019  0.886054923
 [46]  0.856238291 -0.556064763  0.218923810 -1.951566308 -1.229078853
 [51]  0.960642276 -0.322375001 -1.592664826  0.009525485  0.582701505
 [56] -1.238067716 -0.167090977 -0.730336927  1.143156054 -0.831198621
 [61] -2.032051212 -0.027025699 -0.974901679 -1.241296537  0.265886046
 [66]  1.164727862  0.375153864  0.394000424  0.555074032  0.623129515
 [71]  0.799493396 -0.975910383 -0.158936824 -1.580613832 -1.064626456
 [76] -0.647907157 -0.591109811  1.421808851 -2.490274047  0.220531485
 [81] -0.593268474  0.413318206  0.850886977 -1.525409546  0.401399971
 [86]  0.237144819  1.040530463  0.687322066  0.365346456  0.741943965
 [91] -0.179164354  0.926995618 -0.678708973 -0.072101707  0.441612992
 [96] -1.782104792  0.128226446 -0.350927817  1.293464490  1.992479775
> colSums(tmp)
  [1]  0.438612461 -0.011014176 -0.036662539 -0.250662134  1.283470284
  [6] -0.743108110 -0.475930969 -0.154234061 -0.909799698  0.120066385
 [11] -0.471146328 -1.306078701 -0.359347827  1.588919607  0.609650490
 [16] -0.041970825 -0.519045792 -0.299927236 -1.915487019  0.891487310
 [21]  0.118554174 -0.457402191  0.464127502  0.159476958  0.431911800
 [26] -0.130894068  0.025232167  0.258570058  1.054101727 -0.715630977
 [31] -1.035540802  0.162845902  0.204477320  0.303049111  0.743628618
 [36]  0.036040889  1.892024592  0.103452055  0.621386237  0.658532551
 [41] -0.562782587  0.853123845 -0.584105063  0.851076019  0.886054923
 [46]  0.856238291 -0.556064763  0.218923810 -1.951566308 -1.229078853
 [51]  0.960642276 -0.322375001 -1.592664826  0.009525485  0.582701505
 [56] -1.238067716 -0.167090977 -0.730336927  1.143156054 -0.831198621
 [61] -2.032051212 -0.027025699 -0.974901679 -1.241296537  0.265886046
 [66]  1.164727862  0.375153864  0.394000424  0.555074032  0.623129515
 [71]  0.799493396 -0.975910383 -0.158936824 -1.580613832 -1.064626456
 [76] -0.647907157 -0.591109811  1.421808851 -2.490274047  0.220531485
 [81] -0.593268474  0.413318206  0.850886977 -1.525409546  0.401399971
 [86]  0.237144819  1.040530463  0.687322066  0.365346456  0.741943965
 [91] -0.179164354  0.926995618 -0.678708973 -0.072101707  0.441612992
 [96] -1.782104792  0.128226446 -0.350927817  1.293464490  1.992479775
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.438612461 -0.011014176 -0.036662539 -0.250662134  1.283470284
  [6] -0.743108110 -0.475930969 -0.154234061 -0.909799698  0.120066385
 [11] -0.471146328 -1.306078701 -0.359347827  1.588919607  0.609650490
 [16] -0.041970825 -0.519045792 -0.299927236 -1.915487019  0.891487310
 [21]  0.118554174 -0.457402191  0.464127502  0.159476958  0.431911800
 [26] -0.130894068  0.025232167  0.258570058  1.054101727 -0.715630977
 [31] -1.035540802  0.162845902  0.204477320  0.303049111  0.743628618
 [36]  0.036040889  1.892024592  0.103452055  0.621386237  0.658532551
 [41] -0.562782587  0.853123845 -0.584105063  0.851076019  0.886054923
 [46]  0.856238291 -0.556064763  0.218923810 -1.951566308 -1.229078853
 [51]  0.960642276 -0.322375001 -1.592664826  0.009525485  0.582701505
 [56] -1.238067716 -0.167090977 -0.730336927  1.143156054 -0.831198621
 [61] -2.032051212 -0.027025699 -0.974901679 -1.241296537  0.265886046
 [66]  1.164727862  0.375153864  0.394000424  0.555074032  0.623129515
 [71]  0.799493396 -0.975910383 -0.158936824 -1.580613832 -1.064626456
 [76] -0.647907157 -0.591109811  1.421808851 -2.490274047  0.220531485
 [81] -0.593268474  0.413318206  0.850886977 -1.525409546  0.401399971
 [86]  0.237144819  1.040530463  0.687322066  0.365346456  0.741943965
 [91] -0.179164354  0.926995618 -0.678708973 -0.072101707  0.441612992
 [96] -1.782104792  0.128226446 -0.350927817  1.293464490  1.992479775
> colMin(tmp)
  [1]  0.438612461 -0.011014176 -0.036662539 -0.250662134  1.283470284
  [6] -0.743108110 -0.475930969 -0.154234061 -0.909799698  0.120066385
 [11] -0.471146328 -1.306078701 -0.359347827  1.588919607  0.609650490
 [16] -0.041970825 -0.519045792 -0.299927236 -1.915487019  0.891487310
 [21]  0.118554174 -0.457402191  0.464127502  0.159476958  0.431911800
 [26] -0.130894068  0.025232167  0.258570058  1.054101727 -0.715630977
 [31] -1.035540802  0.162845902  0.204477320  0.303049111  0.743628618
 [36]  0.036040889  1.892024592  0.103452055  0.621386237  0.658532551
 [41] -0.562782587  0.853123845 -0.584105063  0.851076019  0.886054923
 [46]  0.856238291 -0.556064763  0.218923810 -1.951566308 -1.229078853
 [51]  0.960642276 -0.322375001 -1.592664826  0.009525485  0.582701505
 [56] -1.238067716 -0.167090977 -0.730336927  1.143156054 -0.831198621
 [61] -2.032051212 -0.027025699 -0.974901679 -1.241296537  0.265886046
 [66]  1.164727862  0.375153864  0.394000424  0.555074032  0.623129515
 [71]  0.799493396 -0.975910383 -0.158936824 -1.580613832 -1.064626456
 [76] -0.647907157 -0.591109811  1.421808851 -2.490274047  0.220531485
 [81] -0.593268474  0.413318206  0.850886977 -1.525409546  0.401399971
 [86]  0.237144819  1.040530463  0.687322066  0.365346456  0.741943965
 [91] -0.179164354  0.926995618 -0.678708973 -0.072101707  0.441612992
 [96] -1.782104792  0.128226446 -0.350927817  1.293464490  1.992479775
> colMedians(tmp)
  [1]  0.438612461 -0.011014176 -0.036662539 -0.250662134  1.283470284
  [6] -0.743108110 -0.475930969 -0.154234061 -0.909799698  0.120066385
 [11] -0.471146328 -1.306078701 -0.359347827  1.588919607  0.609650490
 [16] -0.041970825 -0.519045792 -0.299927236 -1.915487019  0.891487310
 [21]  0.118554174 -0.457402191  0.464127502  0.159476958  0.431911800
 [26] -0.130894068  0.025232167  0.258570058  1.054101727 -0.715630977
 [31] -1.035540802  0.162845902  0.204477320  0.303049111  0.743628618
 [36]  0.036040889  1.892024592  0.103452055  0.621386237  0.658532551
 [41] -0.562782587  0.853123845 -0.584105063  0.851076019  0.886054923
 [46]  0.856238291 -0.556064763  0.218923810 -1.951566308 -1.229078853
 [51]  0.960642276 -0.322375001 -1.592664826  0.009525485  0.582701505
 [56] -1.238067716 -0.167090977 -0.730336927  1.143156054 -0.831198621
 [61] -2.032051212 -0.027025699 -0.974901679 -1.241296537  0.265886046
 [66]  1.164727862  0.375153864  0.394000424  0.555074032  0.623129515
 [71]  0.799493396 -0.975910383 -0.158936824 -1.580613832 -1.064626456
 [76] -0.647907157 -0.591109811  1.421808851 -2.490274047  0.220531485
 [81] -0.593268474  0.413318206  0.850886977 -1.525409546  0.401399971
 [86]  0.237144819  1.040530463  0.687322066  0.365346456  0.741943965
 [91] -0.179164354  0.926995618 -0.678708973 -0.072101707  0.441612992
 [96] -1.782104792  0.128226446 -0.350927817  1.293464490  1.992479775
> colRanges(tmp)
          [,1]        [,2]        [,3]       [,4]    [,5]       [,6]      [,7]
[1,] 0.4386125 -0.01101418 -0.03666254 -0.2506621 1.28347 -0.7431081 -0.475931
[2,] 0.4386125 -0.01101418 -0.03666254 -0.2506621 1.28347 -0.7431081 -0.475931
           [,8]       [,9]     [,10]      [,11]     [,12]      [,13]   [,14]
[1,] -0.1542341 -0.9097997 0.1200664 -0.4711463 -1.306079 -0.3593478 1.58892
[2,] -0.1542341 -0.9097997 0.1200664 -0.4711463 -1.306079 -0.3593478 1.58892
         [,15]       [,16]      [,17]      [,18]     [,19]     [,20]     [,21]
[1,] 0.6096505 -0.04197083 -0.5190458 -0.2999272 -1.915487 0.8914873 0.1185542
[2,] 0.6096505 -0.04197083 -0.5190458 -0.2999272 -1.915487 0.8914873 0.1185542
          [,22]     [,23]    [,24]     [,25]      [,26]      [,27]     [,28]
[1,] -0.4574022 0.4641275 0.159477 0.4319118 -0.1308941 0.02523217 0.2585701
[2,] -0.4574022 0.4641275 0.159477 0.4319118 -0.1308941 0.02523217 0.2585701
        [,29]     [,30]     [,31]     [,32]     [,33]     [,34]     [,35]
[1,] 1.054102 -0.715631 -1.035541 0.1628459 0.2044773 0.3030491 0.7436286
[2,] 1.054102 -0.715631 -1.035541 0.1628459 0.2044773 0.3030491 0.7436286
          [,36]    [,37]     [,38]     [,39]     [,40]      [,41]     [,42]
[1,] 0.03604089 1.892025 0.1034521 0.6213862 0.6585326 -0.5627826 0.8531238
[2,] 0.03604089 1.892025 0.1034521 0.6213862 0.6585326 -0.5627826 0.8531238
          [,43]    [,44]     [,45]     [,46]      [,47]     [,48]     [,49]
[1,] -0.5841051 0.851076 0.8860549 0.8562383 -0.5560648 0.2189238 -1.951566
[2,] -0.5841051 0.851076 0.8860549 0.8562383 -0.5560648 0.2189238 -1.951566
         [,50]     [,51]     [,52]     [,53]       [,54]     [,55]     [,56]
[1,] -1.229079 0.9606423 -0.322375 -1.592665 0.009525485 0.5827015 -1.238068
[2,] -1.229079 0.9606423 -0.322375 -1.592665 0.009525485 0.5827015 -1.238068
         [,57]      [,58]    [,59]      [,60]     [,61]      [,62]      [,63]
[1,] -0.167091 -0.7303369 1.143156 -0.8311986 -2.032051 -0.0270257 -0.9749017
[2,] -0.167091 -0.7303369 1.143156 -0.8311986 -2.032051 -0.0270257 -0.9749017
         [,64]    [,65]    [,66]     [,67]     [,68]    [,69]     [,70]
[1,] -1.241297 0.265886 1.164728 0.3751539 0.3940004 0.555074 0.6231295
[2,] -1.241297 0.265886 1.164728 0.3751539 0.3940004 0.555074 0.6231295
         [,71]      [,72]      [,73]     [,74]     [,75]      [,76]      [,77]
[1,] 0.7994934 -0.9759104 -0.1589368 -1.580614 -1.064626 -0.6479072 -0.5911098
[2,] 0.7994934 -0.9759104 -0.1589368 -1.580614 -1.064626 -0.6479072 -0.5911098
        [,78]     [,79]     [,80]      [,81]     [,82]    [,83]    [,84]  [,85]
[1,] 1.421809 -2.490274 0.2205315 -0.5932685 0.4133182 0.850887 -1.52541 0.4014
[2,] 1.421809 -2.490274 0.2205315 -0.5932685 0.4133182 0.850887 -1.52541 0.4014
         [,86]   [,87]     [,88]     [,89]    [,90]      [,91]     [,92]
[1,] 0.2371448 1.04053 0.6873221 0.3653465 0.741944 -0.1791644 0.9269956
[2,] 0.2371448 1.04053 0.6873221 0.3653465 0.741944 -0.1791644 0.9269956
         [,93]       [,94]    [,95]     [,96]     [,97]      [,98]    [,99]
[1,] -0.678709 -0.07210171 0.441613 -1.782105 0.1282264 -0.3509278 1.293464
[2,] -0.678709 -0.07210171 0.441613 -1.782105 0.1282264 -0.3509278 1.293464
      [,100]
[1,] 1.99248
[2,] 1.99248
> 
> 
> Max(tmp2)
[1] 2.765029
> Min(tmp2)
[1] -2.711265
> mean(tmp2)
[1] 0.0584716
> Sum(tmp2)
[1] 5.84716
> Var(tmp2)
[1] 1.222714
> 
> rowMeans(tmp2)
  [1] -2.101588722 -0.054828659  0.966520622  0.826295007 -2.711264673
  [6] -0.473350652 -1.168360991 -1.781322181  0.155589351 -0.008652725
 [11] -0.364387263 -2.224855733  1.900743173 -0.612219342  0.841149238
 [16] -0.675359224  0.189621620  0.132119428  0.884403659  0.457866058
 [21] -1.211686283  0.661640036  0.598889900  1.189589058  0.376338975
 [26] -0.008946045  0.033544025  0.028054888  0.390738619 -1.237752440
 [31]  0.957881127  0.817342067 -0.792633659  0.923572246  0.120896014
 [36] -1.428052062 -0.392936433  0.106312839 -0.306283055 -0.084304232
 [41] -0.555579384 -2.129398674 -1.543904267  0.695334773  2.590907188
 [46] -0.303769571  1.096600958  0.548612256  0.471781216  1.362780921
 [51]  0.274304163  0.088471136  1.200077276  0.105357950  0.050935776
 [56] -0.548755785  2.049388654  0.276826885  1.533807489  1.767124081
 [61] -0.888159510  1.709791711 -0.945514901  0.860294366 -0.538020209
 [66] -1.383448692 -0.650026069  1.340080854  2.765028698  0.072649153
 [71]  0.286331879  2.268590934  0.514041407 -0.176986438  0.558995857
 [76]  0.013171831  0.142479545 -0.120798436 -0.411040379 -2.676120791
 [81] -0.733557727 -1.272401184  0.443780173 -0.784918390 -0.292138591
 [86]  0.846325673  1.558686837  0.609679633  0.591618040 -1.217448238
 [91]  0.375265253  0.462017011  2.094260102 -0.615405419 -0.587052033
 [96]  0.338500610  0.444469742 -2.308074975 -1.072231986  0.273217895
> rowSums(tmp2)
  [1] -2.101588722 -0.054828659  0.966520622  0.826295007 -2.711264673
  [6] -0.473350652 -1.168360991 -1.781322181  0.155589351 -0.008652725
 [11] -0.364387263 -2.224855733  1.900743173 -0.612219342  0.841149238
 [16] -0.675359224  0.189621620  0.132119428  0.884403659  0.457866058
 [21] -1.211686283  0.661640036  0.598889900  1.189589058  0.376338975
 [26] -0.008946045  0.033544025  0.028054888  0.390738619 -1.237752440
 [31]  0.957881127  0.817342067 -0.792633659  0.923572246  0.120896014
 [36] -1.428052062 -0.392936433  0.106312839 -0.306283055 -0.084304232
 [41] -0.555579384 -2.129398674 -1.543904267  0.695334773  2.590907188
 [46] -0.303769571  1.096600958  0.548612256  0.471781216  1.362780921
 [51]  0.274304163  0.088471136  1.200077276  0.105357950  0.050935776
 [56] -0.548755785  2.049388654  0.276826885  1.533807489  1.767124081
 [61] -0.888159510  1.709791711 -0.945514901  0.860294366 -0.538020209
 [66] -1.383448692 -0.650026069  1.340080854  2.765028698  0.072649153
 [71]  0.286331879  2.268590934  0.514041407 -0.176986438  0.558995857
 [76]  0.013171831  0.142479545 -0.120798436 -0.411040379 -2.676120791
 [81] -0.733557727 -1.272401184  0.443780173 -0.784918390 -0.292138591
 [86]  0.846325673  1.558686837  0.609679633  0.591618040 -1.217448238
 [91]  0.375265253  0.462017011  2.094260102 -0.615405419 -0.587052033
 [96]  0.338500610  0.444469742 -2.308074975 -1.072231986  0.273217895
> 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] -2.101588722 -0.054828659  0.966520622  0.826295007 -2.711264673
  [6] -0.473350652 -1.168360991 -1.781322181  0.155589351 -0.008652725
 [11] -0.364387263 -2.224855733  1.900743173 -0.612219342  0.841149238
 [16] -0.675359224  0.189621620  0.132119428  0.884403659  0.457866058
 [21] -1.211686283  0.661640036  0.598889900  1.189589058  0.376338975
 [26] -0.008946045  0.033544025  0.028054888  0.390738619 -1.237752440
 [31]  0.957881127  0.817342067 -0.792633659  0.923572246  0.120896014
 [36] -1.428052062 -0.392936433  0.106312839 -0.306283055 -0.084304232
 [41] -0.555579384 -2.129398674 -1.543904267  0.695334773  2.590907188
 [46] -0.303769571  1.096600958  0.548612256  0.471781216  1.362780921
 [51]  0.274304163  0.088471136  1.200077276  0.105357950  0.050935776
 [56] -0.548755785  2.049388654  0.276826885  1.533807489  1.767124081
 [61] -0.888159510  1.709791711 -0.945514901  0.860294366 -0.538020209
 [66] -1.383448692 -0.650026069  1.340080854  2.765028698  0.072649153
 [71]  0.286331879  2.268590934  0.514041407 -0.176986438  0.558995857
 [76]  0.013171831  0.142479545 -0.120798436 -0.411040379 -2.676120791
 [81] -0.733557727 -1.272401184  0.443780173 -0.784918390 -0.292138591
 [86]  0.846325673  1.558686837  0.609679633  0.591618040 -1.217448238
 [91]  0.375265253  0.462017011  2.094260102 -0.615405419 -0.587052033
 [96]  0.338500610  0.444469742 -2.308074975 -1.072231986  0.273217895
> rowMin(tmp2)
  [1] -2.101588722 -0.054828659  0.966520622  0.826295007 -2.711264673
  [6] -0.473350652 -1.168360991 -1.781322181  0.155589351 -0.008652725
 [11] -0.364387263 -2.224855733  1.900743173 -0.612219342  0.841149238
 [16] -0.675359224  0.189621620  0.132119428  0.884403659  0.457866058
 [21] -1.211686283  0.661640036  0.598889900  1.189589058  0.376338975
 [26] -0.008946045  0.033544025  0.028054888  0.390738619 -1.237752440
 [31]  0.957881127  0.817342067 -0.792633659  0.923572246  0.120896014
 [36] -1.428052062 -0.392936433  0.106312839 -0.306283055 -0.084304232
 [41] -0.555579384 -2.129398674 -1.543904267  0.695334773  2.590907188
 [46] -0.303769571  1.096600958  0.548612256  0.471781216  1.362780921
 [51]  0.274304163  0.088471136  1.200077276  0.105357950  0.050935776
 [56] -0.548755785  2.049388654  0.276826885  1.533807489  1.767124081
 [61] -0.888159510  1.709791711 -0.945514901  0.860294366 -0.538020209
 [66] -1.383448692 -0.650026069  1.340080854  2.765028698  0.072649153
 [71]  0.286331879  2.268590934  0.514041407 -0.176986438  0.558995857
 [76]  0.013171831  0.142479545 -0.120798436 -0.411040379 -2.676120791
 [81] -0.733557727 -1.272401184  0.443780173 -0.784918390 -0.292138591
 [86]  0.846325673  1.558686837  0.609679633  0.591618040 -1.217448238
 [91]  0.375265253  0.462017011  2.094260102 -0.615405419 -0.587052033
 [96]  0.338500610  0.444469742 -2.308074975 -1.072231986  0.273217895
> 
> colMeans(tmp2)
[1] 0.0584716
> colSums(tmp2)
[1] 5.84716
> colVars(tmp2)
[1] 1.222714
> colSd(tmp2)
[1] 1.105764
> colMax(tmp2)
[1] 2.765029
> colMin(tmp2)
[1] -2.711265
> colMedians(tmp2)
[1] 0.1136044
> colRanges(tmp2)
          [,1]
[1,] -2.711265
[2,]  2.765029
> 
> 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]  1.0538055 -2.5627278  4.5536595 -1.0696600  0.5842662 -1.5786387
 [7] -6.8546460 -3.6942740  0.2988695  1.3936033
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.78387148
[2,] -0.52857284
[3,]  0.01042956
[4,]  0.39348788
[5,]  1.48336496
> 
> rowApply(tmp,sum)
 [1] -1.9603732  3.5230036 -0.8644282  0.4122239 -6.7970557 -6.3680244
 [7] -1.7226024 -0.1211394  4.9300434  1.0926098
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    3    6    7    6    6    4    5    8     9
 [2,]    6    2    4    5   10    5    2    1   10     2
 [3,]    8    6   10    8    5    3   10    8    7     7
 [4,]    3   10    8    1    7    1    9    7    5     3
 [5,]   10    1    2    3    9   10    7    6    6     4
 [6,]    4    4    1    4    8    8    6    9    3     8
 [7,]    1    7    7   10    4    2    1    4    1     6
 [8,]    2    5    5    9    1    9    5    2    2     5
 [9,]    5    9    9    6    2    7    8    3    4     1
[10,]    9    8    3    2    3    4    3   10    9    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.9783187 -0.1653680  0.8073154 -3.3093549 -0.9897680 -0.6976712
 [7] -1.5377022 -1.8851672  2.4574155  0.5956300  2.0737052  0.3011893
[13]  0.7658694  1.4197873  0.8914790  1.5184000  2.8681853 -1.0307827
[19] -0.4796038  3.8288659
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3023062
[2,]  0.4322262
[3,]  0.6500303
[4,]  0.8629569
[5,]  1.3354115
> 
> rowApply(tmp,sum)
[1]  4.88466431  2.81804194  6.29860326 -4.62505001  0.03448356
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   12   16   18    4   15
[2,]   19    1   12   17    4
[3,]    5   13    4   15   18
[4,]   14    2    6    1    5
[5,]    9    7    8    8    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.4322262  1.5084417 -0.5043188  0.6772682  0.1783632 -0.2288377
[2,]  0.8629569 -1.3466410  0.4814990 -1.1918881 -0.1276498 -0.4932033
[3,]  1.3354115  0.2638050 -0.5488793 -0.1004071  0.1212181  0.5651341
[4,] -1.3023062  0.4698064  0.4166367 -1.8762279 -0.5826800 -0.7922461
[5,]  0.6500303 -1.0607800  0.9623778 -0.8180999 -0.5790195  0.2514819
           [,7]       [,8]       [,9]      [,10]       [,11]       [,12]
[1,] -1.4035562 -0.4449909  1.2214449 -0.5343741 -0.68409162  0.80200131
[2,]  0.9689516 -0.1355000  0.1199620 -0.4587774  1.39709011 -0.99382053
[3,]  0.2224229  1.7169921  1.1785098 -0.6911445  0.04848964  0.20852547
[4,]  0.4779445 -1.7258379 -0.2243383  0.4204700  0.66122562 -0.09377721
[5,] -1.8034650 -1.2958305  0.1618371  1.8594561  0.65099149  0.37826027
          [,13]       [,14]       [,15]       [,16]       [,17]       [,18]
[1,] -0.1759297  0.34419025  0.46330052 0.715678457  1.17038670 -0.78026517
[2,]  0.7639321 -0.08846567  0.83986905 0.042417325  0.91592567 -0.01198027
[3,] -0.9983398 -0.75698626  1.13959690 0.609980261  1.58801747 -0.16822673
[4,]  0.1299041  2.52313060 -0.07647614 0.008337635 -0.79483178 -0.60955391
[5,]  1.0463027 -0.60208166 -1.47481134 0.141986281 -0.01131276  0.53924341
          [,19]       [,20]
[1,]  0.3338485  1.79387863
[2,]  0.2317017  1.04166253
[3,]  0.1486797  0.41580399
[4,] -1.5766492 -0.07758066
[5,]  0.3828155  0.65510137
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2     col3      col4       col5      col6      col7
row1 0.7008303 -0.5515757 1.749169 0.7925639 -0.1676955 0.4986415 0.4724833
          col8     col9    col10       col11    col12     col13     col14
row1 -1.068704 1.076197 1.049201 -0.07410155 1.066241 0.3247658 0.6843887
        col15     col16     col17    col18     col19    col20
row1 1.526504 0.6815813 -1.023362 1.932828 0.6696529 1.271597
> tmp[,"col10"]
          col10
row1  1.0492007
row2 -1.4068611
row3 -0.5494088
row4  1.5224434
row5  0.1152975
> tmp[c("row1","row5"),]
          col1       col2     col3      col4       col5      col6       col7
row1 0.7008303 -0.5515757 1.749169 0.7925639 -0.1676955 0.4986415 0.47248331
row5 0.1650255 -0.1467553 1.780451 0.4013584 -0.7976003 0.4640973 0.01147993
           col8      col9     col10       col11     col12      col13      col14
row1 -1.0687042 1.0761967 1.0492007 -0.07410155  1.066241  0.3247658  0.6843887
row5  0.5600865 0.8016805 0.1152975 -0.21373098 -1.018696 -1.6730264 -1.3926524
         col15      col16      col17     col18      col19      col20
row1  1.526504  0.6815813 -1.0233618 1.9328279  0.6696529  1.2715973
row5 -1.957178 -0.1875480  0.6048339 0.4037206 -0.1060593 -0.1488295
> tmp[,c("col6","col20")]
           col6      col20
row1  0.4986415  1.2715973
row2 -0.3254734  0.9699923
row3 -0.7787077  1.4450303
row4 -0.6587929 -0.6678378
row5  0.4640973 -0.1488295
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.4986415  1.2715973
row5 0.4640973 -0.1488295
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.25421 50.23737 49.63429 49.23499 52.14728 103.3062 50.72401 49.59834
         col9    col10    col11   col12    col13    col14    col15    col16
row1 49.37538 50.42715 51.26795 50.6637 48.82973 50.40041 49.24157 50.89385
        col17    col18    col19    col20
row1 50.45449 49.43544 47.17657 106.6957
> tmp[,"col10"]
        col10
row1 50.42715
row2 30.01361
row3 30.30453
row4 29.50262
row5 51.39383
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.25421 50.23737 49.63429 49.23499 52.14728 103.3062 50.72401 49.59834
row5 48.84664 49.93671 48.32034 49.34542 48.01632 105.4601 49.64452 48.99981
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.37538 50.42715 51.26795 50.66370 48.82973 50.40041 49.24157 50.89385
row5 49.89045 51.39383 47.84485 49.50176 50.47393 48.37527 49.44318 49.08881
        col17    col18    col19    col20
row1 50.45449 49.43544 47.17657 106.6957
row5 50.23174 49.65900 48.93938 104.2511
> tmp[,c("col6","col20")]
          col6     col20
row1 103.30624 106.69572
row2  73.87813  72.62036
row3  76.15281  73.23142
row4  73.93496  77.07762
row5 105.46005 104.25110
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.3062 106.6957
row5 105.4601 104.2511
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.3062 106.6957
row5 105.4601 104.2511
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  2.15754479
[2,]  0.42964275
[3,]  0.07934662
[4,] -0.56759925
[5,]  0.23022545
> tmp[,c("col17","col7")]
          col17        col7
[1,]  0.3237397  0.20874809
[2,] -0.2139555 -0.44723424
[3,] -1.4188799 -0.01460427
[4,]  0.5790337 -0.60524256
[5,]  1.6243831 -1.70028297
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -0.85300934 -1.08375672
[2,]  0.05544815  0.06442323
[3,] -0.28292029 -0.16735177
[4,]  1.06279261 -1.01208971
[5,]  0.70317648  0.07141199
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.8530093
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.85300934
[2,]  0.05544815
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3  0.04070722 -0.6820810 -0.7798950 -0.9365195 -0.9238822  0.1533425
row1 -0.49313808  0.3503868 -0.4221772  0.8427242 -0.5894958 -0.7907676
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
row3  1.2186762 -2.4318863 -1.03400137 -0.5643321 -1.2363415 -1.8312442
row1 -0.8829018  0.7216917 -0.04056506 -0.2053165  0.7719469  0.3055096
          [,13]     [,14]      [,15]     [,16]      [,17]     [,18]     [,19]
row3 -0.4809548 -1.806035 0.02521047 -0.230219 -0.8942802 0.7431558 0.6158897
row1 -1.1200248  0.114512 0.38840975  1.005411 -1.2046930 1.6796862 0.7159322
          [,20]
row3 -0.7718991
row1 -1.0237579
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]     [,3]       [,4]      [,5]       [,6]       [,7]
row2 -0.8489029 0.2482509 0.561591 -0.7009278 -1.079838 -0.5588176 -0.2041284
          [,8]       [,9]     [,10]
row2 0.8465487 -0.2573595 0.5237579
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]     [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
row5 0.02617216 1.197927 -1.276534 0.2956852 -1.978019 0.2563104 0.6500767
          [,8]       [,9]     [,10]      [,11]    [,12]     [,13]     [,14]
row5 -1.076815 -0.6012355 0.1359827 0.03744248 1.732438 0.5921429 -0.352303
         [,15]      [,16]    [,17]      [,18]     [,19]    [,20]
row5 -1.984076 -0.8285452 0.143671 -0.7973313 0.8452343 -1.34846
> 
> 
> 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: 0x600002ce4420>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c24f6f430"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c51198e45"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c64cb7d9b"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c6ba37ecf"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c3ada7f3e"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c5ed7dda1"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c2e17a5ac"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c127dd6d8"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c3a40864" 
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c622df1a" 
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c5b65271b"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c4dea8c7d"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c61ad8a81"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c48604d40"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM165c2a6fc9df"
> 
> 
> ### 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: 0x600002ce0180>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002ce0180>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002ce0180>
> rowMedians(tmp)
  [1] -0.0188079819  0.1730137711 -0.2678923193  0.0477986014  0.3846190443
  [6]  0.2560653973  0.1810524534 -0.3678531540 -0.0906052903 -0.0227083403
 [11]  0.1569012624 -0.0215893642  0.3704235006 -0.1630356510 -0.0369854787
 [16]  0.3673885596  0.2570512979  0.5838485841 -0.1022053563  0.3974895635
 [21]  0.1240590275  0.1750015997 -0.2441230476  0.4402739936  0.1790003740
 [26] -0.1813405357 -0.2284424114  0.0239359285 -0.5663570795 -0.0979110487
 [31]  0.1189690129  0.4073140454 -0.0120014590  0.2175682315 -0.0926918586
 [36]  0.5104538294  0.0072740510 -0.1891306663 -0.6266416346  0.3151198151
 [41] -0.6600045796 -0.3572057408 -0.0267113203  0.0787686772 -0.1534069254
 [46]  0.5696197928 -0.0380143462 -0.4319852126  0.2005765116  0.1330762466
 [51]  0.0389243536  0.5285690518 -0.0626973499 -0.0001495259 -0.0871384323
 [56] -0.4500363127  0.0121159488 -0.3983960095 -0.3591537200  0.1901323028
 [61]  0.3508113284 -0.1749403008  0.3048494146  0.5061397243  0.1538914239
 [66] -0.0694309188 -0.6120331786  0.1785785427 -0.1877176911  0.3928095585
 [71]  0.2294536209  0.1988933691 -0.1000485728  0.1932893751  0.2202120339
 [76] -0.1220225294 -0.3592553592  0.5517579239 -0.3056740708  0.4207021591
 [81]  0.3252766213 -0.0155944909 -0.1686176611  0.3198249871 -0.4873608600
 [86]  0.0450237454 -0.3857044417  0.1187097707 -0.0107877682 -0.0695300023
 [91]  0.1407360297  0.1607892422 -0.0415386035  0.2480765194 -0.2911431990
 [96]  0.5264295962  0.0110848946  0.1798412298 -0.3631827718 -0.2323923228
[101] -0.6601186005 -0.0418564204  0.1808017208 -0.0452510758 -0.0561036444
[106] -0.0578800885 -0.1347162384 -0.3978742443  0.0782569279  0.1380228123
[111] -0.2844984130  0.4421014557  0.0683902881 -0.0140097081 -0.0236815652
[116] -0.0195069033 -0.5283874912  0.0038485864 -0.1804879233  0.3130173312
[121]  0.2676804741 -0.2017364484  0.3740123445  0.0469729838  0.2543045486
[126]  0.6273392516 -0.3182335180  0.1802878585  0.0926148132  0.1459880290
[131]  0.0546036796 -0.4773974769  0.0782521448  0.3141093290  0.0650839339
[136] -0.1649317915  0.5919990791 -0.3142199788 -0.0878873462  0.2323432902
[141]  0.4037384165  0.1553608681  0.0950218040 -0.3364742189  0.5436888111
[146]  0.5148333608 -0.2201583719 -0.4186506008  0.1529841205  0.2645186613
[151]  0.0475948849  0.0333733316  0.4539066355 -0.0398694998  0.4966224362
[156]  0.2582030573 -0.1838265221 -0.0555978864  0.5600811628 -0.2178285014
[161]  0.4383748417 -0.6886501276  0.1775435967  0.0378560030  0.0715991647
[166] -0.1022999833  0.4062177873  0.4386068839  0.0864907340  0.0411398453
[171] -0.5588624757 -0.0373495275 -0.2178310835  0.5449558864 -0.3765051778
[176]  0.2209844806 -0.1542071900 -0.3957489189  0.1218820362 -0.0296489638
[181]  0.4879968263 -0.0162380343 -0.6260883936 -0.1417475793  0.1204597266
[186] -0.3574806345 -0.1340000187 -0.0135517470  0.0376084046  0.3197214036
[191]  0.1382827135 -0.3685328697  0.3454508375 -0.1163214643  0.2937600800
[196]  0.2774209506  0.1627197876 -0.0031542678  0.1959023813 -0.1609946391
[201]  0.2081275172 -0.4827273803 -0.1240853173 -0.1488056231  0.2674196540
[206]  0.3644655063 -0.4890155836 -0.0781474739  0.1385820563 -0.1428338891
[211]  0.4501662010 -0.3025894473 -0.0343660205 -0.3005394545 -0.2262193892
[216] -0.4226823248 -0.2031263604 -0.1004101728  0.3753672173  0.2240782886
[221] -0.4488172341  0.0802976926  0.0371361736  0.1191295530  0.0642769420
[226]  0.0164794808 -0.3762847339  0.3173077817 -0.3929663335 -0.1448448021
> 
> proc.time()
   user  system elapsed 
  0.623   3.068   3.949 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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: 0x600003ea8360>
> .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: 0x600003ea8360>
> .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: 0x600003ea8360>
> .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: 0x600003ea8360>
> 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: 0x600003e9c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c000>
> .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: 0x600003e9c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c000>
> .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: 0x600003e9c000>
> 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: 0x600003e9c180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c180>
> .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: 0x600003e9c180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003e9c180>
> .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: 0x600003e9c180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003e9c180>
> .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: 0x600003e9c180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003e9c180>
> .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: 0x600003e9c180>
> 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: 0x600003e9c360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003e9c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile172f15c7ba2c" "BufferedMatrixFile172f6b8fa9df"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile172f15c7ba2c" "BufferedMatrixFile172f6b8fa9df"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e98000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e98000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003e98000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003e98000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003e98000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003e98000>
> .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: 0x600003e94000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e94000>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003e94000>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003e94000>
> 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: 0x600003e94180>
> .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: 0x600003e94180>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.121   0.048   0.165 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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.107   0.020   0.125 

Example timings