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

This page was generated on 2025-08-09 12:09 -0400 (Sat, 09 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.2 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4818
palomino8Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4553
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4595
kjohnson3macOS 13.7.1 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4537
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 251/2317HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-08 13:45 -0400 (Fri, 08 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.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


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-08 18:26:02 -0400 (Fri, 08 Aug 2025)
EndedAt: 2025-08-08 18:26:19 -0400 (Fri, 08 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.1
* 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.105   0.031   0.133 

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  2109864 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] "Fri Aug  8 18:26:11 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug  8 18:26:11 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: 0x600002d48000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Aug  8 18:26:12 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Aug  8 18:26:13 2025"
> 
> ColMode(tmp2)
<pointer: 0x600002d48000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.0014642  1.6070875  1.5996832  0.8634702
[2,]  -0.3697122  1.0016473 -0.2043962 -0.2360702
[3,]   0.8808726 -1.5509081 -1.6185248 -0.2259610
[4,]   0.3237660 -0.7424813  0.2200663 -0.5633120
> 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,] 100.0014642 1.6070875 1.5996832 0.8634702
[2,]   0.3697122 1.0016473 0.2043962 0.2360702
[3,]   0.8808726 1.5509081 1.6185248 0.2259610
[4,]   0.3237660 0.7424813 0.2200663 0.5633120
> 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,] 10.0000732 1.2677095 1.2647858 0.9292310
[2,]  0.6080396 1.0008233 0.4521019 0.4858705
[3,]  0.9385481 1.2453546 1.2722125 0.4753536
[4,]  0.5690044 0.8616735 0.4691123 0.7505411
> 
> 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,] 225.00220 39.28418 39.24754 35.15578
[2,]  31.45011 36.00988 29.72542 30.09478
[3,]  35.26635 39.00445 39.34065 29.97950
[4,]  31.01381 34.35922 29.91119 33.06872
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002d4c000>
> exp(tmp5)
<pointer: 0x600002d4c000>
> log(tmp5,2)
<pointer: 0x600002d4c000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.3126
> Min(tmp5)
[1] 53.75983
> mean(tmp5)
[1] 72.47928
> Sum(tmp5)
[1] 14495.86
> Var(tmp5)
[1] 863.3747
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.25724 68.87867 72.44205 69.65357 72.54885 68.67851 68.15043 72.10908
 [9] 71.41937 70.65500
> rowSums(tmp5)
 [1] 1805.145 1377.573 1448.841 1393.071 1450.977 1373.570 1363.009 1442.182
 [9] 1428.387 1413.100
> rowVars(tmp5)
 [1] 8002.61104   42.83714   91.23751   80.50741   65.44376   58.71298
 [7]   69.00115   71.80989   80.28131   85.76186
> rowSd(tmp5)
 [1] 89.457314  6.545009  9.551833  8.972592  8.089732  7.662439  8.306693
 [8]  8.474071  8.959984  9.260770
> rowMax(tmp5)
 [1] 468.31259  83.15868  91.38515  97.34845  84.16196  83.91223  90.15448
 [8]  87.56798  86.56233  90.45025
> rowMin(tmp5)
 [1] 53.75983 60.19930 56.78634 58.59430 58.74304 59.09983 54.22059 55.91504
 [9] 56.32542 57.23739
> 
> colMeans(tmp5)
 [1] 106.99684  75.24613  72.46595  70.55576  69.43318  74.06651  69.95359
 [8]  72.80397  69.03038  69.80377  71.34199  67.64307  67.47656  69.40581
[15]  67.43769  68.22892  67.18585  73.01642  73.43818  74.05498
> colSums(tmp5)
 [1] 1069.9684  752.4613  724.6595  705.5576  694.3318  740.6651  699.5359
 [8]  728.0397  690.3038  698.0377  713.4199  676.4307  674.7656  694.0581
[15]  674.3769  682.2892  671.8585  730.1642  734.3818  740.5498
> colVars(tmp5)
 [1] 16142.47249    74.73419    91.94250    56.12893    39.77252    80.99908
 [7]    64.07566    97.96364    41.27609    72.13006   120.87766    35.43245
[13]    74.36430   109.62223    70.62816    55.55448    94.66888    32.33638
[19]    57.86464   150.10340
> colSd(tmp5)
 [1] 127.053030   8.644894   9.588665   7.491924   6.306546   8.999949
 [7]   8.004728   9.897658   6.424647   8.492942  10.994438   5.952517
[13]   8.623474  10.470063   8.404056   7.453487   9.729794   5.686509
[19]   7.606881  12.251669
> colMax(tmp5)
 [1] 468.31259  90.45025  84.12897  84.16196  83.25911  88.48824  80.33100
 [8]  91.38515  79.43011  84.40721  90.15448  76.19586  82.17028  87.29652
[15]  78.69437  84.84031  87.51112  78.26223  82.54298  97.34845
> colMin(tmp5)
 [1] 58.74304 59.01664 60.93562 62.39840 62.18888 62.55768 59.63222 59.37929
 [9] 60.19930 61.54640 57.23739 60.92662 54.22059 53.75983 55.91504 62.27038
[17] 56.32542 63.89862 59.97452 56.78634
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.25724 68.87867 72.44205 69.65357       NA 68.67851 68.15043 72.10908
 [9] 71.41937 70.65500
> rowSums(tmp5)
 [1] 1805.145 1377.573 1448.841 1393.071       NA 1373.570 1363.009 1442.182
 [9] 1428.387 1413.100
> rowVars(tmp5)
 [1] 8002.61104   42.83714   91.23751   80.50741   66.92944   58.71298
 [7]   69.00115   71.80989   80.28131   85.76186
> rowSd(tmp5)
 [1] 89.457314  6.545009  9.551833  8.972592  8.181041  7.662439  8.306693
 [8]  8.474071  8.959984  9.260770
> rowMax(tmp5)
 [1] 468.31259  83.15868  91.38515  97.34845        NA  83.91223  90.15448
 [8]  87.56798  86.56233  90.45025
> rowMin(tmp5)
 [1] 53.75983 60.19930 56.78634 58.59430       NA 59.09983 54.22059 55.91504
 [9] 56.32542 57.23739
> 
> colMeans(tmp5)
 [1] 106.99684  75.24613  72.46595  70.55576  69.43318  74.06651  69.95359
 [8]  72.80397  69.03038  69.80377  71.34199  67.64307  67.47656  69.40581
[15]  67.43769        NA  67.18585  73.01642  73.43818  74.05498
> colSums(tmp5)
 [1] 1069.9684  752.4613  724.6595  705.5576  694.3318  740.6651  699.5359
 [8]  728.0397  690.3038  698.0377  713.4199  676.4307  674.7656  694.0581
[15]  674.3769        NA  671.8585  730.1642  734.3818  740.5498
> colVars(tmp5)
 [1] 16142.47249    74.73419    91.94250    56.12893    39.77252    80.99908
 [7]    64.07566    97.96364    41.27609    72.13006   120.87766    35.43245
[13]    74.36430   109.62223    70.62816          NA    94.66888    32.33638
[19]    57.86464   150.10340
> colSd(tmp5)
 [1] 127.053030   8.644894   9.588665   7.491924   6.306546   8.999949
 [7]   8.004728   9.897658   6.424647   8.492942  10.994438   5.952517
[13]   8.623474  10.470063   8.404056         NA   9.729794   5.686509
[19]   7.606881  12.251669
> colMax(tmp5)
 [1] 468.31259  90.45025  84.12897  84.16196  83.25911  88.48824  80.33100
 [8]  91.38515  79.43011  84.40721  90.15448  76.19586  82.17028  87.29652
[15]  78.69437        NA  87.51112  78.26223  82.54298  97.34845
> colMin(tmp5)
 [1] 58.74304 59.01664 60.93562 62.39840 62.18888 62.55768 59.63222 59.37929
 [9] 60.19930 61.54640 57.23739 60.92662 54.22059 53.75983 55.91504       NA
[17] 56.32542 63.89862 59.97452 56.78634
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.3126
> Min(tmp5,na.rm=TRUE)
[1] 53.75983
> mean(tmp5,na.rm=TRUE)
[1] 72.44846
> Sum(tmp5,na.rm=TRUE)
[1] 14417.24
> Var(tmp5,na.rm=TRUE)
[1] 867.5442
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.25724 68.87867 72.44205 69.65357 72.22972 68.67851 68.15043 72.10908
 [9] 71.41937 70.65500
> rowSums(tmp5,na.rm=TRUE)
 [1] 1805.145 1377.573 1448.841 1393.071 1372.365 1373.570 1363.009 1442.182
 [9] 1428.387 1413.100
> rowVars(tmp5,na.rm=TRUE)
 [1] 8002.61104   42.83714   91.23751   80.50741   66.92944   58.71298
 [7]   69.00115   71.80989   80.28131   85.76186
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.457314  6.545009  9.551833  8.972592  8.181041  7.662439  8.306693
 [8]  8.474071  8.959984  9.260770
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.31259  83.15868  91.38515  97.34845  84.16196  83.91223  90.15448
 [8]  87.56798  86.56233  90.45025
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.75983 60.19930 56.78634 58.59430 58.74304 59.09983 54.22059 55.91504
 [9] 56.32542 57.23739
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 106.99684  75.24613  72.46595  70.55576  69.43318  74.06651  69.95359
 [8]  72.80397  69.03038  69.80377  71.34199  67.64307  67.47656  69.40581
[15]  67.43769  67.07520  67.18585  73.01642  73.43818  74.05498
> colSums(tmp5,na.rm=TRUE)
 [1] 1069.9684  752.4613  724.6595  705.5576  694.3318  740.6651  699.5359
 [8]  728.0397  690.3038  698.0377  713.4199  676.4307  674.7656  694.0581
[15]  674.3769  603.6768  671.8585  730.1642  734.3818  740.5498
> colVars(tmp5,na.rm=TRUE)
 [1] 16142.47249    74.73419    91.94250    56.12893    39.77252    80.99908
 [7]    64.07566    97.96364    41.27609    72.13006   120.87766    35.43245
[13]    74.36430   109.62223    70.62816    47.52429    94.66888    32.33638
[19]    57.86464   150.10340
> colSd(tmp5,na.rm=TRUE)
 [1] 127.053030   8.644894   9.588665   7.491924   6.306546   8.999949
 [7]   8.004728   9.897658   6.424647   8.492942  10.994438   5.952517
[13]   8.623474  10.470063   8.404056   6.893786   9.729794   5.686509
[19]   7.606881  12.251669
> colMax(tmp5,na.rm=TRUE)
 [1] 468.31259  90.45025  84.12897  84.16196  83.25911  88.48824  80.33100
 [8]  91.38515  79.43011  84.40721  90.15448  76.19586  82.17028  87.29652
[15]  78.69437  84.84031  87.51112  78.26223  82.54298  97.34845
> colMin(tmp5,na.rm=TRUE)
 [1] 58.74304 59.01664 60.93562 62.39840 62.18888 62.55768 59.63222 59.37929
 [9] 60.19930 61.54640 57.23739 60.92662 54.22059 53.75983 55.91504 62.27038
[17] 56.32542 63.89862 59.97452 56.78634
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.25724 68.87867 72.44205 69.65357      NaN 68.67851 68.15043 72.10908
 [9] 71.41937 70.65500
> rowSums(tmp5,na.rm=TRUE)
 [1] 1805.145 1377.573 1448.841 1393.071    0.000 1373.570 1363.009 1442.182
 [9] 1428.387 1413.100
> rowVars(tmp5,na.rm=TRUE)
 [1] 8002.61104   42.83714   91.23751   80.50741         NA   58.71298
 [7]   69.00115   71.80989   80.28131   85.76186
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.457314  6.545009  9.551833  8.972592        NA  7.662439  8.306693
 [8]  8.474071  8.959984  9.260770
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.31259  83.15868  91.38515  97.34845        NA  83.91223  90.15448
 [8]  87.56798  86.56233  90.45025
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.75983 60.19930 56.78634 58.59430       NA 59.09983 54.22059 55.91504
 [9] 56.32542 57.23739
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.35837  76.08839  71.17005  69.04396  68.75035  74.24648  71.10040
 [8]  72.92200  69.39804  70.72125  71.12653  66.82075  67.53173  68.09283
[15]  66.80042       NaN  66.55173  74.02951  72.57634  73.02658
> colSums(tmp5,na.rm=TRUE)
 [1] 1011.2253  684.7955  640.5305  621.3956  618.7532  668.2184  639.9036
 [8]  656.2980  624.5823  636.4913  640.1388  601.3867  607.7855  612.8355
[15]  601.2038    0.0000  598.9656  666.2656  653.1871  657.2392
> colVars(tmp5,na.rm=TRUE)
 [1] 17836.88868    76.09509    84.54277    37.43272    39.49875    90.75956
 [7]    57.28922   110.05236    44.91494    71.67631   135.46508    32.25412
[13]    83.62559   103.93093    74.88790          NA   101.97884    24.83200
[19]    56.74160   156.96825
> colSd(tmp5,na.rm=TRUE)
 [1] 133.554815   8.723250   9.194714   6.118228   6.284803   9.526781
 [7]   7.568964  10.490584   6.701861   8.466186  11.638947   5.679271
[13]   9.144703  10.194652   8.653779         NA  10.098457   4.983171
[19]   7.532702  12.528697
> colMax(tmp5,na.rm=TRUE)
 [1] 468.31259  90.45025  83.91223  79.35594  83.25911  88.48824  80.33100
 [8]  91.38515  79.43011  84.40721  90.15448  76.19586  82.17028  87.29652
[15]  78.69437      -Inf  87.51112  78.26223  82.54298  97.34845
> colMin(tmp5,na.rm=TRUE)
 [1] 62.88207 59.01664 60.93562 62.39840 62.18888 62.55768 59.74453 59.37929
 [9] 60.19930 62.10980 57.23739 60.92662 54.22059 53.75983 55.91504      Inf
[17] 56.32542 65.79783 59.97452 56.78634
> 
> 
> 
> 
> 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] 200.4849 123.9424 188.5390 351.1705 133.8972 202.8356 258.2218 242.6645
 [9] 215.4383 234.0362
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 200.4849 123.9424 188.5390 351.1705 133.8972 202.8356 258.2218 242.6645
 [9] 215.4383 234.0362
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -8.526513e-14 -5.684342e-14  1.421085e-13  1.705303e-13 -5.684342e-14
 [6]  1.136868e-13 -8.526513e-14  1.278977e-13 -8.526513e-14  2.842171e-13
[11] -1.136868e-13 -3.126388e-13 -1.705303e-13  1.136868e-13  1.421085e-13
[16] -8.526513e-14 -2.842171e-14 -5.684342e-14  5.684342e-14 -2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   9 
4   16 
10   4 
2   18 
5   15 
6   1 
8   2 
3   13 
10   10 
1   9 
5   1 
2   19 
7   12 
9   12 
7   14 
7   12 
7   6 
1   19 
2   4 
6   5 
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.852135
> Min(tmp)
[1] -1.921533
> mean(tmp)
[1] -0.1161794
> Sum(tmp)
[1] -11.61794
> Var(tmp)
[1] 0.817211
> 
> rowMeans(tmp)
[1] -0.1161794
> rowSums(tmp)
[1] -11.61794
> rowVars(tmp)
[1] 0.817211
> rowSd(tmp)
[1] 0.9039973
> rowMax(tmp)
[1] 1.852135
> rowMin(tmp)
[1] -1.921533
> 
> colMeans(tmp)
  [1] -1.10528616 -0.24893385 -0.99546208  0.53789655  0.38431943 -0.67220112
  [7]  0.36889344  1.00057394 -0.51360067 -1.12158854 -0.86728627  1.74330451
 [13] -0.48220276  1.02588218 -1.57772901 -0.82110143 -0.92442588 -0.77910675
 [19] -0.87170635  0.77858203 -0.05947173  0.08985041 -1.44972016  1.29796471
 [25] -0.37799433  0.34374546  0.97370309  0.75059359 -0.54369136 -0.37708175
 [31]  1.50765636  1.85213480 -1.92153303 -0.06479913 -1.61433588 -0.93417735
 [37] -1.24518420 -1.40166152 -0.47291374 -0.02952225 -0.90771400 -0.18891755
 [43]  0.18341810  0.56101364  1.11638339 -0.41561981 -1.44812784 -1.29409770
 [49] -0.32161145 -1.28260608 -0.33532641  0.84635682 -0.30675718  1.61843358
 [55]  0.63706886  0.23358022  0.10043721 -0.26527208  0.07512154  0.94192352
 [61] -0.54451929 -0.84763418  0.28648782 -0.80705767  1.39145697  1.11243559
 [67]  0.30571710 -1.23970740  1.83659614 -0.04100032  0.15272063  0.01414587
 [73] -1.17318695 -0.20248345 -0.92530176  0.91471328 -0.97154825  1.52247787
 [79] -0.15697367  0.73845110  0.66146016 -1.28909430  0.07482165  0.05152398
 [85] -0.53673868 -0.66282400 -1.47257499  0.70803278 -0.38302119 -0.44676757
 [91] -0.42142856  1.51199866 -0.08327751  0.89555650 -1.03413560  0.93094498
 [97] -0.04331888 -0.68658534 -0.94475713 -0.54361625
> colSums(tmp)
  [1] -1.10528616 -0.24893385 -0.99546208  0.53789655  0.38431943 -0.67220112
  [7]  0.36889344  1.00057394 -0.51360067 -1.12158854 -0.86728627  1.74330451
 [13] -0.48220276  1.02588218 -1.57772901 -0.82110143 -0.92442588 -0.77910675
 [19] -0.87170635  0.77858203 -0.05947173  0.08985041 -1.44972016  1.29796471
 [25] -0.37799433  0.34374546  0.97370309  0.75059359 -0.54369136 -0.37708175
 [31]  1.50765636  1.85213480 -1.92153303 -0.06479913 -1.61433588 -0.93417735
 [37] -1.24518420 -1.40166152 -0.47291374 -0.02952225 -0.90771400 -0.18891755
 [43]  0.18341810  0.56101364  1.11638339 -0.41561981 -1.44812784 -1.29409770
 [49] -0.32161145 -1.28260608 -0.33532641  0.84635682 -0.30675718  1.61843358
 [55]  0.63706886  0.23358022  0.10043721 -0.26527208  0.07512154  0.94192352
 [61] -0.54451929 -0.84763418  0.28648782 -0.80705767  1.39145697  1.11243559
 [67]  0.30571710 -1.23970740  1.83659614 -0.04100032  0.15272063  0.01414587
 [73] -1.17318695 -0.20248345 -0.92530176  0.91471328 -0.97154825  1.52247787
 [79] -0.15697367  0.73845110  0.66146016 -1.28909430  0.07482165  0.05152398
 [85] -0.53673868 -0.66282400 -1.47257499  0.70803278 -0.38302119 -0.44676757
 [91] -0.42142856  1.51199866 -0.08327751  0.89555650 -1.03413560  0.93094498
 [97] -0.04331888 -0.68658534 -0.94475713 -0.54361625
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.10528616 -0.24893385 -0.99546208  0.53789655  0.38431943 -0.67220112
  [7]  0.36889344  1.00057394 -0.51360067 -1.12158854 -0.86728627  1.74330451
 [13] -0.48220276  1.02588218 -1.57772901 -0.82110143 -0.92442588 -0.77910675
 [19] -0.87170635  0.77858203 -0.05947173  0.08985041 -1.44972016  1.29796471
 [25] -0.37799433  0.34374546  0.97370309  0.75059359 -0.54369136 -0.37708175
 [31]  1.50765636  1.85213480 -1.92153303 -0.06479913 -1.61433588 -0.93417735
 [37] -1.24518420 -1.40166152 -0.47291374 -0.02952225 -0.90771400 -0.18891755
 [43]  0.18341810  0.56101364  1.11638339 -0.41561981 -1.44812784 -1.29409770
 [49] -0.32161145 -1.28260608 -0.33532641  0.84635682 -0.30675718  1.61843358
 [55]  0.63706886  0.23358022  0.10043721 -0.26527208  0.07512154  0.94192352
 [61] -0.54451929 -0.84763418  0.28648782 -0.80705767  1.39145697  1.11243559
 [67]  0.30571710 -1.23970740  1.83659614 -0.04100032  0.15272063  0.01414587
 [73] -1.17318695 -0.20248345 -0.92530176  0.91471328 -0.97154825  1.52247787
 [79] -0.15697367  0.73845110  0.66146016 -1.28909430  0.07482165  0.05152398
 [85] -0.53673868 -0.66282400 -1.47257499  0.70803278 -0.38302119 -0.44676757
 [91] -0.42142856  1.51199866 -0.08327751  0.89555650 -1.03413560  0.93094498
 [97] -0.04331888 -0.68658534 -0.94475713 -0.54361625
> colMin(tmp)
  [1] -1.10528616 -0.24893385 -0.99546208  0.53789655  0.38431943 -0.67220112
  [7]  0.36889344  1.00057394 -0.51360067 -1.12158854 -0.86728627  1.74330451
 [13] -0.48220276  1.02588218 -1.57772901 -0.82110143 -0.92442588 -0.77910675
 [19] -0.87170635  0.77858203 -0.05947173  0.08985041 -1.44972016  1.29796471
 [25] -0.37799433  0.34374546  0.97370309  0.75059359 -0.54369136 -0.37708175
 [31]  1.50765636  1.85213480 -1.92153303 -0.06479913 -1.61433588 -0.93417735
 [37] -1.24518420 -1.40166152 -0.47291374 -0.02952225 -0.90771400 -0.18891755
 [43]  0.18341810  0.56101364  1.11638339 -0.41561981 -1.44812784 -1.29409770
 [49] -0.32161145 -1.28260608 -0.33532641  0.84635682 -0.30675718  1.61843358
 [55]  0.63706886  0.23358022  0.10043721 -0.26527208  0.07512154  0.94192352
 [61] -0.54451929 -0.84763418  0.28648782 -0.80705767  1.39145697  1.11243559
 [67]  0.30571710 -1.23970740  1.83659614 -0.04100032  0.15272063  0.01414587
 [73] -1.17318695 -0.20248345 -0.92530176  0.91471328 -0.97154825  1.52247787
 [79] -0.15697367  0.73845110  0.66146016 -1.28909430  0.07482165  0.05152398
 [85] -0.53673868 -0.66282400 -1.47257499  0.70803278 -0.38302119 -0.44676757
 [91] -0.42142856  1.51199866 -0.08327751  0.89555650 -1.03413560  0.93094498
 [97] -0.04331888 -0.68658534 -0.94475713 -0.54361625
> colMedians(tmp)
  [1] -1.10528616 -0.24893385 -0.99546208  0.53789655  0.38431943 -0.67220112
  [7]  0.36889344  1.00057394 -0.51360067 -1.12158854 -0.86728627  1.74330451
 [13] -0.48220276  1.02588218 -1.57772901 -0.82110143 -0.92442588 -0.77910675
 [19] -0.87170635  0.77858203 -0.05947173  0.08985041 -1.44972016  1.29796471
 [25] -0.37799433  0.34374546  0.97370309  0.75059359 -0.54369136 -0.37708175
 [31]  1.50765636  1.85213480 -1.92153303 -0.06479913 -1.61433588 -0.93417735
 [37] -1.24518420 -1.40166152 -0.47291374 -0.02952225 -0.90771400 -0.18891755
 [43]  0.18341810  0.56101364  1.11638339 -0.41561981 -1.44812784 -1.29409770
 [49] -0.32161145 -1.28260608 -0.33532641  0.84635682 -0.30675718  1.61843358
 [55]  0.63706886  0.23358022  0.10043721 -0.26527208  0.07512154  0.94192352
 [61] -0.54451929 -0.84763418  0.28648782 -0.80705767  1.39145697  1.11243559
 [67]  0.30571710 -1.23970740  1.83659614 -0.04100032  0.15272063  0.01414587
 [73] -1.17318695 -0.20248345 -0.92530176  0.91471328 -0.97154825  1.52247787
 [79] -0.15697367  0.73845110  0.66146016 -1.28909430  0.07482165  0.05152398
 [85] -0.53673868 -0.66282400 -1.47257499  0.70803278 -0.38302119 -0.44676757
 [91] -0.42142856  1.51199866 -0.08327751  0.89555650 -1.03413560  0.93094498
 [97] -0.04331888 -0.68658534 -0.94475713 -0.54361625
> colRanges(tmp)
          [,1]       [,2]       [,3]      [,4]      [,5]       [,6]      [,7]
[1,] -1.105286 -0.2489338 -0.9954621 0.5378966 0.3843194 -0.6722011 0.3688934
[2,] -1.105286 -0.2489338 -0.9954621 0.5378966 0.3843194 -0.6722011 0.3688934
         [,8]       [,9]     [,10]      [,11]    [,12]      [,13]    [,14]
[1,] 1.000574 -0.5136007 -1.121589 -0.8672863 1.743305 -0.4822028 1.025882
[2,] 1.000574 -0.5136007 -1.121589 -0.8672863 1.743305 -0.4822028 1.025882
         [,15]      [,16]      [,17]      [,18]      [,19]    [,20]       [,21]
[1,] -1.577729 -0.8211014 -0.9244259 -0.7791068 -0.8717063 0.778582 -0.05947173
[2,] -1.577729 -0.8211014 -0.9244259 -0.7791068 -0.8717063 0.778582 -0.05947173
          [,22]    [,23]    [,24]      [,25]     [,26]     [,27]     [,28]
[1,] 0.08985041 -1.44972 1.297965 -0.3779943 0.3437455 0.9737031 0.7505936
[2,] 0.08985041 -1.44972 1.297965 -0.3779943 0.3437455 0.9737031 0.7505936
          [,29]      [,30]    [,31]    [,32]     [,33]       [,34]     [,35]
[1,] -0.5436914 -0.3770818 1.507656 1.852135 -1.921533 -0.06479913 -1.614336
[2,] -0.5436914 -0.3770818 1.507656 1.852135 -1.921533 -0.06479913 -1.614336
          [,36]     [,37]     [,38]      [,39]       [,40]     [,41]      [,42]
[1,] -0.9341774 -1.245184 -1.401662 -0.4729137 -0.02952225 -0.907714 -0.1889176
[2,] -0.9341774 -1.245184 -1.401662 -0.4729137 -0.02952225 -0.907714 -0.1889176
         [,43]     [,44]    [,45]      [,46]     [,47]     [,48]      [,49]
[1,] 0.1834181 0.5610136 1.116383 -0.4156198 -1.448128 -1.294098 -0.3216114
[2,] 0.1834181 0.5610136 1.116383 -0.4156198 -1.448128 -1.294098 -0.3216114
         [,50]      [,51]     [,52]      [,53]    [,54]     [,55]     [,56]
[1,] -1.282606 -0.3353264 0.8463568 -0.3067572 1.618434 0.6370689 0.2335802
[2,] -1.282606 -0.3353264 0.8463568 -0.3067572 1.618434 0.6370689 0.2335802
         [,57]      [,58]      [,59]     [,60]      [,61]      [,62]     [,63]
[1,] 0.1004372 -0.2652721 0.07512154 0.9419235 -0.5445193 -0.8476342 0.2864878
[2,] 0.1004372 -0.2652721 0.07512154 0.9419235 -0.5445193 -0.8476342 0.2864878
          [,64]    [,65]    [,66]     [,67]     [,68]    [,69]       [,70]
[1,] -0.8070577 1.391457 1.112436 0.3057171 -1.239707 1.836596 -0.04100032
[2,] -0.8070577 1.391457 1.112436 0.3057171 -1.239707 1.836596 -0.04100032
         [,71]      [,72]     [,73]      [,74]      [,75]     [,76]      [,77]
[1,] 0.1527206 0.01414587 -1.173187 -0.2024834 -0.9253018 0.9147133 -0.9715482
[2,] 0.1527206 0.01414587 -1.173187 -0.2024834 -0.9253018 0.9147133 -0.9715482
        [,78]      [,79]     [,80]     [,81]     [,82]      [,83]      [,84]
[1,] 1.522478 -0.1569737 0.7384511 0.6614602 -1.289094 0.07482165 0.05152398
[2,] 1.522478 -0.1569737 0.7384511 0.6614602 -1.289094 0.07482165 0.05152398
          [,85]     [,86]     [,87]     [,88]      [,89]      [,90]      [,91]
[1,] -0.5367387 -0.662824 -1.472575 0.7080328 -0.3830212 -0.4467676 -0.4214286
[2,] -0.5367387 -0.662824 -1.472575 0.7080328 -0.3830212 -0.4467676 -0.4214286
        [,92]       [,93]     [,94]     [,95]    [,96]       [,97]      [,98]
[1,] 1.511999 -0.08327751 0.8955565 -1.034136 0.930945 -0.04331888 -0.6865853
[2,] 1.511999 -0.08327751 0.8955565 -1.034136 0.930945 -0.04331888 -0.6865853
          [,99]     [,100]
[1,] -0.9447571 -0.5436162
[2,] -0.9447571 -0.5436162
> 
> 
> Max(tmp2)
[1] 2.364709
> Min(tmp2)
[1] -2.578426
> mean(tmp2)
[1] -0.05178713
> Sum(tmp2)
[1] -5.178713
> Var(tmp2)
[1] 1.135099
> 
> rowMeans(tmp2)
  [1] -1.64473136  0.15015848  2.28520361  0.96897283  0.60836413 -1.55981003
  [7]  0.86008440 -0.42425095  0.32021260 -1.02998775  0.26028352 -1.28730635
 [13]  0.89397059  0.93210021 -0.02146455 -0.22020824 -2.57842629 -1.83764774
 [19] -2.06566366  0.13515456 -0.86180791  0.33730684 -0.94834485 -0.90670600
 [25] -0.81505007  0.60878898  0.81794245 -0.18862886  1.18820137  0.16638211
 [31]  0.52828601 -1.44449058  1.35289160  0.95545293 -0.72475336  1.09783040
 [37]  0.29535645 -1.67793667  0.67677113 -0.85536491  1.71072590  1.55599304
 [43] -1.30880854 -0.17575891 -0.68510628 -0.76047538  1.23797577  0.54154051
 [49] -0.89295230 -0.19767162 -1.03503818 -0.33894775  0.49303086 -0.84529838
 [55] -1.23690894 -1.38673306 -0.34221539  0.29948467 -0.18739862  0.44337767
 [61]  1.51564995 -0.08843894 -0.69604551 -0.58139166 -2.32013468  1.89738729
 [67] -1.49542863 -0.91109625  0.85397678 -0.17199042 -0.27605430  2.36470931
 [73]  0.41752648  1.02156011  0.97557518 -0.92323178  0.16010254  1.89686687
 [79] -1.25600251  1.20808014  1.11591325  0.06884930  1.08417027 -0.56529421
 [85] -2.33709141  0.45527033 -0.65160231  0.40249339 -0.83632613  0.80256391
 [91] -0.82987048 -0.89736783  0.46481887  0.83593437  0.08543129  1.53965169
 [97]  0.67992049 -0.57481228 -0.32594154 -0.52299398
> rowSums(tmp2)
  [1] -1.64473136  0.15015848  2.28520361  0.96897283  0.60836413 -1.55981003
  [7]  0.86008440 -0.42425095  0.32021260 -1.02998775  0.26028352 -1.28730635
 [13]  0.89397059  0.93210021 -0.02146455 -0.22020824 -2.57842629 -1.83764774
 [19] -2.06566366  0.13515456 -0.86180791  0.33730684 -0.94834485 -0.90670600
 [25] -0.81505007  0.60878898  0.81794245 -0.18862886  1.18820137  0.16638211
 [31]  0.52828601 -1.44449058  1.35289160  0.95545293 -0.72475336  1.09783040
 [37]  0.29535645 -1.67793667  0.67677113 -0.85536491  1.71072590  1.55599304
 [43] -1.30880854 -0.17575891 -0.68510628 -0.76047538  1.23797577  0.54154051
 [49] -0.89295230 -0.19767162 -1.03503818 -0.33894775  0.49303086 -0.84529838
 [55] -1.23690894 -1.38673306 -0.34221539  0.29948467 -0.18739862  0.44337767
 [61]  1.51564995 -0.08843894 -0.69604551 -0.58139166 -2.32013468  1.89738729
 [67] -1.49542863 -0.91109625  0.85397678 -0.17199042 -0.27605430  2.36470931
 [73]  0.41752648  1.02156011  0.97557518 -0.92323178  0.16010254  1.89686687
 [79] -1.25600251  1.20808014  1.11591325  0.06884930  1.08417027 -0.56529421
 [85] -2.33709141  0.45527033 -0.65160231  0.40249339 -0.83632613  0.80256391
 [91] -0.82987048 -0.89736783  0.46481887  0.83593437  0.08543129  1.53965169
 [97]  0.67992049 -0.57481228 -0.32594154 -0.52299398
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.64473136  0.15015848  2.28520361  0.96897283  0.60836413 -1.55981003
  [7]  0.86008440 -0.42425095  0.32021260 -1.02998775  0.26028352 -1.28730635
 [13]  0.89397059  0.93210021 -0.02146455 -0.22020824 -2.57842629 -1.83764774
 [19] -2.06566366  0.13515456 -0.86180791  0.33730684 -0.94834485 -0.90670600
 [25] -0.81505007  0.60878898  0.81794245 -0.18862886  1.18820137  0.16638211
 [31]  0.52828601 -1.44449058  1.35289160  0.95545293 -0.72475336  1.09783040
 [37]  0.29535645 -1.67793667  0.67677113 -0.85536491  1.71072590  1.55599304
 [43] -1.30880854 -0.17575891 -0.68510628 -0.76047538  1.23797577  0.54154051
 [49] -0.89295230 -0.19767162 -1.03503818 -0.33894775  0.49303086 -0.84529838
 [55] -1.23690894 -1.38673306 -0.34221539  0.29948467 -0.18739862  0.44337767
 [61]  1.51564995 -0.08843894 -0.69604551 -0.58139166 -2.32013468  1.89738729
 [67] -1.49542863 -0.91109625  0.85397678 -0.17199042 -0.27605430  2.36470931
 [73]  0.41752648  1.02156011  0.97557518 -0.92323178  0.16010254  1.89686687
 [79] -1.25600251  1.20808014  1.11591325  0.06884930  1.08417027 -0.56529421
 [85] -2.33709141  0.45527033 -0.65160231  0.40249339 -0.83632613  0.80256391
 [91] -0.82987048 -0.89736783  0.46481887  0.83593437  0.08543129  1.53965169
 [97]  0.67992049 -0.57481228 -0.32594154 -0.52299398
> rowMin(tmp2)
  [1] -1.64473136  0.15015848  2.28520361  0.96897283  0.60836413 -1.55981003
  [7]  0.86008440 -0.42425095  0.32021260 -1.02998775  0.26028352 -1.28730635
 [13]  0.89397059  0.93210021 -0.02146455 -0.22020824 -2.57842629 -1.83764774
 [19] -2.06566366  0.13515456 -0.86180791  0.33730684 -0.94834485 -0.90670600
 [25] -0.81505007  0.60878898  0.81794245 -0.18862886  1.18820137  0.16638211
 [31]  0.52828601 -1.44449058  1.35289160  0.95545293 -0.72475336  1.09783040
 [37]  0.29535645 -1.67793667  0.67677113 -0.85536491  1.71072590  1.55599304
 [43] -1.30880854 -0.17575891 -0.68510628 -0.76047538  1.23797577  0.54154051
 [49] -0.89295230 -0.19767162 -1.03503818 -0.33894775  0.49303086 -0.84529838
 [55] -1.23690894 -1.38673306 -0.34221539  0.29948467 -0.18739862  0.44337767
 [61]  1.51564995 -0.08843894 -0.69604551 -0.58139166 -2.32013468  1.89738729
 [67] -1.49542863 -0.91109625  0.85397678 -0.17199042 -0.27605430  2.36470931
 [73]  0.41752648  1.02156011  0.97557518 -0.92323178  0.16010254  1.89686687
 [79] -1.25600251  1.20808014  1.11591325  0.06884930  1.08417027 -0.56529421
 [85] -2.33709141  0.45527033 -0.65160231  0.40249339 -0.83632613  0.80256391
 [91] -0.82987048 -0.89736783  0.46481887  0.83593437  0.08543129  1.53965169
 [97]  0.67992049 -0.57481228 -0.32594154 -0.52299398
> 
> colMeans(tmp2)
[1] -0.05178713
> colSums(tmp2)
[1] -5.178713
> colVars(tmp2)
[1] 1.135099
> colSd(tmp2)
[1] 1.06541
> colMax(tmp2)
[1] 2.364709
> colMin(tmp2)
[1] -2.578426
> colMedians(tmp2)
[1] -0.05495174
> colRanges(tmp2)
          [,1]
[1,] -2.578426
[2,]  2.364709
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.2426936 -2.7857305  2.1855592  1.0279063 -0.2005323 -2.7588658
 [7] -6.4981322 -2.1033582  5.2850011  1.4257814
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.69634008
[2,]  0.05411782
[3,]  0.17821837
[4,]  0.33133249
[5,]  2.67411844
> 
> rowApply(tmp,sum)
 [1]  3.0776404  3.2660769 -2.1556111 -0.5847245  0.7109240 -3.7924814
 [7]  0.5045475 -3.3730934  0.6385628  0.5284810
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    7    7    3   10    7    6    4    5     7
 [2,]   10    1    5    4    4    4    5    2    2     4
 [3,]    5    8    9    2    8    9    7    3    3     9
 [4,]    9    4    4    7    6    3    9    7   10     1
 [5,]    8    3    8    5    5    6    8    6    9     3
 [6,]    6    2    6    9    2    2    4    5    8     2
 [7,]    3    6    3   10    1    1    1    1    4     8
 [8,]    1    9    2    1    9    5   10    8    1     5
 [9,]    2   10   10    8    7   10    2   10    6     6
[10,]    7    5    1    6    3    8    3    9    7    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.1175506  2.1259798  0.9979740  0.0638614 -2.0047090  2.2595125
 [7] -0.6237878  4.2542993 -0.7671565 -0.5439560  1.2163787  0.9662048
[13] -1.4298363 -3.8961715 -1.7937781  5.5267377 -0.2206853  3.0757267
[19] -0.5135530 -2.6584346
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3362666
[2,] -1.0209357
[3,] -0.9021177
[4,] -0.5294948
[5,]  2.6712642
> 
> rowApply(tmp,sum)
[1]  3.6793127  5.7007368 -5.3121479  0.9733110 -0.1241562
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    3    5    9   20
[2,]   18   11   16    5   15
[3,]   16   17   13    1   17
[4,]   11    6   18   16    3
[5,]    3   18    7    2    9
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]        [,5]       [,6]
[1,] -1.3362666  1.4008640  1.05438684  0.5838301 -1.41711818 -0.2867981
[2,] -0.9021177  0.4985027  1.06324632 -0.0933176  1.32554175  0.2063490
[3,] -1.0209357  0.2990424 -0.05631588  0.5692249 -0.32291184 -0.2068297
[4,] -0.5294948 -0.6757693 -1.91484744  0.8327469 -1.67222035  2.2813795
[5,]  2.6712642  0.6033400  0.85150414 -1.8286229  0.08199967  0.2654118
           [,7]        [,8]       [,9]      [,10]       [,11]       [,12]
[1,]  0.7304514  1.66810938 -1.5548596  1.3828339  0.62038290  0.87606743
[2,] -0.5701992  2.36893799  0.9744824 -1.7671834  0.96335486  0.79594730
[3,] -0.5877813 -0.08560261  0.2957697 -1.6644543  0.12123780 -0.08749533
[4,]  0.7141251 -0.65307650  0.1933697  1.3699371 -0.54202523 -1.11951195
[5,] -0.9103836  0.95593103 -0.6759188  0.1349108  0.05342838  0.50119731
           [,13]      [,14]      [,15]       [,16]      [,17]      [,18]
[1,] -0.26815569 -0.6908735 -0.1247491  1.99439989 -1.5400752 -0.3867919
[2,] -0.85676189 -1.2036990  0.6241240 -0.08519996  1.4034347  0.7142758
[3,] -1.14878153  1.2115669 -1.5874236  1.12748290 -0.1540890  0.3621568
[4,] -0.01443963 -0.3917861 -0.9218295  1.92116564  0.2520627  1.7630950
[5,]  0.85830240 -2.8213799  0.2161002  0.56888921 -0.1820185  0.6229910
           [,19]      [,20]
[1,]  0.38372197  0.5899528
[2,]  0.01381695  0.2272018
[3,] -0.11790134 -2.2581071
[4,] -0.59455128  0.6749814
[5,] -0.19863927 -1.8924635
> 
> 
> 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 :  562  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.5455526 0.3857436 0.4486298 -1.259831 0.8113749 -1.170108 -0.3383317
           col8       col9   col10     col11     col12   col13     col14
row1 -0.3205226 -0.1853851 1.45317 0.5159579 -1.037244 1.52722 -2.585891
         col15      col16     col17      col18     col19      col20
row1 0.3705051 0.02443583 -1.570963 -0.3926672 0.8981618 0.07853726
> tmp[,"col10"]
          col10
row1  1.4531696
row2 -0.2517212
row3 -1.1998764
row4 -1.9046005
row5  0.4374742
> tmp[c("row1","row5"),]
           col1      col2       col3       col4       col5       col6
row1 -0.5455526 0.3857436  0.4486298 -1.2598312  0.8113749 -1.1701078
row5 -0.6412820 1.6454962 -1.3843885 -0.8315351 -1.4726813  0.3519213
           col7       col8       col9     col10     col11     col12      col13
row1 -0.3383317 -0.3205226 -0.1853851 1.4531696 0.5159579 -1.037244 1.52722010
row5 -0.7248236 -0.8766424  0.4652780 0.4374742 0.7018977 -1.245344 0.03768326
          col14      col15       col16      col17      col18     col19
row1 -2.5858914  0.3705051  0.02443583 -1.5709628 -0.3926672 0.8981618
row5  0.3871512 -0.8929555 -0.02387452  0.3408619 -0.1619103 0.3941844
           col20
row1  0.07853726
row5 -1.67143653
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.1701078  0.07853726
row2  1.5231617 -0.41814525
row3 -0.3028315  0.30208972
row4  0.7913442  0.50219408
row5  0.3519213 -1.67143653
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -1.1701078  0.07853726
row5  0.3519213 -1.67143653
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.43409 49.16732 48.86698 50.22835 51.34288 104.3613 50.97404 51.55653
         col9    col10    col11   col12    col13    col14    col15  col16
row1 51.80756 49.89299 50.10912 48.8822 50.96732 49.51606 51.61358 49.815
        col17    col18    col19    col20
row1 50.25926 51.25169 50.92398 105.7501
> tmp[,"col10"]
        col10
row1 49.89299
row2 30.99555
row3 30.73326
row4 29.02821
row5 49.61329
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.43409 49.16732 48.86698 50.22835 51.34288 104.3613 50.97404 51.55653
row5 50.29683 48.27783 49.18942 50.10081 51.39768 104.7271 51.01140 51.31639
         col9    col10    col11    col12    col13    col14    col15   col16
row1 51.80756 49.89299 50.10912 48.88220 50.96732 49.51606 51.61358 49.8150
row5 49.29834 49.61329 50.76448 50.02298 49.60210 48.91485 50.35922 49.3888
        col17    col18    col19    col20
row1 50.25926 51.25169 50.92398 105.7501
row5 49.10691 51.17191 48.73926 105.6072
> tmp[,c("col6","col20")]
          col6     col20
row1 104.36130 105.75013
row2  74.69465  74.55396
row3  74.48854  76.07932
row4  75.26488  75.08208
row5 104.72709 105.60721
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.3613 105.7501
row5 104.7271 105.6072
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.3613 105.7501
row5 104.7271 105.6072
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.2082838
[2,] -1.3157251
[3,] -0.8391916
[4,] -0.7840574
[5,] -1.0382304
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.6258700  0.2975905
[2,] -1.3957171  0.2647646
[3,] -0.1174387 -0.5893804
[4,] -0.4984107 -0.4721048
[5,] -0.8901655  0.6687629
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -1.1932723 -2.0707748
[2,] -1.2030120  0.8645143
[3,] -0.6358926 -0.9666592
[4,] -1.4702541 -0.3230527
[5,] -0.4152471 -0.1085762
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.193272
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.193272
[2,] -1.203012
> 
> 
> 
> 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 -1.0190590 -1.8376343  1.2674402 0.64350434 -0.7241566 -0.5951309
row1  0.3457765 -0.6844216 -0.1102696 0.01023801 -0.7451497 -1.2513950
           [,7]       [,8]      [,9]      [,10]       [,11]     [,12]
row3 -0.1674098 -0.7903414 0.1346591  0.2622412 -0.28053878 0.4376924
row1  0.1403473  0.4223181 0.1812261 -0.9734902  0.03683494 1.4096127
          [,13]      [,14]      [,15]     [,16]       [,17]      [,18]
row3 -0.3693828  0.3368256 -1.2352274 -1.062076 -0.01997133 -1.7175335
row1  0.9909320 -1.8023424 -0.4839853 -1.311678 -0.49286285  0.7292612
          [,19]     [,20]
row3 -0.1203437 0.3841545
row1 -0.9354707 0.5008283
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]       [,3]      [,4]      [,5]        [,6]
row2 0.06769066 -1.887099 -0.1228548 0.3220085 0.9051676 -0.09229887
            [,7]       [,8]      [,9]     [,10]
row2 -0.08414202 -0.6195544 0.9499221 0.4141939
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
        [,1]      [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
row5 -1.0578 -0.300956 -0.4436986 -0.9908842 -0.3201552 -0.1779308 -1.478354
           [,8]     [,9]    [,10]      [,11]    [,12]    [,13]      [,14]
row5 -0.2536665 1.440784 -1.66074 -0.2017883 1.469378 0.923828 -0.5778221
         [,15]       [,16]    [,17]      [,18]     [,19]     [,20]
row5 0.4082385 -0.07701657 1.139442 -0.6795693 0.9165567 -1.146356
> 
> 
> 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: 0x600002d58060>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f432d4b8d"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f52bb386f"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f17629d8" 
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f74b524a7"
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f20798bcd"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94fbc95063" 
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f4dbc99a0"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f1909ff3f"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f5f548df0"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f2832b875"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f19ec1df1"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f5ca1c682"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94fefb051"  
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f78209651"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMe94f236cdd74"
> 
> 
> ### 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: 0x600002d587e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002d587e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002d587e0>
> rowMedians(tmp)
  [1]  0.0416239206  0.3638958011 -0.1910679075 -0.2394339314  0.7866707779
  [6] -0.2075642525 -0.1635355285  0.6299474466 -0.0435391335 -0.0333157678
 [11] -0.2189147713  0.1836108293 -0.1337496065 -0.4926898964 -0.4358381547
 [16]  0.5886970626  0.1862397498  0.0850228679  0.6449541391 -0.5519810578
 [21] -0.3399575723  0.1976473762 -0.1387023786 -0.2382578361 -0.2286090360
 [26]  0.1217798893 -0.3438858691  0.6139581970 -0.1830973352 -0.3719553772
 [31] -0.0803778259 -0.4998381646 -0.7173346439  0.6654098915  0.0846598424
 [36]  0.3853589023  0.0207300940 -0.1138448421 -0.0076213230  0.0004499390
 [41]  0.6182281975 -0.1370889315  0.3188143569  0.4177787929  0.2177999683
 [46] -0.0403585815  0.2921828928  0.0771972485  0.3688041026  0.0722505495
 [51]  0.2601945011  0.0126335912  0.1778690810 -0.0317965992 -0.0094141901
 [56]  0.0933576375  0.1229183984  0.7259886326  0.3095775180  0.0567391850
 [61]  0.0908935298 -0.0380387467  0.2092307117 -0.3188805317  0.6395679250
 [66] -0.0307145698 -0.1787077091 -0.3581200686 -0.3203341287  0.3785318196
 [71] -0.5295100260 -0.3638942340 -0.4322717106  0.4108386746 -0.2875715821
 [76]  0.3527328346 -0.2427025470  0.1213053890  0.0071752466  0.3354012195
 [81]  0.1847305716  0.4318741169 -0.2805574222  0.5234901881  0.3363583127
 [86]  0.0610992857 -0.2078789473  0.0177134181 -0.0446133938 -0.2960975484
 [91] -0.2685743852 -0.2263480622 -0.1059347950 -0.0433964401 -0.8960043225
 [96]  0.6711974133  0.4490437363  0.0041558760  0.0660572618 -0.1630987730
[101]  0.0182291269 -0.5597889460 -0.0754167055 -0.5256883001 -0.3114476501
[106] -0.1395030977 -0.0948793963 -0.2295999239 -0.2885726614  0.2732457809
[111] -0.4087232105  0.3828871991  0.2587049220  0.0152092164 -0.7495773397
[116] -0.1877995474 -0.4880113127 -0.3517051629 -0.3726280485 -0.2890482678
[121]  0.5362729614 -0.4079674132  0.4586446342  0.1492784850  0.0377183520
[126] -0.4038725098  0.0002265111  0.1061112606  0.4932630240  0.4441894732
[131] -0.1235341743 -0.1161856474  0.3296646179  0.0452166539  0.2188481588
[136] -0.0156176711  0.0563632403 -0.6523457524 -0.0837027962 -0.5049301803
[141]  0.1364804293  0.3214834117 -0.0867911174  0.0616957512  0.4325795959
[146]  0.0560772488 -0.2948877981  0.1557670121 -0.2910148651  0.0456795088
[151] -0.0127213805  0.3093406784  0.6303060811 -0.2208256686 -0.1777343980
[156] -0.0504033248  0.1488709906 -0.2066701983  0.4387214475 -0.2264624381
[161]  0.2173147204  0.1095054668 -0.4920298522  0.3296307221 -0.0073239637
[166]  0.8994038566 -0.1100741868  0.2844155114 -0.0466790570 -0.6439128292
[171] -0.2490842315  0.2410304388 -0.1337926430 -0.0381931183 -0.0800038279
[176]  0.3217465568  0.3474521640  0.2319377955 -0.1390350897  0.1492926199
[181]  0.2177583828 -0.0799678291 -0.4695452362  0.1583118447  0.3207150000
[186] -0.3270292956  0.2319782571 -0.2828107273 -0.1464408384 -0.3545889794
[191]  0.0328189724 -0.0339662127 -0.0268749021 -0.4941912004  0.2476313998
[196]  0.0328892388  0.1278049612 -0.5272243830 -0.0006652497  0.7572983920
[201]  0.2358828521 -0.0878816861  0.2289330887  0.2682253584  0.2838916614
[206]  0.1778811464  0.1432211265  0.2507440958  0.3361993665 -0.1650466930
[211]  0.1713950791 -0.5549981799  0.1827869274  0.3552458193 -0.0177963298
[216]  0.3618859725  0.0752333803 -0.0996416560 -0.0128451299 -0.0709774283
[221] -0.1018760843  0.2662603754 -0.1626593235  0.3338274629 -0.8141357409
[226] -0.1617815117 -0.4425691956  0.0818154021 -0.1770221281  0.5577562702
> 
> proc.time()
   user  system elapsed 
  0.630   2.994   3.766 

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: 0x600002290780>
> .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: 0x600002290780>
> .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: 0x600002290780>
> .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: 0x600002290780>
> 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: 0x600002298060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002298060>
> .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: 0x600002298060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002298060>
> .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: 0x600002298060>
> 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: 0x600002298240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002298240>
> .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: 0x600002298240>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002298240>
> .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: 0x600002298240>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002298240>
> .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: 0x600002298240>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002298240>
> .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: 0x600002298240>
> 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: 0x600002298420>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002298420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002298420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002298420>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileeb56189f3bb4" "BufferedMatrixFileeb5620eeb8b0"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileeb56189f3bb4" "BufferedMatrixFileeb5620eeb8b0"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022986c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022986c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000022986c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000022986c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000022986c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000022986c0>
> .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: 0x6000022988a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022988a0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000022988a0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000022988a0>
> 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: 0x600002298a80>
> .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: 0x600002298a80>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.110   0.037   0.145 

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.108   0.025   0.131 

Example timings