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

This page was generated on 2025-08-20 12:03 -0400 (Wed, 20 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4818
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4596
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4538
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4536
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2317HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-19 13:45 -0400 (Tue, 19 Aug 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 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
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


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.73.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.73.0.tar.gz
StartedAt: 2025-08-19 20:39:44 -0400 (Tue, 19 Aug 2025)
EndedAt: 2025-08-19 20:40:08 -0400 (Tue, 19 Aug 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.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 (2025-06-13)
* 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.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... 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.73.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 (2025-06-13) -- "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.283   0.054   0.319 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 (2025-06-13) -- "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 478417 25.6    1047105   56   639600 34.2
Vcells 885231  6.8    8388608   64  2081598 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] "Tue Aug 19 20:40:00 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] "Tue Aug 19 20:40:00 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: 0x5fe076cd0b80>
> 
> 
> 
> 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] "Tue Aug 19 20:40:00 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] "Tue Aug 19 20:40:00 2025"
> 
> ColMode(tmp2)
<pointer: 0x5fe076cd0b80>
> 
> 
> 
> ### 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.5199742  1.4952456 -1.0460748  1.1177256
[2,]  -0.7610715  0.1165287 -0.3821007 -1.2595265
[3,]   0.8278580  0.5153239 -0.6253844 -1.0792470
[4,]   0.9258106 -0.3495005 -1.0021999  0.5044785
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.5199742 1.4952456 1.0460748 1.1177256
[2,]   0.7610715 0.1165287 0.3821007 1.2595265
[3,]   0.8278580 0.5153239 0.6253844 1.0792470
[4,]   0.9258106 0.3495005 1.0021999 0.5044785
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0259650 1.2228024 1.0227780 1.0572254
[2,]  0.8723941 0.3413630 0.6181430 1.1222863
[3,]  0.9098671 0.7178606 0.7908125 1.0388682
[4,]  0.9621905 0.5911857 1.0010993 0.7102665
> 
> 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 :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.77962 38.72327 36.27385 36.68998
[2,]  34.48501 28.53016 31.56353 37.48239
[3,]  34.92653 32.69393 33.53351 36.46793
[4,]  35.54772 31.26136 36.01319 32.60714
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5fe0757294b0>
> exp(tmp5)
<pointer: 0x5fe0757294b0>
> log(tmp5,2)
<pointer: 0x5fe0757294b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.9307
> Min(tmp5)
[1] 55.94516
> mean(tmp5)
[1] 73.05823
> Sum(tmp5)
[1] 14611.65
> Var(tmp5)
[1] 869.6112
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.73490 72.04368 72.13165 72.67427 68.84563 73.81169 68.98814 70.04252
 [9] 73.48455 68.82523
> rowSums(tmp5)
 [1] 1794.698 1440.874 1442.633 1453.485 1376.913 1476.234 1379.763 1400.850
 [9] 1469.691 1376.505
> rowVars(tmp5)
 [1] 8071.54527   78.61535   79.51761   81.07068   54.51892   69.38894
 [7]   62.41784   92.90863   74.90473   82.91272
> rowSd(tmp5)
 [1] 89.841779  8.866530  8.917265  9.003926  7.383693  8.330003  7.900496
 [8]  9.638913  8.654752  9.105642
> rowMax(tmp5)
 [1] 469.93071  92.47315  95.13657  91.72367  84.49990  91.54227  86.58375
 [8]  93.46933  88.40202  87.71275
> rowMin(tmp5)
 [1] 57.48243 59.38179 58.89368 55.94516 56.26046 58.46407 57.18948 57.08163
 [9] 59.73449 56.12275
> 
> colMeans(tmp5)
 [1] 111.35589  69.51262  70.84354  71.19665  70.60437  72.60337  69.28772
 [8]  71.69201  64.20738  71.01872  67.56539  70.92646  76.00639  75.80163
[15]  72.94451  71.07680  68.67273  71.58254  69.78212  74.48369
> colSums(tmp5)
 [1] 1113.5589  695.1262  708.4354  711.9665  706.0437  726.0337  692.8772
 [8]  716.9201  642.0738  710.1872  675.6539  709.2646  760.0639  758.0163
[15]  729.4451  710.7680  686.7273  715.8254  697.8212  744.8369
> colVars(tmp5)
 [1] 15933.76845    77.85935    42.39237    77.22459    62.39602    63.19479
 [7]   110.33166    47.77381    77.75489    74.96083    71.24767    83.90415
[13]   104.03143   149.70356   106.58172    68.74294    55.02734    76.33344
[19]    33.59307    42.90378
> colSd(tmp5)
 [1] 126.229032   8.823795   6.510942   8.787752   7.899115   7.949515
 [7]  10.503888   6.911860   8.817873   8.657992   8.440834   9.159921
[13]  10.199580  12.235341  10.323842   8.291136   7.418041   8.736901
[19]   5.795953   6.550098
> colMax(tmp5)
 [1] 469.93071  82.90083  79.75539  81.45866  82.05287  86.58375  87.71275
 [8]  82.77503  82.40530  83.18682  82.13048  93.46933  89.31545  95.13657
[15]  92.47315  84.49251  84.49990  89.28492  80.39795  91.54227
> colMin(tmp5)
 [1] 56.12275 57.08163 60.54191 57.23422 57.46222 58.29863 57.48243 61.19074
 [9] 55.94516 59.30802 56.75152 59.93647 57.18948 61.33797 57.63558 58.89368
[17] 61.29953 60.77173 59.50582 66.15420
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 89.73490 72.04368 72.13165 72.67427 68.84563 73.81169 68.98814 70.04252
 [9]       NA 68.82523
> rowSums(tmp5)
 [1] 1794.698 1440.874 1442.633 1453.485 1376.913 1476.234 1379.763 1400.850
 [9]       NA 1376.505
> rowVars(tmp5)
 [1] 8071.54527   78.61535   79.51761   81.07068   54.51892   69.38894
 [7]   62.41784   92.90863   76.35568   82.91272
> rowSd(tmp5)
 [1] 89.841779  8.866530  8.917265  9.003926  7.383693  8.330003  7.900496
 [8]  9.638913  8.738174  9.105642
> rowMax(tmp5)
 [1] 469.93071  92.47315  95.13657  91.72367  84.49990  91.54227  86.58375
 [8]  93.46933        NA  87.71275
> rowMin(tmp5)
 [1] 57.48243 59.38179 58.89368 55.94516 56.26046 58.46407 57.18948 57.08163
 [9]       NA 56.12275
> 
> colMeans(tmp5)
 [1] 111.35589  69.51262  70.84354        NA  70.60437  72.60337  69.28772
 [8]  71.69201  64.20738  71.01872  67.56539  70.92646  76.00639  75.80163
[15]  72.94451  71.07680  68.67273  71.58254  69.78212  74.48369
> colSums(tmp5)
 [1] 1113.5589  695.1262  708.4354        NA  706.0437  726.0337  692.8772
 [8]  716.9201  642.0738  710.1872  675.6539  709.2646  760.0639  758.0163
[15]  729.4451  710.7680  686.7273  715.8254  697.8212  744.8369
> colVars(tmp5)
 [1] 15933.76845    77.85935    42.39237          NA    62.39602    63.19479
 [7]   110.33166    47.77381    77.75489    74.96083    71.24767    83.90415
[13]   104.03143   149.70356   106.58172    68.74294    55.02734    76.33344
[19]    33.59307    42.90378
> colSd(tmp5)
 [1] 126.229032   8.823795   6.510942         NA   7.899115   7.949515
 [7]  10.503888   6.911860   8.817873   8.657992   8.440834   9.159921
[13]  10.199580  12.235341  10.323842   8.291136   7.418041   8.736901
[19]   5.795953   6.550098
> colMax(tmp5)
 [1] 469.93071  82.90083  79.75539        NA  82.05287  86.58375  87.71275
 [8]  82.77503  82.40530  83.18682  82.13048  93.46933  89.31545  95.13657
[15]  92.47315  84.49251  84.49990  89.28492  80.39795  91.54227
> colMin(tmp5)
 [1] 56.12275 57.08163 60.54191       NA 57.46222 58.29863 57.48243 61.19074
 [9] 55.94516 59.30802 56.75152 59.93647 57.18948 61.33797 57.63558 58.89368
[17] 61.29953 60.77173 59.50582 66.15420
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.9307
> Min(tmp5,na.rm=TRUE)
[1] 55.94516
> mean(tmp5,na.rm=TRUE)
[1] 73.02187
> Sum(tmp5,na.rm=TRUE)
[1] 14531.35
> Var(tmp5,na.rm=TRUE)
[1] 873.7375
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.73490 72.04368 72.13165 72.67427 68.84563 73.81169 68.98814 70.04252
 [9] 73.12623 68.82523
> rowSums(tmp5,na.rm=TRUE)
 [1] 1794.698 1440.874 1442.633 1453.485 1376.913 1476.234 1379.763 1400.850
 [9] 1389.398 1376.505
> rowVars(tmp5,na.rm=TRUE)
 [1] 8071.54527   78.61535   79.51761   81.07068   54.51892   69.38894
 [7]   62.41784   92.90863   76.35568   82.91272
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.841779  8.866530  8.917265  9.003926  7.383693  8.330003  7.900496
 [8]  9.638913  8.738174  9.105642
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.93071  92.47315  95.13657  91.72367  84.49990  91.54227  86.58375
 [8]  93.46933  88.40202  87.71275
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.48243 59.38179 58.89368 55.94516 56.26046 58.46407 57.18948 57.08163
 [9] 59.73449 56.12275
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.35589  69.51262  70.84354  70.18600  70.60437  72.60337  69.28772
 [8]  71.69201  64.20738  71.01872  67.56539  70.92646  76.00639  75.80163
[15]  72.94451  71.07680  68.67273  71.58254  69.78212  74.48369
> colSums(tmp5,na.rm=TRUE)
 [1] 1113.5589  695.1262  708.4354  631.6740  706.0437  726.0337  692.8772
 [8]  716.9201  642.0738  710.1872  675.6539  709.2646  760.0639  758.0163
[15]  729.4451  710.7680  686.7273  715.8254  697.8212  744.8369
> colVars(tmp5,na.rm=TRUE)
 [1] 15933.76845    77.85935    42.39237    75.38675    62.39602    63.19479
 [7]   110.33166    47.77381    77.75489    74.96083    71.24767    83.90415
[13]   104.03143   149.70356   106.58172    68.74294    55.02734    76.33344
[19]    33.59307    42.90378
> colSd(tmp5,na.rm=TRUE)
 [1] 126.229032   8.823795   6.510942   8.682554   7.899115   7.949515
 [7]  10.503888   6.911860   8.817873   8.657992   8.440834   9.159921
[13]  10.199580  12.235341  10.323842   8.291136   7.418041   8.736901
[19]   5.795953   6.550098
> colMax(tmp5,na.rm=TRUE)
 [1] 469.93071  82.90083  79.75539  81.45866  82.05287  86.58375  87.71275
 [8]  82.77503  82.40530  83.18682  82.13048  93.46933  89.31545  95.13657
[15]  92.47315  84.49251  84.49990  89.28492  80.39795  91.54227
> colMin(tmp5,na.rm=TRUE)
 [1] 56.12275 57.08163 60.54191 57.23422 57.46222 58.29863 57.48243 61.19074
 [9] 55.94516 59.30802 56.75152 59.93647 57.18948 61.33797 57.63558 58.89368
[17] 61.29953 60.77173 59.50582 66.15420
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.73490 72.04368 72.13165 72.67427 68.84563 73.81169 68.98814 70.04252
 [9]      NaN 68.82523
> rowSums(tmp5,na.rm=TRUE)
 [1] 1794.698 1440.874 1442.633 1453.485 1376.913 1476.234 1379.763 1400.850
 [9]    0.000 1376.505
> rowVars(tmp5,na.rm=TRUE)
 [1] 8071.54527   78.61535   79.51761   81.07068   54.51892   69.38894
 [7]   62.41784   92.90863         NA   82.91272
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.841779  8.866530  8.917265  9.003926  7.383693  8.330003  7.900496
 [8]  9.638913        NA  9.105642
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.93071  92.47315  95.13657  91.72367  84.49990  91.54227  86.58375
 [8]  93.46933        NA  87.71275
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.48243 59.38179 58.89368 55.94516 56.26046 58.46407 57.18948 57.08163
 [9]       NA 56.12275
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.62889  68.02504  70.66822       NaN  71.12035  72.40545  69.60878
 [8]  70.87557  62.18539  70.16522  68.43549  71.22051  74.98051  75.55374
[15]  71.22700  71.66816  69.40717  72.49340  69.95306  75.40919
> colSums(tmp5,na.rm=TRUE)
 [1] 1031.6600  612.2254  636.0140    0.0000  640.0831  651.6491  626.4790
 [8]  637.8801  559.6685  631.4870  615.9194  640.9846  674.8246  679.9837
[15]  641.0430  645.0134  624.6645  652.4406  629.5775  678.6827
> colVars(tmp5,na.rm=TRUE)
 [1] 17804.97413    62.69676    47.34564          NA    67.20038    70.65346
 [7]   122.96347    46.24654    41.47922    76.13581    71.63654    93.41940
[13]   105.19545   167.72519    86.71906    73.40162    55.83743    76.54133
[19]    37.46349    38.63059
> colSd(tmp5,na.rm=TRUE)
 [1] 133.435281   7.918129   6.880817         NA   8.197584   8.405561
 [7]  11.088889   6.800481   6.440436   8.725584   8.463837   9.665371
[13]  10.256483  12.950876   9.312307   8.567475   7.472445   8.748790
[19]   6.120742   6.215351
> colMax(tmp5,na.rm=TRUE)
 [1] 469.93071  80.59741  79.75539      -Inf  82.05287  86.58375  87.71275
 [8]  82.77503  73.99097  83.18682  82.13048  93.46933  89.31545  95.13657
[15]  92.47315  84.49251  84.49990  89.28492  80.39795  91.54227
> colMin(tmp5,na.rm=TRUE)
 [1] 56.12275 57.08163 60.54191      Inf 57.46222 58.29863 57.48243 61.19074
 [9] 55.94516 59.30802 56.75152 59.93647 57.18948 61.33797 57.63558 58.89368
[17] 61.29953 60.77173 59.50582 71.30854
> 
> 
> 
> 
> 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] 234.3964 276.4532 181.3605 128.9958 171.3233 119.0143 191.5303 168.0296
 [9] 278.4588 307.6096
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 234.3964 276.4532 181.3605 128.9958 171.3233 119.0143 191.5303 168.0296
 [9] 278.4588 307.6096
> 
> 
> 
> 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] -3.410605e-13  2.842171e-14 -3.552714e-14  5.684342e-14  1.136868e-13
 [6]  0.000000e+00 -1.136868e-13  5.684342e-14  5.684342e-14  2.842171e-14
[11] -2.842171e-14 -5.684342e-14  2.842171e-14 -2.273737e-13  0.000000e+00
[16] -5.684342e-14  2.842171e-14 -2.557954e-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)
+ }
6   12 
4   10 
1   8 
7   12 
7   19 
4   3 
9   14 
9   10 
10   6 
4   14 
9   1 
2   15 
3   15 
3   4 
3   14 
10   14 
4   18 
5   11 
9   10 
8   2 
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.867424
> Min(tmp)
[1] -1.721176
> mean(tmp)
[1] 0.0622083
> Sum(tmp)
[1] 6.22083
> Var(tmp)
[1] 0.905356
> 
> rowMeans(tmp)
[1] 0.0622083
> rowSums(tmp)
[1] 6.22083
> rowVars(tmp)
[1] 0.905356
> rowSd(tmp)
[1] 0.951502
> rowMax(tmp)
[1] 3.867424
> rowMin(tmp)
[1] -1.721176
> 
> colMeans(tmp)
  [1]  0.749984532  0.903581436 -1.086165024  0.330568750  0.609928461
  [6] -0.069469236  1.224365939 -0.471066135 -0.372025415 -0.274870500
 [11]  0.580713938 -0.301345308  0.532893085  0.003992507 -0.496071213
 [16]  1.380533786  1.574076036  1.755105999 -0.992663088 -1.185402474
 [21]  0.038432279 -1.560321630 -0.141523270  0.856113247  0.676420078
 [26] -0.164169435  3.867423946  1.138330544  0.051226351  0.726946694
 [31] -0.530201991  1.039680860 -0.248471569 -0.889728897  0.901437076
 [36] -1.648162770  0.438320522 -0.211609090  1.160269680  2.673691223
 [41] -0.588266084 -0.496176979  1.050404024  1.001266535  0.108447516
 [46] -1.721176313 -0.425761898  1.214396577 -0.351977432 -0.230879901
 [51]  0.686391418 -0.877122481  0.948277864  1.055828970 -0.030754321
 [56] -0.693905220  0.278215727  0.048902486 -1.067146455 -1.049033659
 [61]  0.838429614  0.321847170 -0.227322735  0.594265130 -0.977145728
 [66] -1.594120039 -1.130060612  0.665101387 -0.601715688  0.680177638
 [71] -0.613514535  0.299200269 -0.360392364 -1.116151444  0.674175643
 [76] -0.604265565 -0.897462015  1.449572660  0.568765662  0.499181629
 [81] -1.131838050  0.471917381 -0.422822233  1.389691725  0.268443297
 [86] -0.875859740  0.932557990 -0.611121533 -0.686834443 -1.097874579
 [91] -0.461305047 -0.190654944  1.569959915 -0.811701452  0.300263859
 [96] -0.085653673 -0.714689872 -0.510752432 -0.179317109 -0.830845405
> colSums(tmp)
  [1]  0.749984532  0.903581436 -1.086165024  0.330568750  0.609928461
  [6] -0.069469236  1.224365939 -0.471066135 -0.372025415 -0.274870500
 [11]  0.580713938 -0.301345308  0.532893085  0.003992507 -0.496071213
 [16]  1.380533786  1.574076036  1.755105999 -0.992663088 -1.185402474
 [21]  0.038432279 -1.560321630 -0.141523270  0.856113247  0.676420078
 [26] -0.164169435  3.867423946  1.138330544  0.051226351  0.726946694
 [31] -0.530201991  1.039680860 -0.248471569 -0.889728897  0.901437076
 [36] -1.648162770  0.438320522 -0.211609090  1.160269680  2.673691223
 [41] -0.588266084 -0.496176979  1.050404024  1.001266535  0.108447516
 [46] -1.721176313 -0.425761898  1.214396577 -0.351977432 -0.230879901
 [51]  0.686391418 -0.877122481  0.948277864  1.055828970 -0.030754321
 [56] -0.693905220  0.278215727  0.048902486 -1.067146455 -1.049033659
 [61]  0.838429614  0.321847170 -0.227322735  0.594265130 -0.977145728
 [66] -1.594120039 -1.130060612  0.665101387 -0.601715688  0.680177638
 [71] -0.613514535  0.299200269 -0.360392364 -1.116151444  0.674175643
 [76] -0.604265565 -0.897462015  1.449572660  0.568765662  0.499181629
 [81] -1.131838050  0.471917381 -0.422822233  1.389691725  0.268443297
 [86] -0.875859740  0.932557990 -0.611121533 -0.686834443 -1.097874579
 [91] -0.461305047 -0.190654944  1.569959915 -0.811701452  0.300263859
 [96] -0.085653673 -0.714689872 -0.510752432 -0.179317109 -0.830845405
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.749984532  0.903581436 -1.086165024  0.330568750  0.609928461
  [6] -0.069469236  1.224365939 -0.471066135 -0.372025415 -0.274870500
 [11]  0.580713938 -0.301345308  0.532893085  0.003992507 -0.496071213
 [16]  1.380533786  1.574076036  1.755105999 -0.992663088 -1.185402474
 [21]  0.038432279 -1.560321630 -0.141523270  0.856113247  0.676420078
 [26] -0.164169435  3.867423946  1.138330544  0.051226351  0.726946694
 [31] -0.530201991  1.039680860 -0.248471569 -0.889728897  0.901437076
 [36] -1.648162770  0.438320522 -0.211609090  1.160269680  2.673691223
 [41] -0.588266084 -0.496176979  1.050404024  1.001266535  0.108447516
 [46] -1.721176313 -0.425761898  1.214396577 -0.351977432 -0.230879901
 [51]  0.686391418 -0.877122481  0.948277864  1.055828970 -0.030754321
 [56] -0.693905220  0.278215727  0.048902486 -1.067146455 -1.049033659
 [61]  0.838429614  0.321847170 -0.227322735  0.594265130 -0.977145728
 [66] -1.594120039 -1.130060612  0.665101387 -0.601715688  0.680177638
 [71] -0.613514535  0.299200269 -0.360392364 -1.116151444  0.674175643
 [76] -0.604265565 -0.897462015  1.449572660  0.568765662  0.499181629
 [81] -1.131838050  0.471917381 -0.422822233  1.389691725  0.268443297
 [86] -0.875859740  0.932557990 -0.611121533 -0.686834443 -1.097874579
 [91] -0.461305047 -0.190654944  1.569959915 -0.811701452  0.300263859
 [96] -0.085653673 -0.714689872 -0.510752432 -0.179317109 -0.830845405
> colMin(tmp)
  [1]  0.749984532  0.903581436 -1.086165024  0.330568750  0.609928461
  [6] -0.069469236  1.224365939 -0.471066135 -0.372025415 -0.274870500
 [11]  0.580713938 -0.301345308  0.532893085  0.003992507 -0.496071213
 [16]  1.380533786  1.574076036  1.755105999 -0.992663088 -1.185402474
 [21]  0.038432279 -1.560321630 -0.141523270  0.856113247  0.676420078
 [26] -0.164169435  3.867423946  1.138330544  0.051226351  0.726946694
 [31] -0.530201991  1.039680860 -0.248471569 -0.889728897  0.901437076
 [36] -1.648162770  0.438320522 -0.211609090  1.160269680  2.673691223
 [41] -0.588266084 -0.496176979  1.050404024  1.001266535  0.108447516
 [46] -1.721176313 -0.425761898  1.214396577 -0.351977432 -0.230879901
 [51]  0.686391418 -0.877122481  0.948277864  1.055828970 -0.030754321
 [56] -0.693905220  0.278215727  0.048902486 -1.067146455 -1.049033659
 [61]  0.838429614  0.321847170 -0.227322735  0.594265130 -0.977145728
 [66] -1.594120039 -1.130060612  0.665101387 -0.601715688  0.680177638
 [71] -0.613514535  0.299200269 -0.360392364 -1.116151444  0.674175643
 [76] -0.604265565 -0.897462015  1.449572660  0.568765662  0.499181629
 [81] -1.131838050  0.471917381 -0.422822233  1.389691725  0.268443297
 [86] -0.875859740  0.932557990 -0.611121533 -0.686834443 -1.097874579
 [91] -0.461305047 -0.190654944  1.569959915 -0.811701452  0.300263859
 [96] -0.085653673 -0.714689872 -0.510752432 -0.179317109 -0.830845405
> colMedians(tmp)
  [1]  0.749984532  0.903581436 -1.086165024  0.330568750  0.609928461
  [6] -0.069469236  1.224365939 -0.471066135 -0.372025415 -0.274870500
 [11]  0.580713938 -0.301345308  0.532893085  0.003992507 -0.496071213
 [16]  1.380533786  1.574076036  1.755105999 -0.992663088 -1.185402474
 [21]  0.038432279 -1.560321630 -0.141523270  0.856113247  0.676420078
 [26] -0.164169435  3.867423946  1.138330544  0.051226351  0.726946694
 [31] -0.530201991  1.039680860 -0.248471569 -0.889728897  0.901437076
 [36] -1.648162770  0.438320522 -0.211609090  1.160269680  2.673691223
 [41] -0.588266084 -0.496176979  1.050404024  1.001266535  0.108447516
 [46] -1.721176313 -0.425761898  1.214396577 -0.351977432 -0.230879901
 [51]  0.686391418 -0.877122481  0.948277864  1.055828970 -0.030754321
 [56] -0.693905220  0.278215727  0.048902486 -1.067146455 -1.049033659
 [61]  0.838429614  0.321847170 -0.227322735  0.594265130 -0.977145728
 [66] -1.594120039 -1.130060612  0.665101387 -0.601715688  0.680177638
 [71] -0.613514535  0.299200269 -0.360392364 -1.116151444  0.674175643
 [76] -0.604265565 -0.897462015  1.449572660  0.568765662  0.499181629
 [81] -1.131838050  0.471917381 -0.422822233  1.389691725  0.268443297
 [86] -0.875859740  0.932557990 -0.611121533 -0.686834443 -1.097874579
 [91] -0.461305047 -0.190654944  1.569959915 -0.811701452  0.300263859
 [96] -0.085653673 -0.714689872 -0.510752432 -0.179317109 -0.830845405
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]      [,5]        [,6]     [,7]
[1,] 0.7499845 0.9035814 -1.086165 0.3305688 0.6099285 -0.06946924 1.224366
[2,] 0.7499845 0.9035814 -1.086165 0.3305688 0.6099285 -0.06946924 1.224366
           [,8]       [,9]      [,10]     [,11]      [,12]     [,13]
[1,] -0.4710661 -0.3720254 -0.2748705 0.5807139 -0.3013453 0.5328931
[2,] -0.4710661 -0.3720254 -0.2748705 0.5807139 -0.3013453 0.5328931
           [,14]      [,15]    [,16]    [,17]    [,18]      [,19]     [,20]
[1,] 0.003992507 -0.4960712 1.380534 1.574076 1.755106 -0.9926631 -1.185402
[2,] 0.003992507 -0.4960712 1.380534 1.574076 1.755106 -0.9926631 -1.185402
          [,21]     [,22]      [,23]     [,24]     [,25]      [,26]    [,27]
[1,] 0.03843228 -1.560322 -0.1415233 0.8561132 0.6764201 -0.1641694 3.867424
[2,] 0.03843228 -1.560322 -0.1415233 0.8561132 0.6764201 -0.1641694 3.867424
        [,28]      [,29]     [,30]     [,31]    [,32]      [,33]      [,34]
[1,] 1.138331 0.05122635 0.7269467 -0.530202 1.039681 -0.2484716 -0.8897289
[2,] 1.138331 0.05122635 0.7269467 -0.530202 1.039681 -0.2484716 -0.8897289
         [,35]     [,36]     [,37]      [,38]   [,39]    [,40]      [,41]
[1,] 0.9014371 -1.648163 0.4383205 -0.2116091 1.16027 2.673691 -0.5882661
[2,] 0.9014371 -1.648163 0.4383205 -0.2116091 1.16027 2.673691 -0.5882661
         [,42]    [,43]    [,44]     [,45]     [,46]      [,47]    [,48]
[1,] -0.496177 1.050404 1.001267 0.1084475 -1.721176 -0.4257619 1.214397
[2,] -0.496177 1.050404 1.001267 0.1084475 -1.721176 -0.4257619 1.214397
          [,49]      [,50]     [,51]      [,52]     [,53]    [,54]       [,55]
[1,] -0.3519774 -0.2308799 0.6863914 -0.8771225 0.9482779 1.055829 -0.03075432
[2,] -0.3519774 -0.2308799 0.6863914 -0.8771225 0.9482779 1.055829 -0.03075432
          [,56]     [,57]      [,58]     [,59]     [,60]     [,61]     [,62]
[1,] -0.6939052 0.2782157 0.04890249 -1.067146 -1.049034 0.8384296 0.3218472
[2,] -0.6939052 0.2782157 0.04890249 -1.067146 -1.049034 0.8384296 0.3218472
          [,63]     [,64]      [,65]    [,66]     [,67]     [,68]      [,69]
[1,] -0.2273227 0.5942651 -0.9771457 -1.59412 -1.130061 0.6651014 -0.6017157
[2,] -0.2273227 0.5942651 -0.9771457 -1.59412 -1.130061 0.6651014 -0.6017157
         [,70]      [,71]     [,72]      [,73]     [,74]     [,75]      [,76]
[1,] 0.6801776 -0.6135145 0.2992003 -0.3603924 -1.116151 0.6741756 -0.6042656
[2,] 0.6801776 -0.6135145 0.2992003 -0.3603924 -1.116151 0.6741756 -0.6042656
         [,77]    [,78]     [,79]     [,80]     [,81]     [,82]      [,83]
[1,] -0.897462 1.449573 0.5687657 0.4991816 -1.131838 0.4719174 -0.4228222
[2,] -0.897462 1.449573 0.5687657 0.4991816 -1.131838 0.4719174 -0.4228222
        [,84]     [,85]      [,86]    [,87]      [,88]      [,89]     [,90]
[1,] 1.389692 0.2684433 -0.8758597 0.932558 -0.6111215 -0.6868344 -1.097875
[2,] 1.389692 0.2684433 -0.8758597 0.932558 -0.6111215 -0.6868344 -1.097875
         [,91]      [,92]   [,93]      [,94]     [,95]       [,96]      [,97]
[1,] -0.461305 -0.1906549 1.56996 -0.8117015 0.3002639 -0.08565367 -0.7146899
[2,] -0.461305 -0.1906549 1.56996 -0.8117015 0.3002639 -0.08565367 -0.7146899
          [,98]      [,99]     [,100]
[1,] -0.5107524 -0.1793171 -0.8308454
[2,] -0.5107524 -0.1793171 -0.8308454
> 
> 
> Max(tmp2)
[1] 2.276088
> Min(tmp2)
[1] -1.874163
> mean(tmp2)
[1] 0.1121943
> Sum(tmp2)
[1] 11.21943
> Var(tmp2)
[1] 0.8534469
> 
> rowMeans(tmp2)
  [1]  1.16871426  0.29088905 -0.28764169 -1.34607302  1.17690968  1.32861337
  [7] -0.39192455  0.37645875  0.33207075  0.23640374 -0.61813240  2.27608800
 [13] -0.75644382  1.67409599 -0.27064620  0.07680682  0.89137391 -0.89490773
 [19] -0.37294620 -0.05030148 -1.25065302  0.46779617  0.46107982  0.51889415
 [25] -1.33553781 -0.40346476 -1.06767525  1.33430064  0.65113253 -0.69106959
 [31]  0.72578680  2.11274796 -1.40187787 -0.77434016  0.52954060  1.54200505
 [37]  1.84568118  1.51277987 -0.44939275  0.91449721  0.51555884  0.43116484
 [43] -0.59836999  1.56724577  0.23730924 -1.56431070 -1.11622091  0.28549073
 [49] -1.54069617 -0.48635253 -0.19614977 -0.21937561 -1.63713752 -0.42537081
 [55] -1.87416266  1.22278433  0.93941402  0.20069034 -1.20534317 -0.27068236
 [61]  2.06573116  1.25796408  0.73161839  0.69740549  0.06169100 -1.16733658
 [67]  0.06384200  0.38461299  0.67429156 -0.22846795 -0.04513310  0.10624410
 [73] -0.31157307 -0.52128989 -1.61666527  0.23031345  0.57515691 -0.07237459
 [79]  0.67220199 -0.87403582  1.01921341  0.48194654  0.93124399 -0.11391046
 [85]  0.97990792  0.59863298 -0.05080045  0.27382911  1.57004811  0.87701506
 [91] -0.52031277  0.33440311 -0.01393692 -0.56201649 -0.21371922  0.03994205
 [97] -0.44095999  0.11868751  0.17639632 -1.29749857
> rowSums(tmp2)
  [1]  1.16871426  0.29088905 -0.28764169 -1.34607302  1.17690968  1.32861337
  [7] -0.39192455  0.37645875  0.33207075  0.23640374 -0.61813240  2.27608800
 [13] -0.75644382  1.67409599 -0.27064620  0.07680682  0.89137391 -0.89490773
 [19] -0.37294620 -0.05030148 -1.25065302  0.46779617  0.46107982  0.51889415
 [25] -1.33553781 -0.40346476 -1.06767525  1.33430064  0.65113253 -0.69106959
 [31]  0.72578680  2.11274796 -1.40187787 -0.77434016  0.52954060  1.54200505
 [37]  1.84568118  1.51277987 -0.44939275  0.91449721  0.51555884  0.43116484
 [43] -0.59836999  1.56724577  0.23730924 -1.56431070 -1.11622091  0.28549073
 [49] -1.54069617 -0.48635253 -0.19614977 -0.21937561 -1.63713752 -0.42537081
 [55] -1.87416266  1.22278433  0.93941402  0.20069034 -1.20534317 -0.27068236
 [61]  2.06573116  1.25796408  0.73161839  0.69740549  0.06169100 -1.16733658
 [67]  0.06384200  0.38461299  0.67429156 -0.22846795 -0.04513310  0.10624410
 [73] -0.31157307 -0.52128989 -1.61666527  0.23031345  0.57515691 -0.07237459
 [79]  0.67220199 -0.87403582  1.01921341  0.48194654  0.93124399 -0.11391046
 [85]  0.97990792  0.59863298 -0.05080045  0.27382911  1.57004811  0.87701506
 [91] -0.52031277  0.33440311 -0.01393692 -0.56201649 -0.21371922  0.03994205
 [97] -0.44095999  0.11868751  0.17639632 -1.29749857
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.16871426  0.29088905 -0.28764169 -1.34607302  1.17690968  1.32861337
  [7] -0.39192455  0.37645875  0.33207075  0.23640374 -0.61813240  2.27608800
 [13] -0.75644382  1.67409599 -0.27064620  0.07680682  0.89137391 -0.89490773
 [19] -0.37294620 -0.05030148 -1.25065302  0.46779617  0.46107982  0.51889415
 [25] -1.33553781 -0.40346476 -1.06767525  1.33430064  0.65113253 -0.69106959
 [31]  0.72578680  2.11274796 -1.40187787 -0.77434016  0.52954060  1.54200505
 [37]  1.84568118  1.51277987 -0.44939275  0.91449721  0.51555884  0.43116484
 [43] -0.59836999  1.56724577  0.23730924 -1.56431070 -1.11622091  0.28549073
 [49] -1.54069617 -0.48635253 -0.19614977 -0.21937561 -1.63713752 -0.42537081
 [55] -1.87416266  1.22278433  0.93941402  0.20069034 -1.20534317 -0.27068236
 [61]  2.06573116  1.25796408  0.73161839  0.69740549  0.06169100 -1.16733658
 [67]  0.06384200  0.38461299  0.67429156 -0.22846795 -0.04513310  0.10624410
 [73] -0.31157307 -0.52128989 -1.61666527  0.23031345  0.57515691 -0.07237459
 [79]  0.67220199 -0.87403582  1.01921341  0.48194654  0.93124399 -0.11391046
 [85]  0.97990792  0.59863298 -0.05080045  0.27382911  1.57004811  0.87701506
 [91] -0.52031277  0.33440311 -0.01393692 -0.56201649 -0.21371922  0.03994205
 [97] -0.44095999  0.11868751  0.17639632 -1.29749857
> rowMin(tmp2)
  [1]  1.16871426  0.29088905 -0.28764169 -1.34607302  1.17690968  1.32861337
  [7] -0.39192455  0.37645875  0.33207075  0.23640374 -0.61813240  2.27608800
 [13] -0.75644382  1.67409599 -0.27064620  0.07680682  0.89137391 -0.89490773
 [19] -0.37294620 -0.05030148 -1.25065302  0.46779617  0.46107982  0.51889415
 [25] -1.33553781 -0.40346476 -1.06767525  1.33430064  0.65113253 -0.69106959
 [31]  0.72578680  2.11274796 -1.40187787 -0.77434016  0.52954060  1.54200505
 [37]  1.84568118  1.51277987 -0.44939275  0.91449721  0.51555884  0.43116484
 [43] -0.59836999  1.56724577  0.23730924 -1.56431070 -1.11622091  0.28549073
 [49] -1.54069617 -0.48635253 -0.19614977 -0.21937561 -1.63713752 -0.42537081
 [55] -1.87416266  1.22278433  0.93941402  0.20069034 -1.20534317 -0.27068236
 [61]  2.06573116  1.25796408  0.73161839  0.69740549  0.06169100 -1.16733658
 [67]  0.06384200  0.38461299  0.67429156 -0.22846795 -0.04513310  0.10624410
 [73] -0.31157307 -0.52128989 -1.61666527  0.23031345  0.57515691 -0.07237459
 [79]  0.67220199 -0.87403582  1.01921341  0.48194654  0.93124399 -0.11391046
 [85]  0.97990792  0.59863298 -0.05080045  0.27382911  1.57004811  0.87701506
 [91] -0.52031277  0.33440311 -0.01393692 -0.56201649 -0.21371922  0.03994205
 [97] -0.44095999  0.11868751  0.17639632 -1.29749857
> 
> colMeans(tmp2)
[1] 0.1121943
> colSums(tmp2)
[1] 11.21943
> colVars(tmp2)
[1] 0.8534469
> colSd(tmp2)
[1] 0.9238219
> colMax(tmp2)
[1] 2.276088
> colMin(tmp2)
[1] -1.874163
> colMedians(tmp2)
[1] 0.1124658
> colRanges(tmp2)
          [,1]
[1,] -1.874163
[2,]  2.276088
> 
> 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]  3.7648811  2.2513263  0.6913985  3.3294526  3.4701917  0.8930821
 [7] -3.2378683  1.5525471 -1.7686455 -0.5589726
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.49781876
[2,] -0.02937338
[3,]  0.22340865
[4,]  0.74544763
[5,]  1.81687765
> 
> rowApply(tmp,sum)
 [1]  0.7797138  6.0522035  4.7711359  0.0315975 -6.2575593  1.9714547
 [7]  2.1755684  0.4966939  0.6308201 -0.2642355
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    9    4    3    9    5    5    8    6     8
 [2,]    3   10    2    1    8    8    6    1    9     6
 [3,]    8    2    7    8    2    4   10    4    8     4
 [4,]    1    5    8    9    5   10    2    7    5     9
 [5,]    6    6   10    4    7    9    9    2    7     1
 [6,]    5    3    5   10    6    3    7    5   10     2
 [7,]    9    7    3    2    3    1    8    3    1     5
 [8,]    7    4    9    5   10    6    1    9    2     3
 [9,]    4    8    1    6    1    2    3   10    3    10
[10,]    2    1    6    7    4    7    4    6    4     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.85355815 -1.08764035  3.29711107 -0.10416260 -0.34400078  1.08729212
 [7]  1.07713168 -1.39948929 -0.67747601  2.38579242  0.01997558 -2.28853175
[13] -2.14077301  2.22446454  0.79412077 -1.35308081  0.37842842  1.51959094
[19] -1.00798117 -0.56381311
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3850150
[2,] -0.7730625
[3,] -0.3791950
[4,]  0.1046511
[5,]  0.5790633
> 
> rowApply(tmp,sum)
[1] -0.5239173  2.2236526 -0.8004806  2.1259203 -3.0617744
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   14    5    3    7   13
[2,]    5    7    6   12   17
[3,]   19    3   20    8   19
[4,]   16   13   18    2    8
[5,]   15   11   10   11    4
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]         [,5]        [,6]
[1,]  0.5790633 -0.79634050  1.0544060  0.6609056  0.622828825  1.08908601
[2,] -0.7730625 -0.31568140 -0.9307932  0.2512934  0.047166639  0.02704342
[3,] -1.3850150 -0.61231180  2.7912870  0.6083754  0.034304748 -0.08078917
[4,] -0.3791950  0.05575989 -0.3418704 -1.0307746  0.008103675 -0.03568972
[5,]  0.1046511  0.58093347  0.7240817 -0.5939624 -1.056404666  0.08764158
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  0.3540252 -1.5439875 -1.2047397 -0.6297766 -0.3302821  0.09510571
[2,] -1.2241721  0.5234052 -1.8605095  1.8262971  0.3941487 -0.25956405
[3,]  0.3007449 -0.1711307 -0.2190618  0.4675044  0.2554321 -1.16756203
[4,]  0.3103500  0.5742513  2.1954150  1.0532107 -0.7997745 -0.69800861
[5,]  1.3361837 -0.7820276  0.4114200 -0.3314432  0.5004513 -0.25850276
            [,13]        [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.153428477 -0.025896044  0.8339344 -1.1173030  0.7206844 -0.8554074
[2,] -0.040986678  0.894087398  3.4013650 -0.3709422 -0.8460320  0.1210602
[3,] -1.635081087  0.772007516 -1.4439968  0.5146215  0.2573339  0.4267782
[4,]  0.005189369  0.576477362 -0.5977323 -0.8718158  1.3214827  1.2198668
[5,] -0.623323094  0.007788306 -1.3994496  0.4923586 -1.0750407  0.6072932
           [,19]      [,20]
[1,]  0.03610495 -0.2197574
[2,]  0.32796566  1.0315634
[3,]  0.41047710 -0.9243989
[4,] -1.14998869  0.7106631
[5,] -0.63254019 -1.1618832
> 
> 
> 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 :  649  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 :  562  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
row1 -0.09008613 -0.6583055 -0.2975523 1.712413 -0.5936177 -0.06800104
          col7        col8      col9      col10     col11    col12     col13
row1 0.2741112 -0.06714724 0.1111396 -0.1353129 0.3217064 0.448687 0.4554948
          col14    col15    col16      col17     col18     col19     col20
row1 -0.7164531 1.065116 1.510043 -0.5186808 0.4722992 0.7960186 -1.723255
> tmp[,"col10"]
          col10
row1 -0.1353129
row2  1.6338609
row3 -1.4968442
row4 -1.5783391
row5 -0.6482539
> tmp[c("row1","row5"),]
            col1       col2       col3      col4       col5        col6
row1 -0.09008613 -0.6583055 -0.2975523 1.7124125 -0.5936177 -0.06800104
row5 -0.89186486  0.2483889  1.2511248 0.3912231 -0.5747523 -0.86015797
          col7        col8       col9      col10     col11       col12
row1 0.2741112 -0.06714724  0.1111396 -0.1353129 0.3217064  0.44868695
row5 1.1496182 -0.34687711 -0.8834484 -0.6482539 0.1810761 -0.08940511
          col13      col14     col15     col16      col17     col18      col19
row1  0.4554948 -0.7164531  1.065116 1.5100431 -0.5186808 0.4722992  0.7960186
row5 -0.5155415  1.3823107 -1.249117 0.7804666  1.1336114 0.5286087 -0.9942748
          col20
row1 -1.7232546
row5 -0.1643404
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.06800104 -1.7232546
row2  0.90636970  2.5010046
row3 -1.33843948  0.8642555
row4 -1.46671255  1.1735149
row5 -0.86015797 -0.1643404
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1 -0.06800104 -1.7232546
row5 -0.86015797 -0.1643404
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.46256 49.74118 48.66781 50.03691 51.06789 107.3014 50.54686 49.96696
         col9    col10    col11    col12    col13    col14   col15    col16
row1 49.16701 50.83036 50.29005 50.26208 49.26571 50.99464 50.4199 50.10335
        col17    col18   col19    col20
row1 50.68159 51.12784 49.5481 106.1038
> tmp[,"col10"]
        col10
row1 50.83036
row2 30.83001
row3 31.53244
row4 29.23299
row5 49.26855
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.46256 49.74118 48.66781 50.03691 51.06789 107.3014 50.54686 49.96696
row5 50.24615 50.37021 49.27077 49.19440 49.92247 104.2770 50.49783 49.54729
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.16701 50.83036 50.29005 50.26208 49.26571 50.99464 50.41990 50.10335
row5 50.17073 49.26855 48.82500 50.09862 49.37191 48.29162 51.07235 51.57694
        col17    col18    col19    col20
row1 50.68159 51.12784 49.54810 106.1038
row5 49.90605 49.31487 49.04784 105.9902
> tmp[,c("col6","col20")]
          col6     col20
row1 107.30142 106.10377
row2  74.21874  73.53416
row3  73.17938  73.97554
row4  74.82096  72.94093
row5 104.27699 105.99021
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 107.3014 106.1038
row5 104.2770 105.9902
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 107.3014 106.1038
row5 104.2770 105.9902
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.2846237
[2,] -1.7904308
[3,]  0.4347555
[4,] -1.6438929
[5,]  0.8151159
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.2103682 -0.2866729
[2,] -1.1242956  1.6085209
[3,]  0.5023224 -1.2022984
[4,] -0.4831921 -1.7339628
[5,] -1.2630033  0.2426007
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.63057214 -0.8232505
[2,] -0.44256193 -0.6129987
[3,]  0.03542096  1.0506268
[4,]  1.08111652 -1.2580217
[5,] -0.29922254  0.4175879
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.6305721
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.6305721
[2,] -0.4425619
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]       [,4]       [,5]      [,6]      [,7]
row3 -0.3022928 0.2321295 -0.4623202  1.1801405 0.08376790 0.9433444 0.5923313
row1 -0.4593055 0.5663966  0.5749758 -0.7113325 0.05445166 0.6268230 1.8620721
           [,8]      [,9]      [,10]      [,11]      [,12]      [,13]
row3 -0.4571623 1.3951433 -0.3832574  0.3984189 -0.2524718 -0.2271486
row1 -1.7520332 0.2689581 -0.6356322 -0.7025212  0.7981365  0.9436400
          [,14]      [,15]     [,16]       [,17]      [,18]     [,19]
row3 -0.6718755 0.82942875 0.4214367 -0.09872043  0.4568485 -1.729376
row1 -0.3647429 0.07797192 1.3354195 -0.39062686 -1.0842828 -1.081836
          [,20]
row3 -0.7342797
row1 -1.5916632
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]      [,3]        [,4]      [,5]      [,6]       [,7]
row2 -0.7499726 1.621194 0.9237476 -0.02562761 0.3784411 -2.541733 -0.5266657
          [,8]      [,9]     [,10]
row2 0.5215261 0.7031744 0.9303148
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]     [,4]     [,5]       [,6]      [,7]
row5 -0.4813004 -1.823853 0.1228595 -1.59793 1.934316 -0.8961515 0.7820463
         [,8]      [,9]    [,10]     [,11]     [,12]      [,13]      [,14]
row5 1.649858 0.9393479 2.509722 -1.904663 -1.259225 -0.8071342 -0.5723122
         [,15]    [,16]     [,17]     [,18]      [,19]     [,20]
row5 0.7274225 1.979644 0.4263924 0.3791746 -0.4143611 0.1597182
> 
> 
> 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: 0x5fe07649e2e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a72288156d5"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a725039c2c1"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a723b1c77b8"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a724446019" 
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a7237d323c0"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a724a4fb419"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a727d1a4b4c"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a7215c2d4c8"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a72335afce1"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a7249dd15b7"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a725497403b"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a725ad0a410"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a723700db64"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a726f09e6f4"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25a727d4dbc39"
> 
> 
> ### 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: 0x5fe0781868c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5fe0781868c0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5fe0781868c0>
> rowMedians(tmp)
  [1]  7.711504e-02  3.779416e-01  6.642818e-02 -3.948778e-01 -3.075622e-01
  [6] -2.284353e-01  4.777341e-01  7.894444e-02 -1.349530e-03  2.917426e-01
 [11] -1.500694e-02 -3.696485e-01  2.406682e-01 -1.341256e-01 -1.966992e-01
 [16]  2.067972e-01 -2.404804e-01  1.898546e-01  4.691738e-01 -3.744545e-01
 [21]  2.755337e-01  3.478336e-01  2.822042e-01  4.491829e-02 -2.660128e-01
 [26] -3.762905e-02  8.656136e-02  4.425637e-01 -3.699445e-01 -2.657649e-01
 [31]  2.546520e-01  2.015550e-01  5.167775e-01 -1.999966e-02  2.834181e-01
 [36]  1.255557e-01 -6.999279e-02  3.895859e-01 -3.087110e-01 -2.289461e-01
 [41]  2.666815e-01  3.192059e-01  4.939461e-01  1.008861e-01  1.976961e-01
 [46]  4.073866e-01 -1.599372e-01 -1.687882e-01 -3.547156e-01  2.716866e-01
 [51] -6.197086e-01 -5.849626e-02  2.784998e-01 -1.996391e-02  3.802948e-01
 [56]  4.091972e-01 -4.123781e-01  5.217064e-01 -2.499998e-01  1.083070e+00
 [61]  3.722290e-01  4.388187e-02  1.975262e-01  1.666404e-01  1.999047e-01
 [66]  7.874333e-01  2.527521e-01  1.067242e-01 -2.590381e-01 -4.976045e-02
 [71]  1.050004e-01 -1.774079e-01 -9.595853e-02  5.636426e-03 -3.818667e-01
 [76]  2.137079e-01 -3.557082e-01 -1.475715e-01  2.929464e-02  5.799448e-02
 [81] -1.507212e-01  2.373615e-01 -4.810372e-01  3.609449e-01  5.327134e-01
 [86] -2.826045e-01  8.244572e-02  1.444711e-01 -9.166325e-01 -1.856990e-01
 [91] -3.139314e-02 -7.249139e-01 -3.347834e-01  5.746509e-01 -3.033065e-01
 [96] -5.251749e-02  4.566494e-01 -7.439374e-02  1.064754e-01 -4.438029e-02
[101] -2.658853e-02  3.616621e-01 -5.377340e-02  2.372715e-02  1.605965e-01
[106]  4.968406e-02 -9.862925e-01  4.225638e-01  7.002954e-05  9.856767e-03
[111] -3.172215e-01  3.848255e-02 -4.240645e-01  3.796667e-01 -2.887236e-01
[116]  5.855714e-02 -2.169715e-01  5.673068e-03  9.128996e-02  8.199338e-02
[121] -2.452925e-01  2.508746e-01 -1.933573e-01 -4.515372e-02 -6.153585e-01
[126] -2.733859e-01  2.675336e-01  1.219201e-01 -1.375613e-01  4.255883e-01
[131] -5.762498e-02  9.352870e-03  2.060638e-01 -1.200127e-01 -1.723955e-01
[136] -3.392709e-02 -1.669394e-01 -1.032361e-01 -2.510180e-01 -4.728668e-01
[141] -4.039729e-02 -3.203263e-02  3.690154e-01  1.601909e-01  2.926348e-01
[146] -4.132960e-01 -4.720283e-01  2.516719e-01  2.352697e-01  2.495498e-01
[151] -1.830058e-01 -5.066929e-02 -4.030604e-01 -3.457690e-01 -9.797287e-02
[156]  4.981857e-02  2.113003e-01 -4.154614e-01 -3.578961e-01  5.219803e-01
[161] -3.611283e-02  4.174255e-02  9.573245e-02  4.318459e-01  4.457286e-01
[166] -2.208276e-01 -3.634272e-02  1.712617e-01  2.402863e-02 -6.053042e-01
[171] -1.002124e-01 -1.699827e-01  4.215727e-01 -1.523101e-01  2.360504e-02
[176] -4.310839e-02 -4.055538e-01  1.857842e-01  8.568533e-02  1.893452e-01
[181] -2.822621e-01 -2.857224e-01  1.863481e-01 -5.213481e-01 -3.290967e-01
[186] -2.718387e-01  4.102173e-01  1.323728e-01 -1.115401e-01 -1.291002e-01
[191] -2.393267e-01  2.794959e-01 -2.005728e-01 -2.824565e-01  2.329379e-01
[196]  3.286613e-01  4.251093e-02  4.598937e-01 -7.458812e-01 -2.514446e-01
[201]  9.982292e-02 -6.902628e-02  7.800165e-02  5.702329e-01  1.147514e-01
[206] -7.946782e-02 -3.941777e-01  2.509778e-01 -3.369255e-01  7.569897e-02
[211] -2.043725e-01  1.506702e-01  2.891912e-01  4.480748e-01 -3.026370e-01
[216]  5.685044e-03  3.983373e-01  2.834738e-01 -6.713362e-01 -3.183321e-01
[221]  3.041182e-01  1.354049e-01  2.828178e-01  2.225728e-01 -6.103246e-01
[226] -3.319312e-01 -2.031488e-01  6.488583e-01 -8.054676e-02 -9.720864e-02
> 
> proc.time()
   user  system elapsed 
  1.263   0.671   1.921 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 (2025-06-13) -- "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: 0x599ca85f4b80>
> .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: 0x599ca85f4b80>
> .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: 0x599ca85f4b80>
> .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: 0x599ca85f4b80>
> 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: 0x599ca85d7390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x599ca85d7390>
> .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: 0x599ca85d7390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x599ca85d7390>
> .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: 0x599ca85d7390>
> 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: 0x599ca85bf1e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x599ca85bf1e0>
> .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: 0x599ca85bf1e0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x599ca85bf1e0>
> .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: 0x599ca85bf1e0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x599ca85bf1e0>
> .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: 0x599ca85bf1e0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x599ca85bf1e0>
> .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: 0x599ca85bf1e0>
> 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: 0x599ca7e442a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x599ca7e442a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x599ca7e442a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x599ca7e442a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile25b981c575d49" "BufferedMatrixFile25b9879ee5cb6"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile25b981c575d49" "BufferedMatrixFile25b9879ee5cb6"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x599ca9047da0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x599ca9047da0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x599ca9047da0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x599ca9047da0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x599ca9047da0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x599ca9047da0>
> .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: 0x599ca92dc470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x599ca92dc470>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x599ca92dc470>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x599ca92dc470>
> 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: 0x599ca84bd410>
> .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: 0x599ca84bd410>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.271   0.046   0.306 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 (2025-06-13) -- "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.274   0.059   0.315 

Example timings