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

This page was generated on 2025-11-20 11:38 -0500 (Thu, 20 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4827
lconwaymacOS 12.7.6 Montereyx86_64R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences" 4600
kjohnson3macOS 13.7.7 Venturaarm64R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" 4564
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2325HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-19 13:40 -0500 (Wed, 19 Nov 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: ecdbf23
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo1Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.6 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on lconway

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.75.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.75.0.tar.gz
StartedAt: 2025-11-19 19:53:36 -0500 (Wed, 19 Nov 2025)
EndedAt: 2025-11-19 19:54:29 -0500 (Wed, 19 Nov 2025)
EllapsedTime: 53.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.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-21 r88958)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.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.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
* used SDK: ‘MacOSX11.3.1.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 ... INFO
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, 1 NOTE
See
  ‘/Users/biocbuild/bbs-3.23-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.6-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/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 x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/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.6-x86_64/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 Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.307   0.143   0.472 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.23-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 481268 25.8    1058102 56.6         NA   633897 33.9
Vcells 891509  6.9    8388608 64.0      98304  2110436 16.2
> 
> 
> 
> 
> ##
> ## 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 Nov 19 19:54:02 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 Nov 19 19:54:02 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: 0x600002160000>
> 
> 
> 
> 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 Nov 19 19:54:07 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Nov 19 19:54:09 2025"
> 
> ColMode(tmp2)
<pointer: 0x600002160000>
> 
> 
> 
> ### 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,] 97.7572964 -0.7288533  0.2647247 0.7060206
[2,]  1.6891471 -0.4620364  0.1387559 0.4248110
[3,]  0.6882141  0.7594804 -1.5202224 0.9905099
[4,]  1.8994271 -1.3772972  0.8204448 0.4755147
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-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,] 97.7572964 0.7288533 0.2647247 0.7060206
[2,]  1.6891471 0.4620364 0.1387559 0.4248110
[3,]  0.6882141 0.7594804 1.5202224 0.9905099
[4,]  1.8994271 1.3772972 0.8204448 0.4755147
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-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.8872290 0.8537291 0.5145141 0.8402503
[2,] 1.2996719 0.6797326 0.3724995 0.6517753
[3,] 0.8295867 0.8714817 1.2329730 0.9952436
[4,] 1.3781970 1.1735830 0.9057841 0.6895757
> 
> 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.23-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,] 221.62959 34.26614 30.40987 34.10852
[2,]  39.68587 32.25936 28.86375 31.94256
[3,]  33.98408 34.47430 38.84995 35.94295
[4,]  40.68140 38.11313 34.87829 32.37127
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002164000>
> exp(tmp5)
<pointer: 0x600002164000>
> log(tmp5,2)
<pointer: 0x600002164000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 461.2929
> Min(tmp5)
[1] 55.2014
> mean(tmp5)
[1] 72.58322
> Sum(tmp5)
[1] 14516.64
> Var(tmp5)
[1] 818.6919
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.09673 71.28570 72.49345 71.22753 70.15651 70.17339 70.31598 69.65578
 [9] 69.53872 69.88843
> rowSums(tmp5)
 [1] 1821.935 1425.714 1449.869 1424.551 1403.130 1403.468 1406.320 1393.116
 [9] 1390.774 1397.769
> rowVars(tmp5)
 [1] 7658.94540   80.63751   58.78153   61.75692   61.26251   89.42533
 [7]   39.30308   40.35587   29.35560   46.24704
> rowSd(tmp5)
 [1] 87.515401  8.979839  7.666911  7.858557  7.827037  9.456497  6.269217
 [8]  6.352627  5.418080  6.800518
> rowMax(tmp5)
 [1] 461.29295  87.92740  82.27819  84.78726  84.60307  92.39995  82.70521
 [8]  85.46396  78.66847  82.37886
> rowMin(tmp5)
 [1] 55.20140 59.06968 55.70316 58.59725 59.15106 56.63472 56.48290 61.21111
 [9] 58.72507 57.29928
> 
> colMeans(tmp5)
 [1] 110.89942  69.03638  68.17052  74.97340  67.32642  67.72802  71.08531
 [8]  71.65383  67.77595  66.40594  74.82565  71.89097  73.55525  69.84339
[15]  69.58143  71.87790  68.46555  71.11585  71.16809  74.28517
> colSums(tmp5)
 [1] 1108.9942  690.3638  681.7052  749.7340  673.2642  677.2802  710.8531
 [8]  716.5383  677.7595  664.0594  748.2565  718.9097  735.5525  698.4339
[15]  695.8143  718.7790  684.6555  711.1585  711.6809  742.8517
> colVars(tmp5)
 [1] 15219.69718    59.50275    44.27853    49.38772    43.38334    33.47798
 [7]    48.63209    88.44696    91.47148    22.74585    13.85463    20.65234
[13]    74.57719    69.18683    45.14111    69.14636    68.75696    67.70886
[19]    23.35762    94.38825
> colSd(tmp5)
 [1] 123.368137   7.713803   6.654212   7.027640   6.586603   5.786016
 [7]   6.973671   9.404625   9.564073   4.769261   3.722180   4.544485
[13]   8.635809   8.317862   6.718713   8.315429   8.291982   8.228539
[19]   4.832972   9.715361
> colMax(tmp5)
 [1] 461.29295  79.32748  80.86109  85.46396  78.09765  77.08984  82.56139
 [8]  87.92079  84.78726  73.79644  79.20473  80.22345  84.60307  87.92740
[15]  81.17518  82.40259  78.84326  82.70521  76.39075  92.39995
> colMin(tmp5)
 [1] 60.72302 56.63472 58.72507 66.48426 59.15106 58.82656 61.70901 62.75664
 [9] 55.70316 58.29727 68.77876 66.60775 58.59725 58.82841 59.76770 56.48290
[17] 55.20140 59.94745 60.07362 59.06968
> 
> 
> ### 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] 91.09673 71.28570 72.49345 71.22753 70.15651 70.17339 70.31598 69.65578
 [9]       NA 69.88843
> rowSums(tmp5)
 [1] 1821.935 1425.714 1449.869 1424.551 1403.130 1403.468 1406.320 1393.116
 [9]       NA 1397.769
> rowVars(tmp5)
 [1] 7658.94540   80.63751   58.78153   61.75692   61.26251   89.42533
 [7]   39.30308   40.35587   30.71758   46.24704
> rowSd(tmp5)
 [1] 87.515401  8.979839  7.666911  7.858557  7.827037  9.456497  6.269217
 [8]  6.352627  5.542344  6.800518
> rowMax(tmp5)
 [1] 461.29295  87.92740  82.27819  84.78726  84.60307  92.39995  82.70521
 [8]  85.46396        NA  82.37886
> rowMin(tmp5)
 [1] 55.20140 59.06968 55.70316 58.59725 59.15106 56.63472 56.48290 61.21111
 [9]       NA 57.29928
> 
> colMeans(tmp5)
 [1] 110.89942  69.03638  68.17052  74.97340  67.32642  67.72802  71.08531
 [8]  71.65383  67.77595  66.40594  74.82565  71.89097  73.55525  69.84339
[15]  69.58143  71.87790  68.46555        NA  71.16809  74.28517
> colSums(tmp5)
 [1] 1108.9942  690.3638  681.7052  749.7340  673.2642  677.2802  710.8531
 [8]  716.5383  677.7595  664.0594  748.2565  718.9097  735.5525  698.4339
[15]  695.8143  718.7790  684.6555        NA  711.6809  742.8517
> colVars(tmp5)
 [1] 15219.69718    59.50275    44.27853    49.38772    43.38334    33.47798
 [7]    48.63209    88.44696    91.47148    22.74585    13.85463    20.65234
[13]    74.57719    69.18683    45.14111    69.14636    68.75696          NA
[19]    23.35762    94.38825
> colSd(tmp5)
 [1] 123.368137   7.713803   6.654212   7.027640   6.586603   5.786016
 [7]   6.973671   9.404625   9.564073   4.769261   3.722180   4.544485
[13]   8.635809   8.317862   6.718713   8.315429   8.291982         NA
[19]   4.832972   9.715361
> colMax(tmp5)
 [1] 461.29295  79.32748  80.86109  85.46396  78.09765  77.08984  82.56139
 [8]  87.92079  84.78726  73.79644  79.20473  80.22345  84.60307  87.92740
[15]  81.17518  82.40259  78.84326        NA  76.39075  92.39995
> colMin(tmp5)
 [1] 60.72302 56.63472 58.72507 66.48426 59.15106 58.82656 61.70901 62.75664
 [9] 55.70316 58.29727 68.77876 66.60775 58.59725 58.82841 59.76770 56.48290
[17] 55.20140       NA 60.07362 59.06968
> 
> Max(tmp5,na.rm=TRUE)
[1] 461.2929
> Min(tmp5,na.rm=TRUE)
[1] 55.2014
> mean(tmp5,na.rm=TRUE)
[1] 72.6093
> Sum(tmp5,na.rm=TRUE)
[1] 14449.25
> Var(tmp5,na.rm=TRUE)
[1] 822.69
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.09673 71.28570 72.49345 71.22753 70.15651 70.17339 70.31598 69.65578
 [9] 69.65157 69.88843
> rowSums(tmp5,na.rm=TRUE)
 [1] 1821.935 1425.714 1449.869 1424.551 1403.130 1403.468 1406.320 1393.116
 [9] 1323.380 1397.769
> rowVars(tmp5,na.rm=TRUE)
 [1] 7658.94540   80.63751   58.78153   61.75692   61.26251   89.42533
 [7]   39.30308   40.35587   30.71758   46.24704
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.515401  8.979839  7.666911  7.858557  7.827037  9.456497  6.269217
 [8]  6.352627  5.542344  6.800518
> rowMax(tmp5,na.rm=TRUE)
 [1] 461.29295  87.92740  82.27819  84.78726  84.60307  92.39995  82.70521
 [8]  85.46396  78.66847  82.37886
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.20140 59.06968 55.70316 58.59725 59.15106 56.63472 56.48290 61.21111
 [9] 58.72507 57.29928
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.89942  69.03638  68.17052  74.97340  67.32642  67.72802  71.08531
 [8]  71.65383  67.77595  66.40594  74.82565  71.89097  73.55525  69.84339
[15]  69.58143  71.87790  68.46555  71.52934  71.16809  74.28517
> colSums(tmp5,na.rm=TRUE)
 [1] 1108.9942  690.3638  681.7052  749.7340  673.2642  677.2802  710.8531
 [8]  716.5383  677.7595  664.0594  748.2565  718.9097  735.5525  698.4339
[15]  695.8143  718.7790  684.6555  643.7640  711.6809  742.8517
> colVars(tmp5,na.rm=TRUE)
 [1] 15219.69718    59.50275    44.27853    49.38772    43.38334    33.47798
 [7]    48.63209    88.44696    91.47148    22.74585    13.85463    20.65234
[13]    74.57719    69.18683    45.14111    69.14636    68.75696    74.24903
[19]    23.35762    94.38825
> colSd(tmp5,na.rm=TRUE)
 [1] 123.368137   7.713803   6.654212   7.027640   6.586603   5.786016
 [7]   6.973671   9.404625   9.564073   4.769261   3.722180   4.544485
[13]   8.635809   8.317862   6.718713   8.315429   8.291982   8.616787
[19]   4.832972   9.715361
> colMax(tmp5,na.rm=TRUE)
 [1] 461.29295  79.32748  80.86109  85.46396  78.09765  77.08984  82.56139
 [8]  87.92079  84.78726  73.79644  79.20473  80.22345  84.60307  87.92740
[15]  81.17518  82.40259  78.84326  82.70521  76.39075  92.39995
> colMin(tmp5,na.rm=TRUE)
 [1] 60.72302 56.63472 58.72507 66.48426 59.15106 58.82656 61.70901 62.75664
 [9] 55.70316 58.29727 68.77876 66.60775 58.59725 58.82841 59.76770 56.48290
[17] 55.20140 59.94745 60.07362 59.06968
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.09673 71.28570 72.49345 71.22753 70.15651 70.17339 70.31598 69.65578
 [9]      NaN 69.88843
> rowSums(tmp5,na.rm=TRUE)
 [1] 1821.935 1425.714 1449.869 1424.551 1403.130 1403.468 1406.320 1393.116
 [9]    0.000 1397.769
> rowVars(tmp5,na.rm=TRUE)
 [1] 7658.94540   80.63751   58.78153   61.75692   61.26251   89.42533
 [7]   39.30308   40.35587         NA   46.24704
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.515401  8.979839  7.666911  7.858557  7.827037  9.456497  6.269217
 [8]  6.352627        NA  6.800518
> rowMax(tmp5,na.rm=TRUE)
 [1] 461.29295  87.92740  82.27819  84.78726  84.60307  92.39995  82.70521
 [8]  85.46396        NA  82.37886
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.20140 59.06968 55.70316 58.59725 59.15106 56.63472 56.48290 61.21111
 [9]       NA 57.29928
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.48063  69.35289  69.22001  74.79658  66.82655  67.90253  70.99508
 [8]  72.32665  67.64136  67.17290  74.57896  72.41836  74.53818  69.53844
[15]  69.15870  71.85745  68.43660       NaN  71.50387  74.15494
> colSums(tmp5,na.rm=TRUE)
 [1] 1030.3257  624.1760  622.9801  673.1692  601.4390  611.1227  638.9557
 [8]  650.9398  608.7722  604.5561  671.2107  651.7653  670.8436  625.8460
[15]  622.4283  646.7170  615.9294    0.0000  643.5348  667.3944
> colVars(tmp5,na.rm=TRUE)
 [1] 16977.87685    65.81356    37.42217    55.20943    45.99523    37.32015
 [7]    54.61951    94.41019   102.70161    18.97144    14.90185    20.10485
[13]    73.03004    76.78902    48.77341    77.78495    77.34215          NA
[19]    25.00891   105.99595
> colSd(tmp5,na.rm=TRUE)
 [1] 130.299182   8.112556   6.117366   7.430305   6.781978   6.109022
 [7]   7.390502   9.716491  10.134180   4.355622   3.860291   4.483843
[13]   8.545762   8.762934   6.983796   8.819578   8.794439         NA
[19]   5.000891  10.295434
> colMax(tmp5,na.rm=TRUE)
 [1] 461.29295  79.32748  80.86109  85.46396  78.09765  77.08984  82.56139
 [8]  87.92079  84.78726  73.79644  79.20473  80.22345  84.60307  87.92740
[15]  81.17518  82.40259  78.84326      -Inf  76.39075  92.39995
> colMin(tmp5,na.rm=TRUE)
 [1] 60.72302 56.63472 60.07612 66.48426 59.15106 58.82656 61.70901 62.75664
 [9] 55.70316 58.29727 68.77876 66.60775 58.59725 58.82841 59.76770 56.48290
[17] 55.20140      Inf 60.07362 59.06968
> 
> 
> 
> 
> 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]  99.22438 349.46171 391.25024 298.13252 173.48121 257.28707 290.60799
 [8] 303.32217 262.35492 210.80930
> apply(copymatrix,1,var,na.rm=TRUE)
 [1]  99.22438 349.46171 391.25024 298.13252 173.48121 257.28707 290.60799
 [8] 303.32217 262.35492 210.80930
> 
> 
> 
> 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 -8.526513e-14 -1.136868e-13  5.684342e-14  5.684342e-14
 [6]  1.136868e-13 -5.684342e-14 -5.684342e-14  0.000000e+00 -5.684342e-14
[11] -1.705303e-13  0.000000e+00 -3.979039e-13  1.136868e-13 -1.705303e-13
[16] -1.989520e-13  0.000000e+00  1.136868e-13  2.842171e-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   2 
1   3 
9   2 
5   7 
9   15 
5   2 
7   12 
5   7 
8   1 
4   20 
3   10 
8   18 
10   9 
2   15 
7   10 
2   3 
2   18 
3   10 
4   6 
9   10 
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.24674
> Min(tmp)
[1] -2.474682
> mean(tmp)
[1] -0.07885375
> Sum(tmp)
[1] -7.885375
> Var(tmp)
[1] 1.108306
> 
> rowMeans(tmp)
[1] -0.07885375
> rowSums(tmp)
[1] -7.885375
> rowVars(tmp)
[1] 1.108306
> rowSd(tmp)
[1] 1.052761
> rowMax(tmp)
[1] 2.24674
> rowMin(tmp)
[1] -2.474682
> 
> colMeans(tmp)
  [1] -0.40991503 -0.79076537 -0.64182470 -0.98517631  0.87569083  0.59551011
  [7] -0.21405050 -0.10314158  0.16970880 -0.69793499  1.67098615 -0.31270624
 [13] -0.15716505  0.29353903 -1.81898581 -2.39345372 -0.87032231 -0.22684827
 [19] -0.52424525  1.59448739 -1.00766699  2.20772078  0.69805850 -0.33773172
 [25] -1.83489037 -0.58843811 -2.47468153  0.87890561  1.19629172 -0.89221660
 [31]  1.89423810  0.57739653 -1.32854500 -0.23871876 -0.03890046 -1.17062073
 [37] -1.87534137 -0.39276851 -0.51871569 -0.66996733  1.25805416 -0.52463495
 [43] -0.33609212  0.34077435  0.05522570  0.44683878 -0.54414478 -0.58104597
 [49]  1.93818250  0.28928644  0.54274696  1.76625795  0.40429242 -0.20172275
 [55] -0.82830584  1.13930773  2.24673974  0.05725367  0.28090584 -0.21880385
 [61] -1.35274417  0.79739388  0.15230522 -0.31474616 -0.45220090 -0.19038679
 [67] -0.72305343 -1.28709358  0.39167140  0.29371034  0.32610758 -2.42382159
 [73] -0.31892745 -0.83371585  0.50050685 -0.93196898  1.40404325 -0.98070519
 [79]  1.13139787 -1.93084465  1.00299869 -0.08124647  1.03727115  0.33554643
 [85]  0.83120722 -0.30748815 -0.23687011 -1.26809044 -1.50085212  1.65464699
 [91]  0.31629504  1.94412451  0.93339988  0.28353390  0.65375123 -0.55091125
 [97]  0.67683666 -1.08323840 -0.35701704 -2.09411128
> colSums(tmp)
  [1] -0.40991503 -0.79076537 -0.64182470 -0.98517631  0.87569083  0.59551011
  [7] -0.21405050 -0.10314158  0.16970880 -0.69793499  1.67098615 -0.31270624
 [13] -0.15716505  0.29353903 -1.81898581 -2.39345372 -0.87032231 -0.22684827
 [19] -0.52424525  1.59448739 -1.00766699  2.20772078  0.69805850 -0.33773172
 [25] -1.83489037 -0.58843811 -2.47468153  0.87890561  1.19629172 -0.89221660
 [31]  1.89423810  0.57739653 -1.32854500 -0.23871876 -0.03890046 -1.17062073
 [37] -1.87534137 -0.39276851 -0.51871569 -0.66996733  1.25805416 -0.52463495
 [43] -0.33609212  0.34077435  0.05522570  0.44683878 -0.54414478 -0.58104597
 [49]  1.93818250  0.28928644  0.54274696  1.76625795  0.40429242 -0.20172275
 [55] -0.82830584  1.13930773  2.24673974  0.05725367  0.28090584 -0.21880385
 [61] -1.35274417  0.79739388  0.15230522 -0.31474616 -0.45220090 -0.19038679
 [67] -0.72305343 -1.28709358  0.39167140  0.29371034  0.32610758 -2.42382159
 [73] -0.31892745 -0.83371585  0.50050685 -0.93196898  1.40404325 -0.98070519
 [79]  1.13139787 -1.93084465  1.00299869 -0.08124647  1.03727115  0.33554643
 [85]  0.83120722 -0.30748815 -0.23687011 -1.26809044 -1.50085212  1.65464699
 [91]  0.31629504  1.94412451  0.93339988  0.28353390  0.65375123 -0.55091125
 [97]  0.67683666 -1.08323840 -0.35701704 -2.09411128
> 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.40991503 -0.79076537 -0.64182470 -0.98517631  0.87569083  0.59551011
  [7] -0.21405050 -0.10314158  0.16970880 -0.69793499  1.67098615 -0.31270624
 [13] -0.15716505  0.29353903 -1.81898581 -2.39345372 -0.87032231 -0.22684827
 [19] -0.52424525  1.59448739 -1.00766699  2.20772078  0.69805850 -0.33773172
 [25] -1.83489037 -0.58843811 -2.47468153  0.87890561  1.19629172 -0.89221660
 [31]  1.89423810  0.57739653 -1.32854500 -0.23871876 -0.03890046 -1.17062073
 [37] -1.87534137 -0.39276851 -0.51871569 -0.66996733  1.25805416 -0.52463495
 [43] -0.33609212  0.34077435  0.05522570  0.44683878 -0.54414478 -0.58104597
 [49]  1.93818250  0.28928644  0.54274696  1.76625795  0.40429242 -0.20172275
 [55] -0.82830584  1.13930773  2.24673974  0.05725367  0.28090584 -0.21880385
 [61] -1.35274417  0.79739388  0.15230522 -0.31474616 -0.45220090 -0.19038679
 [67] -0.72305343 -1.28709358  0.39167140  0.29371034  0.32610758 -2.42382159
 [73] -0.31892745 -0.83371585  0.50050685 -0.93196898  1.40404325 -0.98070519
 [79]  1.13139787 -1.93084465  1.00299869 -0.08124647  1.03727115  0.33554643
 [85]  0.83120722 -0.30748815 -0.23687011 -1.26809044 -1.50085212  1.65464699
 [91]  0.31629504  1.94412451  0.93339988  0.28353390  0.65375123 -0.55091125
 [97]  0.67683666 -1.08323840 -0.35701704 -2.09411128
> colMin(tmp)
  [1] -0.40991503 -0.79076537 -0.64182470 -0.98517631  0.87569083  0.59551011
  [7] -0.21405050 -0.10314158  0.16970880 -0.69793499  1.67098615 -0.31270624
 [13] -0.15716505  0.29353903 -1.81898581 -2.39345372 -0.87032231 -0.22684827
 [19] -0.52424525  1.59448739 -1.00766699  2.20772078  0.69805850 -0.33773172
 [25] -1.83489037 -0.58843811 -2.47468153  0.87890561  1.19629172 -0.89221660
 [31]  1.89423810  0.57739653 -1.32854500 -0.23871876 -0.03890046 -1.17062073
 [37] -1.87534137 -0.39276851 -0.51871569 -0.66996733  1.25805416 -0.52463495
 [43] -0.33609212  0.34077435  0.05522570  0.44683878 -0.54414478 -0.58104597
 [49]  1.93818250  0.28928644  0.54274696  1.76625795  0.40429242 -0.20172275
 [55] -0.82830584  1.13930773  2.24673974  0.05725367  0.28090584 -0.21880385
 [61] -1.35274417  0.79739388  0.15230522 -0.31474616 -0.45220090 -0.19038679
 [67] -0.72305343 -1.28709358  0.39167140  0.29371034  0.32610758 -2.42382159
 [73] -0.31892745 -0.83371585  0.50050685 -0.93196898  1.40404325 -0.98070519
 [79]  1.13139787 -1.93084465  1.00299869 -0.08124647  1.03727115  0.33554643
 [85]  0.83120722 -0.30748815 -0.23687011 -1.26809044 -1.50085212  1.65464699
 [91]  0.31629504  1.94412451  0.93339988  0.28353390  0.65375123 -0.55091125
 [97]  0.67683666 -1.08323840 -0.35701704 -2.09411128
> colMedians(tmp)
  [1] -0.40991503 -0.79076537 -0.64182470 -0.98517631  0.87569083  0.59551011
  [7] -0.21405050 -0.10314158  0.16970880 -0.69793499  1.67098615 -0.31270624
 [13] -0.15716505  0.29353903 -1.81898581 -2.39345372 -0.87032231 -0.22684827
 [19] -0.52424525  1.59448739 -1.00766699  2.20772078  0.69805850 -0.33773172
 [25] -1.83489037 -0.58843811 -2.47468153  0.87890561  1.19629172 -0.89221660
 [31]  1.89423810  0.57739653 -1.32854500 -0.23871876 -0.03890046 -1.17062073
 [37] -1.87534137 -0.39276851 -0.51871569 -0.66996733  1.25805416 -0.52463495
 [43] -0.33609212  0.34077435  0.05522570  0.44683878 -0.54414478 -0.58104597
 [49]  1.93818250  0.28928644  0.54274696  1.76625795  0.40429242 -0.20172275
 [55] -0.82830584  1.13930773  2.24673974  0.05725367  0.28090584 -0.21880385
 [61] -1.35274417  0.79739388  0.15230522 -0.31474616 -0.45220090 -0.19038679
 [67] -0.72305343 -1.28709358  0.39167140  0.29371034  0.32610758 -2.42382159
 [73] -0.31892745 -0.83371585  0.50050685 -0.93196898  1.40404325 -0.98070519
 [79]  1.13139787 -1.93084465  1.00299869 -0.08124647  1.03727115  0.33554643
 [85]  0.83120722 -0.30748815 -0.23687011 -1.26809044 -1.50085212  1.65464699
 [91]  0.31629504  1.94412451  0.93339988  0.28353390  0.65375123 -0.55091125
 [97]  0.67683666 -1.08323840 -0.35701704 -2.09411128
> colRanges(tmp)
          [,1]       [,2]       [,3]       [,4]      [,5]      [,6]       [,7]
[1,] -0.409915 -0.7907654 -0.6418247 -0.9851763 0.8756908 0.5955101 -0.2140505
[2,] -0.409915 -0.7907654 -0.6418247 -0.9851763 0.8756908 0.5955101 -0.2140505
           [,8]      [,9]     [,10]    [,11]      [,12]      [,13]    [,14]
[1,] -0.1031416 0.1697088 -0.697935 1.670986 -0.3127062 -0.1571651 0.293539
[2,] -0.1031416 0.1697088 -0.697935 1.670986 -0.3127062 -0.1571651 0.293539
         [,15]     [,16]      [,17]      [,18]      [,19]    [,20]     [,21]
[1,] -1.818986 -2.393454 -0.8703223 -0.2268483 -0.5242453 1.594487 -1.007667
[2,] -1.818986 -2.393454 -0.8703223 -0.2268483 -0.5242453 1.594487 -1.007667
        [,22]     [,23]      [,24]    [,25]      [,26]     [,27]     [,28]
[1,] 2.207721 0.6980585 -0.3377317 -1.83489 -0.5884381 -2.474682 0.8789056
[2,] 2.207721 0.6980585 -0.3377317 -1.83489 -0.5884381 -2.474682 0.8789056
        [,29]      [,30]    [,31]     [,32]     [,33]      [,34]       [,35]
[1,] 1.196292 -0.8922166 1.894238 0.5773965 -1.328545 -0.2387188 -0.03890046
[2,] 1.196292 -0.8922166 1.894238 0.5773965 -1.328545 -0.2387188 -0.03890046
         [,36]     [,37]      [,38]      [,39]      [,40]    [,41]     [,42]
[1,] -1.170621 -1.875341 -0.3927685 -0.5187157 -0.6699673 1.258054 -0.524635
[2,] -1.170621 -1.875341 -0.3927685 -0.5187157 -0.6699673 1.258054 -0.524635
          [,43]     [,44]     [,45]     [,46]      [,47]     [,48]    [,49]
[1,] -0.3360921 0.3407743 0.0552257 0.4468388 -0.5441448 -0.581046 1.938182
[2,] -0.3360921 0.3407743 0.0552257 0.4468388 -0.5441448 -0.581046 1.938182
         [,50]    [,51]    [,52]     [,53]      [,54]      [,55]    [,56]
[1,] 0.2892864 0.542747 1.766258 0.4042924 -0.2017228 -0.8283058 1.139308
[2,] 0.2892864 0.542747 1.766258 0.4042924 -0.2017228 -0.8283058 1.139308
       [,57]      [,58]     [,59]      [,60]     [,61]     [,62]     [,63]
[1,] 2.24674 0.05725367 0.2809058 -0.2188039 -1.352744 0.7973939 0.1523052
[2,] 2.24674 0.05725367 0.2809058 -0.2188039 -1.352744 0.7973939 0.1523052
          [,64]      [,65]      [,66]      [,67]     [,68]     [,69]     [,70]
[1,] -0.3147462 -0.4522009 -0.1903868 -0.7230534 -1.287094 0.3916714 0.2937103
[2,] -0.3147462 -0.4522009 -0.1903868 -0.7230534 -1.287094 0.3916714 0.2937103
         [,71]     [,72]      [,73]      [,74]     [,75]     [,76]    [,77]
[1,] 0.3261076 -2.423822 -0.3189275 -0.8337158 0.5005069 -0.931969 1.404043
[2,] 0.3261076 -2.423822 -0.3189275 -0.8337158 0.5005069 -0.931969 1.404043
          [,78]    [,79]     [,80]    [,81]       [,82]    [,83]     [,84]
[1,] -0.9807052 1.131398 -1.930845 1.002999 -0.08124647 1.037271 0.3355464
[2,] -0.9807052 1.131398 -1.930845 1.002999 -0.08124647 1.037271 0.3355464
         [,85]      [,86]      [,87]    [,88]     [,89]    [,90]    [,91]
[1,] 0.8312072 -0.3074881 -0.2368701 -1.26809 -1.500852 1.654647 0.316295
[2,] 0.8312072 -0.3074881 -0.2368701 -1.26809 -1.500852 1.654647 0.316295
        [,92]     [,93]     [,94]     [,95]      [,96]     [,97]     [,98]
[1,] 1.944125 0.9333999 0.2835339 0.6537512 -0.5509112 0.6768367 -1.083238
[2,] 1.944125 0.9333999 0.2835339 0.6537512 -0.5509112 0.6768367 -1.083238
         [,99]    [,100]
[1,] -0.357017 -2.094111
[2,] -0.357017 -2.094111
> 
> 
> Max(tmp2)
[1] 3.338279
> Min(tmp2)
[1] -2.831849
> mean(tmp2)
[1] -0.03405012
> Sum(tmp2)
[1] -3.405012
> Var(tmp2)
[1] 1.064644
> 
> rowMeans(tmp2)
  [1]  0.99676215  0.36505481  0.59501246 -0.25022086  0.63461315 -0.40567528
  [7]  0.29058244 -0.63434886  0.88741749  1.31087815 -2.83184929 -1.06281743
 [13]  0.19859185  1.16224568  0.30558725 -1.40856092  0.85463803  0.34827742
 [19] -1.09963348  1.01170254  0.49892660 -0.10677244 -1.49243802  0.28376495
 [25] -1.43543713  0.46050449 -1.07674920  0.01707330  0.24627101 -0.78016442
 [31] -1.97996576 -0.01246025  0.81627628 -1.13265481  0.36470150  0.37601714
 [37]  0.48534075 -0.98787235 -0.13820151 -1.07552187 -0.17420664 -1.06525113
 [43] -0.17158311  1.61162110  2.17712535 -1.74975095 -0.44551412  0.04365382
 [49]  0.36906349  0.10034288  0.99372101 -1.75915548 -0.42245530 -1.57221626
 [55] -1.58803332  0.90026324 -0.91597757 -0.59663199 -0.29280950 -0.95702349
 [61]  0.07183570  1.84524052  1.09009875 -0.29423460  0.06205911 -1.02165274
 [67] -0.67015612 -0.13036509  1.76090782 -0.08844627 -0.93197134  0.07447136
 [73]  0.53535402  0.90294939 -2.71354399 -0.01186078  0.91704521 -0.80976937
 [79]  0.03376434 -0.80676109  1.30438241 -1.52869149  0.07991169  0.43117338
 [85] -0.54964918 -0.04609882 -0.87127698  0.45466860  0.66275478  0.06585766
 [91]  0.67001537  0.59946935  0.53231904  1.51548386 -0.98796952 -0.13489728
 [97]  3.33827918 -0.22786835  0.93065400  1.45742746
> rowSums(tmp2)
  [1]  0.99676215  0.36505481  0.59501246 -0.25022086  0.63461315 -0.40567528
  [7]  0.29058244 -0.63434886  0.88741749  1.31087815 -2.83184929 -1.06281743
 [13]  0.19859185  1.16224568  0.30558725 -1.40856092  0.85463803  0.34827742
 [19] -1.09963348  1.01170254  0.49892660 -0.10677244 -1.49243802  0.28376495
 [25] -1.43543713  0.46050449 -1.07674920  0.01707330  0.24627101 -0.78016442
 [31] -1.97996576 -0.01246025  0.81627628 -1.13265481  0.36470150  0.37601714
 [37]  0.48534075 -0.98787235 -0.13820151 -1.07552187 -0.17420664 -1.06525113
 [43] -0.17158311  1.61162110  2.17712535 -1.74975095 -0.44551412  0.04365382
 [49]  0.36906349  0.10034288  0.99372101 -1.75915548 -0.42245530 -1.57221626
 [55] -1.58803332  0.90026324 -0.91597757 -0.59663199 -0.29280950 -0.95702349
 [61]  0.07183570  1.84524052  1.09009875 -0.29423460  0.06205911 -1.02165274
 [67] -0.67015612 -0.13036509  1.76090782 -0.08844627 -0.93197134  0.07447136
 [73]  0.53535402  0.90294939 -2.71354399 -0.01186078  0.91704521 -0.80976937
 [79]  0.03376434 -0.80676109  1.30438241 -1.52869149  0.07991169  0.43117338
 [85] -0.54964918 -0.04609882 -0.87127698  0.45466860  0.66275478  0.06585766
 [91]  0.67001537  0.59946935  0.53231904  1.51548386 -0.98796952 -0.13489728
 [97]  3.33827918 -0.22786835  0.93065400  1.45742746
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.99676215  0.36505481  0.59501246 -0.25022086  0.63461315 -0.40567528
  [7]  0.29058244 -0.63434886  0.88741749  1.31087815 -2.83184929 -1.06281743
 [13]  0.19859185  1.16224568  0.30558725 -1.40856092  0.85463803  0.34827742
 [19] -1.09963348  1.01170254  0.49892660 -0.10677244 -1.49243802  0.28376495
 [25] -1.43543713  0.46050449 -1.07674920  0.01707330  0.24627101 -0.78016442
 [31] -1.97996576 -0.01246025  0.81627628 -1.13265481  0.36470150  0.37601714
 [37]  0.48534075 -0.98787235 -0.13820151 -1.07552187 -0.17420664 -1.06525113
 [43] -0.17158311  1.61162110  2.17712535 -1.74975095 -0.44551412  0.04365382
 [49]  0.36906349  0.10034288  0.99372101 -1.75915548 -0.42245530 -1.57221626
 [55] -1.58803332  0.90026324 -0.91597757 -0.59663199 -0.29280950 -0.95702349
 [61]  0.07183570  1.84524052  1.09009875 -0.29423460  0.06205911 -1.02165274
 [67] -0.67015612 -0.13036509  1.76090782 -0.08844627 -0.93197134  0.07447136
 [73]  0.53535402  0.90294939 -2.71354399 -0.01186078  0.91704521 -0.80976937
 [79]  0.03376434 -0.80676109  1.30438241 -1.52869149  0.07991169  0.43117338
 [85] -0.54964918 -0.04609882 -0.87127698  0.45466860  0.66275478  0.06585766
 [91]  0.67001537  0.59946935  0.53231904  1.51548386 -0.98796952 -0.13489728
 [97]  3.33827918 -0.22786835  0.93065400  1.45742746
> rowMin(tmp2)
  [1]  0.99676215  0.36505481  0.59501246 -0.25022086  0.63461315 -0.40567528
  [7]  0.29058244 -0.63434886  0.88741749  1.31087815 -2.83184929 -1.06281743
 [13]  0.19859185  1.16224568  0.30558725 -1.40856092  0.85463803  0.34827742
 [19] -1.09963348  1.01170254  0.49892660 -0.10677244 -1.49243802  0.28376495
 [25] -1.43543713  0.46050449 -1.07674920  0.01707330  0.24627101 -0.78016442
 [31] -1.97996576 -0.01246025  0.81627628 -1.13265481  0.36470150  0.37601714
 [37]  0.48534075 -0.98787235 -0.13820151 -1.07552187 -0.17420664 -1.06525113
 [43] -0.17158311  1.61162110  2.17712535 -1.74975095 -0.44551412  0.04365382
 [49]  0.36906349  0.10034288  0.99372101 -1.75915548 -0.42245530 -1.57221626
 [55] -1.58803332  0.90026324 -0.91597757 -0.59663199 -0.29280950 -0.95702349
 [61]  0.07183570  1.84524052  1.09009875 -0.29423460  0.06205911 -1.02165274
 [67] -0.67015612 -0.13036509  1.76090782 -0.08844627 -0.93197134  0.07447136
 [73]  0.53535402  0.90294939 -2.71354399 -0.01186078  0.91704521 -0.80976937
 [79]  0.03376434 -0.80676109  1.30438241 -1.52869149  0.07991169  0.43117338
 [85] -0.54964918 -0.04609882 -0.87127698  0.45466860  0.66275478  0.06585766
 [91]  0.67001537  0.59946935  0.53231904  1.51548386 -0.98796952 -0.13489728
 [97]  3.33827918 -0.22786835  0.93065400  1.45742746
> 
> colMeans(tmp2)
[1] -0.03405012
> colSums(tmp2)
[1] -3.405012
> colVars(tmp2)
[1] 1.064644
> colSd(tmp2)
[1] 1.031816
> colMax(tmp2)
[1] 3.338279
> colMin(tmp2)
[1] -2.831849
> colMedians(tmp2)
[1] 0.03870908
> colRanges(tmp2)
          [,1]
[1,] -2.831849
[2,]  3.338279
> 
> 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.7092789  0.5356221  1.9161059  1.9649762  5.0109287 -1.4313218
 [7] -2.2562957  3.8543905  2.1281324  4.1009564
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7125305
[2,] -0.7894352
[3,] -0.2281121
[4,]  0.3597437
[5,]  0.9168152
> 
> rowApply(tmp,sum)
 [1] -0.8754725 -3.4720272 -0.1506065  0.1481318  4.3806115  4.0984134
 [7]  5.9141150  4.5109251 -2.5337529  1.0938783
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1   10    8    4    4    3    1    2    8     1
 [2,]    5    3    5    7    6    5    8    3    5     7
 [3,]    8    5    9    2    5    6    9    7    1     4
 [4,]   10    2    2    9   10    2    6    6    2    10
 [5,]    7    9    7    6    3    8    4   10    6     3
 [6,]    3    7    3    8    1   10    2    1   10     2
 [7,]    6    1    6    1    7    1    5    8    4     6
 [8,]    9    4    1    5    9    9   10    5    3     8
 [9,]    4    8    4   10    2    4    7    4    9     9
[10,]    2    6   10    3    8    7    3    9    7     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.174913613 -2.451345524  1.870491820  1.575974148 -3.696832049
 [6] -0.600493775 -2.956243311  1.390780774 -1.501948014  0.824912982
[11]  1.679812239 -1.382224051 -0.642638149 -3.039195442  2.999446620
[16]  0.008111706  2.275516462 -0.560464742  6.918991879  1.251859324
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9508162
[2,] -0.3287499
[3,]  1.0377847
[4,]  1.2920862
[5,]  2.1246088
> 
> rowApply(tmp,sum)
[1]  9.7976960  0.8018752 -2.2825335  3.2303389 -4.4079501
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   15   17   20    8    5
[2,]   19    1    3    9    4
[3,]    3   11   11   17   17
[4,]   10   14   14    3   20
[5,]    2    4    4    2   18
> 
> 
> as.matrix(tmp)
           [,1]       [,2]         [,3]       [,4]       [,5]       [,6]
[1,]  1.0377847  1.6185536 -0.304474171  0.4748330 -0.8897718 -1.6384189
[2,]  1.2920862 -1.4196446  0.319636620  0.9510389 -1.1925612 -0.6172384
[3,]  2.1246088 -1.3631044  0.002419048  0.2122806 -0.8563750  1.6360504
[4,] -0.3287499 -0.3256863  1.189383023 -1.5496927 -1.6878591 -0.6142619
[5,] -0.9508162 -0.9614638  0.663527300  1.4875143  0.9297350  0.6333750
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  0.5887815  1.2732928  0.3436928 -0.04107889  0.2545514 -0.1455291
[2,] -1.3827798  1.5465413  0.6222944  0.03315408  1.0454577 -0.7624787
[3,] -0.1930957  0.4489035 -1.5208470 -0.14012890 -0.8319033 -0.8065112
[4,] -0.7164960 -0.5739488 -0.5889854  2.52502127  0.8821214  0.8824225
[5,] -1.2526533 -1.3040080 -0.3581028 -1.55205459  0.3295850 -0.5501276
            [,13]      [,14]      [,15]       [,16]      [,17]       [,18]
[1,]  0.842573748  1.0790818 -0.2075385 -0.04700879  1.4978069  0.84938301
[2,] -1.393802083 -1.1334166  0.4220528 -0.70392001  0.9869421 -1.07852676
[3,]  0.004926923 -0.5045758  1.2066591  0.41202281 -0.5790821  0.06767126
[4,]  0.335181504 -1.9914865  2.0037713  1.00528015 -0.1546893  0.18541790
[5,] -0.431518241 -0.4887983 -0.4254981 -0.65826245  0.5245388 -0.58441014
         [,19]      [,20]
[1,] 2.7245201  0.4866606
[2,] 1.9709831  1.2960562
[3,] 0.7240726 -2.3265252
[4,] 0.4796387  2.2739571
[5,] 1.0197773 -0.4782893
> 
> 
> 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.23-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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.23-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.19235 -2.852936 -1.826968 -0.4599499 1.865361 -0.1664343 -1.638237
         col8      col9     col10     col11       col12      col13      col14
row1 1.248158 -0.139359 0.5598795 0.3851552 -0.08337798 -0.5930323 -0.1998345
         col15      col16     col17   col18      col19    col20
row1 -1.212385 -0.1274342 -1.396042 1.31041 -0.1224624 -2.00825
> tmp[,"col10"]
           col10
row1  0.55987945
row2  0.09075196
row3 -2.09942539
row4 -0.31048452
row5  1.73046598
> tmp[c("row1","row5"),]
           col1      col2       col3        col4     col5       col6      col7
row1  1.1923495 -2.852936 -1.8269678 -0.45994989 1.865361 -0.1664343 -1.638237
row5 -0.2159416  1.585593 -0.4016775 -0.04811175 1.476905  1.1966698  1.209086
           col8       col9     col10      col11       col12      col13
row1  1.2481576 -0.1393590 0.5598795  0.3851552 -0.08337798 -0.5930323
row5 -0.9281624  0.6079036 1.7304660 -1.5806442 -0.14850706 -2.4249828
          col14     col15      col16     col17     col18      col19      col20
row1 -0.1998345 -1.212385 -0.1274342 -1.396042  1.310410 -0.1224624 -2.0082503
row5 -0.2047116 -1.651912  1.6885733  0.179165 -1.308275 -1.1300546  0.7366072
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.1664343 -2.0082503
row2 -1.2293937  0.1549297
row3  0.9013852  1.0028716
row4 -0.2069002 -0.8026183
row5  1.1966698  0.7366072
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.1664343 -2.0082503
row5  1.1966698  0.7366072
> 
> 
> 
> 
> 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.54032 49.07791 50.87543 49.78494 50.90061 103.9442 50.7303 47.82678
         col9    col10    col11    col12    col13    col14    col15   col16
row1 49.01364 49.23193 49.25403 50.94446 49.61858 49.92179 50.92923 51.3361
        col17    col18    col19    col20
row1 50.14199 49.56951 50.13419 105.7536
> tmp[,"col10"]
        col10
row1 49.23193
row2 28.68119
row3 28.99215
row4 28.84277
row5 50.33064
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.54032 49.07791 50.87543 49.78494 50.90061 103.9442 50.73030 47.82678
row5 50.70932 49.15251 51.75500 48.92814 49.40605 105.1273 48.41732 49.45637
         col9    col10    col11    col12    col13    col14    col15   col16
row1 49.01364 49.23193 49.25403 50.94446 49.61858 49.92179 50.92923 51.3361
row5 51.86723 50.33064 50.98268 50.29992 48.95121 49.47082 50.09468 48.7797
        col17    col18    col19    col20
row1 50.14199 49.56951 50.13419 105.7536
row5 49.58688 51.02006 49.69201 106.4331
> tmp[,c("col6","col20")]
          col6     col20
row1 103.94423 105.75356
row2  75.01510  75.41991
row3  75.03377  74.05267
row4  74.79262  74.29028
row5 105.12725 106.43310
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.9442 105.7536
row5 105.1273 106.4331
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.9442 105.7536
row5 105.1273 106.4331
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.1672137
[2,]  0.4701690
[3,]  0.2233076
[4,]  0.5399296
[5,]  1.2362392
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.24084061 -0.2845619
[2,]  0.08248523 -2.3713876
[3,] -0.56118377  1.0151584
[4,] -1.90727561  1.7709291
[5,]  0.72932466 -0.7778369
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.9050257 -1.36579952
[2,] -1.0381368  0.57295991
[3,]  1.0450112 -0.40288307
[4,]  0.6445822 -0.68037586
[5,]  0.4658239 -0.08736485
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9050257
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9050257
[2,] -1.0381368
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]      [,3]        [,4]      [,5]       [,6]       [,7]
row3 1.1374509 0.6660118  1.542145 -0.07594575 0.6008276  0.8897145 -0.5105099
row1 0.3610142 2.0470765 -1.253453  0.44054875 0.2415474 -2.2314808 -1.1209521
            [,8]       [,9]      [,10]      [,11]      [,12]     [,13]
row3  0.06801526  0.6684780 -0.2598513  0.1141884 -0.7956300 1.1690501
row1 -0.66817415 -0.9482665 -0.4079967 -0.4494692 -0.3602558 0.7187741
          [,14]      [,15]     [,16]     [,17]      [,18]      [,19]     [,20]
row3 -0.1011883 -0.9475555 0.3673362 -2.147702  0.6250473 -1.1320912 1.9127700
row1 -0.8345033 -0.1360282 0.6125809  1.455285 -0.1246100  0.5210582 0.7898719
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
            [,1]      [,2]      [,3]     [,4]     [,5]     [,6]      [,7]
row2 -0.02880511 -0.849695 -0.374648 0.269599 0.908441 0.411153 0.8715537
          [,8]      [,9]      [,10]
row2 0.2675033 0.2229686 -0.6308537
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]        [,2]     [,3]      [,4]      [,5]       [,6]      [,7]
row5 0.5764115 -0.01559314 -1.36731 0.4287258 -0.901254 -0.1586832 0.4360446
           [,8]     [,9]      [,10]     [,11]       [,12]      [,13]     [,14]
row5 -0.1748621 2.446965 0.09547752 0.2253556 -0.06518135 -0.1990241 -2.315376
        [,15]     [,16]    [,17]    [,18]    [,19]      [,20]
row5 1.107599 -0.601185 -1.25026 0.395754 1.144974 0.06954973
> 
> 
> 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: 0x600002148000>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa301f4eca2d" 
 [2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa3017dbb5834"
 [3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa301169bfe69"
 [4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa3015b5bab17"
 [5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa3015f3da1dc"
 [6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa301474da35d"
 [7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa3013a20533d"
 [8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa3012038e79b"
 [9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa30177ed81a3"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa3019da31d8" 
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa30153fe60f5"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa301618f9fe7"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa3011c4b28bb"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa301a5f1b80" 
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMa3016a0675d1"
> 
> 
> ### 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: 0x60000212c0c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000212c0c0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000212c0c0>
> rowMedians(tmp)
  [1]  0.4518930901  0.1068390774  0.0208903257 -0.2486192365  0.4222483890
  [6] -0.1754838674 -0.0705389895  0.3855424391 -0.4363085739  0.2798886553
 [11]  0.7134647011  0.2475201918 -0.2039106323 -0.3885633062 -0.3857905449
 [16] -0.0577395430 -0.4219214575 -0.2699827398  0.1238876431 -0.1694286118
 [21]  0.0985975418  0.2066744275  0.1518844877 -0.1650436390  0.2843594188
 [26]  0.6690906049 -0.6376201660  0.2790484379 -0.5479560603  0.1102122986
 [31] -0.1382970855  0.3820271627 -0.0556255183  0.1295651344  0.1754580670
 [36] -0.2575379146  0.2815710087 -0.0331050041 -0.1617623893  0.1443125963
 [41] -0.2552653485 -0.2278613876  0.1719316458  0.0007193052 -0.1735252247
 [46] -0.8393300590 -0.1020565772  0.2425446266  0.1638250144  0.4467318079
 [51]  0.0400071543 -0.4320099616 -0.0167256323 -0.1743182687 -0.6232502138
 [56]  0.0340225873 -0.2208574620 -0.0298183540 -0.1147034110 -0.6419942682
 [61]  0.1149670393 -0.5430313075  0.2678917453  0.2214055311 -0.1226335332
 [66] -0.0682016003 -0.4895036937  0.1796417659 -0.2297458996  0.0500630108
 [71] -0.2031834621 -0.3271846533 -0.1192565039 -0.0236490730 -0.2070645829
 [76]  0.2570531511 -0.0434474350 -0.7226269556 -0.2597690672  0.1308214553
 [81] -0.0809842203 -0.3193835333 -0.1992471396  0.2072299913  0.4859104046
 [86]  0.1651478081 -0.2251191486  0.1930962066 -0.2500858784 -0.4600932523
 [91]  0.4576438123 -0.3976885608 -0.0898476679  0.0648276315 -0.2113610538
 [96]  0.6147914509  0.0013562710 -0.0758233276  0.0600616759  1.1944812226
[101] -0.3655185990 -0.2587523569  0.3928863190 -0.1266938482  0.1204282780
[106] -0.3642006789 -0.2932056633 -0.0832401658  0.3356511683  0.0764656347
[111]  0.2740709981 -0.0774144895 -0.2725436413  0.0511873939  0.2251007031
[116] -0.0158410609  0.0263046212  0.4524175625  0.0210101339 -0.7162496460
[121] -0.3829181311  0.2435679774  0.0230818096 -0.0866248572 -0.3503392333
[126]  0.3394338643 -0.1032009783  0.0172206771 -1.0787805902  0.1354741923
[131]  0.3095208547 -0.0138364692  0.4389553501 -0.3154142860  0.0323919371
[136] -0.0123263432 -0.0898630979  0.4720231259 -0.5932548426 -0.0992233303
[141]  0.5205647212 -0.1722990528 -0.1426611645  0.6079531562  0.0306333802
[146] -0.5816175692 -0.1019451974  0.4169475925 -0.0346144436 -0.2435106113
[151] -0.6761104087 -0.3292210509 -0.5788487610 -0.3231861707  0.5827616590
[156]  0.1136128647  0.0605995155  0.7088676939  0.3743367827  0.1872951610
[161] -0.0016060000 -0.4612111171  0.1518500911 -0.1842097652 -0.0986924110
[166]  0.1940260956 -0.3259598521 -0.3286358615  0.0301661812 -0.2883275329
[171]  0.0959884065  0.4757496983 -0.2270056367 -0.3871161849  0.3388936348
[176] -0.2527309552  0.3448893858 -0.1600395835 -0.1254916974  0.4952285500
[181] -0.1722615979 -0.1368887692  0.2025603937 -0.0897886082  0.0819748062
[186]  0.5342368477  0.5196439341 -0.0556899742 -0.6016335720 -0.2690587881
[191]  0.4262455005 -0.3316977375 -0.0637124935  0.2336907661 -0.4542752219
[196] -0.3560519203  0.0079852362  0.0222172976 -0.3201215151 -0.1285749816
[201] -0.1529297886 -0.5228518086  0.0499876436 -0.0577714912  0.6461741041
[206] -0.4805276851 -0.1518442041 -0.0692648748  0.2487354243  0.0824461068
[211]  0.4127536847 -0.6905129611  0.2985009861 -0.2530503044  0.2141569064
[216]  0.1305747438 -0.2457489750  0.3696553022  0.3395691685 -0.0798009220
[221] -0.2134168098  0.3699381504  0.0346905730 -0.1013310747 -0.6672602624
[226] -0.3817994919  0.0423950576 -0.5218452129  0.3581781068  0.2184947414
> 
> proc.time()
   user  system elapsed 
  2.669  14.987  18.306 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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: 0x600002ae4180>
> .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: 0x600002ae4180>
> .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: 0x600002ae4180>
> .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: 0x600002ae4180>
> 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: 0x600002aa8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002aa8000>
> .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: 0x600002aa8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002aa8000>
> .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: 0x600002aa8000>
> 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: 0x600002ae00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002ae00c0>
> .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: 0x600002ae00c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002ae00c0>
> .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: 0x600002ae00c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002ae00c0>
> .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: 0x600002ae00c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002ae00c0>
> .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: 0x600002ae00c0>
> 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: 0x600002aa0000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002aa0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002aa0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002aa0000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea935490bdad5" "BufferedMatrixFilea9357dd2a6b" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea935490bdad5" "BufferedMatrixFilea9357dd2a6b" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002aa0240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002aa0240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002aa0240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002aa0240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002aa0240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002aa0240>
> .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: 0x600002aa0420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002aa0420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002aa0420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002aa0420>
> 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: 0x600002aa04e0>
> .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: 0x600002aa04e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.321   0.152   0.488 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-10-21 r88958) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-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.315   0.095   0.445 

Example timings