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

This page was generated on 2025-01-11 11:41 -0500 (Sat, 11 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_64R Under development (unstable) (2024-10-21 r87258) -- "Unsuffered Consequences" 4760
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2024-10-26 r87273 ucrt) -- "Unsuffered Consequences" 4479
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" 4443
kjohnson3macOS 13.7.1 Venturaarm64R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" 4398
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch64R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" 4391
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 246/2277HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.71.1  (landing page)
Ben Bolstad
Snapshot Date: 2025-01-10 13:40 -0500 (Fri, 10 Jan 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 824836d
git_last_commit_date: 2024-12-14 17:47:34 -0500 (Sat, 14 Dec 2024)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows 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
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on palomino7

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.71.1
Command: E:\biocbuild\bbs-3.21-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=E:\biocbuild\bbs-3.21-bioc\R\library --no-vignettes --timings BufferedMatrix_1.71.1.tar.gz
StartedAt: 2025-01-10 23:13:32 -0500 (Fri, 10 Jan 2025)
EndedAt: 2025-01-10 23:16:43 -0500 (Fri, 10 Jan 2025)
EllapsedTime: 191.5 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck'
* using R Under development (unstable) (2024-10-26 r87273 ucrt)
* using platform: x86_64-w64-mingw32
* R was compiled by
    gcc.exe (GCC) 13.2.0
    GNU Fortran (GCC) 13.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.71.1'
* 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) 13.3.0'
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking 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 'E:/biocbuild/bbs-3.21-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
  'E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'E:/biocbuild/bbs-3.21-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 13.3.0'
gcc  -I"E:/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"E:/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall  -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"E:/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"E:/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"      -O2 -Wall  -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:/rtools44/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib -LE:/biocbuild/bbs-3.21-bioc/R/bin/x64 -lR
installing to E:/biocbuild/bbs-3.21-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 Under development (unstable) (2024-10-26 r87273 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2024 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.35    0.12    3.68 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2024-10-26 r87273 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2024 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] "E:/biocbuild/bbs-3.21-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 474902 25.4    1041921 55.7   629882 33.7
Vcells 866320  6.7    8388608 64.0  2037043 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] "Fri Jan 10 23:14:16 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] "Fri Jan 10 23:14:18 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: 0x0000025b690ff290>
> 
> 
> 
> 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] "Fri Jan 10 23:14:44 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] "Fri Jan 10 23:14:52 2025"
> 
> ColMode(tmp2)
<pointer: 0x0000025b690ff290>
> 
> 
> 
> ### 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,] 98.2942155 -0.9983346 -0.7667806 -0.5739697
[2,] -1.4503160 -0.5102901 -0.7775474 -1.4499979
[3,] -0.8141326  1.2170700  0.4649099  0.0734471
[4,] -1.5589858  0.5875924  0.6840744 -1.4785549
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-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,] 98.2942155 0.9983346 0.7667806 0.5739697
[2,]  1.4503160 0.5102901 0.7775474 1.4499979
[3,]  0.8141326 1.2170700 0.4649099 0.0734471
[4,]  1.5589858 0.5875924 0.6840744 1.4785549
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-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.914344 0.9991669 0.8756601 0.7576079
[2,] 1.204291 0.7143459 0.8817865 1.2041586
[3,] 0.902293 1.1032089 0.6818430 0.2710113
[4,] 1.248594 0.7665457 0.8270879 1.2159584
> 
> 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:    E:/biocbuild/bbs-3.21-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,] 222.43765 35.99000 34.52338 33.15005
[2,]  38.49322 32.65375 34.59541 38.49158
[3,]  34.83706 37.24916 32.28334 27.78356
[4,]  39.04492 33.25305 33.95495 38.63814
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x0000025b690ff950>
> exp(tmp5)
<pointer: 0x0000025b690ff950>
> log(tmp5,2)
<pointer: 0x0000025b690ff950>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 462.9748
> Min(tmp5)
[1] 54.22681
> mean(tmp5)
[1] 72.68461
> Sum(tmp5)
[1] 14536.92
> Var(tmp5)
[1] 828.3001
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.16224 68.75818 70.14678 70.75374 71.64937 72.56639 69.14477 72.18596
 [9] 67.64051 73.83813
> rowSums(tmp5)
 [1] 1803.245 1375.164 1402.936 1415.075 1432.987 1451.328 1382.895 1443.719
 [9] 1352.810 1476.763
> rowVars(tmp5)
 [1] 7743.34869   44.27535   74.47151   59.65783   61.22662   40.59657
 [7]   49.44451   67.83756   88.84444   54.39614
> rowSd(tmp5)
 [1] 87.996299  6.653972  8.629688  7.723848  7.824744  6.371543  7.031679
 [8]  8.236356  9.425733  7.375374
> rowMax(tmp5)
 [1] 462.97483  80.11860  84.32540  93.24061  80.86233  89.81513  80.54476
 [8]  85.23098  84.72406  84.12277
> rowMin(tmp5)
 [1] 57.18499 57.80071 55.04924 59.44979 55.38490 61.56813 58.15471 56.07756
 [9] 55.07448 54.22681
> 
> colMeans(tmp5)
 [1] 109.72761  72.13187  72.45544  72.58175  70.11388  71.82463  71.83952
 [8]  69.83128  75.31718  68.94126  71.50553  65.24183  72.52099  72.68937
[15]  68.23949  73.42760  66.45373  69.70085  70.44084  68.70754
> colSums(tmp5)
 [1] 1097.2761  721.3187  724.5544  725.8175  701.1388  718.2463  718.3952
 [8]  698.3128  753.1718  689.4126  715.0553  652.4183  725.2099  726.8937
[15]  682.3949  734.2760  664.5373  697.0085  704.4084  687.0754
> colVars(tmp5)
 [1] 15483.50689    36.68100    64.18247    70.31778    60.10340    33.55894
 [7]    56.80750    46.04971    84.75694    49.00963    60.94006    96.75302
[13]    65.71844    25.81354    68.39564    41.92643    43.43549    84.84848
[19]    80.00396    33.60232
> colSd(tmp5)
 [1] 124.432740   6.056485   8.011396   8.385570   7.752638   5.793008
 [7]   7.537075   6.785994   9.206353   7.000688   7.806411   9.836312
[13]   8.106691   5.080703   8.270165   6.475062   6.590561   9.211323
[19]   8.944493   5.796751
> colMax(tmp5)
 [1] 462.97483  80.67570  85.23098  80.42022  80.86233  82.28715  89.81513
 [8]  84.32540  93.24061  79.80003  84.12277  79.53517  84.13476  80.99345
[15]  77.78878  79.78669  77.07404  81.08880  81.83829  75.75115
> colMin(tmp5)
 [1] 59.81400 61.56813 61.72622 57.82784 58.41747 65.58845 61.84947 60.27632
 [9] 62.35252 57.58910 57.18499 54.22681 59.37138 64.97475 57.80071 60.36663
[17] 58.57917 55.38490 55.63132 55.07448
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.16224       NA 70.14678 70.75374 71.64937 72.56639 69.14477 72.18596
 [9] 67.64051 73.83813
> rowSums(tmp5)
 [1] 1803.245       NA 1402.936 1415.075 1432.987 1451.328 1382.895 1443.719
 [9] 1352.810 1476.763
> rowVars(tmp5)
 [1] 7743.34869   43.87416   74.47151   59.65783   61.22662   40.59657
 [7]   49.44451   67.83756   88.84444   54.39614
> rowSd(tmp5)
 [1] 87.996299  6.623757  8.629688  7.723848  7.824744  6.371543  7.031679
 [8]  8.236356  9.425733  7.375374
> rowMax(tmp5)
 [1] 462.97483        NA  84.32540  93.24061  80.86233  89.81513  80.54476
 [8]  85.23098  84.72406  84.12277
> rowMin(tmp5)
 [1] 57.18499       NA 55.04924 59.44979 55.38490 61.56813 58.15471 56.07756
 [9] 55.07448 54.22681
> 
> colMeans(tmp5)
 [1] 109.72761  72.13187  72.45544  72.58175  70.11388  71.82463  71.83952
 [8]  69.83128  75.31718  68.94126  71.50553  65.24183  72.52099  72.68937
[15]  68.23949  73.42760  66.45373  69.70085        NA  68.70754
> colSums(tmp5)
 [1] 1097.2761  721.3187  724.5544  725.8175  701.1388  718.2463  718.3952
 [8]  698.3128  753.1718  689.4126  715.0553  652.4183  725.2099  726.8937
[15]  682.3949  734.2760  664.5373  697.0085        NA  687.0754
> colVars(tmp5)
 [1] 15483.50689    36.68100    64.18247    70.31778    60.10340    33.55894
 [7]    56.80750    46.04971    84.75694    49.00963    60.94006    96.75302
[13]    65.71844    25.81354    68.39564    41.92643    43.43549    84.84848
[19]          NA    33.60232
> colSd(tmp5)
 [1] 124.432740   6.056485   8.011396   8.385570   7.752638   5.793008
 [7]   7.537075   6.785994   9.206353   7.000688   7.806411   9.836312
[13]   8.106691   5.080703   8.270165   6.475062   6.590561   9.211323
[19]         NA   5.796751
> colMax(tmp5)
 [1] 462.97483  80.67570  85.23098  80.42022  80.86233  82.28715  89.81513
 [8]  84.32540  93.24061  79.80003  84.12277  79.53517  84.13476  80.99345
[15]  77.78878  79.78669  77.07404  81.08880        NA  75.75115
> colMin(tmp5)
 [1] 59.81400 61.56813 61.72622 57.82784 58.41747 65.58845 61.84947 60.27632
 [9] 62.35252 57.58910 57.18499 54.22681 59.37138 64.97475 57.80071 60.36663
[17] 58.57917 55.38490       NA 55.07448
> 
> Max(tmp5,na.rm=TRUE)
[1] 462.9748
> Min(tmp5,na.rm=TRUE)
[1] 54.22681
> mean(tmp5,na.rm=TRUE)
[1] 72.66919
> Sum(tmp5,na.rm=TRUE)
[1] 14461.17
> Var(tmp5,na.rm=TRUE)
[1] 832.4356
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.16224 68.39006 70.14678 70.75374 71.64937 72.56639 69.14477 72.18596
 [9] 67.64051 73.83813
> rowSums(tmp5,na.rm=TRUE)
 [1] 1803.245 1299.411 1402.936 1415.075 1432.987 1451.328 1382.895 1443.719
 [9] 1352.810 1476.763
> rowVars(tmp5,na.rm=TRUE)
 [1] 7743.34869   43.87416   74.47151   59.65783   61.22662   40.59657
 [7]   49.44451   67.83756   88.84444   54.39614
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.996299  6.623757  8.629688  7.723848  7.824744  6.371543  7.031679
 [8]  8.236356  9.425733  7.375374
> rowMax(tmp5,na.rm=TRUE)
 [1] 462.97483  80.11860  84.32540  93.24061  80.86233  89.81513  80.54476
 [8]  85.23098  84.72406  84.12277
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.18499 57.80071 55.04924 59.44979 55.38490 61.56813 58.15471 56.07756
 [9] 55.07448 54.22681
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.72761  72.13187  72.45544  72.58175  70.11388  71.82463  71.83952
 [8]  69.83128  75.31718  68.94126  71.50553  65.24183  72.52099  72.68937
[15]  68.23949  73.42760  66.45373  69.70085  69.85064  68.70754
> colSums(tmp5,na.rm=TRUE)
 [1] 1097.2761  721.3187  724.5544  725.8175  701.1388  718.2463  718.3952
 [8]  698.3128  753.1718  689.4126  715.0553  652.4183  725.2099  726.8937
[15]  682.3949  734.2760  664.5373  697.0085  628.6558  687.0754
> colVars(tmp5,na.rm=TRUE)
 [1] 15483.50689    36.68100    64.18247    70.31778    60.10340    33.55894
 [7]    56.80750    46.04971    84.75694    49.00963    60.94006    96.75302
[13]    65.71844    25.81354    68.39564    41.92643    43.43549    84.84848
[19]    86.08573    33.60232
> colSd(tmp5,na.rm=TRUE)
 [1] 124.432740   6.056485   8.011396   8.385570   7.752638   5.793008
 [7]   7.537075   6.785994   9.206353   7.000688   7.806411   9.836312
[13]   8.106691   5.080703   8.270165   6.475062   6.590561   9.211323
[19]   9.278239   5.796751
> colMax(tmp5,na.rm=TRUE)
 [1] 462.97483  80.67570  85.23098  80.42022  80.86233  82.28715  89.81513
 [8]  84.32540  93.24061  79.80003  84.12277  79.53517  84.13476  80.99345
[15]  77.78878  79.78669  77.07404  81.08880  81.83829  75.75115
> colMin(tmp5,na.rm=TRUE)
 [1] 59.81400 61.56813 61.72622 57.82784 58.41747 65.58845 61.84947 60.27632
 [9] 62.35252 57.58910 57.18499 54.22681 59.37138 64.97475 57.80071 60.36663
[17] 58.57917 55.38490 55.63132 55.07448
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.16224      NaN 70.14678 70.75374 71.64937 72.56639 69.14477 72.18596
 [9] 67.64051 73.83813
> rowSums(tmp5,na.rm=TRUE)
 [1] 1803.245    0.000 1402.936 1415.075 1432.987 1451.328 1382.895 1443.719
 [9] 1352.810 1476.763
> rowVars(tmp5,na.rm=TRUE)
 [1] 7743.34869         NA   74.47151   59.65783   61.22662   40.59657
 [7]   49.44451   67.83756   88.84444   54.39614
> rowSd(tmp5,na.rm=TRUE)
 [1] 87.996299        NA  8.629688  7.723848  7.824744  6.371543  7.031679
 [8]  8.236356  9.425733  7.375374
> rowMax(tmp5,na.rm=TRUE)
 [1] 462.97483        NA  84.32540  93.24061  80.86233  89.81513  80.54476
 [8]  85.23098  84.72406  84.12277
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.18499       NA 55.04924 59.44979 55.38490 61.56813 58.15471 56.07756
 [9] 55.07448 54.22681
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.01750  72.59491  72.50540  71.74470  71.14995  72.36093  72.29827
 [8]  70.32632  76.75769  69.05320  71.36087  65.59680  73.44611  73.54655
[15]  69.39935  72.72103  66.91216  69.51405       NaN  68.26110
> colSums(tmp5,na.rm=TRUE)
 [1] 1017.1575  653.3542  652.5486  645.7023  640.3496  651.2484  650.6844
 [8]  632.9369  690.8192  621.4788  642.2478  590.3712  661.0150  661.9190
[15]  624.5941  654.4893  602.2095  625.6265    0.0000  614.3499
> colVars(tmp5,na.rm=TRUE)
 [1] 17297.18228    38.85405    72.17720    71.22518    55.54005    34.51802
 [7]    61.54083    49.04894    72.00680    54.99488    68.32215   107.42963
[13]    64.30495    20.77421    61.81065    41.55084    46.50060    95.06200
[19]          NA    35.56046
> colSd(tmp5,na.rm=TRUE)
 [1] 131.518753   6.233302   8.495716   8.439501   7.452519   5.875204
 [7]   7.844796   7.003495   8.485682   7.415853   8.265722  10.364826
[13]   8.019036   4.557873   7.861975   6.445994   6.819135   9.749974
[19]         NA   5.963259
> colMax(tmp5,na.rm=TRUE)
 [1] 462.97483  80.67570  85.23098  80.42022  80.86233  82.28715  89.81513
 [8]  84.32540  93.24061  79.80003  84.12277  79.53517  84.13476  80.99345
[15]  77.78878  78.94462  77.07404  81.08880      -Inf  75.75115
> colMin(tmp5,na.rm=TRUE)
 [1] 59.81400 61.56813 61.72622 57.82784 58.41747 65.58845 61.84947 60.27632
 [9] 65.03089 57.58910 57.18499 54.22681 59.37138 67.79253 58.15471 60.36663
[17] 58.57917 55.38490      Inf 55.07448
> 
> 
> 
> 
> 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] 222.1252 208.0232 291.0314 157.4349 221.7691 292.3330 203.3307 281.3925
 [9] 240.3753 324.1118
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 222.1252 208.0232 291.0314 157.4349 221.7691 292.3330 203.3307 281.3925
 [9] 240.3753 324.1118
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00  0.000000e+00 -5.684342e-14  0.000000e+00 -5.684342e-14
 [6]  2.842171e-14 -3.979039e-13 -2.842171e-14 -1.705303e-13 -1.136868e-13
[11]  5.684342e-14  4.263256e-14 -5.684342e-14  1.705303e-13 -2.842171e-13
[16]  0.000000e+00  2.273737e-13  5.684342e-14 -5.684342e-14  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
3   14 
1   20 
4   17 
10   17 
8   2 
1   3 
6   7 
8   3 
8   15 
6   2 
8   10 
5   18 
1   11 
10   3 
5   19 
1   12 
7   18 
5   16 
5   2 
5   9 
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.097693
> Min(tmp)
[1] -1.881605
> mean(tmp)
[1] 0.07535169
> Sum(tmp)
[1] 7.535169
> Var(tmp)
[1] 1.066809
> 
> rowMeans(tmp)
[1] 0.07535169
> rowSums(tmp)
[1] 7.535169
> rowVars(tmp)
[1] 1.066809
> rowSd(tmp)
[1] 1.032864
> rowMax(tmp)
[1] 3.097693
> rowMin(tmp)
[1] -1.881605
> 
> colMeans(tmp)
  [1] -0.867092417 -1.128447032  1.428500118  1.185681331  1.112741423
  [6] -1.398715528  0.154582373  1.120684505 -0.301896086  0.136793202
 [11] -0.460189784 -0.208787890 -0.810790512  0.767544849  1.530224399
 [16] -0.571323318 -0.067898935 -0.621528078  0.779811384  1.054973962
 [21] -0.162823156 -0.440215815 -0.009024617 -1.771168857 -1.243622481
 [26] -0.416188495  0.048808580  1.031481755 -1.522208654 -0.075293555
 [31] -1.181807403  1.406786495  0.034493598  0.436273982 -0.329563018
 [36] -0.403454984 -1.783458109  0.417600034  2.579384953 -0.001083907
 [41] -0.441212298 -1.552283895 -1.575109542  0.258633413  0.787024952
 [46] -0.050491016 -0.772235324  1.206952531 -0.079674046  0.002659571
 [51]  1.499546003 -1.881605487  0.255190443 -0.336803141 -0.832937017
 [56]  0.015040327 -0.460242982 -0.672815575  0.268003960 -1.141164786
 [61]  0.099562272 -0.042028651 -0.269992713  1.116103006  1.193360223
 [66]  0.800692756  1.801312716  1.722901535  1.048304627  1.390390691
 [71] -0.386102379  0.378280949  1.954471600  0.764692016 -0.693236254
 [76]  0.290450456  0.001481977  0.372570290 -0.721572560 -0.456062584
 [81] -0.332536426  2.610232540  1.580193506 -0.115022469  1.581721498
 [86]  0.011237257  0.214717103  1.243733024 -1.110488087 -1.379719353
 [91]  0.006363097 -1.385447603 -0.295795637 -0.182007835  3.097692795
 [96] -0.812761485 -1.743828877  0.423552763  0.020922220 -0.209429532
> colSums(tmp)
  [1] -0.867092417 -1.128447032  1.428500118  1.185681331  1.112741423
  [6] -1.398715528  0.154582373  1.120684505 -0.301896086  0.136793202
 [11] -0.460189784 -0.208787890 -0.810790512  0.767544849  1.530224399
 [16] -0.571323318 -0.067898935 -0.621528078  0.779811384  1.054973962
 [21] -0.162823156 -0.440215815 -0.009024617 -1.771168857 -1.243622481
 [26] -0.416188495  0.048808580  1.031481755 -1.522208654 -0.075293555
 [31] -1.181807403  1.406786495  0.034493598  0.436273982 -0.329563018
 [36] -0.403454984 -1.783458109  0.417600034  2.579384953 -0.001083907
 [41] -0.441212298 -1.552283895 -1.575109542  0.258633413  0.787024952
 [46] -0.050491016 -0.772235324  1.206952531 -0.079674046  0.002659571
 [51]  1.499546003 -1.881605487  0.255190443 -0.336803141 -0.832937017
 [56]  0.015040327 -0.460242982 -0.672815575  0.268003960 -1.141164786
 [61]  0.099562272 -0.042028651 -0.269992713  1.116103006  1.193360223
 [66]  0.800692756  1.801312716  1.722901535  1.048304627  1.390390691
 [71] -0.386102379  0.378280949  1.954471600  0.764692016 -0.693236254
 [76]  0.290450456  0.001481977  0.372570290 -0.721572560 -0.456062584
 [81] -0.332536426  2.610232540  1.580193506 -0.115022469  1.581721498
 [86]  0.011237257  0.214717103  1.243733024 -1.110488087 -1.379719353
 [91]  0.006363097 -1.385447603 -0.295795637 -0.182007835  3.097692795
 [96] -0.812761485 -1.743828877  0.423552763  0.020922220 -0.209429532
> 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.867092417 -1.128447032  1.428500118  1.185681331  1.112741423
  [6] -1.398715528  0.154582373  1.120684505 -0.301896086  0.136793202
 [11] -0.460189784 -0.208787890 -0.810790512  0.767544849  1.530224399
 [16] -0.571323318 -0.067898935 -0.621528078  0.779811384  1.054973962
 [21] -0.162823156 -0.440215815 -0.009024617 -1.771168857 -1.243622481
 [26] -0.416188495  0.048808580  1.031481755 -1.522208654 -0.075293555
 [31] -1.181807403  1.406786495  0.034493598  0.436273982 -0.329563018
 [36] -0.403454984 -1.783458109  0.417600034  2.579384953 -0.001083907
 [41] -0.441212298 -1.552283895 -1.575109542  0.258633413  0.787024952
 [46] -0.050491016 -0.772235324  1.206952531 -0.079674046  0.002659571
 [51]  1.499546003 -1.881605487  0.255190443 -0.336803141 -0.832937017
 [56]  0.015040327 -0.460242982 -0.672815575  0.268003960 -1.141164786
 [61]  0.099562272 -0.042028651 -0.269992713  1.116103006  1.193360223
 [66]  0.800692756  1.801312716  1.722901535  1.048304627  1.390390691
 [71] -0.386102379  0.378280949  1.954471600  0.764692016 -0.693236254
 [76]  0.290450456  0.001481977  0.372570290 -0.721572560 -0.456062584
 [81] -0.332536426  2.610232540  1.580193506 -0.115022469  1.581721498
 [86]  0.011237257  0.214717103  1.243733024 -1.110488087 -1.379719353
 [91]  0.006363097 -1.385447603 -0.295795637 -0.182007835  3.097692795
 [96] -0.812761485 -1.743828877  0.423552763  0.020922220 -0.209429532
> colMin(tmp)
  [1] -0.867092417 -1.128447032  1.428500118  1.185681331  1.112741423
  [6] -1.398715528  0.154582373  1.120684505 -0.301896086  0.136793202
 [11] -0.460189784 -0.208787890 -0.810790512  0.767544849  1.530224399
 [16] -0.571323318 -0.067898935 -0.621528078  0.779811384  1.054973962
 [21] -0.162823156 -0.440215815 -0.009024617 -1.771168857 -1.243622481
 [26] -0.416188495  0.048808580  1.031481755 -1.522208654 -0.075293555
 [31] -1.181807403  1.406786495  0.034493598  0.436273982 -0.329563018
 [36] -0.403454984 -1.783458109  0.417600034  2.579384953 -0.001083907
 [41] -0.441212298 -1.552283895 -1.575109542  0.258633413  0.787024952
 [46] -0.050491016 -0.772235324  1.206952531 -0.079674046  0.002659571
 [51]  1.499546003 -1.881605487  0.255190443 -0.336803141 -0.832937017
 [56]  0.015040327 -0.460242982 -0.672815575  0.268003960 -1.141164786
 [61]  0.099562272 -0.042028651 -0.269992713  1.116103006  1.193360223
 [66]  0.800692756  1.801312716  1.722901535  1.048304627  1.390390691
 [71] -0.386102379  0.378280949  1.954471600  0.764692016 -0.693236254
 [76]  0.290450456  0.001481977  0.372570290 -0.721572560 -0.456062584
 [81] -0.332536426  2.610232540  1.580193506 -0.115022469  1.581721498
 [86]  0.011237257  0.214717103  1.243733024 -1.110488087 -1.379719353
 [91]  0.006363097 -1.385447603 -0.295795637 -0.182007835  3.097692795
 [96] -0.812761485 -1.743828877  0.423552763  0.020922220 -0.209429532
> colMedians(tmp)
  [1] -0.867092417 -1.128447032  1.428500118  1.185681331  1.112741423
  [6] -1.398715528  0.154582373  1.120684505 -0.301896086  0.136793202
 [11] -0.460189784 -0.208787890 -0.810790512  0.767544849  1.530224399
 [16] -0.571323318 -0.067898935 -0.621528078  0.779811384  1.054973962
 [21] -0.162823156 -0.440215815 -0.009024617 -1.771168857 -1.243622481
 [26] -0.416188495  0.048808580  1.031481755 -1.522208654 -0.075293555
 [31] -1.181807403  1.406786495  0.034493598  0.436273982 -0.329563018
 [36] -0.403454984 -1.783458109  0.417600034  2.579384953 -0.001083907
 [41] -0.441212298 -1.552283895 -1.575109542  0.258633413  0.787024952
 [46] -0.050491016 -0.772235324  1.206952531 -0.079674046  0.002659571
 [51]  1.499546003 -1.881605487  0.255190443 -0.336803141 -0.832937017
 [56]  0.015040327 -0.460242982 -0.672815575  0.268003960 -1.141164786
 [61]  0.099562272 -0.042028651 -0.269992713  1.116103006  1.193360223
 [66]  0.800692756  1.801312716  1.722901535  1.048304627  1.390390691
 [71] -0.386102379  0.378280949  1.954471600  0.764692016 -0.693236254
 [76]  0.290450456  0.001481977  0.372570290 -0.721572560 -0.456062584
 [81] -0.332536426  2.610232540  1.580193506 -0.115022469  1.581721498
 [86]  0.011237257  0.214717103  1.243733024 -1.110488087 -1.379719353
 [91]  0.006363097 -1.385447603 -0.295795637 -0.182007835  3.097692795
 [96] -0.812761485 -1.743828877  0.423552763  0.020922220 -0.209429532
> colRanges(tmp)
           [,1]      [,2]   [,3]     [,4]     [,5]      [,6]      [,7]     [,8]
[1,] -0.8670924 -1.128447 1.4285 1.185681 1.112741 -1.398716 0.1545824 1.120685
[2,] -0.8670924 -1.128447 1.4285 1.185681 1.112741 -1.398716 0.1545824 1.120685
           [,9]     [,10]      [,11]      [,12]      [,13]     [,14]    [,15]
[1,] -0.3018961 0.1367932 -0.4601898 -0.2087879 -0.8107905 0.7675448 1.530224
[2,] -0.3018961 0.1367932 -0.4601898 -0.2087879 -0.8107905 0.7675448 1.530224
          [,16]       [,17]      [,18]     [,19]    [,20]      [,21]      [,22]
[1,] -0.5713233 -0.06789894 -0.6215281 0.7798114 1.054974 -0.1628232 -0.4402158
[2,] -0.5713233 -0.06789894 -0.6215281 0.7798114 1.054974 -0.1628232 -0.4402158
            [,23]     [,24]     [,25]      [,26]      [,27]    [,28]     [,29]
[1,] -0.009024617 -1.771169 -1.243622 -0.4161885 0.04880858 1.031482 -1.522209
[2,] -0.009024617 -1.771169 -1.243622 -0.4161885 0.04880858 1.031482 -1.522209
           [,30]     [,31]    [,32]     [,33]    [,34]     [,35]     [,36]
[1,] -0.07529355 -1.181807 1.406786 0.0344936 0.436274 -0.329563 -0.403455
[2,] -0.07529355 -1.181807 1.406786 0.0344936 0.436274 -0.329563 -0.403455
         [,37]  [,38]    [,39]        [,40]      [,41]     [,42]    [,43]
[1,] -1.783458 0.4176 2.579385 -0.001083907 -0.4412123 -1.552284 -1.57511
[2,] -1.783458 0.4176 2.579385 -0.001083907 -0.4412123 -1.552284 -1.57511
         [,44]    [,45]       [,46]      [,47]    [,48]       [,49]       [,50]
[1,] 0.2586334 0.787025 -0.05049102 -0.7722353 1.206953 -0.07967405 0.002659571
[2,] 0.2586334 0.787025 -0.05049102 -0.7722353 1.206953 -0.07967405 0.002659571
        [,51]     [,52]     [,53]      [,54]     [,55]      [,56]     [,57]
[1,] 1.499546 -1.881605 0.2551904 -0.3368031 -0.832937 0.01504033 -0.460243
[2,] 1.499546 -1.881605 0.2551904 -0.3368031 -0.832937 0.01504033 -0.460243
          [,58]    [,59]     [,60]      [,61]       [,62]      [,63]    [,64]
[1,] -0.6728156 0.268004 -1.141165 0.09956227 -0.04202865 -0.2699927 1.116103
[2,] -0.6728156 0.268004 -1.141165 0.09956227 -0.04202865 -0.2699927 1.116103
       [,65]     [,66]    [,67]    [,68]    [,69]    [,70]      [,71]     [,72]
[1,] 1.19336 0.8006928 1.801313 1.722902 1.048305 1.390391 -0.3861024 0.3782809
[2,] 1.19336 0.8006928 1.801313 1.722902 1.048305 1.390391 -0.3861024 0.3782809
        [,73]    [,74]      [,75]     [,76]       [,77]     [,78]      [,79]
[1,] 1.954472 0.764692 -0.6932363 0.2904505 0.001481977 0.3725703 -0.7215726
[2,] 1.954472 0.764692 -0.6932363 0.2904505 0.001481977 0.3725703 -0.7215726
          [,80]      [,81]    [,82]    [,83]      [,84]    [,85]      [,86]
[1,] -0.4560626 -0.3325364 2.610233 1.580194 -0.1150225 1.581721 0.01123726
[2,] -0.4560626 -0.3325364 2.610233 1.580194 -0.1150225 1.581721 0.01123726
         [,87]    [,88]     [,89]     [,90]       [,91]     [,92]      [,93]
[1,] 0.2147171 1.243733 -1.110488 -1.379719 0.006363097 -1.385448 -0.2957956
[2,] 0.2147171 1.243733 -1.110488 -1.379719 0.006363097 -1.385448 -0.2957956
          [,94]    [,95]      [,96]     [,97]     [,98]      [,99]     [,100]
[1,] -0.1820078 3.097693 -0.8127615 -1.743829 0.4235528 0.02092222 -0.2094295
[2,] -0.1820078 3.097693 -0.8127615 -1.743829 0.4235528 0.02092222 -0.2094295
> 
> 
> Max(tmp2)
[1] 2.612105
> Min(tmp2)
[1] -2.311097
> mean(tmp2)
[1] -0.1651315
> Sum(tmp2)
[1] -16.51315
> Var(tmp2)
[1] 1.063174
> 
> rowMeans(tmp2)
  [1] -2.027675090 -0.171320941 -1.009195398 -2.234186325  0.033111153
  [6] -0.165979202  0.771926914 -1.664397808  1.817971642  0.252995586
 [11]  0.727788125 -0.036252420  0.318777517 -0.616299113  0.856680146
 [16] -0.886484141 -0.488171450 -2.311097253 -1.079431374 -0.300862964
 [21]  0.261400760 -0.734294325 -0.934037649  1.048963844  0.532218250
 [26]  1.557913160 -0.570105101 -2.094194135 -1.456507209 -0.464705485
 [31]  0.713826248 -2.026874573  2.612105393 -0.583056091 -1.736280277
 [36]  0.636250234  0.192968880  0.312376093 -0.690544083  0.125496701
 [41]  0.291841854  1.279148956 -0.388567361 -0.817134033 -0.346745414
 [46] -0.318806446 -0.531823970 -0.709187638 -0.986905140  0.182948433
 [51]  1.063406911 -0.239667145 -1.334176606 -1.645050930  0.102280985
 [56] -1.553401142 -1.864954811  0.364440437  0.057255061  1.518909655
 [61]  2.344900202 -0.065094475 -0.081620059 -1.035166894  1.248537691
 [66]  1.481554894 -0.259954709  0.574768134 -0.781078737  0.279749371
 [71] -0.723468949  0.008184088 -0.561150712  1.078327772  0.902512846
 [76]  0.620826078 -0.461341523  0.549240615 -0.947453944  1.467032969
 [81] -0.936779657 -0.023382912 -0.081589927  0.682094868 -1.407148999
 [86]  0.202084497  0.586612740 -1.004455806 -1.224161183 -0.882300461
 [91] -0.999097570 -1.411529224 -0.286918739 -0.351061676  0.823059232
 [96]  0.819719351 -1.079620375  0.185814756 -0.353305608  1.974880400
> rowSums(tmp2)
  [1] -2.027675090 -0.171320941 -1.009195398 -2.234186325  0.033111153
  [6] -0.165979202  0.771926914 -1.664397808  1.817971642  0.252995586
 [11]  0.727788125 -0.036252420  0.318777517 -0.616299113  0.856680146
 [16] -0.886484141 -0.488171450 -2.311097253 -1.079431374 -0.300862964
 [21]  0.261400760 -0.734294325 -0.934037649  1.048963844  0.532218250
 [26]  1.557913160 -0.570105101 -2.094194135 -1.456507209 -0.464705485
 [31]  0.713826248 -2.026874573  2.612105393 -0.583056091 -1.736280277
 [36]  0.636250234  0.192968880  0.312376093 -0.690544083  0.125496701
 [41]  0.291841854  1.279148956 -0.388567361 -0.817134033 -0.346745414
 [46] -0.318806446 -0.531823970 -0.709187638 -0.986905140  0.182948433
 [51]  1.063406911 -0.239667145 -1.334176606 -1.645050930  0.102280985
 [56] -1.553401142 -1.864954811  0.364440437  0.057255061  1.518909655
 [61]  2.344900202 -0.065094475 -0.081620059 -1.035166894  1.248537691
 [66]  1.481554894 -0.259954709  0.574768134 -0.781078737  0.279749371
 [71] -0.723468949  0.008184088 -0.561150712  1.078327772  0.902512846
 [76]  0.620826078 -0.461341523  0.549240615 -0.947453944  1.467032969
 [81] -0.936779657 -0.023382912 -0.081589927  0.682094868 -1.407148999
 [86]  0.202084497  0.586612740 -1.004455806 -1.224161183 -0.882300461
 [91] -0.999097570 -1.411529224 -0.286918739 -0.351061676  0.823059232
 [96]  0.819719351 -1.079620375  0.185814756 -0.353305608  1.974880400
> 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] -2.027675090 -0.171320941 -1.009195398 -2.234186325  0.033111153
  [6] -0.165979202  0.771926914 -1.664397808  1.817971642  0.252995586
 [11]  0.727788125 -0.036252420  0.318777517 -0.616299113  0.856680146
 [16] -0.886484141 -0.488171450 -2.311097253 -1.079431374 -0.300862964
 [21]  0.261400760 -0.734294325 -0.934037649  1.048963844  0.532218250
 [26]  1.557913160 -0.570105101 -2.094194135 -1.456507209 -0.464705485
 [31]  0.713826248 -2.026874573  2.612105393 -0.583056091 -1.736280277
 [36]  0.636250234  0.192968880  0.312376093 -0.690544083  0.125496701
 [41]  0.291841854  1.279148956 -0.388567361 -0.817134033 -0.346745414
 [46] -0.318806446 -0.531823970 -0.709187638 -0.986905140  0.182948433
 [51]  1.063406911 -0.239667145 -1.334176606 -1.645050930  0.102280985
 [56] -1.553401142 -1.864954811  0.364440437  0.057255061  1.518909655
 [61]  2.344900202 -0.065094475 -0.081620059 -1.035166894  1.248537691
 [66]  1.481554894 -0.259954709  0.574768134 -0.781078737  0.279749371
 [71] -0.723468949  0.008184088 -0.561150712  1.078327772  0.902512846
 [76]  0.620826078 -0.461341523  0.549240615 -0.947453944  1.467032969
 [81] -0.936779657 -0.023382912 -0.081589927  0.682094868 -1.407148999
 [86]  0.202084497  0.586612740 -1.004455806 -1.224161183 -0.882300461
 [91] -0.999097570 -1.411529224 -0.286918739 -0.351061676  0.823059232
 [96]  0.819719351 -1.079620375  0.185814756 -0.353305608  1.974880400
> rowMin(tmp2)
  [1] -2.027675090 -0.171320941 -1.009195398 -2.234186325  0.033111153
  [6] -0.165979202  0.771926914 -1.664397808  1.817971642  0.252995586
 [11]  0.727788125 -0.036252420  0.318777517 -0.616299113  0.856680146
 [16] -0.886484141 -0.488171450 -2.311097253 -1.079431374 -0.300862964
 [21]  0.261400760 -0.734294325 -0.934037649  1.048963844  0.532218250
 [26]  1.557913160 -0.570105101 -2.094194135 -1.456507209 -0.464705485
 [31]  0.713826248 -2.026874573  2.612105393 -0.583056091 -1.736280277
 [36]  0.636250234  0.192968880  0.312376093 -0.690544083  0.125496701
 [41]  0.291841854  1.279148956 -0.388567361 -0.817134033 -0.346745414
 [46] -0.318806446 -0.531823970 -0.709187638 -0.986905140  0.182948433
 [51]  1.063406911 -0.239667145 -1.334176606 -1.645050930  0.102280985
 [56] -1.553401142 -1.864954811  0.364440437  0.057255061  1.518909655
 [61]  2.344900202 -0.065094475 -0.081620059 -1.035166894  1.248537691
 [66]  1.481554894 -0.259954709  0.574768134 -0.781078737  0.279749371
 [71] -0.723468949  0.008184088 -0.561150712  1.078327772  0.902512846
 [76]  0.620826078 -0.461341523  0.549240615 -0.947453944  1.467032969
 [81] -0.936779657 -0.023382912 -0.081589927  0.682094868 -1.407148999
 [86]  0.202084497  0.586612740 -1.004455806 -1.224161183 -0.882300461
 [91] -0.999097570 -1.411529224 -0.286918739 -0.351061676  0.823059232
 [96]  0.819719351 -1.079620375  0.185814756 -0.353305608  1.974880400
> 
> colMeans(tmp2)
[1] -0.1651315
> colSums(tmp2)
[1] -16.51315
> colVars(tmp2)
[1] 1.063174
> colSd(tmp2)
[1] 1.031103
> colMax(tmp2)
[1] 2.612105
> colMin(tmp2)
[1] -2.311097
> colMedians(tmp2)
[1] -0.205494
> colRanges(tmp2)
          [,1]
[1,] -2.311097
[2,]  2.612105
> 
> 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] -0.1461524 -0.9056965  2.5110729  2.9022644 -1.1990133  2.4994905
 [7]  5.3607365  2.1327674  3.7134908  2.8646033
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.1866428
[2,] -0.3319931
[3,]  0.2558068
[4,]  0.7549026
[5,]  1.1253520
> 
> rowApply(tmp,sum)
 [1]  3.7849416  0.5836474 -0.6669503  4.9279436  2.9128108  2.2134626
 [7]  4.5816602  0.4301617 -1.4792740  2.4451600
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    6    1    4    8    5    8    4    2     5
 [2,]    6    1    7    9   10    1    6    2    4     4
 [3,]    4   10    4    7    6    2   10    5    3     6
 [4,]   10    3    6    3    5    3    3   10    5     8
 [5,]    1    5    2    6    3    7    7    6    6     1
 [6,]    9    2    8    5    9    4    4    8    1    10
 [7,]    2    8   10    8    4    8    5    7    7     7
 [8,]    5    7    5    2    7    9    2    1   10     3
 [9,]    7    9    9   10    1    6    1    3    9     2
[10,]    3    4    3    1    2   10    9    9    8     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.24279872  2.80296224  1.99221262 -1.22244652  0.21637272 -1.31005584
 [7]  0.67234544  1.19405012 -5.32741282  0.31549884 -2.29449123 -1.48927925
[13]  0.02446295 -0.85918678  4.65129557  0.40866463 -2.07638415  1.40306773
[19]  1.10202506 -2.31709303
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.0464276
[2,] -1.4617946
[3,] -0.6482962
[4,] -0.2326127
[5,]  1.1463324
> 
> rowApply(tmp,sum)
[1]  4.4792171 -5.4536028 -1.4536430 -0.5608147 -2.3673470
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16   13    2    1    6
[2,]   18   16   15    9   18
[3,]   13   10    5   14   20
[4,]   11    6    1   17   11
[5,]    2   12   11   19   16
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
[1,]  1.1463324  1.2630432  0.3930536  0.2479853 -1.5848010  1.25813437
[2,] -0.2326127  0.2519722 -0.6007033 -1.0514292 -0.2893393  0.04389459
[3,] -1.4617946  0.8103974 -0.6722815 -1.7264729 -0.1646684  0.15856629
[4,] -2.0464276 -0.3700888  0.6247950  1.1966185  1.5463044 -1.41702792
[5,] -0.6482962  0.8476382  2.2473488  0.1108518  0.7088771 -1.35362318
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,]  0.1939035 -0.7780997 -0.05389266  0.9236082 -0.8002839  0.3280733
[2,] -1.8332014 -1.2650156 -1.38057243 -0.8506100 -0.7271195 -0.5475524
[3,]  0.9811218  1.0715380 -0.55622951  1.3186141 -0.2646490 -0.4819679
[4,]  1.1648015  1.3881851 -1.94935273 -0.7130605  0.1142550 -0.6848732
[5,]  0.1657200  0.7774424 -1.38736549 -0.3630530 -0.6166939 -0.1029590
          [,13]       [,14]      [,15]       [,16]       [,17]      [,18]
[1,]  1.7546461 -0.19300811  1.4864669  0.04905294 -1.88337925 -0.2545512
[2,] -1.9493057 -1.81181781  2.5881742  2.38459430 -0.03978411 -0.6891834
[3,] -0.9005458  0.15489620  1.3508521 -1.26905282  1.00950212  0.1210903
[4,]  0.9212634  0.07367221 -0.3625445 -1.22485017  0.49104048  2.0503668
[5,]  0.1984050  0.91707073 -0.4116531  0.46892038 -1.65376339  0.1753453
          [,19]      [,20]
[1,]  0.8279844  0.1549487
[2,]  2.2825848  0.2634241
[3,] -0.4363251 -0.4962337
[4,] -0.6623150 -0.7015766
[5,] -0.9099040 -1.5376555
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-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:    E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  626  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  541  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.21-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.942366 1.114764 -0.6754572 -1.581969 1.264649 -0.6948682 1.052347
           col8       col9     col10      col11    col12    col13   col14
row1 -0.4049621 -0.3738083 -1.042902 -0.2701079 -1.58345 0.179293 0.29048
        col15     col16      col17     col18      col19      col20
row1 1.391292 0.4319204 -0.5170034 -1.114288 -0.6384468 0.07646676
> tmp[,"col10"]
          col10
row1 -1.0429020
row2 -0.3688276
row3  0.4028539
row4 -0.3119612
row5 -0.9625071
> tmp[c("row1","row5"),]
          col1      col2       col3       col4     col5        col6      col7
row1 0.9423660 1.1147645 -0.6754572 -1.5819686 1.264649 -0.69486821 1.0523473
row5 0.3548662 0.8274396 -0.3160259 -0.4242569 0.665300  0.05870781 0.2445026
           col8       col9      col10      col11      col12    col13    col14
row1 -0.4049621 -0.3738083 -1.0429020 -0.2701079 -1.5834503 0.179293 0.290480
row5  1.3288740  0.2535018 -0.9625071 -1.6717105 -0.1893013 1.629736 1.779869
        col15      col16      col17     col18      col19      col20
row1 1.391292  0.4319204 -0.5170034 -1.114288 -0.6384468 0.07646676
row5 1.648888 -0.1988323  0.1691665  1.554549 -0.7439452 1.03912181
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.69486821 0.07646676
row2 -2.05140791 0.51451293
row3 -0.85164256 0.17747092
row4 -0.62502357 1.25377769
row5  0.05870781 1.03912181
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1 -0.69486821 0.07646676
row5  0.05870781 1.03912181
> 
> 
> 
> 
> 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 49.22904 51.50872 48.86131 51.10755 48.52804 105.8724 50.04851 47.82901
         col9    col10    col11    col12    col13   col14    col15    col16
row1 49.89518 49.60515 49.76568 50.10938 48.75853 50.8979 50.49846 50.41074
        col17    col18    col19    col20
row1 51.31046 50.94552 52.66431 106.5992
> tmp[,"col10"]
        col10
row1 49.60515
row2 28.42213
row3 31.04004
row4 30.83827
row5 50.48158
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.22904 51.50872 48.86131 51.10755 48.52804 105.8724 50.04851 47.82901
row5 48.80692 50.05300 49.40179 48.93794 50.60883 107.8938 49.92516 49.81899
         col9    col10    col11    col12    col13   col14    col15    col16
row1 49.89518 49.60515 49.76568 50.10938 48.75853 50.8979 50.49846 50.41074
row5 49.81248 50.48158 50.10217 48.64957 49.97497 50.3082 49.15929 48.88804
        col17    col18    col19    col20
row1 51.31046 50.94552 52.66431 106.5992
row5 48.09938 50.17018 47.47594 104.6955
> tmp[,c("col6","col20")]
          col6     col20
row1 105.87238 106.59917
row2  75.79206  74.79227
row3  74.56750  75.37464
row4  76.07773  74.53254
row5 107.89375 104.69554
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.8724 106.5992
row5 107.8938 104.6955
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.8724 106.5992
row5 107.8938 104.6955
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -1.62170986
[2,]  0.57523941
[3,]  1.57656509
[4,]  0.80043891
[5,] -0.01853235
> tmp[,c("col17","col7")]
           col17        col7
[1,]  2.07854885 -0.59965409
[2,]  1.10797741  0.04504184
[3,] -0.48084397 -0.53708280
[4,] -0.08911829 -1.51509011
[5,] -0.33722606  0.51118240
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  1.4234989  0.6143010
[2,]  0.8884539 -1.4727995
[3,] -1.3165585  0.2522887
[4,] -0.4313543  0.7045938
[5,]  0.4164882  0.7554205
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.423499
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 1.4234989
[2,] 0.8884539
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]       [,4]      [,5]        [,6]     [,7]
row3  0.4014219  1.783621 -0.6046685 -1.2512367 0.3453129 -0.64133740 1.538954
row1 -1.0104858 -1.315530  1.0843707  0.1302774 0.5640515 -0.03534918 1.334955
           [,8]      [,9]      [,10]      [,11]        [,12]      [,13]
row3 0.08860194 0.1810576  0.2625046 -0.6821116 0.5238710533  0.9088426
row1 1.12270994 1.2125105 -0.1108230  0.6343496 0.0002299788 -0.2789813
          [,14]      [,15]      [,16]      [,17]     [,18]     [,19]      [,20]
row3 -0.9176805 -1.6631877  0.4847361 -0.1014898 0.2210827 0.1305042  1.2329942
row1  0.4775252  0.5278349 -1.8283168 -0.8013826 1.3268032 0.7459077 -0.1053887
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]       [,3]      [,4]       [,5]      [,6]     [,7]
row2 1.273486 0.7298729 -0.3044715 0.2229496 -0.9356722 0.6360773 1.480148
          [,8]       [,9]     [,10]
row2 0.5621895 -0.4517385 0.6882384
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]      [,4]      [,5]     [,6]       [,7]
row5 0.9857391 -0.2804195 0.2565866 0.3314121 0.2663811 1.850722 -0.1474679
          [,8]      [,9]     [,10]      [,11]      [,12]     [,13]     [,14]
row5 -1.719369 0.3624666 0.2469189 -0.6707415 -0.6103869 -2.047619 0.7407082
        [,15]      [,16]     [,17]     [,18]      [,19]    [,20]
row5 1.247595 -0.7098111 0.6658587 -2.894284 -0.9776648 2.765433
> 
> 
> 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: 0x0000025b690ffa10>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d04d637b97"
 [2] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d0105f208d"
 [3] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d03e63bf4" 
 [4] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d037751c02"
 [5] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d0e1a19c7" 
 [6] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d04d5379a5"
 [7] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d07fba6c8c"
 [8] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d08522ffa" 
 [9] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d023053b0e"
[10] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d051e71934"
[11] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d065b3734" 
[12] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d03244da7" 
[13] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d054146c1e"
[14] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d04a82280" 
[15] "E:/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests\\BMf7d04cf61270"
> 
> 
> ### 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: 0x0000025b6a9ff2f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x0000025b6a9ff2f0>
Warning message:
In dir.create(new.directory) :
  'E:\biocbuild\bbs-3.21-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x0000025b6a9ff2f0>
> rowMedians(tmp)
  [1] -0.2905997969  0.1386188992 -0.2754833950  0.2801419021  0.6219276439
  [6] -0.2423559285  0.0147153340 -0.3403984115  0.3372956835 -0.3980025904
 [11]  0.0722574788  0.1740505852 -0.0718973172  0.9559812734 -0.2739828345
 [16] -0.1200719078  0.0465015319 -0.2483172154 -0.2244876583  0.0956534007
 [21]  0.2626162752  0.5363286529 -0.3028742637 -0.0810540436 -0.0858243834
 [26] -0.1566394934 -0.2868104085  0.3059505099  0.3447522633  0.2659911313
 [31]  0.1729085518  0.4624678001 -0.3768444806  0.0052817833 -0.1847090128
 [36] -0.2127018620 -0.1593606378  0.0226614626  0.5921259482 -0.1940162921
 [41]  0.2647951188 -0.0755682111 -0.0580708660 -0.0017578925 -0.3315317040
 [46]  0.0270781902 -0.2013664024  0.0794302035  0.4353046983 -0.2786277428
 [51]  0.3215980257 -0.2703262032  0.3069625584  0.2050668786  0.2876006260
 [56] -0.7756539074  0.1857895978  0.2089149991 -0.2322584076 -0.0270002209
 [61] -0.0820366422  0.4375296574  0.0003236489 -0.0063391969 -0.2601559977
 [66]  0.6826224761  0.3456500347  0.2949819500 -0.2668894169  0.1991303593
 [71]  0.3122559487 -0.5363883943  0.1989539209 -0.2916140964 -0.3286996314
 [76] -0.1795289524 -0.2692435203  0.0733304304 -0.1116809334  0.1572225523
 [81]  0.2372249110 -0.2448827002 -0.1576018700 -0.0042885935  0.3469869785
 [86] -0.3173331016  0.2314496874 -0.4780171546  0.0557156384  0.0303471334
 [91] -0.5308629790 -0.0529242203 -0.0800304655  0.2537996430  0.4878590321
 [96] -0.2633696197  0.2396175321  0.0183627726  0.4225939821 -0.2591128894
[101]  0.5227242108 -0.2176502690  0.4861561453  0.2759587477 -0.6077566841
[106] -0.3728097728  0.0017270943  0.2697029577  0.0334837370 -0.0922849782
[111] -0.1071022341  0.0840154491  0.0520667957 -0.2104469566 -0.0473020586
[116] -0.3861428438 -0.6499444727 -0.2958061572  0.0210411049  0.4619434953
[121] -0.6027760706  0.4935037668  0.1309880589  0.5871079745  0.3287180092
[126]  0.2412442354 -0.2495491558 -0.0400213711  0.3530627667  0.4208659682
[131]  0.2815358404 -0.4911398715 -0.2103470468  0.0294456301  0.1071261950
[136] -0.0146808410  0.3242304282  0.5067944334 -0.2143742361 -0.2707423901
[141] -0.1070994490  0.0240372224  0.4347457683  0.6043341955 -0.1704228019
[146] -0.4502464485  0.0312254037 -0.5838880361 -0.2122133657  0.0288781884
[151] -0.0259586741  0.0403446656  0.1093538655 -0.0898704521  0.0700002969
[156] -0.9759340323  0.3675247981  0.1000197730  0.0843276725 -0.3084994658
[161] -0.4638275870 -0.5289583541  0.1638625087 -0.0603600299  0.0459417790
[166] -0.1925424032  0.4041737912  0.3531236402  0.3894488401  0.0375399400
[171] -0.1228112498 -0.3068705048  0.3732605438  0.5778513609 -0.4251339683
[176] -0.3546286820 -0.2494339724 -0.0758821112 -0.2905094421 -0.1525810274
[181] -0.1783402450  0.5118840409  0.1108322140  0.2823125721 -0.4219391223
[186] -0.4870807498  0.1793413785  0.3126223232 -0.3612219103  0.0028846676
[191] -0.0152527258  0.0566212938 -0.4921891818 -0.2003638319 -0.0588203676
[196] -0.1707138171  0.0254075789 -0.1613150258  0.0655766440 -0.3976567356
[201] -0.0600892698 -0.2116458506 -0.1519173657 -0.1343929833 -0.1924990929
[206]  0.0465875899  0.2316491381  0.0377978152 -0.4869810459  0.3576669575
[211] -0.1720352442  0.1868764012  0.0582203157 -0.0506427202  0.5208744577
[216] -0.0339081810  0.5533565314 -0.3009459330 -0.0181268772 -0.3699535605
[221]  0.0665706246 -0.6062640799  0.4533049800  0.1683779932  0.6930705402
[226]  0.0737782916 -0.2399647804  0.0906211938 -0.3665913002  0.1252272247
> 
> proc.time()
   user  system elapsed 
   3.57   15.53  135.03 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2024-10-26 r87273 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2024 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: 0x000002b7e16ff0b0>
> .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: 0x000002b7e16ff0b0>
> .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: 0x000002b7e16ff0b0>
> .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: 0x000002b7e16ff0b0>
> 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: 0x000002b7e16ff2f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002b7e16ff2f0>
> .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: 0x000002b7e16ff2f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002b7e16ff2f0>
> .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: 0x000002b7e16ff2f0>
> 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: 0x000002b7e16ff5f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002b7e16ff5f0>
> .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: 0x000002b7e16ff5f0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002b7e16ff5f0>
> .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: 0x000002b7e16ff5f0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000002b7e16ff5f0>
> .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: 0x000002b7e16ff5f0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000002b7e16ff5f0>
> .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: 0x000002b7e16ff5f0>
> 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: 0x000002b7e16ffa10>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000002b7e16ffa10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002b7e16ffa10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002b7e16ffa10>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1aa8027455ded" "BufferedMatrixFile1aa806f2d7172"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1aa8027455ded" "BufferedMatrixFile1aa806f2d7172"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002b7e16ffdd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002b7e16ffdd0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002b7e16ffdd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002b7e16ffdd0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000002b7e16ffdd0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000002b7e16ffdd0>
> .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: 0x000002b7e0a7aa70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002b7e0a7aa70>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002b7e0a7aa70>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000002b7e0a7aa70>
> 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: 0x000002b7e33ff410>
> .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: 0x000002b7e33ff410>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.39    0.06    1.98 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2024-10-26 r87273 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2024 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.32    0.07    0.39 

Example timings