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

This page was generated on 2025-10-06 11:40 -0400 (Mon, 06 Oct 2025).

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

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


CHECK results for BufferedMatrix on kjohnson1

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.72.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.72.0.tar.gz
StartedAt: 2025-10-03 14:41:43 -0400 (Fri, 03 Oct 2025)
EndedAt: 2025-10-03 14:42:25 -0400 (Fri, 03 Oct 2025)
EllapsedTime: 41.1 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.72.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.21-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.5
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.72.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... 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.21-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
* 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.21-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.72.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
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.335   0.129   0.460 

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.21-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480828 25.7    1056581 56.5         NA   634425 33.9
Vcells 891011  6.8    8388608 64.0      65536  2109041 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 Oct  3 14:42:04 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 Oct  3 14:42:04 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: 0x6000038b02a0>
> 
> 
> 
> 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 Oct  3 14:42:07 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 Oct  3 14:42:08 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000038b02a0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 101.1390922  0.8609271 -0.2091503  0.4680421
[2,]   0.4012918  3.3874166 -1.1275678  0.4604957
[3,]  -0.5756150 -0.5566141  0.6747845 -0.2415081
[4,]   0.4519996 -0.5992122  0.1422441 -0.4874124
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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,] 101.1390922 0.8609271 0.2091503 0.4680421
[2,]   0.4012918 3.3874166 1.1275678 0.4604957
[3,]   0.5756150 0.5566141 0.6747845 0.2415081
[4,]   0.4519996 0.5992122 0.1422441 0.4874124
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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.0567933 0.9278616 0.4573295 0.6841360
[2,]  0.6334760 1.8404936 1.0618700 0.6785983
[3,]  0.7586930 0.7460658 0.8214527 0.4914348
[4,]  0.6723092 0.7740880 0.3771527 0.6981493
> 
> 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.21-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,] 226.70703 35.13954 29.78245 32.30940
[2,]  31.73605 46.79235 36.74627 32.24648
[3,]  33.16254 33.01727 33.88931 30.15586
[4,]  32.17509 33.34009 28.91377 32.46891
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000038ac540>
> exp(tmp5)
<pointer: 0x6000038ac540>
> log(tmp5,2)
<pointer: 0x6000038ac540>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.861
> Min(tmp5)
[1] 55.66052
> mean(tmp5)
[1] 72.2867
> Sum(tmp5)
[1] 14457.34
> Var(tmp5)
[1] 864.8677
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.06382 72.86156 69.31408 72.63870 69.79314 69.18587 71.46426 68.79195
 [9] 71.44421 69.30938
> rowSums(tmp5)
 [1] 1761.276 1457.231 1386.282 1452.774 1395.863 1383.717 1429.285 1375.839
 [9] 1428.884 1386.188
> rowVars(tmp5)
 [1] 8220.52205   58.91823   62.46060   85.39073   65.45721   68.42404
 [7]   50.58097   22.81884   67.89463   43.77331
> rowSd(tmp5)
 [1] 90.667095  7.675821  7.903202  9.240710  8.090563  8.271882  7.112030
 [8]  4.776907  8.239820  6.616140
> rowMax(tmp5)
 [1] 471.86097  97.39215  86.64109  91.68709  92.26673  84.97139  83.35917
 [8]  79.77123  90.75078  81.73758
> rowMin(tmp5)
 [1] 55.79006 64.58505 57.46447 55.66052 57.92067 57.77585 56.70852 61.85878
 [9] 55.71744 56.95809
> 
> colMeans(tmp5)
 [1] 109.39604  72.56785  69.06134  69.33665  72.47837  71.82879  69.67396
 [8]  68.99209  68.73873  67.64907  71.92164  68.79497  70.59913  67.97628
[15]  71.19081  76.39088  68.91756  70.76816  69.55400  69.89759
> colSums(tmp5)
 [1] 1093.9604  725.6785  690.6134  693.3665  724.7837  718.2879  696.7396
 [8]  689.9209  687.3873  676.4907  719.2164  687.9497  705.9913  679.7628
[15]  711.9081  763.9088  689.1756  707.6816  695.5400  698.9759
> colVars(tmp5)
 [1] 16253.79089    79.14723    29.90110    32.43016    87.08101    67.89499
 [7]    43.67161    97.17173    90.08650    30.50283    96.30113    61.59459
[13]    71.25804    45.99822    28.95878   102.03832    66.68596    40.57726
[19]    48.20142    53.29245
> colSd(tmp5)
 [1] 127.490356   8.896473   5.468190   5.694748   9.331721   8.239841
 [7]   6.608450   9.857572   9.491391   5.522936   9.813314   7.848222
[13]   8.441448   6.782199   5.381336  10.101402   8.166147   6.370028
[19]   6.942725   7.300168
> colMax(tmp5)
 [1] 471.86097  97.39215  76.48254  81.81598  90.75078  86.04937  78.16809
 [8]  86.27874  81.73758  77.05157  81.93612  83.35917  83.69012  76.89297
[15]  79.02351  92.26673  81.72256  86.64109  81.05927  85.49116
> colMin(tmp5)
 [1] 60.82798 67.14480 60.18023 62.76546 57.46447 61.99663 55.66052 56.70852
 [9] 55.71744 59.20708 57.92067 55.79006 58.42141 58.58043 63.68195 66.18649
[17] 56.95809 63.39370 60.96324 58.06471
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 88.06382 72.86156 69.31408 72.63870 69.79314       NA 71.46426 68.79195
 [9] 71.44421 69.30938
> rowSums(tmp5)
 [1] 1761.276 1457.231 1386.282 1452.774 1395.863       NA 1429.285 1375.839
 [9] 1428.884 1386.188
> rowVars(tmp5)
 [1] 8220.52205   58.91823   62.46060   85.39073   65.45721   68.98048
 [7]   50.58097   22.81884   67.89463   43.77331
> rowSd(tmp5)
 [1] 90.667095  7.675821  7.903202  9.240710  8.090563  8.305449  7.112030
 [8]  4.776907  8.239820  6.616140
> rowMax(tmp5)
 [1] 471.86097  97.39215  86.64109  91.68709  92.26673        NA  83.35917
 [8]  79.77123  90.75078  81.73758
> rowMin(tmp5)
 [1] 55.79006 64.58505 57.46447 55.66052 57.92067       NA 56.70852 61.85878
 [9] 55.71744 56.95809
> 
> colMeans(tmp5)
 [1] 109.39604  72.56785  69.06134  69.33665  72.47837  71.82879  69.67396
 [8]  68.99209        NA  67.64907  71.92164  68.79497  70.59913  67.97628
[15]  71.19081  76.39088  68.91756  70.76816  69.55400  69.89759
> colSums(tmp5)
 [1] 1093.9604  725.6785  690.6134  693.3665  724.7837  718.2879  696.7396
 [8]  689.9209        NA  676.4907  719.2164  687.9497  705.9913  679.7628
[15]  711.9081  763.9088  689.1756  707.6816  695.5400  698.9759
> colVars(tmp5)
 [1] 16253.79089    79.14723    29.90110    32.43016    87.08101    67.89499
 [7]    43.67161    97.17173          NA    30.50283    96.30113    61.59459
[13]    71.25804    45.99822    28.95878   102.03832    66.68596    40.57726
[19]    48.20142    53.29245
> colSd(tmp5)
 [1] 127.490356   8.896473   5.468190   5.694748   9.331721   8.239841
 [7]   6.608450   9.857572         NA   5.522936   9.813314   7.848222
[13]   8.441448   6.782199   5.381336  10.101402   8.166147   6.370028
[19]   6.942725   7.300168
> colMax(tmp5)
 [1] 471.86097  97.39215  76.48254  81.81598  90.75078  86.04937  78.16809
 [8]  86.27874        NA  77.05157  81.93612  83.35917  83.69012  76.89297
[15]  79.02351  92.26673  81.72256  86.64109  81.05927  85.49116
> colMin(tmp5)
 [1] 60.82798 67.14480 60.18023 62.76546 57.46447 61.99663 55.66052 56.70852
 [9]       NA 59.20708 57.92067 55.79006 58.42141 58.58043 63.68195 66.18649
[17] 56.95809 63.39370 60.96324 58.06471
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.861
> Min(tmp5,na.rm=TRUE)
[1] 55.66052
> mean(tmp5,na.rm=TRUE)
[1] 72.33971
> Sum(tmp5,na.rm=TRUE)
[1] 14395.6
> Var(tmp5,na.rm=TRUE)
[1] 868.6708
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.06382 72.86156 69.31408 72.63870 69.79314 69.57792 71.46426 68.79195
 [9] 71.44421 69.30938
> rowSums(tmp5,na.rm=TRUE)
 [1] 1761.276 1457.231 1386.282 1452.774 1395.863 1321.981 1429.285 1375.839
 [9] 1428.884 1386.188
> rowVars(tmp5,na.rm=TRUE)
 [1] 8220.52205   58.91823   62.46060   85.39073   65.45721   68.98048
 [7]   50.58097   22.81884   67.89463   43.77331
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.667095  7.675821  7.903202  9.240710  8.090563  8.305449  7.112030
 [8]  4.776907  8.239820  6.616140
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.86097  97.39215  86.64109  91.68709  92.26673  84.97139  83.35917
 [8]  79.77123  90.75078  81.73758
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.79006 64.58505 57.46447 55.66052 57.92067 57.77585 56.70852 61.85878
 [9] 55.71744 56.95809
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.39604  72.56785  69.06134  69.33665  72.47837  71.82879  69.67396
 [8]  68.99209  69.51672  67.64907  71.92164  68.79497  70.59913  67.97628
[15]  71.19081  76.39088  68.91756  70.76816  69.55400  69.89759
> colSums(tmp5,na.rm=TRUE)
 [1] 1093.9604  725.6785  690.6134  693.3665  724.7837  718.2879  696.7396
 [8]  689.9209  625.6504  676.4907  719.2164  687.9497  705.9913  679.7628
[15]  711.9081  763.9088  689.1756  707.6816  695.5400  698.9759
> colVars(tmp5,na.rm=TRUE)
 [1] 16253.79089    79.14723    29.90110    32.43016    87.08101    67.89499
 [7]    43.67161    97.17173    94.53814    30.50283    96.30113    61.59459
[13]    71.25804    45.99822    28.95878   102.03832    66.68596    40.57726
[19]    48.20142    53.29245
> colSd(tmp5,na.rm=TRUE)
 [1] 127.490356   8.896473   5.468190   5.694748   9.331721   8.239841
 [7]   6.608450   9.857572   9.723073   5.522936   9.813314   7.848222
[13]   8.441448   6.782199   5.381336  10.101402   8.166147   6.370028
[19]   6.942725   7.300168
> colMax(tmp5,na.rm=TRUE)
 [1] 471.86097  97.39215  76.48254  81.81598  90.75078  86.04937  78.16809
 [8]  86.27874  81.73758  77.05157  81.93612  83.35917  83.69012  76.89297
[15]  79.02351  92.26673  81.72256  86.64109  81.05927  85.49116
> colMin(tmp5,na.rm=TRUE)
 [1] 60.82798 67.14480 60.18023 62.76546 57.46447 61.99663 55.66052 56.70852
 [9] 55.71744 59.20708 57.92067 55.79006 58.42141 58.58043 63.68195 66.18649
[17] 56.95809 63.39370 60.96324 58.06471
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.06382 72.86156 69.31408 72.63870 69.79314      NaN 71.46426 68.79195
 [9] 71.44421 69.30938
> rowSums(tmp5,na.rm=TRUE)
 [1] 1761.276 1457.231 1386.282 1452.774 1395.863    0.000 1429.285 1375.839
 [9] 1428.884 1386.188
> rowVars(tmp5,na.rm=TRUE)
 [1] 8220.52205   58.91823   62.46060   85.39073   65.45721         NA
 [7]   50.58097   22.81884   67.89463   43.77331
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.667095  7.675821  7.903202  9.240710  8.090563        NA  7.112030
 [8]  4.776907  8.239820  6.616140
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.86097  97.39215  86.64109  91.68709  92.26673        NA  83.35917
 [8]  79.77123  90.75078  81.73758
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.79006 64.58505 57.46447 55.66052 57.92067       NA 56.70852 61.85878
 [9] 55.71744 56.95809
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.79249  72.80631  68.89962  67.95006  72.31285  72.45306  68.73016
 [8]  70.23834       NaN  67.69302  71.17207  69.71129  71.54159  66.98554
[15]  70.57596  75.43749  69.17880  70.99887  70.41807  71.21235
> colSums(tmp5,na.rm=TRUE)
 [1] 1033.1324  655.2568  620.0966  611.5506  650.8157  652.0775  618.5715
 [8]  632.1451    0.0000  609.2372  640.5486  627.4016  643.8744  602.8699
[15]  635.1837  678.9374  622.6092  638.9898  633.7626  640.9112
> colVars(tmp5,na.rm=TRUE)
 [1] 17957.89575    88.40095    33.34452    14.85425    97.65792    71.99770
 [7]    39.10968    91.84542          NA    34.29395   102.01783    59.84801
[13]    70.17262    40.70532    28.32566   104.56740    74.25396    45.05063
[19]    45.82725    40.50720
> colSd(tmp5,na.rm=TRUE)
 [1] 134.007074   9.402178   5.774472   3.854121   9.882202   8.485146
 [7]   6.253773   9.583601         NA   5.856104  10.100388   7.736149
[13]   8.376910   6.380072   5.322185  10.225820   8.617074   6.711977
[19]   6.769583   6.364527
> colMax(tmp5,na.rm=TRUE)
 [1] 471.86097  97.39215  76.48254  76.15640  90.75078  86.04937  77.37339
 [8]  86.27874      -Inf  77.05157  81.93612  83.35917  83.69012  75.54865
[15]  79.02351  92.26673  81.72256  86.64109  81.05927  85.49116
> colMin(tmp5,na.rm=TRUE)
 [1] 62.95190 67.14480 60.18023 62.76546 57.46447 61.99663 55.66052 56.70852
 [9]      Inf 59.20708 57.92067 55.79006 58.42141 58.58043 63.68195 66.18649
[17] 56.95809 63.39370 60.96324 64.55106
> 
> 
> 
> 
> 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] 142.4907 214.9862 319.9475 308.9021 355.2836 184.5047 205.3269 221.6145
 [9] 243.5557 317.2294
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 142.4907 214.9862 319.9475 308.9021 355.2836 184.5047 205.3269 221.6145
 [9] 243.5557 317.2294
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.136868e-13 -1.136868e-13  5.684342e-14 -2.842171e-14  0.000000e+00
 [6]  0.000000e+00 -1.705303e-13  0.000000e+00 -8.526513e-14  1.136868e-13
[11]  3.410605e-13  5.684342e-14 -2.557954e-13 -5.684342e-14 -7.105427e-14
[16] -5.684342e-14 -1.136868e-13  0.000000e+00  5.684342e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   14 
8   2 
5   4 
6   10 
1   5 
10   6 
7   5 
6   13 
8   9 
8   1 
2   10 
10   16 
1   4 
3   13 
6   5 
5   7 
7   9 
10   18 
5   3 
5   11 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.834351
> Min(tmp)
[1] -2.217282
> mean(tmp)
[1] 0.006236387
> Sum(tmp)
[1] 0.6236387
> Var(tmp)
[1] 1.048574
> 
> rowMeans(tmp)
[1] 0.006236387
> rowSums(tmp)
[1] 0.6236387
> rowVars(tmp)
[1] 1.048574
> rowSd(tmp)
[1] 1.023999
> rowMax(tmp)
[1] 2.834351
> rowMin(tmp)
[1] -2.217282
> 
> colMeans(tmp)
  [1] -1.553090441 -1.118153856 -1.347968271  1.496298937  0.487307619
  [6] -0.773415368 -1.381704626  0.597889204 -0.713090876  0.160241982
 [11]  0.730987179 -0.622124390 -1.452521746 -0.475526046 -0.276619849
 [16] -0.705676973  1.453374595  1.812954529  0.114559538  1.064499406
 [21]  1.748952640 -0.120524737 -1.205061493 -0.488951989  0.026753416
 [26] -0.240483753  2.834350972  1.118990969  0.723430746 -0.672233282
 [31]  0.568290833  0.018276759 -1.041755560 -1.371926584  1.630284670
 [36] -0.262076235 -0.420921366 -0.220332034 -1.186848751  0.020778836
 [41] -1.066872855 -0.717012784 -0.708772837  1.017591364  1.410358300
 [46]  0.217267726 -0.216170649  0.871202764  0.006635283  1.181890578
 [51]  0.731625801  1.716777329  0.779157755 -0.687957847 -2.217282271
 [56]  0.850211444  0.207386305 -0.823212834 -1.017912349 -0.651185959
 [61]  1.309816482 -0.527693084 -0.461328040  0.725789024  0.135028813
 [66] -1.266985316  0.859027915 -1.034951428  0.645933953  1.528360986
 [71] -0.641056518  0.617676607 -0.047855196  0.685766765 -0.446348294
 [76]  1.254330568  1.061145439 -0.313409012 -1.027721468 -0.339166855
 [81] -1.668130329  1.296513772 -1.983162945 -0.103281725  0.614741709
 [86] -1.049434019  0.026251278 -1.162009827  0.407204090 -1.046978414
 [91]  1.510236746  1.198446677 -1.433083327  0.090914397  0.747934125
 [96] -1.685898883 -0.092475996 -0.201524874  1.487937838  1.112138200
> colSums(tmp)
  [1] -1.553090441 -1.118153856 -1.347968271  1.496298937  0.487307619
  [6] -0.773415368 -1.381704626  0.597889204 -0.713090876  0.160241982
 [11]  0.730987179 -0.622124390 -1.452521746 -0.475526046 -0.276619849
 [16] -0.705676973  1.453374595  1.812954529  0.114559538  1.064499406
 [21]  1.748952640 -0.120524737 -1.205061493 -0.488951989  0.026753416
 [26] -0.240483753  2.834350972  1.118990969  0.723430746 -0.672233282
 [31]  0.568290833  0.018276759 -1.041755560 -1.371926584  1.630284670
 [36] -0.262076235 -0.420921366 -0.220332034 -1.186848751  0.020778836
 [41] -1.066872855 -0.717012784 -0.708772837  1.017591364  1.410358300
 [46]  0.217267726 -0.216170649  0.871202764  0.006635283  1.181890578
 [51]  0.731625801  1.716777329  0.779157755 -0.687957847 -2.217282271
 [56]  0.850211444  0.207386305 -0.823212834 -1.017912349 -0.651185959
 [61]  1.309816482 -0.527693084 -0.461328040  0.725789024  0.135028813
 [66] -1.266985316  0.859027915 -1.034951428  0.645933953  1.528360986
 [71] -0.641056518  0.617676607 -0.047855196  0.685766765 -0.446348294
 [76]  1.254330568  1.061145439 -0.313409012 -1.027721468 -0.339166855
 [81] -1.668130329  1.296513772 -1.983162945 -0.103281725  0.614741709
 [86] -1.049434019  0.026251278 -1.162009827  0.407204090 -1.046978414
 [91]  1.510236746  1.198446677 -1.433083327  0.090914397  0.747934125
 [96] -1.685898883 -0.092475996 -0.201524874  1.487937838  1.112138200
> 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.553090441 -1.118153856 -1.347968271  1.496298937  0.487307619
  [6] -0.773415368 -1.381704626  0.597889204 -0.713090876  0.160241982
 [11]  0.730987179 -0.622124390 -1.452521746 -0.475526046 -0.276619849
 [16] -0.705676973  1.453374595  1.812954529  0.114559538  1.064499406
 [21]  1.748952640 -0.120524737 -1.205061493 -0.488951989  0.026753416
 [26] -0.240483753  2.834350972  1.118990969  0.723430746 -0.672233282
 [31]  0.568290833  0.018276759 -1.041755560 -1.371926584  1.630284670
 [36] -0.262076235 -0.420921366 -0.220332034 -1.186848751  0.020778836
 [41] -1.066872855 -0.717012784 -0.708772837  1.017591364  1.410358300
 [46]  0.217267726 -0.216170649  0.871202764  0.006635283  1.181890578
 [51]  0.731625801  1.716777329  0.779157755 -0.687957847 -2.217282271
 [56]  0.850211444  0.207386305 -0.823212834 -1.017912349 -0.651185959
 [61]  1.309816482 -0.527693084 -0.461328040  0.725789024  0.135028813
 [66] -1.266985316  0.859027915 -1.034951428  0.645933953  1.528360986
 [71] -0.641056518  0.617676607 -0.047855196  0.685766765 -0.446348294
 [76]  1.254330568  1.061145439 -0.313409012 -1.027721468 -0.339166855
 [81] -1.668130329  1.296513772 -1.983162945 -0.103281725  0.614741709
 [86] -1.049434019  0.026251278 -1.162009827  0.407204090 -1.046978414
 [91]  1.510236746  1.198446677 -1.433083327  0.090914397  0.747934125
 [96] -1.685898883 -0.092475996 -0.201524874  1.487937838  1.112138200
> colMin(tmp)
  [1] -1.553090441 -1.118153856 -1.347968271  1.496298937  0.487307619
  [6] -0.773415368 -1.381704626  0.597889204 -0.713090876  0.160241982
 [11]  0.730987179 -0.622124390 -1.452521746 -0.475526046 -0.276619849
 [16] -0.705676973  1.453374595  1.812954529  0.114559538  1.064499406
 [21]  1.748952640 -0.120524737 -1.205061493 -0.488951989  0.026753416
 [26] -0.240483753  2.834350972  1.118990969  0.723430746 -0.672233282
 [31]  0.568290833  0.018276759 -1.041755560 -1.371926584  1.630284670
 [36] -0.262076235 -0.420921366 -0.220332034 -1.186848751  0.020778836
 [41] -1.066872855 -0.717012784 -0.708772837  1.017591364  1.410358300
 [46]  0.217267726 -0.216170649  0.871202764  0.006635283  1.181890578
 [51]  0.731625801  1.716777329  0.779157755 -0.687957847 -2.217282271
 [56]  0.850211444  0.207386305 -0.823212834 -1.017912349 -0.651185959
 [61]  1.309816482 -0.527693084 -0.461328040  0.725789024  0.135028813
 [66] -1.266985316  0.859027915 -1.034951428  0.645933953  1.528360986
 [71] -0.641056518  0.617676607 -0.047855196  0.685766765 -0.446348294
 [76]  1.254330568  1.061145439 -0.313409012 -1.027721468 -0.339166855
 [81] -1.668130329  1.296513772 -1.983162945 -0.103281725  0.614741709
 [86] -1.049434019  0.026251278 -1.162009827  0.407204090 -1.046978414
 [91]  1.510236746  1.198446677 -1.433083327  0.090914397  0.747934125
 [96] -1.685898883 -0.092475996 -0.201524874  1.487937838  1.112138200
> colMedians(tmp)
  [1] -1.553090441 -1.118153856 -1.347968271  1.496298937  0.487307619
  [6] -0.773415368 -1.381704626  0.597889204 -0.713090876  0.160241982
 [11]  0.730987179 -0.622124390 -1.452521746 -0.475526046 -0.276619849
 [16] -0.705676973  1.453374595  1.812954529  0.114559538  1.064499406
 [21]  1.748952640 -0.120524737 -1.205061493 -0.488951989  0.026753416
 [26] -0.240483753  2.834350972  1.118990969  0.723430746 -0.672233282
 [31]  0.568290833  0.018276759 -1.041755560 -1.371926584  1.630284670
 [36] -0.262076235 -0.420921366 -0.220332034 -1.186848751  0.020778836
 [41] -1.066872855 -0.717012784 -0.708772837  1.017591364  1.410358300
 [46]  0.217267726 -0.216170649  0.871202764  0.006635283  1.181890578
 [51]  0.731625801  1.716777329  0.779157755 -0.687957847 -2.217282271
 [56]  0.850211444  0.207386305 -0.823212834 -1.017912349 -0.651185959
 [61]  1.309816482 -0.527693084 -0.461328040  0.725789024  0.135028813
 [66] -1.266985316  0.859027915 -1.034951428  0.645933953  1.528360986
 [71] -0.641056518  0.617676607 -0.047855196  0.685766765 -0.446348294
 [76]  1.254330568  1.061145439 -0.313409012 -1.027721468 -0.339166855
 [81] -1.668130329  1.296513772 -1.983162945 -0.103281725  0.614741709
 [86] -1.049434019  0.026251278 -1.162009827  0.407204090 -1.046978414
 [91]  1.510236746  1.198446677 -1.433083327  0.090914397  0.747934125
 [96] -1.685898883 -0.092475996 -0.201524874  1.487937838  1.112138200
> colRanges(tmp)
         [,1]      [,2]      [,3]     [,4]      [,5]       [,6]      [,7]
[1,] -1.55309 -1.118154 -1.347968 1.496299 0.4873076 -0.7734154 -1.381705
[2,] -1.55309 -1.118154 -1.347968 1.496299 0.4873076 -0.7734154 -1.381705
          [,8]       [,9]    [,10]     [,11]      [,12]     [,13]     [,14]
[1,] 0.5978892 -0.7130909 0.160242 0.7309872 -0.6221244 -1.452522 -0.475526
[2,] 0.5978892 -0.7130909 0.160242 0.7309872 -0.6221244 -1.452522 -0.475526
          [,15]     [,16]    [,17]    [,18]     [,19]    [,20]    [,21]
[1,] -0.2766198 -0.705677 1.453375 1.812955 0.1145595 1.064499 1.748953
[2,] -0.2766198 -0.705677 1.453375 1.812955 0.1145595 1.064499 1.748953
          [,22]     [,23]     [,24]      [,25]      [,26]    [,27]    [,28]
[1,] -0.1205247 -1.205061 -0.488952 0.02675342 -0.2404838 2.834351 1.118991
[2,] -0.1205247 -1.205061 -0.488952 0.02675342 -0.2404838 2.834351 1.118991
         [,29]      [,30]     [,31]      [,32]     [,33]     [,34]    [,35]
[1,] 0.7234307 -0.6722333 0.5682908 0.01827676 -1.041756 -1.371927 1.630285
[2,] 0.7234307 -0.6722333 0.5682908 0.01827676 -1.041756 -1.371927 1.630285
          [,36]      [,37]     [,38]     [,39]      [,40]     [,41]      [,42]
[1,] -0.2620762 -0.4209214 -0.220332 -1.186849 0.02077884 -1.066873 -0.7170128
[2,] -0.2620762 -0.4209214 -0.220332 -1.186849 0.02077884 -1.066873 -0.7170128
          [,43]    [,44]    [,45]     [,46]      [,47]     [,48]       [,49]
[1,] -0.7087728 1.017591 1.410358 0.2172677 -0.2161706 0.8712028 0.006635283
[2,] -0.7087728 1.017591 1.410358 0.2172677 -0.2161706 0.8712028 0.006635283
        [,50]     [,51]    [,52]     [,53]      [,54]     [,55]     [,56]
[1,] 1.181891 0.7316258 1.716777 0.7791578 -0.6879578 -2.217282 0.8502114
[2,] 1.181891 0.7316258 1.716777 0.7791578 -0.6879578 -2.217282 0.8502114
         [,57]      [,58]     [,59]     [,60]    [,61]      [,62]     [,63]
[1,] 0.2073863 -0.8232128 -1.017912 -0.651186 1.309816 -0.5276931 -0.461328
[2,] 0.2073863 -0.8232128 -1.017912 -0.651186 1.309816 -0.5276931 -0.461328
        [,64]     [,65]     [,66]     [,67]     [,68]    [,69]    [,70]
[1,] 0.725789 0.1350288 -1.266985 0.8590279 -1.034951 0.645934 1.528361
[2,] 0.725789 0.1350288 -1.266985 0.8590279 -1.034951 0.645934 1.528361
          [,71]     [,72]      [,73]     [,74]      [,75]    [,76]    [,77]
[1,] -0.6410565 0.6176766 -0.0478552 0.6857668 -0.4463483 1.254331 1.061145
[2,] -0.6410565 0.6176766 -0.0478552 0.6857668 -0.4463483 1.254331 1.061145
         [,78]     [,79]      [,80]    [,81]    [,82]     [,83]      [,84]
[1,] -0.313409 -1.027721 -0.3391669 -1.66813 1.296514 -1.983163 -0.1032817
[2,] -0.313409 -1.027721 -0.3391669 -1.66813 1.296514 -1.983163 -0.1032817
         [,85]     [,86]      [,87]    [,88]     [,89]     [,90]    [,91]
[1,] 0.6147417 -1.049434 0.02625128 -1.16201 0.4072041 -1.046978 1.510237
[2,] 0.6147417 -1.049434 0.02625128 -1.16201 0.4072041 -1.046978 1.510237
        [,92]     [,93]     [,94]     [,95]     [,96]     [,97]      [,98]
[1,] 1.198447 -1.433083 0.0909144 0.7479341 -1.685899 -0.092476 -0.2015249
[2,] 1.198447 -1.433083 0.0909144 0.7479341 -1.685899 -0.092476 -0.2015249
        [,99]   [,100]
[1,] 1.487938 1.112138
[2,] 1.487938 1.112138
> 
> 
> Max(tmp2)
[1] 2.682358
> Min(tmp2)
[1] -2.827475
> mean(tmp2)
[1] 0.09215702
> Sum(tmp2)
[1] 9.215702
> Var(tmp2)
[1] 1.144811
> 
> rowMeans(tmp2)
  [1] -0.146962063  1.096538440 -0.107157813 -0.983499402 -0.344207091
  [6] -0.559085153 -1.002033908  0.157739219 -1.434167940  0.751520972
 [11]  0.453794225  0.727020625 -1.616467828  0.648669909  1.384845051
 [16]  0.173796766  0.974397826  2.665986530 -0.385810029 -0.113214055
 [21]  1.046809546 -0.034941343 -0.592358118  0.008840238  1.258381917
 [26]  0.325987086  0.724182951 -0.015077883  2.139831701  0.564903071
 [31] -0.162242302 -0.894338785 -0.673360188 -1.962552604 -0.791350311
 [36] -0.143713634 -1.741939707 -1.083093128  1.074859973  0.210151740
 [41] -1.342362297 -0.411802121  0.104988366  0.346020772 -1.611540191
 [46]  0.655851168  0.867294070  2.241597137 -0.122750251  0.262369754
 [51]  0.058292268 -1.143183095  0.508693115  0.662715406 -0.451467570
 [56]  1.059239058  0.214949483  0.752234967 -0.407274379 -1.402658412
 [61]  0.714896426 -0.536959743 -0.128956826  0.506371148  0.405249861
 [66] -0.318090472 -0.222873495  0.637904998 -1.117145940 -2.386707625
 [71]  1.107288374  2.682357559 -0.432694904 -2.827475078  0.125912397
 [76]  0.086767263 -1.543091197  2.142908358  0.409192156 -1.189191590
 [81] -0.133596104  0.642179514  1.538286927  2.385230038  1.333747813
 [86]  0.290904906  0.986198650  1.021503458 -0.694186677  1.692752861
 [91] -0.204901116  0.775461913 -0.893060431  0.292195399  0.872181037
 [96]  0.522711688 -1.372129692 -1.509030082  0.255555755  0.856143103
> rowSums(tmp2)
  [1] -0.146962063  1.096538440 -0.107157813 -0.983499402 -0.344207091
  [6] -0.559085153 -1.002033908  0.157739219 -1.434167940  0.751520972
 [11]  0.453794225  0.727020625 -1.616467828  0.648669909  1.384845051
 [16]  0.173796766  0.974397826  2.665986530 -0.385810029 -0.113214055
 [21]  1.046809546 -0.034941343 -0.592358118  0.008840238  1.258381917
 [26]  0.325987086  0.724182951 -0.015077883  2.139831701  0.564903071
 [31] -0.162242302 -0.894338785 -0.673360188 -1.962552604 -0.791350311
 [36] -0.143713634 -1.741939707 -1.083093128  1.074859973  0.210151740
 [41] -1.342362297 -0.411802121  0.104988366  0.346020772 -1.611540191
 [46]  0.655851168  0.867294070  2.241597137 -0.122750251  0.262369754
 [51]  0.058292268 -1.143183095  0.508693115  0.662715406 -0.451467570
 [56]  1.059239058  0.214949483  0.752234967 -0.407274379 -1.402658412
 [61]  0.714896426 -0.536959743 -0.128956826  0.506371148  0.405249861
 [66] -0.318090472 -0.222873495  0.637904998 -1.117145940 -2.386707625
 [71]  1.107288374  2.682357559 -0.432694904 -2.827475078  0.125912397
 [76]  0.086767263 -1.543091197  2.142908358  0.409192156 -1.189191590
 [81] -0.133596104  0.642179514  1.538286927  2.385230038  1.333747813
 [86]  0.290904906  0.986198650  1.021503458 -0.694186677  1.692752861
 [91] -0.204901116  0.775461913 -0.893060431  0.292195399  0.872181037
 [96]  0.522711688 -1.372129692 -1.509030082  0.255555755  0.856143103
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.146962063  1.096538440 -0.107157813 -0.983499402 -0.344207091
  [6] -0.559085153 -1.002033908  0.157739219 -1.434167940  0.751520972
 [11]  0.453794225  0.727020625 -1.616467828  0.648669909  1.384845051
 [16]  0.173796766  0.974397826  2.665986530 -0.385810029 -0.113214055
 [21]  1.046809546 -0.034941343 -0.592358118  0.008840238  1.258381917
 [26]  0.325987086  0.724182951 -0.015077883  2.139831701  0.564903071
 [31] -0.162242302 -0.894338785 -0.673360188 -1.962552604 -0.791350311
 [36] -0.143713634 -1.741939707 -1.083093128  1.074859973  0.210151740
 [41] -1.342362297 -0.411802121  0.104988366  0.346020772 -1.611540191
 [46]  0.655851168  0.867294070  2.241597137 -0.122750251  0.262369754
 [51]  0.058292268 -1.143183095  0.508693115  0.662715406 -0.451467570
 [56]  1.059239058  0.214949483  0.752234967 -0.407274379 -1.402658412
 [61]  0.714896426 -0.536959743 -0.128956826  0.506371148  0.405249861
 [66] -0.318090472 -0.222873495  0.637904998 -1.117145940 -2.386707625
 [71]  1.107288374  2.682357559 -0.432694904 -2.827475078  0.125912397
 [76]  0.086767263 -1.543091197  2.142908358  0.409192156 -1.189191590
 [81] -0.133596104  0.642179514  1.538286927  2.385230038  1.333747813
 [86]  0.290904906  0.986198650  1.021503458 -0.694186677  1.692752861
 [91] -0.204901116  0.775461913 -0.893060431  0.292195399  0.872181037
 [96]  0.522711688 -1.372129692 -1.509030082  0.255555755  0.856143103
> rowMin(tmp2)
  [1] -0.146962063  1.096538440 -0.107157813 -0.983499402 -0.344207091
  [6] -0.559085153 -1.002033908  0.157739219 -1.434167940  0.751520972
 [11]  0.453794225  0.727020625 -1.616467828  0.648669909  1.384845051
 [16]  0.173796766  0.974397826  2.665986530 -0.385810029 -0.113214055
 [21]  1.046809546 -0.034941343 -0.592358118  0.008840238  1.258381917
 [26]  0.325987086  0.724182951 -0.015077883  2.139831701  0.564903071
 [31] -0.162242302 -0.894338785 -0.673360188 -1.962552604 -0.791350311
 [36] -0.143713634 -1.741939707 -1.083093128  1.074859973  0.210151740
 [41] -1.342362297 -0.411802121  0.104988366  0.346020772 -1.611540191
 [46]  0.655851168  0.867294070  2.241597137 -0.122750251  0.262369754
 [51]  0.058292268 -1.143183095  0.508693115  0.662715406 -0.451467570
 [56]  1.059239058  0.214949483  0.752234967 -0.407274379 -1.402658412
 [61]  0.714896426 -0.536959743 -0.128956826  0.506371148  0.405249861
 [66] -0.318090472 -0.222873495  0.637904998 -1.117145940 -2.386707625
 [71]  1.107288374  2.682357559 -0.432694904 -2.827475078  0.125912397
 [76]  0.086767263 -1.543091197  2.142908358  0.409192156 -1.189191590
 [81] -0.133596104  0.642179514  1.538286927  2.385230038  1.333747813
 [86]  0.290904906  0.986198650  1.021503458 -0.694186677  1.692752861
 [91] -0.204901116  0.775461913 -0.893060431  0.292195399  0.872181037
 [96]  0.522711688 -1.372129692 -1.509030082  0.255555755  0.856143103
> 
> colMeans(tmp2)
[1] 0.09215702
> colSums(tmp2)
[1] 9.215702
> colVars(tmp2)
[1] 1.144811
> colSd(tmp2)
[1] 1.069958
> colMax(tmp2)
[1] 2.682358
> colMin(tmp2)
[1] -2.827475
> colMedians(tmp2)
[1] 0.1418258
> colRanges(tmp2)
          [,1]
[1,] -2.827475
[2,]  2.682358
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.5973253 -2.3889393 -1.1682659  3.5401162  3.0633432  1.1164486
 [7]  2.1954097 -3.8583457 -0.7598819 -3.4766062
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.15567725
[2,] -1.18163008
[3,]  0.05612961
[4,]  1.21661180
[5,]  1.80123677
> 
> rowApply(tmp,sum)
 [1] -4.6077625  2.3788708  0.9021876  3.6560103 -2.6107440 -2.4947005
 [7] -1.2548402 -2.9931185  0.4199186  4.2701319
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    9    1    9    6    8    6    2    3     9
 [2,]   10    2    9    1    1    5    7    7    2     3
 [3,]    7    8    7    3    3    6    8    8    1     1
 [4,]    8    6   10    5   10    9   10    4    4     4
 [5,]    4    7    6    4    2    2    9    9   10     6
 [6,]    6   10    5    8    4    4    5    1    5    10
 [7,]    2    3    4    6    7   10    3   10    7     7
 [8,]    3    4    8    2    9    1    2    3    8     2
 [9,]    9    1    2   10    8    7    4    5    9     8
[10,]    5    5    3    7    5    3    1    6    6     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.21773978  1.68404124 -1.14026093  4.14543602  2.13501043 -0.71053924
 [7]  1.67336905 -1.43721285  0.20887873 -2.89519553  0.80708770 -4.89248465
[13]  1.37673973 -1.45984262  3.63591012 -1.66208174 -1.72046444 -1.08338630
[19] -0.08795984  0.12675609
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.4097733
[2,] -0.2103891
[3,] -0.1195827
[4,]  0.4728639
[5,]  0.4846210
> 
> rowApply(tmp,sum)
[1]   7.8429101  -3.5478114  -0.8248933   6.6638380 -11.2125027
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    8   13    8   15
[2,]   19   15    9   16    5
[3,]   17    4    3   11   11
[4,]   14   20   10   13   18
[5,]   13   19   20    4   14
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.1195827  1.7084406  1.3710336  0.8064451  0.7807280  1.6714917
[2,] -0.4097733  0.1863742 -1.0155129  1.5487083  1.3503579  0.7761924
[3,]  0.4846210 -0.3859549 -1.2537472 -0.1696321  1.6078058  0.9593656
[4,]  0.4728639  1.1705407  0.5186077  1.0347693 -1.2268954 -2.8190830
[5,] -0.2103891 -0.9953594 -0.7606421  0.9251455 -0.3769859 -1.2985059
            [,7]       [,8]       [,9]      [,10]       [,11]       [,12]
[1,]  0.76939579  1.2381356  2.1752837  0.3533512  0.82766748 -1.15797671
[2,]  0.09216921 -2.2306334 -0.0258447  0.6422442 -0.43904777 -0.08811841
[3,] -0.77232472  0.2639130  0.7323002 -1.7218425  0.28443056 -2.15403287
[4,]  0.50102415  0.1858274 -1.2619385 -0.9675312  0.18189283  0.73831850
[5,]  1.08310462 -0.8944554 -1.4109220 -1.2014173 -0.04785541 -2.23067515
          [,13]        [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.4758466 -0.009777193  0.3342119 -0.4918397 -0.9102770 -0.5915387
[2,]  0.6986053 -1.564824515 -0.9233200 -0.5291643  0.1096302 -1.0902364
[3,] -0.5202249 -0.430280888  0.9510702 -1.0817435  1.0527313  0.9690343
[4,]  1.5739736  1.421674995  2.3304077  1.0630511 -1.2903252  0.5041700
[5,] -0.8514609 -0.876635020  0.9435403 -0.6223852 -0.6822238 -0.8748155
           [,19]      [,20]
[1,] -0.58936217 -0.7987671
[2,] -0.36543992 -0.2701773
[3,] -0.62867766  0.9882959
[4,]  1.48640255  1.0460870
[5,]  0.00911736 -0.8386824
> 
> 
> 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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1       col2       col3       col4       col5      col6       col7
row1 0.6334711 -0.8696473 -0.6860389 -0.2398405 -0.5885545 0.1647014 -0.3983257
           col8      col9      col10      col11     col12     col13      col14
row1 0.00101692 0.3911626 -0.1378311 -0.2672302 -1.207313 0.7657744 -0.8809104
         col15    col16      col17      col18       col19     col20
row1 0.5869923 2.448282 -0.7576262 -0.6575505 -0.08370176 -1.207949
> tmp[,"col10"]
          col10
row1 -0.1378311
row2 -1.1408456
row3 -1.2123147
row4 -0.3310541
row5  0.9177666
> tmp[c("row1","row5"),]
           col1       col2       col3       col4         col5      col6
row1  0.6334711 -0.8696473 -0.6860389 -0.2398405 -0.588554478 0.1647014
row5 -0.8651513 -1.6817973 -0.5216411  1.5758976  0.006404249 1.0954367
           col7        col8      col9      col10      col11     col12
row1 -0.3983257  0.00101692 0.3911626 -0.1378311 -0.2672302 -1.207313
row5 -0.1612060 -0.04541179 0.1163696  0.9177666  0.7047654 -1.566431
          col13      col14      col15       col16      col17      col18
row1  0.7657744 -0.8809104  0.5869923  2.44828239 -0.7576262 -0.6575505
row5 -1.0656630 -0.7559652 -0.2854789 -0.05492403  0.1039390 -0.7403215
           col19      col20
row1 -0.08370176 -1.2079488
row5  0.85968938 -0.3068882
> tmp[,c("col6","col20")]
           col6      col20
row1  0.1647014 -1.2079488
row2  0.4178159 -0.1739749
row3 -0.2259531  0.5995211
row4 -0.4826303  1.6471509
row5  1.0954367 -0.3068882
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.1647014 -1.2079488
row5 1.0954367 -0.3068882
> 
> 
> 
> 
> 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 51.16193 48.14124 49.03217 50.41236 48.89551 105.8888 48.30667 50.88675
         col9    col10    col11    col12    col13   col14    col15    col16
row1 49.49158 51.02459 50.79102 50.94387 52.20592 51.5933 49.54612 50.29595
        col17    col18    col19    col20
row1 50.29663 49.66874 49.55694 104.6529
> tmp[,"col10"]
        col10
row1 51.02459
row2 30.09443
row3 30.92328
row4 30.12503
row5 49.29816
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.16193 48.14124 49.03217 50.41236 48.89551 105.8888 48.30667 50.88675
row5 49.04793 49.53092 50.03453 51.38710 51.56013 105.3850 50.55793 48.18411
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.49158 51.02459 50.79102 50.94387 52.20592 51.59330 49.54612 50.29595
row5 49.48873 49.29816 50.00559 51.64753 48.81021 48.92743 49.05536 49.07771
        col17    col18    col19    col20
row1 50.29663 49.66874 49.55694 104.6529
row5 50.26104 49.27646 49.16066 105.4891
> tmp[,c("col6","col20")]
          col6     col20
row1 105.88875 104.65294
row2  75.40766  75.44993
row3  75.19313  75.10152
row4  75.09801  75.56545
row5 105.38500 105.48906
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.8888 104.6529
row5 105.3850 105.4891
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.8888 104.6529
row5 105.3850 105.4891
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.9731717
[2,]  0.2774488
[3,] -0.7870454
[4,]  2.4499708
[5,] -0.1276951
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.4919058 -0.3969698
[2,] -0.8019958 -0.1055943
[3,] -0.1029311  0.4625524
[4,] -0.8426818 -1.2235910
[5,] -0.9267438  0.0257407
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.5955923  0.2742834
[2,]  1.5610254  1.4596052
[3,] -1.8969576 -2.4068205
[4,]  0.1580256 -0.5802902
[5,]  0.7036844 -0.5971251
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5955923
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5955923
[2,]  1.5610254
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
row3  0.3373396 -0.4277730  0.1207873 -0.2077676  0.03928616  0.7421336
row1 -1.1027397  0.1711923 -1.1647678 -0.1043106 -0.58470011 -0.1611131
           [,7]       [,8]       [,9]      [,10]       [,11]     [,12]
row3  0.1477092 1.04108160  0.1465544 -0.2374543  0.22546997 1.3165504
row1 -0.4055345 0.08398215 -0.5294688  0.1191676 -0.07147103 0.7601064
           [,13]     [,14]       [,15]     [,16]      [,17]     [,18]
row3 -0.74636978 1.0085046  0.24577278 1.0500969  1.2675865 0.4456893
row1 -0.04707526 0.9610429 -0.08628632 0.8101925 -0.2593064 0.1409782
          [,19]      [,20]
row3 -0.2061187 -0.3979345
row1 -1.3775151  0.4304815
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
            [,1]     [,2]       [,3]      [,4]      [,5]      [,6]       [,7]
row2 -0.06021317 -1.89713 -0.4888685 -1.736612 -0.493163 0.7608921 -0.2583112
          [,8]       [,9]    [,10]
row2 -1.854734 -0.2456729 1.515261
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]      [,3]      [,4]     [,5]      [,6]     [,7]
row5 -0.7725046 -0.3057188 -2.019812 -1.423299 1.575524 0.8541237 1.928505
           [,8]       [,9]    [,10]     [,11]     [,12]    [,13]     [,14]
row5 -0.6360668 -0.4783575 1.518585 0.1624534 -2.152614 1.778578 0.9475576
         [,15]     [,16]     [,17]    [,18]     [,19]    [,20]
row5 0.6903577 0.1566349 0.3639349 2.118912 0.1281491 0.606814
> 
> 
> 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: 0x6000038bc240>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa21315eb1f0c"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2137f435811"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2131e4b055d"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2134f4d2c34"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa21353913298"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2136190c404"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa213673514a6"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2134dded339"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2135ffd6b1f"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2137683f174"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa21350613375"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa2131d796f8d"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa213f8aa119" 
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa21356567847"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMa21346f2a999"
> 
> 
> ### 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: 0x6000038acba0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000038acba0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000038acba0>
> rowMedians(tmp)
  [1]  0.4395154176  0.3989052997  0.0008830906  0.1776071662 -0.0334817628
  [6]  0.1043812561  0.0217236528 -0.2429784503 -0.1276477201 -0.2293800186
 [11] -0.2114549969 -0.0747099146  0.4820512948 -0.7873318057  0.0022271873
 [16]  0.0597164118  0.1400519617  0.2245085175 -0.0761147046  0.0955804477
 [21]  0.2022461011  0.2775708976 -0.4440973632 -0.3871623578  0.1092655556
 [26]  0.3600641974 -0.0720875068 -0.0942406880 -0.0292766201 -0.0619353644
 [31] -0.2818322399  0.1100242644 -0.3498235721  0.1062900576 -0.2617919395
 [36] -0.0828687054 -0.0334243155  0.6854488099 -0.6055857303  0.2649329360
 [41]  0.3524224432  0.2649001955 -0.0629454198  0.3120973671  0.7612135759
 [46] -0.0461221250 -0.0892425327  0.0148242168  0.7466105629 -0.0586305029
 [51] -0.1054908035  0.2342805085 -0.5489049369  0.1477293283  0.6239842123
 [56]  0.0421371448  0.1717739566 -0.2560607824 -0.3164524555  0.2729200264
 [61]  0.2881428987 -0.2175132986 -0.0031343737  0.4081030123 -0.1547678692
 [66]  0.7505247550  0.5320332896  0.3003631620 -0.0843738800  0.2524825531
 [71]  0.1729147149  0.7750313929 -0.3637450296 -0.2006682945 -0.1153979542
 [76] -0.2129466504 -0.1680905709 -0.0900376466  0.4255183276 -0.1780633984
 [81]  0.3072924022  0.6423919326 -0.2759644541 -0.0225111684 -0.1222689450
 [86]  0.1668038414  0.2761470801 -0.0230815567  0.6275016014  0.2603186783
 [91] -0.2692465597  0.4353233123 -0.3991243043 -0.1972693591 -0.2729010505
 [96]  0.1327149110 -0.0515568227 -0.2471318456  0.4869669756  0.1081910082
[101] -0.3457964122  0.0168337249 -0.1215179660  0.0696032889  0.2253790521
[106] -0.2775720970  0.4351296807 -0.2490479333 -0.4183145645 -0.3761667762
[111] -0.2068104238  0.4025841607 -0.5754027044 -0.0255932181  0.4212229334
[116]  0.4863306723  0.2856343816  0.1274059485  0.2430829388  0.0080229085
[121]  0.0238554623  0.4339380830  0.1270690098 -0.2727412475 -0.3398006211
[126] -0.3179937574 -0.0369906739 -0.3982966120  0.5236902535 -0.2006897080
[131] -0.5134363239  0.1037028167 -0.0646862212  0.4715732200 -0.1470490586
[136]  0.1557513112 -0.1462121585 -0.1067682171 -0.1901057658 -0.1149087357
[141] -0.0690569645 -0.0933593856 -0.1073541104  0.0984075030  0.4255403473
[146]  0.2661353958 -0.0583058312 -0.0486864039 -0.3244021629 -0.1407010050
[151]  0.0424872067 -0.0615089638  0.1843514217  0.2463205843  0.2942582488
[156]  0.0545398329 -0.4334425087 -0.1775064376 -0.1952860835  0.0896497881
[161]  0.1644202529 -0.0108997234 -0.0732934286 -0.0860201675 -0.0333699600
[166] -0.1564196197 -0.1707577849  0.3380546488 -0.0497602177  0.0393134611
[171]  0.0035089098  0.0616837156  0.0743405067  0.0701751821 -0.1225982223
[176]  0.1799031179 -0.2398252006 -0.3305740777  0.0373865523  0.0179617312
[181]  0.1810912270  0.2145552573 -0.2271328800  0.4485769893 -0.0806389358
[186] -0.2120927514 -0.1169874946  0.4754395519  0.1042333826 -0.0891777362
[191]  0.2412939697 -0.7639320987  0.4924045026  0.3086861635  0.6466225518
[196]  0.2662106346 -0.1442258560 -0.2349616143 -0.1792843108 -0.4227061746
[201] -1.1317636956  0.0779746715  0.0146931269  0.1760191136  0.5409031164
[206] -0.0189357609 -0.3298990351  0.2788413946 -0.1317321369  0.0605260227
[211] -0.0041999412  0.4120762591 -0.0901306673  0.1665484683  0.1259534339
[216]  0.3270903861  0.9581127442 -0.1039618229 -0.2584467694 -0.1309227046
[221]  0.2623579995 -0.0818388378 -0.5930144533  0.5416461905  0.4370506879
[226] -0.3107065776 -0.3342898301  0.3031685721  0.0383027971  0.0977642739
> 
> proc.time()
   user  system elapsed 
  2.085   8.737  11.424 

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: 0x600003aa4120>
> .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: 0x600003aa4120>
> .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: 0x600003aa4120>
> .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: 0x600003aa4120>
> 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: 0x600003aac3c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003aac3c0>
> .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: 0x600003aac3c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003aac3c0>
> .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: 0x600003aac3c0>
> 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: 0x600003aac5a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003aac5a0>
> .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: 0x600003aac5a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003aac5a0>
> .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: 0x600003aac5a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003aac5a0>
> .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: 0x600003aac5a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003aac5a0>
> .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: 0x600003aac5a0>
> 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: 0x600003aac780>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003aac780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003aac780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003aac780>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea38f67ed41b9" "BufferedMatrixFilea38f6f0da19c"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea38f67ed41b9" "BufferedMatrixFilea38f6f0da19c"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003aaca20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003aaca20>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003aaca20>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003aaca20>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003aaca20>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003aaca20>
> .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: 0x600003aa8960>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003aa8960>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003aa8960>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003aa8960>
> 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: 0x600003aa8b40>
> .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: 0x600003aa8b40>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.341   0.116   0.445 

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.336   0.092   0.424 

Example timings