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

This page was generated on 2025-08-09 12:06 -0400 (Sat, 09 Aug 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.2 LTS)x86_644.5.1 (2025-06-13) -- "Great Square Root" 4818
palomino8Windows Server 2022 Datacenterx644.5.1 (2025-06-13 ucrt) -- "Great Square Root" 4553
lconwaymacOS 12.7.1 Montereyx86_644.5.1 (2025-06-13) -- "Great Square Root" 4595
kjohnson3macOS 13.7.1 Venturaarm644.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" 4537
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2317HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-08-08 13:45 -0400 (Fri, 08 Aug 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.2 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on palomino8

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

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: F:\biocbuild\bbs-3.22-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.22-bioc\R\library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-08-09 00:07:01 -0400 (Sat, 09 Aug 2025)
EndedAt: 2025-08-09 00:09:53 -0400 (Sat, 09 Aug 2025)
EllapsedTime: 171.5 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   F:\biocbuild\bbs-3.22-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.22-bioc\R\library --no-vignettes --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck'
* using R version 4.5.1 (2025-06-13 ucrt)
* using platform: x86_64-w64-mingw32
* R was compiled by
    gcc.exe (GCC) 14.2.0
    GNU Fortran (GCC) 14.2.0
* running under: Windows Server 2022 x64 (build 20348)
* using session charset: UTF-8
* using option '--no-vignettes'
* checking for file 'BufferedMatrix/DESCRIPTION' ... OK
* this is package 'BufferedMatrix' version '1.73.0'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'BufferedMatrix' can be installed ... OK
* used C compiler: 'gcc.exe (GCC) 14.2.0'
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files for x64 is not available
File 'F:/biocbuild/bbs-3.22-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found '_exit', possibly from '_exit' (C)
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs nor [v]sprintf. The detected symbols are linked into
the code but might come from libraries and not actually be called.

See 'Writing portable packages' in the 'Writing R Extensions' manual.
* checking sizes of PDF files under 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ... NONE
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
  Running 'Rcodetesting.R'
  Running 'c_code_level_tests.R'
  Running 'objectTesting.R'
  Running 'rawCalltesting.R'
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  'F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   F:\biocbuild\bbs-3.22-bioc\R\bin\R.exe CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library 'F:/biocbuild/bbs-3.22-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** this is package 'BufferedMatrix' version '1.73.0'
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 14.2.0'
gcc  -I"F:/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG     -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall -std=gnu2x  -mfpmath=sse -msse2 -mstackrealign   -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"F:/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG     -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall -std=gnu2x  -mfpmath=sse -msse2 -mstackrealign   -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  -I"F:/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG     -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall -std=gnu2x  -mfpmath=sse -msse2 -mstackrealign   -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"F:/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG     -I"C:/rtools45/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall -std=gnu2x  -mfpmath=sse -msse2 -mstackrealign   -c init_package.c -o init_package.o
gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -LC:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools45/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.22-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.22-bioc/R/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs/x64
** 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
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 (2025-06-13 ucrt) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.31    0.15    1.45 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 (2025-06-13 ucrt) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 475147 25.4    1042854 55.7   629417 33.7
Vcells 867355  6.7    8388608 64.0  2039181 15.6
> 
> 
> 
> 
> ##
> ## 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] "Sat Aug  9 00:07:37 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] "Sat Aug  9 00:07:38 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: 0x00000246d44f96b0>
> 
> 
> 
> 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] "Sat Aug  9 00:08:04 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] "Sat Aug  9 00:08:11 2025"
> 
> ColMode(tmp2)
<pointer: 0x00000246d44f96b0>
> 
> 
> 
> ### 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,] 99.7742761  0.9405246  0.3538136 -0.08654952
[2,]  0.1003150 -1.2158946 -0.5258081  1.45978483
[3,]  0.9828074  0.7244732  0.8494815  2.06061103
[4,]  0.1151615  0.6195590  0.3808003 -0.59151938
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]       [,4]
[1,] 99.7742761 0.9405246 0.3538136 0.08654952
[2,]  0.1003150 1.2158946 0.5258081 1.45978483
[3,]  0.9828074 0.7244732 0.8494815 2.06061103
[4,]  0.1151615 0.6195590 0.3808003 0.59151938
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]     [,4]
[1,] 9.9887074 0.9698065 0.5948223 0.294193
[2,] 0.3167254 1.1026761 0.7251263 1.208216
[3,] 0.9913664 0.8511599 0.9216732 1.435483
[4,] 0.3393546 0.7871207 0.6170902 0.769103
> 
> 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:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.66135 35.63859 31.30204 28.02848
[2,]  28.26757 37.24266 32.77707 38.54194
[3,]  35.89647 34.23607 35.06621 41.41544
[4,]  28.50871 33.49077 31.55170 33.28255
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x00000246d44f9170>
> exp(tmp5)
<pointer: 0x00000246d44f9170>
> log(tmp5,2)
<pointer: 0x00000246d44f9170>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.6032
> Min(tmp5)
[1] 54.42917
> mean(tmp5)
[1] 72.75853
> Sum(tmp5)
[1] 14551.71
> Var(tmp5)
[1] 856.8237
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.52887 70.47513 70.81678 70.37298 68.91826 72.12014 69.44935 69.08824
 [9] 72.51485 72.30070
> rowSums(tmp5)
 [1] 1830.577 1409.503 1416.336 1407.460 1378.365 1442.403 1388.987 1381.765
 [9] 1450.297 1446.014
> rowVars(tmp5)
 [1] 7892.71308   72.07961   63.49999   85.71637   46.82095   63.38331
 [7]   86.56668   75.46475   86.94378   72.65222
> rowSd(tmp5)
 [1] 88.840943  8.489971  7.968688  9.258314  6.842584  7.961363  9.304121
 [8]  8.687045  9.324365  8.523627
> rowMax(tmp5)
 [1] 467.60317  82.19454  86.20081  88.27345  83.75476  92.16366  87.60008
 [8]  83.07662  85.45992  86.06855
> rowMin(tmp5)
 [1] 58.33761 57.43263 59.95367 57.85234 59.74235 61.59274 56.66580 54.42917
 [9] 58.11591 56.42161
> 
> colMeans(tmp5)
 [1] 105.36312  71.44378  69.73856  70.33111  69.79718  74.96564  68.53682
 [8]  74.76463  70.16909  69.21336  74.54571  72.16537  70.52909  67.40543
[15]  76.16053  66.61042  69.70319  71.67295  69.88501  72.16960
> colSums(tmp5)
 [1] 1053.6312  714.4378  697.3856  703.3111  697.9718  749.6564  685.3682
 [8]  747.6463  701.6909  692.1336  745.4571  721.6537  705.2909  674.0543
[15]  761.6053  666.1042  697.0319  716.7295  698.8501  721.6960
> colVars(tmp5)
 [1] 16259.68790    37.68341    24.23946    83.80881    69.21821    86.22531
 [7]    67.87489    81.92828    72.97866    61.22007    68.38634    61.82363
[13]    57.57954    85.33291    81.96007    46.60996    50.84316    69.53705
[19]    98.57449   101.78367
> colSd(tmp5)
 [1] 127.513481   6.138682   4.923359   9.154715   8.319748   9.285759
 [7]   8.238622   9.051424   8.542755   7.824325   8.269603   7.862800
[13]   7.588118   9.237582   9.053180   6.827148   7.130439   8.338888
[19]   9.928469  10.088789
> colMax(tmp5)
 [1] 467.60317  84.58173  78.72386  86.20081  82.73117  92.16366  82.19454
 [8]  87.22608  82.95600  83.07662  84.49055  85.90931  83.03458  81.84125
[15]  88.27345  79.46680  80.11709  87.60008  86.29671  82.89892
> colMin(tmp5)
 [1] 56.42161 63.70809 65.15109 58.33761 58.22474 59.95367 57.85234 59.94583
 [9] 60.81901 58.78891 59.74235 59.57977 58.11591 57.92712 61.13183 57.43263
[17] 59.68231 59.90375 56.66580 54.42917
> 
> 
> ### 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.52887 70.47513 70.81678 70.37298 68.91826 72.12014 69.44935 69.08824
 [9]       NA 72.30070
> rowSums(tmp5)
 [1] 1830.577 1409.503 1416.336 1407.460 1378.365 1442.403 1388.987 1381.765
 [9]       NA 1446.014
> rowVars(tmp5)
 [1] 7892.71308   72.07961   63.49999   85.71637   46.82095   63.38331
 [7]   86.56668   75.46475   83.77442   72.65222
> rowSd(tmp5)
 [1] 88.840943  8.489971  7.968688  9.258314  6.842584  7.961363  9.304121
 [8]  8.687045  9.152837  8.523627
> rowMax(tmp5)
 [1] 467.60317  82.19454  86.20081  88.27345  83.75476  92.16366  87.60008
 [8]  83.07662        NA  86.06855
> rowMin(tmp5)
 [1] 58.33761 57.43263 59.95367 57.85234 59.74235 61.59274 56.66580 54.42917
 [9]       NA 56.42161
> 
> colMeans(tmp5)
 [1] 105.36312  71.44378  69.73856  70.33111  69.79718  74.96564  68.53682
 [8]  74.76463        NA  69.21336  74.54571  72.16537  70.52909  67.40543
[15]  76.16053  66.61042  69.70319  71.67295  69.88501  72.16960
> colSums(tmp5)
 [1] 1053.6312  714.4378  697.3856  703.3111  697.9718  749.6564  685.3682
 [8]  747.6463        NA  692.1336  745.4571  721.6537  705.2909  674.0543
[15]  761.6053  666.1042  697.0319  716.7295  698.8501  721.6960
> colVars(tmp5)
 [1] 16259.68790    37.68341    24.23946    83.80881    69.21821    86.22531
 [7]    67.87489    81.92828          NA    61.22007    68.38634    61.82363
[13]    57.57954    85.33291    81.96007    46.60996    50.84316    69.53705
[19]    98.57449   101.78367
> colSd(tmp5)
 [1] 127.513481   6.138682   4.923359   9.154715   8.319748   9.285759
 [7]   8.238622   9.051424         NA   7.824325   8.269603   7.862800
[13]   7.588118   9.237582   9.053180   6.827148   7.130439   8.338888
[19]   9.928469  10.088789
> colMax(tmp5)
 [1] 467.60317  84.58173  78.72386  86.20081  82.73117  92.16366  82.19454
 [8]  87.22608        NA  83.07662  84.49055  85.90931  83.03458  81.84125
[15]  88.27345  79.46680  80.11709  87.60008  86.29671  82.89892
> colMin(tmp5)
 [1] 56.42161 63.70809 65.15109 58.33761 58.22474 59.95367 57.85234 59.94583
 [9]       NA 58.78891 59.74235 59.57977 58.11591 57.92712 61.13183 57.43263
[17] 59.68231 59.90375 56.66580 54.42917
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.6032
> Min(tmp5,na.rm=TRUE)
[1] 54.42917
> mean(tmp5,na.rm=TRUE)
[1] 72.81853
> Sum(tmp5,na.rm=TRUE)
[1] 14490.89
> Var(tmp5,na.rm=TRUE)
[1] 860.4275
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.52887 70.47513 70.81678 70.37298 68.91826 72.12014 69.44935 69.08824
 [9] 73.13042 72.30070
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.577 1409.503 1416.336 1407.460 1378.365 1442.403 1388.987 1381.765
 [9] 1389.478 1446.014
> rowVars(tmp5,na.rm=TRUE)
 [1] 7892.71308   72.07961   63.49999   85.71637   46.82095   63.38331
 [7]   86.56668   75.46475   83.77442   72.65222
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.840943  8.489971  7.968688  9.258314  6.842584  7.961363  9.304121
 [8]  8.687045  9.152837  8.523627
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.60317  82.19454  86.20081  88.27345  83.75476  92.16366  87.60008
 [8]  83.07662  85.45992  86.06855
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.33761 57.43263 59.95367 57.85234 59.74235 61.59274 56.66580 54.42917
 [9] 58.11591 56.42161
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 105.36312  71.44378  69.73856  70.33111  69.79718  74.96564  68.53682
 [8]  74.76463  71.20799  69.21336  74.54571  72.16537  70.52909  67.40543
[15]  76.16053  66.61042  69.70319  71.67295  69.88501  72.16960
> colSums(tmp5,na.rm=TRUE)
 [1] 1053.6312  714.4378  697.3856  703.3111  697.9718  749.6564  685.3682
 [8]  747.6463  640.8719  692.1336  745.4571  721.6537  705.2909  674.0543
[15]  761.6053  666.1042  697.0319  716.7295  698.8501  721.6960
> colVars(tmp5,na.rm=TRUE)
 [1] 16259.68790    37.68341    24.23946    83.80881    69.21821    86.22531
 [7]    67.87489    81.92828    69.95878    61.22007    68.38634    61.82363
[13]    57.57954    85.33291    81.96007    46.60996    50.84316    69.53705
[19]    98.57449   101.78367
> colSd(tmp5,na.rm=TRUE)
 [1] 127.513481   6.138682   4.923359   9.154715   8.319748   9.285759
 [7]   8.238622   9.051424   8.364136   7.824325   8.269603   7.862800
[13]   7.588118   9.237582   9.053180   6.827148   7.130439   8.338888
[19]   9.928469  10.088789
> colMax(tmp5,na.rm=TRUE)
 [1] 467.60317  84.58173  78.72386  86.20081  82.73117  92.16366  82.19454
 [8]  87.22608  82.95600  83.07662  84.49055  85.90931  83.03458  81.84125
[15]  88.27345  79.46680  80.11709  87.60008  86.29671  82.89892
> colMin(tmp5,na.rm=TRUE)
 [1] 56.42161 63.70809 65.15109 58.33761 58.22474 59.95367 57.85234 59.94583
 [9] 62.29706 58.78891 59.74235 59.57977 58.11591 57.92712 61.13183 57.43263
[17] 59.68231 59.90375 56.66580 54.42917
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.52887 70.47513 70.81678 70.37298 68.91826 72.12014 69.44935 69.08824
 [9]      NaN 72.30070
> rowSums(tmp5,na.rm=TRUE)
 [1] 1830.577 1409.503 1416.336 1407.460 1378.365 1442.403 1388.987 1381.765
 [9]    0.000 1446.014
> rowVars(tmp5,na.rm=TRUE)
 [1] 7892.71308   72.07961   63.49999   85.71637   46.82095   63.38331
 [7]   86.56668   75.46475         NA   72.65222
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.840943  8.489971  7.968688  9.258314  6.842584  7.961363  9.304121
 [8]  8.687045        NA  8.523627
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.60317  82.19454  86.20081  88.27345  83.75476  92.16366  87.60008
 [8]  83.07662        NA  86.06855
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.33761 57.43263 59.95367 57.85234 59.74235 61.59274 56.66580 54.42917
 [9]       NA 56.42161
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.08306  71.89463  68.74020  71.14625  69.17920  74.09682  69.35717
 [8]  73.57626       NaN  70.37163  74.06429  71.77209  71.90834  65.80145
[15]  75.73762  66.21250  70.81663  70.75518  69.01336  70.97745
> colSums(tmp5,na.rm=TRUE)
 [1] 981.7475 647.0517 618.6618 640.3163 622.6128 666.8714 624.2145 662.1864
 [9]   0.0000 633.3447 666.5786 645.9488 647.1750 592.2130 681.6385 595.9125
[17] 637.3496 636.7967 621.1202 638.7970
> colVars(tmp5,na.rm=TRUE)
 [1] 18136.47255    40.10715    16.05613    86.80970    73.57424    88.51153
 [7]    68.78830    76.28191          NA    53.77963    74.32732    67.81150
[13]    43.37599    67.05608    90.19296    50.65487    43.25160    68.75336
[19]   102.34875    98.51796
> colSd(tmp5,na.rm=TRUE)
 [1] 134.671721   6.333021   4.007010   9.317173   8.577543   9.408057
 [7]   8.293871   8.733952         NA   7.333460   8.621330   8.234774
[13]   6.586045   8.188778   9.496997   7.117223   6.576595   8.291765
[19]  10.116756   9.925621
> colMax(tmp5,na.rm=TRUE)
 [1] 467.60317  84.58173  77.43754  86.20081  82.73117  92.16366  82.19454
 [8]  87.22608      -Inf  83.07662  84.49055  85.90931  83.03458  81.63531
[15]  88.27345  79.46680  80.11709  87.60008  86.29671  81.75158
> colMin(tmp5,na.rm=TRUE)
 [1] 56.42161 63.70809 65.15109 58.33761 58.22474 59.95367 57.85234 59.94583
 [9]      Inf 62.75368 59.74235 59.57977 59.13038 57.92712 61.13183 57.43263
[17] 62.00267 59.90375 56.66580 54.42917
> 
> 
> 
> 
> 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] 274.9764 275.8227 138.1728 234.2177 215.0253 136.7968 284.9020 209.9214
 [9] 180.2962 149.4878
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 274.9764 275.8227 138.1728 234.2177 215.0253 136.7968 284.9020 209.9214
 [9] 180.2962 149.4878
> 
> 
> 
> 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] -8.526513e-14  1.136868e-13 -2.131628e-14  5.684342e-14 -5.684342e-14
 [6] -5.684342e-14 -1.136868e-13  0.000000e+00 -8.526513e-14 -1.136868e-13
[11]  0.000000e+00  1.136868e-13 -2.842171e-14 -2.842171e-14  4.263256e-14
[16]  5.684342e-14 -5.684342e-14 -1.421085e-14 -1.136868e-13  1.705303e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
7   6 
1   12 
9   5 
4   8 
5   9 
4   6 
4   5 
9   13 
4   19 
5   20 
6   4 
3   18 
7   13 
3   6 
8   7 
5   5 
10   20 
1   6 
10   4 
6   11 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 3.488276
> Min(tmp)
[1] -3.050154
> mean(tmp)
[1] 0.2145432
> Sum(tmp)
[1] 21.45432
> Var(tmp)
[1] 1.020015
> 
> rowMeans(tmp)
[1] 0.2145432
> rowSums(tmp)
[1] 21.45432
> rowVars(tmp)
[1] 1.020015
> rowSd(tmp)
[1] 1.009958
> rowMax(tmp)
[1] 3.488276
> rowMin(tmp)
[1] -3.050154
> 
> colMeans(tmp)
  [1]  0.378365582 -0.680806507  0.431865951  0.313294206 -1.625025388
  [6]  0.313911649  1.629820842  0.328559037 -0.433710889 -0.336779181
 [11]  0.612836511  1.669994255 -0.326264525  0.372878807  1.062650137
 [16]  0.969572693  0.437856293 -1.016809239  0.298434067 -0.998356515
 [21] -1.932141388  1.358002747 -1.431971598  0.425895526  0.817667979
 [26] -0.171560678 -0.180559125  1.371359768  0.926034357  0.219910364
 [31] -0.760973004  1.291716605 -1.103727721 -0.344145217  0.606040426
 [36]  1.380546843 -0.112673420 -0.537852734 -0.438800043 -0.261522175
 [41]  0.452859141 -0.316674085 -0.925326709 -0.251911336 -0.042343517
 [46]  2.339161942 -0.922019042  0.547630573 -0.277643741  1.619551869
 [51] -1.272751247  0.495103140  0.015434728  0.799190424  0.748417778
 [56] -0.294719778  0.474429910  2.350526252  0.244291225 -1.596399081
 [61]  0.351464939  0.740388281  0.420112894  0.592696502  0.655909165
 [66] -0.580090435  0.331160355  2.440336515 -1.115787256 -0.139132339
 [71] -1.395038556  0.254070548  0.917739638  3.488275666 -0.008178946
 [76]  1.963062514 -0.479795883  0.545599766  1.022337242  0.549872155
 [81]  0.131520545  0.766089570  0.136519054 -0.008470558  1.077944552
 [86] -0.625999541 -0.465499929 -0.324634535  0.682100366 -0.534936102
 [91] -1.324907625  1.605507982  0.938663771 -0.018525670 -0.249725986
 [96]  0.333289399  0.854783506 -3.050154277  1.199905608  1.065505617
> colSums(tmp)
  [1]  0.378365582 -0.680806507  0.431865951  0.313294206 -1.625025388
  [6]  0.313911649  1.629820842  0.328559037 -0.433710889 -0.336779181
 [11]  0.612836511  1.669994255 -0.326264525  0.372878807  1.062650137
 [16]  0.969572693  0.437856293 -1.016809239  0.298434067 -0.998356515
 [21] -1.932141388  1.358002747 -1.431971598  0.425895526  0.817667979
 [26] -0.171560678 -0.180559125  1.371359768  0.926034357  0.219910364
 [31] -0.760973004  1.291716605 -1.103727721 -0.344145217  0.606040426
 [36]  1.380546843 -0.112673420 -0.537852734 -0.438800043 -0.261522175
 [41]  0.452859141 -0.316674085 -0.925326709 -0.251911336 -0.042343517
 [46]  2.339161942 -0.922019042  0.547630573 -0.277643741  1.619551869
 [51] -1.272751247  0.495103140  0.015434728  0.799190424  0.748417778
 [56] -0.294719778  0.474429910  2.350526252  0.244291225 -1.596399081
 [61]  0.351464939  0.740388281  0.420112894  0.592696502  0.655909165
 [66] -0.580090435  0.331160355  2.440336515 -1.115787256 -0.139132339
 [71] -1.395038556  0.254070548  0.917739638  3.488275666 -0.008178946
 [76]  1.963062514 -0.479795883  0.545599766  1.022337242  0.549872155
 [81]  0.131520545  0.766089570  0.136519054 -0.008470558  1.077944552
 [86] -0.625999541 -0.465499929 -0.324634535  0.682100366 -0.534936102
 [91] -1.324907625  1.605507982  0.938663771 -0.018525670 -0.249725986
 [96]  0.333289399  0.854783506 -3.050154277  1.199905608  1.065505617
> 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.378365582 -0.680806507  0.431865951  0.313294206 -1.625025388
  [6]  0.313911649  1.629820842  0.328559037 -0.433710889 -0.336779181
 [11]  0.612836511  1.669994255 -0.326264525  0.372878807  1.062650137
 [16]  0.969572693  0.437856293 -1.016809239  0.298434067 -0.998356515
 [21] -1.932141388  1.358002747 -1.431971598  0.425895526  0.817667979
 [26] -0.171560678 -0.180559125  1.371359768  0.926034357  0.219910364
 [31] -0.760973004  1.291716605 -1.103727721 -0.344145217  0.606040426
 [36]  1.380546843 -0.112673420 -0.537852734 -0.438800043 -0.261522175
 [41]  0.452859141 -0.316674085 -0.925326709 -0.251911336 -0.042343517
 [46]  2.339161942 -0.922019042  0.547630573 -0.277643741  1.619551869
 [51] -1.272751247  0.495103140  0.015434728  0.799190424  0.748417778
 [56] -0.294719778  0.474429910  2.350526252  0.244291225 -1.596399081
 [61]  0.351464939  0.740388281  0.420112894  0.592696502  0.655909165
 [66] -0.580090435  0.331160355  2.440336515 -1.115787256 -0.139132339
 [71] -1.395038556  0.254070548  0.917739638  3.488275666 -0.008178946
 [76]  1.963062514 -0.479795883  0.545599766  1.022337242  0.549872155
 [81]  0.131520545  0.766089570  0.136519054 -0.008470558  1.077944552
 [86] -0.625999541 -0.465499929 -0.324634535  0.682100366 -0.534936102
 [91] -1.324907625  1.605507982  0.938663771 -0.018525670 -0.249725986
 [96]  0.333289399  0.854783506 -3.050154277  1.199905608  1.065505617
> colMin(tmp)
  [1]  0.378365582 -0.680806507  0.431865951  0.313294206 -1.625025388
  [6]  0.313911649  1.629820842  0.328559037 -0.433710889 -0.336779181
 [11]  0.612836511  1.669994255 -0.326264525  0.372878807  1.062650137
 [16]  0.969572693  0.437856293 -1.016809239  0.298434067 -0.998356515
 [21] -1.932141388  1.358002747 -1.431971598  0.425895526  0.817667979
 [26] -0.171560678 -0.180559125  1.371359768  0.926034357  0.219910364
 [31] -0.760973004  1.291716605 -1.103727721 -0.344145217  0.606040426
 [36]  1.380546843 -0.112673420 -0.537852734 -0.438800043 -0.261522175
 [41]  0.452859141 -0.316674085 -0.925326709 -0.251911336 -0.042343517
 [46]  2.339161942 -0.922019042  0.547630573 -0.277643741  1.619551869
 [51] -1.272751247  0.495103140  0.015434728  0.799190424  0.748417778
 [56] -0.294719778  0.474429910  2.350526252  0.244291225 -1.596399081
 [61]  0.351464939  0.740388281  0.420112894  0.592696502  0.655909165
 [66] -0.580090435  0.331160355  2.440336515 -1.115787256 -0.139132339
 [71] -1.395038556  0.254070548  0.917739638  3.488275666 -0.008178946
 [76]  1.963062514 -0.479795883  0.545599766  1.022337242  0.549872155
 [81]  0.131520545  0.766089570  0.136519054 -0.008470558  1.077944552
 [86] -0.625999541 -0.465499929 -0.324634535  0.682100366 -0.534936102
 [91] -1.324907625  1.605507982  0.938663771 -0.018525670 -0.249725986
 [96]  0.333289399  0.854783506 -3.050154277  1.199905608  1.065505617
> colMedians(tmp)
  [1]  0.378365582 -0.680806507  0.431865951  0.313294206 -1.625025388
  [6]  0.313911649  1.629820842  0.328559037 -0.433710889 -0.336779181
 [11]  0.612836511  1.669994255 -0.326264525  0.372878807  1.062650137
 [16]  0.969572693  0.437856293 -1.016809239  0.298434067 -0.998356515
 [21] -1.932141388  1.358002747 -1.431971598  0.425895526  0.817667979
 [26] -0.171560678 -0.180559125  1.371359768  0.926034357  0.219910364
 [31] -0.760973004  1.291716605 -1.103727721 -0.344145217  0.606040426
 [36]  1.380546843 -0.112673420 -0.537852734 -0.438800043 -0.261522175
 [41]  0.452859141 -0.316674085 -0.925326709 -0.251911336 -0.042343517
 [46]  2.339161942 -0.922019042  0.547630573 -0.277643741  1.619551869
 [51] -1.272751247  0.495103140  0.015434728  0.799190424  0.748417778
 [56] -0.294719778  0.474429910  2.350526252  0.244291225 -1.596399081
 [61]  0.351464939  0.740388281  0.420112894  0.592696502  0.655909165
 [66] -0.580090435  0.331160355  2.440336515 -1.115787256 -0.139132339
 [71] -1.395038556  0.254070548  0.917739638  3.488275666 -0.008178946
 [76]  1.963062514 -0.479795883  0.545599766  1.022337242  0.549872155
 [81]  0.131520545  0.766089570  0.136519054 -0.008470558  1.077944552
 [86] -0.625999541 -0.465499929 -0.324634535  0.682100366 -0.534936102
 [91] -1.324907625  1.605507982  0.938663771 -0.018525670 -0.249725986
 [96]  0.333289399  0.854783506 -3.050154277  1.199905608  1.065505617
> colRanges(tmp)
          [,1]       [,2]     [,3]      [,4]      [,5]      [,6]     [,7]
[1,] 0.3783656 -0.6808065 0.431866 0.3132942 -1.625025 0.3139116 1.629821
[2,] 0.3783656 -0.6808065 0.431866 0.3132942 -1.625025 0.3139116 1.629821
         [,8]       [,9]      [,10]     [,11]    [,12]      [,13]     [,14]
[1,] 0.328559 -0.4337109 -0.3367792 0.6128365 1.669994 -0.3262645 0.3728788
[2,] 0.328559 -0.4337109 -0.3367792 0.6128365 1.669994 -0.3262645 0.3728788
       [,15]     [,16]     [,17]     [,18]     [,19]      [,20]     [,21]
[1,] 1.06265 0.9695727 0.4378563 -1.016809 0.2984341 -0.9983565 -1.932141
[2,] 1.06265 0.9695727 0.4378563 -1.016809 0.2984341 -0.9983565 -1.932141
        [,22]     [,23]     [,24]    [,25]      [,26]      [,27]   [,28]
[1,] 1.358003 -1.431972 0.4258955 0.817668 -0.1715607 -0.1805591 1.37136
[2,] 1.358003 -1.431972 0.4258955 0.817668 -0.1715607 -0.1805591 1.37136
         [,29]     [,30]     [,31]    [,32]     [,33]      [,34]     [,35]
[1,] 0.9260344 0.2199104 -0.760973 1.291717 -1.103728 -0.3441452 0.6060404
[2,] 0.9260344 0.2199104 -0.760973 1.291717 -1.103728 -0.3441452 0.6060404
        [,36]      [,37]      [,38]   [,39]      [,40]     [,41]      [,42]
[1,] 1.380547 -0.1126734 -0.5378527 -0.4388 -0.2615222 0.4528591 -0.3166741
[2,] 1.380547 -0.1126734 -0.5378527 -0.4388 -0.2615222 0.4528591 -0.3166741
          [,43]      [,44]       [,45]    [,46]     [,47]     [,48]      [,49]
[1,] -0.9253267 -0.2519113 -0.04234352 2.339162 -0.922019 0.5476306 -0.2776437
[2,] -0.9253267 -0.2519113 -0.04234352 2.339162 -0.922019 0.5476306 -0.2776437
        [,50]     [,51]     [,52]      [,53]     [,54]     [,55]      [,56]
[1,] 1.619552 -1.272751 0.4951031 0.01543473 0.7991904 0.7484178 -0.2947198
[2,] 1.619552 -1.272751 0.4951031 0.01543473 0.7991904 0.7484178 -0.2947198
         [,57]    [,58]     [,59]     [,60]     [,61]     [,62]     [,63]
[1,] 0.4744299 2.350526 0.2442912 -1.596399 0.3514649 0.7403883 0.4201129
[2,] 0.4744299 2.350526 0.2442912 -1.596399 0.3514649 0.7403883 0.4201129
         [,64]     [,65]      [,66]     [,67]    [,68]     [,69]      [,70]
[1,] 0.5926965 0.6559092 -0.5800904 0.3311604 2.440337 -1.115787 -0.1391323
[2,] 0.5926965 0.6559092 -0.5800904 0.3311604 2.440337 -1.115787 -0.1391323
         [,71]     [,72]     [,73]    [,74]        [,75]    [,76]      [,77]
[1,] -1.395039 0.2540705 0.9177396 3.488276 -0.008178946 1.963063 -0.4797959
[2,] -1.395039 0.2540705 0.9177396 3.488276 -0.008178946 1.963063 -0.4797959
         [,78]    [,79]     [,80]     [,81]     [,82]     [,83]        [,84]
[1,] 0.5455998 1.022337 0.5498722 0.1315205 0.7660896 0.1365191 -0.008470558
[2,] 0.5455998 1.022337 0.5498722 0.1315205 0.7660896 0.1365191 -0.008470558
        [,85]      [,86]      [,87]      [,88]     [,89]      [,90]     [,91]
[1,] 1.077945 -0.6259995 -0.4654999 -0.3246345 0.6821004 -0.5349361 -1.324908
[2,] 1.077945 -0.6259995 -0.4654999 -0.3246345 0.6821004 -0.5349361 -1.324908
        [,92]     [,93]       [,94]     [,95]     [,96]     [,97]     [,98]
[1,] 1.605508 0.9386638 -0.01852567 -0.249726 0.3332894 0.8547835 -3.050154
[2,] 1.605508 0.9386638 -0.01852567 -0.249726 0.3332894 0.8547835 -3.050154
        [,99]   [,100]
[1,] 1.199906 1.065506
[2,] 1.199906 1.065506
> 
> 
> Max(tmp2)
[1] 2.373169
> Min(tmp2)
[1] -2.40241
> mean(tmp2)
[1] -0.1935036
> Sum(tmp2)
[1] -19.35036
> Var(tmp2)
[1] 0.9810588
> 
> rowMeans(tmp2)
  [1] -1.2360474688 -1.4991778652  1.2935607349 -0.3750388853 -0.6476442913
  [6]  0.1119763814  0.5886365670 -0.5246527064  1.7613110723 -0.9550866166
 [11] -0.2035181720  0.4054678382 -0.0826533311  0.0023421527 -1.5941499322
 [16] -1.0721914942  0.2848034230 -2.1581523065 -0.2007018316 -2.0383741838
 [21]  0.6207500426  0.0537438174  0.8505100349 -0.7524662888  0.2244342028
 [26] -1.0753184282  0.5007868880 -0.0001184787 -0.8133684072 -0.2679262959
 [31] -0.1707417308 -0.5324651577 -1.6161263786 -0.3863351270 -1.6694545405
 [36]  1.8164236623 -1.6063442403 -1.2316660242  1.1896918278 -1.8715083821
 [41] -0.8735794051  0.4925767948  0.1009475273 -2.4024104317 -0.8002304407
 [46]  0.7245554839  0.2862081335 -0.0075983851  2.3731692629  1.5135662378
 [51]  0.0362379507 -0.1999243035  1.1143971268 -0.1023327489 -0.9665910506
 [56]  0.3855139148 -1.2577760315 -1.5157283504 -0.4107858311  0.4235314671
 [61]  0.2063234237 -0.4796168342  1.2264640848  0.2157987803  0.2605899295
 [66]  0.1614668404 -0.3048278480 -0.7001744460  0.6033121752 -0.5781818861
 [71]  1.3913788925  0.5512213091 -0.1936726136 -1.5700293700  0.9071717753
 [76] -0.5011117341  1.1106732386 -0.6456136770  0.2926270646  0.2267234358
 [81] -0.0857251254 -1.3948050274 -1.3956860858 -1.0886919395  0.8650176820
 [86]  0.7513640610 -1.9809513209  1.2470488004 -0.7688684270  0.9620601855
 [91] -1.4541062095  0.2227460751 -0.3800202519 -0.7692623240  0.3339499872
 [96] -2.0533381184  0.1563965852  1.0851400581 -0.1597676050  0.3396584329
> rowSums(tmp2)
  [1] -1.2360474688 -1.4991778652  1.2935607349 -0.3750388853 -0.6476442913
  [6]  0.1119763814  0.5886365670 -0.5246527064  1.7613110723 -0.9550866166
 [11] -0.2035181720  0.4054678382 -0.0826533311  0.0023421527 -1.5941499322
 [16] -1.0721914942  0.2848034230 -2.1581523065 -0.2007018316 -2.0383741838
 [21]  0.6207500426  0.0537438174  0.8505100349 -0.7524662888  0.2244342028
 [26] -1.0753184282  0.5007868880 -0.0001184787 -0.8133684072 -0.2679262959
 [31] -0.1707417308 -0.5324651577 -1.6161263786 -0.3863351270 -1.6694545405
 [36]  1.8164236623 -1.6063442403 -1.2316660242  1.1896918278 -1.8715083821
 [41] -0.8735794051  0.4925767948  0.1009475273 -2.4024104317 -0.8002304407
 [46]  0.7245554839  0.2862081335 -0.0075983851  2.3731692629  1.5135662378
 [51]  0.0362379507 -0.1999243035  1.1143971268 -0.1023327489 -0.9665910506
 [56]  0.3855139148 -1.2577760315 -1.5157283504 -0.4107858311  0.4235314671
 [61]  0.2063234237 -0.4796168342  1.2264640848  0.2157987803  0.2605899295
 [66]  0.1614668404 -0.3048278480 -0.7001744460  0.6033121752 -0.5781818861
 [71]  1.3913788925  0.5512213091 -0.1936726136 -1.5700293700  0.9071717753
 [76] -0.5011117341  1.1106732386 -0.6456136770  0.2926270646  0.2267234358
 [81] -0.0857251254 -1.3948050274 -1.3956860858 -1.0886919395  0.8650176820
 [86]  0.7513640610 -1.9809513209  1.2470488004 -0.7688684270  0.9620601855
 [91] -1.4541062095  0.2227460751 -0.3800202519 -0.7692623240  0.3339499872
 [96] -2.0533381184  0.1563965852  1.0851400581 -0.1597676050  0.3396584329
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.2360474688 -1.4991778652  1.2935607349 -0.3750388853 -0.6476442913
  [6]  0.1119763814  0.5886365670 -0.5246527064  1.7613110723 -0.9550866166
 [11] -0.2035181720  0.4054678382 -0.0826533311  0.0023421527 -1.5941499322
 [16] -1.0721914942  0.2848034230 -2.1581523065 -0.2007018316 -2.0383741838
 [21]  0.6207500426  0.0537438174  0.8505100349 -0.7524662888  0.2244342028
 [26] -1.0753184282  0.5007868880 -0.0001184787 -0.8133684072 -0.2679262959
 [31] -0.1707417308 -0.5324651577 -1.6161263786 -0.3863351270 -1.6694545405
 [36]  1.8164236623 -1.6063442403 -1.2316660242  1.1896918278 -1.8715083821
 [41] -0.8735794051  0.4925767948  0.1009475273 -2.4024104317 -0.8002304407
 [46]  0.7245554839  0.2862081335 -0.0075983851  2.3731692629  1.5135662378
 [51]  0.0362379507 -0.1999243035  1.1143971268 -0.1023327489 -0.9665910506
 [56]  0.3855139148 -1.2577760315 -1.5157283504 -0.4107858311  0.4235314671
 [61]  0.2063234237 -0.4796168342  1.2264640848  0.2157987803  0.2605899295
 [66]  0.1614668404 -0.3048278480 -0.7001744460  0.6033121752 -0.5781818861
 [71]  1.3913788925  0.5512213091 -0.1936726136 -1.5700293700  0.9071717753
 [76] -0.5011117341  1.1106732386 -0.6456136770  0.2926270646  0.2267234358
 [81] -0.0857251254 -1.3948050274 -1.3956860858 -1.0886919395  0.8650176820
 [86]  0.7513640610 -1.9809513209  1.2470488004 -0.7688684270  0.9620601855
 [91] -1.4541062095  0.2227460751 -0.3800202519 -0.7692623240  0.3339499872
 [96] -2.0533381184  0.1563965852  1.0851400581 -0.1597676050  0.3396584329
> rowMin(tmp2)
  [1] -1.2360474688 -1.4991778652  1.2935607349 -0.3750388853 -0.6476442913
  [6]  0.1119763814  0.5886365670 -0.5246527064  1.7613110723 -0.9550866166
 [11] -0.2035181720  0.4054678382 -0.0826533311  0.0023421527 -1.5941499322
 [16] -1.0721914942  0.2848034230 -2.1581523065 -0.2007018316 -2.0383741838
 [21]  0.6207500426  0.0537438174  0.8505100349 -0.7524662888  0.2244342028
 [26] -1.0753184282  0.5007868880 -0.0001184787 -0.8133684072 -0.2679262959
 [31] -0.1707417308 -0.5324651577 -1.6161263786 -0.3863351270 -1.6694545405
 [36]  1.8164236623 -1.6063442403 -1.2316660242  1.1896918278 -1.8715083821
 [41] -0.8735794051  0.4925767948  0.1009475273 -2.4024104317 -0.8002304407
 [46]  0.7245554839  0.2862081335 -0.0075983851  2.3731692629  1.5135662378
 [51]  0.0362379507 -0.1999243035  1.1143971268 -0.1023327489 -0.9665910506
 [56]  0.3855139148 -1.2577760315 -1.5157283504 -0.4107858311  0.4235314671
 [61]  0.2063234237 -0.4796168342  1.2264640848  0.2157987803  0.2605899295
 [66]  0.1614668404 -0.3048278480 -0.7001744460  0.6033121752 -0.5781818861
 [71]  1.3913788925  0.5512213091 -0.1936726136 -1.5700293700  0.9071717753
 [76] -0.5011117341  1.1106732386 -0.6456136770  0.2926270646  0.2267234358
 [81] -0.0857251254 -1.3948050274 -1.3956860858 -1.0886919395  0.8650176820
 [86]  0.7513640610 -1.9809513209  1.2470488004 -0.7688684270  0.9620601855
 [91] -1.4541062095  0.2227460751 -0.3800202519 -0.7692623240  0.3339499872
 [96] -2.0533381184  0.1563965852  1.0851400581 -0.1597676050  0.3396584329
> 
> colMeans(tmp2)
[1] -0.1935036
> colSums(tmp2)
[1] -19.35036
> colVars(tmp2)
[1] 0.9810588
> colSd(tmp2)
[1] 0.9904841
> colMax(tmp2)
[1] 2.373169
> colMin(tmp2)
[1] -2.40241
> colMedians(tmp2)
[1] -0.1310502
> colRanges(tmp2)
          [,1]
[1,] -2.402410
[2,]  2.373169
> 
> 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]  2.305369  3.182852  1.298768 -3.617867 -2.538633 -3.234432  2.755523
 [8] -1.331573  1.524517  3.909332
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0882051
[2,] -0.1904306
[3,]  0.2234304
[4,]  0.4947568
[5,]  2.0205774
> 
> rowApply(tmp,sum)
 [1]  2.1954364 -1.9132155  3.0648777  1.3594272  1.0373822 -0.6582862
 [7]  3.2943336 -1.8687813 -0.7704604 -1.4868583
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    5    9    2    4    8    6   10    8    4     7
 [2,]    7   10   10    3    3    8    2    7    2     9
 [3,]   10    4    3   10    5    7    9    9    1    10
 [4,]    4    8    1    8   10    4    1    2    3     1
 [5,]    6    2    4    1    4    2    8    5    9     3
 [6,]    1    5    8    9    1    1    4    1    5     5
 [7,]    2    7    5    7    9   10    5    3    6     6
 [8,]    3    1    7    2    6    3    3   10   10     4
 [9,]    9    3    6    5    7    5    6    4    7     8
[10,]    8    6    9    6    2    9    7    6    8     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -4.0791330 -2.5470530 -0.5214076 -0.8485810  2.0923133  0.1030399
 [7]  2.7784061  3.6704245 -0.2099510 -0.5157165  1.2023964  0.5893615
[13]  3.6733899 -0.5153520 -4.1487039  2.8830473  0.6873637  0.1324985
[19] -0.7699704  0.8595896
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.67661264
[2,] -1.28400499
[3,] -0.34120907
[4,] -0.03829339
[5,]  0.26098713
> 
> rowApply(tmp,sum)
[1]  3.28208296 -0.02768923  3.43293192 -3.75553920  1.58417594
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    2    9    9    1
[2,]   17    8    1   14    2
[3,]   18    4   19    1   10
[4,]    4    3   15    8   11
[5,]    9    9    7   19   14
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]       [,4]          [,5]       [,6]
[1,] -0.03829339  1.22498070  1.2739715 -0.4422599 -0.0004827283 -0.4063697
[2,] -1.28400499 -0.06001312 -0.9685496 -1.0772437  0.0425808250 -2.0900293
[3,]  0.26098713 -2.36808242  1.4626039  0.8630546 -0.2588258086  0.6641325
[4,] -0.34120907  0.07902208 -2.1947203 -0.3673802  1.6361031821 -0.7721118
[5,] -2.67661264 -1.42296028 -0.0947130  0.1752481  0.6729378599  2.7074182
          [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,] 0.2945975  1.3722089 -1.6190640  0.5061440 -0.5662210  0.14178686
[2,] 0.4365026  1.0897820  1.1897935  0.6477911  0.6637353  0.69092345
[3,] 0.8724013 -0.7567646  0.2634975 -0.9278522  1.4238839  0.06322443
[4,] 0.2611864  1.7877979 -0.2549422 -0.2252391 -0.1898885 -1.05084931
[5,] 0.9137184  0.1774004  0.2107643 -0.5165603 -0.1291133  0.74427606
          [,13]      [,14]      [,15]      [,16]       [,17]       [,18]
[1,]  1.4157896 -0.1872719 -1.2271034  0.1255084 -0.01323803  0.21521095
[2,]  0.6318417  0.1746781 -0.7180584 -0.1239286  1.24224017  0.06153019
[3,]  1.8305281  0.4284396 -1.0399550  0.5580177 -1.07961710  1.33986733
[4,]  0.1452510 -1.9233714 -0.9903822  1.1351658 -0.30475086 -0.68307471
[5,] -0.3500205  0.9921736 -0.1732048  1.1882840  0.84272951 -0.80103531
           [,19]      [,20]
[1,]  0.07808596  1.1341026
[2,] -0.78630375  0.2090434
[3,] -0.71966952  0.5530607
[4,]  1.36025041 -0.8623962
[5,] -0.70233349 -0.1742209
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  629  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  546  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  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.2621484 -0.3654102 -0.546369 0.1773965 -0.7852201 -1.24969 1.782616
           col8     col9    col10     col11     col12     col13      col14
row1 -0.2438102 1.762912 0.432736 0.6386464 0.5274045 0.9723266 -0.8552122
          col15    col16    col17       col18     col19     col20
row1 -0.8374509 1.548154 2.156479 -0.02839292 0.5281973 0.1641054
> tmp[,"col10"]
          col10
row1  0.4327360
row2 -0.2335032
row3  0.4007973
row4 -0.2315592
row5  0.8175095
> tmp[c("row1","row5"),]
           col1       col2       col3       col4       col5       col6
row1 -0.2621484 -0.3654102 -0.5463690  0.1773965 -0.7852201 -1.2496905
row5  0.5000589  0.5438590  0.7306068 -0.9673942 -0.5052409  0.9656341
           col7       col8      col9     col10      col11     col12     col13
row1  1.7826160 -0.2438102 1.7629124 0.4327360  0.6386464 0.5274045 0.9723266
row5 -0.6109394  0.9256809 0.9465255 0.8175095 -0.7186366 0.9913833 0.2222469
          col14      col15     col16     col17       col18      col19     col20
row1 -0.8552122 -0.8374509 1.5481544  2.156479 -0.02839292  0.5281973 0.1641054
row5 -0.9146785  0.8718493 0.6769968 -0.304821  0.87875983 -0.4543623 1.5445801
> tmp[,c("col6","col20")]
            col6      col20
row1 -1.24969045  0.1641054
row2 -0.03525355  0.1407463
row3 -0.56688291  0.3243146
row4 -0.60164469 -2.4396175
row5  0.96563411  1.5445801
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -1.2496905 0.1641054
row5  0.9656341 1.5445801
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.08468 50.51032 49.03734 50.38336 50.88941 105.5663 49.58607 49.80753
        col9   col10    col11    col12    col13    col14    col15    col16
row1 47.7797 50.4125 50.62635 51.10863 48.68706 50.92912 52.37355 50.09712
        col17    col18    col19    col20
row1 51.01081 49.63176 49.43556 103.4447
> tmp[,"col10"]
        col10
row1 50.41250
row2 28.72286
row3 29.53091
row4 30.42627
row5 49.70401
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 51.08468 50.51032 49.03734 50.38336 50.88941 105.5663 49.58607 49.80753
row5 49.00535 51.50061 50.48512 49.89135 50.79957 105.8654 49.65806 49.82336
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.77970 50.41250 50.62635 51.10863 48.68706 50.92912 52.37355 50.09712
row5 51.26354 49.70401 51.01737 51.03559 51.49866 50.45465 50.39078 49.76934
        col17    col18    col19    col20
row1 51.01081 49.63176 49.43556 103.4447
row5 49.89389 49.72442 49.02067 105.2243
> tmp[,c("col6","col20")]
          col6     col20
row1 105.56627 103.44465
row2  75.68684  74.66068
row3  76.24470  75.18321
row4  73.66846  74.38804
row5 105.86542 105.22430
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.5663 103.4447
row5 105.8654 105.2243
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.5663 103.4447
row5 105.8654 105.2243
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.2511284
[2,]  0.6476086
[3,]  0.2078933
[4,] -1.3602460
[5,] -0.2507328
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.1248303  1.46682719
[2,] -0.5254832  1.56871835
[3,] -0.4637942 -2.07429760
[4,] -0.7699991  0.03908203
[5,]  0.1640341  0.39007517
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -1.15361819 -0.5335676
[2,]  0.06174931  2.3004789
[3,] -0.49289724  0.2052230
[4,]  0.04615031 -1.2160805
[5,]  0.33652315 -1.5298917
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.153618
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -1.15361819
[2,]  0.06174931
> 
> 
> 
> 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.03463466 0.4571691 -0.08596694 0.47757813 -0.8868315  0.45263076
row1 -0.51073190 0.1261284  0.26193726 0.06021655 -0.1758335 -0.04255789
           [,7]      [,8]       [,9]     [,10]     [,11]     [,12]      [,13]
row3 -0.2069474 -1.265807 -0.6522688 -0.171931 1.1006855 -1.749679  0.7133206
row1  1.0070237  0.201202 -0.5790946  0.666800 0.2162551 -1.270426 -1.4423590
          [,14]      [,15]      [,16]      [,17]     [,18]      [,19]     [,20]
row3  0.9316027 -0.4366056 -0.5141174 -0.4052736 0.3642961 -1.3840129 -1.014435
row1 -1.6373853 -0.2115269  0.6658202  0.9984346 0.1276461 -0.2342116  1.872170
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]    [,2]      [,3]     [,4]       [,5]      [,6]      [,7]
row2 1.051992 1.02313 0.9721879 1.189518 0.08573199 -1.292795 -1.402221
           [,8]       [,9]       [,10]
row2 -0.3336427 -0.7365037 -0.03666834
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]       [,4]     [,5]      [,6]   [,7]
row5 0.4670762 -0.5723964 0.4913136 -0.6672081 1.002682 -1.686422 0.1995
          [,8]      [,9]      [,10]    [,11]    [,12]     [,13]     [,14]
row5 0.2584657 0.4043035 -0.5315823 -2.36771 1.430762 -1.306303 0.1689972
          [,15]     [,16]     [,17]     [,18]     [,19]      [,20]
row5 -0.4587195 0.4013368 0.8491401 0.2012955 0.4801484 -0.1588016
> 
> 
> 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: 0x00000246d44f91d0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd4a7e60b"  
 [2] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd44b824039"
 [3] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd4a74b8d"  
 [4] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd41e104590"
 [5] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd410a7e8b" 
 [6] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd44b9733b6"
 [7] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd41345bc7" 
 [8] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd47fe46114"
 [9] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd4419d1da6"
[10] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd432d250e6"
[11] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd4118e23d8"
[12] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd4416337fa"
[13] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd44140e3b" 
[14] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd41d0f3eb4"
[15] "F:/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests\\BM19cd421134efd"
> 
> 
> ### 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: 0x00000246d44f9dd0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x00000246d44f9dd0>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.22-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x00000246d44f9dd0>
> rowMedians(tmp)
  [1] -0.1062727303  0.3483936980  0.0942004423  0.4027686862  0.3850933130
  [6]  0.0823381073  0.3393363041  0.0088851513 -0.2506812040 -0.5284442775
 [11] -0.1068099755 -0.3426190300 -0.1293096021  0.3573117346 -0.0507496902
 [16]  0.4651860988  0.1214206024  0.0180469348  0.2498829592 -0.0648047301
 [21] -0.0150241445  0.1431433219  0.2812788553 -0.0164345309 -0.3884466203
 [26] -0.3734427734  0.6367315803  0.2046948813 -0.5712516977 -0.2905204406
 [31] -0.6186966239  0.4291838749  0.4660002044 -0.5227366615 -0.0264638554
 [36]  0.4654700038  0.1315373040  0.0114106760 -0.0035913569 -0.0485849407
 [41] -0.2290664532  0.2468036040  0.2284555051 -0.3301296885 -0.0291980731
 [46] -0.3139640713 -0.4529554860 -0.0083956965  0.1218033130 -0.1764800088
 [51] -0.4513382186 -0.3354390612 -0.0103974996 -0.0387303816 -0.0947697742
 [56]  0.1177149192 -0.3736138206  0.0599165336  0.1946016559 -0.0744049518
 [61]  0.0226114886  0.4223253305  0.1432034735 -0.2270505108 -0.2165072410
 [66]  0.2615319028 -0.0702044621 -0.2062473588  0.8901533406 -0.6705095070
 [71]  0.2074011356  0.1713110493 -0.5770351923 -0.3982444786  0.3918983979
 [76] -0.3032917447 -0.2823010015 -0.1056686373  0.1650987986  0.3182415093
 [81]  0.7010431842 -0.1990852320  0.0527733566 -0.7349606301  0.0468434471
 [86]  0.1931963120  0.0162886112  0.2962493708 -0.1243062780 -0.0636939148
 [91]  0.3980336580 -0.1748810172 -0.0509484142 -0.2020222553  0.0974538060
 [96]  0.5218590261  0.3315232375 -0.0003862368 -0.0061993539  0.1743533397
[101]  0.0152774604  0.1936417412 -0.0821248407  0.3257744836 -0.2387378731
[106] -0.6828758602 -0.3242402014  0.5245470617  0.1632742044  0.3645630667
[111] -0.4853903248  0.3112267311  0.4810774595  0.2646624170  0.0287541931
[116]  0.2660683100 -0.1357980996 -0.4926083477 -0.1691588238 -0.4221719202
[121] -0.2429397920  0.0126527794  0.1964399124 -0.0806522485  0.0604592134
[126]  0.2691248723  0.2940799526 -0.2630841811  0.4122000241 -0.1119905430
[131]  0.0699085270  0.4210396738  0.1459630375 -0.4744084084 -0.2225633051
[136] -0.0081435579 -0.6155301175  0.7841840843  0.1254159028  0.1894528181
[141]  0.1482154712  0.3835069381  0.1610552236 -0.1532286421 -0.1333775073
[146]  0.1750359529  0.0501442638 -0.5243054041  0.0235529121 -0.3218616074
[151] -0.0190224782 -0.3630749477 -0.2861918006  0.4641048144  0.4054182812
[156] -0.6274190756  0.2001292674 -0.2431991820 -0.7876453736 -0.4259417889
[161] -0.1497854521 -0.0110618315  0.0876120391  0.3611716880 -0.1246577260
[166]  0.8948088865  0.3238788161  0.0285974952  0.3919822610  0.2077627632
[171] -0.1968960270 -0.3509823451  0.5619242385  0.7465179407 -0.6657196136
[176] -0.5284170180  0.1165190116 -0.3564351938 -0.4339916403 -0.2099182574
[181]  0.1818137178  0.0715776907 -0.1545329613  0.1781650209 -0.3129167047
[186]  0.1600808746 -0.4314338576  0.1089322716  0.1148234933  0.1004807050
[191] -0.0457843375  0.2167076428  0.5495612698  0.0610423268  0.1209685647
[196]  0.1824517960 -0.5458637702  0.1113842698 -0.1836243044  0.6518199631
[201]  0.0182321028 -0.0847756150  0.4359381265  0.3519789223  0.2517695964
[206] -0.2093920868 -0.0546078246 -0.1873746934 -0.0497221942  0.0800963972
[211]  0.1918639470  0.0754862824  0.4957081333  0.1841855286  0.3323650039
[216] -0.2328155308 -0.2411860413  0.0727824438 -0.3416608974  0.3606615631
[221] -0.6865963660 -0.2382273541  0.2452061891 -0.5067771827  0.2641410692
[226]  0.2316510958  0.2797539107 -0.3688068137  0.5309031689 -0.4348677843
> 
> proc.time()
   user  system elapsed 
   3.73   13.87  130.51 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 (2025-06-13 ucrt) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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: 0x000002810b8f8950>
> .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: 0x000002810b8f8950>
> .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: 0x000002810b8f8950>
> .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: 0x000002810b8f8950>
> 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: 0x000002810b8f8530>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002810b8f8530>
> .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: 0x000002810b8f8530>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002810b8f8530>
> .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: 0x000002810b8f8530>
> 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: 0x000002810b8f8890>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002810b8f8890>
> .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: 0x000002810b8f8890>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002810b8f8890>
> .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: 0x000002810b8f8890>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000002810b8f8890>
> .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: 0x000002810b8f8890>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000002810b8f8890>
> .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: 0x000002810b8f8890>
> 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: 0x000002810b8f8d10>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000002810b8f8d10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002810b8f8d10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002810b8f8d10>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile141f8219327d9" "BufferedMatrixFile141f84afa4897"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile141f8219327d9" "BufferedMatrixFile141f84afa4897"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002810b8f8e90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002810b8f8e90>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002810b8f8e90>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002810b8f8e90>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000002810b8f8e90>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000002810b8f8e90>
> .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: 0x000002810ddffad0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002810ddffad0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002810ddffad0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000002810ddffad0>
> 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: 0x000002810ddff110>
> .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: 0x000002810ddff110>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.23    0.12    0.71 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 (2025-06-13 ucrt) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.25    0.09    0.34 

Example timings