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

This page was generated on 2025-11-28 11:37 -0500 (Fri, 28 Nov 2025).

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

Package 252/2328HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.75.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-11-27 13:40 -0500 (Thu, 27 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 nebbiolo1

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: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-11-27 21:37:12 -0500 (Thu, 27 Nov 2025)
EndedAt: 2025-11-27 21:37:38 -0500 (Thu, 27 Nov 2025)
EllapsedTime: 26.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-20 r88955)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* 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 ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* 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 loading without being on the library search path ... 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’ ...* 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 re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 1 NOTE
See
  ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-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-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.234   0.053   0.278 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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] "/home/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) max used (Mb)
Ncells 478818 25.6    1048392   56   639317 34.2
Vcells 885623  6.8    8388608   64  2082728 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov 27 21:37:28 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov 27 21:37:28 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: 0x62a642ba85e0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov 27 21:37:29 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov 27 21:37:29 2025"
> 
> ColMode(tmp2)
<pointer: 0x62a642ba85e0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]       [,4]
[1,] 99.8243894 -0.5863820 -1.131318 -0.6800489
[2,] -0.6271226 -0.5740558 -1.243773  0.5067654
[3,]  2.1797038  0.6493782  1.606845 -0.3552754
[4,] -0.9821561 -0.1853928 -0.377986  0.9651585
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/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,] 99.8243894 0.5863820 1.131318 0.6800489
[2,]  0.6271226 0.5740558 1.243773 0.5067654
[3,]  2.1797038 0.6493782 1.606845 0.3552754
[4,]  0.9821561 0.1853928 0.377986 0.9651585
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/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.9912156 0.7657558 1.0636341 0.8246508
[2,] 0.7919107 0.7576647 1.1152458 0.7118746
[3,] 1.4763820 0.8058401 1.2676138 0.5960498
[4,] 0.9910379 0.4305726 0.6148056 0.9824248
> 
> 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:    /home/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,] 224.73655 33.24394 36.76766 33.92656
[2,]  33.54623 33.15070 37.39623 32.62551
[3,]  41.94352 33.70778 39.28298 31.31577
[4,]  35.89254 29.49112 31.52604 35.78941
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x62a642598350>
> exp(tmp5)
<pointer: 0x62a642598350>
> log(tmp5,2)
<pointer: 0x62a642598350>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.7597
> Min(tmp5)
[1] 53.65379
> mean(tmp5)
[1] 72.953
> Sum(tmp5)
[1] 14590.6
> Var(tmp5)
[1] 857.425
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.96605 69.84392 73.89592 71.46575 72.47024 71.93902 71.75609 69.59354
 [9] 68.27349 69.32594
> rowSums(tmp5)
 [1] 1819.321 1396.878 1477.918 1429.315 1449.405 1438.780 1435.122 1391.871
 [9] 1365.470 1386.519
> rowVars(tmp5)
 [1] 7908.10141   53.12986   65.44291   48.31523   93.63250   68.79208
 [7]  113.03668   75.55151   69.41040   78.38552
> rowSd(tmp5)
 [1] 88.927506  7.289023  8.089679  6.950916  9.676389  8.294099 10.631871
 [8]  8.692037  8.331290  8.853560
> rowMax(tmp5)
 [1] 467.75967  82.16509  90.47039  87.88295  89.92215  89.55437  87.10428
 [8]  90.61447  86.98680  83.42906
> rowMin(tmp5)
 [1] 58.43347 53.67305 62.58650 60.18889 53.65379 60.12927 54.78274 55.34893
 [9] 53.72663 54.15804
> 
> colMeans(tmp5)
 [1] 111.96892  64.58540  69.42656  68.16474  72.31176  69.80738  71.79100
 [8]  72.82428  69.29235  72.61869  71.46192  65.33287  70.43432  77.73299
[15]  73.36038  71.32893  71.45278  72.10232  71.34572  71.71662
> colSums(tmp5)
 [1] 1119.6892  645.8540  694.2656  681.6474  723.1176  698.0738  717.9100
 [8]  728.2428  692.9235  726.1869  714.6192  653.3287  704.3432  777.3299
[15]  733.6038  713.2893  714.5278  721.0232  713.4572  717.1662
> colVars(tmp5)
 [1] 15707.38974    24.54820    68.13327    68.31634    66.40473    74.26026
 [7]   143.33328   101.17208    99.84611    23.80057    73.20815    46.80730
[13]    34.72318    98.26268    64.49161    46.87985   104.84966    89.23895
[19]    29.90297    46.18514
> colSd(tmp5)
 [1] 125.329126   4.954614   8.254288   8.265370   8.148910   8.617439
 [7]  11.972188  10.058433   9.992302   4.878583   8.556176   6.841586
[13]   5.892638   9.912753   8.030667   6.846886  10.239612   9.446637
[19]   5.468361   6.795965
> colMax(tmp5)
 [1] 467.75967  70.15833  81.76238  82.05671  84.88132  83.18077  90.47039
 [8]  90.61447  83.25118  79.87233  84.47620  72.03802  78.20405  89.55437
[15]  85.33474  79.41332  85.53943  89.92215  80.78651  84.73825
> colMin(tmp5)
 [1] 58.21543 54.78274 54.97482 53.72663 60.18889 57.52710 54.15804 58.06151
 [9] 53.67305 64.17291 59.21628 54.41589 61.63993 59.81854 59.17414 57.95731
[17] 53.65379 60.47712 63.51626 63.72456
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.96605 69.84392 73.89592       NA 72.47024 71.93902 71.75609 69.59354
 [9] 68.27349 69.32594
> rowSums(tmp5)
 [1] 1819.321 1396.878 1477.918       NA 1449.405 1438.780 1435.122 1391.871
 [9] 1365.470 1386.519
> rowVars(tmp5)
 [1] 7908.10141   53.12986   65.44291   49.47808   93.63250   68.79208
 [7]  113.03668   75.55151   69.41040   78.38552
> rowSd(tmp5)
 [1] 88.927506  7.289023  8.089679  7.034065  9.676389  8.294099 10.631871
 [8]  8.692037  8.331290  8.853560
> rowMax(tmp5)
 [1] 467.75967  82.16509  90.47039        NA  89.92215  89.55437  87.10428
 [8]  90.61447  86.98680  83.42906
> rowMin(tmp5)
 [1] 58.43347 53.67305 62.58650       NA 53.65379 60.12927 54.78274 55.34893
 [9] 53.72663 54.15804
> 
> colMeans(tmp5)
 [1] 111.96892  64.58540  69.42656  68.16474  72.31176  69.80738  71.79100
 [8]  72.82428  69.29235  72.61869  71.46192  65.33287  70.43432  77.73299
[15]  73.36038  71.32893  71.45278  72.10232  71.34572        NA
> colSums(tmp5)
 [1] 1119.6892  645.8540  694.2656  681.6474  723.1176  698.0738  717.9100
 [8]  728.2428  692.9235  726.1869  714.6192  653.3287  704.3432  777.3299
[15]  733.6038  713.2893  714.5278  721.0232  713.4572        NA
> colVars(tmp5)
 [1] 15707.38974    24.54820    68.13327    68.31634    66.40473    74.26026
 [7]   143.33328   101.17208    99.84611    23.80057    73.20815    46.80730
[13]    34.72318    98.26268    64.49161    46.87985   104.84966    89.23895
[19]    29.90297          NA
> colSd(tmp5)
 [1] 125.329126   4.954614   8.254288   8.265370   8.148910   8.617439
 [7]  11.972188  10.058433   9.992302   4.878583   8.556176   6.841586
[13]   5.892638   9.912753   8.030667   6.846886  10.239612   9.446637
[19]   5.468361         NA
> colMax(tmp5)
 [1] 467.75967  70.15833  81.76238  82.05671  84.88132  83.18077  90.47039
 [8]  90.61447  83.25118  79.87233  84.47620  72.03802  78.20405  89.55437
[15]  85.33474  79.41332  85.53943  89.92215  80.78651        NA
> colMin(tmp5)
 [1] 58.21543 54.78274 54.97482 53.72663 60.18889 57.52710 54.15804 58.06151
 [9] 53.67305 64.17291 59.21628 54.41589 61.63993 59.81854 59.17414 57.95731
[17] 53.65379 60.47712 63.51626       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.7597
> Min(tmp5,na.rm=TRUE)
[1] 53.65379
> mean(tmp5,na.rm=TRUE)
[1] 72.9861
> Sum(tmp5,na.rm=TRUE)
[1] 14524.23
> Var(tmp5,na.rm=TRUE)
[1] 861.5351
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.96605 69.84392 73.89592 71.73420 72.47024 71.93902 71.75609 69.59354
 [9] 68.27349 69.32594
> rowSums(tmp5,na.rm=TRUE)
 [1] 1819.321 1396.878 1477.918 1362.950 1449.405 1438.780 1435.122 1391.871
 [9] 1365.470 1386.519
> rowVars(tmp5,na.rm=TRUE)
 [1] 7908.10141   53.12986   65.44291   49.47808   93.63250   68.79208
 [7]  113.03668   75.55151   69.41040   78.38552
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.927506  7.289023  8.089679  7.034065  9.676389  8.294099 10.631871
 [8]  8.692037  8.331290  8.853560
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.75967  82.16509  90.47039  87.88295  89.92215  89.55437  87.10428
 [8]  90.61447  86.98680  83.42906
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.43347 53.67305 62.58650 60.18889 53.65379 60.12927 54.78274 55.34893
 [9] 53.72663 54.15804
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.96892  64.58540  69.42656  68.16474  72.31176  69.80738  71.79100
 [8]  72.82428  69.29235  72.61869  71.46192  65.33287  70.43432  77.73299
[15]  73.36038  71.32893  71.45278  72.10232  71.34572  72.31122
> colSums(tmp5,na.rm=TRUE)
 [1] 1119.6892  645.8540  694.2656  681.6474  723.1176  698.0738  717.9100
 [8]  728.2428  692.9235  726.1869  714.6192  653.3287  704.3432  777.3299
[15]  733.6038  713.2893  714.5278  721.0232  713.4572  650.8009
> colVars(tmp5,na.rm=TRUE)
 [1] 15707.38974    24.54820    68.13327    68.31634    66.40473    74.26026
 [7]   143.33328   101.17208    99.84611    23.80057    73.20815    46.80730
[13]    34.72318    98.26268    64.49161    46.87985   104.84966    89.23895
[19]    29.90297    47.98095
> colSd(tmp5,na.rm=TRUE)
 [1] 125.329126   4.954614   8.254288   8.265370   8.148910   8.617439
 [7]  11.972188  10.058433   9.992302   4.878583   8.556176   6.841586
[13]   5.892638   9.912753   8.030667   6.846886  10.239612   9.446637
[19]   5.468361   6.926829
> colMax(tmp5,na.rm=TRUE)
 [1] 467.75967  70.15833  81.76238  82.05671  84.88132  83.18077  90.47039
 [8]  90.61447  83.25118  79.87233  84.47620  72.03802  78.20405  89.55437
[15]  85.33474  79.41332  85.53943  89.92215  80.78651  84.73825
> colMin(tmp5,na.rm=TRUE)
 [1] 58.21543 54.78274 54.97482 53.72663 60.18889 57.52710 54.15804 58.06151
 [9] 53.67305 64.17291 59.21628 54.41589 61.63993 59.81854 59.17414 57.95731
[17] 53.65379 60.47712 63.51626 63.72456
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.96605 69.84392 73.89592      NaN 72.47024 71.93902 71.75609 69.59354
 [9] 68.27349 69.32594
> rowSums(tmp5,na.rm=TRUE)
 [1] 1819.321 1396.878 1477.918    0.000 1449.405 1438.780 1435.122 1391.871
 [9] 1365.470 1386.519
> rowVars(tmp5,na.rm=TRUE)
 [1] 7908.10141   53.12986   65.44291         NA   93.63250   68.79208
 [7]  113.03668   75.55151   69.41040   78.38552
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.927506  7.289023  8.089679        NA  9.676389  8.294099 10.631871
 [8]  8.692037  8.331290  8.853560
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.75967  82.16509  90.47039        NA  89.92215  89.55437  87.10428
 [8]  90.61447  86.98680  83.42906
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.43347 53.67305 62.58650       NA 53.65379 60.12927 54.78274 55.34893
 [9] 53.72663 54.15804
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.10929  64.94134  69.84981  67.46183  73.65874  68.32145  71.75622
 [8]  72.89974  69.24269  72.81283  71.94574  64.68393  71.07323  76.60522
[15]  72.35558  71.21200  71.30430  72.53814  71.28161       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1044.9836  584.4721  628.6483  607.1565  662.9287  614.8930  645.8060
 [8]  656.0977  623.1842  655.3155  647.5117  582.1553  639.6591  689.4470
[15]  651.2002  640.9080  641.7387  652.8433  641.5345    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 17477.95868    26.19139    74.63461    71.29740    54.29365    58.70284
 [7]   161.23634   113.75452   112.29913    26.35164    79.72572    47.92051
[13]    34.47126    96.23696    61.19477    52.58602   117.70787    98.25695
[19]    33.59459          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 132.204231   5.117752   8.639133   8.443779   7.368423   7.661778
 [7]  12.697887  10.665576  10.597128   5.133385   8.928926   6.922464
[13]   5.871223   9.810044   7.822709   7.251622  10.849326   9.912464
[19]   5.796084         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 467.75967  70.15833  81.76238  82.05671  84.88132  78.76307  90.47039
 [8]  90.61447  83.25118  79.87233  84.47620  72.03802  78.20405  89.55437
[15]  85.33474  79.41332  85.53943  89.92215  80.78651      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 58.21543 54.78274 54.97482 53.72663 60.28243 57.52710 54.15804 58.06151
 [9] 53.67305 64.17291 59.21628 54.41589 61.63993 59.81854 59.17414 57.95731
[17] 53.65379 60.47712 63.51626      Inf
> 
> 
> 
> 
> 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] 341.3316 280.8435 190.1269 304.5005 215.9170 224.1879 305.2817 172.1005
 [9] 326.8515 134.4684
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 341.3316 280.8435 190.1269 304.5005 215.9170 224.1879 305.2817 172.1005
 [9] 326.8515 134.4684
> 
> 
> 
> 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]  0.000000e+00 -1.421085e-13  5.684342e-14 -5.684342e-14 -1.705303e-13
 [6] -1.705303e-13  1.136868e-13  1.705303e-13  1.705303e-13 -2.842171e-14
[11] -5.684342e-14 -5.684342e-14  5.684342e-14  0.000000e+00 -7.815970e-14
[16]  2.273737e-13  2.842171e-14  1.705303e-13  1.136868e-13  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   5 
3   10 
7   20 
7   9 
2   20 
3   1 
3   5 
4   8 
5   5 
6   4 
3   9 
10   19 
6   1 
9   7 
3   8 
8   7 
5   19 
6   10 
9   19 
2   13 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 1.957701
> Min(tmp)
[1] -1.908905
> mean(tmp)
[1] 0.007822814
> Sum(tmp)
[1] 0.7822814
> Var(tmp)
[1] 0.8771336
> 
> rowMeans(tmp)
[1] 0.007822814
> rowSums(tmp)
[1] 0.7822814
> rowVars(tmp)
[1] 0.8771336
> rowSd(tmp)
[1] 0.9365541
> rowMax(tmp)
[1] 1.957701
> rowMin(tmp)
[1] -1.908905
> 
> colMeans(tmp)
  [1] -1.384205753 -0.011244814  0.613420192 -0.932065507  1.439366742
  [6] -0.205137626 -0.424286381 -1.192448879  0.987500953  0.214839012
 [11] -1.249382335 -0.455229819  0.057268575  1.106406333 -1.128547914
 [16]  0.424996656  0.234188824 -0.508923359 -0.395501347 -0.419411251
 [21] -0.443725218 -1.256962936 -1.437286381  1.018688932  0.188764097
 [26] -1.144094403  1.951799306  0.437292041 -1.832540962 -0.344707602
 [31] -0.337044778 -0.737590070 -0.361202015 -0.980051392 -0.459781456
 [36]  0.881583640  0.081677395  0.796266780 -0.009631682  0.944901811
 [41] -0.011829940 -0.322797855 -0.148947933 -0.405154591  0.807167626
 [46]  0.584827946 -1.734820903  0.716021144 -1.084074876 -0.343583371
 [51]  1.391090513  1.168374931 -0.137766807  0.761266789  1.260597801
 [56] -0.029266728 -0.845198940 -1.039464127 -0.135461077  0.931875414
 [61]  0.137728542  0.812399537  1.585195155  0.039263066  1.554436429
 [66]  0.328555933  1.624615302  0.276395516 -1.908904768  0.231159275
 [71]  0.603614531 -0.630294085 -0.525299516 -1.602288295  0.954288128
 [76]  0.533620096  1.957700961 -0.658486173 -0.088661289 -0.739597969
 [81]  1.429032358  1.661679641  1.101539934 -0.840855768 -1.514713238
 [86] -0.741003427 -0.404315139 -0.234145214  1.341713682  1.462098626
 [91]  1.219774258  0.735640612 -0.537606618 -1.282100638 -0.303114083
 [96] -0.262213156 -0.984129309  0.082019588 -0.986049441  0.242775957
> colSums(tmp)
  [1] -1.384205753 -0.011244814  0.613420192 -0.932065507  1.439366742
  [6] -0.205137626 -0.424286381 -1.192448879  0.987500953  0.214839012
 [11] -1.249382335 -0.455229819  0.057268575  1.106406333 -1.128547914
 [16]  0.424996656  0.234188824 -0.508923359 -0.395501347 -0.419411251
 [21] -0.443725218 -1.256962936 -1.437286381  1.018688932  0.188764097
 [26] -1.144094403  1.951799306  0.437292041 -1.832540962 -0.344707602
 [31] -0.337044778 -0.737590070 -0.361202015 -0.980051392 -0.459781456
 [36]  0.881583640  0.081677395  0.796266780 -0.009631682  0.944901811
 [41] -0.011829940 -0.322797855 -0.148947933 -0.405154591  0.807167626
 [46]  0.584827946 -1.734820903  0.716021144 -1.084074876 -0.343583371
 [51]  1.391090513  1.168374931 -0.137766807  0.761266789  1.260597801
 [56] -0.029266728 -0.845198940 -1.039464127 -0.135461077  0.931875414
 [61]  0.137728542  0.812399537  1.585195155  0.039263066  1.554436429
 [66]  0.328555933  1.624615302  0.276395516 -1.908904768  0.231159275
 [71]  0.603614531 -0.630294085 -0.525299516 -1.602288295  0.954288128
 [76]  0.533620096  1.957700961 -0.658486173 -0.088661289 -0.739597969
 [81]  1.429032358  1.661679641  1.101539934 -0.840855768 -1.514713238
 [86] -0.741003427 -0.404315139 -0.234145214  1.341713682  1.462098626
 [91]  1.219774258  0.735640612 -0.537606618 -1.282100638 -0.303114083
 [96] -0.262213156 -0.984129309  0.082019588 -0.986049441  0.242775957
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.384205753 -0.011244814  0.613420192 -0.932065507  1.439366742
  [6] -0.205137626 -0.424286381 -1.192448879  0.987500953  0.214839012
 [11] -1.249382335 -0.455229819  0.057268575  1.106406333 -1.128547914
 [16]  0.424996656  0.234188824 -0.508923359 -0.395501347 -0.419411251
 [21] -0.443725218 -1.256962936 -1.437286381  1.018688932  0.188764097
 [26] -1.144094403  1.951799306  0.437292041 -1.832540962 -0.344707602
 [31] -0.337044778 -0.737590070 -0.361202015 -0.980051392 -0.459781456
 [36]  0.881583640  0.081677395  0.796266780 -0.009631682  0.944901811
 [41] -0.011829940 -0.322797855 -0.148947933 -0.405154591  0.807167626
 [46]  0.584827946 -1.734820903  0.716021144 -1.084074876 -0.343583371
 [51]  1.391090513  1.168374931 -0.137766807  0.761266789  1.260597801
 [56] -0.029266728 -0.845198940 -1.039464127 -0.135461077  0.931875414
 [61]  0.137728542  0.812399537  1.585195155  0.039263066  1.554436429
 [66]  0.328555933  1.624615302  0.276395516 -1.908904768  0.231159275
 [71]  0.603614531 -0.630294085 -0.525299516 -1.602288295  0.954288128
 [76]  0.533620096  1.957700961 -0.658486173 -0.088661289 -0.739597969
 [81]  1.429032358  1.661679641  1.101539934 -0.840855768 -1.514713238
 [86] -0.741003427 -0.404315139 -0.234145214  1.341713682  1.462098626
 [91]  1.219774258  0.735640612 -0.537606618 -1.282100638 -0.303114083
 [96] -0.262213156 -0.984129309  0.082019588 -0.986049441  0.242775957
> colMin(tmp)
  [1] -1.384205753 -0.011244814  0.613420192 -0.932065507  1.439366742
  [6] -0.205137626 -0.424286381 -1.192448879  0.987500953  0.214839012
 [11] -1.249382335 -0.455229819  0.057268575  1.106406333 -1.128547914
 [16]  0.424996656  0.234188824 -0.508923359 -0.395501347 -0.419411251
 [21] -0.443725218 -1.256962936 -1.437286381  1.018688932  0.188764097
 [26] -1.144094403  1.951799306  0.437292041 -1.832540962 -0.344707602
 [31] -0.337044778 -0.737590070 -0.361202015 -0.980051392 -0.459781456
 [36]  0.881583640  0.081677395  0.796266780 -0.009631682  0.944901811
 [41] -0.011829940 -0.322797855 -0.148947933 -0.405154591  0.807167626
 [46]  0.584827946 -1.734820903  0.716021144 -1.084074876 -0.343583371
 [51]  1.391090513  1.168374931 -0.137766807  0.761266789  1.260597801
 [56] -0.029266728 -0.845198940 -1.039464127 -0.135461077  0.931875414
 [61]  0.137728542  0.812399537  1.585195155  0.039263066  1.554436429
 [66]  0.328555933  1.624615302  0.276395516 -1.908904768  0.231159275
 [71]  0.603614531 -0.630294085 -0.525299516 -1.602288295  0.954288128
 [76]  0.533620096  1.957700961 -0.658486173 -0.088661289 -0.739597969
 [81]  1.429032358  1.661679641  1.101539934 -0.840855768 -1.514713238
 [86] -0.741003427 -0.404315139 -0.234145214  1.341713682  1.462098626
 [91]  1.219774258  0.735640612 -0.537606618 -1.282100638 -0.303114083
 [96] -0.262213156 -0.984129309  0.082019588 -0.986049441  0.242775957
> colMedians(tmp)
  [1] -1.384205753 -0.011244814  0.613420192 -0.932065507  1.439366742
  [6] -0.205137626 -0.424286381 -1.192448879  0.987500953  0.214839012
 [11] -1.249382335 -0.455229819  0.057268575  1.106406333 -1.128547914
 [16]  0.424996656  0.234188824 -0.508923359 -0.395501347 -0.419411251
 [21] -0.443725218 -1.256962936 -1.437286381  1.018688932  0.188764097
 [26] -1.144094403  1.951799306  0.437292041 -1.832540962 -0.344707602
 [31] -0.337044778 -0.737590070 -0.361202015 -0.980051392 -0.459781456
 [36]  0.881583640  0.081677395  0.796266780 -0.009631682  0.944901811
 [41] -0.011829940 -0.322797855 -0.148947933 -0.405154591  0.807167626
 [46]  0.584827946 -1.734820903  0.716021144 -1.084074876 -0.343583371
 [51]  1.391090513  1.168374931 -0.137766807  0.761266789  1.260597801
 [56] -0.029266728 -0.845198940 -1.039464127 -0.135461077  0.931875414
 [61]  0.137728542  0.812399537  1.585195155  0.039263066  1.554436429
 [66]  0.328555933  1.624615302  0.276395516 -1.908904768  0.231159275
 [71]  0.603614531 -0.630294085 -0.525299516 -1.602288295  0.954288128
 [76]  0.533620096  1.957700961 -0.658486173 -0.088661289 -0.739597969
 [81]  1.429032358  1.661679641  1.101539934 -0.840855768 -1.514713238
 [86] -0.741003427 -0.404315139 -0.234145214  1.341713682  1.462098626
 [91]  1.219774258  0.735640612 -0.537606618 -1.282100638 -0.303114083
 [96] -0.262213156 -0.984129309  0.082019588 -0.986049441  0.242775957
> colRanges(tmp)
          [,1]        [,2]      [,3]       [,4]     [,5]       [,6]       [,7]
[1,] -1.384206 -0.01124481 0.6134202 -0.9320655 1.439367 -0.2051376 -0.4242864
[2,] -1.384206 -0.01124481 0.6134202 -0.9320655 1.439367 -0.2051376 -0.4242864
          [,8]     [,9]    [,10]     [,11]      [,12]      [,13]    [,14]
[1,] -1.192449 0.987501 0.214839 -1.249382 -0.4552298 0.05726858 1.106406
[2,] -1.192449 0.987501 0.214839 -1.249382 -0.4552298 0.05726858 1.106406
         [,15]     [,16]     [,17]      [,18]      [,19]      [,20]      [,21]
[1,] -1.128548 0.4249967 0.2341888 -0.5089234 -0.3955013 -0.4194113 -0.4437252
[2,] -1.128548 0.4249967 0.2341888 -0.5089234 -0.3955013 -0.4194113 -0.4437252
         [,22]     [,23]    [,24]     [,25]     [,26]    [,27]    [,28]
[1,] -1.256963 -1.437286 1.018689 0.1887641 -1.144094 1.951799 0.437292
[2,] -1.256963 -1.437286 1.018689 0.1887641 -1.144094 1.951799 0.437292
         [,29]      [,30]      [,31]      [,32]     [,33]      [,34]      [,35]
[1,] -1.832541 -0.3447076 -0.3370448 -0.7375901 -0.361202 -0.9800514 -0.4597815
[2,] -1.832541 -0.3447076 -0.3370448 -0.7375901 -0.361202 -0.9800514 -0.4597815
         [,36]     [,37]     [,38]        [,39]     [,40]       [,41]
[1,] 0.8815836 0.0816774 0.7962668 -0.009631682 0.9449018 -0.01182994
[2,] 0.8815836 0.0816774 0.7962668 -0.009631682 0.9449018 -0.01182994
          [,42]      [,43]      [,44]     [,45]     [,46]     [,47]     [,48]
[1,] -0.3227979 -0.1489479 -0.4051546 0.8071676 0.5848279 -1.734821 0.7160211
[2,] -0.3227979 -0.1489479 -0.4051546 0.8071676 0.5848279 -1.734821 0.7160211
         [,49]      [,50]    [,51]    [,52]      [,53]     [,54]    [,55]
[1,] -1.084075 -0.3435834 1.391091 1.168375 -0.1377668 0.7612668 1.260598
[2,] -1.084075 -0.3435834 1.391091 1.168375 -0.1377668 0.7612668 1.260598
           [,56]      [,57]     [,58]      [,59]     [,60]     [,61]     [,62]
[1,] -0.02926673 -0.8451989 -1.039464 -0.1354611 0.9318754 0.1377285 0.8123995
[2,] -0.02926673 -0.8451989 -1.039464 -0.1354611 0.9318754 0.1377285 0.8123995
        [,63]      [,64]    [,65]     [,66]    [,67]     [,68]     [,69]
[1,] 1.585195 0.03926307 1.554436 0.3285559 1.624615 0.2763955 -1.908905
[2,] 1.585195 0.03926307 1.554436 0.3285559 1.624615 0.2763955 -1.908905
         [,70]     [,71]      [,72]      [,73]     [,74]     [,75]     [,76]
[1,] 0.2311593 0.6036145 -0.6302941 -0.5252995 -1.602288 0.9542881 0.5336201
[2,] 0.2311593 0.6036145 -0.6302941 -0.5252995 -1.602288 0.9542881 0.5336201
        [,77]      [,78]       [,79]     [,80]    [,81]   [,82]   [,83]
[1,] 1.957701 -0.6584862 -0.08866129 -0.739598 1.429032 1.66168 1.10154
[2,] 1.957701 -0.6584862 -0.08866129 -0.739598 1.429032 1.66168 1.10154
          [,84]     [,85]      [,86]      [,87]      [,88]    [,89]    [,90]
[1,] -0.8408558 -1.514713 -0.7410034 -0.4043151 -0.2341452 1.341714 1.462099
[2,] -0.8408558 -1.514713 -0.7410034 -0.4043151 -0.2341452 1.341714 1.462099
        [,91]     [,92]      [,93]     [,94]      [,95]      [,96]      [,97]
[1,] 1.219774 0.7356406 -0.5376066 -1.282101 -0.3031141 -0.2622132 -0.9841293
[2,] 1.219774 0.7356406 -0.5376066 -1.282101 -0.3031141 -0.2622132 -0.9841293
          [,98]      [,99]   [,100]
[1,] 0.08201959 -0.9860494 0.242776
[2,] 0.08201959 -0.9860494 0.242776
> 
> 
> Max(tmp2)
[1] 2.751706
> Min(tmp2)
[1] -3.305747
> mean(tmp2)
[1] 0.04698219
> Sum(tmp2)
[1] 4.698219
> Var(tmp2)
[1] 1.217642
> 
> rowMeans(tmp2)
  [1] -2.09692134  1.18075806  0.31254007  0.33095270  0.64744165 -0.56947383
  [7]  1.45399396  0.58793021  0.78608552  2.34965992 -0.50048917  0.58806807
 [13] -0.67737714 -1.41596328 -1.43569962  0.90117455 -0.31741701  1.36787632
 [19]  0.09799746  1.44487330  0.17885501 -0.64322357 -1.07750275  0.50831482
 [25] -0.13384638  0.44109525 -0.43200943  0.87947815 -0.83211743 -0.63121144
 [31]  1.45141447  0.21286475 -0.26688084  1.34633407 -1.61200364 -0.80098200
 [37] -0.33052662 -0.84483395  1.44843139  0.23160515 -1.19512352  1.42970727
 [43] -0.27949598  1.19001357 -1.67236456  0.41025004 -0.63055577 -0.56092670
 [49]  1.36000438  1.81890644 -0.85909699 -1.38690415  0.31241548  0.76128898
 [55]  0.91593013  0.21279870 -3.30574695  0.59260429 -0.80160415 -1.49594447
 [61]  2.23277619 -0.87898816  0.30226677 -0.65710068  0.85221966 -0.53495711
 [67] -0.89824594 -0.60142204 -0.76208505  1.97815569  0.88804203  2.75170647
 [73] -0.90696806 -0.46822696 -0.10675218  0.32967574  0.84682802 -1.46117306
 [79] -1.74117695 -0.03811790 -2.42684040  0.66686645 -1.02902400  1.28045129
 [85] -0.85375810 -0.25569130  1.67507118  0.65361772 -0.08606186  1.49304700
 [91]  0.45232756 -0.56935219  1.01265047 -0.65157502 -0.57598360 -0.65678912
 [97]  0.19906636  0.44494992  0.42504778  1.42832141
> rowSums(tmp2)
  [1] -2.09692134  1.18075806  0.31254007  0.33095270  0.64744165 -0.56947383
  [7]  1.45399396  0.58793021  0.78608552  2.34965992 -0.50048917  0.58806807
 [13] -0.67737714 -1.41596328 -1.43569962  0.90117455 -0.31741701  1.36787632
 [19]  0.09799746  1.44487330  0.17885501 -0.64322357 -1.07750275  0.50831482
 [25] -0.13384638  0.44109525 -0.43200943  0.87947815 -0.83211743 -0.63121144
 [31]  1.45141447  0.21286475 -0.26688084  1.34633407 -1.61200364 -0.80098200
 [37] -0.33052662 -0.84483395  1.44843139  0.23160515 -1.19512352  1.42970727
 [43] -0.27949598  1.19001357 -1.67236456  0.41025004 -0.63055577 -0.56092670
 [49]  1.36000438  1.81890644 -0.85909699 -1.38690415  0.31241548  0.76128898
 [55]  0.91593013  0.21279870 -3.30574695  0.59260429 -0.80160415 -1.49594447
 [61]  2.23277619 -0.87898816  0.30226677 -0.65710068  0.85221966 -0.53495711
 [67] -0.89824594 -0.60142204 -0.76208505  1.97815569  0.88804203  2.75170647
 [73] -0.90696806 -0.46822696 -0.10675218  0.32967574  0.84682802 -1.46117306
 [79] -1.74117695 -0.03811790 -2.42684040  0.66686645 -1.02902400  1.28045129
 [85] -0.85375810 -0.25569130  1.67507118  0.65361772 -0.08606186  1.49304700
 [91]  0.45232756 -0.56935219  1.01265047 -0.65157502 -0.57598360 -0.65678912
 [97]  0.19906636  0.44494992  0.42504778  1.42832141
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -2.09692134  1.18075806  0.31254007  0.33095270  0.64744165 -0.56947383
  [7]  1.45399396  0.58793021  0.78608552  2.34965992 -0.50048917  0.58806807
 [13] -0.67737714 -1.41596328 -1.43569962  0.90117455 -0.31741701  1.36787632
 [19]  0.09799746  1.44487330  0.17885501 -0.64322357 -1.07750275  0.50831482
 [25] -0.13384638  0.44109525 -0.43200943  0.87947815 -0.83211743 -0.63121144
 [31]  1.45141447  0.21286475 -0.26688084  1.34633407 -1.61200364 -0.80098200
 [37] -0.33052662 -0.84483395  1.44843139  0.23160515 -1.19512352  1.42970727
 [43] -0.27949598  1.19001357 -1.67236456  0.41025004 -0.63055577 -0.56092670
 [49]  1.36000438  1.81890644 -0.85909699 -1.38690415  0.31241548  0.76128898
 [55]  0.91593013  0.21279870 -3.30574695  0.59260429 -0.80160415 -1.49594447
 [61]  2.23277619 -0.87898816  0.30226677 -0.65710068  0.85221966 -0.53495711
 [67] -0.89824594 -0.60142204 -0.76208505  1.97815569  0.88804203  2.75170647
 [73] -0.90696806 -0.46822696 -0.10675218  0.32967574  0.84682802 -1.46117306
 [79] -1.74117695 -0.03811790 -2.42684040  0.66686645 -1.02902400  1.28045129
 [85] -0.85375810 -0.25569130  1.67507118  0.65361772 -0.08606186  1.49304700
 [91]  0.45232756 -0.56935219  1.01265047 -0.65157502 -0.57598360 -0.65678912
 [97]  0.19906636  0.44494992  0.42504778  1.42832141
> rowMin(tmp2)
  [1] -2.09692134  1.18075806  0.31254007  0.33095270  0.64744165 -0.56947383
  [7]  1.45399396  0.58793021  0.78608552  2.34965992 -0.50048917  0.58806807
 [13] -0.67737714 -1.41596328 -1.43569962  0.90117455 -0.31741701  1.36787632
 [19]  0.09799746  1.44487330  0.17885501 -0.64322357 -1.07750275  0.50831482
 [25] -0.13384638  0.44109525 -0.43200943  0.87947815 -0.83211743 -0.63121144
 [31]  1.45141447  0.21286475 -0.26688084  1.34633407 -1.61200364 -0.80098200
 [37] -0.33052662 -0.84483395  1.44843139  0.23160515 -1.19512352  1.42970727
 [43] -0.27949598  1.19001357 -1.67236456  0.41025004 -0.63055577 -0.56092670
 [49]  1.36000438  1.81890644 -0.85909699 -1.38690415  0.31241548  0.76128898
 [55]  0.91593013  0.21279870 -3.30574695  0.59260429 -0.80160415 -1.49594447
 [61]  2.23277619 -0.87898816  0.30226677 -0.65710068  0.85221966 -0.53495711
 [67] -0.89824594 -0.60142204 -0.76208505  1.97815569  0.88804203  2.75170647
 [73] -0.90696806 -0.46822696 -0.10675218  0.32967574  0.84682802 -1.46117306
 [79] -1.74117695 -0.03811790 -2.42684040  0.66686645 -1.02902400  1.28045129
 [85] -0.85375810 -0.25569130  1.67507118  0.65361772 -0.08606186  1.49304700
 [91]  0.45232756 -0.56935219  1.01265047 -0.65157502 -0.57598360 -0.65678912
 [97]  0.19906636  0.44494992  0.42504778  1.42832141
> 
> colMeans(tmp2)
[1] 0.04698219
> colSums(tmp2)
[1] 4.698219
> colVars(tmp2)
[1] 1.217642
> colSd(tmp2)
[1] 1.103468
> colMax(tmp2)
[1] 2.751706
> colMin(tmp2)
[1] -3.305747
> colMedians(tmp2)
[1] 0.1384262
> colRanges(tmp2)
          [,1]
[1,] -3.305747
[2,]  2.751706
> 
> 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.589365  1.177261 -2.079146 -3.407426  2.099704  1.707971  4.067975
 [8]  5.292908 -3.090154  3.849090
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.6831273
[2,] -0.1913615
[3,]  0.1638642
[4,]  0.4847820
[5,]  1.4160462
> 
> rowApply(tmp,sum)
 [1] -0.8123731  0.8954269  4.0579414  4.7658135  1.4154907  2.8907582
 [7] -2.1345944 -0.4534517  0.8944588  0.6880758
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    4    6    4   10    2    9    5    3     5
 [2,]    4    5    2    6    5    1    3    7    8    10
 [3,]    3    7    4    2    4    7    7    8    1     2
 [4,]    1    3    3    7    6    3    4    1    2     4
 [5,]    9    8    7    9    2   10    5    2    4     6
 [6,]    5    9    5    1    9    8    1    9    7     8
 [7,]    7    1   10   10    3    9   10    3    9     1
 [8,]   10    2    9    8    7    6    6    4   10     9
 [9,]    2    6    1    3    1    5    8    6    6     3
[10,]    6   10    8    5    8    4    2   10    5     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.7478032  5.9126694 -1.0589968  2.8695933 -0.2647552  0.6191008
 [7]  3.3652608  2.9556138 -1.5237887  3.2950585  1.4355956 -0.6092462
[13] -0.7215868 -3.4155261 -2.7400659  1.2674963  2.3821508 -1.4231380
[19]  0.3632496  2.2392234
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6235913
[2,] -1.2899910
[3,] -0.5505553
[4,]  0.3137118
[5,]  0.4026226
> 
> rowApply(tmp,sum)
[1] -1.183633  1.096790  4.389485 10.958621 -3.061157
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16    3   13    5    3
[2,]   18   20    1   18   20
[3,]   11    6   17    4    6
[4,]    4    7   19   19   13
[5,]    8    5   14   17    5
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
[1,]  0.3137118  0.7054055  0.1239140 -0.5418291 -0.2253520  0.30803146
[2,] -1.2899910  2.5274287 -0.5569964 -0.5288931 -0.6777458 -0.46626546
[3,]  0.4026226 -1.3348563  1.1584311  1.6359756  0.4640508 -0.10459559
[4,] -0.5505553  1.6598452 -0.5725434  1.9923131  1.4959232  0.82007588
[5,] -1.6235913  2.3548462 -1.2118021  0.3120269 -1.3216314  0.06185452
           [,7]        [,8]       [,9]       [,10]      [,11]      [,12]
[1,]  0.3121593 -0.54179758  0.3051888  0.79462729 -0.5045597 -0.5091357
[2,] -1.0122198  1.12894800  0.4193605  0.06629616  1.6593098  0.7948253
[3,]  1.9985716  1.48309228 -0.4466344 -0.04921876 -0.2090707 -0.7418240
[4,]  0.9938784  0.87449501 -0.1206827  2.43235368  1.0992371  0.1378945
[5,]  1.0728713  0.01087612 -1.6810208  0.05100016 -0.6093209 -0.2910063
           [,13]      [,14]      [,15]       [,16]      [,17]      [,18]
[1,] -0.97447071 -1.7562485 -1.2788010  1.47642886  0.2455727  0.4780312
[2,]  0.04164494  0.5529886 -1.3098116 -0.08424022  0.5290479 -2.4577647
[3,] -0.12875533 -0.7160889  0.1773977  0.24597575 -0.3046728 -0.1968310
[4,] -0.69772436 -1.1672185 -0.9041039  1.05279191  0.9515065  0.2003414
[5,]  1.03771867 -0.3289589  0.5752529 -1.42345996  0.9606965  0.5530851
          [,19]       [,20]
[1,] -0.0187645  0.10425530
[2,]  1.1061264  0.65474142
[3,]  0.5293819  0.52653335
[4,]  1.3147517 -0.05395877
[5,] -2.5682459  1.00765208
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/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:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  648  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  558  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/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.368147 0.4274529 -1.290188 -0.2094719 -2.171863 -1.441734 -0.1669881
           col8      col9   col10    col11     col12      col13      col14
row1 -0.3739391 -2.019239 1.61142 -2.10416 -1.132514 -0.6846218 0.02907682
          col15     col16     col17     col18      col19      col20
row1 -0.4956361 0.4801764 0.9987775 -0.219671 -0.6583139 -0.8600042
> tmp[,"col10"]
           col10
row1  1.61141953
row2 -0.16196037
row3 -0.08426657
row4  0.48022743
row5  0.61258249
> tmp[c("row1","row5"),]
           col1      col2      col3       col4       col5       col6       col7
row1  1.3681469 0.4274529 -1.290188 -0.2094719 -2.1718633 -1.4417338 -0.1669881
row5 -0.6435073 0.2176435 -1.955900 -2.2477780  0.3148265 -0.6159629  1.1739831
           col8        col9     col10      col11      col12      col13
row1 -0.3739391 -2.01923919 1.6114195 -2.1041596 -1.1325144 -0.6846218
row5 -0.9770155 -0.08575469 0.6125825  0.7298459  0.1119603 -1.4330111
           col14      col15     col16      col17      col18      col19
row1  0.02907682 -0.4956361 0.4801764  0.9987775 -0.2196710 -0.6583139
row5 -0.15319547  0.1244018 1.1253937 -1.1587091 -0.4077262 -0.8037153
          col20
row1 -0.8600042
row5  1.0363901
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.4417338 -0.8600042
row2  1.1061232  1.2201595
row3  1.3679185 -0.6280611
row4  0.4542816 -0.9623208
row5 -0.6159629  1.0363901
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -1.4417338 -0.8600042
row5 -0.6159629  1.0363901
> 
> 
> 
> 
> 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.79363 49.53915 51.06302 48.8758 49.02581 104.9305 49.94039 50.39849
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.74582 48.61262 50.60361 49.28493 50.63345 51.83882 48.35379 48.87465
        col17    col18    col19    col20
row1 49.89727 50.34602 48.90247 103.4855
> tmp[,"col10"]
        col10
row1 48.61262
row2 30.67152
row3 30.04920
row4 28.68754
row5 49.84151
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.79363 49.53915 51.06302 48.87580 49.02581 104.9305 49.94039 50.39849
row5 50.17074 50.67912 51.15996 50.10642 48.89283 105.3432 49.30374 50.39643
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.74582 48.61262 50.60361 49.28493 50.63345 51.83882 48.35379 48.87465
row5 47.63193 49.84151 49.59717 51.63142 48.68621 49.61299 51.40635 49.14314
        col17    col18    col19    col20
row1 49.89727 50.34602 48.90247 103.4855
row5 49.43082 49.35990 50.48268 105.6757
> tmp[,c("col6","col20")]
          col6     col20
row1 104.93046 103.48545
row2  76.25026  75.82596
row3  75.06639  74.27093
row4  74.05244  72.94239
row5 105.34321 105.67569
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.9305 103.4855
row5 105.3432 105.6757
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.9305 103.4855
row5 105.3432 105.6757
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.2138346
[2,]  0.1102298
[3,] -0.5201972
[4,] -2.0651864
[5,]  1.6098176
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.2924262 -0.47274158
[2,]  0.6230030 -0.39655386
[3,]  0.1407800 -0.06941163
[4,] -0.3717006  0.77116889
[5,]  0.1633500  0.18690625
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.0681953  1.0352102
[2,]  0.2311091 -0.1474706
[3,]  1.0157616  1.5392937
[4,]  0.5653229 -0.5643558
[5,] -1.0975094 -0.8073129
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.0681953
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.0681953
[2,]  0.2311091
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]        [,2]      [,3]      [,4]       [,5]       [,6]       [,7]
row3 0.7008391 -0.63869132 0.3372221  0.724817 0.07358821 -1.5424203 1.01103127
row1 0.9244135  0.09869404 0.5760997 -1.704383 0.67469886 -0.6231152 0.08046573
           [,8]       [,9]      [,10]      [,11]      [,12]      [,13]
row3 -0.8393138 -0.9534396  0.4092961 -0.1895570  0.2267226 -0.0924030
row1 -0.3641860 -0.8776025 -0.8114884  0.2593623 -0.3172561  0.6475712
           [,14]     [,15]     [,16]      [,17]      [,18]        [,19]
row3 -0.09407460 0.1283216 -1.394369 -1.2435046  1.3305050 -0.008655286
row1  0.01731608 1.6436962  1.563973  0.6079689 -0.6899551 -0.416361876
          [,20]
row3 -1.4262116
row1 -0.7750302
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]       [,3]       [,4]      [,5]      [,6]      [,7]
row2 -0.6165682 -0.2891897 -0.1611278 -0.7445848 0.2788273 -1.525197 -1.878991
          [,8]     [,9]      [,10]
row2 -0.106171 2.578118 -0.2990748
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]       [,4]     [,5]      [,6]     [,7]
row5 0.1842333 -1.28049 -2.634969 -0.7344661 1.091665 -1.099337 2.079181
          [,8]      [,9]     [,10]     [,11]      [,12]       [,13]    [,14]
row5 -2.087827 0.1734879 0.8995168 0.8581583 -0.7594717 -0.07204376 2.848617
        [,15]     [,16]    [,17]      [,18]       [,19]      [,20]
row5 1.356683 0.4183017 1.060546 -0.2676056 -0.06425276 -0.5312104
> 
> 
> 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: 0x62a643d59ed0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM711925f753671"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM711925358ffd5"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM711925049c822"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM711925dd1e513"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM711925df42153"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7119257a9daa0"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM71192679b810f"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM711921299c6cb"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM71192620bb539"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM71192770717eb"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM7119259bf6e22"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM711925070dacf"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM71192ab15d7"  
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM71192261050d2"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM711921552e702"
> 
> 
> ### 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: 0x62a643bb7160>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x62a643bb7160>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x62a643bb7160>
> rowMedians(tmp)
  [1] -8.536229e-02  5.719187e-01  2.130017e-01 -1.298435e-01  5.476849e-01
  [6]  5.070301e-01 -3.219338e-01 -2.157936e-01  5.597130e-01 -3.147424e-01
 [11] -4.161167e-01  6.179295e-02  1.194449e-01 -2.767467e-02 -1.084793e-01
 [16]  4.735564e-01  3.757240e-01  4.453205e-02 -2.189290e-01  3.365983e-02
 [21]  3.431145e-01 -4.884451e-01 -2.692444e-01  1.589932e-01  1.448043e-01
 [26]  1.035253e-01 -2.509076e-01  1.141923e-01 -3.574202e-01  2.440935e-01
 [31]  4.182886e-01  6.005007e-02 -3.242517e-02 -5.311140e-01 -4.735820e-01
 [36]  2.321775e-02  2.332478e-01  8.292038e-02 -2.972025e-02  1.365707e-01
 [41] -4.627260e-02  1.133574e-01 -9.717057e-02  1.903561e-01  3.534786e-01
 [46] -1.493823e-01  8.437602e-01  1.117006e-01 -1.007035e-01 -2.395907e-01
 [51] -6.631581e-01  8.151919e-02  3.292608e-01 -4.948396e-01  2.506871e-04
 [56]  5.520948e-01 -2.043967e-01  1.971124e-01  2.326624e-01 -2.610030e-01
 [61]  1.223352e-01 -2.450870e-01 -1.355144e-01  1.302756e-01  3.402891e-01
 [66] -5.948352e-01 -4.352639e-01 -2.951768e-01  4.950761e-01  2.556395e-01
 [71]  3.906837e-01  5.214614e-01 -7.307249e-02  2.462485e-01 -1.519421e-01
 [76] -6.083852e-01  5.815352e-02 -2.388547e-02  2.222455e-01  4.584011e-01
 [81] -4.509316e-01  1.277341e-01  2.682732e-01 -5.255279e-01  1.195432e-01
 [86] -3.021414e-01 -7.816961e-02 -2.644287e-01  1.977773e-01  1.771436e-01
 [91] -7.576325e-01 -7.522321e-02 -2.118745e-01  5.416390e-02 -1.497485e-01
 [96] -3.397963e-01 -1.064962e-01 -3.759803e-01 -4.423330e-01  1.209806e-01
[101]  8.100221e-02 -1.949540e-01  4.373642e-01  2.573229e-02  6.347085e-05
[106]  1.840923e-01 -1.332290e-01  1.371261e-01 -7.011291e-02  7.276051e-01
[111]  5.561472e-01  3.951713e-01 -1.624651e-01 -1.545746e-01 -5.938282e-01
[116] -1.379166e-01 -1.545435e-01  1.591482e-01 -9.066863e-02  1.865974e-02
[121] -3.819513e-01 -5.403971e-01 -6.242586e-01 -1.795450e-01 -3.818133e-01
[126] -2.726395e-01 -1.661529e-01 -5.205165e-01  2.532612e-01 -1.518088e-01
[131] -3.374466e-01 -1.882134e-01 -1.061260e-01  3.147967e-01 -1.821036e-03
[136] -6.074403e-01 -2.803370e-01  2.775210e-01 -2.072764e-01 -2.260172e-01
[141] -3.912274e-02  1.522495e-01 -2.059664e-01 -1.268342e-01  4.060508e-01
[146]  2.721948e-02  3.992888e-01  4.061522e-01 -3.003814e-01  1.803390e-01
[151]  2.278285e-01  3.634257e-01  7.208854e-02  2.406269e-01 -1.065671e-01
[156]  1.894604e-01  4.366201e-01 -1.339460e-01 -1.707561e-01  3.675662e-01
[161]  1.025604e-01 -2.105999e-01  2.270886e-01  3.320004e-01 -1.843895e-02
[166] -2.583334e-02  4.832538e-02  3.391407e-01 -3.358047e-01  1.480121e-01
[171] -3.391522e-01 -1.670081e-01  2.532369e-01 -5.431661e-01 -1.901223e-01
[176]  7.092772e-02 -4.444676e-01  6.118588e-02  9.309637e-02 -1.543660e-01
[181] -5.239536e-01  2.433905e-01 -4.248328e-02 -1.205648e-01 -9.183245e-02
[186]  1.369499e-01 -4.380309e-01 -3.051119e-02 -6.884789e-01  3.224863e-01
[191]  1.949888e-01  5.582832e-02  2.431606e-01  8.475750e-02  2.972312e-01
[196]  4.287488e-01 -1.014929e-01 -5.858316e-01 -1.380892e-01  4.241206e-01
[201] -8.109220e-02  5.547829e-01 -6.009157e-02 -7.709872e-01  6.039642e-02
[206]  1.447987e-01 -9.748838e-02 -1.817668e-01  4.038881e-01 -1.977975e-01
[211] -2.153711e-01  9.821308e-01  2.874622e-01 -2.558384e-01 -8.040409e-01
[216]  6.023815e-01 -2.637966e-01  2.813623e-02  5.842757e-01 -3.091980e-01
[221]  6.211654e-02  2.010951e-01 -3.543159e-01 -1.167418e-02  1.275946e-01
[226] -3.185407e-01  1.897543e-01 -2.435930e-01 -1.222804e-01  9.464479e-02
> 
> proc.time()
   user  system elapsed 
  1.275   1.435   2.699 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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: 0x5b204d2445e0>
> .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: 0x5b204d2445e0>
> .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: 0x5b204d2445e0>
> .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: 0x5b204d2445e0>
> 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: 0x5b204d21b410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b204d21b410>
> .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: 0x5b204d21b410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b204d21b410>
> .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: 0x5b204d21b410>
> 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: 0x5b204be20b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b204be20b40>
> .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: 0x5b204be20b40>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b204be20b40>
> .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: 0x5b204be20b40>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5b204be20b40>
> .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: 0x5b204be20b40>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5b204be20b40>
> .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: 0x5b204be20b40>
> 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: 0x5b204bac87a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5b204bac87a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b204bac87a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b204bac87a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile715b04369aa68" "BufferedMatrixFile715b072c63b15"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile715b04369aa68" "BufferedMatrixFile715b072c63b15"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b204e57e050>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b204e57e050>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b204e57e050>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b204e57e050>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5b204e57e050>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5b204e57e050>
> .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: 0x5b204cb9f0c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b204cb9f0c0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b204cb9f0c0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5b204cb9f0c0>
> 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: 0x5b204dbb5a10>
> .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: 0x5b204dbb5a10>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.240   0.049   0.278 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.232   0.055   0.276 

Example timings