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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.3 LTS)x86_64R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" 4818
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

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


CHECK results for BufferedMatrix on nebbiolo1

To the developers/maintainers of the BufferedMatrix package:
- Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information.
- Use the following Renviron settings to reproduce errors and warnings.
- If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information.

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-11-06 21:29:53 -0500 (Thu, 06 Nov 2025)
EndedAt: 2025-11-06 21:30:18 -0500 (Thu, 06 Nov 2025)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-10-20 r88955)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.242   0.052   0.282 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478818 25.6    1048392   56   639317 34.2
Vcells 885623  6.8    8388608   64  2082728 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov  6 21:30:08 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov  6 21:30:08 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5a6b8ff3f5e0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Nov  6 21:30:08 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Nov  6 21:30:09 2025"
> 
> ColMode(tmp2)
<pointer: 0x5a6b8ff3f5e0>
> 
> 
> 
> ### 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,] 101.19842130  1.9656180  0.2804712 -1.5054818
[2,]  -0.85211785 -1.6670182 -2.3831010 -0.2598899
[3,]   0.38996480 -0.9039762 -2.1044676  1.3041529
[4,]  -0.06574826 -2.5427235 -0.8815883 -0.6672668
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
             [,1]      [,2]      [,3]      [,4]
[1,] 101.19842130 1.9656180 0.2804712 1.5054818
[2,]   0.85211785 1.6670182 2.3831010 0.2598899
[3,]   0.38996480 0.9039762 2.1044676 1.3041529
[4,]   0.06574826 2.5427235 0.8815883 0.6672668
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]     [,4]
[1,] 10.0597426 1.4020050 0.5295953 1.226981
[2,]  0.9231023 1.2911306 1.5437296 0.509794
[3,]  0.6244716 0.9507767 1.4506783 1.141995
[4,]  0.2564142 1.5945920 0.9389293 0.816864
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.79585 40.98567 30.57642 38.77529
[2,]  35.08314 39.57832 42.82040 30.35783
[3,]  31.63468 35.41174 41.61125 37.72410
[4,]  27.62989 43.48864 35.27088 33.83591
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5a6b8faca840>
> exp(tmp5)
<pointer: 0x5a6b8faca840>
> log(tmp5,2)
<pointer: 0x5a6b8faca840>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.0458
> Min(tmp5)
[1] 53.33634
> mean(tmp5)
[1] 73.40133
> Sum(tmp5)
[1] 14680.27
> Var(tmp5)
[1] 876.4736
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.43153 74.31906 73.13453 70.57114 72.44366 68.92066 72.21396 70.95913
 [9] 68.22014 70.79945
> rowSums(tmp5)
 [1] 1848.631 1486.381 1462.691 1411.423 1448.873 1378.413 1444.279 1419.183
 [9] 1364.403 1415.989
> rowVars(tmp5)
 [1] 8063.70317   60.69213   71.42039   65.18901  114.02887  113.11030
 [7]   77.34381   46.45754   50.91516   61.20113
> rowSd(tmp5)
 [1] 89.798125  7.790515  8.451058  8.073971 10.678430 10.635333  8.794533
 [8]  6.815977  7.135486  7.823115
> rowMax(tmp5)
 [1] 472.04584  89.12505  89.45997  90.51591  90.14796  90.89639  85.11505
 [8]  82.24441  88.00765  84.17458
> rowMin(tmp5)
 [1] 55.09748 57.63615 56.07722 57.50800 54.39415 53.33634 55.07771 59.29439
 [9] 59.02306 57.77993
> 
> colMeans(tmp5)
 [1] 109.79233  80.19766  75.38124  67.48796  67.96997  73.23994  72.70456
 [8]  70.72687  72.22137  68.05200  74.79970  74.64123  72.23758  75.68219
[15]  71.15059  68.93408  66.07931  65.90168  70.23732  70.58893
> colSums(tmp5)
 [1] 1097.9233  801.9766  753.8124  674.8796  679.6997  732.3994  727.0456
 [8]  707.2687  722.2137  680.5200  747.9970  746.4123  722.3758  756.8219
[15]  711.5059  689.3408  660.7931  659.0168  702.3732  705.8893
> colVars(tmp5)
 [1] 16248.62800    38.11963    90.75111    60.00062   125.72747    50.56913
 [7]    34.98653    56.45815    78.95058    38.81602   143.12267    62.70541
[13]   122.26823    24.81738    92.51754    43.61821    15.27577   125.20314
[19]    57.97629    47.73423
> colSd(tmp5)
 [1] 127.470106   6.174110   9.526338   7.746007  11.212826   7.111198
 [7]   5.914942   7.513864   8.885414   6.230250  11.963389   7.918675
[13]  11.057497   4.981705   9.618604   6.604408   3.908422  11.189421
[19]   7.614217   6.908996
> colMax(tmp5)
 [1] 472.04584  90.51591  89.12505  80.70568  89.45997  84.59577  82.24441
 [8]  80.78677  84.17458  81.58963  90.14796  86.70422  87.86024  82.51301
[15]  90.89639  75.04715  71.61557  86.04481  77.03308  79.74335
> colMin(tmp5)
 [1] 57.50800 71.72404 63.07802 57.77993 55.09748 64.96003 62.57401 58.92131
 [9] 58.23380 61.42467 53.33634 63.88742 56.71180 68.34511 61.55976 56.09870
[17] 59.39199 53.40112 55.55256 57.63615
> 
> 
> ### 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] 92.43153 74.31906 73.13453 70.57114 72.44366 68.92066 72.21396       NA
 [9] 68.22014 70.79945
> rowSums(tmp5)
 [1] 1848.631 1486.381 1462.691 1411.423 1448.873 1378.413 1444.279       NA
 [9] 1364.403 1415.989
> rowVars(tmp5)
 [1] 8063.70317   60.69213   71.42039   65.18901  114.02887  113.11030
 [7]   77.34381   49.03467   50.91516   61.20113
> rowSd(tmp5)
 [1] 89.798125  7.790515  8.451058  8.073971 10.678430 10.635333  8.794533
 [8]  7.002476  7.135486  7.823115
> rowMax(tmp5)
 [1] 472.04584  89.12505  89.45997  90.51591  90.14796  90.89639  85.11505
 [8]        NA  88.00765  84.17458
> rowMin(tmp5)
 [1] 55.09748 57.63615 56.07722 57.50800 54.39415 53.33634 55.07771       NA
 [9] 59.02306 57.77993
> 
> colMeans(tmp5)
 [1] 109.79233  80.19766  75.38124        NA  67.96997  73.23994  72.70456
 [8]  70.72687  72.22137  68.05200  74.79970  74.64123  72.23758  75.68219
[15]  71.15059  68.93408  66.07931  65.90168  70.23732  70.58893
> colSums(tmp5)
 [1] 1097.9233  801.9766  753.8124        NA  679.6997  732.3994  727.0456
 [8]  707.2687  722.2137  680.5200  747.9970  746.4123  722.3758  756.8219
[15]  711.5059  689.3408  660.7931  659.0168  702.3732  705.8893
> colVars(tmp5)
 [1] 16248.62800    38.11963    90.75111          NA   125.72747    50.56913
 [7]    34.98653    56.45815    78.95058    38.81602   143.12267    62.70541
[13]   122.26823    24.81738    92.51754    43.61821    15.27577   125.20314
[19]    57.97629    47.73423
> colSd(tmp5)
 [1] 127.470106   6.174110   9.526338         NA  11.212826   7.111198
 [7]   5.914942   7.513864   8.885414   6.230250  11.963389   7.918675
[13]  11.057497   4.981705   9.618604   6.604408   3.908422  11.189421
[19]   7.614217   6.908996
> colMax(tmp5)
 [1] 472.04584  90.51591  89.12505        NA  89.45997  84.59577  82.24441
 [8]  80.78677  84.17458  81.58963  90.14796  86.70422  87.86024  82.51301
[15]  90.89639  75.04715  71.61557  86.04481  77.03308  79.74335
> colMin(tmp5)
 [1] 57.50800 71.72404 63.07802       NA 55.09748 64.96003 62.57401 58.92131
 [9] 58.23380 61.42467 53.33634 63.88742 56.71180 68.34511 61.55976 56.09870
[17] 59.39199 53.40112 55.55256 57.63615
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.0458
> Min(tmp5,na.rm=TRUE)
[1] 53.33634
> mean(tmp5,na.rm=TRUE)
[1] 73.41231
> Sum(tmp5,na.rm=TRUE)
[1] 14609.05
> Var(tmp5,na.rm=TRUE)
[1] 880.876
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.43153 74.31906 73.13453 70.57114 72.44366 68.92066 72.21396 70.94565
 [9] 68.22014 70.79945
> rowSums(tmp5,na.rm=TRUE)
 [1] 1848.631 1486.381 1462.691 1411.423 1448.873 1378.413 1444.279 1347.967
 [9] 1364.403 1415.989
> rowVars(tmp5,na.rm=TRUE)
 [1] 8063.70317   60.69213   71.42039   65.18901  114.02887  113.11030
 [7]   77.34381   49.03467   50.91516   61.20113
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.798125  7.790515  8.451058  8.073971 10.678430 10.635333  8.794533
 [8]  7.002476  7.135486  7.823115
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.04584  89.12505  89.45997  90.51591  90.14796  90.89639  85.11505
 [8]  82.24441  88.00765  84.17458
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.09748 57.63615 56.07722 57.50800 54.39415 53.33634 55.07771 59.29439
 [9] 59.02306 57.77993
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.79233  80.19766  75.38124  67.07380  67.96997  73.23994  72.70456
 [8]  70.72687  72.22137  68.05200  74.79970  74.64123  72.23758  75.68219
[15]  71.15059  68.93408  66.07931  65.90168  70.23732  70.58893
> colSums(tmp5,na.rm=TRUE)
 [1] 1097.9233  801.9766  753.8124  603.6642  679.6997  732.3994  727.0456
 [8]  707.2687  722.2137  680.5200  747.9970  746.4123  722.3758  756.8219
[15]  711.5059  689.3408  660.7931  659.0168  702.3732  705.8893
> colVars(tmp5,na.rm=TRUE)
 [1] 16248.62800    38.11963    90.75111    65.57108   125.72747    50.56913
 [7]    34.98653    56.45815    78.95058    38.81602   143.12267    62.70541
[13]   122.26823    24.81738    92.51754    43.61821    15.27577   125.20314
[19]    57.97629    47.73423
> colSd(tmp5,na.rm=TRUE)
 [1] 127.470106   6.174110   9.526338   8.097597  11.212826   7.111198
 [7]   5.914942   7.513864   8.885414   6.230250  11.963389   7.918675
[13]  11.057497   4.981705   9.618604   6.604408   3.908422  11.189421
[19]   7.614217   6.908996
> colMax(tmp5,na.rm=TRUE)
 [1] 472.04584  90.51591  89.12505  80.70568  89.45997  84.59577  82.24441
 [8]  80.78677  84.17458  81.58963  90.14796  86.70422  87.86024  82.51301
[15]  90.89639  75.04715  71.61557  86.04481  77.03308  79.74335
> colMin(tmp5,na.rm=TRUE)
 [1] 57.50800 71.72404 63.07802 57.77993 55.09748 64.96003 62.57401 58.92131
 [9] 58.23380 61.42467 53.33634 63.88742 56.71180 68.34511 61.55976 56.09870
[17] 59.39199 53.40112 55.55256 57.63615
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.43153 74.31906 73.13453 70.57114 72.44366 68.92066 72.21396      NaN
 [9] 68.22014 70.79945
> rowSums(tmp5,na.rm=TRUE)
 [1] 1848.631 1486.381 1462.691 1411.423 1448.873 1378.413 1444.279    0.000
 [9] 1364.403 1415.989
> rowVars(tmp5,na.rm=TRUE)
 [1] 8063.70317   60.69213   71.42039   65.18901  114.02887  113.11030
 [7]   77.34381         NA   50.91516   61.20113
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.798125  7.790515  8.451058  8.073971 10.678430 10.635333  8.794533
 [8]        NA  7.135486  7.823115
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.04584  89.12505  89.45997  90.51591  90.14796  90.89639  85.11505
 [8]        NA  88.00765  84.17458
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.09748 57.63615 56.07722 57.50800 54.39415 53.33634 55.07771       NA
 [9] 59.02306 57.77993
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.34317  81.13918  75.12472       NaN  68.93393  73.31737  71.64457
 [8]  71.23951  71.25000  68.78837  74.71982  75.83609  72.79747  75.33268
[15]  71.93302  68.41365  65.76698  65.79775  69.58806  71.41346
> colSums(tmp5,na.rm=TRUE)
 [1] 1020.0885  730.2526  676.1225    0.0000  620.4053  659.8564  644.8012
 [8]  641.1556  641.2500  619.0953  672.4784  682.5248  655.1772  677.9941
[15]  647.3971  615.7229  591.9028  592.1798  626.2926  642.7211
> colVars(tmp5,na.rm=TRUE)
 [1] 18137.86134    32.91205   101.35472          NA   130.98981    56.82282
 [7]    26.71973    60.55890    78.20437    37.56782   160.94124    54.48188
[13]   134.02520    26.54527    97.19514    46.02348    16.08775   140.73203
[19]    60.48114    46.05279
> colSd(tmp5,na.rm=TRUE)
 [1] 134.676878   5.736902  10.067508         NA  11.445078   7.538091
 [7]   5.169113   7.781960   8.843324   6.129259  12.686262   7.381185
[13]  11.576925   5.152211   9.858759   6.784061   4.010954  11.863053
[19]   7.776962   6.786221
> colMax(tmp5,na.rm=TRUE)
 [1] 472.04584  90.51591  89.12505      -Inf  89.45997  84.59577  80.95151
 [8]  80.78677  84.17458  81.58963  90.14796  86.70422  87.86024  82.51301
[15]  90.89639  75.04715  71.61557  86.04481  77.03308  79.74335
> colMin(tmp5,na.rm=TRUE)
 [1] 57.50800 72.08210 63.07802      Inf 55.09748 64.96003 62.57401 58.92131
 [9] 58.23380 62.54678 53.33634 64.83818 56.71180 68.34511 61.55976 56.09870
[17] 59.39199 53.40112 55.55256 57.63615
> 
> 
> 
> 
> 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] 348.7376 264.9829 323.7880 249.1259 221.5876 186.2218 221.4015 257.0510
 [9] 121.1466 167.7848
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 348.7376 264.9829 323.7880 249.1259 221.5876 186.2218 221.4015 257.0510
 [9] 121.1466 167.7848
> 
> 
> 
> 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 -5.684342e-14  5.684342e-14  4.263256e-14 -5.684342e-14
 [6]  0.000000e+00 -2.842171e-14  1.136868e-13  2.842171e-14  0.000000e+00
[11]  1.136868e-13  5.684342e-14  1.705303e-13  5.684342e-14  8.526513e-14
[16]  5.684342e-14 -5.684342e-14  1.421085e-13 -2.842171e-13  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   2 
6   10 
5   20 
6   5 
3   14 
4   18 
3   9 
8   12 
10   8 
10   14 
10   2 
3   18 
2   1 
8   10 
7   9 
8   20 
8   4 
4   11 
4   2 
6   12 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 1.978234
> Min(tmp)
[1] -2.350018
> mean(tmp)
[1] -0.03783472
> Sum(tmp)
[1] -3.783472
> Var(tmp)
[1] 0.7459877
> 
> rowMeans(tmp)
[1] -0.03783472
> rowSums(tmp)
[1] -3.783472
> rowVars(tmp)
[1] 0.7459877
> rowSd(tmp)
[1] 0.8637058
> rowMax(tmp)
[1] 1.978234
> rowMin(tmp)
[1] -2.350018
> 
> colMeans(tmp)
  [1] -0.08424287  0.84160477 -1.56316144  0.33240647 -0.72945403  0.67680531
  [7]  0.15191875 -0.12061342 -1.41036892 -0.29776146  0.37273868 -1.08470121
 [13] -0.56741190 -1.58263224  1.17669463  0.40267433  1.37236821  0.15137559
 [19]  0.02530509  1.97823370  0.09442808  0.22956833 -1.44103936 -0.37280848
 [25] -0.12154609 -1.16790071 -0.64677880  0.68926841 -0.34459734 -0.44362528
 [31] -0.55544236 -0.12334965  0.48879086  1.04981623 -0.09725874 -0.01378000
 [37]  1.16894030 -0.84613057 -1.37733703  0.21636176  0.87028283 -1.46976951
 [43] -0.65029025 -0.97429674  1.27287623  1.46194278 -2.35001753 -1.56819843
 [49]  1.82879082  1.02724154  1.62373264  0.59767738 -0.06338200  0.30048672
 [55] -0.36371804  0.13456519 -1.44479439 -0.17750265  0.05514862  0.16766669
 [61]  0.22309260 -1.14968424  0.88871689  1.51327950  0.18161405  0.00512804
 [67] -0.24951461  0.86530898 -0.56376342 -1.54994890 -0.20507940  1.26504105
 [73] -1.25966831  0.03140949 -0.59201564  0.69881308  0.70618106 -1.09167672
 [79] -0.50203943  0.09717908 -0.35690761  0.29331616  0.36674477  0.12020751
 [85] -1.12406709  1.14073383 -0.32535820  0.81868415 -0.78078988 -0.01149768
 [91] -0.10466435 -0.24946161  0.64705223 -0.04495522  0.48806260 -0.38796059
 [97]  0.16569958 -0.66450452  0.15892170  0.04909972
> colSums(tmp)
  [1] -0.08424287  0.84160477 -1.56316144  0.33240647 -0.72945403  0.67680531
  [7]  0.15191875 -0.12061342 -1.41036892 -0.29776146  0.37273868 -1.08470121
 [13] -0.56741190 -1.58263224  1.17669463  0.40267433  1.37236821  0.15137559
 [19]  0.02530509  1.97823370  0.09442808  0.22956833 -1.44103936 -0.37280848
 [25] -0.12154609 -1.16790071 -0.64677880  0.68926841 -0.34459734 -0.44362528
 [31] -0.55544236 -0.12334965  0.48879086  1.04981623 -0.09725874 -0.01378000
 [37]  1.16894030 -0.84613057 -1.37733703  0.21636176  0.87028283 -1.46976951
 [43] -0.65029025 -0.97429674  1.27287623  1.46194278 -2.35001753 -1.56819843
 [49]  1.82879082  1.02724154  1.62373264  0.59767738 -0.06338200  0.30048672
 [55] -0.36371804  0.13456519 -1.44479439 -0.17750265  0.05514862  0.16766669
 [61]  0.22309260 -1.14968424  0.88871689  1.51327950  0.18161405  0.00512804
 [67] -0.24951461  0.86530898 -0.56376342 -1.54994890 -0.20507940  1.26504105
 [73] -1.25966831  0.03140949 -0.59201564  0.69881308  0.70618106 -1.09167672
 [79] -0.50203943  0.09717908 -0.35690761  0.29331616  0.36674477  0.12020751
 [85] -1.12406709  1.14073383 -0.32535820  0.81868415 -0.78078988 -0.01149768
 [91] -0.10466435 -0.24946161  0.64705223 -0.04495522  0.48806260 -0.38796059
 [97]  0.16569958 -0.66450452  0.15892170  0.04909972
> 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.08424287  0.84160477 -1.56316144  0.33240647 -0.72945403  0.67680531
  [7]  0.15191875 -0.12061342 -1.41036892 -0.29776146  0.37273868 -1.08470121
 [13] -0.56741190 -1.58263224  1.17669463  0.40267433  1.37236821  0.15137559
 [19]  0.02530509  1.97823370  0.09442808  0.22956833 -1.44103936 -0.37280848
 [25] -0.12154609 -1.16790071 -0.64677880  0.68926841 -0.34459734 -0.44362528
 [31] -0.55544236 -0.12334965  0.48879086  1.04981623 -0.09725874 -0.01378000
 [37]  1.16894030 -0.84613057 -1.37733703  0.21636176  0.87028283 -1.46976951
 [43] -0.65029025 -0.97429674  1.27287623  1.46194278 -2.35001753 -1.56819843
 [49]  1.82879082  1.02724154  1.62373264  0.59767738 -0.06338200  0.30048672
 [55] -0.36371804  0.13456519 -1.44479439 -0.17750265  0.05514862  0.16766669
 [61]  0.22309260 -1.14968424  0.88871689  1.51327950  0.18161405  0.00512804
 [67] -0.24951461  0.86530898 -0.56376342 -1.54994890 -0.20507940  1.26504105
 [73] -1.25966831  0.03140949 -0.59201564  0.69881308  0.70618106 -1.09167672
 [79] -0.50203943  0.09717908 -0.35690761  0.29331616  0.36674477  0.12020751
 [85] -1.12406709  1.14073383 -0.32535820  0.81868415 -0.78078988 -0.01149768
 [91] -0.10466435 -0.24946161  0.64705223 -0.04495522  0.48806260 -0.38796059
 [97]  0.16569958 -0.66450452  0.15892170  0.04909972
> colMin(tmp)
  [1] -0.08424287  0.84160477 -1.56316144  0.33240647 -0.72945403  0.67680531
  [7]  0.15191875 -0.12061342 -1.41036892 -0.29776146  0.37273868 -1.08470121
 [13] -0.56741190 -1.58263224  1.17669463  0.40267433  1.37236821  0.15137559
 [19]  0.02530509  1.97823370  0.09442808  0.22956833 -1.44103936 -0.37280848
 [25] -0.12154609 -1.16790071 -0.64677880  0.68926841 -0.34459734 -0.44362528
 [31] -0.55544236 -0.12334965  0.48879086  1.04981623 -0.09725874 -0.01378000
 [37]  1.16894030 -0.84613057 -1.37733703  0.21636176  0.87028283 -1.46976951
 [43] -0.65029025 -0.97429674  1.27287623  1.46194278 -2.35001753 -1.56819843
 [49]  1.82879082  1.02724154  1.62373264  0.59767738 -0.06338200  0.30048672
 [55] -0.36371804  0.13456519 -1.44479439 -0.17750265  0.05514862  0.16766669
 [61]  0.22309260 -1.14968424  0.88871689  1.51327950  0.18161405  0.00512804
 [67] -0.24951461  0.86530898 -0.56376342 -1.54994890 -0.20507940  1.26504105
 [73] -1.25966831  0.03140949 -0.59201564  0.69881308  0.70618106 -1.09167672
 [79] -0.50203943  0.09717908 -0.35690761  0.29331616  0.36674477  0.12020751
 [85] -1.12406709  1.14073383 -0.32535820  0.81868415 -0.78078988 -0.01149768
 [91] -0.10466435 -0.24946161  0.64705223 -0.04495522  0.48806260 -0.38796059
 [97]  0.16569958 -0.66450452  0.15892170  0.04909972
> colMedians(tmp)
  [1] -0.08424287  0.84160477 -1.56316144  0.33240647 -0.72945403  0.67680531
  [7]  0.15191875 -0.12061342 -1.41036892 -0.29776146  0.37273868 -1.08470121
 [13] -0.56741190 -1.58263224  1.17669463  0.40267433  1.37236821  0.15137559
 [19]  0.02530509  1.97823370  0.09442808  0.22956833 -1.44103936 -0.37280848
 [25] -0.12154609 -1.16790071 -0.64677880  0.68926841 -0.34459734 -0.44362528
 [31] -0.55544236 -0.12334965  0.48879086  1.04981623 -0.09725874 -0.01378000
 [37]  1.16894030 -0.84613057 -1.37733703  0.21636176  0.87028283 -1.46976951
 [43] -0.65029025 -0.97429674  1.27287623  1.46194278 -2.35001753 -1.56819843
 [49]  1.82879082  1.02724154  1.62373264  0.59767738 -0.06338200  0.30048672
 [55] -0.36371804  0.13456519 -1.44479439 -0.17750265  0.05514862  0.16766669
 [61]  0.22309260 -1.14968424  0.88871689  1.51327950  0.18161405  0.00512804
 [67] -0.24951461  0.86530898 -0.56376342 -1.54994890 -0.20507940  1.26504105
 [73] -1.25966831  0.03140949 -0.59201564  0.69881308  0.70618106 -1.09167672
 [79] -0.50203943  0.09717908 -0.35690761  0.29331616  0.36674477  0.12020751
 [85] -1.12406709  1.14073383 -0.32535820  0.81868415 -0.78078988 -0.01149768
 [91] -0.10466435 -0.24946161  0.64705223 -0.04495522  0.48806260 -0.38796059
 [97]  0.16569958 -0.66450452  0.15892170  0.04909972
> colRanges(tmp)
            [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
[1,] -0.08424287 0.8416048 -1.563161 0.3324065 -0.729454 0.6768053 0.1519187
[2,] -0.08424287 0.8416048 -1.563161 0.3324065 -0.729454 0.6768053 0.1519187
           [,8]      [,9]      [,10]     [,11]     [,12]      [,13]     [,14]
[1,] -0.1206134 -1.410369 -0.2977615 0.3727387 -1.084701 -0.5674119 -1.582632
[2,] -0.1206134 -1.410369 -0.2977615 0.3727387 -1.084701 -0.5674119 -1.582632
        [,15]     [,16]    [,17]     [,18]      [,19]    [,20]      [,21]
[1,] 1.176695 0.4026743 1.372368 0.1513756 0.02530509 1.978234 0.09442808
[2,] 1.176695 0.4026743 1.372368 0.1513756 0.02530509 1.978234 0.09442808
         [,22]     [,23]      [,24]      [,25]     [,26]      [,27]     [,28]
[1,] 0.2295683 -1.441039 -0.3728085 -0.1215461 -1.167901 -0.6467788 0.6892684
[2,] 0.2295683 -1.441039 -0.3728085 -0.1215461 -1.167901 -0.6467788 0.6892684
          [,29]      [,30]      [,31]      [,32]     [,33]    [,34]       [,35]
[1,] -0.3445973 -0.4436253 -0.5554424 -0.1233496 0.4887909 1.049816 -0.09725874
[2,] -0.3445973 -0.4436253 -0.5554424 -0.1233496 0.4887909 1.049816 -0.09725874
        [,36]   [,37]      [,38]     [,39]     [,40]     [,41]    [,42]
[1,] -0.01378 1.16894 -0.8461306 -1.377337 0.2163618 0.8702828 -1.46977
[2,] -0.01378 1.16894 -0.8461306 -1.377337 0.2163618 0.8702828 -1.46977
          [,43]      [,44]    [,45]    [,46]     [,47]     [,48]    [,49]
[1,] -0.6502903 -0.9742967 1.272876 1.461943 -2.350018 -1.568198 1.828791
[2,] -0.6502903 -0.9742967 1.272876 1.461943 -2.350018 -1.568198 1.828791
        [,50]    [,51]     [,52]     [,53]     [,54]     [,55]     [,56]
[1,] 1.027242 1.623733 0.5976774 -0.063382 0.3004867 -0.363718 0.1345652
[2,] 1.027242 1.623733 0.5976774 -0.063382 0.3004867 -0.363718 0.1345652
         [,57]      [,58]      [,59]     [,60]     [,61]     [,62]     [,63]
[1,] -1.444794 -0.1775026 0.05514862 0.1676667 0.2230926 -1.149684 0.8887169
[2,] -1.444794 -0.1775026 0.05514862 0.1676667 0.2230926 -1.149684 0.8887169
       [,64]     [,65]      [,66]      [,67]    [,68]      [,69]     [,70]
[1,] 1.51328 0.1816141 0.00512804 -0.2495146 0.865309 -0.5637634 -1.549949
[2,] 1.51328 0.1816141 0.00512804 -0.2495146 0.865309 -0.5637634 -1.549949
          [,71]    [,72]     [,73]      [,74]      [,75]     [,76]     [,77]
[1,] -0.2050794 1.265041 -1.259668 0.03140949 -0.5920156 0.6988131 0.7061811
[2,] -0.2050794 1.265041 -1.259668 0.03140949 -0.5920156 0.6988131 0.7061811
         [,78]      [,79]      [,80]      [,81]     [,82]     [,83]     [,84]
[1,] -1.091677 -0.5020394 0.09717908 -0.3569076 0.2933162 0.3667448 0.1202075
[2,] -1.091677 -0.5020394 0.09717908 -0.3569076 0.2933162 0.3667448 0.1202075
         [,85]    [,86]      [,87]     [,88]      [,89]       [,90]      [,91]
[1,] -1.124067 1.140734 -0.3253582 0.8186841 -0.7807899 -0.01149768 -0.1046644
[2,] -1.124067 1.140734 -0.3253582 0.8186841 -0.7807899 -0.01149768 -0.1046644
          [,92]     [,93]       [,94]     [,95]      [,96]     [,97]      [,98]
[1,] -0.2494616 0.6470522 -0.04495522 0.4880626 -0.3879606 0.1656996 -0.6645045
[2,] -0.2494616 0.6470522 -0.04495522 0.4880626 -0.3879606 0.1656996 -0.6645045
         [,99]     [,100]
[1,] 0.1589217 0.04909972
[2,] 0.1589217 0.04909972
> 
> 
> Max(tmp2)
[1] 2.188123
> Min(tmp2)
[1] -3.080147
> mean(tmp2)
[1] 0.07584633
> Sum(tmp2)
[1] 7.584633
> Var(tmp2)
[1] 0.9982991
> 
> rowMeans(tmp2)
  [1]  0.271233173  0.017490987  0.111630763  0.001964354  0.953271388
  [6]  1.810909535 -1.093339062  1.780546535  0.300259316  1.161847680
 [11] -0.136334443  0.338755753  0.988845768  1.792033842  1.277173651
 [16]  0.638919798 -1.574923421 -0.531371114  1.464217434 -0.559043813
 [21] -0.987086426  0.177993859 -0.777376135 -1.548371544  0.691676569
 [26] -0.613191964  0.066342626 -0.577929825  0.625927107 -0.992873685
 [31] -0.104316221 -0.239033670 -0.191107286  0.703827293 -0.398755843
 [36] -1.185129775 -0.741604951  0.827152495 -0.289395541  0.286126950
 [41] -0.343213574 -0.570132307  0.927050355 -0.268958658  1.483553131
 [46]  1.064274987  0.051889210  0.635475872 -0.962864571 -0.060475149
 [51]  0.006839487 -0.536959392 -3.080147232 -0.834050747 -0.395130464
 [56]  2.188122972 -0.056085938 -1.427207644  1.476218280  1.141043740
 [61]  0.399145943 -0.430000690  1.152955493  0.693681556 -0.628247515
 [66] -0.264285750  0.723460119  1.315817592  0.705411966  1.057335930
 [71] -0.768537834  0.212233183 -1.909748885  0.581770062 -1.014024416
 [76] -0.169601278 -0.505553926  0.692022747  1.719778312 -1.219703275
 [81]  1.243545425 -0.231891926  2.044436325 -1.923450021 -0.142225652
 [86]  0.165725763 -1.502472735  1.384257630 -0.530324486 -0.009717245
 [91]  1.069045877  0.449118813 -0.720327708 -0.651473581 -1.708838740
 [96]  1.660278273 -0.276317469  0.423800363  0.870922775 -0.559572915
> rowSums(tmp2)
  [1]  0.271233173  0.017490987  0.111630763  0.001964354  0.953271388
  [6]  1.810909535 -1.093339062  1.780546535  0.300259316  1.161847680
 [11] -0.136334443  0.338755753  0.988845768  1.792033842  1.277173651
 [16]  0.638919798 -1.574923421 -0.531371114  1.464217434 -0.559043813
 [21] -0.987086426  0.177993859 -0.777376135 -1.548371544  0.691676569
 [26] -0.613191964  0.066342626 -0.577929825  0.625927107 -0.992873685
 [31] -0.104316221 -0.239033670 -0.191107286  0.703827293 -0.398755843
 [36] -1.185129775 -0.741604951  0.827152495 -0.289395541  0.286126950
 [41] -0.343213574 -0.570132307  0.927050355 -0.268958658  1.483553131
 [46]  1.064274987  0.051889210  0.635475872 -0.962864571 -0.060475149
 [51]  0.006839487 -0.536959392 -3.080147232 -0.834050747 -0.395130464
 [56]  2.188122972 -0.056085938 -1.427207644  1.476218280  1.141043740
 [61]  0.399145943 -0.430000690  1.152955493  0.693681556 -0.628247515
 [66] -0.264285750  0.723460119  1.315817592  0.705411966  1.057335930
 [71] -0.768537834  0.212233183 -1.909748885  0.581770062 -1.014024416
 [76] -0.169601278 -0.505553926  0.692022747  1.719778312 -1.219703275
 [81]  1.243545425 -0.231891926  2.044436325 -1.923450021 -0.142225652
 [86]  0.165725763 -1.502472735  1.384257630 -0.530324486 -0.009717245
 [91]  1.069045877  0.449118813 -0.720327708 -0.651473581 -1.708838740
 [96]  1.660278273 -0.276317469  0.423800363  0.870922775 -0.559572915
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.271233173  0.017490987  0.111630763  0.001964354  0.953271388
  [6]  1.810909535 -1.093339062  1.780546535  0.300259316  1.161847680
 [11] -0.136334443  0.338755753  0.988845768  1.792033842  1.277173651
 [16]  0.638919798 -1.574923421 -0.531371114  1.464217434 -0.559043813
 [21] -0.987086426  0.177993859 -0.777376135 -1.548371544  0.691676569
 [26] -0.613191964  0.066342626 -0.577929825  0.625927107 -0.992873685
 [31] -0.104316221 -0.239033670 -0.191107286  0.703827293 -0.398755843
 [36] -1.185129775 -0.741604951  0.827152495 -0.289395541  0.286126950
 [41] -0.343213574 -0.570132307  0.927050355 -0.268958658  1.483553131
 [46]  1.064274987  0.051889210  0.635475872 -0.962864571 -0.060475149
 [51]  0.006839487 -0.536959392 -3.080147232 -0.834050747 -0.395130464
 [56]  2.188122972 -0.056085938 -1.427207644  1.476218280  1.141043740
 [61]  0.399145943 -0.430000690  1.152955493  0.693681556 -0.628247515
 [66] -0.264285750  0.723460119  1.315817592  0.705411966  1.057335930
 [71] -0.768537834  0.212233183 -1.909748885  0.581770062 -1.014024416
 [76] -0.169601278 -0.505553926  0.692022747  1.719778312 -1.219703275
 [81]  1.243545425 -0.231891926  2.044436325 -1.923450021 -0.142225652
 [86]  0.165725763 -1.502472735  1.384257630 -0.530324486 -0.009717245
 [91]  1.069045877  0.449118813 -0.720327708 -0.651473581 -1.708838740
 [96]  1.660278273 -0.276317469  0.423800363  0.870922775 -0.559572915
> rowMin(tmp2)
  [1]  0.271233173  0.017490987  0.111630763  0.001964354  0.953271388
  [6]  1.810909535 -1.093339062  1.780546535  0.300259316  1.161847680
 [11] -0.136334443  0.338755753  0.988845768  1.792033842  1.277173651
 [16]  0.638919798 -1.574923421 -0.531371114  1.464217434 -0.559043813
 [21] -0.987086426  0.177993859 -0.777376135 -1.548371544  0.691676569
 [26] -0.613191964  0.066342626 -0.577929825  0.625927107 -0.992873685
 [31] -0.104316221 -0.239033670 -0.191107286  0.703827293 -0.398755843
 [36] -1.185129775 -0.741604951  0.827152495 -0.289395541  0.286126950
 [41] -0.343213574 -0.570132307  0.927050355 -0.268958658  1.483553131
 [46]  1.064274987  0.051889210  0.635475872 -0.962864571 -0.060475149
 [51]  0.006839487 -0.536959392 -3.080147232 -0.834050747 -0.395130464
 [56]  2.188122972 -0.056085938 -1.427207644  1.476218280  1.141043740
 [61]  0.399145943 -0.430000690  1.152955493  0.693681556 -0.628247515
 [66] -0.264285750  0.723460119  1.315817592  0.705411966  1.057335930
 [71] -0.768537834  0.212233183 -1.909748885  0.581770062 -1.014024416
 [76] -0.169601278 -0.505553926  0.692022747  1.719778312 -1.219703275
 [81]  1.243545425 -0.231891926  2.044436325 -1.923450021 -0.142225652
 [86]  0.165725763 -1.502472735  1.384257630 -0.530324486 -0.009717245
 [91]  1.069045877  0.449118813 -0.720327708 -0.651473581 -1.708838740
 [96]  1.660278273 -0.276317469  0.423800363  0.870922775 -0.559572915
> 
> colMeans(tmp2)
[1] 0.07584633
> colSums(tmp2)
[1] 7.584633
> colVars(tmp2)
[1] 0.9982991
> colSd(tmp2)
[1] 0.9991492
> colMax(tmp2)
[1] 2.188123
> colMin(tmp2)
[1] -3.080147
> colMedians(tmp2)
[1] 0.004401921
> colRanges(tmp2)
          [,1]
[1,] -3.080147
[2,]  2.188123
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.5716550 -2.1771377  9.8998155 -0.6836088 -1.4365532  1.8072373
 [7]  1.7523073 -1.3304700 -4.3096590  3.4867345
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4406123
[2,] -0.7237361
[3,]  0.5864901
[4,]  1.2900455
[5,]  2.1677524
> 
> rowApply(tmp,sum)
 [1]  2.1987312 -0.5147502 -2.5763146 -6.3137607  3.1675365  2.5502205
 [7]  4.6350648  2.8766819 -0.4817118  5.0386234
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    9    6    4    1   10    1    8    8    10
 [2,]    2    2    4    2   10    1    4    1    9     6
 [3,]   10   10   10   10    7    3    9    6    3     8
 [4,]    8    5    9    3    6    2    6    3    7     3
 [5,]    1    7    2    6    4    8    7    4    5     4
 [6,]    4    8    3    1    8    9    8    5    6     7
 [7,]    5    4    8    7    5    5   10    9    2     5
 [8,]    6    3    7    5    9    7    3    2    4     1
 [9,]    9    1    1    8    2    4    2   10    1     2
[10,]    3    6    5    9    3    6    5    7   10     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.7338068  0.8901322  2.1867080  2.0836883  1.0479048 -1.2579101
 [7] -0.3217398  3.1602671 -1.1168612  3.5872161  0.5166689 -0.8745405
[13] -2.4315242  0.8989620 -1.4202938 -0.5769417  1.4516586 -3.6636224
[19] -1.3642799  1.9858604
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5257181
[2,]  0.2432566
[3,]  0.6105547
[4,]  1.0313013
[5,]  1.3744123
> 
> rowApply(tmp,sum)
[1]  0.6597792 -5.7315156  3.4025833 -0.9752852  9.1595979
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   19   11   18   13
[2,]    8    6   15   19   11
[3,]   11   16    3    3   20
[4,]   18   17    5   11    7
[5,]   19    9   18   13    4
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.5257181 -0.1272495  0.2778125  1.1990127  1.3879443 -0.9396127
[2,]  1.3744123 -1.3343728  1.0605562  1.2725323 -0.9400505 -1.0770977
[3,]  0.2432566  0.5809022 -1.0020390 -0.4719278  1.2319931 -0.1566925
[4,]  1.0313013  1.2260988 -0.6867979 -0.1203315  0.1168676 -0.4089710
[5,]  0.6105547  0.5447536  2.5371762  0.2044025 -0.7488497  1.3244638
            [,7]       [,8]        [,9]     [,10]      [,11]      [,12]
[1,]  0.25145763 -0.9204645  0.89830696 0.6484486  0.2941182  0.8968226
[2,] -0.20469199  1.4671508 -0.63514153 0.8966079  0.7887847 -1.3848780
[3,]  0.69077015  1.9938839 -0.03512978 0.0269258 -0.4506027 -1.0546801
[4,] -0.04513819 -0.3068794 -0.58786519 0.1839352 -0.6257379 -0.5204727
[5,] -1.01413738  0.9265762 -0.75703166 1.8312986  0.5101065  1.1886676
          [,13]     [,14]      [,15]      [,16]       [,17]      [,18]
[1,]  1.9609202 -0.120671 -0.9099496 -1.1476706  0.71430216 -1.8130019
[2,] -1.6979981 -1.242439 -2.0805300  1.3007739 -0.03591959 -2.0609253
[3,] -1.3392477  1.799531  1.0630112 -0.6767811 -0.17030680  0.3659716
[4,] -1.2721468 -0.640982  0.8333625 -0.5034202  0.68651684 -1.0160718
[5,] -0.0830517  1.103523 -0.3261879  0.4501563  0.25706600  0.8604050
          [,19]      [,20]
[1,]  0.3721578 -0.7371865
[2,] -1.7076262  0.5093372
[3,]  0.5015304  0.2622149
[4,]  0.2835194  1.3979275
[5,] -0.8138612  0.5535673
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2      col3       col4      col5     col6      col7
row1 -0.1121204 0.4149579 -3.236743 -0.9508915 -2.575234 -1.04047 0.8865631
          col8       col9      col10      col11     col12     col13     col14
row1 -1.156788 -0.2547916 -0.8065363 -0.1595271 0.4207046 0.7179056 0.9220879
           col15     col16     col17    col18     col19     col20
row1 -0.03017584 0.5288405 0.1600653 1.302712 -1.189959 0.1474994
> tmp[,"col10"]
          col10
row1 -0.8065363
row2 -0.8079752
row3 -1.4223443
row4 -0.7277796
row5 -1.3441575
> tmp[c("row1","row5"),]
           col1      col2      col3       col4      col5       col6       col7
row1 -0.1121204 0.4149579 -3.236743 -0.9508915 -2.575234 -1.0404700  0.8865631
row5  1.3323130 1.1061730  2.016295 -0.1734876 -2.288891 -0.8376238 -0.0743449
           col8       col9      col10      col11     col12      col13     col14
row1 -1.1567881 -0.2547916 -0.8065363 -0.1595271 0.4207046  0.7179056 0.9220879
row5  0.3119084 -0.8918311 -1.3441575 -0.8588814 2.1465069 -0.7152991 0.7555505
           col15     col16     col17      col18     col19     col20
row1 -0.03017584 0.5288405 0.1600653  1.3027125 -1.189959 0.1474994
row5 -1.04873819 0.6142597 0.3603614 -0.2008191 -1.020200 1.2366949
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.0404700  0.1474994
row2  0.8578379  1.5569032
row3 -1.2459250 -1.2283651
row4 -0.1467159  0.4237118
row5 -0.8376238  1.2366949
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -1.0404700 0.1474994
row5 -0.8376238 1.2366949
> 
> 
> 
> 
> 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 48.85659 48.81722 49.15955 50.83678 49.42829 103.7944 50.29978 50.14495
         col9    col10    col11    col12    col13  col14    col15    col16
row1 49.28455 48.38757 50.01832 49.22586 48.92632 49.661 50.01722 50.46668
        col17    col18    col19   col20
row1 50.45372 50.22304 51.29885 103.924
> tmp[,"col10"]
        col10
row1 48.38757
row2 30.33696
row3 29.11162
row4 29.14390
row5 48.82802
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.85659 48.81722 49.15955 50.83678 49.42829 103.7944 50.29978 50.14495
row5 49.19625 52.60551 48.45066 50.52032 48.48213 105.7508 49.93021 48.04557
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.28455 48.38757 50.01832 49.22586 48.92632 49.66100 50.01722 50.46668
row5 50.45410 48.82802 50.57911 50.53515 50.12908 49.75679 51.15330 49.50194
        col17    col18    col19    col20
row1 50.45372 50.22304 51.29885 103.9240
row5 49.30601 50.56684 48.96862 105.3332
> tmp[,c("col6","col20")]
          col6     col20
row1 103.79438 103.92401
row2  76.51253  73.81373
row3  74.50265  74.35771
row4  73.04445  74.72970
row5 105.75081 105.33315
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.7944 103.9240
row5 105.7508 105.3332
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.7944 103.9240
row5 105.7508 105.3332
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.4364864
[2,] -0.2551980
[3,] -0.5486590
[4,] -0.4588333
[5,] -0.2320870
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.4346944 -0.7527071
[2,]  0.7363747  1.4006310
[3,] -1.8461743 -0.4746651
[4,]  1.2007153 -0.5677732
[5,] -0.5011905 -0.5578709
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.6901961 -0.7412357
[2,] -1.2317594 -0.4402000
[3,]  0.4598439 -0.2405585
[4,] -0.7665351 -0.2195621
[5,]  0.6302586 -0.3323281
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.6901961
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.6901961
[2,] -1.2317594
> 
> 
> 
> 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.5106566 -0.5197769 -0.5152784 0.1759479 -0.6900887 1.404732 -0.5106633
row1  0.2718119  1.1019742 -0.2839383 0.5399517 -1.3040400 0.515172 -1.3910422
           [,8]      [,9]      [,10]     [,11]     [,12]      [,13]      [,14]
row3 -0.9947125 0.7456911 -1.0603541 0.9910694 0.8553962 -0.2374365 -0.9326369
row1 -0.1335936 0.7003187  0.7684134 2.4646117 1.3702687 -1.0598351  1.8029710
          [,15]     [,16]      [,17]      [,18]      [,19]      [,20]
row3  1.0495078  1.085252 -0.1487723  0.1850532  1.5162395 -0.9151125
row1 -0.6554031 -1.306111  0.1972403 -0.9202650 -0.2072972 -0.6220577
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]     [,4]      [,5]      [,6]     [,7]
row2 -1.092537 -0.895083 0.2461237 1.061514 -0.866508 0.2941279 2.384877
          [,8]      [,9]    [,10]
row2 0.8326437 0.6667588 0.608899
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]       [,3]       [,4]       [,5]      [,6]      [,7]
row5 -1.147645 -1.03425 -0.3190587 -0.8515079 -0.2992093 0.7000377 -1.198165
           [,8]     [,9]      [,10]     [,11]      [,12]      [,13]      [,14]
row5 -0.6748823 0.551486 -0.9927433 0.6771283 -0.3441139 -0.1920531 -0.1300078
         [,15]     [,16]    [,17]      [,18]     [,19]     [,20]
row5 -1.469607 0.7412205 1.096027 -0.3736816 -1.263289 0.2634678
> 
> 
> 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: 0x5a6b8f8ccfa0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd47c6ef8e0"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd440566f80"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd4737aa6b0"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd4357f3843"
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd4474d8dbb"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd46216a898"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd4770064a2"
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd472a78fde"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd433dcba62"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd4786b432" 
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd42e9457f8"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd4175bdad4"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd45b45cf44"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd46e7ab06a"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM26fdd44415f719"
> 
> 
> ### 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: 0x5a6b8f72c3a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5a6b8f72c3a0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5a6b8f72c3a0>
> rowMedians(tmp)
  [1] -0.445578602  0.229684677 -0.158393388 -0.478813237 -0.010708920
  [6] -0.063941341  0.339475126  0.026235915 -0.049288218 -0.404948448
 [11] -0.578025987  0.159402150  0.013199292  0.140753420  0.250771260
 [16] -0.311315353  0.030059230  0.260909083 -0.155843925 -0.360252086
 [21]  0.451351153  0.484912890  0.007205843  0.393485748  0.367125580
 [26] -0.149953284  0.308586601 -0.222213520  0.086724944 -0.356236280
 [31]  0.224740404 -0.152206013  0.150199327  0.059377604  0.236385462
 [36] -0.029259446 -0.118368435  0.464915532  0.250635016  0.181125790
 [41]  0.171618054 -0.044258272 -0.223995570  0.424022864 -0.104530723
 [46] -0.439077800  0.337901750 -0.039032215  0.189301286  0.138596956
 [51]  0.334818517  0.259009064 -0.172246486  0.105977720 -0.170412251
 [56]  0.181248837  0.401052971 -0.159264037  0.138343060  0.421613402
 [61]  0.034220200 -0.374218948 -0.187271992  0.055856889  0.358994835
 [66] -0.447202551  0.011225283  0.715225562 -0.419338288 -0.334832424
 [71]  0.283397122 -0.417985966  0.201013813 -0.516748739  0.366064188
 [76]  0.207812368  0.023139673  0.311249712  0.177733827 -0.147523343
 [81]  0.170475841 -0.092913938 -0.516839438 -0.067014135  0.492228111
 [86]  0.614978141  0.488376974  0.174369326  0.341346784  0.220818304
 [91] -0.297071244 -0.171226471  0.270326445 -0.306478799 -0.015740672
 [96] -0.238589115  0.594929089  0.345078866  0.167831803 -0.208887063
[101]  0.385670109  0.737271193 -0.531418607 -0.348702841  0.672198533
[106]  0.283621325  0.206940388 -0.353842711  0.244635245 -0.483312411
[111] -0.338894177 -0.618593778 -0.234088148  0.168509003  0.027521214
[116]  0.022101975  0.179672821  0.116062671  0.026276349  0.379654261
[121]  0.159361398 -0.072172962  0.055421510 -0.558677577 -0.448682395
[126]  0.136834302 -0.080886438 -0.480797534  0.383397003 -0.008989179
[131] -0.013366275 -0.318257705  0.340691014  0.638286523 -0.201588074
[136] -0.623896465 -0.299271300 -0.182351904  0.077034569  0.225237134
[141]  0.154815797 -0.253471095  0.785448020 -0.041095106 -0.418503318
[146]  0.239804686 -0.412560649 -0.285242990  0.292304326  0.011034134
[151]  0.040137395 -0.108984249  0.393787075 -0.176065915  0.462125554
[156] -0.028183694  0.014123644 -0.035067133  0.404656322  0.047505541
[161] -0.223879084  0.383627861  0.203997791 -0.065003694 -0.147340493
[166]  0.101973571  0.253209378 -0.231426661  0.356906722 -0.150327027
[171] -0.182980475  0.484437398 -0.162574978  0.027969964 -0.925151719
[176]  0.022346794 -0.504547165  0.120810257  0.286932108 -0.219683561
[181] -0.217908382  0.034763816  0.591513585 -0.102152394  0.128570994
[186]  0.005452790 -0.227154996 -0.204954081 -0.207714689  0.299953655
[191]  0.322716993 -0.128098400  0.173073272 -0.438681739 -0.516452687
[196]  0.267593155 -0.075913229 -0.024258196 -0.381186937 -0.052649534
[201] -0.415349587  0.100987134 -0.500704872 -0.144624052 -0.227763443
[206]  0.259817467  0.267627981 -0.161739602 -0.096660656 -0.086242049
[211] -0.484629216  0.069444763  0.348796136 -0.346653896 -0.088436386
[216]  0.230543449 -0.338743812  0.608456026 -0.183041877 -0.284164980
[221] -0.333639350  0.100473831 -0.015085370  0.249115258  0.039934737
[226] -0.238364187 -0.407986707  0.127263936 -0.205676789  0.002920944
> 
> proc.time()
   user  system elapsed 
  1.298   1.448   2.735 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x60b66d99fb20>
> .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: 0x60b66d99fb20>
> .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: 0x60b66d99fb20>
> .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: 0x60b66d99fb20>
> 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: 0x60b66d980410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b66d980410>
> .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: 0x60b66d980410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b66d980410>
> .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: 0x60b66d980410>
> 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: 0x60b66c22d7a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b66c22d7a0>
> .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: 0x60b66c22d7a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60b66c22d7a0>
> .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: 0x60b66c22d7a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60b66c22d7a0>
> .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: 0x60b66c22d7a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60b66c22d7a0>
> .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: 0x60b66c22d7a0>
> 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: 0x60b66d1ff680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60b66d1ff680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b66d1ff680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b66d1ff680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile26fe64707a97a0" "BufferedMatrixFile26fe64ec3abd0" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile26fe64707a97a0" "BufferedMatrixFile26fe64ec3abd0" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b66cf93490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b66cf93490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60b66cf93490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60b66cf93490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60b66cf93490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60b66cf93490>
> .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: 0x60b66e5ef110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60b66e5ef110>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60b66e5ef110>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60b66e5ef110>
> 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: 0x60b66e6925e0>
> .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: 0x60b66e6925e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.249   0.043   0.282 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.248   0.040   0.277 

Example timings