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

This page was generated on 2025-06-19 12:04 -0400 (Thu, 19 Jun 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.2 LTS)x86_644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4810
palomino8Windows Server 2022 Datacenterx644.5.0 (2025-04-11 ucrt) -- "How About a Twenty-Six" 4548
kjohnson3macOS 13.7.1 Venturaarm644.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six" 4528
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4493
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 250/2309HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-06-18 13:25 -0400 (Wed, 18 Jun 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-06-18 18:20:42 -0400 (Wed, 18 Jun 2025)
EndedAt: 2025-06-18 18:20:58 -0400 (Wed, 18 Jun 2025)
EllapsedTime: 16.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 Patched (2025-04-21 r88169)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 16.0.0 (clang-1600.0.26.6)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.1
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 1 WARNING, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six"
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.111   0.041   0.148 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480809 25.7    1056570 56.5         NA   634340 33.9
Vcells 890978  6.8    8388608 64.0     196608  2109658 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] "Wed Jun 18 18:20:51 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] "Wed Jun 18 18:20:51 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: 0x600003368000>
> 
> 
> 
> 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] "Wed Jun 18 18:20:52 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] "Wed Jun 18 18:20:52 2025"
> 
> ColMode(tmp2)
<pointer: 0x600003368000>
> 
> 
> 
> ### 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,] 98.6081189  1.3165675  0.4135951  0.6384698
[2,] -0.2870285 -0.4123004  0.8387638 -0.0718987
[3,]  0.7260045  0.3644875 -2.3320882 -3.5300452
[4,]  0.4845135 -0.8717581  1.0383076 -0.8765256
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 98.6081189 1.3165675 0.4135951 0.6384698
[2,]  0.2870285 0.4123004 0.8387638 0.0718987
[3,]  0.7260045 0.3644875 2.3320882 3.5300452
[4,]  0.4845135 0.8717581 1.0383076 0.8765256
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9301621 1.1474177 0.6431136 0.7990430
[2,] 0.5357504 0.6421062 0.9158405 0.2681393
[3,] 0.8520590 0.6037280 1.5271176 1.8788415
[4,] 0.6960700 0.9336799 1.0189738 0.9362295
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 222.90974 37.79074 31.84473 33.62890
[2,]  30.64453 31.83336 34.99717 27.75329
[3,]  34.24659 31.40177 42.60326 47.31846
[4,]  32.44521 35.20856 36.22805 35.23882
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003364000>
> exp(tmp5)
<pointer: 0x600003364000>
> log(tmp5,2)
<pointer: 0x600003364000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 463.9574
> Min(tmp5)
[1] 52.51605
> mean(tmp5)
[1] 71.63529
> Sum(tmp5)
[1] 14327.06
> Var(tmp5)
[1] 846.7005
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.60321 69.65327 73.39685 70.18989 68.70081 68.01277 69.40610 69.88309
 [9] 67.27462 70.23226
> rowSums(tmp5)
 [1] 1792.064 1393.065 1467.937 1403.798 1374.016 1360.255 1388.122 1397.662
 [9] 1345.492 1404.645
> rowVars(tmp5)
 [1] 7798.63205   60.65764  112.99210  114.91511   81.16278   42.44814
 [7]   63.15591   44.67681   82.93516   63.63032
> rowSd(tmp5)
 [1] 88.309864  7.788301 10.629774 10.719846  9.009039  6.515224  7.947069
 [8]  6.684072  9.106875  7.976862
> rowMax(tmp5)
 [1] 463.95742  83.31209  98.48717  93.11057  89.25081  82.41935  87.62581
 [8]  81.38898  87.29711  90.76845
> rowMin(tmp5)
 [1] 58.37094 56.29391 57.62351 55.47885 52.51605 59.23872 56.88337 58.51186
 [9] 53.34695 59.04466
> 
> colMeans(tmp5)
 [1] 108.04549  67.58144  71.88884  71.37965  71.28361  71.58595  70.40507
 [8]  74.35338  65.37055  69.26657  68.22945  66.10569  70.30446  72.75684
[15]  70.34960  69.60649  70.66506  70.30555  65.59308  67.62897
> colSums(tmp5)
 [1] 1080.4549  675.8144  718.8884  713.7965  712.8361  715.8595  704.0507
 [8]  743.5338  653.7055  692.6657  682.2945  661.0569  703.0446  727.5684
[15]  703.4960  696.0649  706.6506  703.0555  655.9308  676.2897
> colVars(tmp5)
 [1] 15667.44988    63.91706    75.18238   140.30418    56.44003    88.52674
 [7]    67.43932    95.22705    50.32861    84.70144    52.29909   109.80751
[13]    59.72694    72.16917    79.30119    51.57137    25.33143   117.99214
[19]    40.70480    53.74155
> colSd(tmp5)
 [1] 125.169684   7.994814   8.670777  11.845007   7.512658   9.408865
 [7]   8.212145   9.758435   7.094266   9.203339   7.231811  10.478908
[13]   7.728320   8.495244   8.905122   7.181321   5.033034  10.862419
[19]   6.380032   7.330863
> colMax(tmp5)
 [1] 463.95742  78.65648  88.67311  98.48717  82.41935  87.29711  83.58872
 [8]  90.76845  77.25479  89.25081  80.54096  82.03809  82.57484  87.62581
[15]  93.11057  83.31209  78.05157  91.65246  75.82961  76.67081
> colMin(tmp5)
 [1] 58.06347 57.43829 56.71356 56.88337 59.67780 56.50070 61.33432 62.40588
 [9] 57.06841 55.47885 59.23872 56.18382 56.29391 55.84268 58.37094 58.87545
[17] 61.34253 54.09580 53.34695 52.51605
> 
> 
> ### 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] 89.60321 69.65327 73.39685 70.18989 68.70081 68.01277 69.40610 69.88309
 [9] 67.27462       NA
> rowSums(tmp5)
 [1] 1792.064 1393.065 1467.937 1403.798 1374.016 1360.255 1388.122 1397.662
 [9] 1345.492       NA
> rowVars(tmp5)
 [1] 7798.63205   60.65764  112.99210  114.91511   81.16278   42.44814
 [7]   63.15591   44.67681   82.93516   64.84345
> rowSd(tmp5)
 [1] 88.309864  7.788301 10.629774 10.719846  9.009039  6.515224  7.947069
 [8]  6.684072  9.106875  8.052543
> rowMax(tmp5)
 [1] 463.95742  83.31209  98.48717  93.11057  89.25081  82.41935  87.62581
 [8]  81.38898  87.29711        NA
> rowMin(tmp5)
 [1] 58.37094 56.29391 57.62351 55.47885 52.51605 59.23872 56.88337 58.51186
 [9] 53.34695       NA
> 
> colMeans(tmp5)
 [1] 108.04549  67.58144  71.88884  71.37965  71.28361  71.58595        NA
 [8]  74.35338  65.37055  69.26657  68.22945  66.10569  70.30446  72.75684
[15]  70.34960  69.60649  70.66506  70.30555  65.59308  67.62897
> colSums(tmp5)
 [1] 1080.4549  675.8144  718.8884  713.7965  712.8361  715.8595        NA
 [8]  743.5338  653.7055  692.6657  682.2945  661.0569  703.0446  727.5684
[15]  703.4960  696.0649  706.6506  703.0555  655.9308  676.2897
> colVars(tmp5)
 [1] 15667.44988    63.91706    75.18238   140.30418    56.44003    88.52674
 [7]          NA    95.22705    50.32861    84.70144    52.29909   109.80751
[13]    59.72694    72.16917    79.30119    51.57137    25.33143   117.99214
[19]    40.70480    53.74155
> colSd(tmp5)
 [1] 125.169684   7.994814   8.670777  11.845007   7.512658   9.408865
 [7]         NA   9.758435   7.094266   9.203339   7.231811  10.478908
[13]   7.728320   8.495244   8.905122   7.181321   5.033034  10.862419
[19]   6.380032   7.330863
> colMax(tmp5)
 [1] 463.95742  78.65648  88.67311  98.48717  82.41935  87.29711        NA
 [8]  90.76845  77.25479  89.25081  80.54096  82.03809  82.57484  87.62581
[15]  93.11057  83.31209  78.05157  91.65246  75.82961  76.67081
> colMin(tmp5)
 [1] 58.06347 57.43829 56.71356 56.88337 59.67780 56.50070       NA 62.40588
 [9] 57.06841 55.47885 59.23872 56.18382 56.29391 55.84268 58.37094 58.87545
[17] 61.34253 54.09580 53.34695 52.51605
> 
> Max(tmp5,na.rm=TRUE)
[1] 463.9574
> Min(tmp5,na.rm=TRUE)
[1] 52.51605
> mean(tmp5,na.rm=TRUE)
[1] 71.674
> Sum(tmp5,na.rm=TRUE)
[1] 14263.13
> Var(tmp5,na.rm=TRUE)
[1] 850.6755
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.60321 69.65327 73.39685 70.18989 68.70081 68.01277 69.40610 69.88309
 [9] 67.27462 70.56389
> rowSums(tmp5,na.rm=TRUE)
 [1] 1792.064 1393.065 1467.937 1403.798 1374.016 1360.255 1388.122 1397.662
 [9] 1345.492 1340.714
> rowVars(tmp5,na.rm=TRUE)
 [1] 7798.63205   60.65764  112.99210  114.91511   81.16278   42.44814
 [7]   63.15591   44.67681   82.93516   64.84345
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.309864  7.788301 10.629774 10.719846  9.009039  6.515224  7.947069
 [8]  6.684072  9.106875  8.052543
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.95742  83.31209  98.48717  93.11057  89.25081  82.41935  87.62581
 [8]  81.38898  87.29711  90.76845
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.37094 56.29391 57.62351 55.47885 52.51605 59.23872 56.88337 58.51186
 [9] 53.34695 59.04466
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.04549  67.58144  71.88884  71.37965  71.28361  71.58595  71.12439
 [8]  74.35338  65.37055  69.26657  68.22945  66.10569  70.30446  72.75684
[15]  70.34960  69.60649  70.66506  70.30555  65.59308  67.62897
> colSums(tmp5,na.rm=TRUE)
 [1] 1080.4549  675.8144  718.8884  713.7965  712.8361  715.8595  640.1195
 [8]  743.5338  653.7055  692.6657  682.2945  661.0569  703.0446  727.5684
[15]  703.4960  696.0649  706.6506  703.0555  655.9308  676.2897
> colVars(tmp5,na.rm=TRUE)
 [1] 15667.44988    63.91706    75.18238   140.30418    56.44003    88.52674
 [7]    70.04811    95.22705    50.32861    84.70144    52.29909   109.80751
[13]    59.72694    72.16917    79.30119    51.57137    25.33143   117.99214
[19]    40.70480    53.74155
> colSd(tmp5,na.rm=TRUE)
 [1] 125.169684   7.994814   8.670777  11.845007   7.512658   9.408865
 [7]   8.369475   9.758435   7.094266   9.203339   7.231811  10.478908
[13]   7.728320   8.495244   8.905122   7.181321   5.033034  10.862419
[19]   6.380032   7.330863
> colMax(tmp5,na.rm=TRUE)
 [1] 463.95742  78.65648  88.67311  98.48717  82.41935  87.29711  83.58872
 [8]  90.76845  77.25479  89.25081  80.54096  82.03809  82.57484  87.62581
[15]  93.11057  83.31209  78.05157  91.65246  75.82961  76.67081
> colMin(tmp5,na.rm=TRUE)
 [1] 58.06347 57.43829 56.71356 56.88337 59.67780 56.50070 61.33432 62.40588
 [9] 57.06841 55.47885 59.23872 56.18382 56.29391 55.84268 58.37094 58.87545
[17] 61.34253 54.09580 53.34695 52.51605
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.60321 69.65327 73.39685 70.18989 68.70081 68.01277 69.40610 69.88309
 [9] 67.27462      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1792.064 1393.065 1467.937 1403.798 1374.016 1360.255 1388.122 1397.662
 [9] 1345.492    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7798.63205   60.65764  112.99210  114.91511   81.16278   42.44814
 [7]   63.15591   44.67681   82.93516         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.309864  7.788301 10.629774 10.719846  9.009039  6.515224  7.947069
 [8]  6.684072  9.106875        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.95742  83.31209  98.48717  93.11057  89.25081  82.41935  87.62581
 [8]  81.38898  87.29711        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.37094 56.29391 57.62351 55.47885 52.51605 59.23872 56.88337 58.51186
 [9] 53.34695       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.33859  68.38185  71.92515  71.61563  72.57314  70.84493       NaN
 [8]  72.52948  65.64808  69.28431  68.57168  65.37460  69.64286  71.86817
[15]  69.91126  69.41187  70.69945  69.60581  65.88954  68.58279
> colSums(tmp5,na.rm=TRUE)
 [1] 1011.0473  615.4366  647.3263  644.5407  653.1583  637.6044    0.0000
 [8]  652.7653  590.8327  623.5588  617.1451  588.3714  626.7857  646.8135
[15]  629.2014  624.7069  636.2951  626.4523  593.0059  617.2451
> colVars(tmp5,na.rm=TRUE)
 [1] 17418.53575    64.69940    84.56534   157.21574    44.78741    93.41510
 [7]          NA    69.70620    55.75321    95.28559    57.51889   117.52042
[13]    62.26849    72.30576    87.05233    57.59172    28.48455   127.23267
[19]    44.80414    50.22447
> colSd(tmp5,na.rm=TRUE)
 [1] 131.979300   8.043594   9.195942  12.538570   6.692340   9.665149
 [7]         NA   8.349024   7.466807   9.761434   7.584121  10.840684
[13]   7.891039   8.503279   9.330184   7.588921   5.337092  11.279746
[19]   6.693589   7.086922
> colMax(tmp5,na.rm=TRUE)
 [1] 463.95742  78.65648  88.67311  98.48717  82.41935  87.29711      -Inf
 [8]  89.40133  77.25479  89.25081  80.54096  82.03809  82.57484  87.62581
[15]  93.11057  83.31209  78.05157  91.65246  75.82961  76.67081
> colMin(tmp5,na.rm=TRUE)
 [1] 58.06347 57.43829 56.71356 56.88337 64.60692 56.50070      Inf 62.40588
 [9] 57.06841 55.47885 59.23872 56.18382 56.29391 55.84268 58.37094 58.87545
[17] 61.34253 54.09580 53.34695 52.51605
> 
> 
> 
> 
> 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] 209.8674 246.6339 316.0207 259.5637 287.6330 310.7270 204.8435 257.7771
 [9] 317.8124 243.3613
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 209.8674 246.6339 316.0207 259.5637 287.6330 310.7270 204.8435 257.7771
 [9] 317.8124 243.3613
> 
> 
> 
> 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]  5.684342e-14  5.684342e-14  0.000000e+00  0.000000e+00 -1.705303e-13
 [6]  1.136868e-13 -3.979039e-13  1.705303e-13  2.842171e-14  5.684342e-14
[11] -1.136868e-13 -1.705303e-13 -1.136868e-13  1.136868e-13  0.000000e+00
[16]  4.263256e-14  1.136868e-13  1.136868e-13  4.263256e-14 -5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   20 
3   3 
9   19 
5   18 
6   3 
8   15 
7   5 
1   9 
10   13 
2   20 
5   9 
3   8 
5   18 
7   20 
10   20 
7   3 
3   12 
6   4 
4   9 
2   5 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.250877
> Min(tmp)
[1] -2.591901
> mean(tmp)
[1] -0.1132992
> Sum(tmp)
[1] -11.32992
> Var(tmp)
[1] 0.9173422
> 
> rowMeans(tmp)
[1] -0.1132992
> rowSums(tmp)
[1] -11.32992
> rowVars(tmp)
[1] 0.9173422
> rowSd(tmp)
[1] 0.9577798
> rowMax(tmp)
[1] 2.250877
> rowMin(tmp)
[1] -2.591901
> 
> colMeans(tmp)
  [1] -0.43605778 -0.19318661 -0.06104038  1.01839343  2.25087657  0.20360020
  [7] -0.03471967 -1.60415640 -1.73953327  1.33443178 -1.82327196 -0.30833515
 [13] -0.51700117 -0.46506592  0.84406837 -0.85700792  1.07547081 -1.65519258
 [19]  0.86500164 -1.15036539  1.51292361  0.99899831 -0.42268699 -1.29952540
 [25]  0.20795126 -1.01321626 -0.16821065  0.82554328  0.26283879  0.82094371
 [31] -0.87564513  2.12805372 -1.36695923 -2.22135869  0.05460296 -2.59190144
 [37]  0.88313715 -0.53006106  0.08546511 -0.64371601 -0.36590253 -0.31618564
 [43] -0.63534565  1.27747068 -0.13885625 -0.31938073 -0.07307086  0.91088931
 [49]  0.44148517 -1.66384727  0.62808640 -0.82968128  1.18699402 -0.46702277
 [55] -0.50407578 -0.35153318  0.80853643  1.26995966 -1.90500937 -0.76337811
 [61] -0.66540819 -1.25941895  0.76932555 -0.55630980 -0.12693648 -0.39322975
 [67] -0.63228740 -0.11195262 -0.29931972 -0.99602469 -1.07379904 -0.79879372
 [73]  0.99438152  0.16323456 -1.85769641  0.56039461 -0.02655373 -0.55251278
 [79] -0.18774564  0.78390833  0.22709930 -0.06867965 -0.13829495 -1.25905068
 [85]  0.04396671  0.36985398  0.42313955  0.78414672 -0.31163371  0.44161207
 [91]  0.55548599 -0.12036416  0.03477618  0.52616643  0.36481530 -1.16804086
 [97]  1.51841270  0.87987886  1.36447332 -1.11515350
> colSums(tmp)
  [1] -0.43605778 -0.19318661 -0.06104038  1.01839343  2.25087657  0.20360020
  [7] -0.03471967 -1.60415640 -1.73953327  1.33443178 -1.82327196 -0.30833515
 [13] -0.51700117 -0.46506592  0.84406837 -0.85700792  1.07547081 -1.65519258
 [19]  0.86500164 -1.15036539  1.51292361  0.99899831 -0.42268699 -1.29952540
 [25]  0.20795126 -1.01321626 -0.16821065  0.82554328  0.26283879  0.82094371
 [31] -0.87564513  2.12805372 -1.36695923 -2.22135869  0.05460296 -2.59190144
 [37]  0.88313715 -0.53006106  0.08546511 -0.64371601 -0.36590253 -0.31618564
 [43] -0.63534565  1.27747068 -0.13885625 -0.31938073 -0.07307086  0.91088931
 [49]  0.44148517 -1.66384727  0.62808640 -0.82968128  1.18699402 -0.46702277
 [55] -0.50407578 -0.35153318  0.80853643  1.26995966 -1.90500937 -0.76337811
 [61] -0.66540819 -1.25941895  0.76932555 -0.55630980 -0.12693648 -0.39322975
 [67] -0.63228740 -0.11195262 -0.29931972 -0.99602469 -1.07379904 -0.79879372
 [73]  0.99438152  0.16323456 -1.85769641  0.56039461 -0.02655373 -0.55251278
 [79] -0.18774564  0.78390833  0.22709930 -0.06867965 -0.13829495 -1.25905068
 [85]  0.04396671  0.36985398  0.42313955  0.78414672 -0.31163371  0.44161207
 [91]  0.55548599 -0.12036416  0.03477618  0.52616643  0.36481530 -1.16804086
 [97]  1.51841270  0.87987886  1.36447332 -1.11515350
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.43605778 -0.19318661 -0.06104038  1.01839343  2.25087657  0.20360020
  [7] -0.03471967 -1.60415640 -1.73953327  1.33443178 -1.82327196 -0.30833515
 [13] -0.51700117 -0.46506592  0.84406837 -0.85700792  1.07547081 -1.65519258
 [19]  0.86500164 -1.15036539  1.51292361  0.99899831 -0.42268699 -1.29952540
 [25]  0.20795126 -1.01321626 -0.16821065  0.82554328  0.26283879  0.82094371
 [31] -0.87564513  2.12805372 -1.36695923 -2.22135869  0.05460296 -2.59190144
 [37]  0.88313715 -0.53006106  0.08546511 -0.64371601 -0.36590253 -0.31618564
 [43] -0.63534565  1.27747068 -0.13885625 -0.31938073 -0.07307086  0.91088931
 [49]  0.44148517 -1.66384727  0.62808640 -0.82968128  1.18699402 -0.46702277
 [55] -0.50407578 -0.35153318  0.80853643  1.26995966 -1.90500937 -0.76337811
 [61] -0.66540819 -1.25941895  0.76932555 -0.55630980 -0.12693648 -0.39322975
 [67] -0.63228740 -0.11195262 -0.29931972 -0.99602469 -1.07379904 -0.79879372
 [73]  0.99438152  0.16323456 -1.85769641  0.56039461 -0.02655373 -0.55251278
 [79] -0.18774564  0.78390833  0.22709930 -0.06867965 -0.13829495 -1.25905068
 [85]  0.04396671  0.36985398  0.42313955  0.78414672 -0.31163371  0.44161207
 [91]  0.55548599 -0.12036416  0.03477618  0.52616643  0.36481530 -1.16804086
 [97]  1.51841270  0.87987886  1.36447332 -1.11515350
> colMin(tmp)
  [1] -0.43605778 -0.19318661 -0.06104038  1.01839343  2.25087657  0.20360020
  [7] -0.03471967 -1.60415640 -1.73953327  1.33443178 -1.82327196 -0.30833515
 [13] -0.51700117 -0.46506592  0.84406837 -0.85700792  1.07547081 -1.65519258
 [19]  0.86500164 -1.15036539  1.51292361  0.99899831 -0.42268699 -1.29952540
 [25]  0.20795126 -1.01321626 -0.16821065  0.82554328  0.26283879  0.82094371
 [31] -0.87564513  2.12805372 -1.36695923 -2.22135869  0.05460296 -2.59190144
 [37]  0.88313715 -0.53006106  0.08546511 -0.64371601 -0.36590253 -0.31618564
 [43] -0.63534565  1.27747068 -0.13885625 -0.31938073 -0.07307086  0.91088931
 [49]  0.44148517 -1.66384727  0.62808640 -0.82968128  1.18699402 -0.46702277
 [55] -0.50407578 -0.35153318  0.80853643  1.26995966 -1.90500937 -0.76337811
 [61] -0.66540819 -1.25941895  0.76932555 -0.55630980 -0.12693648 -0.39322975
 [67] -0.63228740 -0.11195262 -0.29931972 -0.99602469 -1.07379904 -0.79879372
 [73]  0.99438152  0.16323456 -1.85769641  0.56039461 -0.02655373 -0.55251278
 [79] -0.18774564  0.78390833  0.22709930 -0.06867965 -0.13829495 -1.25905068
 [85]  0.04396671  0.36985398  0.42313955  0.78414672 -0.31163371  0.44161207
 [91]  0.55548599 -0.12036416  0.03477618  0.52616643  0.36481530 -1.16804086
 [97]  1.51841270  0.87987886  1.36447332 -1.11515350
> colMedians(tmp)
  [1] -0.43605778 -0.19318661 -0.06104038  1.01839343  2.25087657  0.20360020
  [7] -0.03471967 -1.60415640 -1.73953327  1.33443178 -1.82327196 -0.30833515
 [13] -0.51700117 -0.46506592  0.84406837 -0.85700792  1.07547081 -1.65519258
 [19]  0.86500164 -1.15036539  1.51292361  0.99899831 -0.42268699 -1.29952540
 [25]  0.20795126 -1.01321626 -0.16821065  0.82554328  0.26283879  0.82094371
 [31] -0.87564513  2.12805372 -1.36695923 -2.22135869  0.05460296 -2.59190144
 [37]  0.88313715 -0.53006106  0.08546511 -0.64371601 -0.36590253 -0.31618564
 [43] -0.63534565  1.27747068 -0.13885625 -0.31938073 -0.07307086  0.91088931
 [49]  0.44148517 -1.66384727  0.62808640 -0.82968128  1.18699402 -0.46702277
 [55] -0.50407578 -0.35153318  0.80853643  1.26995966 -1.90500937 -0.76337811
 [61] -0.66540819 -1.25941895  0.76932555 -0.55630980 -0.12693648 -0.39322975
 [67] -0.63228740 -0.11195262 -0.29931972 -0.99602469 -1.07379904 -0.79879372
 [73]  0.99438152  0.16323456 -1.85769641  0.56039461 -0.02655373 -0.55251278
 [79] -0.18774564  0.78390833  0.22709930 -0.06867965 -0.13829495 -1.25905068
 [85]  0.04396671  0.36985398  0.42313955  0.78414672 -0.31163371  0.44161207
 [91]  0.55548599 -0.12036416  0.03477618  0.52616643  0.36481530 -1.16804086
 [97]  1.51841270  0.87987886  1.36447332 -1.11515350
> colRanges(tmp)
           [,1]       [,2]        [,3]     [,4]     [,5]      [,6]        [,7]
[1,] -0.4360578 -0.1931866 -0.06104038 1.018393 2.250877 0.2036002 -0.03471967
[2,] -0.4360578 -0.1931866 -0.06104038 1.018393 2.250877 0.2036002 -0.03471967
          [,8]      [,9]    [,10]     [,11]      [,12]      [,13]      [,14]
[1,] -1.604156 -1.739533 1.334432 -1.823272 -0.3083352 -0.5170012 -0.4650659
[2,] -1.604156 -1.739533 1.334432 -1.823272 -0.3083352 -0.5170012 -0.4650659
         [,15]      [,16]    [,17]     [,18]     [,19]     [,20]    [,21]
[1,] 0.8440684 -0.8570079 1.075471 -1.655193 0.8650016 -1.150365 1.512924
[2,] 0.8440684 -0.8570079 1.075471 -1.655193 0.8650016 -1.150365 1.512924
         [,22]     [,23]     [,24]     [,25]     [,26]      [,27]     [,28]
[1,] 0.9989983 -0.422687 -1.299525 0.2079513 -1.013216 -0.1682106 0.8255433
[2,] 0.9989983 -0.422687 -1.299525 0.2079513 -1.013216 -0.1682106 0.8255433
         [,29]     [,30]      [,31]    [,32]     [,33]     [,34]      [,35]
[1,] 0.2628388 0.8209437 -0.8756451 2.128054 -1.366959 -2.221359 0.05460296
[2,] 0.2628388 0.8209437 -0.8756451 2.128054 -1.366959 -2.221359 0.05460296
         [,36]     [,37]      [,38]      [,39]     [,40]      [,41]      [,42]
[1,] -2.591901 0.8831372 -0.5300611 0.08546511 -0.643716 -0.3659025 -0.3161856
[2,] -2.591901 0.8831372 -0.5300611 0.08546511 -0.643716 -0.3659025 -0.3161856
          [,43]    [,44]      [,45]      [,46]       [,47]     [,48]     [,49]
[1,] -0.6353456 1.277471 -0.1388563 -0.3193807 -0.07307086 0.9108893 0.4414852
[2,] -0.6353456 1.277471 -0.1388563 -0.3193807 -0.07307086 0.9108893 0.4414852
         [,50]     [,51]      [,52]    [,53]      [,54]      [,55]      [,56]
[1,] -1.663847 0.6280864 -0.8296813 1.186994 -0.4670228 -0.5040758 -0.3515332
[2,] -1.663847 0.6280864 -0.8296813 1.186994 -0.4670228 -0.5040758 -0.3515332
         [,57]   [,58]     [,59]      [,60]      [,61]     [,62]     [,63]
[1,] 0.8085364 1.26996 -1.905009 -0.7633781 -0.6654082 -1.259419 0.7693256
[2,] 0.8085364 1.26996 -1.905009 -0.7633781 -0.6654082 -1.259419 0.7693256
          [,64]      [,65]      [,66]      [,67]      [,68]      [,69]
[1,] -0.5563098 -0.1269365 -0.3932297 -0.6322874 -0.1119526 -0.2993197
[2,] -0.5563098 -0.1269365 -0.3932297 -0.6322874 -0.1119526 -0.2993197
          [,70]     [,71]      [,72]     [,73]     [,74]     [,75]     [,76]
[1,] -0.9960247 -1.073799 -0.7987937 0.9943815 0.1632346 -1.857696 0.5603946
[2,] -0.9960247 -1.073799 -0.7987937 0.9943815 0.1632346 -1.857696 0.5603946
           [,77]      [,78]      [,79]     [,80]     [,81]       [,82]
[1,] -0.02655373 -0.5525128 -0.1877456 0.7839083 0.2270993 -0.06867965
[2,] -0.02655373 -0.5525128 -0.1877456 0.7839083 0.2270993 -0.06867965
         [,83]     [,84]      [,85]    [,86]     [,87]     [,88]      [,89]
[1,] -0.138295 -1.259051 0.04396671 0.369854 0.4231396 0.7841467 -0.3116337
[2,] -0.138295 -1.259051 0.04396671 0.369854 0.4231396 0.7841467 -0.3116337
         [,90]    [,91]      [,92]      [,93]     [,94]     [,95]     [,96]
[1,] 0.4416121 0.555486 -0.1203642 0.03477618 0.5261664 0.3648153 -1.168041
[2,] 0.4416121 0.555486 -0.1203642 0.03477618 0.5261664 0.3648153 -1.168041
        [,97]     [,98]    [,99]    [,100]
[1,] 1.518413 0.8798789 1.364473 -1.115153
[2,] 1.518413 0.8798789 1.364473 -1.115153
> 
> 
> Max(tmp2)
[1] 2.363119
> Min(tmp2)
[1] -2.071269
> mean(tmp2)
[1] 0.1896427
> Sum(tmp2)
[1] 18.96427
> Var(tmp2)
[1] 1.150422
> 
> rowMeans(tmp2)
  [1]  1.37618670 -0.56225054  2.16322593 -0.64045637  0.20523893  1.16672577
  [7] -0.19440540  1.48841280 -0.55411568  0.98878550 -1.59456116  1.23104966
 [13] -1.77558453 -0.11032418  0.87207653 -1.55527482 -0.22471185  0.56954173
 [19]  1.32184494  0.59849616  0.36446656  1.81148466  0.35065127 -1.71534326
 [25]  0.29002145  0.91783117  1.07437823  0.73350720  0.44440041  1.40351977
 [31]  0.56907578 -0.48640638 -0.24281627  0.23629110  1.08224326  2.36311876
 [37] -1.60887796 -0.03110610  0.78846385 -0.79857031 -0.34183079  0.47978645
 [43]  0.76251100 -1.11302121  0.49801605 -1.16886506 -0.80448490 -0.36875858
 [49]  2.33142812 -0.14520540  0.17329831 -1.31093574 -0.14918050  0.51213027
 [55]  2.19696567 -1.25723578  1.53884554  0.69189142  0.46970390 -0.26835176
 [61]  0.48752148  1.92196915 -1.67635039 -2.07126938 -0.27197413 -0.87001075
 [67]  0.65850179  0.73725694  1.23564724  1.12354153  0.54219412 -1.02539112
 [73] -1.32639644 -1.78037266  0.58424679 -0.08925369  1.26175220 -1.51763681
 [79]  0.41078569 -0.33709071  0.36706267 -1.68217733  0.05240268 -1.94802390
 [85]  1.63798172  0.35807682  0.88610759  1.89986714  0.47178655 -0.45576372
 [91]  1.77569096  0.27744060  1.24376252  0.16420015  0.92205569 -0.89103428
 [97]  0.58849921  0.49114915  0.28581729 -0.52124273
> rowSums(tmp2)
  [1]  1.37618670 -0.56225054  2.16322593 -0.64045637  0.20523893  1.16672577
  [7] -0.19440540  1.48841280 -0.55411568  0.98878550 -1.59456116  1.23104966
 [13] -1.77558453 -0.11032418  0.87207653 -1.55527482 -0.22471185  0.56954173
 [19]  1.32184494  0.59849616  0.36446656  1.81148466  0.35065127 -1.71534326
 [25]  0.29002145  0.91783117  1.07437823  0.73350720  0.44440041  1.40351977
 [31]  0.56907578 -0.48640638 -0.24281627  0.23629110  1.08224326  2.36311876
 [37] -1.60887796 -0.03110610  0.78846385 -0.79857031 -0.34183079  0.47978645
 [43]  0.76251100 -1.11302121  0.49801605 -1.16886506 -0.80448490 -0.36875858
 [49]  2.33142812 -0.14520540  0.17329831 -1.31093574 -0.14918050  0.51213027
 [55]  2.19696567 -1.25723578  1.53884554  0.69189142  0.46970390 -0.26835176
 [61]  0.48752148  1.92196915 -1.67635039 -2.07126938 -0.27197413 -0.87001075
 [67]  0.65850179  0.73725694  1.23564724  1.12354153  0.54219412 -1.02539112
 [73] -1.32639644 -1.78037266  0.58424679 -0.08925369  1.26175220 -1.51763681
 [79]  0.41078569 -0.33709071  0.36706267 -1.68217733  0.05240268 -1.94802390
 [85]  1.63798172  0.35807682  0.88610759  1.89986714  0.47178655 -0.45576372
 [91]  1.77569096  0.27744060  1.24376252  0.16420015  0.92205569 -0.89103428
 [97]  0.58849921  0.49114915  0.28581729 -0.52124273
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.37618670 -0.56225054  2.16322593 -0.64045637  0.20523893  1.16672577
  [7] -0.19440540  1.48841280 -0.55411568  0.98878550 -1.59456116  1.23104966
 [13] -1.77558453 -0.11032418  0.87207653 -1.55527482 -0.22471185  0.56954173
 [19]  1.32184494  0.59849616  0.36446656  1.81148466  0.35065127 -1.71534326
 [25]  0.29002145  0.91783117  1.07437823  0.73350720  0.44440041  1.40351977
 [31]  0.56907578 -0.48640638 -0.24281627  0.23629110  1.08224326  2.36311876
 [37] -1.60887796 -0.03110610  0.78846385 -0.79857031 -0.34183079  0.47978645
 [43]  0.76251100 -1.11302121  0.49801605 -1.16886506 -0.80448490 -0.36875858
 [49]  2.33142812 -0.14520540  0.17329831 -1.31093574 -0.14918050  0.51213027
 [55]  2.19696567 -1.25723578  1.53884554  0.69189142  0.46970390 -0.26835176
 [61]  0.48752148  1.92196915 -1.67635039 -2.07126938 -0.27197413 -0.87001075
 [67]  0.65850179  0.73725694  1.23564724  1.12354153  0.54219412 -1.02539112
 [73] -1.32639644 -1.78037266  0.58424679 -0.08925369  1.26175220 -1.51763681
 [79]  0.41078569 -0.33709071  0.36706267 -1.68217733  0.05240268 -1.94802390
 [85]  1.63798172  0.35807682  0.88610759  1.89986714  0.47178655 -0.45576372
 [91]  1.77569096  0.27744060  1.24376252  0.16420015  0.92205569 -0.89103428
 [97]  0.58849921  0.49114915  0.28581729 -0.52124273
> rowMin(tmp2)
  [1]  1.37618670 -0.56225054  2.16322593 -0.64045637  0.20523893  1.16672577
  [7] -0.19440540  1.48841280 -0.55411568  0.98878550 -1.59456116  1.23104966
 [13] -1.77558453 -0.11032418  0.87207653 -1.55527482 -0.22471185  0.56954173
 [19]  1.32184494  0.59849616  0.36446656  1.81148466  0.35065127 -1.71534326
 [25]  0.29002145  0.91783117  1.07437823  0.73350720  0.44440041  1.40351977
 [31]  0.56907578 -0.48640638 -0.24281627  0.23629110  1.08224326  2.36311876
 [37] -1.60887796 -0.03110610  0.78846385 -0.79857031 -0.34183079  0.47978645
 [43]  0.76251100 -1.11302121  0.49801605 -1.16886506 -0.80448490 -0.36875858
 [49]  2.33142812 -0.14520540  0.17329831 -1.31093574 -0.14918050  0.51213027
 [55]  2.19696567 -1.25723578  1.53884554  0.69189142  0.46970390 -0.26835176
 [61]  0.48752148  1.92196915 -1.67635039 -2.07126938 -0.27197413 -0.87001075
 [67]  0.65850179  0.73725694  1.23564724  1.12354153  0.54219412 -1.02539112
 [73] -1.32639644 -1.78037266  0.58424679 -0.08925369  1.26175220 -1.51763681
 [79]  0.41078569 -0.33709071  0.36706267 -1.68217733  0.05240268 -1.94802390
 [85]  1.63798172  0.35807682  0.88610759  1.89986714  0.47178655 -0.45576372
 [91]  1.77569096  0.27744060  1.24376252  0.16420015  0.92205569 -0.89103428
 [97]  0.58849921  0.49114915  0.28581729 -0.52124273
> 
> colMeans(tmp2)
[1] 0.1896427
> colSums(tmp2)
[1] 18.96427
> colVars(tmp2)
[1] 1.150422
> colSd(tmp2)
[1] 1.072577
> colMax(tmp2)
[1] 2.363119
> colMin(tmp2)
[1] -2.071269
> colMedians(tmp2)
[1] 0.3612717
> colRanges(tmp2)
          [,1]
[1,] -2.071269
[2,]  2.363119
> 
> 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]  2.5193485 -3.7535082  0.6169085  2.3682157  0.4134853  5.1354058
 [7]  5.2669164  2.7886286  1.7545530  2.2220177
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8421025
[2,] -0.4950382
[3,]  0.2835414
[4,]  0.8764437
[5,]  1.5276985
> 
> rowApply(tmp,sum)
 [1]  1.8557573  3.6195999  4.3032371 -0.4619225 -0.2340141  3.8555833
 [7]  0.4597510 -1.1386959  1.7838469  5.2888282
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    4    1    6    8    9    3   10    2     9
 [2,]    1    2    8    1    4    2    6    5    1     1
 [3,]    5    7    5    9    9    6    2    6    4     6
 [4,]    7    1    9    5   10    8    5    3    7    10
 [5,]    2    6    6    3    6    7    1    8    9     8
 [6,]    3    9   10    7    7    4   10    2   10     4
 [7,]    6   10    7    4    5    5    7    9    6     5
 [8,]   10    3    3   10    3    3    9    1    3     7
 [9,]    4    5    4    2    1   10    4    7    8     2
[10,]    9    8    2    8    2    1    8    4    5     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.1472864 -0.1885890  0.8922706  0.5605707 -0.8436415  2.1892485
 [7] -0.1921886  1.8858198  1.6111923  0.1102950 -2.1079525 -0.6014233
[13] -0.2801795  1.4478843 -2.4162213  0.5303945  5.2174746  2.7141583
[19] -0.8959552 -2.3828448
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.63781722
[2,] -0.31929744
[3,] -0.11976323
[4,] -0.01855375
[5,]  0.94814522
> 
> rowApply(tmp,sum)
[1]  3.71060795 -3.76227606  1.17161015  0.09783745  5.88524688
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   11    8    7    9   17
[2,]    6   13   15    4   14
[3,]   17   17   19    8    1
[4,]    5   14   18   10    7
[5,]    3   16   12    7    4
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]        [,4]       [,5]        [,6]
[1,] -0.01855375 -0.6030000  1.1915658 -0.61813031 -0.7609656  0.64581040
[2,] -0.63781722  0.3429675  0.9511852  0.58849925  0.7930902  0.06053819
[3,] -0.31929744  0.5287043  0.9185847  0.73440147  0.3430520 -0.14659485
[4,] -0.11976323 -1.1030017 -0.4142737 -0.10334938 -0.5284072  0.91176904
[5,]  0.94814522  0.6457408 -1.7547914 -0.04085034 -0.6904109  0.71772576
            [,7]       [,8]       [,9]      [,10]       [,11]       [,12]
[1,] -0.20012581  1.9703252 -0.3732762  0.6710608 -0.73548319  0.66163789
[2,]  1.00273875  0.7787501  1.0146977 -0.8109193 -1.65760430 -1.54488722
[3,] -0.93269254 -0.7002231  0.4406130  0.6441219 -0.02653255  0.04461985
[4,]  0.06476493  0.7546721 -1.3119030 -0.5831693  0.42241353 -0.69211864
[5,] -0.12687392 -0.9177046  1.8410608  0.1892009 -0.11074601  0.92932480
          [,13]       [,14]      [,15]       [,16]       [,17]      [,18]
[1,]  0.8242821  1.60119353 -0.2336544  0.43624795 -0.08813202  1.3128616
[2,] -1.9782129 -1.00202806 -0.3848207 -0.85970278  1.67323279 -1.5486720
[3,] -0.3547454  0.73374415 -0.3567570 -0.24439536  0.43430435  1.2173770
[4,]  2.1388762  0.02487482 -1.8677384  0.02886696  1.26886750  1.1190713
[5,] -0.9103795  0.09009983  0.4267491  1.16937770  1.92920201  0.6135203
          [,19]       [,20]
[1,] -1.1329614 -0.84009478
[2,] -0.5653598  0.02204838
[3,] -1.1084813 -0.67819313
[4,]  1.5231972 -1.43581155
[5,]  0.3876500  0.54920627
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
         col1      col2      col3    col4       col5     col6      col7
row1 1.093261 0.6507128 0.5765432 1.30536 -0.2694059 1.709574 -1.973497
          col8      col9    col10     col11    col12      col13     col14
row1 0.2580475 0.5342538 2.233887 0.5429255 2.229679 -0.4203974 -2.228053
          col15      col16     col17      col18    col19     col20
row1 -0.6296621 -0.1409936 0.7395618 -0.8199612 1.511134 0.6156785
> tmp[,"col10"]
          col10
row1  2.2338871
row2  1.1322233
row3 -1.1621182
row4  0.2207189
row5 -0.4732328
> tmp[c("row1","row5"),]
          col1      col2       col3      col4       col5     col6       col7
row1 1.0932614 0.6507128  0.5765432 1.3053598 -0.2694059 1.709574 -1.9734967
row5 0.2732881 0.4640531 -0.8106063 0.5254079  2.9806474 1.151372  0.2070204
           col8       col9      col10     col11     col12      col13      col14
row1  0.2580475  0.5342538  2.2338871 0.5429255 2.2296789 -0.4203974 -2.2280527
row5 -1.0645920 -0.1666249 -0.4732328 0.1854344 0.9596732  1.3166657 -0.7943428
           col15      col16      col17       col18     col19      col20
row1 -0.62966214 -0.1409936  0.7395618 -0.81996118  1.511134  0.6156785
row5  0.07988734 -0.3776568 -1.2181513  0.03065904 -1.182772 -0.2963841
> tmp[,c("col6","col20")]
           col6      col20
row1  1.7095740  0.6156785
row2 -0.4935716  0.6578346
row3  1.3669544 -1.0115761
row4  1.3984733  1.0276629
row5  1.1513718 -0.2963841
> tmp[c("row1","row5"),c("col6","col20")]
         col6      col20
row1 1.709574  0.6156785
row5 1.151372 -0.2963841
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.15691 50.66779 50.49095 50.84452 48.81968 105.0566 50.75821 50.59837
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.73824 51.79885 50.67493 50.32215 50.62364 50.69945 48.50028 50.44878
        col17    col18    col19    col20
row1 51.05467 49.01408 48.88167 104.2991
> tmp[,"col10"]
        col10
row1 51.79885
row2 30.11481
row3 30.16255
row4 31.06545
row5 50.29077
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.15691 50.66779 50.49095 50.84452 48.81968 105.0566 50.75821 50.59837
row5 50.13271 48.69037 50.10108 48.35204 49.90061 103.1149 49.48897 50.79627
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.73824 51.79885 50.67493 50.32215 50.62364 50.69945 48.50028 50.44878
row5 50.74237 50.29077 49.88410 51.32331 50.71794 49.65343 50.45945 49.57064
        col17    col18    col19    col20
row1 51.05467 49.01408 48.88167 104.2991
row5 50.73486 50.09579 50.22807 104.2088
> tmp[,c("col6","col20")]
          col6     col20
row1 105.05662 104.29908
row2  76.62926  74.83985
row3  74.25204  73.97867
row4  75.81755  75.49450
row5 103.11490 104.20877
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0566 104.2991
row5 103.1149 104.2088
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0566 104.2991
row5 103.1149 104.2088
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.25635507
[2,]  1.76349520
[3,] -0.80156137
[4,] -0.05348601
[5,] -0.93288587
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.1107551 -0.9341322
[2,]  0.6767483  2.0146432
[3,] -0.8823703 -1.1187730
[4,]  0.1176192  0.7447526
[5,] -0.4613235  0.2670362
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.3422882 -1.2255475
[2,]  1.2753335 -0.3629290
[3,] -0.5191270 -1.0854819
[4,] -0.4042826 -0.7609039
[5,] -1.0558911 -0.2604338
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.3422882
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.3422882
[2,] 1.2753335
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]       [,3]      [,4]      [,5]      [,6]      [,7]
row3 -0.8900979  0.55444328 -0.8270470 -1.992567 0.4595330 1.5987560 0.4669979
row1 -0.5401358 -0.09766275  0.2327534 -2.401382 0.9249349 0.1637081 2.5635151
         [,8]      [,9]       [,10]     [,11]      [,12]     [,13]      [,14]
row3 1.579125 -1.075471  0.67633633 0.4979023 -0.2715475 2.2911059 -1.1788482
row1 1.731774 -0.295535 -0.05801467 0.4462333  0.2598458 0.6554087 -0.6935688
         [,15]      [,16]      [,17]      [,18]      [,19]      [,20]
row3 0.1515397  0.7769234 0.08380698 -0.1827529 -0.7121192 -0.5153317
row1 1.1306214 -0.2914712 0.08797465 -0.1939302 -0.1056892  1.1550387
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]       [,3]     [,4]      [,5]       [,6]       [,7]
row2 -0.5673654 1.501845 -0.7927021 0.250777 0.6572433 -0.3377997 -0.7048767
         [,8]       [,9]    [,10]
row2 1.323434 -0.6018444 0.583621
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
row5 2.284858 -1.420847 -0.419764 -1.364978 -1.247267 0.4273162 0.05642175
          [,8]      [,9]     [,10]     [,11]     [,12]    [,13]     [,14]
row5 0.1478712 0.9091506 0.2479024 0.9197472 0.2832428 1.380802 -1.490148
        [,15]      [,16]    [,17]     [,18]     [,19]      [,20]
row5 1.233525 -0.3146141 1.436006 0.6099543 -0.592717 -0.1050905
> 
> 
> 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: 0x6000033541e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f56457e8b97"
 [2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f5676fe8a25"
 [3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f56411fc02b"
 [4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f56b816874" 
 [5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f565cf09d92"
 [6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f5638f90be9"
 [7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f56667d0b37"
 [8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f561b6b7c72"
 [9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f562db72e6e"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f5655494f34"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f563fef0aaa"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f5666a53fb0"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f566af87075"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f565c9f4830"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8f565d3c76d1"
> 
> 
> ### 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: 0x600003358240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003358240>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600003358240>
> rowMedians(tmp)
  [1]  0.3138783447  0.1929863718 -0.8061449718  0.1683766061  0.3677406450
  [6] -0.3777225491  0.2075356316  0.3260633969  0.1312447806  0.3652088438
 [11]  0.2132157173  0.0729965779 -0.1387905491 -0.1009824072 -0.1418020687
 [16]  0.5244789195 -0.6421134696  0.0259277121  0.3492790995  0.4560809190
 [21] -0.3789040784  0.3772765614 -0.4005860564  0.3111110005 -0.0957067873
 [26]  0.2578052233 -0.3123438961 -0.1823938568  0.1208762685  0.1705721337
 [31] -0.0295808838 -0.9503813274 -0.1017962084 -1.0492229244  0.2963861814
 [36]  0.4125475554  0.1150912883 -0.0612615561 -0.2310997088  0.0032252719
 [41] -0.0462012914  0.0551452697 -0.3311001188 -0.0927592213  0.1556968013
 [46]  0.0533327077  0.5398088959 -0.2058736941  0.1336044868  0.0927043122
 [51] -0.3366604444  0.4049727207 -0.1553295061 -0.3384630492 -0.4992482650
 [56]  0.7613845903  0.3197069766  0.4583349124  0.1278458895  0.0406385692
 [61] -0.4863225384 -0.5860402123 -0.1858572155  0.3380979554 -0.0259042739
 [66] -0.3717210448 -0.5472406490  0.3476554432 -0.0028323943 -0.2182717969
 [71] -0.4278213259  0.3908149617 -0.2680523435  0.3453337157 -0.1133853562
 [76]  0.2238268530 -0.3282044653 -0.1466192418  0.0255079993  0.2840454546
 [81] -0.0988669156  0.2561761000  0.3382599474 -0.2351064956 -0.2889052352
 [86]  0.1108085772  0.0376668247  0.0114521613  0.4333174089 -0.0965072137
 [91]  0.2286191229  0.5634815652 -0.1064111214 -0.3181826746 -0.3510582811
 [96] -0.1324513165  0.3146060291 -0.0840071950 -0.2494894826  0.1552613794
[101]  0.0257065346 -0.4720297565 -0.4797092298  0.1228050922 -0.2181271193
[106]  0.3622016232  0.0691232451 -0.5280821870  0.0178024259  1.1790348922
[111] -0.1485691364 -0.1096371616 -0.4156903904  0.7452170638  0.0835136965
[116]  0.0482137740 -0.1107720250  0.1228995118  0.6159364235 -0.2998986719
[121] -0.6139156775 -0.0584564410  0.2619779957 -0.2212223916  0.0441965764
[126]  0.1427878508  0.2547279077  0.2188367668  0.0376258378  0.0643203826
[131]  0.1531099554  0.6871348810  0.0012623937  0.3331522699 -0.1736935613
[136]  0.3949286361 -0.0296590404  0.1268469428  0.0173231912  0.3909886262
[141]  0.5380898776  0.4318033659 -0.0712381373  0.3022078529 -0.1305109716
[146]  0.1324902993 -0.4089419498 -0.0213187515 -0.1851795899  0.2428137516
[151] -0.1003474262  0.1550665919  0.3553639913 -0.0242873870 -0.1345455069
[156]  0.1006986504 -0.0347033960  0.1353103112  0.4521428021 -0.0549928168
[161]  0.1094968340  0.4157972171  0.2124707207  0.8516870443 -0.3288832767
[166]  0.0409879725 -0.2674460732  0.0429795544 -0.2651772843  0.0740187290
[171] -0.2648510092  0.2967209943 -0.0916582302 -0.3255189274  0.1042594293
[176] -0.2961732288 -0.2673641210  0.4083805105  0.0599919197  0.3866401985
[181] -0.3120011090 -0.2611130995  0.3046949187  0.4896417608 -0.5883764288
[186]  0.3429881984 -0.4102458643  0.8330759410 -0.2674809144  0.2126887580
[191] -0.0797605460  0.3984745611 -0.2271763822 -0.0245084866  0.1274866103
[196]  0.2070245608  0.5563977488 -0.4527200195  0.2135201878  0.5115916806
[201]  0.2291881410  0.5850996982  0.0996455856 -0.0187553972  0.4239348506
[206] -0.3204987278 -0.0923704386 -0.0411498910  0.0184234532 -0.2462726518
[211] -0.0860534944 -0.2004340591 -0.2935620041  0.3670187524 -0.7010776321
[216]  0.2801165283  0.3020890011 -0.1705405125  0.1781692168 -0.3100208968
[221]  0.3859670047 -0.0712004021  0.1320946688  0.0062385619 -0.0002910615
[226]  0.2216680958 -0.3103151358 -0.2363130031 -0.4352675649 -0.2734715802
> 
> proc.time()
   user  system elapsed 
  0.685   3.531   4.399 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six"
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: 0x600001c28000>
> .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: 0x600001c28000>
> .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: 0x600001c28000>
> .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: 0x600001c28000>
> 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: 0x600001c30360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001c30360>
> .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: 0x600001c30360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001c30360>
> .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: 0x600001c30360>
> 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: 0x600001c30540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001c30540>
> .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: 0x600001c30540>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001c30540>
> .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: 0x600001c30540>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001c30540>
> .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: 0x600001c30540>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001c30540>
> .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: 0x600001c30540>
> 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: 0x600001c30720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001c30720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001c30720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001c30720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile94c819b547e9" "BufferedMatrixFile94c8741b0444"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile94c819b547e9" "BufferedMatrixFile94c8741b0444"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001c309c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001c309c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001c309c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001c309c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001c309c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001c309c0>
> .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: 0x600001c30ba0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001c30ba0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001c30ba0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001c30ba0>
> 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: 0x600001c30d80>
> .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: 0x600001c30d80>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.110   0.039   0.145 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 Patched (2025-04-21 r88169) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.108   0.024   0.129 

Example timings