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

This page was generated on 2026-01-08 11:59 -0500 (Thu, 08 Jan 2026).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.2 (2025-10-31) -- "[Not] Part in a Rumble" 4883
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4671
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 257/2361HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.74.0  (landing page)
Ben Bolstad
Snapshot Date: 2026-01-05 13:45 -0500 (Mon, 05 Jan 2026)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_22
git_last_commit: d2ce144
git_last_commit_date: 2025-10-29 09:58:55 -0500 (Wed, 29 Oct 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on taishan

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.
- See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host.

raw results


Summary

Package: BufferedMatrix
Version: 1.74.0
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.74.0.tar.gz
StartedAt: 2026-01-06 08:08:37 -0000 (Tue, 06 Jan 2026)
EndedAt: 2026-01-06 08:09:06 -0000 (Tue, 06 Jan 2026)
EllapsedTime: 29.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 (2025-04-11)
* using platform: aarch64-unknown-linux-gnu
* R was compiled by
    aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0
    GNU Fortran (GCC) 14.2.0
* running under: openEuler 24.03 (LTS)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* 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/R/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/R/R-4.5.0/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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){
      |            ^~~~~~~~~~~
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
/opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -std=gnu23 -shared -L/home/biocbuild/R/R-4.5.0/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.5.0/lib -lR
installing to /home/biocbuild/R/R-4.5.0/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.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.309   0.056   0.351 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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 478398 25.6    1047041   56   639620 34.2
Vcells 885166  6.8    8388608   64  2080985 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 Jan  6 08:09:00 2026"
> 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 Jan  6 08:09:00 2026"
> 
> 
> 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: 0x2b33eff0>
> 
> 
> 
> 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 Jan  6 08:09:01 2026"
> 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 Jan  6 08:09:01 2026"
> 
> ColMode(tmp2)
<pointer: 0x2b33eff0>
> 
> 
> 
> ### 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.6485484  2.94199857 -0.6407754 0.3071833
[2,]   0.2379997 -0.09178266  1.5312174 0.6894740
[3,]  -0.4088913 -0.74180463  2.8658878 0.1313563
[4,]   0.4355668  1.33158524  1.9995724 0.5107651
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]      [,4]
[1,] 100.6485484 2.94199857 0.6407754 0.3071833
[2,]   0.2379997 0.09178266 1.5312174 0.6894740
[3,]   0.4088913 0.74180463 2.8658878 0.1313563
[4,]   0.4355668 1.33158524 1.9995724 0.5107651
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0323750 1.7152255 0.8004845 0.5542412
[2,]  0.4878521 0.3029565 1.2374237 0.8303457
[3,]  0.6394461 0.8612808 1.6928933 0.3624312
[4,]  0.6599748 1.1539433 1.4140624 0.7146783
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.97230 45.09425 33.64562 30.84960
[2,]  30.11652 28.12135 38.90545 33.99293
[3,]  31.80335 34.35461 44.79482 28.75567
[4,]  32.03532 37.87102 41.14020 32.65755
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x2a0216c0>
> exp(tmp5)
<pointer: 0x2a0216c0>
> log(tmp5,2)
<pointer: 0x2a0216c0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.3317
> Min(tmp5)
[1] 54.34514
> mean(tmp5)
[1] 73.20185
> Sum(tmp5)
[1] 14640.37
> Var(tmp5)
[1] 874.046
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.70648 64.89897 74.31343 72.34120 74.36245 68.78674 69.74392 70.31538
 [9] 74.88894 71.66101
> rowSums(tmp5)
 [1] 1814.130 1297.979 1486.269 1446.824 1487.249 1375.735 1394.878 1406.308
 [9] 1497.779 1433.220
> rowVars(tmp5)
 [1] 8077.28899   39.97498  131.26810   87.99830   46.14378   91.31784
 [7]   61.36525   41.68569   47.96834   83.49571
> rowSd(tmp5)
 [1] 89.873739  6.322577 11.457229  9.380741  6.792921  9.556037  7.833598
 [8]  6.456445  6.925918  9.137599
> rowMax(tmp5)
 [1] 470.33173  80.97661  96.90558  93.51403  88.96736  86.19360  82.40398
 [8]  83.79051  83.21649  90.20291
> rowMin(tmp5)
 [1] 54.34514 57.56659 59.85116 56.75085 63.60360 55.68990 56.94905 56.35896
 [9] 56.82609 55.12690
> 
> colMeans(tmp5)
 [1] 106.81869  72.74852  75.74922  66.79251  72.98754  69.99012  69.43154
 [8]  69.95680  70.74274  72.00960  70.62169  69.58842  70.47207  68.87449
[15]  67.45574  72.60798  78.91706  71.34189  75.06321  71.86725
> colSums(tmp5)
 [1] 1068.1869  727.4852  757.4922  667.9251  729.8754  699.9012  694.3154
 [8]  699.5680  707.4274  720.0960  706.2169  695.8842  704.7207  688.7449
[15]  674.5574  726.0798  789.1706  713.4189  750.6321  718.6725
> colVars(tmp5)
 [1] 16381.27533   115.84043   115.68320    32.05610    94.71856    57.23280
 [7]    71.25012    84.46776    52.29158   106.12653    76.98632    94.80485
[13]    61.11463    60.66972    36.07068   100.66119   102.20051    97.52366
[19]    47.25436    47.81866
> colSd(tmp5)
 [1] 127.989356  10.762919  10.755613   5.661811   9.732346   7.565236
 [7]   8.440979   9.190634   7.231292  10.301773   8.774185   9.736778
[13]   7.817585   7.789077   6.005887  10.033005  10.109427   9.875407
[19]   6.874181   6.915104
> colMax(tmp5)
 [1] 470.33173  93.85778  93.23455  74.64059  90.20291  81.76553  83.21649
 [8]  89.45177  86.66739  88.96736  78.78051  86.43714  81.29764  85.59660
[15]  77.02330  93.51403  96.90558  84.13552  83.19286  83.37365
> colMin(tmp5)
 [1] 56.35896 57.42771 57.07559 55.68990 60.43875 59.57495 59.92130 54.34514
 [9] 59.92219 56.75085 56.94905 55.12690 59.07850 60.70188 57.05956 61.74244
[17] 63.60360 57.19676 63.90806 62.80895
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.70648 64.89897 74.31343 72.34120 74.36245 68.78674 69.74392 70.31538
 [9]       NA 71.66101
> rowSums(tmp5)
 [1] 1814.130 1297.979 1486.269 1446.824 1487.249 1375.735 1394.878 1406.308
 [9]       NA 1433.220
> rowVars(tmp5)
 [1] 8077.28899   39.97498  131.26810   87.99830   46.14378   91.31784
 [7]   61.36525   41.68569   49.74762   83.49571
> rowSd(tmp5)
 [1] 89.873739  6.322577 11.457229  9.380741  6.792921  9.556037  7.833598
 [8]  6.456445  7.053199  9.137599
> rowMax(tmp5)
 [1] 470.33173  80.97661  96.90558  93.51403  88.96736  86.19360  82.40398
 [8]  83.79051        NA  90.20291
> rowMin(tmp5)
 [1] 54.34514 57.56659 59.85116 56.75085 63.60360 55.68990 56.94905 56.35896
 [9]       NA 55.12690
> 
> colMeans(tmp5)
 [1] 106.81869  72.74852  75.74922  66.79251  72.98754  69.99012  69.43154
 [8]  69.95680  70.74274  72.00960        NA  69.58842  70.47207  68.87449
[15]  67.45574  72.60798  78.91706  71.34189  75.06321  71.86725
> colSums(tmp5)
 [1] 1068.1869  727.4852  757.4922  667.9251  729.8754  699.9012  694.3154
 [8]  699.5680  707.4274  720.0960        NA  695.8842  704.7207  688.7449
[15]  674.5574  726.0798  789.1706  713.4189  750.6321  718.6725
> colVars(tmp5)
 [1] 16381.27533   115.84043   115.68320    32.05610    94.71856    57.23280
 [7]    71.25012    84.46776    52.29158   106.12653          NA    94.80485
[13]    61.11463    60.66972    36.07068   100.66119   102.20051    97.52366
[19]    47.25436    47.81866
> colSd(tmp5)
 [1] 127.989356  10.762919  10.755613   5.661811   9.732346   7.565236
 [7]   8.440979   9.190634   7.231292  10.301773         NA   9.736778
[13]   7.817585   7.789077   6.005887  10.033005  10.109427   9.875407
[19]   6.874181   6.915104
> colMax(tmp5)
 [1] 470.33173  93.85778  93.23455  74.64059  90.20291  81.76553  83.21649
 [8]  89.45177  86.66739  88.96736        NA  86.43714  81.29764  85.59660
[15]  77.02330  93.51403  96.90558  84.13552  83.19286  83.37365
> colMin(tmp5)
 [1] 56.35896 57.42771 57.07559 55.68990 60.43875 59.57495 59.92130 54.34514
 [9] 59.92219 56.75085       NA 55.12690 59.07850 60.70188 57.05956 61.74244
[17] 63.60360 57.19676 63.90806 62.80895
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.3317
> Min(tmp5,na.rm=TRUE)
[1] 54.34514
> mean(tmp5,na.rm=TRUE)
[1] 73.17382
> Sum(tmp5,na.rm=TRUE)
[1] 14561.59
> Var(tmp5,na.rm=TRUE)
[1] 878.3024
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.70648 64.89897 74.31343 72.34120 74.36245 68.78674 69.74392 70.31538
 [9] 74.68412 71.66101
> rowSums(tmp5,na.rm=TRUE)
 [1] 1814.130 1297.979 1486.269 1446.824 1487.249 1375.735 1394.878 1406.308
 [9] 1418.998 1433.220
> rowVars(tmp5,na.rm=TRUE)
 [1] 8077.28899   39.97498  131.26810   87.99830   46.14378   91.31784
 [7]   61.36525   41.68569   49.74762   83.49571
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.873739  6.322577 11.457229  9.380741  6.792921  9.556037  7.833598
 [8]  6.456445  7.053199  9.137599
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.33173  80.97661  96.90558  93.51403  88.96736  86.19360  82.40398
 [8]  83.79051  83.21649  90.20291
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.34514 57.56659 59.85116 56.75085 63.60360 55.68990 56.94905 56.35896
 [9] 56.82609 55.12690
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 106.81869  72.74852  75.74922  66.79251  72.98754  69.99012  69.43154
 [8]  69.95680  70.74274  72.00960  69.71516  69.58842  70.47207  68.87449
[15]  67.45574  72.60798  78.91706  71.34189  75.06321  71.86725
> colSums(tmp5,na.rm=TRUE)
 [1] 1068.1869  727.4852  757.4922  667.9251  729.8754  699.9012  694.3154
 [8]  699.5680  707.4274  720.0960  627.4364  695.8842  704.7207  688.7449
[15]  674.5574  726.0798  789.1706  713.4189  750.6321  718.6725
> colVars(tmp5,na.rm=TRUE)
 [1] 16381.27533   115.84043   115.68320    32.05610    94.71856    57.23280
 [7]    71.25012    84.46776    52.29158   106.12653    77.36428    94.80485
[13]    61.11463    60.66972    36.07068   100.66119   102.20051    97.52366
[19]    47.25436    47.81866
> colSd(tmp5,na.rm=TRUE)
 [1] 127.989356  10.762919  10.755613   5.661811   9.732346   7.565236
 [7]   8.440979   9.190634   7.231292  10.301773   8.795697   9.736778
[13]   7.817585   7.789077   6.005887  10.033005  10.109427   9.875407
[19]   6.874181   6.915104
> colMax(tmp5,na.rm=TRUE)
 [1] 470.33173  93.85778  93.23455  74.64059  90.20291  81.76553  83.21649
 [8]  89.45177  86.66739  88.96736  77.73248  86.43714  81.29764  85.59660
[15]  77.02330  93.51403  96.90558  84.13552  83.19286  83.37365
> colMin(tmp5,na.rm=TRUE)
 [1] 56.35896 57.42771 57.07559 55.68990 60.43875 59.57495 59.92130 54.34514
 [9] 59.92219 56.75085 56.94905 55.12690 59.07850 60.70188 57.05956 61.74244
[17] 63.60360 57.19676 63.90806 62.80895
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.70648 64.89897 74.31343 72.34120 74.36245 68.78674 69.74392 70.31538
 [9]      NaN 71.66101
> rowSums(tmp5,na.rm=TRUE)
 [1] 1814.130 1297.979 1486.269 1446.824 1487.249 1375.735 1394.878 1406.308
 [9]    0.000 1433.220
> rowVars(tmp5,na.rm=TRUE)
 [1] 8077.28899   39.97498  131.26810   87.99830   46.14378   91.31784
 [7]   61.36525   41.68569         NA   83.49571
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.873739  6.322577 11.457229  9.380741  6.792921  9.556037  7.833598
 [8]  6.456445        NA  9.137599
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.33173  80.97661  96.90558  93.51403  88.96736  86.19360  82.40398
 [8]  83.79051        NA  90.20291
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.34514 57.56659 59.85116 56.75085 63.60360 55.68990 56.94905 56.35896
 [9]       NA 55.12690
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.37342  73.33981  74.95840  66.85680  72.11056  68.68174  67.89988
 [8]  70.26027  70.77709  71.82061       NaN  68.85338  69.26923  68.32766
[15]  66.90398  72.10065  78.85174  70.14618  75.50190  71.53955
> colSums(tmp5,na.rm=TRUE)
 [1] 1011.3608  660.0583  674.6256  601.7112  648.9950  618.1356  611.0989
 [8]  632.3424  636.9938  646.3855    0.0000  619.6804  623.4231  614.9489
[15]  602.1358  648.9058  709.6656  631.3156  679.5171  643.8559
> colVars(tmp5,na.rm=TRUE)
 [1] 18081.81529   126.38715   123.10782    36.01661    97.90600    45.12851
 [7]    53.76404    93.99019    58.81476   118.99054          NA   100.57729
[13]    52.47717    64.88938    37.15448   110.34828   114.92756    93.62986
[19]    50.99612    52.58788
> colSd(tmp5,na.rm=TRUE)
 [1] 134.468641  11.242204  11.095396   6.001384   9.894746   6.717776
 [7]   7.332396   9.694854   7.669078  10.908279         NA  10.028823
[13]   7.244113   8.055395   6.095447  10.504679  10.720427   9.676252
[19]   7.141157   7.251750
> colMax(tmp5,na.rm=TRUE)
 [1] 470.33173  93.85778  93.23455  74.64059  90.20291  77.44838  81.18191
 [8]  89.45177  86.66739  88.96736      -Inf  86.43714  79.18657  85.59660
[15]  77.02330  93.51403  96.90558  84.13552  83.19286  83.37365
> colMin(tmp5,na.rm=TRUE)
 [1] 56.35896 57.42771 57.07559 55.68990 60.43875 59.57495 59.92130 54.34514
 [9] 59.92219 56.75085      Inf 55.12690 59.07850 60.70188 57.05956 61.74244
[17] 63.60360 57.19676 63.90806 62.80895
> 
> 
> 
> 
> 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] 211.3115 123.8002 171.9029 212.4946 264.8060 286.9156 256.8722 243.1728
 [9] 248.4361 301.7943
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 211.3115 123.8002 171.9029 212.4946 264.8060 286.9156 256.8722 243.1728
 [9] 248.4361 301.7943
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.136868e-13 -1.136868e-13 -8.526513e-14  5.684342e-14 -1.136868e-13
 [6] -2.842171e-13 -2.842171e-14 -5.684342e-14  1.421085e-13 -5.684342e-14
[11]  0.000000e+00 -1.705303e-13 -2.842171e-13  7.105427e-14  0.000000e+00
[16]  1.136868e-13  1.421085e-13 -1.136868e-13  2.842171e-14  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   10 
9   18 
8   19 
1   6 
4   17 
8   9 
2   10 
5   5 
5   6 
3   20 
4   6 
8   16 
2   1 
5   13 
10   7 
4   7 
6   11 
10   9 
10   14 
2   5 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.090809
> Min(tmp)
[1] -2.482586
> mean(tmp)
[1] 0.03843123
> Sum(tmp)
[1] 3.843123
> Var(tmp)
[1] 1.211688
> 
> rowMeans(tmp)
[1] 0.03843123
> rowSums(tmp)
[1] 3.843123
> rowVars(tmp)
[1] 1.211688
> rowSd(tmp)
[1] 1.100767
> rowMax(tmp)
[1] 3.090809
> rowMin(tmp)
[1] -2.482586
> 
> colMeans(tmp)
  [1] -0.49412861  0.24748402  0.14093966  0.58150479 -0.14133062 -2.48258580
  [7]  0.16832961  0.44438180 -0.31472055  1.07852597  2.21581825 -0.41587200
 [13]  0.69130501  0.20796390  1.17712369 -1.07490664 -0.36828791  0.53595846
 [19] -0.87424471  0.39137374  0.06738095 -0.25723597 -1.54960090  1.26603884
 [25] -0.69686876  0.87704418 -1.45362098  1.91445906 -0.93232786 -0.79261253
 [31]  2.15581078 -1.44156350 -0.50443321  0.54564496  1.83358521 -1.61927592
 [37]  0.88558157  0.95278390 -0.50353949 -1.36836354 -0.86891834  0.60668381
 [43]  0.51484877  0.42807406  2.11985856  0.68323666  0.29883978 -0.10428322
 [49]  0.27943832  0.08708669  3.09080930  0.81236054 -0.53332627  0.07621748
 [55]  1.68290212  0.24487406 -1.61625634  0.08545443 -1.43977886  0.76697196
 [61]  0.40007073  1.41895271 -1.40520944  1.36690420 -0.66729950 -0.26058400
 [67] -0.47460554  0.05345401  0.48493496 -0.60938687  1.23074683 -0.83418561
 [73]  1.12162230 -2.30505337  0.14889137 -0.86521774 -1.54844224  0.54253910
 [79] -0.68873821 -1.81285432  0.84625512 -0.47917007 -1.92886529 -0.81122002
 [85] -0.73681151  0.15606235  0.40906336  3.05388527 -0.18067377  0.72625835
 [91]  1.34738722 -0.71519102  0.47008241  0.59442385 -0.44641672 -0.49332505
 [97] -0.59034417 -0.42210185 -1.67030782  1.10898107
> colSums(tmp)
  [1] -0.49412861  0.24748402  0.14093966  0.58150479 -0.14133062 -2.48258580
  [7]  0.16832961  0.44438180 -0.31472055  1.07852597  2.21581825 -0.41587200
 [13]  0.69130501  0.20796390  1.17712369 -1.07490664 -0.36828791  0.53595846
 [19] -0.87424471  0.39137374  0.06738095 -0.25723597 -1.54960090  1.26603884
 [25] -0.69686876  0.87704418 -1.45362098  1.91445906 -0.93232786 -0.79261253
 [31]  2.15581078 -1.44156350 -0.50443321  0.54564496  1.83358521 -1.61927592
 [37]  0.88558157  0.95278390 -0.50353949 -1.36836354 -0.86891834  0.60668381
 [43]  0.51484877  0.42807406  2.11985856  0.68323666  0.29883978 -0.10428322
 [49]  0.27943832  0.08708669  3.09080930  0.81236054 -0.53332627  0.07621748
 [55]  1.68290212  0.24487406 -1.61625634  0.08545443 -1.43977886  0.76697196
 [61]  0.40007073  1.41895271 -1.40520944  1.36690420 -0.66729950 -0.26058400
 [67] -0.47460554  0.05345401  0.48493496 -0.60938687  1.23074683 -0.83418561
 [73]  1.12162230 -2.30505337  0.14889137 -0.86521774 -1.54844224  0.54253910
 [79] -0.68873821 -1.81285432  0.84625512 -0.47917007 -1.92886529 -0.81122002
 [85] -0.73681151  0.15606235  0.40906336  3.05388527 -0.18067377  0.72625835
 [91]  1.34738722 -0.71519102  0.47008241  0.59442385 -0.44641672 -0.49332505
 [97] -0.59034417 -0.42210185 -1.67030782  1.10898107
> 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.49412861  0.24748402  0.14093966  0.58150479 -0.14133062 -2.48258580
  [7]  0.16832961  0.44438180 -0.31472055  1.07852597  2.21581825 -0.41587200
 [13]  0.69130501  0.20796390  1.17712369 -1.07490664 -0.36828791  0.53595846
 [19] -0.87424471  0.39137374  0.06738095 -0.25723597 -1.54960090  1.26603884
 [25] -0.69686876  0.87704418 -1.45362098  1.91445906 -0.93232786 -0.79261253
 [31]  2.15581078 -1.44156350 -0.50443321  0.54564496  1.83358521 -1.61927592
 [37]  0.88558157  0.95278390 -0.50353949 -1.36836354 -0.86891834  0.60668381
 [43]  0.51484877  0.42807406  2.11985856  0.68323666  0.29883978 -0.10428322
 [49]  0.27943832  0.08708669  3.09080930  0.81236054 -0.53332627  0.07621748
 [55]  1.68290212  0.24487406 -1.61625634  0.08545443 -1.43977886  0.76697196
 [61]  0.40007073  1.41895271 -1.40520944  1.36690420 -0.66729950 -0.26058400
 [67] -0.47460554  0.05345401  0.48493496 -0.60938687  1.23074683 -0.83418561
 [73]  1.12162230 -2.30505337  0.14889137 -0.86521774 -1.54844224  0.54253910
 [79] -0.68873821 -1.81285432  0.84625512 -0.47917007 -1.92886529 -0.81122002
 [85] -0.73681151  0.15606235  0.40906336  3.05388527 -0.18067377  0.72625835
 [91]  1.34738722 -0.71519102  0.47008241  0.59442385 -0.44641672 -0.49332505
 [97] -0.59034417 -0.42210185 -1.67030782  1.10898107
> colMin(tmp)
  [1] -0.49412861  0.24748402  0.14093966  0.58150479 -0.14133062 -2.48258580
  [7]  0.16832961  0.44438180 -0.31472055  1.07852597  2.21581825 -0.41587200
 [13]  0.69130501  0.20796390  1.17712369 -1.07490664 -0.36828791  0.53595846
 [19] -0.87424471  0.39137374  0.06738095 -0.25723597 -1.54960090  1.26603884
 [25] -0.69686876  0.87704418 -1.45362098  1.91445906 -0.93232786 -0.79261253
 [31]  2.15581078 -1.44156350 -0.50443321  0.54564496  1.83358521 -1.61927592
 [37]  0.88558157  0.95278390 -0.50353949 -1.36836354 -0.86891834  0.60668381
 [43]  0.51484877  0.42807406  2.11985856  0.68323666  0.29883978 -0.10428322
 [49]  0.27943832  0.08708669  3.09080930  0.81236054 -0.53332627  0.07621748
 [55]  1.68290212  0.24487406 -1.61625634  0.08545443 -1.43977886  0.76697196
 [61]  0.40007073  1.41895271 -1.40520944  1.36690420 -0.66729950 -0.26058400
 [67] -0.47460554  0.05345401  0.48493496 -0.60938687  1.23074683 -0.83418561
 [73]  1.12162230 -2.30505337  0.14889137 -0.86521774 -1.54844224  0.54253910
 [79] -0.68873821 -1.81285432  0.84625512 -0.47917007 -1.92886529 -0.81122002
 [85] -0.73681151  0.15606235  0.40906336  3.05388527 -0.18067377  0.72625835
 [91]  1.34738722 -0.71519102  0.47008241  0.59442385 -0.44641672 -0.49332505
 [97] -0.59034417 -0.42210185 -1.67030782  1.10898107
> colMedians(tmp)
  [1] -0.49412861  0.24748402  0.14093966  0.58150479 -0.14133062 -2.48258580
  [7]  0.16832961  0.44438180 -0.31472055  1.07852597  2.21581825 -0.41587200
 [13]  0.69130501  0.20796390  1.17712369 -1.07490664 -0.36828791  0.53595846
 [19] -0.87424471  0.39137374  0.06738095 -0.25723597 -1.54960090  1.26603884
 [25] -0.69686876  0.87704418 -1.45362098  1.91445906 -0.93232786 -0.79261253
 [31]  2.15581078 -1.44156350 -0.50443321  0.54564496  1.83358521 -1.61927592
 [37]  0.88558157  0.95278390 -0.50353949 -1.36836354 -0.86891834  0.60668381
 [43]  0.51484877  0.42807406  2.11985856  0.68323666  0.29883978 -0.10428322
 [49]  0.27943832  0.08708669  3.09080930  0.81236054 -0.53332627  0.07621748
 [55]  1.68290212  0.24487406 -1.61625634  0.08545443 -1.43977886  0.76697196
 [61]  0.40007073  1.41895271 -1.40520944  1.36690420 -0.66729950 -0.26058400
 [67] -0.47460554  0.05345401  0.48493496 -0.60938687  1.23074683 -0.83418561
 [73]  1.12162230 -2.30505337  0.14889137 -0.86521774 -1.54844224  0.54253910
 [79] -0.68873821 -1.81285432  0.84625512 -0.47917007 -1.92886529 -0.81122002
 [85] -0.73681151  0.15606235  0.40906336  3.05388527 -0.18067377  0.72625835
 [91]  1.34738722 -0.71519102  0.47008241  0.59442385 -0.44641672 -0.49332505
 [97] -0.59034417 -0.42210185 -1.67030782  1.10898107
> colRanges(tmp)
           [,1]     [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
[1,] -0.4941286 0.247484 0.1409397 0.5815048 -0.1413306 -2.482586 0.1683296
[2,] -0.4941286 0.247484 0.1409397 0.5815048 -0.1413306 -2.482586 0.1683296
          [,8]       [,9]    [,10]    [,11]     [,12]    [,13]     [,14]
[1,] 0.4443818 -0.3147206 1.078526 2.215818 -0.415872 0.691305 0.2079639
[2,] 0.4443818 -0.3147206 1.078526 2.215818 -0.415872 0.691305 0.2079639
        [,15]     [,16]      [,17]     [,18]      [,19]     [,20]      [,21]
[1,] 1.177124 -1.074907 -0.3682879 0.5359585 -0.8742447 0.3913737 0.06738095
[2,] 1.177124 -1.074907 -0.3682879 0.5359585 -0.8742447 0.3913737 0.06738095
         [,22]     [,23]    [,24]      [,25]     [,26]     [,27]    [,28]
[1,] -0.257236 -1.549601 1.266039 -0.6968688 0.8770442 -1.453621 1.914459
[2,] -0.257236 -1.549601 1.266039 -0.6968688 0.8770442 -1.453621 1.914459
          [,29]      [,30]    [,31]     [,32]      [,33]    [,34]    [,35]
[1,] -0.9323279 -0.7926125 2.155811 -1.441563 -0.5044332 0.545645 1.833585
[2,] -0.9323279 -0.7926125 2.155811 -1.441563 -0.5044332 0.545645 1.833585
         [,36]     [,37]     [,38]      [,39]     [,40]      [,41]     [,42]
[1,] -1.619276 0.8855816 0.9527839 -0.5035395 -1.368364 -0.8689183 0.6066838
[2,] -1.619276 0.8855816 0.9527839 -0.5035395 -1.368364 -0.8689183 0.6066838
         [,43]     [,44]    [,45]     [,46]     [,47]      [,48]     [,49]
[1,] 0.5148488 0.4280741 2.119859 0.6832367 0.2988398 -0.1042832 0.2794383
[2,] 0.5148488 0.4280741 2.119859 0.6832367 0.2988398 -0.1042832 0.2794383
          [,50]    [,51]     [,52]      [,53]      [,54]    [,55]     [,56]
[1,] 0.08708669 3.090809 0.8123605 -0.5333263 0.07621748 1.682902 0.2448741
[2,] 0.08708669 3.090809 0.8123605 -0.5333263 0.07621748 1.682902 0.2448741
         [,57]      [,58]     [,59]    [,60]     [,61]    [,62]     [,63]
[1,] -1.616256 0.08545443 -1.439779 0.766972 0.4000707 1.418953 -1.405209
[2,] -1.616256 0.08545443 -1.439779 0.766972 0.4000707 1.418953 -1.405209
        [,64]      [,65]     [,66]      [,67]      [,68]    [,69]      [,70]
[1,] 1.366904 -0.6672995 -0.260584 -0.4746055 0.05345401 0.484935 -0.6093869
[2,] 1.366904 -0.6672995 -0.260584 -0.4746055 0.05345401 0.484935 -0.6093869
        [,71]      [,72]    [,73]     [,74]     [,75]      [,76]     [,77]
[1,] 1.230747 -0.8341856 1.121622 -2.305053 0.1488914 -0.8652177 -1.548442
[2,] 1.230747 -0.8341856 1.121622 -2.305053 0.1488914 -0.8652177 -1.548442
         [,78]      [,79]     [,80]     [,81]      [,82]     [,83]    [,84]
[1,] 0.5425391 -0.6887382 -1.812854 0.8462551 -0.4791701 -1.928865 -0.81122
[2,] 0.5425391 -0.6887382 -1.812854 0.8462551 -0.4791701 -1.928865 -0.81122
          [,85]     [,86]     [,87]    [,88]      [,89]     [,90]    [,91]
[1,] -0.7368115 0.1560623 0.4090634 3.053885 -0.1806738 0.7262583 1.347387
[2,] -0.7368115 0.1560623 0.4090634 3.053885 -0.1806738 0.7262583 1.347387
         [,92]     [,93]     [,94]      [,95]     [,96]      [,97]      [,98]
[1,] -0.715191 0.4700824 0.5944238 -0.4464167 -0.493325 -0.5903442 -0.4221019
[2,] -0.715191 0.4700824 0.5944238 -0.4464167 -0.493325 -0.5903442 -0.4221019
         [,99]   [,100]
[1,] -1.670308 1.108981
[2,] -1.670308 1.108981
> 
> 
> Max(tmp2)
[1] 2.181814
> Min(tmp2)
[1] -2.389006
> mean(tmp2)
[1] -0.01096015
> Sum(tmp2)
[1] -1.096015
> Var(tmp2)
[1] 0.7987797
> 
> rowMeans(tmp2)
  [1]  1.011842394 -0.166580299 -1.209642578  0.829452691  0.908195943
  [6] -0.203066834  0.386737075  1.177306453  0.262346898 -1.010935923
 [11] -0.719062086  0.255633801  1.043931048  1.036695437 -0.442503657
 [16]  1.039784114  0.351187279  0.877674563 -0.671032133 -0.674538144
 [21]  0.277149532 -1.441589750 -0.465346108 -0.881642022 -0.578278722
 [26]  0.083060029  1.133884285 -0.125224156 -0.373792677  0.131456115
 [31] -0.247740838 -1.329482547  0.072707865  1.886827430  1.276725828
 [36] -0.284395216 -0.633543313 -0.686674327  1.082563906 -1.046171052
 [41] -0.950912408  0.266643756  0.229480062 -1.221757425 -1.111158831
 [46]  0.943510377 -0.899801530  0.209387499  1.988691028  1.187531618
 [51] -2.389006287 -0.180126338  0.760025400  0.063715285  0.043828724
 [56]  1.460213826  0.529116431 -0.219779656  0.195470092  0.183831233
 [61]  0.716516690 -1.101979950 -0.474867761 -0.420562293  1.115571659
 [66] -0.865505308  0.460654064  0.131481552  0.110821608  0.410148223
 [71] -0.754584948  0.419157182 -1.106902355  0.375001990  0.068778172
 [76]  0.034147553  0.337130794  0.085084575  0.530883510 -1.106928482
 [81] -0.730536106  2.181814479 -1.797945783 -1.285155813 -0.238240846
 [86]  0.934572359  0.137874328 -0.904100072  0.735283076 -0.015541200
 [91] -1.601361796  0.007601725  1.046324146  0.787004143  0.537830325
 [96] -0.613851139 -0.380481508  0.740120291 -2.264811500 -0.359283743
> rowSums(tmp2)
  [1]  1.011842394 -0.166580299 -1.209642578  0.829452691  0.908195943
  [6] -0.203066834  0.386737075  1.177306453  0.262346898 -1.010935923
 [11] -0.719062086  0.255633801  1.043931048  1.036695437 -0.442503657
 [16]  1.039784114  0.351187279  0.877674563 -0.671032133 -0.674538144
 [21]  0.277149532 -1.441589750 -0.465346108 -0.881642022 -0.578278722
 [26]  0.083060029  1.133884285 -0.125224156 -0.373792677  0.131456115
 [31] -0.247740838 -1.329482547  0.072707865  1.886827430  1.276725828
 [36] -0.284395216 -0.633543313 -0.686674327  1.082563906 -1.046171052
 [41] -0.950912408  0.266643756  0.229480062 -1.221757425 -1.111158831
 [46]  0.943510377 -0.899801530  0.209387499  1.988691028  1.187531618
 [51] -2.389006287 -0.180126338  0.760025400  0.063715285  0.043828724
 [56]  1.460213826  0.529116431 -0.219779656  0.195470092  0.183831233
 [61]  0.716516690 -1.101979950 -0.474867761 -0.420562293  1.115571659
 [66] -0.865505308  0.460654064  0.131481552  0.110821608  0.410148223
 [71] -0.754584948  0.419157182 -1.106902355  0.375001990  0.068778172
 [76]  0.034147553  0.337130794  0.085084575  0.530883510 -1.106928482
 [81] -0.730536106  2.181814479 -1.797945783 -1.285155813 -0.238240846
 [86]  0.934572359  0.137874328 -0.904100072  0.735283076 -0.015541200
 [91] -1.601361796  0.007601725  1.046324146  0.787004143  0.537830325
 [96] -0.613851139 -0.380481508  0.740120291 -2.264811500 -0.359283743
> 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.011842394 -0.166580299 -1.209642578  0.829452691  0.908195943
  [6] -0.203066834  0.386737075  1.177306453  0.262346898 -1.010935923
 [11] -0.719062086  0.255633801  1.043931048  1.036695437 -0.442503657
 [16]  1.039784114  0.351187279  0.877674563 -0.671032133 -0.674538144
 [21]  0.277149532 -1.441589750 -0.465346108 -0.881642022 -0.578278722
 [26]  0.083060029  1.133884285 -0.125224156 -0.373792677  0.131456115
 [31] -0.247740838 -1.329482547  0.072707865  1.886827430  1.276725828
 [36] -0.284395216 -0.633543313 -0.686674327  1.082563906 -1.046171052
 [41] -0.950912408  0.266643756  0.229480062 -1.221757425 -1.111158831
 [46]  0.943510377 -0.899801530  0.209387499  1.988691028  1.187531618
 [51] -2.389006287 -0.180126338  0.760025400  0.063715285  0.043828724
 [56]  1.460213826  0.529116431 -0.219779656  0.195470092  0.183831233
 [61]  0.716516690 -1.101979950 -0.474867761 -0.420562293  1.115571659
 [66] -0.865505308  0.460654064  0.131481552  0.110821608  0.410148223
 [71] -0.754584948  0.419157182 -1.106902355  0.375001990  0.068778172
 [76]  0.034147553  0.337130794  0.085084575  0.530883510 -1.106928482
 [81] -0.730536106  2.181814479 -1.797945783 -1.285155813 -0.238240846
 [86]  0.934572359  0.137874328 -0.904100072  0.735283076 -0.015541200
 [91] -1.601361796  0.007601725  1.046324146  0.787004143  0.537830325
 [96] -0.613851139 -0.380481508  0.740120291 -2.264811500 -0.359283743
> rowMin(tmp2)
  [1]  1.011842394 -0.166580299 -1.209642578  0.829452691  0.908195943
  [6] -0.203066834  0.386737075  1.177306453  0.262346898 -1.010935923
 [11] -0.719062086  0.255633801  1.043931048  1.036695437 -0.442503657
 [16]  1.039784114  0.351187279  0.877674563 -0.671032133 -0.674538144
 [21]  0.277149532 -1.441589750 -0.465346108 -0.881642022 -0.578278722
 [26]  0.083060029  1.133884285 -0.125224156 -0.373792677  0.131456115
 [31] -0.247740838 -1.329482547  0.072707865  1.886827430  1.276725828
 [36] -0.284395216 -0.633543313 -0.686674327  1.082563906 -1.046171052
 [41] -0.950912408  0.266643756  0.229480062 -1.221757425 -1.111158831
 [46]  0.943510377 -0.899801530  0.209387499  1.988691028  1.187531618
 [51] -2.389006287 -0.180126338  0.760025400  0.063715285  0.043828724
 [56]  1.460213826  0.529116431 -0.219779656  0.195470092  0.183831233
 [61]  0.716516690 -1.101979950 -0.474867761 -0.420562293  1.115571659
 [66] -0.865505308  0.460654064  0.131481552  0.110821608  0.410148223
 [71] -0.754584948  0.419157182 -1.106902355  0.375001990  0.068778172
 [76]  0.034147553  0.337130794  0.085084575  0.530883510 -1.106928482
 [81] -0.730536106  2.181814479 -1.797945783 -1.285155813 -0.238240846
 [86]  0.934572359  0.137874328 -0.904100072  0.735283076 -0.015541200
 [91] -1.601361796  0.007601725  1.046324146  0.787004143  0.537830325
 [96] -0.613851139 -0.380481508  0.740120291 -2.264811500 -0.359283743
> 
> colMeans(tmp2)
[1] -0.01096015
> colSums(tmp2)
[1] -1.096015
> colVars(tmp2)
[1] 0.7987797
> colSd(tmp2)
[1] 0.8937448
> colMax(tmp2)
[1] 2.181814
> colMin(tmp2)
[1] -2.389006
> colMedians(tmp2)
[1] 0.07074302
> colRanges(tmp2)
          [,1]
[1,] -2.389006
[2,]  2.181814
> 
> 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]  1.61806852 -2.15992008  4.28271010 -3.20894664 -0.93853810 -0.09289747
 [7]  1.72165999 -2.40189783 -0.59367581 -4.10815377
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5263277
[2,] -0.4225444
[3,]  0.1289817
[4,]  0.5106540
[5,]  1.7634262
> 
> rowApply(tmp,sum)
 [1]  1.0844374  1.6477053 -4.8339105  0.1830263 -0.3761082 -1.8174864
 [7] -0.4087531  1.7740992 -1.6140341 -1.5205668
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    3    6    5    7    6    9    6    7     5
 [2,]   10    6    2    9    3    7    2    3    3     3
 [3,]    5   10    4    8    9    4    7    5    8     4
 [4,]    3    4    3    2    4    8    6    1    6     8
 [5,]    8    7    5    3    6    2    3    4   10     6
 [6,]    1    8   10   10    5    3    4    7    5     1
 [7,]    2    5    9    7    1    5   10    2    9     9
 [8,]    4    9    8    4    8    1    1    9    2    10
 [9,]    9    1    1    1   10    9    8    8    4     7
[10,]    6    2    7    6    2   10    5   10    1     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.4127884 -0.8928357  4.0961131 -4.4472879 -0.4928791 -1.4331696
 [7]  0.4255963  0.2183235  0.2554718  1.9340113 -0.8939587  0.6504861
[13] -0.1737329  0.9872431  2.0548520  1.7072712  2.4829502  1.0464814
[19] -2.3940764  0.1259750
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.3109004
[2,] -0.4937554
[3,]  0.6301298
[4,]  0.9503460
[5,]  1.6369685
> 
> rowApply(tmp,sum)
[1] -0.5469078  2.1344661  2.2536975  2.1422820  0.6860855
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   19   20    4   16    1
[2,]    4    5   15    5   12
[3,]   20    8   12   18   19
[4,]    2    6    1    1   13
[5,]    9   16    8   10    2
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]        [,5]       [,6]
[1,]  0.9503460 -0.5761894  1.42121071 -1.2358855 -0.15601965 -0.5493655
[2,]  1.6369685 -0.5796094 -0.04431254 -0.5431384  0.76239887  0.3786448
[3,] -0.4937554  0.5083862  0.21236283 -1.0445171 -0.13273129 -0.2215050
[4,]  0.6301298 -0.4759102  1.26847046 -1.9600756  0.04088395 -0.3766158
[5,] -1.3109004  0.2304871  1.23838169  0.3363286 -1.00741099 -0.6643281
           [,7]        [,8]       [,9]       [,10]       [,11]      [,12]
[1,] -0.3851249  0.72158222  0.6047478  0.62999063  0.01822904  0.8166909
[2,]  0.1675703 -1.95172125 -0.4738548  1.48694062  0.38572213 -1.1509658
[3,]  0.5177857 -0.91840237 -0.0786752  0.01422775 -0.01702060  0.7888168
[4,]  0.3025434  0.02224565 -0.6162845 -0.74137398 -0.39650076  1.0040717
[5,] -0.1771782  2.34461929  0.8195384  0.54422631 -0.88438853 -0.8081275
           [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,] -1.50623451 -0.1199944 -0.2143004  0.1190664 -0.1680474  0.03237575
[2,] -0.61189691  1.5523943  1.0911735  0.3660736  0.1249065  0.10954552
[3,]  1.72620298 -0.2633423  0.4024103  1.4980781  0.7098482  0.42053510
[4,]  0.03158706  0.2654324  0.1816167  0.5214824  1.4650890 -0.70345211
[5,]  0.18660849 -0.4472469  0.5939519 -0.7974292  0.3511539  1.18747710
          [,19]      [,20]
[1,] -1.2281873  0.2782017
[2,] -0.7354838  0.1631104
[3,] -0.4887869 -0.8862203
[4,]  0.3333428  1.3455996
[5,] -0.2749611 -0.7747165
> 
> 
> 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 :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  565  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2      col3      col4       col5      col6       col7
row1 0.6969207 0.1834209 0.8168111 -2.545656 -0.8607023 0.7060815 -0.2744488
           col8      col9       col10     col11      col12      col13
row1 -0.8041147 0.7623139 -0.02663097 0.7181733 -0.1138912 -0.4688809
          col14     col15      col16     col17     col18      col19     col20
row1 0.05655163 -2.094748 -0.6317276 0.1927797 -1.062717 -0.3848136 0.9860062
> tmp[,"col10"]
            col10
row1 -0.026630968
row2  1.448709621
row3 -1.496975015
row4 -0.008533216
row5  0.274619511
> tmp[c("row1","row5"),]
          col1       col2      col3       col4        col5       col6
row1 0.6969207  0.1834209 0.8168111 -2.5456563 -0.86070235  0.7060815
row5 0.4892857 -0.7584824 1.7651608  0.1233968 -0.05888677 -0.5448192
           col7       col8      col9       col10     col11      col12
row1 -0.2744488 -0.8041147 0.7623139 -0.02663097 0.7181733 -0.1138912
row5 -0.1058808 -1.1566698 0.3319794  0.27461951 1.2977851  0.5492686
          col13      col14     col15      col16       col17      col18
row1 -0.4688809 0.05655163 -2.094748 -0.6317276  0.19277966 -1.0627166
row5 -1.2271300 0.60424253 -0.293824  0.3951931 -0.04954332 -0.2028682
          col19     col20
row1 -0.3848136 0.9860062
row5  0.9460678 0.2628344
> tmp[,c("col6","col20")]
           col6      col20
row1  0.7060815  0.9860062
row2 -0.7614850  0.1924748
row3  0.8519445  0.7319534
row4  0.7471846 -0.4384606
row5 -0.5448192  0.2628344
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  0.7060815 0.9860062
row5 -0.5448192 0.2628344
> 
> 
> 
> 
> 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.42786 49.14767 49.87624 48.99464 49.67336 103.746 51.19965 48.33965
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.94162 48.96364 51.01245 50.09549 50.63913 51.40998 51.10866 50.79454
        col17    col18    col19    col20
row1 49.63268 49.56348 50.13524 103.9906
> tmp[,"col10"]
        col10
row1 48.96364
row2 30.98485
row3 29.87200
row4 31.74286
row5 51.26749
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.42786 49.14767 49.87624 48.99464 49.67336 103.7460 51.19965 48.33965
row5 49.15007 48.39580 49.73945 51.03383 48.75641 107.3702 50.06111 50.40000
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.94162 48.96364 51.01245 50.09549 50.63913 51.40998 51.10866 50.79454
row5 51.59192 51.26749 50.50043 50.40659 50.29593 47.66888 49.84790 48.19723
        col17    col18    col19    col20
row1 49.63268 49.56348 50.13524 103.9906
row5 48.22826 48.60405 50.24226 106.3753
> tmp[,c("col6","col20")]
          col6     col20
row1 103.74603 103.99060
row2  76.70236  74.86099
row3  75.99194  75.69198
row4  74.89374  75.30958
row5 107.37021 106.37528
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.7460 103.9906
row5 107.3702 106.3753
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.7460 103.9906
row5 107.3702 106.3753
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.6032554
[2,]  0.9850313
[3,]  0.4087550
[4,] -1.2158720
[5,]  0.6862927
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.4952497 -1.8635528
[2,]  1.2858811  0.9987329
[3,]  0.9410338 -0.8586085
[4,] -0.1484563  1.4114435
[5,]  0.5607907  1.1893616
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
             col6      col20
[1,] -0.735161129 -0.3574740
[2,]  0.638769629 -0.5615112
[3,]  0.001469545 -0.3935794
[4,]  0.250108506  1.0890504
[5,]  0.536552368  0.1593953
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.7351611
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.7351611
[2,]  0.6387696
> 
> 
> 
> 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.2642721 -1.5912748  1.6931867 1.395863  0.6670674 -1.103109 0.1758874
row1 -0.2662225 -0.8597355 -0.7817941 1.011905 -0.3997715 -1.059017 1.2944528
            [,8]       [,9]      [,10]      [,11]     [,12]      [,13]
row3 -0.01515421  0.9957019 -0.1216228 -0.6641233 0.8885168 -0.9816116
row1 -0.69304153 -0.8268653 -0.7872625  0.1105319 0.9124232  0.9090630
         [,14]       [,15]    [,16]      [,17]     [,18]     [,19]      [,20]
row3 0.6228874 -0.05111966 1.380188 -0.1386411 0.6085929 2.0007851 -1.4042637
row1 0.2958188  0.87165868 1.316041 -0.4473792 1.2253318 0.4420264 -0.4618204
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]       [,4]      [,5]      [,6]     [,7]
row2 0.9641401 -0.5597776 -0.4141481 -0.8469201 -1.121188 0.1441316 1.674229
         [,8]       [,9]     [,10]
row2 0.216762 -0.4617245 -2.038301
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]    [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
row5 0.2231146 1.68062 -0.5107243 -0.1428438 0.07932617 -0.2253256 -1.235242
           [,8]       [,9]    [,10]      [,11]    [,12]    [,13]     [,14]
row5 -0.8025582 -0.1233587 1.605043 -0.9478398 1.058464 1.221787 -1.110924
          [,15]     [,16]     [,17]     [,18]      [,19]       [,20]
row5 -0.2248137 0.1752184 0.1686501 0.1455692 -0.7182492 0.004616957
> 
> 
> 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: 0x2c4889e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b27663ce27b"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b2742c42aae"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b2793b551c" 
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b272b1682c1"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b2749c15b28"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b274ec2fccc"
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b274de7bcf1"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b27786e8e9b"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b27717be2ca"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b2719d6f492"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b275be1fbf8"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b271aa7fdc5"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b2764763989"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b276922388b"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM320b27a5e87e"  
> 
> 
> ### 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: 0x2a299930>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x2a299930>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x2a299930>
> rowMedians(tmp)
  [1] -0.421673882 -0.118907951 -0.104974699  0.114277671  0.339295111
  [6] -0.497108562  1.085850759  0.239396956 -0.355611795  0.264694180
 [11] -0.098584419  0.059349600 -0.804036827  0.324893738 -0.009751276
 [16]  0.125152916 -0.115436653  0.472211066 -0.415691609 -0.255260284
 [21]  0.192205135  0.090514799  0.087428465 -0.223296866 -0.153691811
 [26] -0.109130644 -0.178561629 -0.366151440 -0.783148898  0.136746267
 [31]  0.283877127  0.328961044  0.265691983 -0.134411512 -0.100633951
 [36]  0.215733487  0.090721742 -0.099207735 -0.249818058 -0.136386751
 [41]  0.681412149  0.089031011  0.048392943  0.231001815 -0.155325375
 [46] -0.251116787  0.069645432  0.353666184  0.281133280  0.360222581
 [51]  0.495666280 -0.252513355 -0.117164090 -0.237124187  0.106204329
 [56]  0.092575116 -0.204259517 -0.227095747 -0.102999553 -0.302487090
 [61] -0.012331086 -0.311325925 -0.118177880 -0.085207398  0.141908180
 [66]  0.455540971 -0.440410528 -0.411127423  0.156833350  0.084649427
 [71]  0.020740335  0.217079450 -0.635704878  0.342570045  0.060883505
 [76] -0.078824909  0.041852447  0.080567667 -0.091044168 -0.191016711
 [81] -0.166975188 -0.135466814  0.022758301  0.201390551 -0.155694196
 [86] -0.134663069  0.586894491 -0.101766619 -0.159721314  0.260444051
 [91] -0.220993949 -0.238429637 -0.090571663 -0.172615651 -0.245263161
 [96]  0.074294011 -0.028761330 -0.050055161 -0.407922614  0.034343544
[101]  0.060162914 -0.056878404  0.662640714 -0.462294939  0.078826975
[106]  0.695047370  0.057179473 -0.112058841  0.229329435  0.366666354
[111] -0.006413997  0.082151018 -0.134493760 -0.060811191  0.485138914
[116] -0.241875683 -0.141787654  0.362155462  0.546901647  0.056357329
[121] -0.271712403 -0.351660243  1.091761932  0.068941118  0.430736445
[126]  0.354860816  0.171629477  0.548858099 -0.457118358 -0.378078189
[131] -0.185382025 -0.346842695  0.170810655 -0.413315231  0.054558326
[136] -0.137733050 -0.315631619 -0.220597165  0.411964807 -0.057212805
[141]  0.143863033  0.137116428  0.497996879  0.192430106 -0.081293541
[146]  0.535598332 -0.292886864 -0.562212345 -0.357148210  0.085820773
[151]  0.080923593 -0.004740912  0.647582490  0.112347350  0.006171088
[156]  0.384039121  0.012493870  0.022372898 -0.019738295 -0.096036389
[161]  0.292719626  0.346743590 -0.300072125 -0.013374756  0.051690099
[166]  0.152133902  0.185501645 -0.112923960 -0.342310646 -0.114370681
[171] -0.211661021  0.544972409  0.187537565 -0.257745453 -0.326486501
[176] -0.061182184  0.140795180  0.315877812 -0.046935768  0.081157971
[181] -0.437762575 -0.230698615  0.217864816 -0.232422875  0.115960662
[186]  0.167482907 -0.120483193 -0.081156574 -0.351072144 -0.163374910
[191] -0.001066937 -0.162818571  0.410979047 -0.626104719 -0.215011302
[196]  0.297023026 -0.151859681 -0.774031597 -0.164740940  0.170858916
[201] -0.196199445  0.022983797 -0.276367138 -0.232941178  0.363477055
[206] -0.478473126 -0.180522747  0.033830041  0.098956307 -0.396087211
[211] -0.012371742  0.205024632  0.154165848 -0.203670837 -0.046687047
[216]  0.590673154 -0.058176967  0.386556013  0.220112450  0.075522895
[221] -0.725075651 -0.158411687  0.242997564  0.246559056 -0.081737922
[226]  0.829656945 -0.175319454 -0.278364800  0.496169869  0.233889868
> 
> proc.time()
   user  system elapsed 
  1.754   0.887   2.667 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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: 0x2a4c1ff0>
> .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: 0x2a4c1ff0>
> .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: 0x2a4c1ff0>
> .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: 0x2a4c1ff0>
> 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: 0x2a3a70e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2a3a70e0>
> .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: 0x2a3a70e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2a3a70e0>
> .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: 0x2a3a70e0>
> 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: 0x2932e520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2932e520>
> .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: 0x2932e520>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2932e520>
> .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: 0x2932e520>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x2932e520>
> .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: 0x2932e520>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x2932e520>
> .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: 0x2932e520>
> 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: 0x28d32720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x28d32720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x28d32720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x28d32720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile320b491024402c" "BufferedMatrixFile320b49d9f624b" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile320b491024402c" "BufferedMatrixFile320b49d9f624b" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x29c227d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x29c227d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x29c227d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x29c227d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x29c227d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x29c227d0>
> .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: 0x29d29c90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x29d29c90>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x29d29c90>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x29d29c90>
> 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: 0x2afd2110>
> .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: 0x2afd2110>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.332   0.034   0.351 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.346   0.041   0.371 

Example timings