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

This page was generated on 2024-03-28 11:37:25 -0400 (Thu, 28 Mar 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_64R Under development (unstable) (2024-03-18 r86148) -- "Unsuffered Consequences" 4708
palomino3Windows Server 2022 Datacenterx64R Under development (unstable) (2024-03-16 r86144 ucrt) -- "Unsuffered Consequences" 4446
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2024-03-18 r86148) -- "Unsuffered Consequences" 4471
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch64R Under development (unstable) (2024-03-19 r86153) -- "Unsuffered Consequences" 4426
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 247/2270HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.67.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-03-27 14:00:18 -0400 (Wed, 27 Mar 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 9250806
git_last_commit_date: 2023-10-24 09:37:50 -0400 (Tue, 24 Oct 2023)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows 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
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  

CHECK results for BufferedMatrix on palomino3


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.67.0
Command: F:\biocbuild\bbs-3.19-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.19-bioc\R\library --no-vignettes --timings BufferedMatrix_1.67.0.tar.gz
StartedAt: 2024-03-28 00:00:35 -0400 (Thu, 28 Mar 2024)
EndedAt: 2024-03-28 00:02:05 -0400 (Thu, 28 Mar 2024)
EllapsedTime: 89.8 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck'
* using R Under development (unstable) (2024-03-16 r86144 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.67.0'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'BufferedMatrix' can be installed ... OK
* used C compiler: 'gcc.exe (GCC) 13.2.0'
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files for x64 is not available
File 'F:/biocbuild/bbs-3.19-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found '_exit', possibly from '_exit' (C)
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

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

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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'F:/biocbuild/bbs-3.19-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 13.2.0'
gcc  -I"F:/biocbuild/bbs-3.19-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"F:/biocbuild/bbs-3.19-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"F:/biocbuild/bbs-3.19-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"F:/biocbuild/bbs-3.19-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 -LF:/biocbuild/bbs-3.19-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.19-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-03-16 r86144 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.23    0.14    0.65 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2024-03-16 r86144 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] "F:/biocbuild/bbs-3.19-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 468418 25.1    1021374 54.6   633925 33.9
Vcells 853869  6.6    8388608 64.0  2003432 15.3
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Mar 28 00:01:04 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Mar 28 00:01:04 2024"
> 
> 
> 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: 0x0000022822ef80b0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Mar 28 00:01:14 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Mar 28 00:01:17 2024"
> 
> ColMode(tmp2)
<pointer: 0x0000022822ef80b0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]        [,4]
[1,] 100.7032010  1.220652 -0.6276773 -0.80465187
[2,]  -0.6126047 -1.119727  1.6513898  0.02660305
[3,]  -0.2851168  1.454152  1.6910365 -1.77957072
[4,]  -2.3244405  1.117742 -0.1364979 -1.09402850
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-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,] 100.7032010 1.220652 0.6276773 0.80465187
[2,]   0.6126047 1.119727 1.6513898 0.02660305
[3,]   0.2851168 1.454152 1.6910365 1.77957072
[4,]   2.3244405 1.117742 0.1364979 1.09402850
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-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,] 10.0350985 1.104831 0.7922609 0.8970239
[2,]  0.7826907 1.058172 1.2850641 0.1631044
[3,]  0.5339633 1.205882 1.3003986 1.3340055
[4,]  1.5246116 1.057233 0.3694563 1.0459582
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-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,] 226.05419 37.26896 33.55029 34.77489
[2,]  33.43951 36.70144 39.50203 26.65765
[3,]  30.62475 38.51297 39.69502 40.11963
[4,]  42.57056 36.69007 28.83106 36.55361
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x0000022822ef8110>
> exp(tmp5)
<pointer: 0x0000022822ef8110>
> log(tmp5,2)
<pointer: 0x0000022822ef8110>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.5022
> Min(tmp5)
[1] 54.86545
> mean(tmp5)
[1] 73.43891
> Sum(tmp5)
[1] 14687.78
> Var(tmp5)
[1] 866.7951
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.44325 72.66625 72.54142 71.16159 71.06717 74.71600 72.34908 71.02211
 [9] 68.51189 68.91029
> rowSums(tmp5)
 [1] 1828.865 1453.325 1450.828 1423.232 1421.343 1494.320 1446.982 1420.442
 [9] 1370.238 1378.206
> rowVars(tmp5)
 [1] 7997.38812   73.84345   72.78311   94.26833   83.45308   68.20285
 [7]   91.24885   90.26256   73.20300   23.55474
> rowSd(tmp5)
 [1] 89.428117  8.593221  8.531302  9.709188  9.135266  8.258502  9.552427
 [8]  9.500661  8.555875  4.853322
> rowMax(tmp5)
 [1] 470.50217  82.55426  83.70073  88.60504  93.11012  88.42828  92.77736
 [8]  89.18774  83.21420  81.25330
> rowMin(tmp5)
 [1] 60.43477 55.48440 56.58647 54.86545 57.88145 60.52801 59.61821 58.15518
 [9] 55.30139 59.76318
> 
> colMeans(tmp5)
 [1] 110.16531  72.27495  72.83774  69.56506  68.32728  72.06493  73.64313
 [8]  68.84914  65.37591  70.54154  76.56276  74.75323  73.43611  72.88913
[15]  70.30330  73.94183  74.56702  68.60288  68.22443  71.85243
> colSums(tmp5)
 [1] 1101.6531  722.7495  728.3774  695.6506  683.2728  720.6493  736.4313
 [8]  688.4914  653.7591  705.4154  765.6276  747.5323  734.3611  728.8913
[15]  703.0330  739.4183  745.6702  686.0288  682.2443  718.5243
> colVars(tmp5)
 [1] 16091.79417    49.90311    88.18548    89.98350   140.47191    69.37359
 [7]    38.96906   100.01862    42.69470    52.93593   100.84103    43.15231
[13]    90.95469    86.02125    44.74671    61.33685    71.66033    62.03631
[19]    26.41302    76.17330
> colSd(tmp5)
 [1] 126.853436   7.064213   9.390712   9.485963  11.852085   8.329081
 [7]   6.242520  10.000931   6.534118   7.275708  10.041964   6.569042
[13]   9.537017   9.274764   6.689298   7.831785   8.465243   7.876313
[19]   5.139360   8.727732
> colMax(tmp5)
 [1] 470.50217  80.15971  88.25066  83.50374  88.42828  82.64343  83.70073
 [8]  82.10622  76.06844  80.31596  93.11012  83.33892  92.77736  81.77824
[15]  82.40952  83.30045  87.41186  85.15675  74.83420  84.23792
> colMin(tmp5)
 [1] 60.52801 59.61821 60.00808 55.48440 55.62372 57.02161 61.93727 54.86545
 [9] 55.30139 61.20901 60.59848 65.17283 60.30657 56.78800 60.77805 62.40678
[17] 58.79861 58.49412 60.43146 56.58864
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.44325 72.66625 72.54142 71.16159 71.06717 74.71600 72.34908       NA
 [9] 68.51189 68.91029
> rowSums(tmp5)
 [1] 1828.865 1453.325 1450.828 1423.232 1421.343 1494.320 1446.982       NA
 [9] 1370.238 1378.206
> rowVars(tmp5)
 [1] 7997.38812   73.84345   72.78311   94.26833   83.45308   68.20285
 [7]   91.24885   89.67017   73.20300   23.55474
> rowSd(tmp5)
 [1] 89.428117  8.593221  8.531302  9.709188  9.135266  8.258502  9.552427
 [8]  9.469434  8.555875  4.853322
> rowMax(tmp5)
 [1] 470.50217  82.55426  83.70073  88.60504  93.11012  88.42828  92.77736
 [8]        NA  83.21420  81.25330
> rowMin(tmp5)
 [1] 60.43477 55.48440 56.58647 54.86545 57.88145 60.52801 59.61821       NA
 [9] 55.30139 59.76318
> 
> colMeans(tmp5)
 [1] 110.16531        NA  72.83774  69.56506  68.32728  72.06493  73.64313
 [8]  68.84914  65.37591  70.54154  76.56276  74.75323  73.43611  72.88913
[15]  70.30330  73.94183  74.56702  68.60288  68.22443  71.85243
> colSums(tmp5)
 [1] 1101.6531        NA  728.3774  695.6506  683.2728  720.6493  736.4313
 [8]  688.4914  653.7591  705.4154  765.6276  747.5323  734.3611  728.8913
[15]  703.0330  739.4183  745.6702  686.0288  682.2443  718.5243
> colVars(tmp5)
 [1] 16091.79417          NA    88.18548    89.98350   140.47191    69.37359
 [7]    38.96906   100.01862    42.69470    52.93593   100.84103    43.15231
[13]    90.95469    86.02125    44.74671    61.33685    71.66033    62.03631
[19]    26.41302    76.17330
> colSd(tmp5)
 [1] 126.853436         NA   9.390712   9.485963  11.852085   8.329081
 [7]   6.242520  10.000931   6.534118   7.275708  10.041964   6.569042
[13]   9.537017   9.274764   6.689298   7.831785   8.465243   7.876313
[19]   5.139360   8.727732
> colMax(tmp5)
 [1] 470.50217        NA  88.25066  83.50374  88.42828  82.64343  83.70073
 [8]  82.10622  76.06844  80.31596  93.11012  83.33892  92.77736  81.77824
[15]  82.40952  83.30045  87.41186  85.15675  74.83420  84.23792
> colMin(tmp5)
 [1] 60.52801       NA 60.00808 55.48440 55.62372 57.02161 61.93727 54.86545
 [9] 55.30139 61.20901 60.59848 65.17283 60.30657 56.78800 60.77805 62.40678
[17] 58.79861 58.49412 60.43146 56.58864
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.5022
> Min(tmp5,na.rm=TRUE)
[1] 54.86545
> mean(tmp5,na.rm=TRUE)
[1] 73.50026
> Sum(tmp5,na.rm=TRUE)
[1] 14626.55
> Var(tmp5,na.rm=TRUE)
[1] 870.4163
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.44325 72.66625 72.54142 71.16159 71.06717 74.71600 72.34908 71.53747
 [9] 68.51189 68.91029
> rowSums(tmp5,na.rm=TRUE)
 [1] 1828.865 1453.325 1450.828 1423.232 1421.343 1494.320 1446.982 1359.212
 [9] 1370.238 1378.206
> rowVars(tmp5,na.rm=TRUE)
 [1] 7997.38812   73.84345   72.78311   94.26833   83.45308   68.20285
 [7]   91.24885   89.67017   73.20300   23.55474
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.428117  8.593221  8.531302  9.709188  9.135266  8.258502  9.552427
 [8]  9.469434  8.555875  4.853322
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.50217  82.55426  83.70073  88.60504  93.11012  88.42828  92.77736
 [8]  89.18774  83.21420  81.25330
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.43477 55.48440 56.58647 54.86545 57.88145 60.52801 59.61821 58.15518
 [9] 55.30139 59.76318
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.16531  73.50213  72.83774  69.56506  68.32728  72.06493  73.64313
 [8]  68.84914  65.37591  70.54154  76.56276  74.75323  73.43611  72.88913
[15]  70.30330  73.94183  74.56702  68.60288  68.22443  71.85243
> colSums(tmp5,na.rm=TRUE)
 [1] 1101.6531  661.5191  728.3774  695.6506  683.2728  720.6493  736.4313
 [8]  688.4914  653.7591  705.4154  765.6276  747.5323  734.3611  728.8913
[15]  703.0330  739.4183  745.6702  686.0288  682.2443  718.5243
> colVars(tmp5,na.rm=TRUE)
 [1] 16091.79417    39.19881    88.18548    89.98350   140.47191    69.37359
 [7]    38.96906   100.01862    42.69470    52.93593   100.84103    43.15231
[13]    90.95469    86.02125    44.74671    61.33685    71.66033    62.03631
[19]    26.41302    76.17330
> colSd(tmp5,na.rm=TRUE)
 [1] 126.853436   6.260895   9.390712   9.485963  11.852085   8.329081
 [7]   6.242520  10.000931   6.534118   7.275708  10.041964   6.569042
[13]   9.537017   9.274764   6.689298   7.831785   8.465243   7.876313
[19]   5.139360   8.727732
> colMax(tmp5,na.rm=TRUE)
 [1] 470.50217  80.15971  88.25066  83.50374  88.42828  82.64343  83.70073
 [8]  82.10622  76.06844  80.31596  93.11012  83.33892  92.77736  81.77824
[15]  82.40952  83.30045  87.41186  85.15675  74.83420  84.23792
> colMin(tmp5,na.rm=TRUE)
 [1] 60.52801 59.61821 60.00808 55.48440 55.62372 57.02161 61.93727 54.86545
 [9] 55.30139 61.20901 60.59848 65.17283 60.30657 56.78800 60.77805 62.40678
[17] 58.79861 58.49412 60.43146 56.58864
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.44325 72.66625 72.54142 71.16159 71.06717 74.71600 72.34908      NaN
 [9] 68.51189 68.91029
> rowSums(tmp5,na.rm=TRUE)
 [1] 1828.865 1453.325 1450.828 1423.232 1421.343 1494.320 1446.982    0.000
 [9] 1370.238 1378.206
> rowVars(tmp5,na.rm=TRUE)
 [1] 7997.38812   73.84345   72.78311   94.26833   83.45308   68.20285
 [7]   91.24885         NA   73.20300   23.55474
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.428117  8.593221  8.531302  9.709188  9.135266  8.258502  9.552427
 [8]        NA  8.555875  4.853322
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.50217  82.55426  83.70073  88.60504  93.11012  88.42828  92.77736
 [8]        NA  83.21420  81.25330
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.43477 55.48440 56.58647 54.86545 57.88145 60.52801 59.61821       NA
 [9] 55.30139 59.76318
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.91432       NaN  73.10611  70.83283  69.29897  70.88954  73.18052
 [8]  67.37613  65.08670  69.92440  75.15999  74.38770  74.24624  72.74013
[15]  71.26494  73.75509  75.19037  69.72608  69.09031  70.47627
> colSums(tmp5,na.rm=TRUE)
 [1] 1034.2289    0.0000  657.9550  637.4955  623.6908  638.0059  658.6247
 [8]  606.3852  585.7803  629.3196  676.4399  669.4893  668.2162  654.6612
[15]  641.3845  663.7958  676.7133  627.5347  621.8128  634.2864
> colVars(tmp5,na.rm=TRUE)
 [1] 17849.54600          NA    98.39840    83.15013   147.40874    62.50297
 [7]    41.43263    88.11120    47.09051    55.26824    91.30865    47.04316
[13]    94.94042    96.52415    39.93654    68.61163    76.24654    55.59820
[19]    21.27988    64.38937
> colSd(tmp5,na.rm=TRUE)
 [1] 133.602193         NA   9.919597   9.118669  12.141200   7.905882
 [7]   6.436818   9.386756   6.862252   7.434261   9.555556   6.858802
[13]   9.743738   9.824671   6.319536   8.283214   8.731926   7.456420
[19]   4.613012   8.024298
> colMax(tmp5,na.rm=TRUE)
 [1] 470.50217      -Inf  88.25066  83.50374  88.42828  80.90801  83.70073
 [8]  80.16374  76.06844  80.31596  93.11012  83.33892  92.77736  81.77824
[15]  82.40952  83.30045  87.41186  85.15675  74.83420  83.18440
> colMin(tmp5,na.rm=TRUE)
 [1] 60.52801      Inf 60.00808 55.48440 55.62372 57.02161 61.93727 54.86545
 [9] 55.30139 61.20901 60.59848 65.17283 60.30657 56.78800 60.77805 62.40678
[17] 58.79861 62.50381 60.43477 56.58864
> 
> 
> 
> 
> 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] 302.24480 239.55027 221.05677 203.00529 186.18800 196.38153 201.94858
 [8] 251.66317  81.63633 210.95526
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 302.24480 239.55027 221.05677 203.00529 186.18800 196.38153 201.94858
 [8] 251.66317  81.63633 210.95526
> 
> 
> 
> 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] -5.684342e-14  0.000000e+00  3.410605e-13  0.000000e+00  0.000000e+00
 [6]  5.684342e-14 -1.136868e-13 -2.842171e-14 -1.136868e-13  1.989520e-13
[11]  1.421085e-13 -1.136868e-13 -2.415845e-13 -2.131628e-14  0.000000e+00
[16]  5.684342e-14 -5.684342e-14 -2.842171e-14 -1.136868e-13  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
8   14 
9   16 
1   19 
7   9 
3   13 
8   14 
4   9 
1   4 
4   9 
5   20 
2   18 
7   7 
5   15 
5   5 
6   11 
8   10 
7   5 
7   9 
4   3 
6   2 
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] 2.158215
> Min(tmp)
[1] -2.600686
> mean(tmp)
[1] -0.05141157
> Sum(tmp)
[1] -5.141157
> Var(tmp)
[1] 0.8732697
> 
> rowMeans(tmp)
[1] -0.05141157
> rowSums(tmp)
[1] -5.141157
> rowVars(tmp)
[1] 0.8732697
> rowSd(tmp)
[1] 0.934489
> rowMax(tmp)
[1] 2.158215
> rowMin(tmp)
[1] -2.600686
> 
> colMeans(tmp)
  [1]  1.373508915  1.044214261  0.304345923 -1.317127810 -0.906157058
  [6] -0.083691030  0.103749052  0.044593362  1.119570192  0.505499977
 [11] -2.228859600 -0.290261306  0.173368538 -1.826411272  0.292053035
 [16]  1.486930605 -0.023932543 -0.006917284 -0.323500655  0.690271364
 [21] -0.375981770  0.334804749  0.275542511  0.297458700  0.064507158
 [26] -0.050535541  0.782862255  0.426445187  1.304523279 -0.078132151
 [31] -0.596625539  0.479672592 -0.438411305 -0.804578584 -0.433951159
 [36] -0.539829072 -0.623102492 -1.907155927  1.257694538 -1.586426768
 [41]  0.723340061 -0.121922697 -0.744318258 -0.832088741  0.807645329
 [46] -0.183527462 -1.445561057 -0.652622626 -0.010871994  0.534007817
 [51]  0.120927941 -0.036104636 -2.461059943  2.158215124  1.890564168
 [56]  0.104750281 -0.624355344 -0.379165693  1.303686621  0.532057914
 [61]  0.605155344  0.599362749 -0.057839533 -0.649501620 -1.236056494
 [66] -0.452957814 -1.560504305 -0.730002958  0.596697433  0.877930288
 [71]  0.066786931  0.058872199 -0.034102922 -1.455093739 -1.095168755
 [76]  1.343766173  1.371448634  0.956068012  0.056909500 -0.056352550
 [81] -0.202570836 -0.352181133 -0.635280805  0.519157174  1.901046838
 [86]  0.246428763  0.585577394  0.065422543  0.531727663 -0.444262373
 [91]  0.366410126 -2.600685587  0.373967251  0.573250167 -0.530631778
 [96] -2.001851007  0.083380380 -0.109126439 -0.206610959 -1.113365292
> colSums(tmp)
  [1]  1.373508915  1.044214261  0.304345923 -1.317127810 -0.906157058
  [6] -0.083691030  0.103749052  0.044593362  1.119570192  0.505499977
 [11] -2.228859600 -0.290261306  0.173368538 -1.826411272  0.292053035
 [16]  1.486930605 -0.023932543 -0.006917284 -0.323500655  0.690271364
 [21] -0.375981770  0.334804749  0.275542511  0.297458700  0.064507158
 [26] -0.050535541  0.782862255  0.426445187  1.304523279 -0.078132151
 [31] -0.596625539  0.479672592 -0.438411305 -0.804578584 -0.433951159
 [36] -0.539829072 -0.623102492 -1.907155927  1.257694538 -1.586426768
 [41]  0.723340061 -0.121922697 -0.744318258 -0.832088741  0.807645329
 [46] -0.183527462 -1.445561057 -0.652622626 -0.010871994  0.534007817
 [51]  0.120927941 -0.036104636 -2.461059943  2.158215124  1.890564168
 [56]  0.104750281 -0.624355344 -0.379165693  1.303686621  0.532057914
 [61]  0.605155344  0.599362749 -0.057839533 -0.649501620 -1.236056494
 [66] -0.452957814 -1.560504305 -0.730002958  0.596697433  0.877930288
 [71]  0.066786931  0.058872199 -0.034102922 -1.455093739 -1.095168755
 [76]  1.343766173  1.371448634  0.956068012  0.056909500 -0.056352550
 [81] -0.202570836 -0.352181133 -0.635280805  0.519157174  1.901046838
 [86]  0.246428763  0.585577394  0.065422543  0.531727663 -0.444262373
 [91]  0.366410126 -2.600685587  0.373967251  0.573250167 -0.530631778
 [96] -2.001851007  0.083380380 -0.109126439 -0.206610959 -1.113365292
> 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]  1.373508915  1.044214261  0.304345923 -1.317127810 -0.906157058
  [6] -0.083691030  0.103749052  0.044593362  1.119570192  0.505499977
 [11] -2.228859600 -0.290261306  0.173368538 -1.826411272  0.292053035
 [16]  1.486930605 -0.023932543 -0.006917284 -0.323500655  0.690271364
 [21] -0.375981770  0.334804749  0.275542511  0.297458700  0.064507158
 [26] -0.050535541  0.782862255  0.426445187  1.304523279 -0.078132151
 [31] -0.596625539  0.479672592 -0.438411305 -0.804578584 -0.433951159
 [36] -0.539829072 -0.623102492 -1.907155927  1.257694538 -1.586426768
 [41]  0.723340061 -0.121922697 -0.744318258 -0.832088741  0.807645329
 [46] -0.183527462 -1.445561057 -0.652622626 -0.010871994  0.534007817
 [51]  0.120927941 -0.036104636 -2.461059943  2.158215124  1.890564168
 [56]  0.104750281 -0.624355344 -0.379165693  1.303686621  0.532057914
 [61]  0.605155344  0.599362749 -0.057839533 -0.649501620 -1.236056494
 [66] -0.452957814 -1.560504305 -0.730002958  0.596697433  0.877930288
 [71]  0.066786931  0.058872199 -0.034102922 -1.455093739 -1.095168755
 [76]  1.343766173  1.371448634  0.956068012  0.056909500 -0.056352550
 [81] -0.202570836 -0.352181133 -0.635280805  0.519157174  1.901046838
 [86]  0.246428763  0.585577394  0.065422543  0.531727663 -0.444262373
 [91]  0.366410126 -2.600685587  0.373967251  0.573250167 -0.530631778
 [96] -2.001851007  0.083380380 -0.109126439 -0.206610959 -1.113365292
> colMin(tmp)
  [1]  1.373508915  1.044214261  0.304345923 -1.317127810 -0.906157058
  [6] -0.083691030  0.103749052  0.044593362  1.119570192  0.505499977
 [11] -2.228859600 -0.290261306  0.173368538 -1.826411272  0.292053035
 [16]  1.486930605 -0.023932543 -0.006917284 -0.323500655  0.690271364
 [21] -0.375981770  0.334804749  0.275542511  0.297458700  0.064507158
 [26] -0.050535541  0.782862255  0.426445187  1.304523279 -0.078132151
 [31] -0.596625539  0.479672592 -0.438411305 -0.804578584 -0.433951159
 [36] -0.539829072 -0.623102492 -1.907155927  1.257694538 -1.586426768
 [41]  0.723340061 -0.121922697 -0.744318258 -0.832088741  0.807645329
 [46] -0.183527462 -1.445561057 -0.652622626 -0.010871994  0.534007817
 [51]  0.120927941 -0.036104636 -2.461059943  2.158215124  1.890564168
 [56]  0.104750281 -0.624355344 -0.379165693  1.303686621  0.532057914
 [61]  0.605155344  0.599362749 -0.057839533 -0.649501620 -1.236056494
 [66] -0.452957814 -1.560504305 -0.730002958  0.596697433  0.877930288
 [71]  0.066786931  0.058872199 -0.034102922 -1.455093739 -1.095168755
 [76]  1.343766173  1.371448634  0.956068012  0.056909500 -0.056352550
 [81] -0.202570836 -0.352181133 -0.635280805  0.519157174  1.901046838
 [86]  0.246428763  0.585577394  0.065422543  0.531727663 -0.444262373
 [91]  0.366410126 -2.600685587  0.373967251  0.573250167 -0.530631778
 [96] -2.001851007  0.083380380 -0.109126439 -0.206610959 -1.113365292
> colMedians(tmp)
  [1]  1.373508915  1.044214261  0.304345923 -1.317127810 -0.906157058
  [6] -0.083691030  0.103749052  0.044593362  1.119570192  0.505499977
 [11] -2.228859600 -0.290261306  0.173368538 -1.826411272  0.292053035
 [16]  1.486930605 -0.023932543 -0.006917284 -0.323500655  0.690271364
 [21] -0.375981770  0.334804749  0.275542511  0.297458700  0.064507158
 [26] -0.050535541  0.782862255  0.426445187  1.304523279 -0.078132151
 [31] -0.596625539  0.479672592 -0.438411305 -0.804578584 -0.433951159
 [36] -0.539829072 -0.623102492 -1.907155927  1.257694538 -1.586426768
 [41]  0.723340061 -0.121922697 -0.744318258 -0.832088741  0.807645329
 [46] -0.183527462 -1.445561057 -0.652622626 -0.010871994  0.534007817
 [51]  0.120927941 -0.036104636 -2.461059943  2.158215124  1.890564168
 [56]  0.104750281 -0.624355344 -0.379165693  1.303686621  0.532057914
 [61]  0.605155344  0.599362749 -0.057839533 -0.649501620 -1.236056494
 [66] -0.452957814 -1.560504305 -0.730002958  0.596697433  0.877930288
 [71]  0.066786931  0.058872199 -0.034102922 -1.455093739 -1.095168755
 [76]  1.343766173  1.371448634  0.956068012  0.056909500 -0.056352550
 [81] -0.202570836 -0.352181133 -0.635280805  0.519157174  1.901046838
 [86]  0.246428763  0.585577394  0.065422543  0.531727663 -0.444262373
 [91]  0.366410126 -2.600685587  0.373967251  0.573250167 -0.530631778
 [96] -2.001851007  0.083380380 -0.109126439 -0.206610959 -1.113365292
> colRanges(tmp)
         [,1]     [,2]      [,3]      [,4]       [,5]        [,6]      [,7]
[1,] 1.373509 1.044214 0.3043459 -1.317128 -0.9061571 -0.08369103 0.1037491
[2,] 1.373509 1.044214 0.3043459 -1.317128 -0.9061571 -0.08369103 0.1037491
           [,8]    [,9]  [,10]    [,11]      [,12]     [,13]     [,14]    [,15]
[1,] 0.04459336 1.11957 0.5055 -2.22886 -0.2902613 0.1733685 -1.826411 0.292053
[2,] 0.04459336 1.11957 0.5055 -2.22886 -0.2902613 0.1733685 -1.826411 0.292053
        [,16]       [,17]        [,18]      [,19]     [,20]      [,21]
[1,] 1.486931 -0.02393254 -0.006917284 -0.3235007 0.6902714 -0.3759818
[2,] 1.486931 -0.02393254 -0.006917284 -0.3235007 0.6902714 -0.3759818
         [,22]     [,23]     [,24]      [,25]       [,26]     [,27]     [,28]
[1,] 0.3348047 0.2755425 0.2974587 0.06450716 -0.05053554 0.7828623 0.4264452
[2,] 0.3348047 0.2755425 0.2974587 0.06450716 -0.05053554 0.7828623 0.4264452
        [,29]       [,30]      [,31]     [,32]      [,33]      [,34]      [,35]
[1,] 1.304523 -0.07813215 -0.5966255 0.4796726 -0.4384113 -0.8045786 -0.4339512
[2,] 1.304523 -0.07813215 -0.5966255 0.4796726 -0.4384113 -0.8045786 -0.4339512
          [,36]      [,37]     [,38]    [,39]     [,40]     [,41]      [,42]
[1,] -0.5398291 -0.6231025 -1.907156 1.257695 -1.586427 0.7233401 -0.1219227
[2,] -0.5398291 -0.6231025 -1.907156 1.257695 -1.586427 0.7233401 -0.1219227
          [,43]      [,44]     [,45]      [,46]     [,47]      [,48]
[1,] -0.7443183 -0.8320887 0.8076453 -0.1835275 -1.445561 -0.6526226
[2,] -0.7443183 -0.8320887 0.8076453 -0.1835275 -1.445561 -0.6526226
           [,49]     [,50]     [,51]       [,52]    [,53]    [,54]    [,55]
[1,] -0.01087199 0.5340078 0.1209279 -0.03610464 -2.46106 2.158215 1.890564
[2,] -0.01087199 0.5340078 0.1209279 -0.03610464 -2.46106 2.158215 1.890564
         [,56]      [,57]      [,58]    [,59]     [,60]     [,61]     [,62]
[1,] 0.1047503 -0.6243553 -0.3791657 1.303687 0.5320579 0.6051553 0.5993627
[2,] 0.1047503 -0.6243553 -0.3791657 1.303687 0.5320579 0.6051553 0.5993627
           [,63]      [,64]     [,65]      [,66]     [,67]     [,68]     [,69]
[1,] -0.05783953 -0.6495016 -1.236056 -0.4529578 -1.560504 -0.730003 0.5966974
[2,] -0.05783953 -0.6495016 -1.236056 -0.4529578 -1.560504 -0.730003 0.5966974
         [,70]      [,71]     [,72]       [,73]     [,74]     [,75]    [,76]
[1,] 0.8779303 0.06678693 0.0588722 -0.03410292 -1.455094 -1.095169 1.343766
[2,] 0.8779303 0.06678693 0.0588722 -0.03410292 -1.455094 -1.095169 1.343766
        [,77]    [,78]     [,79]       [,80]      [,81]      [,82]      [,83]
[1,] 1.371449 0.956068 0.0569095 -0.05635255 -0.2025708 -0.3521811 -0.6352808
[2,] 1.371449 0.956068 0.0569095 -0.05635255 -0.2025708 -0.3521811 -0.6352808
         [,84]    [,85]     [,86]     [,87]      [,88]     [,89]      [,90]
[1,] 0.5191572 1.901047 0.2464288 0.5855774 0.06542254 0.5317277 -0.4442624
[2,] 0.5191572 1.901047 0.2464288 0.5855774 0.06542254 0.5317277 -0.4442624
         [,91]     [,92]     [,93]     [,94]      [,95]     [,96]      [,97]
[1,] 0.3664101 -2.600686 0.3739673 0.5732502 -0.5306318 -2.001851 0.08338038
[2,] 0.3664101 -2.600686 0.3739673 0.5732502 -0.5306318 -2.001851 0.08338038
          [,98]     [,99]    [,100]
[1,] -0.1091264 -0.206611 -1.113365
[2,] -0.1091264 -0.206611 -1.113365
> 
> 
> Max(tmp2)
[1] 1.855399
> Min(tmp2)
[1] -2.90884
> mean(tmp2)
[1] -0.09629088
> Sum(tmp2)
[1] -9.629088
> Var(tmp2)
[1] 1.035887
> 
> rowMeans(tmp2)
  [1]  1.029161264  0.560846184  1.786606456  0.068163651 -1.759447933
  [6] -1.110233427 -0.925119817 -0.344386454 -1.251562513 -0.089619038
 [11]  0.337760298 -2.452569626  0.296427907  0.683466842  0.242383228
 [16]  0.032145664 -0.008620507 -0.904866398  0.559884403  0.882187601
 [21]  1.305130729 -2.046944885 -0.760174615 -0.459880022 -2.180527935
 [26]  0.358147890  1.054662571 -0.315919616  1.619998734  0.682056232
 [31] -0.172887957  0.104839753 -1.465848253 -1.104328125  0.131863531
 [36] -0.940923483 -1.655296091 -0.452247331  0.022613173 -0.401278188
 [41]  1.496589357  1.131852258  1.050664618 -0.101121830  0.244632765
 [46]  1.385386486 -1.039008534  0.484673293  0.335316364  0.319514039
 [51]  0.987185586 -1.191561057 -0.520326249 -1.879423330  1.227891168
 [56] -1.100549737 -0.250935531  0.030834477 -0.324381196 -1.301340617
 [61]  0.191726056  1.584837304  1.096085860  0.268566713  0.027065105
 [66] -0.898486520  0.078232594 -0.617558004 -1.252398941 -0.187986997
 [71]  0.443769937  0.589249690  0.332428526 -2.782381937  0.199454208
 [76]  1.855398699 -0.031802221  0.165118934  0.867653100  0.404497502
 [81]  0.206247475  0.660985322 -0.350492747 -2.104699776  0.482375661
 [86] -1.314143916  0.211021288  0.170501516 -1.284436217  0.416848712
 [91] -0.675942955  0.284933460 -0.142527695 -0.683736880  1.260844391
 [96]  1.230693935  0.124591292  0.478509128  0.033153616 -2.908839883
> rowSums(tmp2)
  [1]  1.029161264  0.560846184  1.786606456  0.068163651 -1.759447933
  [6] -1.110233427 -0.925119817 -0.344386454 -1.251562513 -0.089619038
 [11]  0.337760298 -2.452569626  0.296427907  0.683466842  0.242383228
 [16]  0.032145664 -0.008620507 -0.904866398  0.559884403  0.882187601
 [21]  1.305130729 -2.046944885 -0.760174615 -0.459880022 -2.180527935
 [26]  0.358147890  1.054662571 -0.315919616  1.619998734  0.682056232
 [31] -0.172887957  0.104839753 -1.465848253 -1.104328125  0.131863531
 [36] -0.940923483 -1.655296091 -0.452247331  0.022613173 -0.401278188
 [41]  1.496589357  1.131852258  1.050664618 -0.101121830  0.244632765
 [46]  1.385386486 -1.039008534  0.484673293  0.335316364  0.319514039
 [51]  0.987185586 -1.191561057 -0.520326249 -1.879423330  1.227891168
 [56] -1.100549737 -0.250935531  0.030834477 -0.324381196 -1.301340617
 [61]  0.191726056  1.584837304  1.096085860  0.268566713  0.027065105
 [66] -0.898486520  0.078232594 -0.617558004 -1.252398941 -0.187986997
 [71]  0.443769937  0.589249690  0.332428526 -2.782381937  0.199454208
 [76]  1.855398699 -0.031802221  0.165118934  0.867653100  0.404497502
 [81]  0.206247475  0.660985322 -0.350492747 -2.104699776  0.482375661
 [86] -1.314143916  0.211021288  0.170501516 -1.284436217  0.416848712
 [91] -0.675942955  0.284933460 -0.142527695 -0.683736880  1.260844391
 [96]  1.230693935  0.124591292  0.478509128  0.033153616 -2.908839883
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.029161264  0.560846184  1.786606456  0.068163651 -1.759447933
  [6] -1.110233427 -0.925119817 -0.344386454 -1.251562513 -0.089619038
 [11]  0.337760298 -2.452569626  0.296427907  0.683466842  0.242383228
 [16]  0.032145664 -0.008620507 -0.904866398  0.559884403  0.882187601
 [21]  1.305130729 -2.046944885 -0.760174615 -0.459880022 -2.180527935
 [26]  0.358147890  1.054662571 -0.315919616  1.619998734  0.682056232
 [31] -0.172887957  0.104839753 -1.465848253 -1.104328125  0.131863531
 [36] -0.940923483 -1.655296091 -0.452247331  0.022613173 -0.401278188
 [41]  1.496589357  1.131852258  1.050664618 -0.101121830  0.244632765
 [46]  1.385386486 -1.039008534  0.484673293  0.335316364  0.319514039
 [51]  0.987185586 -1.191561057 -0.520326249 -1.879423330  1.227891168
 [56] -1.100549737 -0.250935531  0.030834477 -0.324381196 -1.301340617
 [61]  0.191726056  1.584837304  1.096085860  0.268566713  0.027065105
 [66] -0.898486520  0.078232594 -0.617558004 -1.252398941 -0.187986997
 [71]  0.443769937  0.589249690  0.332428526 -2.782381937  0.199454208
 [76]  1.855398699 -0.031802221  0.165118934  0.867653100  0.404497502
 [81]  0.206247475  0.660985322 -0.350492747 -2.104699776  0.482375661
 [86] -1.314143916  0.211021288  0.170501516 -1.284436217  0.416848712
 [91] -0.675942955  0.284933460 -0.142527695 -0.683736880  1.260844391
 [96]  1.230693935  0.124591292  0.478509128  0.033153616 -2.908839883
> rowMin(tmp2)
  [1]  1.029161264  0.560846184  1.786606456  0.068163651 -1.759447933
  [6] -1.110233427 -0.925119817 -0.344386454 -1.251562513 -0.089619038
 [11]  0.337760298 -2.452569626  0.296427907  0.683466842  0.242383228
 [16]  0.032145664 -0.008620507 -0.904866398  0.559884403  0.882187601
 [21]  1.305130729 -2.046944885 -0.760174615 -0.459880022 -2.180527935
 [26]  0.358147890  1.054662571 -0.315919616  1.619998734  0.682056232
 [31] -0.172887957  0.104839753 -1.465848253 -1.104328125  0.131863531
 [36] -0.940923483 -1.655296091 -0.452247331  0.022613173 -0.401278188
 [41]  1.496589357  1.131852258  1.050664618 -0.101121830  0.244632765
 [46]  1.385386486 -1.039008534  0.484673293  0.335316364  0.319514039
 [51]  0.987185586 -1.191561057 -0.520326249 -1.879423330  1.227891168
 [56] -1.100549737 -0.250935531  0.030834477 -0.324381196 -1.301340617
 [61]  0.191726056  1.584837304  1.096085860  0.268566713  0.027065105
 [66] -0.898486520  0.078232594 -0.617558004 -1.252398941 -0.187986997
 [71]  0.443769937  0.589249690  0.332428526 -2.782381937  0.199454208
 [76]  1.855398699 -0.031802221  0.165118934  0.867653100  0.404497502
 [81]  0.206247475  0.660985322 -0.350492747 -2.104699776  0.482375661
 [86] -1.314143916  0.211021288  0.170501516 -1.284436217  0.416848712
 [91] -0.675942955  0.284933460 -0.142527695 -0.683736880  1.260844391
 [96]  1.230693935  0.124591292  0.478509128  0.033153616 -2.908839883
> 
> colMeans(tmp2)
[1] -0.09629088
> colSums(tmp2)
[1] -9.629088
> colVars(tmp2)
[1] 1.035887
> colSd(tmp2)
[1] 1.017785
> colMax(tmp2)
[1] 1.855399
> colMin(tmp2)
[1] -2.90884
> colMedians(tmp2)
[1] 0.07319812
> colRanges(tmp2)
          [,1]
[1,] -2.908840
[2,]  1.855399
> 
> 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]  5.1521240 -4.2310378  1.7707802 -4.6517011 -2.7184082 -3.5226303
 [7] -3.7268742 -0.9930765  4.0256601 -0.2272596
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9402027
[2,] -0.1104395
[3,]  0.6829574
[4,]  1.1424792
[5,]  1.9466559
> 
> rowApply(tmp,sum)
 [1] -1.275558  2.326483  2.650803 -1.087369 -1.600911 -5.695690  2.370588
 [8] -1.346107 -6.713196  1.248535
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9   10    8    3   10    3    6    9    6     6
 [2,]    1    2    1    6    1    4    9   10    1     2
 [3,]    7    4    9    7    8    8    5    6    3    10
 [4,]    4    9    4    1    4   10    7    1    8     3
 [5,]    2    1    5    5    2    2    8    8    5     9
 [6,]    5    7    2    4    5    6    1    5    9     4
 [7,]    8    8    3   10    3    1    4    2    4     5
 [8,]    6    6    6    2    7    7   10    3    7     8
 [9,]    3    5   10    9    9    9    3    4   10     7
[10,]   10    3    7    8    6    5    2    7    2     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -4.45696756 -0.92555403  0.79858099 -1.64456182 -4.14152931  0.80571953
 [7] -0.84508928 -1.26090994  3.97139760  0.06842002 -0.49046870  0.11937671
[13]  3.10282897  0.55594082 -3.42352675 -2.05132149  0.59887973 -0.91370523
[19] -2.91926950  2.46903199
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8242675
[2,] -1.1567572
[3,] -0.8866929
[4,] -0.7322393
[5,]  0.1429894
> 
> rowApply(tmp,sum)
[1] -2.9808513 -2.8185840  0.5955207 -2.8038874 -2.5749253
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    6    3   13    6
[2,]   11    4    8    8   15
[3,]   17   20   10   17    2
[4,]    2    2    9   19   17
[5,]    3    8   12   14    1
> 
> 
> as.matrix(tmp)
           [,1]          [,2]        [,3]       [,4]       [,5]       [,6]
[1,] -1.8242675  0.0008471041  0.91715648 -1.4340748 -1.1604777  0.2999107
[2,] -0.8866929 -0.9134545693  1.34637147 -1.7715163 -0.7839136 -0.7085926
[3,] -0.7322393 -0.1408846913 -0.09090903 -0.1089741  0.1038793  0.1703337
[4,]  0.1429894 -0.5195055789  0.66562115  0.7454071  0.1540178  0.1187293
[5,] -1.1567572  0.6474437103 -2.03965907  0.9245963 -2.4550352  0.9253384
            [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.37224873 -0.8921671  0.1592361 -0.9510734 -0.7017909  0.5724136
[2,]  0.85659515 -1.1554978  0.8781915  0.1638553 -0.7941563  1.1103738
[3,] -1.08963672  0.3593199 -0.2415858  0.3932751  1.2113923 -0.2837764
[4,] -0.90669410  1.6018482  0.7359228 -0.8118302  0.0817233 -0.5197157
[5,] -0.07760235 -1.1744132  2.4396330  1.2741932 -0.2876371 -0.7599185
          [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,]  1.3099347 -0.8894708 -0.70045418  1.7892182  1.0481235 -1.0101121
[2,]  1.2709173  0.5102195 -0.90947231 -0.2126112  0.4190570  0.5639647
[3,] -0.1975329  1.5487482 -0.01915803 -0.6869392 -1.5520508  0.1996143
[4,]  0.4771980 -0.8673805 -0.47457100 -1.0807262  0.1339308 -0.8327380
[5,]  0.2423118  0.2538245 -1.31987123 -1.8602631  0.5498193  0.1655660
          [,19]     [,20]
[1,] -0.1827875 0.2967358
[2,] -2.2988775 0.4966556
[3,]  0.6345291 1.1181158
[4,] -1.9902020 0.3420880
[5,]  0.9180684 0.2154369
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  625  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-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:    F:/biocbuild/bbs-3.19-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.8317198 2.593922 -1.596908 0.8187061 0.2538861 -0.8706657 1.23151
          col8     col9     col10    col11    col12     col13     col14
row1 0.7333119 1.262685 0.5017014 1.316717 1.272305 0.1953661 0.8827193
          col15    col16     col17     col18     col19      col20
row1 -0.7078461 -1.90173 0.2554452 0.5460732 0.1992547 -0.1641956
> tmp[,"col10"]
           col10
row1  0.50170138
row2  1.82094172
row3  0.69111753
row4 -0.09078996
row5 -0.60890422
> tmp[c("row1","row5"),]
           col1       col2      col3       col4      col5       col6      col7
row1 -0.8317198  2.5939218 -1.596908  0.8187061 0.2538861 -0.8706657  1.231510
row5  1.7704773 -0.9290716 -2.368566 -1.0388670 0.6196521 -0.1491993 -1.561785
          col8       col9      col10    col11    col12     col13      col14
row1 0.7333119  1.2626847  0.5017014 1.316717 1.272305 0.1953661  0.8827193
row5 0.4808510 -0.3542296 -0.6089042 1.366921 1.023688 1.4860545 -0.4017655
          col15     col16      col17     col18     col19      col20
row1 -0.7078461 -1.901730  0.2554452 0.5460732 0.1992547 -0.1641956
row5  0.6251058  1.314237 -1.2467277 0.6699424 0.2970301 -1.4628702
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.87066568 -0.1641956
row2  0.07249203  0.2606642
row3  0.57607924  0.3849477
row4  0.33291299  0.7814376
row5 -0.14919928 -1.4628702
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.8706657 -0.1641956
row5 -0.1491993 -1.4628702
> 
> 
> 
> 
> 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.40997 50.48272 49.55524 49.39314 51.35092 104.7945 52.71242 50.09214
         col9   col10    col11    col12    col13    col14    col15    col16
row1 51.00509 48.7002 49.06889 49.63962 49.65666 51.01677 49.66231 48.82612
        col17    col18    col19    col20
row1 49.42646 51.01161 50.27004 105.3181
> tmp[,"col10"]
        col10
row1 48.70020
row2 31.62563
row3 29.38697
row4 31.55014
row5 51.81715
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.40997 50.48272 49.55524 49.39314 51.35092 104.7945 52.71242 50.09214
row5 50.26864 50.47572 49.04887 50.22834 50.75799 104.7264 50.91488 48.86673
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.00509 48.70020 49.06889 49.63962 49.65666 51.01677 49.66231 48.82612
row5 49.29156 51.81715 51.32456 50.28847 48.50274 49.00326 50.13730 49.61188
        col17    col18    col19    col20
row1 49.42646 51.01161 50.27004 105.3181
row5 50.46230 48.64685 52.10529 104.2147
> tmp[,c("col6","col20")]
          col6     col20
row1 104.79448 105.31809
row2  75.11416  75.77521
row3  75.22997  74.50705
row4  75.50216  73.06525
row5 104.72644 104.21467
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7945 105.3181
row5 104.7264 104.2147
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7945 105.3181
row5 104.7264 104.2147
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.4711396
[2,]  0.5344182
[3,] -1.6147388
[4,]  0.9087233
[5,]  0.5205487
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.1580911  0.6028749
[2,] -0.1592685  1.4460323
[3,]  0.6696576 -1.2355901
[4,]  1.3395810  1.2570175
[5,] -0.6137350  1.3175549
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  0.4980472  0.81439382
[2,]  0.6030284 -0.53561616
[3,]  0.3422758  0.06508651
[4,] -0.3778873  0.63466033
[5,] -1.2007933 -0.23692195
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.4980472
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.4980472
[2,] 0.6030284
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]       [,2]      [,3]       [,4]       [,5]      [,6]
row3 -1.33561089 -1.9684011 -1.199553  0.4577828 -0.1679934 0.8846229
row1 -0.03821074  0.9328183  1.295907 -0.5906093  0.4596438 1.4047705
           [,7]      [,8]      [,9]      [,10]      [,11]     [,12]      [,13]
row3 -0.4825506  1.301852 1.3201980 -0.2564290 -1.3630695 0.9080766 -0.7035089
row1  2.5818819 -1.658893 0.2717454  0.6214373 -0.9275498 0.3119036  0.3460133
         [,14]        [,15]      [,16]     [,17]      [,18]      [,19]
row3 -2.221017  0.519859003 -0.2143099 -1.102566 -0.1235067 1.42203927
row1 -2.076393 -0.008354026  0.9110575  0.118386 -0.4590605 0.06280646
         [,20]
row3 -1.062043
row1 -1.133672
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]      [,3]      [,4]        [,5]      [,6]        [,7]
row2 0.3214377 -1.23609 0.3068568 0.8399969 -0.01984972 0.3742408 -0.05239366
          [,8]      [,9]      [,10]
row2 -1.694059 0.2527219 -0.2698819
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]     [,3]      [,4]      [,5]    [,6]      [,7]     [,8]
row5 0.4394199 1.249913 1.138192 0.1845547 -2.257815 1.01807 -1.343259 1.892018
          [,9]      [,10]      [,11]     [,12]      [,13]     [,14]     [,15]
row5 -1.394554 -0.4782966 -0.3593664 -1.354199 -0.1721309 0.6429713 0.3049808
         [,16]     [,17]      [,18]     [,19]     [,20]
row5 0.7820895 -1.635984 -0.9324399 -0.668449 -0.487161
> 
> 
> 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: 0x000002282227aa10>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238cc6a1578" 
 [2] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c572a2f4" 
 [3] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c56a9193e"
 [4] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238cf924ccb" 
 [5] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c653359b4"
 [6] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c793940ff"
 [7] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c5e5b312f"
 [8] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c5d2b3c3d"
 [9] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c44aae65" 
[10] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c4c5a3479"
[11] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c7bd5358b"
[12] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c6c392332"
[13] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c19ed1cba"
[14] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c718664f7"
[15] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM238c58d66797"
> 
> 
> ### 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: 0x00000228258ff8f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x00000228258ff8f0>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.19-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x00000228258ff8f0>
> rowMedians(tmp)
  [1]  0.268156903  0.116330177 -0.669262150 -0.255292315 -0.212755961
  [6] -0.441966144  0.155412331  0.357259745  0.555470233 -0.412178706
 [11]  0.240443674 -0.321903840  0.706599558  0.067800900 -0.556925578
 [16] -0.044111825  0.256160641  0.029599145  0.651575221  0.357589994
 [21] -0.115305589 -0.035171831 -0.242188215 -0.101261051  0.004371667
 [26]  0.394530319 -0.580463222  0.019875877 -0.524459432 -0.183486480
 [31] -0.293715961  0.446407976  0.272110457  0.203414063  0.090274609
 [36]  0.062811849 -0.483860749 -0.161708489 -0.366950093 -0.274568037
 [41]  0.300262727 -0.505144628  0.152323714  0.072516804  0.027736390
 [46] -0.001897982 -0.165186768  0.122954019 -0.096906818  0.255862478
 [51]  0.199951537 -0.622846563 -0.455696974 -0.215133101  0.150613695
 [56]  0.018531795 -0.210819696  0.569112406  0.615045032 -0.179776295
 [61] -0.656951827  0.120099505  0.056214708  0.243803990  0.347282975
 [66] -0.481332340  0.240111180  0.492348217 -0.066629542  0.093160902
 [71] -0.703090328 -0.171213452 -0.117453889 -0.444922733  0.286293054
 [76]  0.184622414 -0.492481698 -0.264935021  0.150814797 -0.137994626
 [81]  0.316899954 -0.038948501  0.314644901  0.227467028 -0.042583606
 [86]  0.559314386 -0.751346182  0.174923840 -0.139534611  0.078211509
 [91]  0.196062770  0.710316274 -0.068870045  0.132899526  0.596084088
 [96]  0.304027378 -0.273790872  0.007221071  0.011909050 -0.257766869
[101] -0.258550778 -0.254910826 -0.234711860 -0.166950348 -0.186663065
[106]  0.353833230 -0.265592757  0.196442983 -0.441973110 -0.368949431
[111]  0.367518135 -0.299756113 -0.422938575  0.221175336  0.014172755
[116] -0.015830629 -0.534628136 -0.482727855  0.002350681 -0.194655649
[121] -0.186547391 -0.456180641  0.057212748  0.027433833 -0.085980583
[126]  0.020595986  0.204285731 -0.260144879 -0.175791193  0.656471075
[131] -0.009913745  0.714410110 -0.251985553  0.134754003  0.112130046
[136]  0.771084944  0.332332319  0.075595779 -0.047061212  0.189181841
[141]  0.006122013 -0.009305622  0.287613787  0.186606585  0.339187963
[146]  0.959876281  0.218338093 -0.402073756 -0.105825850  0.185923476
[151]  0.079061729 -0.402198614 -0.407792294 -0.166959431 -0.206560728
[156] -0.293161345 -0.284716855  0.623601085 -0.127897817  0.081561358
[161]  0.071909413  0.234696778  0.037053574 -0.307879643 -0.370645178
[166]  0.342551759 -0.563068132 -0.221068807 -0.010075962 -0.218406796
[171] -0.030013016 -0.655638673  0.195176967  0.112631890  0.214640474
[176] -0.032262212  0.264204019 -0.278690856  0.743713500 -0.109680027
[181]  0.062341032  0.233580599  0.243901773  0.216831891  0.291880191
[186]  0.356645649  0.773371744  0.065931547 -0.209992351 -0.378208694
[191]  0.006035532  0.347940485 -0.535410312  0.139543228  0.227761158
[196] -0.117129523  0.155716120 -0.246048140  0.155864787 -0.171448623
[201] -0.204443646 -0.243450769 -0.335797084 -0.107996951 -0.614353826
[206] -0.429527984 -0.616329142  0.095912010 -0.197457951  0.244355399
[211]  0.381767075 -0.135759588 -0.365706439 -0.144192837  0.179306865
[216]  0.134446372  0.240007397 -0.192525717  0.228267008  0.287154334
[221]  0.427737123 -0.200785386 -0.262665794 -0.208432912  0.582994706
[226]  0.154757411  0.007291990  0.226288742  0.316623449 -0.002025916
> 
> proc.time()
   user  system elapsed 
   3.81   19.42   50.84 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2024-03-16 r86144 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: 0x00000207486fd530>
> .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: 0x00000207486fd530>
> .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: 0x00000207486fd530>
> .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: 0x00000207486fd530>
> 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: 0x00000207486fd710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000207486fd710>
> .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: 0x00000207486fd710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000207486fd710>
> .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: 0x00000207486fd710>
> 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: 0x00000207486fd9b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000207486fd9b0>
> .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: 0x00000207486fd9b0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000207486fd9b0>
> .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: 0x00000207486fd9b0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x00000207486fd9b0>
> .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: 0x00000207486fd9b0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x00000207486fd9b0>
> .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: 0x00000207486fd9b0>
> 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: 0x00000207486fd6b0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x00000207486fd6b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000207486fd6b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000207486fd6b0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile345c15ba78aa" "BufferedMatrixFile345c87123c9" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile345c15ba78aa" "BufferedMatrixFile345c87123c9" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000207486fd0b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000207486fd0b0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000207486fd0b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000207486fd0b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x00000207486fd0b0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x00000207486fd0b0>
> .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: 0x00000207486fdb90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000207486fdb90>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000207486fdb90>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x00000207486fdb90>
> 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: 0x00000207486fd470>
> .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: 0x00000207486fd470>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.34    0.14    1.57 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2024-03-16 r86144 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.26    0.07    0.34 

Example timings