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

This page was generated on 2025-11-01 12:02 -0400 (Sat, 01 Nov 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4901
lconwaymacOS 12.7.6 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4691
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4637
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 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-10-31 13:45 -0400 (Fri, 31 Oct 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0400 (Wed, 29 Oct 2025)
nebbiolo2Linux (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 nebbiolo2

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.74.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2025-10-31 21:49:54 -0400 (Fri, 31 Oct 2025)
EndedAt: 2025-10-31 21:50:18 -0400 (Fri, 31 Oct 2025)
EllapsedTime: 24.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-08-23 r88802)
* 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.74.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 ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.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.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-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 version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.252   0.044   0.282 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478419 25.6    1047111   56   639600 34.2
Vcells 885237  6.8    8388608   64  2081604 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] "Fri Oct 31 21:50:09 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Oct 31 21:50:09 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: 0x630d80db3b10>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Oct 31 21:50:09 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Oct 31 21:50:09 2025"
> 
> ColMode(tmp2)
<pointer: 0x630d80db3b10>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
             [,1]       [,2]       [,3]       [,4]
[1,] 100.74310057 -0.8497526 -1.5038593  0.1416078
[2,]  -2.08418945 -0.1900712  0.6469995 -0.8011778
[3,]  -0.78683207 -1.5278491 -0.7054996  0.7816153
[4,]  -0.09460032  1.2063311 -1.1201756  1.5176139
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]      [,2]      [,3]      [,4]
[1,] 100.74310057 0.8497526 1.5038593 0.1416078
[2,]   2.08418945 0.1900712 0.6469995 0.8011778
[3,]   0.78683207 1.5278491 0.7054996 0.7816153
[4,]   0.09460032 1.2063311 1.1201756 1.5176139
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0370863 0.9218203 1.2263194 0.3763081
[2,]  1.4436722 0.4359715 0.8043628 0.8950854
[3,]  0.8870356 1.2360619 0.8399402 0.8840901
[4,]  0.3075717 1.0983311 1.0583835 1.2319147
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.11396 35.06796 38.76705 28.90469
[2,]  41.52091 29.54979 33.69063 34.75203
[3,]  34.65719 38.88847 34.10490 34.62252
[4,]  28.17032 37.18964 36.70401 38.83676
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x630d807b15c0>
> exp(tmp5)
<pointer: 0x630d807b15c0>
> log(tmp5,2)
<pointer: 0x630d807b15c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.6266
> Min(tmp5)
[1] 54.30587
> mean(tmp5)
[1] 72.85288
> Sum(tmp5)
[1] 14570.58
> Var(tmp5)
[1] 870.8263
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.22473 71.93273 71.50205 69.54094 65.49663 72.65431 70.78390 74.07930
 [9] 72.81540 68.49880
> rowSums(tmp5)
 [1] 1824.495 1438.655 1430.041 1390.819 1309.933 1453.086 1415.678 1481.586
 [9] 1456.308 1369.976
> rowVars(tmp5)
 [1] 8029.76464   94.00890   59.22406  100.54858   37.13805   85.36932
 [7]   63.41984   70.11720   54.51544   73.95583
> rowSd(tmp5)
 [1] 89.608954  9.695819  7.695717 10.027391  6.094099  9.239552  7.963657
 [8]  8.373601  7.383457  8.599757
> rowMax(tmp5)
 [1] 470.62659  88.86277  86.59068  85.92980  79.15635  90.14150  85.11947
 [8]  88.81209  84.58259  88.85629
> rowMin(tmp5)
 [1] 57.55829 55.60785 57.99911 54.30587 56.06104 55.50657 59.65844 59.47940
 [9] 58.61713 57.70697
> 
> colMeans(tmp5)
 [1] 111.48965  69.55902  75.15219  71.46981  71.07243  67.47447  71.80207
 [8]  68.51171  75.95940  71.04696  70.80345  71.86032  73.16232  66.67848
[15]  68.68093  68.07464  66.97413  69.60170  73.22059  74.46332
> colSums(tmp5)
 [1] 1114.8965  695.5902  751.5219  714.6981  710.7243  674.7447  718.0207
 [8]  685.1171  759.5940  710.4696  708.0345  718.6032  731.6232  666.7848
[15]  686.8093  680.7464  669.7413  696.0170  732.2059  744.6332
> colVars(tmp5)
 [1] 16030.38397    54.41414    54.50599    52.73572    63.45505    11.58590
 [7]    50.41799    75.18939   125.43001    86.81646    48.20176    78.23727
[13]    96.22084    76.14149    81.66746    77.22754    72.64294    65.17671
[19]   105.28062    52.19829
> colSd(tmp5)
 [1] 126.611153   7.376594   7.382817   7.261936   7.965868   3.403807
 [7]   7.100563   8.671182  11.199554   9.317535   6.942749   8.845184
[13]   9.809222   8.725909   9.037005   8.787920   8.523083   8.073209
[19]  10.260635   7.224838
> colMax(tmp5)
 [1] 470.62659  80.94125  85.08250  84.58259  82.28972  70.70673  81.41219
 [8]  86.98291  88.86277  90.14150  82.01283  88.81209  88.44215  80.34499
[15]  86.51527  83.93596  82.36730  82.10527  86.59068  88.85629
> colMin(tmp5)
 [1] 58.63282 61.50401 62.45430 60.16132 57.43930 59.34729 59.03704 56.06104
 [9] 57.70697 58.38148 60.78507 62.75699 59.65844 56.35753 54.30587 58.61713
[17] 57.55958 55.50657 55.60785 62.64824
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.22473 71.93273 71.50205       NA 65.49663 72.65431 70.78390 74.07930
 [9] 72.81540 68.49880
> rowSums(tmp5)
 [1] 1824.495 1438.655 1430.041       NA 1309.933 1453.086 1415.678 1481.586
 [9] 1456.308 1369.976
> rowVars(tmp5)
 [1] 8029.76464   94.00890   59.22406  106.11990   37.13805   85.36932
 [7]   63.41984   70.11720   54.51544   73.95583
> rowSd(tmp5)
 [1] 89.608954  9.695819  7.695717 10.301452  6.094099  9.239552  7.963657
 [8]  8.373601  7.383457  8.599757
> rowMax(tmp5)
 [1] 470.62659  88.86277  86.59068        NA  79.15635  90.14150  85.11947
 [8]  88.81209  84.58259  88.85629
> rowMin(tmp5)
 [1] 57.55829 55.60785 57.99911       NA 56.06104 55.50657 59.65844 59.47940
 [9] 58.61713 57.70697
> 
> colMeans(tmp5)
 [1] 111.48965  69.55902  75.15219  71.46981  71.07243  67.47447  71.80207
 [8]        NA  75.95940  71.04696  70.80345  71.86032  73.16232  66.67848
[15]  68.68093  68.07464  66.97413  69.60170  73.22059  74.46332
> colSums(tmp5)
 [1] 1114.8965  695.5902  751.5219  714.6981  710.7243  674.7447  718.0207
 [8]        NA  759.5940  710.4696  708.0345  718.6032  731.6232  666.7848
[15]  686.8093  680.7464  669.7413  696.0170  732.2059  744.6332
> colVars(tmp5)
 [1] 16030.38397    54.41414    54.50599    52.73572    63.45505    11.58590
 [7]    50.41799          NA   125.43001    86.81646    48.20176    78.23727
[13]    96.22084    76.14149    81.66746    77.22754    72.64294    65.17671
[19]   105.28062    52.19829
> colSd(tmp5)
 [1] 126.611153   7.376594   7.382817   7.261936   7.965868   3.403807
 [7]   7.100563         NA  11.199554   9.317535   6.942749   8.845184
[13]   9.809222   8.725909   9.037005   8.787920   8.523083   8.073209
[19]  10.260635   7.224838
> colMax(tmp5)
 [1] 470.62659  80.94125  85.08250  84.58259  82.28972  70.70673  81.41219
 [8]        NA  88.86277  90.14150  82.01283  88.81209  88.44215  80.34499
[15]  86.51527  83.93596  82.36730  82.10527  86.59068  88.85629
> colMin(tmp5)
 [1] 58.63282 61.50401 62.45430 60.16132 57.43930 59.34729 59.03704       NA
 [9] 57.70697 58.38148 60.78507 62.75699 59.65844 56.35753 54.30587 58.61713
[17] 57.55958 55.50657 55.60785 62.64824
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.6266
> Min(tmp5,na.rm=TRUE)
[1] 54.30587
> mean(tmp5,na.rm=TRUE)
[1] 72.867
> Sum(tmp5,na.rm=TRUE)
[1] 14500.53
> Var(tmp5,na.rm=TRUE)
[1] 875.1844
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.22473 71.93273 71.50205 69.51455 65.49663 72.65431 70.78390 74.07930
 [9] 72.81540 68.49880
> rowSums(tmp5,na.rm=TRUE)
 [1] 1824.495 1438.655 1430.041 1320.776 1309.933 1453.086 1415.678 1481.586
 [9] 1456.308 1369.976
> rowVars(tmp5,na.rm=TRUE)
 [1] 8029.76464   94.00890   59.22406  106.11990   37.13805   85.36932
 [7]   63.41984   70.11720   54.51544   73.95583
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.608954  9.695819  7.695717 10.301452  6.094099  9.239552  7.963657
 [8]  8.373601  7.383457  8.599757
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.62659  88.86277  86.59068  85.92980  79.15635  90.14150  85.11947
 [8]  88.81209  84.58259  88.85629
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.55829 55.60785 57.99911 54.30587 56.06104 55.50657 59.65844 59.47940
 [9] 58.61713 57.70697
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.48965  69.55902  75.15219  71.46981  71.07243  67.47447  71.80207
 [8]  68.34163  75.95940  71.04696  70.80345  71.86032  73.16232  66.67848
[15]  68.68093  68.07464  66.97413  69.60170  73.22059  74.46332
> colSums(tmp5,na.rm=TRUE)
 [1] 1114.8965  695.5902  751.5219  714.6981  710.7243  674.7447  718.0207
 [8]  615.0747  759.5940  710.4696  708.0345  718.6032  731.6232  666.7848
[15]  686.8093  680.7464  669.7413  696.0170  732.2059  744.6332
> colVars(tmp5,na.rm=TRUE)
 [1] 16030.38397    54.41414    54.50599    52.73572    63.45505    11.58590
 [7]    50.41799    84.26264   125.43001    86.81646    48.20176    78.23727
[13]    96.22084    76.14149    81.66746    77.22754    72.64294    65.17671
[19]   105.28062    52.19829
> colSd(tmp5,na.rm=TRUE)
 [1] 126.611153   7.376594   7.382817   7.261936   7.965868   3.403807
 [7]   7.100563   9.179468  11.199554   9.317535   6.942749   8.845184
[13]   9.809222   8.725909   9.037005   8.787920   8.523083   8.073209
[19]  10.260635   7.224838
> colMax(tmp5,na.rm=TRUE)
 [1] 470.62659  80.94125  85.08250  84.58259  82.28972  70.70673  81.41219
 [8]  86.98291  88.86277  90.14150  82.01283  88.81209  88.44215  80.34499
[15]  86.51527  83.93596  82.36730  82.10527  86.59068  88.85629
> colMin(tmp5,na.rm=TRUE)
 [1] 58.63282 61.50401 62.45430 60.16132 57.43930 59.34729 59.03704 56.06104
 [9] 57.70697 58.38148 60.78507 62.75699 59.65844 56.35753 54.30587 58.61713
[17] 57.55958 55.50657 55.60785 62.64824
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.22473 71.93273 71.50205      NaN 65.49663 72.65431 70.78390 74.07930
 [9] 72.81540 68.49880
> rowSums(tmp5,na.rm=TRUE)
 [1] 1824.495 1438.655 1430.041    0.000 1309.933 1453.086 1415.678 1481.586
 [9] 1456.308 1369.976
> rowVars(tmp5,na.rm=TRUE)
 [1] 8029.76464   94.00890   59.22406         NA   37.13805   85.36932
 [7]   63.41984   70.11720   54.51544   73.95583
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.608954  9.695819  7.695717        NA  6.094099  9.239552  7.963657
 [8]  8.373601  7.383457  8.599757
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.62659  88.86277  86.59068        NA  79.15635  90.14150  85.11947
 [8]  88.81209  84.58259  88.85629
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.55829 55.60785 57.99911       NA 56.06104 55.50657 59.65844 59.47940
 [9] 58.61713 57.70697
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.36263  68.68720  75.01415  70.42938  69.82607  67.18833  71.99143
 [8]       NaN  76.50649  71.86443  71.91660  70.29704  71.96248  67.82525
[15]  70.27816  67.77619  68.02019  70.52938  74.67078  73.92962
> colSums(tmp5,na.rm=TRUE)
 [1] 1056.2636  618.1848  675.1273  633.8645  628.4346  604.6950  647.9229
 [8]    0.0000  688.5584  646.7799  647.2494  632.6734  647.6624  610.4273
[15]  632.5034  609.9857  612.1817  634.7645  672.0370  665.3666
> colVars(tmp5,na.rm=TRUE)
 [1] 17646.14814    52.66519    61.10485    47.14974    53.91088    12.11305
 [7]    56.31682          NA   137.74149    90.15064    40.28698    60.52383
[13]    92.05275    70.86445    63.17558    85.87892    69.41307    63.64208
[19]    94.78143    55.51866
> colSd(tmp5,na.rm=TRUE)
 [1] 132.838805   7.257078   7.816959   6.866567   7.342403   3.480380
 [7]   7.504453         NA  11.736332   9.494769   6.347202   7.779706
[13]   9.594413   8.418102   7.948307   9.267088   8.331451   7.977598
[19]   9.735575   7.451084
> colMax(tmp5,na.rm=TRUE)
 [1] 470.62659  80.94125  85.08250  84.58259  78.72293  70.70673  81.41219
 [8]      -Inf  88.86277  90.14150  82.01283  88.81209  88.44215  80.34499
[15]  86.51527  83.93596  82.36730  82.10527  86.59068  88.85629
> colMin(tmp5,na.rm=TRUE)
 [1] 61.02656 61.50401 62.45430 60.16132 57.43930 59.34729 59.03704      Inf
 [9] 57.70697 58.38148 63.90352 62.75699 59.65844 57.55829 61.33375 58.61713
[17] 57.99911 55.50657 55.60785 62.64824
> 
> 
> 
> 
> 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] 351.8961 178.8338 167.2469 163.4728 221.8033 224.4196 156.8894 218.1613
 [9] 233.4741 214.4055
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 351.8961 178.8338 167.2469 163.4728 221.8033 224.4196 156.8894 218.1613
 [9] 233.4741 214.4055
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.136868e-13 -1.421085e-14  2.273737e-13 -1.421085e-14 -5.684342e-14
 [6] -2.842171e-14 -1.136868e-13  1.989520e-13  2.842171e-14 -5.684342e-14
[11] -5.684342e-14  5.684342e-14 -1.136868e-13  2.842171e-14 -1.136868e-13
[16] -5.684342e-14  5.684342e-14 -2.842171e-13  5.684342e-14 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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   4 
6   4 
9   8 
3   15 
4   18 
5   20 
1   19 
10   1 
10   5 
3   12 
2   20 
8   3 
6   19 
6   14 
10   11 
6   11 
2   16 
6   6 
9   18 
4   11 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.736707
> Min(tmp)
[1] -2.482369
> mean(tmp)
[1] -0.100978
> Sum(tmp)
[1] -10.0978
> Var(tmp)
[1] 1.24965
> 
> rowMeans(tmp)
[1] -0.100978
> rowSums(tmp)
[1] -10.0978
> rowVars(tmp)
[1] 1.24965
> rowSd(tmp)
[1] 1.117877
> rowMax(tmp)
[1] 3.736707
> rowMin(tmp)
[1] -2.482369
> 
> colMeans(tmp)
  [1] -1.44528212  0.34075419  0.02964093 -2.41512141 -0.73938460  2.00107534
  [7] -0.38293988 -0.39350218  0.33236200  1.00973558 -0.46958416 -1.04382638
 [13] -0.35794420 -1.24859494  1.31819706 -1.35528414  0.66751523 -0.54193201
 [19]  0.68936589 -1.62893215 -0.70115299 -1.69874879  0.65807622 -2.09577140
 [25]  0.16112733 -0.58581107 -0.69627022 -0.15523327 -0.72745689  1.48476197
 [31] -1.88447668  0.53784109 -0.34326966 -0.03767823 -0.91762241  1.11038187
 [37]  0.58368026  1.75194429 -0.45437897 -1.67353909 -0.35489191  0.63086910
 [43]  0.15718594  1.29811059  0.52315063 -2.12849751 -0.18418799 -0.32662898
 [49] -2.25060230 -1.83614604  0.29577321 -0.79629546  0.13206425  0.50252611
 [55] -0.36500703 -0.35870227 -0.23739006 -0.05368058  1.11469288  0.03036580
 [61] -1.40072512 -0.14036249  2.76422125  0.37600443  1.68038815 -1.09483933
 [67] -0.02766311 -1.36474263 -0.58439161  0.85280957  1.33559945  0.31863024
 [73] -0.01339578 -0.64517380 -1.81828763 -0.18828318 -0.74362291  1.00157322
 [79] -0.36911444 -0.22453764 -0.40808301 -0.88495750  0.67362052 -0.08809726
 [85]  0.86995707 -0.29903531 -2.48236933 -0.68104161  2.07274677  3.73670651
 [91]  0.80258061  0.87387123 -0.38255377  0.62279728  1.71643068  0.29185235
 [97]  0.81570791 -0.77633578 -0.21001196 -0.55110036
> colSums(tmp)
  [1] -1.44528212  0.34075419  0.02964093 -2.41512141 -0.73938460  2.00107534
  [7] -0.38293988 -0.39350218  0.33236200  1.00973558 -0.46958416 -1.04382638
 [13] -0.35794420 -1.24859494  1.31819706 -1.35528414  0.66751523 -0.54193201
 [19]  0.68936589 -1.62893215 -0.70115299 -1.69874879  0.65807622 -2.09577140
 [25]  0.16112733 -0.58581107 -0.69627022 -0.15523327 -0.72745689  1.48476197
 [31] -1.88447668  0.53784109 -0.34326966 -0.03767823 -0.91762241  1.11038187
 [37]  0.58368026  1.75194429 -0.45437897 -1.67353909 -0.35489191  0.63086910
 [43]  0.15718594  1.29811059  0.52315063 -2.12849751 -0.18418799 -0.32662898
 [49] -2.25060230 -1.83614604  0.29577321 -0.79629546  0.13206425  0.50252611
 [55] -0.36500703 -0.35870227 -0.23739006 -0.05368058  1.11469288  0.03036580
 [61] -1.40072512 -0.14036249  2.76422125  0.37600443  1.68038815 -1.09483933
 [67] -0.02766311 -1.36474263 -0.58439161  0.85280957  1.33559945  0.31863024
 [73] -0.01339578 -0.64517380 -1.81828763 -0.18828318 -0.74362291  1.00157322
 [79] -0.36911444 -0.22453764 -0.40808301 -0.88495750  0.67362052 -0.08809726
 [85]  0.86995707 -0.29903531 -2.48236933 -0.68104161  2.07274677  3.73670651
 [91]  0.80258061  0.87387123 -0.38255377  0.62279728  1.71643068  0.29185235
 [97]  0.81570791 -0.77633578 -0.21001196 -0.55110036
> 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.44528212  0.34075419  0.02964093 -2.41512141 -0.73938460  2.00107534
  [7] -0.38293988 -0.39350218  0.33236200  1.00973558 -0.46958416 -1.04382638
 [13] -0.35794420 -1.24859494  1.31819706 -1.35528414  0.66751523 -0.54193201
 [19]  0.68936589 -1.62893215 -0.70115299 -1.69874879  0.65807622 -2.09577140
 [25]  0.16112733 -0.58581107 -0.69627022 -0.15523327 -0.72745689  1.48476197
 [31] -1.88447668  0.53784109 -0.34326966 -0.03767823 -0.91762241  1.11038187
 [37]  0.58368026  1.75194429 -0.45437897 -1.67353909 -0.35489191  0.63086910
 [43]  0.15718594  1.29811059  0.52315063 -2.12849751 -0.18418799 -0.32662898
 [49] -2.25060230 -1.83614604  0.29577321 -0.79629546  0.13206425  0.50252611
 [55] -0.36500703 -0.35870227 -0.23739006 -0.05368058  1.11469288  0.03036580
 [61] -1.40072512 -0.14036249  2.76422125  0.37600443  1.68038815 -1.09483933
 [67] -0.02766311 -1.36474263 -0.58439161  0.85280957  1.33559945  0.31863024
 [73] -0.01339578 -0.64517380 -1.81828763 -0.18828318 -0.74362291  1.00157322
 [79] -0.36911444 -0.22453764 -0.40808301 -0.88495750  0.67362052 -0.08809726
 [85]  0.86995707 -0.29903531 -2.48236933 -0.68104161  2.07274677  3.73670651
 [91]  0.80258061  0.87387123 -0.38255377  0.62279728  1.71643068  0.29185235
 [97]  0.81570791 -0.77633578 -0.21001196 -0.55110036
> colMin(tmp)
  [1] -1.44528212  0.34075419  0.02964093 -2.41512141 -0.73938460  2.00107534
  [7] -0.38293988 -0.39350218  0.33236200  1.00973558 -0.46958416 -1.04382638
 [13] -0.35794420 -1.24859494  1.31819706 -1.35528414  0.66751523 -0.54193201
 [19]  0.68936589 -1.62893215 -0.70115299 -1.69874879  0.65807622 -2.09577140
 [25]  0.16112733 -0.58581107 -0.69627022 -0.15523327 -0.72745689  1.48476197
 [31] -1.88447668  0.53784109 -0.34326966 -0.03767823 -0.91762241  1.11038187
 [37]  0.58368026  1.75194429 -0.45437897 -1.67353909 -0.35489191  0.63086910
 [43]  0.15718594  1.29811059  0.52315063 -2.12849751 -0.18418799 -0.32662898
 [49] -2.25060230 -1.83614604  0.29577321 -0.79629546  0.13206425  0.50252611
 [55] -0.36500703 -0.35870227 -0.23739006 -0.05368058  1.11469288  0.03036580
 [61] -1.40072512 -0.14036249  2.76422125  0.37600443  1.68038815 -1.09483933
 [67] -0.02766311 -1.36474263 -0.58439161  0.85280957  1.33559945  0.31863024
 [73] -0.01339578 -0.64517380 -1.81828763 -0.18828318 -0.74362291  1.00157322
 [79] -0.36911444 -0.22453764 -0.40808301 -0.88495750  0.67362052 -0.08809726
 [85]  0.86995707 -0.29903531 -2.48236933 -0.68104161  2.07274677  3.73670651
 [91]  0.80258061  0.87387123 -0.38255377  0.62279728  1.71643068  0.29185235
 [97]  0.81570791 -0.77633578 -0.21001196 -0.55110036
> colMedians(tmp)
  [1] -1.44528212  0.34075419  0.02964093 -2.41512141 -0.73938460  2.00107534
  [7] -0.38293988 -0.39350218  0.33236200  1.00973558 -0.46958416 -1.04382638
 [13] -0.35794420 -1.24859494  1.31819706 -1.35528414  0.66751523 -0.54193201
 [19]  0.68936589 -1.62893215 -0.70115299 -1.69874879  0.65807622 -2.09577140
 [25]  0.16112733 -0.58581107 -0.69627022 -0.15523327 -0.72745689  1.48476197
 [31] -1.88447668  0.53784109 -0.34326966 -0.03767823 -0.91762241  1.11038187
 [37]  0.58368026  1.75194429 -0.45437897 -1.67353909 -0.35489191  0.63086910
 [43]  0.15718594  1.29811059  0.52315063 -2.12849751 -0.18418799 -0.32662898
 [49] -2.25060230 -1.83614604  0.29577321 -0.79629546  0.13206425  0.50252611
 [55] -0.36500703 -0.35870227 -0.23739006 -0.05368058  1.11469288  0.03036580
 [61] -1.40072512 -0.14036249  2.76422125  0.37600443  1.68038815 -1.09483933
 [67] -0.02766311 -1.36474263 -0.58439161  0.85280957  1.33559945  0.31863024
 [73] -0.01339578 -0.64517380 -1.81828763 -0.18828318 -0.74362291  1.00157322
 [79] -0.36911444 -0.22453764 -0.40808301 -0.88495750  0.67362052 -0.08809726
 [85]  0.86995707 -0.29903531 -2.48236933 -0.68104161  2.07274677  3.73670651
 [91]  0.80258061  0.87387123 -0.38255377  0.62279728  1.71643068  0.29185235
 [97]  0.81570791 -0.77633578 -0.21001196 -0.55110036
> colRanges(tmp)
          [,1]      [,2]       [,3]      [,4]       [,5]     [,6]       [,7]
[1,] -1.445282 0.3407542 0.02964093 -2.415121 -0.7393846 2.001075 -0.3829399
[2,] -1.445282 0.3407542 0.02964093 -2.415121 -0.7393846 2.001075 -0.3829399
           [,8]     [,9]    [,10]      [,11]     [,12]      [,13]     [,14]
[1,] -0.3935022 0.332362 1.009736 -0.4695842 -1.043826 -0.3579442 -1.248595
[2,] -0.3935022 0.332362 1.009736 -0.4695842 -1.043826 -0.3579442 -1.248595
        [,15]     [,16]     [,17]     [,18]     [,19]     [,20]     [,21]
[1,] 1.318197 -1.355284 0.6675152 -0.541932 0.6893659 -1.628932 -0.701153
[2,] 1.318197 -1.355284 0.6675152 -0.541932 0.6893659 -1.628932 -0.701153
         [,22]     [,23]     [,24]     [,25]      [,26]      [,27]      [,28]
[1,] -1.698749 0.6580762 -2.095771 0.1611273 -0.5858111 -0.6962702 -0.1552333
[2,] -1.698749 0.6580762 -2.095771 0.1611273 -0.5858111 -0.6962702 -0.1552333
          [,29]    [,30]     [,31]     [,32]      [,33]       [,34]      [,35]
[1,] -0.7274569 1.484762 -1.884477 0.5378411 -0.3432697 -0.03767823 -0.9176224
[2,] -0.7274569 1.484762 -1.884477 0.5378411 -0.3432697 -0.03767823 -0.9176224
        [,36]     [,37]    [,38]     [,39]     [,40]      [,41]     [,42]
[1,] 1.110382 0.5836803 1.751944 -0.454379 -1.673539 -0.3548919 0.6308691
[2,] 1.110382 0.5836803 1.751944 -0.454379 -1.673539 -0.3548919 0.6308691
         [,43]    [,44]     [,45]     [,46]     [,47]     [,48]     [,49]
[1,] 0.1571859 1.298111 0.5231506 -2.128498 -0.184188 -0.326629 -2.250602
[2,] 0.1571859 1.298111 0.5231506 -2.128498 -0.184188 -0.326629 -2.250602
         [,50]     [,51]      [,52]     [,53]     [,54]     [,55]      [,56]
[1,] -1.836146 0.2957732 -0.7962955 0.1320643 0.5025261 -0.365007 -0.3587023
[2,] -1.836146 0.2957732 -0.7962955 0.1320643 0.5025261 -0.365007 -0.3587023
          [,57]       [,58]    [,59]     [,60]     [,61]      [,62]    [,63]
[1,] -0.2373901 -0.05368058 1.114693 0.0303658 -1.400725 -0.1403625 2.764221
[2,] -0.2373901 -0.05368058 1.114693 0.0303658 -1.400725 -0.1403625 2.764221
         [,64]    [,65]     [,66]       [,67]     [,68]      [,69]     [,70]
[1,] 0.3760044 1.680388 -1.094839 -0.02766311 -1.364743 -0.5843916 0.8528096
[2,] 0.3760044 1.680388 -1.094839 -0.02766311 -1.364743 -0.5843916 0.8528096
        [,71]     [,72]       [,73]      [,74]     [,75]      [,76]      [,77]
[1,] 1.335599 0.3186302 -0.01339578 -0.6451738 -1.818288 -0.1882832 -0.7436229
[2,] 1.335599 0.3186302 -0.01339578 -0.6451738 -1.818288 -0.1882832 -0.7436229
        [,78]      [,79]      [,80]     [,81]      [,82]     [,83]       [,84]
[1,] 1.001573 -0.3691144 -0.2245376 -0.408083 -0.8849575 0.6736205 -0.08809726
[2,] 1.001573 -0.3691144 -0.2245376 -0.408083 -0.8849575 0.6736205 -0.08809726
         [,85]      [,86]     [,87]      [,88]    [,89]    [,90]     [,91]
[1,] 0.8699571 -0.2990353 -2.482369 -0.6810416 2.072747 3.736707 0.8025806
[2,] 0.8699571 -0.2990353 -2.482369 -0.6810416 2.072747 3.736707 0.8025806
         [,92]      [,93]     [,94]    [,95]     [,96]     [,97]      [,98]
[1,] 0.8738712 -0.3825538 0.6227973 1.716431 0.2918524 0.8157079 -0.7763358
[2,] 0.8738712 -0.3825538 0.6227973 1.716431 0.2918524 0.8157079 -0.7763358
         [,99]     [,100]
[1,] -0.210012 -0.5511004
[2,] -0.210012 -0.5511004
> 
> 
> Max(tmp2)
[1] 2.71401
> Min(tmp2)
[1] -2.01015
> mean(tmp2)
[1] -0.01573637
> Sum(tmp2)
[1] -1.573637
> Var(tmp2)
[1] 0.9670055
> 
> rowMeans(tmp2)
  [1]  0.4304113467  0.4627828517 -0.7127876736  0.9269374126 -1.4906356985
  [6] -0.9013794792  0.0545558207 -1.0817631118 -0.2623535531  0.4296382010
 [11] -1.2654988506 -1.3463883842 -0.7031482017  0.6506925342 -0.8087946677
 [16]  0.6621220276 -0.5926511065 -1.2370170077 -0.2261401614 -0.4904698614
 [21]  0.2858211921  0.2322441641 -0.5197317611 -2.0101496852  0.6682542861
 [26] -0.6411649884 -0.4257120326 -1.1538735721 -0.1124601026  1.8510240734
 [31] -0.5050387585 -0.3552918565  0.3258940780  0.2049103677 -0.8774170998
 [36] -0.8203880812 -0.3922618505  1.3551335186  1.2359825828  1.7970149491
 [41] -0.0783554819  0.6105794223  0.7295408121 -0.0008489432 -0.4801207309
 [46] -0.5432074537  0.0390880157  1.0435981220  1.0229338332 -0.8277589300
 [51] -0.9743321181 -0.0743776446  0.6316944093 -1.0946958557 -0.1543088193
 [56] -0.0107112333 -1.6485758740 -0.7062666378  1.0912835664 -1.3422624763
 [61]  0.7213219060 -0.6891402450  1.0001726052  0.5025462771  2.4618337536
 [66]  0.9196994345  2.7140097865 -0.6640643758 -0.2614643597  1.7623548007
 [71] -1.4211871497 -0.0174370528  0.5142804073 -0.0745642086  0.2440251163
 [76] -0.8188120086 -1.2887803849 -0.3210678345  0.8530249388 -0.8724767530
 [81] -0.7636180036  1.0566768075  0.4272151599 -1.1948329094  1.2745108407
 [86] -0.7225245619  0.5319363431 -1.6199967194  1.4399761928  0.7879472681
 [91] -1.4140759361  0.8954084827 -0.2735408585  1.3798667853 -0.9641073671
 [96]  1.8446930817  1.4878322943  0.0202012647  0.1431976798 -1.0484757363
> rowSums(tmp2)
  [1]  0.4304113467  0.4627828517 -0.7127876736  0.9269374126 -1.4906356985
  [6] -0.9013794792  0.0545558207 -1.0817631118 -0.2623535531  0.4296382010
 [11] -1.2654988506 -1.3463883842 -0.7031482017  0.6506925342 -0.8087946677
 [16]  0.6621220276 -0.5926511065 -1.2370170077 -0.2261401614 -0.4904698614
 [21]  0.2858211921  0.2322441641 -0.5197317611 -2.0101496852  0.6682542861
 [26] -0.6411649884 -0.4257120326 -1.1538735721 -0.1124601026  1.8510240734
 [31] -0.5050387585 -0.3552918565  0.3258940780  0.2049103677 -0.8774170998
 [36] -0.8203880812 -0.3922618505  1.3551335186  1.2359825828  1.7970149491
 [41] -0.0783554819  0.6105794223  0.7295408121 -0.0008489432 -0.4801207309
 [46] -0.5432074537  0.0390880157  1.0435981220  1.0229338332 -0.8277589300
 [51] -0.9743321181 -0.0743776446  0.6316944093 -1.0946958557 -0.1543088193
 [56] -0.0107112333 -1.6485758740 -0.7062666378  1.0912835664 -1.3422624763
 [61]  0.7213219060 -0.6891402450  1.0001726052  0.5025462771  2.4618337536
 [66]  0.9196994345  2.7140097865 -0.6640643758 -0.2614643597  1.7623548007
 [71] -1.4211871497 -0.0174370528  0.5142804073 -0.0745642086  0.2440251163
 [76] -0.8188120086 -1.2887803849 -0.3210678345  0.8530249388 -0.8724767530
 [81] -0.7636180036  1.0566768075  0.4272151599 -1.1948329094  1.2745108407
 [86] -0.7225245619  0.5319363431 -1.6199967194  1.4399761928  0.7879472681
 [91] -1.4140759361  0.8954084827 -0.2735408585  1.3798667853 -0.9641073671
 [96]  1.8446930817  1.4878322943  0.0202012647  0.1431976798 -1.0484757363
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.4304113467  0.4627828517 -0.7127876736  0.9269374126 -1.4906356985
  [6] -0.9013794792  0.0545558207 -1.0817631118 -0.2623535531  0.4296382010
 [11] -1.2654988506 -1.3463883842 -0.7031482017  0.6506925342 -0.8087946677
 [16]  0.6621220276 -0.5926511065 -1.2370170077 -0.2261401614 -0.4904698614
 [21]  0.2858211921  0.2322441641 -0.5197317611 -2.0101496852  0.6682542861
 [26] -0.6411649884 -0.4257120326 -1.1538735721 -0.1124601026  1.8510240734
 [31] -0.5050387585 -0.3552918565  0.3258940780  0.2049103677 -0.8774170998
 [36] -0.8203880812 -0.3922618505  1.3551335186  1.2359825828  1.7970149491
 [41] -0.0783554819  0.6105794223  0.7295408121 -0.0008489432 -0.4801207309
 [46] -0.5432074537  0.0390880157  1.0435981220  1.0229338332 -0.8277589300
 [51] -0.9743321181 -0.0743776446  0.6316944093 -1.0946958557 -0.1543088193
 [56] -0.0107112333 -1.6485758740 -0.7062666378  1.0912835664 -1.3422624763
 [61]  0.7213219060 -0.6891402450  1.0001726052  0.5025462771  2.4618337536
 [66]  0.9196994345  2.7140097865 -0.6640643758 -0.2614643597  1.7623548007
 [71] -1.4211871497 -0.0174370528  0.5142804073 -0.0745642086  0.2440251163
 [76] -0.8188120086 -1.2887803849 -0.3210678345  0.8530249388 -0.8724767530
 [81] -0.7636180036  1.0566768075  0.4272151599 -1.1948329094  1.2745108407
 [86] -0.7225245619  0.5319363431 -1.6199967194  1.4399761928  0.7879472681
 [91] -1.4140759361  0.8954084827 -0.2735408585  1.3798667853 -0.9641073671
 [96]  1.8446930817  1.4878322943  0.0202012647  0.1431976798 -1.0484757363
> rowMin(tmp2)
  [1]  0.4304113467  0.4627828517 -0.7127876736  0.9269374126 -1.4906356985
  [6] -0.9013794792  0.0545558207 -1.0817631118 -0.2623535531  0.4296382010
 [11] -1.2654988506 -1.3463883842 -0.7031482017  0.6506925342 -0.8087946677
 [16]  0.6621220276 -0.5926511065 -1.2370170077 -0.2261401614 -0.4904698614
 [21]  0.2858211921  0.2322441641 -0.5197317611 -2.0101496852  0.6682542861
 [26] -0.6411649884 -0.4257120326 -1.1538735721 -0.1124601026  1.8510240734
 [31] -0.5050387585 -0.3552918565  0.3258940780  0.2049103677 -0.8774170998
 [36] -0.8203880812 -0.3922618505  1.3551335186  1.2359825828  1.7970149491
 [41] -0.0783554819  0.6105794223  0.7295408121 -0.0008489432 -0.4801207309
 [46] -0.5432074537  0.0390880157  1.0435981220  1.0229338332 -0.8277589300
 [51] -0.9743321181 -0.0743776446  0.6316944093 -1.0946958557 -0.1543088193
 [56] -0.0107112333 -1.6485758740 -0.7062666378  1.0912835664 -1.3422624763
 [61]  0.7213219060 -0.6891402450  1.0001726052  0.5025462771  2.4618337536
 [66]  0.9196994345  2.7140097865 -0.6640643758 -0.2614643597  1.7623548007
 [71] -1.4211871497 -0.0174370528  0.5142804073 -0.0745642086  0.2440251163
 [76] -0.8188120086 -1.2887803849 -0.3210678345  0.8530249388 -0.8724767530
 [81] -0.7636180036  1.0566768075  0.4272151599 -1.1948329094  1.2745108407
 [86] -0.7225245619  0.5319363431 -1.6199967194  1.4399761928  0.7879472681
 [91] -1.4140759361  0.8954084827 -0.2735408585  1.3798667853 -0.9641073671
 [96]  1.8446930817  1.4878322943  0.0202012647  0.1431976798 -1.0484757363
> 
> colMeans(tmp2)
[1] -0.01573637
> colSums(tmp2)
[1] -1.573637
> colVars(tmp2)
[1] 0.9670055
> colSd(tmp2)
[1] 0.9833644
> colMax(tmp2)
[1] 2.71401
> colMin(tmp2)
[1] -2.01015
> colMedians(tmp2)
[1] -0.07645985
> colRanges(tmp2)
         [,1]
[1,] -2.01015
[2,]  2.71401
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.76568674  2.04010523  0.09382193 -0.44943290 -1.05908920  0.20891514
 [7]  5.70153925  3.07424785 -0.75639654 -3.08072978
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.58698343
[2,] -1.14073209
[3,]  0.03485381
[4,]  1.28284848
[5,]  2.17886458
> 
> rowApply(tmp,sum)
 [1] -1.9901323  0.2097603  1.9168627  4.0938332  4.9074285 -1.2887561
 [7] -1.7498066  1.1353831 -3.6113634  2.9154583
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    1   10    4    6    2    2   10   10     6
 [2,]    9   10    4    8    9    1    8    8    2     5
 [3,]   10    2    9    2    3    7    9    2    4     8
 [4,]    5    7    8    7    5    6    6    4    1     1
 [5,]    4    3    7    3   10    4    3    3    7     7
 [6,]    8    4    3    9    4    3    5    9    6     4
 [7,]    6    9    6    6    8    9   10    6    8    10
 [8,]    7    8    2   10    1    5    7    5    9     3
 [9,]    2    6    1    5    2   10    1    7    3     9
[10,]    3    5    5    1    7    8    4    1    5     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -4.8901411 -2.2105061  0.8403785  2.3175886  1.0233033 -3.0943219
 [7]  1.2838675 -1.4927690  4.5672476  1.0547194 -1.9194167 -4.0499122
[13]  3.4054686 -1.1849058 -0.6668632 -1.0229165 -1.7206544  1.3782268
[19] -1.7876861 -1.9816631
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7596493
[2,] -1.4804482
[3,] -1.1757936
[4,] -1.0295874
[5,]  0.5553373
> 
> rowApply(tmp,sum)
[1] -8.562495 -3.811625 -5.135690  1.676636  5.682218
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    5    2    4   10
[2,]   13    3    1   19    7
[3,]    8    7   18    8   20
[4,]   15   14   10   14   18
[5,]   18   11    9   10   11
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]         [,5]       [,6]
[1,] -1.4804482 -0.2932645 -0.8986396  0.4934277  0.990897787 -0.6071839
[2,] -1.0295874 -1.6897868 -0.6462596  0.4195058 -0.063749862 -0.2789650
[3,] -1.7596493 -1.8226853  1.0283954 -0.3028198 -0.533325662 -1.3992166
[4,] -1.1757936  1.7717985 -0.2254194  0.3969136 -0.008258514  0.2971074
[5,]  0.5553373 -0.1765681  1.5823018  1.3105612  0.637739596 -1.1060638
           [,7]       [,8]       [,9]      [,10]       [,11]      [,12]
[1,] -0.5183584 -0.1207169  0.5041866 -1.6877167 -0.99298832 -1.9983143
[2,]  0.7503232 -2.0648145  0.4900626  1.5338788  0.03238967 -0.2984664
[3,]  0.2352466  0.3228187 -0.1981075  0.3106982 -0.27651564 -0.9734846
[4,] -0.1660832 -0.7882436  2.5824664  0.2552813  0.82181326 -0.3324707
[5,]  0.9827393  1.1581874  1.1886395  0.6425778 -1.50411565 -0.4471764
            [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  1.281317731 -1.8411224 -0.4329923  1.2981779 -1.1629061  0.6297931
[2,] -0.146199522  1.4901419  0.8703885 -1.9000253  0.6046792 -0.7724541
[3,]  1.153577412 -0.6970001 -0.5693434  0.7651514 -0.5656439 -1.1005959
[4,]  1.118277428  0.2240088 -0.2682408 -2.1535247 -1.2513728  1.3075748
[5,] -0.001504496 -0.3609340 -0.2666752  0.9673042  0.6545892  1.3139089
           [,19]      [,20]
[1,] -0.90868149 -0.8169622
[2,] -1.22774588  0.1150600
[3,] -0.18241895  1.4292286
[4,]  0.56144523 -1.2906434
[5,] -0.03028499 -1.4183462
> 
> 
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2       col3     col4      col5     col6        col7
row1 0.2423656 0.4218294 -0.9897733 2.216972 -1.379331 1.728286 -0.09836178
         col8       col9      col10       col11     col12     col13      col14
row1 1.066351 -0.9308493 -0.4490403 0.007359389 0.6478827 0.5884877 -0.6226272
       col15     col16      col17     col18    col19      col20
row1 1.36543 -1.687435 -0.2625077 -1.318051 1.131943 -0.8648045
> tmp[,"col10"]
          col10
row1 -0.4490403
row2  1.3892455
row3 -0.9539420
row4 -0.2906837
row5  2.1400812
> tmp[c("row1","row5"),]
          col1      col2       col3     col4      col5        col6        col7
row1 0.2423656 0.4218294 -0.9897733 2.216972 -1.379331  1.72828593 -0.09836178
row5 0.5759471 2.3397200  0.2297529 1.493702 -0.377072 -0.05513715  0.02852752
          col8        col9      col10       col11      col12      col13
row1  1.066351 -0.93084927 -0.4490403 0.007359389  0.6478827  0.5884877
row5 -2.050021 -0.09397217  2.1400812 0.580233202 -1.1986155 -1.4010011
          col14     col15       col16      col17     col18    col19      col20
row1 -0.6226272 1.3654301 -1.68743498 -0.2625077 -1.318051 1.131943 -0.8648045
row5  2.0194861 0.5001898 -0.08453184  0.8667058 -1.711265 1.099390 -0.9328809
> tmp[,c("col6","col20")]
            col6      col20
row1  1.72828593 -0.8648045
row2  0.35608923 -0.7934847
row3 -1.12016017 -2.2360315
row4  1.45763870  0.5585283
row5 -0.05513715 -0.9328809
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1  1.72828593 -0.8648045
row5 -0.05513715 -0.9328809
> 
> 
> 
> 
> 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 50.73595 51.38793 49.56129 48.04373 49.83412 106.2894 49.29796 48.88975
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.97677 49.99268 51.29953 47.52398 49.06257 50.73616 49.19344 50.07716
        col17    col18    col19    col20
row1 50.72559 49.85895 51.08974 104.4406
> tmp[,"col10"]
        col10
row1 49.99268
row2 30.29956
row3 29.57976
row4 32.19628
row5 49.47480
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.73595 51.38793 49.56129 48.04373 49.83412 106.2894 49.29796 48.88975
row5 50.11972 48.57047 50.19075 49.54027 51.17595 105.3088 49.67357 49.60150
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.97677 49.99268 51.29953 47.52398 49.06257 50.73616 49.19344 50.07716
row5 49.46403 49.47480 50.04877 48.62686 49.99113 50.97479 50.93999 49.88866
        col17    col18    col19    col20
row1 50.72559 49.85895 51.08974 104.4406
row5 50.30030 49.82410 52.04579 103.3329
> tmp[,c("col6","col20")]
          col6     col20
row1 106.28936 104.44064
row2  75.18628  73.28222
row3  74.80523  74.82588
row4  75.53966  74.82447
row5 105.30876 103.33293
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.2894 104.4406
row5 105.3088 103.3329
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.2894 104.4406
row5 105.3088 103.3329
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.4434871
[2,] -2.2313621
[3,]  0.5408854
[4,]  0.4448908
[5,]  1.1173686
> tmp[,c("col17","col7")]
           col17        col7
[1,] -1.17465130 -0.85939009
[2,] -0.01217128 -0.85831775
[3,]  0.36944679  0.19373890
[4,] -1.15840401  0.15843363
[5,]  0.07366053 -0.06774885
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  1.56601009  0.5461982
[2,] -0.31037259  1.4711460
[3,]  1.84876702 -0.4617958
[4,]  1.70035118 -0.8671748
[5,] -0.00416979 -0.3685538
> subBufferedMatrix(tmp,1,c("col6"))[,1]
        col1
[1,] 1.56601
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.5660101
[2,] -0.3103726
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]       [,3]       [,4]       [,5]        [,6]
row3 0.6164747 0.1913840 -0.5877428 -0.6271821  0.2784962 -0.07581653
row1 2.1327578 0.8859629  0.2105315 -1.0319095 -0.9502273  0.89786724
           [,7]      [,8]       [,9]      [,10]      [,11]      [,12]     [,13]
row3 0.06362796 -1.444914 -0.1704647 -0.2538876 -0.5257637 -0.3286465 2.4859046
row1 2.01622346  1.025245  1.6932991 -1.1240826 -1.8003768 -0.5998996 0.9470819
          [,14]      [,15]      [,16]     [,17]      [,18]    [,19]      [,20]
row3 -0.6232886 -0.8309601 1.29108293 0.4127739 -0.5403662 1.035853 -0.6714945
row1  0.4823387  0.3359187 0.05161646 1.2962428 -0.4788455 1.997561  0.3187558
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]     [,3]       [,4]      [,5]      [,6]      [,7]
row2 0.2576579 -1.044953 1.000317 -0.3806148 0.5635515 -1.905486 0.3954682
          [,8]       [,9]     [,10]
row2 -1.870779 0.07511262 -1.292234
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]        [,3]     [,4]       [,5]      [,6]       [,7]
row5 0.7606081 -0.8052066 -0.04897064 -0.16666 -0.9627396 0.2917553 -0.4773175
          [,8]       [,9]     [,10]      [,11]     [,12]       [,13]     [,14]
row5 0.1943693 -0.5536392 0.1448004 -0.1558408 0.5003795 -0.04126028 0.2728743
         [,15]      [,16]     [,17]      [,18]    [,19]     [,20]
row5 0.8385443 -0.9527392 0.1806809 -0.6247546 -0.80107 0.5204037
> 
> 
> 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: 0x630d808cdb10>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e55d02d121"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e5417d5be3"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e514388442"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e542d48a1c"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e54660d811"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e55f840852"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e5631f4d07"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e57cdf2513"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e5235fb7ad"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e555982bb" 
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e52aab503c"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e55ca4a014"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e576370301"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e57dc07b81"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2fb4e52b1f3c69"
> 
> 
> ### 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: 0x630d8066b6b0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x630d8066b6b0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x630d8066b6b0>
> rowMedians(tmp)
  [1]  2.955210e-01 -3.409084e-01  4.541856e-02  1.776150e-01 -3.940038e-01
  [6]  2.964825e-01  4.628530e-02  2.314505e-01  2.998753e-01  3.159223e-01
 [11] -3.279448e-01 -2.273505e-01 -1.304535e-01  1.299439e-01 -1.308397e-01
 [16] -5.866754e-01 -1.678450e-01  4.241304e-01 -3.921755e-01  1.011466e+00
 [21] -6.475128e-01 -1.047576e-01 -6.450643e-02  2.741901e-01 -1.396677e-02
 [26] -7.920127e-01  3.705926e-01  1.899573e-01 -3.745919e-01  2.645977e-01
 [31]  2.038302e-01 -5.251943e-01  5.173721e-01 -4.843440e-01 -8.843544e-02
 [36] -2.960899e-01  1.068492e+00  5.878034e-02 -2.292641e-01  2.577400e-01
 [41]  4.868022e-01 -4.994307e-01 -4.937407e-01 -7.310358e-02 -4.844067e-01
 [46]  2.851850e-01 -2.274390e-02 -8.960833e-02 -5.111940e-01 -1.620013e-01
 [51] -9.101411e-02 -4.067701e-01  4.540009e-02  5.921553e-01 -2.080624e-01
 [56] -9.131207e-01  8.589052e-02 -4.227535e-02 -1.028709e-01  1.713507e-01
 [61] -6.489859e-02 -2.519257e-01 -4.823410e-01  6.908593e-05 -5.502758e-01
 [66]  3.841535e-01  3.633957e-01  3.219662e-02  5.502504e-01  2.920528e-01
 [71]  4.379539e-01  3.717241e-01  4.035700e-02 -4.135421e-01  3.823105e-01
 [76] -3.805122e-01 -1.853221e-01 -5.961848e-01 -3.312990e-01  1.873179e-02
 [81]  4.062579e-02  1.453667e-01 -5.582375e-01 -1.302407e-01  1.911139e-01
 [86]  3.702649e-01  1.076054e-02 -6.012046e-01  3.724482e-01 -1.316933e-01
 [91] -6.906606e-03 -6.694672e-01  1.279976e-01  2.920822e-01  1.950672e-01
 [96]  2.608394e-01  3.250338e-01 -1.365312e-01 -1.939599e-01 -4.366058e-01
[101] -7.832781e-02 -5.638017e-02  1.142877e-01  5.702752e-02  1.200732e-01
[106]  1.752690e-01  1.553080e-01  8.664853e-02 -1.064393e-01  7.178889e-01
[111] -2.947996e-01  5.310131e-01  1.137142e-01  3.349509e-01 -4.088932e-02
[116] -3.666803e-01 -1.355791e-01 -8.014808e-03 -1.086114e-01 -6.308080e-01
[121] -3.625433e-02  1.235877e+00  1.163938e-01 -3.319275e-02  7.004486e-02
[126]  2.577293e-01  1.487019e-01  1.974642e-01  6.311015e-01 -1.481496e-01
[131]  3.245516e-01 -2.560041e-01 -1.975467e-01  5.757181e-02  1.180261e-02
[136]  9.523291e-02 -7.152613e-01 -3.255581e-01 -1.270169e-01 -4.540205e-01
[141] -2.196282e-01  5.177925e-01  1.192456e-01  4.132358e-02 -7.332705e-02
[146] -1.821217e-01 -3.404355e-01 -1.227325e-01 -1.184626e-01  1.065500e-01
[151]  4.910442e-01  2.419017e-01 -2.842016e-01 -2.215415e-01  3.912010e-01
[156]  4.704546e-01 -8.352873e-01  1.025615e-01  3.868359e-01  3.595442e-02
[161]  4.048562e-01  7.236742e-03  2.250780e-01  1.656002e-01 -7.913526e-02
[166] -2.244170e-01 -2.388673e-01 -7.193546e-02  3.989740e-01  3.539941e-01
[171]  1.591250e-01 -7.869487e-02  6.673646e-01 -1.511273e-01  3.047904e-02
[176] -4.592404e-01 -2.392599e-01  5.319713e-01  5.899034e-02  3.109924e-01
[181] -3.963405e-03  2.419162e-01 -1.218519e-01  9.728096e-01 -1.691014e-01
[186] -7.202706e-02  1.651629e-01 -6.332738e-03  5.498970e-01 -4.162703e-01
[191]  4.497517e-03 -5.368780e-01 -4.645813e-02 -3.948572e-01  1.163043e-01
[196]  2.360589e-01  4.687844e-01 -2.085678e-01 -7.845175e-02 -3.844460e-01
[201] -1.847884e-01  5.745319e-01 -3.466194e-01 -3.411413e-01  3.588557e-01
[206]  3.297430e-01 -3.390899e-01 -2.215905e-01  4.504213e-01  3.633277e-01
[211] -5.064035e-01 -5.692418e-01 -1.406378e-01  5.885845e-01  2.404657e-01
[216]  7.326232e-01 -3.078852e-01 -1.856675e-01 -1.044142e-01  1.878248e-01
[221] -1.308387e-01  5.336414e-01 -2.018689e-01 -9.191331e-02  1.678682e-01
[226] -3.420018e-01 -4.249064e-02 -2.021061e-01 -1.383472e-01 -2.470594e-01
> 
> proc.time()
   user  system elapsed 
  1.226   0.665   1.879 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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: 0x59b59b47fb10>
> .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: 0x59b59b47fb10>
> .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: 0x59b59b47fb10>
> .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: 0x59b59b47fb10>
> 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: 0x59b59a131660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b59a131660>
> .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: 0x59b59a131660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b59a131660>
> .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: 0x59b59a131660>
> 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: 0x59b599d12c40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b599d12c40>
> .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: 0x59b599d12c40>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x59b599d12c40>
> .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: 0x59b599d12c40>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x59b599d12c40>
> .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: 0x59b599d12c40>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x59b599d12c40>
> .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: 0x59b599d12c40>
> 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: 0x59b59c7fe4f0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x59b59c7fe4f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b59c7fe4f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b59c7fe4f0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2fb596541f9102" "BufferedMatrixFile2fb5967afec967"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2fb596541f9102" "BufferedMatrixFile2fb5967afec967"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b59c13ca80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b59c13ca80>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x59b59c13ca80>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x59b59c13ca80>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x59b59c13ca80>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x59b59c13ca80>
> .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: 0x59b59c019750>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59b59c019750>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x59b59c019750>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x59b59c019750>
> 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: 0x59b59a089fc0>
> .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: 0x59b59a089fc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.254   0.044   0.287 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.245   0.045   0.279 

Example timings