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

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

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

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


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.75.0
Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
StartedAt: 2025-11-20 21:40:14 -0500 (Thu, 20 Nov 2025)
EndedAt: 2025-11-20 21:40:39 -0500 (Thu, 20 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.232   0.057   0.277 

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 20 21:40:29 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 20 21:40:29 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: 0x599159a515e0>
> 
> 
> 
> 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 20 21:40:30 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 20 21:40:30 2025"
> 
> ColMode(tmp2)
<pointer: 0x599159a515e0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
             [,1]       [,2]        [,3]       [,4]
[1,] 100.23999110  1.2340165 -1.52712084 -1.2933265
[2,]   0.51394380 -1.0831159  0.17535529  1.8396169
[3,]   0.02287432  0.8792101 -0.06782351  2.2234255
[4,]   1.10757395 -0.7922756 -1.88541540 -0.3428332
> 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,] 100.23999110 1.2340165 1.52712084 1.2933265
[2,]   0.51394380 1.0831159 0.17535529 1.8396169
[3,]   0.02287432 0.8792101 0.06782351 2.2234255
[4,]   1.10757395 0.7922756 1.88541540 0.3428332
> 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.0119924 1.1108630 1.2357673 1.1372451
[2,]  0.7168987 1.0407285 0.4187545 1.3563248
[3,]  0.1512426 0.9376620 0.2604295 1.4911155
[4,]  1.0524134 0.8900987 1.3731043 0.5855196
> 
> 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,] 225.35991 37.34265 38.88479 37.66578
[2,]  32.68293 36.49040 29.36290 40.40286
[3,]  26.53530 35.25583 27.67212 42.13458
[4,]  36.63171 34.69326 40.61646 31.19803
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5991595dc840>
> exp(tmp5)
<pointer: 0x5991595dc840>
> log(tmp5,2)
<pointer: 0x5991595dc840>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.0571
> Min(tmp5)
[1] 53.86754
> mean(tmp5)
[1] 72.13661
> Sum(tmp5)
[1] 14427.32
> Var(tmp5)
[1] 871.2326
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.78507 68.02547 66.29814 69.76263 71.79813 68.75579 72.86952 71.25860
 [9] 68.91173 71.90097
> rowSums(tmp5)
 [1] 1835.701 1360.509 1325.963 1395.253 1435.963 1375.116 1457.390 1425.172
 [9] 1378.235 1438.019
> rowVars(tmp5)
 [1] 7971.02138   69.69072   77.16964   73.55595   97.87052   75.81308
 [7]   56.78844   57.72851   44.57493  110.28097
> rowSd(tmp5)
 [1] 89.280577  8.348097  8.784625  8.576476  9.892953  8.707071  7.535810
 [8]  7.597928  6.676446 10.501475
> rowMax(tmp5)
 [1] 469.05714  86.59688  87.69761  84.76970  88.63663  87.62239  81.53746
 [8]  91.62523  81.26263  93.97256
> rowMin(tmp5)
 [1] 57.61720 57.21469 55.22975 53.86754 56.04151 55.64726 57.47302 62.47883
 [9] 55.57103 56.29258
> 
> colMeans(tmp5)
 [1] 111.55177  71.15832  71.40002  73.56638  71.13166  69.04881  67.15770
 [8]  65.85430  68.87090  72.26096  70.79031  68.69002  74.41185  67.69439
[15]  74.81986  66.64151  70.04525  68.97620  67.46032  71.20160
> colSums(tmp5)
 [1] 1115.5177  711.5832  714.0002  735.6638  711.3166  690.4881  671.5770
 [8]  658.5430  688.7090  722.6096  707.9031  686.9002  744.1185  676.9439
[15]  748.1986  666.4151  700.4525  689.7620  674.6032  712.0160
> colVars(tmp5)
 [1] 15835.94701    31.94539   113.02378   104.65565    55.77029    48.32572
 [7]   114.76631    72.46449   147.30383   115.97235    57.04840    61.01881
[13]   131.00140    57.29818    32.85623    64.24836    45.98783   102.20377
[19]    48.04150    73.28403
> colSd(tmp5)
 [1] 125.840959   5.652025  10.631264  10.230134   7.467951   6.951671
 [7]  10.712904   8.512608  12.136879  10.769046   7.553039   7.811454
[13]  11.445584   7.569556   5.732036   8.015507   6.781432  10.109588
[19]   6.931198   8.560609
> colMax(tmp5)
 [1] 469.05714  77.72383  84.53784  87.69761  80.51386  77.77928  91.62523
 [8]  80.31999  87.62239  91.67830  79.17865  81.78834  93.97256  81.41319
[15]  83.38496  80.54566  80.04166  86.59688  78.90349  86.94589
> colMin(tmp5)
 [1] 55.22975 58.09026 57.59589 57.40413 60.75287 56.04151 56.29258 53.86754
 [9] 58.03233 57.61720 57.21469 60.31553 62.81337 55.64726 66.21641 57.47302
[17] 59.86960 55.38728 57.44773 59.89843
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.78507 68.02547 66.29814 69.76263 71.79813       NA 72.86952 71.25860
 [9] 68.91173 71.90097
> rowSums(tmp5)
 [1] 1835.701 1360.509 1325.963 1395.253 1435.963       NA 1457.390 1425.172
 [9] 1378.235 1438.019
> rowVars(tmp5)
 [1] 7971.02138   69.69072   77.16964   73.55595   97.87052   77.12896
 [7]   56.78844   57.72851   44.57493  110.28097
> rowSd(tmp5)
 [1] 89.280577  8.348097  8.784625  8.576476  9.892953  8.782309  7.535810
 [8]  7.597928  6.676446 10.501475
> rowMax(tmp5)
 [1] 469.05714  86.59688  87.69761  84.76970  88.63663        NA  81.53746
 [8]  91.62523  81.26263  93.97256
> rowMin(tmp5)
 [1] 57.61720 57.21469 55.22975 53.86754 56.04151       NA 57.47302 62.47883
 [9] 55.57103 56.29258
> 
> colMeans(tmp5)
 [1] 111.55177  71.15832  71.40002  73.56638  71.13166  69.04881  67.15770
 [8]        NA  68.87090  72.26096  70.79031  68.69002  74.41185  67.69439
[15]  74.81986  66.64151  70.04525  68.97620  67.46032  71.20160
> colSums(tmp5)
 [1] 1115.5177  711.5832  714.0002  735.6638  711.3166  690.4881  671.5770
 [8]        NA  688.7090  722.6096  707.9031  686.9002  744.1185  676.9439
[15]  748.1986  666.4151  700.4525  689.7620  674.6032  712.0160
> colVars(tmp5)
 [1] 15835.94701    31.94539   113.02378   104.65565    55.77029    48.32572
 [7]   114.76631          NA   147.30383   115.97235    57.04840    61.01881
[13]   131.00140    57.29818    32.85623    64.24836    45.98783   102.20377
[19]    48.04150    73.28403
> colSd(tmp5)
 [1] 125.840959   5.652025  10.631264  10.230134   7.467951   6.951671
 [7]  10.712904         NA  12.136879  10.769046   7.553039   7.811454
[13]  11.445584   7.569556   5.732036   8.015507   6.781432  10.109588
[19]   6.931198   8.560609
> colMax(tmp5)
 [1] 469.05714  77.72383  84.53784  87.69761  80.51386  77.77928  91.62523
 [8]        NA  87.62239  91.67830  79.17865  81.78834  93.97256  81.41319
[15]  83.38496  80.54566  80.04166  86.59688  78.90349  86.94589
> colMin(tmp5)
 [1] 55.22975 58.09026 57.59589 57.40413 60.75287 56.04151 56.29258       NA
 [9] 58.03233 57.61720 57.21469 60.31553 62.81337 55.64726 66.21641 57.47302
[17] 59.86960 55.38728 57.44773 59.89843
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.0571
> Min(tmp5,na.rm=TRUE)
[1] 53.86754
> mean(tmp5,na.rm=TRUE)
[1] 72.18896
> Sum(tmp5,na.rm=TRUE)
[1] 14365.6
> Var(tmp5,na.rm=TRUE)
[1] 875.0819
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.78507 68.02547 66.29814 69.76263 71.79813 69.12617 72.86952 71.25860
 [9] 68.91173 71.90097
> rowSums(tmp5,na.rm=TRUE)
 [1] 1835.701 1360.509 1325.963 1395.253 1435.963 1313.397 1457.390 1425.172
 [9] 1378.235 1438.019
> rowVars(tmp5,na.rm=TRUE)
 [1] 7971.02138   69.69072   77.16964   73.55595   97.87052   77.12896
 [7]   56.78844   57.72851   44.57493  110.28097
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.280577  8.348097  8.784625  8.576476  9.892953  8.782309  7.535810
 [8]  7.597928  6.676446 10.501475
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.05714  86.59688  87.69761  84.76970  88.63663  87.62239  81.53746
 [8]  91.62523  81.26263  93.97256
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.61720 57.21469 55.22975 53.86754 56.04151 55.64726 57.47302 62.47883
 [9] 55.57103 56.29258
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.55177  71.15832  71.40002  73.56638  71.13166  69.04881  67.15770
 [8]  66.31381  68.87090  72.26096  70.79031  68.69002  74.41185  67.69439
[15]  74.81986  66.64151  70.04525  68.97620  67.46032  71.20160
> colSums(tmp5,na.rm=TRUE)
 [1] 1115.5177  711.5832  714.0002  735.6638  711.3166  690.4881  671.5770
 [8]  596.8243  688.7090  722.6096  707.9031  686.9002  744.1185  676.9439
[15]  748.1986  666.4151  700.4525  689.7620  674.6032  712.0160
> colVars(tmp5,na.rm=TRUE)
 [1] 15835.94701    31.94539   113.02378   104.65565    55.77029    48.32572
 [7]   114.76631    79.14709   147.30383   115.97235    57.04840    61.01881
[13]   131.00140    57.29818    32.85623    64.24836    45.98783   102.20377
[19]    48.04150    73.28403
> colSd(tmp5,na.rm=TRUE)
 [1] 125.840959   5.652025  10.631264  10.230134   7.467951   6.951671
 [7]  10.712904   8.896465  12.136879  10.769046   7.553039   7.811454
[13]  11.445584   7.569556   5.732036   8.015507   6.781432  10.109588
[19]   6.931198   8.560609
> colMax(tmp5,na.rm=TRUE)
 [1] 469.05714  77.72383  84.53784  87.69761  80.51386  77.77928  91.62523
 [8]  80.31999  87.62239  91.67830  79.17865  81.78834  93.97256  81.41319
[15]  83.38496  80.54566  80.04166  86.59688  78.90349  86.94589
> colMin(tmp5,na.rm=TRUE)
 [1] 55.22975 58.09026 57.59589 57.40413 60.75287 56.04151 56.29258 53.86754
 [9] 58.03233 57.61720 57.21469 60.31553 62.81337 55.64726 66.21641 57.47302
[17] 59.86960 55.38728 57.44773 59.89843
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.78507 68.02547 66.29814 69.76263 71.79813      NaN 72.86952 71.25860
 [9] 68.91173 71.90097
> rowSums(tmp5,na.rm=TRUE)
 [1] 1835.701 1360.509 1325.963 1395.253 1435.963    0.000 1457.390 1425.172
 [9] 1378.235 1438.019
> rowVars(tmp5,na.rm=TRUE)
 [1] 7971.02138   69.69072   77.16964   73.55595   97.87052         NA
 [7]   56.78844   57.72851   44.57493  110.28097
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.280577  8.348097  8.784625  8.576476  9.892953        NA  7.535810
 [8]  7.597928  6.676446 10.501475
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.05714  86.59688  87.69761  84.76970  88.63663        NA  81.53746
 [8]  91.62523  81.26263  93.97256
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.61720 57.21469 55.22975 53.86754 56.04151       NA 57.47302 62.47883
 [9] 55.57103 56.29258
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.46274  71.30019  70.16998  75.36218  70.59752  69.50817  67.85063
 [8]       NaN  66.78740  71.84527  70.92842  69.25628  75.70057  69.03296
[15]  74.52934  65.87498  71.17588  69.91761  66.79213  70.83897
> colSums(tmp5,na.rm=TRUE)
 [1] 1048.1647  641.7017  631.5299  678.2596  635.3777  625.5735  610.6557
 [8]    0.0000  601.0866  646.6074  638.3558  623.3065  681.3051  621.2967
[15]  670.7641  592.8748  640.5829  629.2585  601.1292  637.5507
> colVars(tmp5,na.rm=TRUE)
 [1] 17544.11699    35.71213   110.13075    81.45731    59.53188    51.99258
 [7]   123.71032          NA   116.88089   128.52494    63.96485    65.03887
[13]   128.69258    44.30304    36.01379    65.66917    37.35521   105.00902
[19]    49.02381    80.96511
> colSd(tmp5,na.rm=TRUE)
 [1] 132.454207   5.975963  10.494320   9.025370   7.715690   7.210588
 [7]  11.122514         NA  10.811146  11.336884   7.997803   8.064668
[13]  11.344275   6.656053   6.001149   8.103652   6.111891  10.247391
[19]   7.001701   8.998061
> colMax(tmp5,na.rm=TRUE)
 [1] 469.05714  77.72383  84.53784  87.69761  80.51386  77.77928  91.62523
 [8]      -Inf  87.23891  91.67830  79.17865  81.78834  93.97256  81.41319
[15]  83.38496  80.54566  80.04166  86.59688  78.90349  86.94589
> colMin(tmp5,na.rm=TRUE)
 [1] 55.22975 58.09026 57.59589 64.70134 60.75287 56.04151 56.29258      Inf
 [9] 58.03233 57.61720 57.21469 60.31553 63.30662 59.81969 66.21641 57.47302
[17] 62.20839 55.38728 57.44773 59.89843
> 
> 
> 
> 
> 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] 339.1880 210.4340 162.4782 188.8520 210.2840 179.2893 169.1682 183.1299
 [9] 270.9810 423.0213
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 339.1880 210.4340 162.4782 188.8520 210.2840 179.2893 169.1682 183.1299
 [9] 270.9810 423.0213
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00  5.684342e-14 -1.278977e-13 -2.842171e-14  0.000000e+00
 [6] -5.684342e-14  0.000000e+00 -2.842171e-14  0.000000e+00  1.136868e-13
[11] -1.421085e-14  8.526513e-14  1.989520e-13 -2.842171e-14 -2.842171e-14
[16] -1.705303e-13 -2.842171e-14  7.105427e-14  1.136868e-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)
+ }
9   7 
2   14 
7   18 
7   18 
5   16 
9   3 
1   13 
10   16 
5   6 
1   3 
4   12 
2   12 
10   8 
5   15 
2   3 
6   15 
10   11 
2   18 
1   3 
6   16 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.004327
> Min(tmp)
[1] -2.747788
> mean(tmp)
[1] -0.04017242
> Sum(tmp)
[1] -4.017242
> Var(tmp)
[1] 1.140271
> 
> rowMeans(tmp)
[1] -0.04017242
> rowSums(tmp)
[1] -4.017242
> rowVars(tmp)
[1] 1.140271
> rowSd(tmp)
[1] 1.067835
> rowMax(tmp)
[1] 3.004327
> rowMin(tmp)
[1] -2.747788
> 
> colMeans(tmp)
  [1]  0.2080320619 -0.1831101674  1.1338262133 -1.6641497321  0.1374529907
  [6] -0.1886308648  0.4718324140 -0.2016269222  0.7331452010 -0.3152626997
 [11] -1.2823848567  0.3959159359 -1.8940463179 -1.4353167770  0.0760231296
 [16]  1.0781519217  1.0406681674 -0.8415294995 -2.1068878113 -1.5738527397
 [21]  0.9557305015  0.3325822343  1.4381155103  1.6071465419 -0.6037385547
 [26]  0.3945756781  1.7653928045 -1.0905990882 -0.4886529390 -0.0193618217
 [31]  2.5332567028  3.0043266199 -0.2409388814 -0.3050105928 -0.8719212331
 [36] -0.4340824516  1.2996310237 -0.6595104954 -0.7301950782  0.4747275805
 [41]  1.0811390956  0.4529926642  0.6553142831 -0.8781796757  0.1083463410
 [46]  0.4447186580 -0.6139272654  0.5053742806  0.6086741719  0.4173722906
 [51]  0.0819449328 -0.0005546239  1.3599700725 -0.7467131282 -1.5387796292
 [56]  1.3519371471 -0.5811549006 -0.4969090906 -0.6935617937 -0.1563664970
 [61]  0.1166738914  0.2436777689  1.4962049359  0.1467955140  0.0368208397
 [66] -0.0558705928 -0.6700344057  2.2350976646 -1.2773421294  0.4692386731
 [71]  1.9651854930  0.9702516556 -1.1336897232  0.1551675476 -1.1730410571
 [76]  0.9128910993 -1.9735918110  0.4515807969 -2.7477880197  0.6656969068
 [81] -1.8659980274 -0.9449212142 -0.7435498842  0.0093051206 -0.9091375298
 [86]  1.0060042814 -0.3158523789 -0.2978918619 -1.8981981333 -0.1059745837
 [91] -1.6018213952 -0.9980535045  0.4305093555  1.2275359161 -0.0882918809
 [96] -0.8904052909  0.9850032171 -0.5660812901 -0.8764326173  0.2817232287
> colSums(tmp)
  [1]  0.2080320619 -0.1831101674  1.1338262133 -1.6641497321  0.1374529907
  [6] -0.1886308648  0.4718324140 -0.2016269222  0.7331452010 -0.3152626997
 [11] -1.2823848567  0.3959159359 -1.8940463179 -1.4353167770  0.0760231296
 [16]  1.0781519217  1.0406681674 -0.8415294995 -2.1068878113 -1.5738527397
 [21]  0.9557305015  0.3325822343  1.4381155103  1.6071465419 -0.6037385547
 [26]  0.3945756781  1.7653928045 -1.0905990882 -0.4886529390 -0.0193618217
 [31]  2.5332567028  3.0043266199 -0.2409388814 -0.3050105928 -0.8719212331
 [36] -0.4340824516  1.2996310237 -0.6595104954 -0.7301950782  0.4747275805
 [41]  1.0811390956  0.4529926642  0.6553142831 -0.8781796757  0.1083463410
 [46]  0.4447186580 -0.6139272654  0.5053742806  0.6086741719  0.4173722906
 [51]  0.0819449328 -0.0005546239  1.3599700725 -0.7467131282 -1.5387796292
 [56]  1.3519371471 -0.5811549006 -0.4969090906 -0.6935617937 -0.1563664970
 [61]  0.1166738914  0.2436777689  1.4962049359  0.1467955140  0.0368208397
 [66] -0.0558705928 -0.6700344057  2.2350976646 -1.2773421294  0.4692386731
 [71]  1.9651854930  0.9702516556 -1.1336897232  0.1551675476 -1.1730410571
 [76]  0.9128910993 -1.9735918110  0.4515807969 -2.7477880197  0.6656969068
 [81] -1.8659980274 -0.9449212142 -0.7435498842  0.0093051206 -0.9091375298
 [86]  1.0060042814 -0.3158523789 -0.2978918619 -1.8981981333 -0.1059745837
 [91] -1.6018213952 -0.9980535045  0.4305093555  1.2275359161 -0.0882918809
 [96] -0.8904052909  0.9850032171 -0.5660812901 -0.8764326173  0.2817232287
> 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.2080320619 -0.1831101674  1.1338262133 -1.6641497321  0.1374529907
  [6] -0.1886308648  0.4718324140 -0.2016269222  0.7331452010 -0.3152626997
 [11] -1.2823848567  0.3959159359 -1.8940463179 -1.4353167770  0.0760231296
 [16]  1.0781519217  1.0406681674 -0.8415294995 -2.1068878113 -1.5738527397
 [21]  0.9557305015  0.3325822343  1.4381155103  1.6071465419 -0.6037385547
 [26]  0.3945756781  1.7653928045 -1.0905990882 -0.4886529390 -0.0193618217
 [31]  2.5332567028  3.0043266199 -0.2409388814 -0.3050105928 -0.8719212331
 [36] -0.4340824516  1.2996310237 -0.6595104954 -0.7301950782  0.4747275805
 [41]  1.0811390956  0.4529926642  0.6553142831 -0.8781796757  0.1083463410
 [46]  0.4447186580 -0.6139272654  0.5053742806  0.6086741719  0.4173722906
 [51]  0.0819449328 -0.0005546239  1.3599700725 -0.7467131282 -1.5387796292
 [56]  1.3519371471 -0.5811549006 -0.4969090906 -0.6935617937 -0.1563664970
 [61]  0.1166738914  0.2436777689  1.4962049359  0.1467955140  0.0368208397
 [66] -0.0558705928 -0.6700344057  2.2350976646 -1.2773421294  0.4692386731
 [71]  1.9651854930  0.9702516556 -1.1336897232  0.1551675476 -1.1730410571
 [76]  0.9128910993 -1.9735918110  0.4515807969 -2.7477880197  0.6656969068
 [81] -1.8659980274 -0.9449212142 -0.7435498842  0.0093051206 -0.9091375298
 [86]  1.0060042814 -0.3158523789 -0.2978918619 -1.8981981333 -0.1059745837
 [91] -1.6018213952 -0.9980535045  0.4305093555  1.2275359161 -0.0882918809
 [96] -0.8904052909  0.9850032171 -0.5660812901 -0.8764326173  0.2817232287
> colMin(tmp)
  [1]  0.2080320619 -0.1831101674  1.1338262133 -1.6641497321  0.1374529907
  [6] -0.1886308648  0.4718324140 -0.2016269222  0.7331452010 -0.3152626997
 [11] -1.2823848567  0.3959159359 -1.8940463179 -1.4353167770  0.0760231296
 [16]  1.0781519217  1.0406681674 -0.8415294995 -2.1068878113 -1.5738527397
 [21]  0.9557305015  0.3325822343  1.4381155103  1.6071465419 -0.6037385547
 [26]  0.3945756781  1.7653928045 -1.0905990882 -0.4886529390 -0.0193618217
 [31]  2.5332567028  3.0043266199 -0.2409388814 -0.3050105928 -0.8719212331
 [36] -0.4340824516  1.2996310237 -0.6595104954 -0.7301950782  0.4747275805
 [41]  1.0811390956  0.4529926642  0.6553142831 -0.8781796757  0.1083463410
 [46]  0.4447186580 -0.6139272654  0.5053742806  0.6086741719  0.4173722906
 [51]  0.0819449328 -0.0005546239  1.3599700725 -0.7467131282 -1.5387796292
 [56]  1.3519371471 -0.5811549006 -0.4969090906 -0.6935617937 -0.1563664970
 [61]  0.1166738914  0.2436777689  1.4962049359  0.1467955140  0.0368208397
 [66] -0.0558705928 -0.6700344057  2.2350976646 -1.2773421294  0.4692386731
 [71]  1.9651854930  0.9702516556 -1.1336897232  0.1551675476 -1.1730410571
 [76]  0.9128910993 -1.9735918110  0.4515807969 -2.7477880197  0.6656969068
 [81] -1.8659980274 -0.9449212142 -0.7435498842  0.0093051206 -0.9091375298
 [86]  1.0060042814 -0.3158523789 -0.2978918619 -1.8981981333 -0.1059745837
 [91] -1.6018213952 -0.9980535045  0.4305093555  1.2275359161 -0.0882918809
 [96] -0.8904052909  0.9850032171 -0.5660812901 -0.8764326173  0.2817232287
> colMedians(tmp)
  [1]  0.2080320619 -0.1831101674  1.1338262133 -1.6641497321  0.1374529907
  [6] -0.1886308648  0.4718324140 -0.2016269222  0.7331452010 -0.3152626997
 [11] -1.2823848567  0.3959159359 -1.8940463179 -1.4353167770  0.0760231296
 [16]  1.0781519217  1.0406681674 -0.8415294995 -2.1068878113 -1.5738527397
 [21]  0.9557305015  0.3325822343  1.4381155103  1.6071465419 -0.6037385547
 [26]  0.3945756781  1.7653928045 -1.0905990882 -0.4886529390 -0.0193618217
 [31]  2.5332567028  3.0043266199 -0.2409388814 -0.3050105928 -0.8719212331
 [36] -0.4340824516  1.2996310237 -0.6595104954 -0.7301950782  0.4747275805
 [41]  1.0811390956  0.4529926642  0.6553142831 -0.8781796757  0.1083463410
 [46]  0.4447186580 -0.6139272654  0.5053742806  0.6086741719  0.4173722906
 [51]  0.0819449328 -0.0005546239  1.3599700725 -0.7467131282 -1.5387796292
 [56]  1.3519371471 -0.5811549006 -0.4969090906 -0.6935617937 -0.1563664970
 [61]  0.1166738914  0.2436777689  1.4962049359  0.1467955140  0.0368208397
 [66] -0.0558705928 -0.6700344057  2.2350976646 -1.2773421294  0.4692386731
 [71]  1.9651854930  0.9702516556 -1.1336897232  0.1551675476 -1.1730410571
 [76]  0.9128910993 -1.9735918110  0.4515807969 -2.7477880197  0.6656969068
 [81] -1.8659980274 -0.9449212142 -0.7435498842  0.0093051206 -0.9091375298
 [86]  1.0060042814 -0.3158523789 -0.2978918619 -1.8981981333 -0.1059745837
 [91] -1.6018213952 -0.9980535045  0.4305093555  1.2275359161 -0.0882918809
 [96] -0.8904052909  0.9850032171 -0.5660812901 -0.8764326173  0.2817232287
> colRanges(tmp)
          [,1]       [,2]     [,3]     [,4]     [,5]       [,6]      [,7]
[1,] 0.2080321 -0.1831102 1.133826 -1.66415 0.137453 -0.1886309 0.4718324
[2,] 0.2080321 -0.1831102 1.133826 -1.66415 0.137453 -0.1886309 0.4718324
           [,8]      [,9]      [,10]     [,11]     [,12]     [,13]     [,14]
[1,] -0.2016269 0.7331452 -0.3152627 -1.282385 0.3959159 -1.894046 -1.435317
[2,] -0.2016269 0.7331452 -0.3152627 -1.282385 0.3959159 -1.894046 -1.435317
          [,15]    [,16]    [,17]      [,18]     [,19]     [,20]     [,21]
[1,] 0.07602313 1.078152 1.040668 -0.8415295 -2.106888 -1.573853 0.9557305
[2,] 0.07602313 1.078152 1.040668 -0.8415295 -2.106888 -1.573853 0.9557305
         [,22]    [,23]    [,24]      [,25]     [,26]    [,27]     [,28]
[1,] 0.3325822 1.438116 1.607147 -0.6037386 0.3945757 1.765393 -1.090599
[2,] 0.3325822 1.438116 1.607147 -0.6037386 0.3945757 1.765393 -1.090599
          [,29]       [,30]    [,31]    [,32]      [,33]      [,34]      [,35]
[1,] -0.4886529 -0.01936182 2.533257 3.004327 -0.2409389 -0.3050106 -0.8719212
[2,] -0.4886529 -0.01936182 2.533257 3.004327 -0.2409389 -0.3050106 -0.8719212
          [,36]    [,37]      [,38]      [,39]     [,40]    [,41]     [,42]
[1,] -0.4340825 1.299631 -0.6595105 -0.7301951 0.4747276 1.081139 0.4529927
[2,] -0.4340825 1.299631 -0.6595105 -0.7301951 0.4747276 1.081139 0.4529927
         [,43]      [,44]     [,45]     [,46]      [,47]     [,48]     [,49]
[1,] 0.6553143 -0.8781797 0.1083463 0.4447187 -0.6139273 0.5053743 0.6086742
[2,] 0.6553143 -0.8781797 0.1083463 0.4447187 -0.6139273 0.5053743 0.6086742
         [,50]      [,51]         [,52]   [,53]      [,54]    [,55]    [,56]
[1,] 0.4173723 0.08194493 -0.0005546239 1.35997 -0.7467131 -1.53878 1.351937
[2,] 0.4173723 0.08194493 -0.0005546239 1.35997 -0.7467131 -1.53878 1.351937
          [,57]      [,58]      [,59]      [,60]     [,61]     [,62]    [,63]
[1,] -0.5811549 -0.4969091 -0.6935618 -0.1563665 0.1166739 0.2436778 1.496205
[2,] -0.5811549 -0.4969091 -0.6935618 -0.1563665 0.1166739 0.2436778 1.496205
         [,64]      [,65]       [,66]      [,67]    [,68]     [,69]     [,70]
[1,] 0.1467955 0.03682084 -0.05587059 -0.6700344 2.235098 -1.277342 0.4692387
[2,] 0.1467955 0.03682084 -0.05587059 -0.6700344 2.235098 -1.277342 0.4692387
        [,71]     [,72]    [,73]     [,74]     [,75]     [,76]     [,77]
[1,] 1.965185 0.9702517 -1.13369 0.1551675 -1.173041 0.9128911 -1.973592
[2,] 1.965185 0.9702517 -1.13369 0.1551675 -1.173041 0.9128911 -1.973592
         [,78]     [,79]     [,80]     [,81]      [,82]      [,83]       [,84]
[1,] 0.4515808 -2.747788 0.6656969 -1.865998 -0.9449212 -0.7435499 0.009305121
[2,] 0.4515808 -2.747788 0.6656969 -1.865998 -0.9449212 -0.7435499 0.009305121
          [,85]    [,86]      [,87]      [,88]     [,89]      [,90]     [,91]
[1,] -0.9091375 1.006004 -0.3158524 -0.2978919 -1.898198 -0.1059746 -1.601821
[2,] -0.9091375 1.006004 -0.3158524 -0.2978919 -1.898198 -0.1059746 -1.601821
          [,92]     [,93]    [,94]       [,95]      [,96]     [,97]      [,98]
[1,] -0.9980535 0.4305094 1.227536 -0.08829188 -0.8904053 0.9850032 -0.5660813
[2,] -0.9980535 0.4305094 1.227536 -0.08829188 -0.8904053 0.9850032 -0.5660813
          [,99]    [,100]
[1,] -0.8764326 0.2817232
[2,] -0.8764326 0.2817232
> 
> 
> Max(tmp2)
[1] 2.172104
> Min(tmp2)
[1] -2.008969
> mean(tmp2)
[1] 0.09742505
> Sum(tmp2)
[1] 9.742505
> Var(tmp2)
[1] 0.9209302
> 
> rowMeans(tmp2)
  [1]  0.9319008628 -0.6243616820 -0.7841273933  1.2135578954 -2.0089691975
  [6]  1.3439922570  1.1926206357  0.2408637431  0.9877788873 -0.0071967536
 [11] -0.9280216977 -0.5896874695  1.4874251911  0.6678224067 -0.5620801309
 [16] -0.1034709512  0.5224326947  0.1205902347  0.4697239234 -0.1027141654
 [21]  0.0121100209  0.8627866244  1.8458706010 -1.4227673332 -0.1105513271
 [26] -1.8249260226 -0.7060946187  1.4557957775 -0.9175870143  0.8065569110
 [31]  1.7063546256 -0.3591379612 -1.0735580425  0.3124339201  1.6615516657
 [36]  0.5631701114  1.2733020284 -0.9736644948 -0.7038470089 -1.3755977138
 [41]  0.3853653228  0.5644997152 -0.5825525725  0.5819385125 -0.4851016728
 [46]  1.8495315914  0.1788882744  1.3291051366  0.7503365751 -1.2231903578
 [51]  1.6472186778 -0.9171919407 -0.4738759176 -0.2240577447  1.1620277842
 [56] -1.0892578393 -0.1861277447  0.2356140168 -1.3042883800  1.8534369509
 [61]  0.0001593876 -0.6875723676 -0.0877904590 -0.4069577847  0.1732413260
 [66] -0.3998525373  0.8099159685 -0.5017249268 -0.7872147140 -1.6335178169
 [71]  0.0048415825  0.1545952139  1.0102723972 -0.0631730505  0.1122243781
 [76]  0.2167048739 -0.8825951175  0.9270789384 -1.5584221294 -1.6173560929
 [81] -1.2068796919  2.1721037093  1.6674254786  0.7203570748 -0.5786885806
 [86]  0.5922850615  0.6757353792  0.3972937319 -0.9690287158 -0.0283812383
 [91] -0.1558191641  0.3825004771  0.2843724403  1.1312260831  0.0212481425
 [96] -0.1930897675  0.6514492147  1.0747472917  0.8448595839 -1.0766670699
> rowSums(tmp2)
  [1]  0.9319008628 -0.6243616820 -0.7841273933  1.2135578954 -2.0089691975
  [6]  1.3439922570  1.1926206357  0.2408637431  0.9877788873 -0.0071967536
 [11] -0.9280216977 -0.5896874695  1.4874251911  0.6678224067 -0.5620801309
 [16] -0.1034709512  0.5224326947  0.1205902347  0.4697239234 -0.1027141654
 [21]  0.0121100209  0.8627866244  1.8458706010 -1.4227673332 -0.1105513271
 [26] -1.8249260226 -0.7060946187  1.4557957775 -0.9175870143  0.8065569110
 [31]  1.7063546256 -0.3591379612 -1.0735580425  0.3124339201  1.6615516657
 [36]  0.5631701114  1.2733020284 -0.9736644948 -0.7038470089 -1.3755977138
 [41]  0.3853653228  0.5644997152 -0.5825525725  0.5819385125 -0.4851016728
 [46]  1.8495315914  0.1788882744  1.3291051366  0.7503365751 -1.2231903578
 [51]  1.6472186778 -0.9171919407 -0.4738759176 -0.2240577447  1.1620277842
 [56] -1.0892578393 -0.1861277447  0.2356140168 -1.3042883800  1.8534369509
 [61]  0.0001593876 -0.6875723676 -0.0877904590 -0.4069577847  0.1732413260
 [66] -0.3998525373  0.8099159685 -0.5017249268 -0.7872147140 -1.6335178169
 [71]  0.0048415825  0.1545952139  1.0102723972 -0.0631730505  0.1122243781
 [76]  0.2167048739 -0.8825951175  0.9270789384 -1.5584221294 -1.6173560929
 [81] -1.2068796919  2.1721037093  1.6674254786  0.7203570748 -0.5786885806
 [86]  0.5922850615  0.6757353792  0.3972937319 -0.9690287158 -0.0283812383
 [91] -0.1558191641  0.3825004771  0.2843724403  1.1312260831  0.0212481425
 [96] -0.1930897675  0.6514492147  1.0747472917  0.8448595839 -1.0766670699
> 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.9319008628 -0.6243616820 -0.7841273933  1.2135578954 -2.0089691975
  [6]  1.3439922570  1.1926206357  0.2408637431  0.9877788873 -0.0071967536
 [11] -0.9280216977 -0.5896874695  1.4874251911  0.6678224067 -0.5620801309
 [16] -0.1034709512  0.5224326947  0.1205902347  0.4697239234 -0.1027141654
 [21]  0.0121100209  0.8627866244  1.8458706010 -1.4227673332 -0.1105513271
 [26] -1.8249260226 -0.7060946187  1.4557957775 -0.9175870143  0.8065569110
 [31]  1.7063546256 -0.3591379612 -1.0735580425  0.3124339201  1.6615516657
 [36]  0.5631701114  1.2733020284 -0.9736644948 -0.7038470089 -1.3755977138
 [41]  0.3853653228  0.5644997152 -0.5825525725  0.5819385125 -0.4851016728
 [46]  1.8495315914  0.1788882744  1.3291051366  0.7503365751 -1.2231903578
 [51]  1.6472186778 -0.9171919407 -0.4738759176 -0.2240577447  1.1620277842
 [56] -1.0892578393 -0.1861277447  0.2356140168 -1.3042883800  1.8534369509
 [61]  0.0001593876 -0.6875723676 -0.0877904590 -0.4069577847  0.1732413260
 [66] -0.3998525373  0.8099159685 -0.5017249268 -0.7872147140 -1.6335178169
 [71]  0.0048415825  0.1545952139  1.0102723972 -0.0631730505  0.1122243781
 [76]  0.2167048739 -0.8825951175  0.9270789384 -1.5584221294 -1.6173560929
 [81] -1.2068796919  2.1721037093  1.6674254786  0.7203570748 -0.5786885806
 [86]  0.5922850615  0.6757353792  0.3972937319 -0.9690287158 -0.0283812383
 [91] -0.1558191641  0.3825004771  0.2843724403  1.1312260831  0.0212481425
 [96] -0.1930897675  0.6514492147  1.0747472917  0.8448595839 -1.0766670699
> rowMin(tmp2)
  [1]  0.9319008628 -0.6243616820 -0.7841273933  1.2135578954 -2.0089691975
  [6]  1.3439922570  1.1926206357  0.2408637431  0.9877788873 -0.0071967536
 [11] -0.9280216977 -0.5896874695  1.4874251911  0.6678224067 -0.5620801309
 [16] -0.1034709512  0.5224326947  0.1205902347  0.4697239234 -0.1027141654
 [21]  0.0121100209  0.8627866244  1.8458706010 -1.4227673332 -0.1105513271
 [26] -1.8249260226 -0.7060946187  1.4557957775 -0.9175870143  0.8065569110
 [31]  1.7063546256 -0.3591379612 -1.0735580425  0.3124339201  1.6615516657
 [36]  0.5631701114  1.2733020284 -0.9736644948 -0.7038470089 -1.3755977138
 [41]  0.3853653228  0.5644997152 -0.5825525725  0.5819385125 -0.4851016728
 [46]  1.8495315914  0.1788882744  1.3291051366  0.7503365751 -1.2231903578
 [51]  1.6472186778 -0.9171919407 -0.4738759176 -0.2240577447  1.1620277842
 [56] -1.0892578393 -0.1861277447  0.2356140168 -1.3042883800  1.8534369509
 [61]  0.0001593876 -0.6875723676 -0.0877904590 -0.4069577847  0.1732413260
 [66] -0.3998525373  0.8099159685 -0.5017249268 -0.7872147140 -1.6335178169
 [71]  0.0048415825  0.1545952139  1.0102723972 -0.0631730505  0.1122243781
 [76]  0.2167048739 -0.8825951175  0.9270789384 -1.5584221294 -1.6173560929
 [81] -1.2068796919  2.1721037093  1.6674254786  0.7203570748 -0.5786885806
 [86]  0.5922850615  0.6757353792  0.3972937319 -0.9690287158 -0.0283812383
 [91] -0.1558191641  0.3825004771  0.2843724403  1.1312260831  0.0212481425
 [96] -0.1930897675  0.6514492147  1.0747472917  0.8448595839 -1.0766670699
> 
> colMeans(tmp2)
[1] 0.09742505
> colSums(tmp2)
[1] 9.742505
> colVars(tmp2)
[1] 0.9209302
> colSd(tmp2)
[1] 0.9596511
> colMax(tmp2)
[1] 2.172104
> colMin(tmp2)
[1] -2.008969
> colMedians(tmp2)
[1] 0.06673626
> colRanges(tmp2)
          [,1]
[1,] -2.008969
[2,]  2.172104
> 
> 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.5693286  2.1985269 -1.4217311  7.8709158  2.6042230 -0.7743964
 [7] -4.5041503 -6.1885200 -0.8911972 -6.2999671
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.6658882
[2,] -0.2991839
[3,]  0.1876897
[4,]  0.9360707
[5,]  1.8159347
> 
> rowApply(tmp,sum)
 [1]  1.3699203 -2.9764374 -7.1080987 -6.4235720 -1.1974427 -1.6820539
 [7]  6.3677435  3.9721043 -0.1125986  3.9534673
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    9    8    7    5    9    5    2    7    10
 [2,]    6    3    7    9    9    5    7    3   10     4
 [3,]    9    7    1    6   10    1    3    4    6     5
 [4,]    7   10   10   10    4    8   10    1    9     6
 [5,]   10    4    6    2    3    7    8   10    5     7
 [6,]    2    8    9    8    6    4    1    6    3     9
 [7,]    4    5    5    5    2    3    2    7    2     8
 [8,]    1    2    4    3    8    2    4    5    8     2
 [9,]    5    1    3    4    7   10    6    9    4     3
[10,]    8    6    2    1    1    6    9    8    1     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.0665794  1.1083662  0.4570445  4.3964713  1.4226053  1.2397331
 [7] -2.7567706 -4.0006357 -3.1628241  1.5521451 -2.2001426  5.5043057
[13]  1.8884853 -3.3694494 -6.1699255  1.6904566 -1.3670334 -0.7350483
[19]  1.1715267  5.1420268
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8487959
[2,] -0.2572228
[3,]  1.0878434
[4,]  1.4699109
[5,]  1.6148438
> 
> rowApply(tmp,sum)
[1]  2.755530  1.348999  6.088193 -2.340629 -2.974178
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   20   17   19    6   11
[2,]    7   14   17   13    7
[3,]   19    9   15    4   10
[4,]    9   20   10   16   16
[5,]    5    1   18    9   20
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,]  1.4699109 -0.1596962  1.3766093 0.02367066 -0.40995244  0.4057678
[2,]  1.0878434  0.6020593 -0.3328892 1.90953939 -1.81016745 -0.6623535
[3,]  1.6148438  1.2886249  0.9290381 0.53628498  1.49709581  1.6401285
[4,] -0.8487959  0.3821584 -1.2054808 0.84720420  0.07579931  0.2485509
[5,] -0.2572228 -1.0047802 -0.3102328 1.07977209  2.06983005 -0.3923606
            [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,] -0.40995868 -1.8038823 -0.27088763  0.9945497  0.5744735  1.2702236
[2,] -1.67248910  0.6595164  0.41717650  0.4739215  0.5581226 -0.1820537
[3,] -0.08625654  0.7380389  0.07356484 -1.3364248 -1.5205248  0.8515845
[4,]  0.73124158 -0.8637237 -2.32888666  1.2219217 -2.4219071  1.6819826
[5,] -1.31930786 -2.7305849 -1.05379118  0.1981771  0.6096932  1.8825687
          [,13]      [,14]      [,15]      [,16]      [,17]       [,18]
[1,]  0.4514525 -1.4657803 -0.1173989 -1.3702644  0.6403724  0.04096733
[2,]  0.9426536 -0.6564267 -1.2811911 -0.4727954 -0.4334372 -0.82771093
[3,]  0.5731283 -0.4285442 -0.9397032  1.2285905 -0.6839801 -0.33903290
[4,] -0.5297422  0.7040846 -2.0534395  0.8954622  0.2305458  0.10228131
[5,]  0.4509931 -1.5227828 -1.7781928  1.4094637 -1.1205343  0.28844684
          [,19]     [,20]
[1,]  0.9674714 0.5478822
[2,]  1.5550469 1.4746338
[3,] -0.3448457 0.7965825
[4,] -0.2585689 1.0486836
[5,] -0.7475772 1.2742447
> 
> 
> 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 :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  564  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.04635844 0.9211439 0.1507203 0.971639 1.272519 1.325858 -0.01217403
          col8      col9     col10    col11      col12    col13     col14
row1 0.7741107 0.2482615 -0.436887 1.428233 -0.1342993 -2.01146 0.3437051
           col15     col16     col17      col18     col19    col20
row1 -0.03384407 0.7514635 0.5976375 -0.2257053 0.9909883 1.791101
> tmp[,"col10"]
          col10
row1 -0.4368870
row2 -0.6178221
row3 -1.8015654
row4  0.2652921
row5  0.2452993
> tmp[c("row1","row5"),]
            col1      col2       col3      col4       col5      col6
row1  0.04635844 0.9211439  0.1507203 0.9716390  1.2725191  1.325858
row5 -1.12422162 0.4685080 -1.3516516 0.6304825 -0.3211637 -1.490040
            col7      col8      col9      col10      col11      col12
row1 -0.01217403 0.7741107 0.2482615 -0.4368870  1.4282329 -0.1342993
row5 -1.35872170 1.2262672 0.9571435  0.2452993 -0.2143546 -0.4791937
          col13     col14       col15       col16     col17      col18
row1 -2.0114599 0.3437051 -0.03384407  0.75146350 0.5976375 -0.2257053
row5 -0.2518521 0.3010992  0.71654310 -0.08309226 1.5627571  0.2182682
         col19     col20
row1 0.9909883 1.7911015
row5 0.4065050 0.4486465
> tmp[,c("col6","col20")]
           col6      col20
row1  1.3258581  1.7911015
row2  0.8875751  0.0837295
row3 -0.2573443 -0.6740436
row4 -0.7909520  0.6319635
row5 -1.4900404  0.4486465
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1  1.325858 1.7911015
row5 -1.490040 0.4486465
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.78277 49.79309 50.34234 49.82009 49.81964 104.7685 50.13025 50.30325
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.19739 49.49096 50.75365 48.52219 49.20391 51.34016 49.90559 50.98469
        col17    col18    col19    col20
row1 50.32932 51.22424 48.85576 105.6471
> tmp[,"col10"]
        col10
row1 49.49096
row2 31.11712
row3 30.02618
row4 30.11595
row5 51.48957
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.78277 49.79309 50.34234 49.82009 49.81964 104.7685 50.13025 50.30325
row5 49.52369 49.78847 51.55546 50.54993 50.42067 106.3872 48.52312 49.75322
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.19739 49.49096 50.75365 48.52219 49.20391 51.34016 49.90559 50.98469
row5 49.22986 51.48957 50.78943 50.47966 48.31737 51.16967 50.47718 49.73176
        col17    col18    col19    col20
row1 50.32932 51.22424 48.85576 105.6471
row5 50.47461 49.94621 51.31893 105.7358
> tmp[,c("col6","col20")]
          col6     col20
row1 104.76849 105.64708
row2  75.25241  75.12043
row3  75.44306  75.89440
row4  75.55251  73.74296
row5 106.38721 105.73580
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7685 105.6471
row5 106.3872 105.7358
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7685 105.6471
row5 106.3872 105.7358
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.47018294
[2,] -0.14281034
[3,]  0.03276367
[4,] -0.37933639
[5,]  0.87384512
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.7776133 -0.4978255
[2,]  1.7206634 -1.3412664
[3,]  0.1806389  0.6663395
[4,]  0.4393359 -1.3862627
[5,] -0.8105987 -0.4064324
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.03701419 -0.8453906
[2,]  0.11953063  0.1888754
[3,]  0.91297585 -1.1173039
[4,]  0.70517237  0.1942760
[5,] -2.09006480  1.4346290
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] 0.03701419
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] 0.03701419
[2,] 0.11953063
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]       [,2]       [,3]      [,4]       [,5]      [,6]
row3  0.01105876  0.5176412 -0.1935403 1.7115806 -0.2893903 0.1161573
row1 -0.35407828 -1.2134358  1.4308317 0.2879384 -0.2536043 0.4938062
            [,7]       [,8]       [,9]      [,10]      [,11]     [,12]
row3 -0.07388462 -1.9354605 -0.1823774  0.6323583 -0.7921391 0.4427684
row1  0.69647704 -0.7117875 -1.1235706 -2.1615766  1.0675965 0.2919045
         [,13]      [,14]     [,15]     [,16]      [,17]      [,18]     [,19]
row3 0.9127617 -1.7301969 0.8528148  1.484076  0.5701457 -0.7606902 0.7713376
row1 0.6494052 -0.1435654 1.9314651 -1.146422 -1.6812143 -0.3949269 0.7325565
          [,20]
row3  0.1244776
row1 -1.1608818
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]       [,3]      [,4]      [,5]     [,6]        [,7]
row2 -1.163452 0.6238069 -0.8536012 0.3897821 -0.921946 1.558872 -0.06916391
          [,8]      [,9]      [,10]
row2 -1.337707 -0.274779 -0.7948842
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]       [,4]       [,5]     [,6]       [,7]
row5 0.5408968 0.3968691 -0.2774978 -0.4261826 0.06359153 1.264685 -0.3504535
          [,8]      [,9]     [,10]    [,11]     [,12]    [,13]     [,14]
row5 0.9817073 0.2959404 0.6348791 1.090681 -1.072431 1.465311 0.7040676
         [,15]    [,16]  [,17]     [,18]    [,19]      [,20]
row5 0.8035997 2.110514 1.9265 0.7354778 1.839096 -0.2351251
> 
> 
> 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: 0x59915a3834e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c15b22ee5"
 [2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c4816cd31"
 [3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c1f86e2eb"
 [4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c360c9b7" 
 [5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c247cbe51"
 [6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c299e91ab"
 [7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c9d2f0c4" 
 [8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c4d961c96"
 [9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c53a224a9"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c7051cad3"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c70f8edc2"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c3cf354a1"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c7384da3" 
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c5cb121fd"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM34441c60f237"  
> 
> 
> ### 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: 0x59915a551af0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x59915a551af0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x59915a551af0>
> rowMedians(tmp)
  [1] -0.1450019803 -0.3352712006 -0.2019802731  0.0024781706 -0.4085824637
  [6]  0.1885058774  0.4102411630  0.4419288093  0.4125678322 -0.3320068525
 [11]  0.5886021698  0.4093364735  0.2663281704 -0.4355203968  0.6866758980
 [16]  0.3609247876  0.7245652116  0.4146356406 -0.1616239246 -0.3069080847
 [21] -0.4279363794 -0.0286506797  0.3279980935 -0.2084335145  0.1754266907
 [26]  0.1215654150  0.2082985600 -0.0179127034 -0.1230010962  0.0422881228
 [31]  0.4358882282 -0.4876340751 -0.6028449300 -0.3348335633  0.4328962571
 [36]  0.0795908750  0.0179902795  0.1330657431 -0.2542332635  0.1879184876
 [41] -0.0495906488 -0.4396125471 -0.1129645735 -0.5159595750  0.1469249362
 [46]  0.2682269176 -0.0703758581 -0.3552251411 -0.2326567601 -0.1144737285
 [51]  0.0503607860  0.4824681219  0.1302832253 -0.2930331920 -0.1395253507
 [56] -0.0722153067  0.2466653449  0.1720380137  0.2307637454  0.4757980199
 [61]  0.3943582821 -0.1611243282  0.2987512386  0.0041433584  0.3783328708
 [66] -0.0553125895  0.1732573354  0.3086071604 -0.0609122884 -0.5925550728
 [71]  0.5312016616 -0.1034613510  0.0180001177  0.1568326983  1.0092190842
 [76] -0.4006645120  0.1534557308  0.2879550262  0.1461962685  0.0654129112
 [81] -0.1514944471 -0.3005208494  0.1838447742  0.2858534458 -0.3182218788
 [86] -0.4568047727  0.5568879638 -0.1764848988 -0.4739954484 -0.3093126651
 [91]  0.3880232180 -0.7162756891  0.3385540733 -0.0151887590 -0.3896139595
 [96] -0.0009428818 -0.0775769584  0.1866274624 -0.2685535628 -0.2269024122
[101]  0.3315369207  0.0289901006  0.1492347861  0.0732344977 -0.4420552691
[106] -0.1000047079 -0.1300867212  0.3837468218  0.2922372323 -0.1219928598
[111] -0.1275837632 -0.2118724868 -0.1472383352 -0.2108388547  0.0258282999
[116]  0.3053790678 -0.2328567485  0.0682847250  0.3215729652 -0.2015036076
[121] -0.1193913271  0.1204657480  0.0674225434  0.0169406212 -0.6420585497
[126] -0.1367826798  0.0956982686 -0.9819967209 -0.2506180007  0.3878289950
[131]  0.3337516630  0.2384329052  0.3300260772 -0.2517673640 -0.1061615829
[136] -0.4244225722  0.1459340127  0.6030141958 -0.0645273425  0.2493488194
[141]  0.0179999858 -0.0174473723  0.0192071977 -0.0303498393 -0.0923464560
[146]  0.0788973662  0.0159960265  0.1293007890  0.3973652793 -0.0279392879
[151]  0.0052354140  0.0776420174  0.6339985082  0.2241716964 -0.3708223539
[156]  0.0706915891 -0.2678736113 -0.2798844412 -0.2033827658 -0.1775808475
[161] -0.5124452408 -0.7258537916 -0.2471841752 -0.2421472986 -0.1683512589
[166]  0.1896075339  0.3640715753 -0.4617032001  0.1000033192  0.1539423986
[171]  0.5113363745 -0.2413102752 -0.0171664196 -0.2550401316  0.3280701088
[176] -0.3580711883  0.7761766432 -0.0406578871 -0.0746010248 -0.1691514297
[181]  0.3184936458  0.1013562123  0.2874342244  0.1536829549 -0.0548544486
[186]  0.1951013921 -0.4974097679  0.1450538303  0.1708044241  0.1228419724
[191] -0.2561902954  0.2053494383  0.1065789007 -0.0555548781  0.4401417045
[196]  0.0014156262  0.0616249310  0.8782958133 -0.0545065048 -0.0476629244
[201]  0.2476675618 -0.0425533412  0.0365465074 -0.2218210973  0.6505591977
[206] -0.3887072716  0.1566631344  0.0585940472 -0.1173048137 -0.3714884106
[211]  0.4746922037  0.0422092461 -0.0148264648 -0.5703004815 -0.2849586102
[216] -0.4338083409  0.0213168878 -0.4877407621  0.5789421237 -0.4159821278
[221] -0.2102986543 -0.2416544382  0.0789357771  0.7279216473 -0.0206160663
[226]  0.1036262451 -0.6475350291  0.2106659382  0.2297755521 -0.1147715177
> 
> proc.time()
   user  system elapsed 
  1.326   1.426   2.742 

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: 0x603f6be7ab20>
> .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: 0x603f6be7ab20>
> .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: 0x603f6be7ab20>
> .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: 0x603f6be7ab20>
> 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: 0x603f6be5b410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x603f6be5b410>
> .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: 0x603f6be5b410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x603f6be5b410>
> .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: 0x603f6be5b410>
> 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: 0x603f6a7087a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x603f6a7087a0>
> .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: 0x603f6a7087a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x603f6a7087a0>
> .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: 0x603f6a7087a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x603f6a7087a0>
> .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: 0x603f6a7087a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x603f6a7087a0>
> .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: 0x603f6a7087a0>
> 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: 0x603f6b6da680>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x603f6b6da680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x603f6b6da680>
> .Call("R_bm_AddColumn",P)
<pointer: 0x603f6b6da680>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3444d3428b25a3" "BufferedMatrixFile3444d3784357f7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3444d3428b25a3" "BufferedMatrixFile3444d3784357f7"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x603f6b46e490>
> .Call("R_bm_AddColumn",P)
<pointer: 0x603f6b46e490>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x603f6b46e490>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x603f6b46e490>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x603f6b46e490>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x603f6b46e490>
> .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: 0x603f6caca110>
> .Call("R_bm_AddColumn",P)
<pointer: 0x603f6caca110>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x603f6caca110>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x603f6caca110>
> 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: 0x603f6cb6d5e0>
> .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: 0x603f6cb6d5e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.241   0.054   0.284 

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.236   0.050   0.272 

Example timings