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

This page was generated on 2024-10-18 20:39 -0400 (Fri, 18 Oct 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4763
palomino7Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4500
merida1macOS 12.7.5 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4530
kjohnson1macOS 13.6.6 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4480
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 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-10-16 14:00 -0400 (Wed, 16 Oct 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on palomino7

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

raw results


Summary

Package: BufferedMatrix
Version: 1.68.0
Command: E:\biocbuild\bbs-3.19-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=E:\biocbuild\bbs-3.19-bioc\R\library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-10-16 23:33:16 -0400 (Wed, 16 Oct 2024)
EndedAt: 2024-10-16 23:49:53 -0400 (Wed, 16 Oct 2024)
EllapsedTime: 997.3 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck'
* using R version 4.4.1 (2024-06-14 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.68.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 'E:/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
  'E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'E:/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"E:/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"E:/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"E:/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"E:/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 -LE:/biocbuild/bbs-3.19-bioc/R/bin/x64 -lR
installing to E:/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 version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life"
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.31    0.12   69.56 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "E:/biocbuild/bbs-3.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 468463 25.1    1021760 54.6   633411 33.9
Vcells 853871  6.6    8388608 64.0  2003091 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] "Wed Oct 16 23:41:31 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] "Wed Oct 16 23:44:58 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: 0x000001fcaceffbf0>
> 
> 
> 
> 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] "Wed Oct 16 23:48:06 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] "Wed Oct 16 23:48:17 2024"
> 
> ColMode(tmp2)
<pointer: 0x000001fcaceffbf0>
> 
> 
> 
> ### 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.7740563 -0.8521121 -0.3431714  0.7385865
[2,]   1.4798638  1.2239538 -1.3991479 -0.3660381
[3,]  -0.9208759  0.4510155  0.2647469 -0.6446992
[4,]   1.6387275  0.3328177 -1.1811483  1.8690465
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    E:/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.7740563 0.8521121 0.3431714 0.7385865
[2,]   1.4798638 1.2239538 1.3991479 0.3660381
[3,]   0.9208759 0.4510155 0.2647469 0.6446992
[4,]   1.6387275 0.3328177 1.1811483 1.8690465
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    E:/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.0386282 0.9230992 0.5858083 0.8594106
[2,]  1.2164965 1.1063244 1.1828558 0.6050108
[3,]  0.9596228 0.6715769 0.5145356 0.8029316
[4,]  1.2801279 0.5769036 1.0868065 1.3671308
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.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.16034 35.08310 31.20125 34.33269
[2,]  38.64483 37.28720 38.22771 31.41615
[3,]  35.51710 32.16678 30.41010 33.67402
[4,]  39.44001 31.10185 37.04921 40.54035
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001fcaceff830>
> exp(tmp5)
<pointer: 0x000001fcaceff830>
> log(tmp5,2)
<pointer: 0x000001fcaceff830>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.7231
> Min(tmp5)
[1] 54.80885
> mean(tmp5)
[1] 72.96113
> Sum(tmp5)
[1] 14592.23
> Var(tmp5)
[1] 875.0995
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.13557 67.82141 73.92425 71.90961 73.46804 69.99053 72.32771 70.59738
 [9] 68.68871 73.74809
> rowSums(tmp5)
 [1] 1742.711 1356.428 1478.485 1438.192 1469.361 1399.811 1446.554 1411.948
 [9] 1373.774 1474.962
> rowVars(tmp5)
 [1] 8201.91496   61.41982  103.58448   85.48523   79.79780   72.15978
 [7]   73.50142   59.63755   84.18816   66.66102
> rowSd(tmp5)
 [1] 90.564424  7.837080 10.177646  9.245822  8.932961  8.494691  8.573297
 [8]  7.722535  9.175411  8.164620
> rowMax(tmp5)
 [1] 470.72311  80.43415  91.46898  85.23029  84.33739  86.92740  92.57318
 [8]  85.42743  85.49242  91.48454
> rowMin(tmp5)
 [1] 58.20077 54.80885 55.36807 54.85830 56.00185 56.10763 55.03309 60.49166
 [9] 55.22769 59.40296
> 
> colMeans(tmp5)
 [1] 112.12293  71.83879  70.55545  74.23400  68.34343  69.07507  72.45547
 [8]  73.39862  68.84014  68.33822  69.90875  67.31039  72.78840  68.41559
[15]  70.21975  66.70044  71.16642  75.20124  74.96358  73.34590
> colSums(tmp5)
 [1] 1121.2293  718.3879  705.5545  742.3400  683.4343  690.7507  724.5547
 [8]  733.9862  688.4014  683.3822  699.0875  673.1039  727.8840  684.1559
[15]  702.1975  667.0044  711.6642  752.0124  749.6358  733.4590
> colVars(tmp5)
 [1] 15937.16556    74.85986    41.82241    86.06953    52.10763    80.60970
 [7]    98.09603   121.79490    65.45863    44.10196    32.78712    94.96145
[13]    97.07182    87.19334    50.36753   104.13753    83.38893   151.10215
[19]    50.76624    63.79636
> colSd(tmp5)
 [1] 126.242487   8.652159   6.467025   9.277367   7.218561   8.978290
 [7]   9.904344  11.036073   8.090651   6.640931   5.726004   9.744816
[13]   9.852503   9.337737   7.097008  10.204780   9.131754  12.292361
[19]   7.125043   7.987262
> colMax(tmp5)
 [1] 470.72311  86.92740  80.24541  91.48454  80.91838  84.01084  84.72053
 [8]  89.84730  84.33739  80.39882  78.75699  85.85100  85.49242  85.23029
[15]  83.57537  79.81057  82.13020  92.57318  85.19991  81.52937
> colMin(tmp5)
 [1] 61.42281 61.59189 63.12009 61.82117 58.20892 55.22769 55.92185 58.16637
 [9] 58.46602 60.17868 60.28571 55.03309 56.68954 57.16151 61.20767 54.85830
[17] 54.80885 60.29642 63.11727 62.30667
> 
> 
> ### 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] 87.13557 67.82141 73.92425 71.90961 73.46804 69.99053 72.32771 70.59738
 [9]       NA 73.74809
> rowSums(tmp5)
 [1] 1742.711 1356.428 1478.485 1438.192 1469.361 1399.811 1446.554 1411.948
 [9]       NA 1474.962
> rowVars(tmp5)
 [1] 8201.91496   61.41982  103.58448   85.48523   79.79780   72.15978
 [7]   73.50142   59.63755   88.86422   66.66102
> rowSd(tmp5)
 [1] 90.564424  7.837080 10.177646  9.245822  8.932961  8.494691  8.573297
 [8]  7.722535  9.426782  8.164620
> rowMax(tmp5)
 [1] 470.72311  80.43415  91.46898  85.23029  84.33739  86.92740  92.57318
 [8]  85.42743        NA  91.48454
> rowMin(tmp5)
 [1] 58.20077 54.80885 55.36807 54.85830 56.00185 56.10763 55.03309 60.49166
 [9]       NA 59.40296
> 
> colMeans(tmp5)
 [1] 112.12293  71.83879  70.55545        NA  68.34343  69.07507  72.45547
 [8]  73.39862  68.84014  68.33822  69.90875  67.31039  72.78840  68.41559
[15]  70.21975  66.70044  71.16642  75.20124  74.96358  73.34590
> colSums(tmp5)
 [1] 1121.2293  718.3879  705.5545        NA  683.4343  690.7507  724.5547
 [8]  733.9862  688.4014  683.3822  699.0875  673.1039  727.8840  684.1559
[15]  702.1975  667.0044  711.6642  752.0124  749.6358  733.4590
> colVars(tmp5)
 [1] 15937.16556    74.85986    41.82241          NA    52.10763    80.60970
 [7]    98.09603   121.79490    65.45863    44.10196    32.78712    94.96145
[13]    97.07182    87.19334    50.36753   104.13753    83.38893   151.10215
[19]    50.76624    63.79636
> colSd(tmp5)
 [1] 126.242487   8.652159   6.467025         NA   7.218561   8.978290
 [7]   9.904344  11.036073   8.090651   6.640931   5.726004   9.744816
[13]   9.852503   9.337737   7.097008  10.204780   9.131754  12.292361
[19]   7.125043   7.987262
> colMax(tmp5)
 [1] 470.72311  86.92740  80.24541        NA  80.91838  84.01084  84.72053
 [8]  89.84730  84.33739  80.39882  78.75699  85.85100  85.49242  85.23029
[15]  83.57537  79.81057  82.13020  92.57318  85.19991  81.52937
> colMin(tmp5)
 [1] 61.42281 61.59189 63.12009       NA 58.20892 55.22769 55.92185 58.16637
 [9] 58.46602 60.17868 60.28571 55.03309 56.68954 57.16151 61.20767 54.85830
[17] 54.80885 60.29642 63.11727 62.30667
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.7231
> Min(tmp5,na.rm=TRUE)
[1] 54.80885
> mean(tmp5,na.rm=TRUE)
[1] 72.98328
> Sum(tmp5,na.rm=TRUE)
[1] 14523.67
> Var(tmp5,na.rm=TRUE)
[1] 879.4206
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.13557 67.82141 73.92425 71.90961 73.46804 69.99053 72.32771 70.59738
 [9] 68.69580 73.74809
> rowSums(tmp5,na.rm=TRUE)
 [1] 1742.711 1356.428 1478.485 1438.192 1469.361 1399.811 1446.554 1411.948
 [9] 1305.220 1474.962
> rowVars(tmp5,na.rm=TRUE)
 [1] 8201.91496   61.41982  103.58448   85.48523   79.79780   72.15978
 [7]   73.50142   59.63755   88.86422   66.66102
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.564424  7.837080 10.177646  9.245822  8.932961  8.494691  8.573297
 [8]  7.722535  9.426782  8.164620
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.72311  80.43415  91.46898  85.23029  84.33739  86.92740  92.57318
 [8]  85.42743  85.49242  91.48454
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.20077 54.80885 55.36807 54.85830 56.00185 56.10763 55.03309 60.49166
 [9] 55.22769 59.40296
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.12293  71.83879  70.55545  74.86512  68.34343  69.07507  72.45547
 [8]  73.39862  68.84014  68.33822  69.90875  67.31039  72.78840  68.41559
[15]  70.21975  66.70044  71.16642  75.20124  74.96358  73.34590
> colSums(tmp5,na.rm=TRUE)
 [1] 1121.2293  718.3879  705.5545  673.7861  683.4343  690.7507  724.5547
 [8]  733.9862  688.4014  683.3822  699.0875  673.1039  727.8840  684.1559
[15]  702.1975  667.0044  711.6642  752.0124  749.6358  733.4590
> colVars(tmp5,na.rm=TRUE)
 [1] 15937.16556    74.85986    41.82241    92.34714    52.10763    80.60970
 [7]    98.09603   121.79490    65.45863    44.10196    32.78712    94.96145
[13]    97.07182    87.19334    50.36753   104.13753    83.38893   151.10215
[19]    50.76624    63.79636
> colSd(tmp5,na.rm=TRUE)
 [1] 126.242487   8.652159   6.467025   9.609742   7.218561   8.978290
 [7]   9.904344  11.036073   8.090651   6.640931   5.726004   9.744816
[13]   9.852503   9.337737   7.097008  10.204780   9.131754  12.292361
[19]   7.125043   7.987262
> colMax(tmp5,na.rm=TRUE)
 [1] 470.72311  86.92740  80.24541  91.48454  80.91838  84.01084  84.72053
 [8]  89.84730  84.33739  80.39882  78.75699  85.85100  85.49242  85.23029
[15]  83.57537  79.81057  82.13020  92.57318  85.19991  81.52937
> colMin(tmp5,na.rm=TRUE)
 [1] 61.42281 61.59189 63.12009 61.82117 58.20892 55.22769 55.92185 58.16637
 [9] 58.46602 60.17868 60.28571 55.03309 56.68954 57.16151 61.20767 54.85830
[17] 54.80885 60.29642 63.11727 62.30667
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.13557 67.82141 73.92425 71.90961 73.46804 69.99053 72.32771 70.59738
 [9]      NaN 73.74809
> rowSums(tmp5,na.rm=TRUE)
 [1] 1742.711 1356.428 1478.485 1438.192 1469.361 1399.811 1446.554 1411.948
 [9]    0.000 1474.962
> rowVars(tmp5,na.rm=TRUE)
 [1] 8201.91496   61.41982  103.58448   85.48523   79.79780   72.15978
 [7]   73.50142   59.63755         NA   66.66102
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.564424  7.837080 10.177646  9.245822  8.932961  8.494691  8.573297
 [8]  7.722535        NA  8.164620
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.72311  80.43415  91.46898  85.23029  84.33739  86.92740  92.57318
 [8]  85.42743        NA  91.48454
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.20077 54.80885 55.36807 54.85830 56.00185 56.10763 55.03309 60.49166
 [9]       NA 59.40296
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 117.75628  72.90713  70.83723       NaN  67.25294  70.61367  74.29253
 [8]  75.09109  68.48187  68.74049  69.71042  68.26270  71.37684  69.29011
[15]  69.13996  66.38192  71.73358  74.67550  74.87082  72.43662
> colSums(tmp5,na.rm=TRUE)
 [1] 1059.8065  656.1642  637.5350    0.0000  605.2765  635.5230  668.6328
 [8]  675.8198  616.3368  618.6644  627.3938  614.3643  642.3916  623.6110
[15]  622.2597  597.4372  645.6023  672.0795  673.8374  651.9296
> colVars(tmp5,na.rm=TRUE)
 [1] 17572.29696    71.37712    46.15698          NA    45.24294    64.05396
 [7]    72.39129   104.79408    72.19695    47.79423    36.44299    96.62889
[13]    86.79023    89.48862    43.54674   116.01331    90.19372   166.88042
[19]    57.01521    62.46962
> colSd(tmp5,na.rm=TRUE)
 [1] 132.560541   8.448498   6.793893         NA   6.726287   8.003372
 [7]   8.508307  10.236898   8.496879   6.913337   6.036803   9.830000
[13]   9.316127   9.459842   6.598996  10.770947   9.497037  12.918221
[19]   7.550842   7.903772
> colMax(tmp5,na.rm=TRUE)
 [1] 470.72311  86.92740  80.24541      -Inf  80.91838  84.01084  84.72053
 [8]  89.84730  84.33739  80.39882  78.75699  85.85100  82.40465  85.23029
[15]  83.57537  79.81057  82.13020  92.57318  85.19991  80.25670
> colMin(tmp5,na.rm=TRUE)
 [1] 63.54736 61.59189 63.12009      Inf 58.20892 56.00185 58.85501 59.82811
 [9] 58.46602 60.17868 60.28571 55.03309 56.68954 57.16151 61.20767 54.85830
[17] 54.80885 60.29642 63.11727 62.30667
> 
> 
> 
> 
> 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] 208.6645 190.1880 245.6293 188.5683 218.7021 213.0721 193.7910 218.0024
 [9] 266.5101 323.6747
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 208.6645 190.1880 245.6293 188.5683 218.7021 213.0721 193.7910 218.0024
 [9] 266.5101 323.6747
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  0.000000e+00 -1.136868e-13 -2.842171e-14  1.421085e-13  1.705303e-13
 [6]  0.000000e+00 -2.842171e-14  0.000000e+00  1.989520e-13 -8.526513e-14
[11] -1.136868e-13  0.000000e+00  7.105427e-14 -1.705303e-13  1.421085e-14
[16]  5.684342e-14 -1.136868e-13 -1.705303e-13 -8.526513e-14 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   4 
8   6 
4   1 
2   11 
7   11 
6   2 
6   10 
10   17 
3   5 
9   2 
9   11 
5   12 
8   4 
4   9 
10   2 
4   8 
5   2 
3   19 
5   5 
8   7 
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.428673
> Min(tmp)
[1] -2.958934
> mean(tmp)
[1] -0.06188605
> Sum(tmp)
[1] -6.188605
> Var(tmp)
[1] 1.118204
> 
> rowMeans(tmp)
[1] -0.06188605
> rowSums(tmp)
[1] -6.188605
> rowVars(tmp)
[1] 1.118204
> rowSd(tmp)
[1] 1.057452
> rowMax(tmp)
[1] 2.428673
> rowMin(tmp)
[1] -2.958934
> 
> colMeans(tmp)
  [1]  0.924282620  0.116370229  0.728807174  1.934934851  0.287711839
  [6]  1.414581700 -0.161207454 -1.084543286 -0.260197075 -0.578621472
 [11] -0.751869638  2.068826014 -0.091866160 -0.839019754 -0.748650830
 [16] -1.664703757 -0.023392619  0.398349559  0.005750148  2.428673217
 [21]  0.761262891  0.549190129 -1.188560670  1.218215874  1.120350114
 [26]  0.422103930  0.480858717  0.559956834  1.277610675 -1.341266733
 [31]  0.128408336 -0.151821056 -0.028358917 -0.958928753 -1.514398402
 [36]  0.660923930  0.283690490 -0.685150487  0.288990608  1.636465178
 [41] -0.126371141  0.517513400 -0.809943875 -1.186636025  1.427025929
 [46]  0.066023601 -0.391566143 -0.243632093  1.055419404 -1.407531825
 [51] -1.073683044 -0.116586502  0.161849799 -0.259592822 -0.184420250
 [56] -1.894329335  1.654771699 -1.328010885 -1.053836567  0.638708256
 [61] -2.958933825 -0.832998546 -1.052509978 -0.342365207  0.421362315
 [66]  0.231147470  0.775492808  1.295131166  0.109058320  1.190127714
 [71]  1.150981217  1.140839884 -1.153170194  0.869934683 -0.448410613
 [76]  0.664412065  0.460445603 -0.567017832 -0.650378658 -0.966546796
 [81]  2.098612555 -0.059404216  0.439657720  0.028463034  0.680560149
 [86] -0.477904002 -2.755925329 -0.681777122 -0.710516021 -1.234464855
 [91] -2.559554565 -0.258095172  0.256043519 -0.160814673 -0.533524018
 [96] -0.394063001 -2.675631509  0.638502614  0.399880771 -0.634181833
> colSums(tmp)
  [1]  0.924282620  0.116370229  0.728807174  1.934934851  0.287711839
  [6]  1.414581700 -0.161207454 -1.084543286 -0.260197075 -0.578621472
 [11] -0.751869638  2.068826014 -0.091866160 -0.839019754 -0.748650830
 [16] -1.664703757 -0.023392619  0.398349559  0.005750148  2.428673217
 [21]  0.761262891  0.549190129 -1.188560670  1.218215874  1.120350114
 [26]  0.422103930  0.480858717  0.559956834  1.277610675 -1.341266733
 [31]  0.128408336 -0.151821056 -0.028358917 -0.958928753 -1.514398402
 [36]  0.660923930  0.283690490 -0.685150487  0.288990608  1.636465178
 [41] -0.126371141  0.517513400 -0.809943875 -1.186636025  1.427025929
 [46]  0.066023601 -0.391566143 -0.243632093  1.055419404 -1.407531825
 [51] -1.073683044 -0.116586502  0.161849799 -0.259592822 -0.184420250
 [56] -1.894329335  1.654771699 -1.328010885 -1.053836567  0.638708256
 [61] -2.958933825 -0.832998546 -1.052509978 -0.342365207  0.421362315
 [66]  0.231147470  0.775492808  1.295131166  0.109058320  1.190127714
 [71]  1.150981217  1.140839884 -1.153170194  0.869934683 -0.448410613
 [76]  0.664412065  0.460445603 -0.567017832 -0.650378658 -0.966546796
 [81]  2.098612555 -0.059404216  0.439657720  0.028463034  0.680560149
 [86] -0.477904002 -2.755925329 -0.681777122 -0.710516021 -1.234464855
 [91] -2.559554565 -0.258095172  0.256043519 -0.160814673 -0.533524018
 [96] -0.394063001 -2.675631509  0.638502614  0.399880771 -0.634181833
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.924282620  0.116370229  0.728807174  1.934934851  0.287711839
  [6]  1.414581700 -0.161207454 -1.084543286 -0.260197075 -0.578621472
 [11] -0.751869638  2.068826014 -0.091866160 -0.839019754 -0.748650830
 [16] -1.664703757 -0.023392619  0.398349559  0.005750148  2.428673217
 [21]  0.761262891  0.549190129 -1.188560670  1.218215874  1.120350114
 [26]  0.422103930  0.480858717  0.559956834  1.277610675 -1.341266733
 [31]  0.128408336 -0.151821056 -0.028358917 -0.958928753 -1.514398402
 [36]  0.660923930  0.283690490 -0.685150487  0.288990608  1.636465178
 [41] -0.126371141  0.517513400 -0.809943875 -1.186636025  1.427025929
 [46]  0.066023601 -0.391566143 -0.243632093  1.055419404 -1.407531825
 [51] -1.073683044 -0.116586502  0.161849799 -0.259592822 -0.184420250
 [56] -1.894329335  1.654771699 -1.328010885 -1.053836567  0.638708256
 [61] -2.958933825 -0.832998546 -1.052509978 -0.342365207  0.421362315
 [66]  0.231147470  0.775492808  1.295131166  0.109058320  1.190127714
 [71]  1.150981217  1.140839884 -1.153170194  0.869934683 -0.448410613
 [76]  0.664412065  0.460445603 -0.567017832 -0.650378658 -0.966546796
 [81]  2.098612555 -0.059404216  0.439657720  0.028463034  0.680560149
 [86] -0.477904002 -2.755925329 -0.681777122 -0.710516021 -1.234464855
 [91] -2.559554565 -0.258095172  0.256043519 -0.160814673 -0.533524018
 [96] -0.394063001 -2.675631509  0.638502614  0.399880771 -0.634181833
> colMin(tmp)
  [1]  0.924282620  0.116370229  0.728807174  1.934934851  0.287711839
  [6]  1.414581700 -0.161207454 -1.084543286 -0.260197075 -0.578621472
 [11] -0.751869638  2.068826014 -0.091866160 -0.839019754 -0.748650830
 [16] -1.664703757 -0.023392619  0.398349559  0.005750148  2.428673217
 [21]  0.761262891  0.549190129 -1.188560670  1.218215874  1.120350114
 [26]  0.422103930  0.480858717  0.559956834  1.277610675 -1.341266733
 [31]  0.128408336 -0.151821056 -0.028358917 -0.958928753 -1.514398402
 [36]  0.660923930  0.283690490 -0.685150487  0.288990608  1.636465178
 [41] -0.126371141  0.517513400 -0.809943875 -1.186636025  1.427025929
 [46]  0.066023601 -0.391566143 -0.243632093  1.055419404 -1.407531825
 [51] -1.073683044 -0.116586502  0.161849799 -0.259592822 -0.184420250
 [56] -1.894329335  1.654771699 -1.328010885 -1.053836567  0.638708256
 [61] -2.958933825 -0.832998546 -1.052509978 -0.342365207  0.421362315
 [66]  0.231147470  0.775492808  1.295131166  0.109058320  1.190127714
 [71]  1.150981217  1.140839884 -1.153170194  0.869934683 -0.448410613
 [76]  0.664412065  0.460445603 -0.567017832 -0.650378658 -0.966546796
 [81]  2.098612555 -0.059404216  0.439657720  0.028463034  0.680560149
 [86] -0.477904002 -2.755925329 -0.681777122 -0.710516021 -1.234464855
 [91] -2.559554565 -0.258095172  0.256043519 -0.160814673 -0.533524018
 [96] -0.394063001 -2.675631509  0.638502614  0.399880771 -0.634181833
> colMedians(tmp)
  [1]  0.924282620  0.116370229  0.728807174  1.934934851  0.287711839
  [6]  1.414581700 -0.161207454 -1.084543286 -0.260197075 -0.578621472
 [11] -0.751869638  2.068826014 -0.091866160 -0.839019754 -0.748650830
 [16] -1.664703757 -0.023392619  0.398349559  0.005750148  2.428673217
 [21]  0.761262891  0.549190129 -1.188560670  1.218215874  1.120350114
 [26]  0.422103930  0.480858717  0.559956834  1.277610675 -1.341266733
 [31]  0.128408336 -0.151821056 -0.028358917 -0.958928753 -1.514398402
 [36]  0.660923930  0.283690490 -0.685150487  0.288990608  1.636465178
 [41] -0.126371141  0.517513400 -0.809943875 -1.186636025  1.427025929
 [46]  0.066023601 -0.391566143 -0.243632093  1.055419404 -1.407531825
 [51] -1.073683044 -0.116586502  0.161849799 -0.259592822 -0.184420250
 [56] -1.894329335  1.654771699 -1.328010885 -1.053836567  0.638708256
 [61] -2.958933825 -0.832998546 -1.052509978 -0.342365207  0.421362315
 [66]  0.231147470  0.775492808  1.295131166  0.109058320  1.190127714
 [71]  1.150981217  1.140839884 -1.153170194  0.869934683 -0.448410613
 [76]  0.664412065  0.460445603 -0.567017832 -0.650378658 -0.966546796
 [81]  2.098612555 -0.059404216  0.439657720  0.028463034  0.680560149
 [86] -0.477904002 -2.755925329 -0.681777122 -0.710516021 -1.234464855
 [91] -2.559554565 -0.258095172  0.256043519 -0.160814673 -0.533524018
 [96] -0.394063001 -2.675631509  0.638502614  0.399880771 -0.634181833
> colRanges(tmp)
          [,1]      [,2]      [,3]     [,4]      [,5]     [,6]       [,7]
[1,] 0.9242826 0.1163702 0.7288072 1.934935 0.2877118 1.414582 -0.1612075
[2,] 0.9242826 0.1163702 0.7288072 1.934935 0.2877118 1.414582 -0.1612075
          [,8]       [,9]      [,10]      [,11]    [,12]       [,13]      [,14]
[1,] -1.084543 -0.2601971 -0.5786215 -0.7518696 2.068826 -0.09186616 -0.8390198
[2,] -1.084543 -0.2601971 -0.5786215 -0.7518696 2.068826 -0.09186616 -0.8390198
          [,15]     [,16]       [,17]     [,18]       [,19]    [,20]     [,21]
[1,] -0.7486508 -1.664704 -0.02339262 0.3983496 0.005750148 2.428673 0.7612629
[2,] -0.7486508 -1.664704 -0.02339262 0.3983496 0.005750148 2.428673 0.7612629
         [,22]     [,23]    [,24]   [,25]     [,26]     [,27]     [,28]
[1,] 0.5491901 -1.188561 1.218216 1.12035 0.4221039 0.4808587 0.5599568
[2,] 0.5491901 -1.188561 1.218216 1.12035 0.4221039 0.4808587 0.5599568
        [,29]     [,30]     [,31]      [,32]       [,33]      [,34]     [,35]
[1,] 1.277611 -1.341267 0.1284083 -0.1518211 -0.02835892 -0.9589288 -1.514398
[2,] 1.277611 -1.341267 0.1284083 -0.1518211 -0.02835892 -0.9589288 -1.514398
         [,36]     [,37]      [,38]     [,39]    [,40]      [,41]     [,42]
[1,] 0.6609239 0.2836905 -0.6851505 0.2889906 1.636465 -0.1263711 0.5175134
[2,] 0.6609239 0.2836905 -0.6851505 0.2889906 1.636465 -0.1263711 0.5175134
          [,43]     [,44]    [,45]     [,46]      [,47]      [,48]    [,49]
[1,] -0.8099439 -1.186636 1.427026 0.0660236 -0.3915661 -0.2436321 1.055419
[2,] -0.8099439 -1.186636 1.427026 0.0660236 -0.3915661 -0.2436321 1.055419
         [,50]     [,51]      [,52]     [,53]      [,54]      [,55]     [,56]
[1,] -1.407532 -1.073683 -0.1165865 0.1618498 -0.2595928 -0.1844203 -1.894329
[2,] -1.407532 -1.073683 -0.1165865 0.1618498 -0.2595928 -0.1844203 -1.894329
        [,57]     [,58]     [,59]     [,60]     [,61]      [,62]    [,63]
[1,] 1.654772 -1.328011 -1.053837 0.6387083 -2.958934 -0.8329985 -1.05251
[2,] 1.654772 -1.328011 -1.053837 0.6387083 -2.958934 -0.8329985 -1.05251
          [,64]     [,65]     [,66]     [,67]    [,68]     [,69]    [,70]
[1,] -0.3423652 0.4213623 0.2311475 0.7754928 1.295131 0.1090583 1.190128
[2,] -0.3423652 0.4213623 0.2311475 0.7754928 1.295131 0.1090583 1.190128
        [,71]   [,72]    [,73]     [,74]      [,75]     [,76]     [,77]
[1,] 1.150981 1.14084 -1.15317 0.8699347 -0.4484106 0.6644121 0.4604456
[2,] 1.150981 1.14084 -1.15317 0.8699347 -0.4484106 0.6644121 0.4604456
          [,78]      [,79]      [,80]    [,81]       [,82]     [,83]      [,84]
[1,] -0.5670178 -0.6503787 -0.9665468 2.098613 -0.05940422 0.4396577 0.02846303
[2,] -0.5670178 -0.6503787 -0.9665468 2.098613 -0.05940422 0.4396577 0.02846303
         [,85]     [,86]     [,87]      [,88]     [,89]     [,90]     [,91]
[1,] 0.6805601 -0.477904 -2.755925 -0.6817771 -0.710516 -1.234465 -2.559555
[2,] 0.6805601 -0.477904 -2.755925 -0.6817771 -0.710516 -1.234465 -2.559555
          [,92]     [,93]      [,94]     [,95]     [,96]     [,97]     [,98]
[1,] -0.2580952 0.2560435 -0.1608147 -0.533524 -0.394063 -2.675632 0.6385026
[2,] -0.2580952 0.2560435 -0.1608147 -0.533524 -0.394063 -2.675632 0.6385026
         [,99]     [,100]
[1,] 0.3998808 -0.6341818
[2,] 0.3998808 -0.6341818
> 
> 
> Max(tmp2)
[1] 2.152114
> Min(tmp2)
[1] -2.852465
> mean(tmp2)
[1] -0.1318381
> Sum(tmp2)
[1] -13.18381
> Var(tmp2)
[1] 1.031398
> 
> rowMeans(tmp2)
  [1] -0.183051007  1.754877043 -0.905110658  1.390007384  0.142544168
  [6] -1.098904674  0.605671085 -0.331293373 -0.327020973 -0.252514947
 [11] -1.823397324  0.360649113 -1.659387780 -1.022034338  1.237791089
 [16] -1.301067061 -2.852464511 -0.138610988 -1.293668211 -0.358429740
 [21]  0.124754543 -0.368684726 -0.463531114 -0.674245980 -0.606575675
 [26]  0.751950848 -1.709987047  0.473857523 -0.352599237 -1.385445008
 [31]  0.002498617  0.111874173 -0.737860044  0.620210003 -0.774465545
 [36]  0.483508872 -0.143785823 -1.348581839 -0.256150971  0.611173444
 [41] -1.066917164 -0.817214420  0.160397639  1.746217206 -0.912809779
 [46] -1.080398922 -1.275984412  0.274100501 -0.966359675 -2.336682626
 [51]  0.147638429 -1.175006001  0.279019141  1.560884186 -1.007086966
 [56]  1.019754262  1.659543564 -0.130324182 -0.771575250  1.420398275
 [61] -1.431057156 -1.061537173 -1.279463027 -0.868761575 -1.276259308
 [66]  0.618423268  1.114909060  2.152113650  0.252220957  0.886364178
 [71]  0.134205264  0.110670929  0.408603228  0.064778363 -0.014580234
 [76]  1.042127261  0.347735236  0.358978087  1.566682952 -1.021856226
 [81] -0.740331298 -0.071404699 -0.635544867  0.047807623 -0.214812369
 [86]  0.106989485  0.513593465  0.284736035 -1.754175460  0.688739483
 [91] -0.572573233 -2.113078691  0.700761110 -0.560549098  0.095062155
 [96]  1.280974253  0.269298527  1.377293214  1.025187451  1.953824307
> rowSums(tmp2)
  [1] -0.183051007  1.754877043 -0.905110658  1.390007384  0.142544168
  [6] -1.098904674  0.605671085 -0.331293373 -0.327020973 -0.252514947
 [11] -1.823397324  0.360649113 -1.659387780 -1.022034338  1.237791089
 [16] -1.301067061 -2.852464511 -0.138610988 -1.293668211 -0.358429740
 [21]  0.124754543 -0.368684726 -0.463531114 -0.674245980 -0.606575675
 [26]  0.751950848 -1.709987047  0.473857523 -0.352599237 -1.385445008
 [31]  0.002498617  0.111874173 -0.737860044  0.620210003 -0.774465545
 [36]  0.483508872 -0.143785823 -1.348581839 -0.256150971  0.611173444
 [41] -1.066917164 -0.817214420  0.160397639  1.746217206 -0.912809779
 [46] -1.080398922 -1.275984412  0.274100501 -0.966359675 -2.336682626
 [51]  0.147638429 -1.175006001  0.279019141  1.560884186 -1.007086966
 [56]  1.019754262  1.659543564 -0.130324182 -0.771575250  1.420398275
 [61] -1.431057156 -1.061537173 -1.279463027 -0.868761575 -1.276259308
 [66]  0.618423268  1.114909060  2.152113650  0.252220957  0.886364178
 [71]  0.134205264  0.110670929  0.408603228  0.064778363 -0.014580234
 [76]  1.042127261  0.347735236  0.358978087  1.566682952 -1.021856226
 [81] -0.740331298 -0.071404699 -0.635544867  0.047807623 -0.214812369
 [86]  0.106989485  0.513593465  0.284736035 -1.754175460  0.688739483
 [91] -0.572573233 -2.113078691  0.700761110 -0.560549098  0.095062155
 [96]  1.280974253  0.269298527  1.377293214  1.025187451  1.953824307
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.183051007  1.754877043 -0.905110658  1.390007384  0.142544168
  [6] -1.098904674  0.605671085 -0.331293373 -0.327020973 -0.252514947
 [11] -1.823397324  0.360649113 -1.659387780 -1.022034338  1.237791089
 [16] -1.301067061 -2.852464511 -0.138610988 -1.293668211 -0.358429740
 [21]  0.124754543 -0.368684726 -0.463531114 -0.674245980 -0.606575675
 [26]  0.751950848 -1.709987047  0.473857523 -0.352599237 -1.385445008
 [31]  0.002498617  0.111874173 -0.737860044  0.620210003 -0.774465545
 [36]  0.483508872 -0.143785823 -1.348581839 -0.256150971  0.611173444
 [41] -1.066917164 -0.817214420  0.160397639  1.746217206 -0.912809779
 [46] -1.080398922 -1.275984412  0.274100501 -0.966359675 -2.336682626
 [51]  0.147638429 -1.175006001  0.279019141  1.560884186 -1.007086966
 [56]  1.019754262  1.659543564 -0.130324182 -0.771575250  1.420398275
 [61] -1.431057156 -1.061537173 -1.279463027 -0.868761575 -1.276259308
 [66]  0.618423268  1.114909060  2.152113650  0.252220957  0.886364178
 [71]  0.134205264  0.110670929  0.408603228  0.064778363 -0.014580234
 [76]  1.042127261  0.347735236  0.358978087  1.566682952 -1.021856226
 [81] -0.740331298 -0.071404699 -0.635544867  0.047807623 -0.214812369
 [86]  0.106989485  0.513593465  0.284736035 -1.754175460  0.688739483
 [91] -0.572573233 -2.113078691  0.700761110 -0.560549098  0.095062155
 [96]  1.280974253  0.269298527  1.377293214  1.025187451  1.953824307
> rowMin(tmp2)
  [1] -0.183051007  1.754877043 -0.905110658  1.390007384  0.142544168
  [6] -1.098904674  0.605671085 -0.331293373 -0.327020973 -0.252514947
 [11] -1.823397324  0.360649113 -1.659387780 -1.022034338  1.237791089
 [16] -1.301067061 -2.852464511 -0.138610988 -1.293668211 -0.358429740
 [21]  0.124754543 -0.368684726 -0.463531114 -0.674245980 -0.606575675
 [26]  0.751950848 -1.709987047  0.473857523 -0.352599237 -1.385445008
 [31]  0.002498617  0.111874173 -0.737860044  0.620210003 -0.774465545
 [36]  0.483508872 -0.143785823 -1.348581839 -0.256150971  0.611173444
 [41] -1.066917164 -0.817214420  0.160397639  1.746217206 -0.912809779
 [46] -1.080398922 -1.275984412  0.274100501 -0.966359675 -2.336682626
 [51]  0.147638429 -1.175006001  0.279019141  1.560884186 -1.007086966
 [56]  1.019754262  1.659543564 -0.130324182 -0.771575250  1.420398275
 [61] -1.431057156 -1.061537173 -1.279463027 -0.868761575 -1.276259308
 [66]  0.618423268  1.114909060  2.152113650  0.252220957  0.886364178
 [71]  0.134205264  0.110670929  0.408603228  0.064778363 -0.014580234
 [76]  1.042127261  0.347735236  0.358978087  1.566682952 -1.021856226
 [81] -0.740331298 -0.071404699 -0.635544867  0.047807623 -0.214812369
 [86]  0.106989485  0.513593465  0.284736035 -1.754175460  0.688739483
 [91] -0.572573233 -2.113078691  0.700761110 -0.560549098  0.095062155
 [96]  1.280974253  0.269298527  1.377293214  1.025187451  1.953824307
> 
> colMeans(tmp2)
[1] -0.1318381
> colSums(tmp2)
[1] -13.18381
> colVars(tmp2)
[1] 1.031398
> colSd(tmp2)
[1] 1.015578
> colMax(tmp2)
[1] 2.152114
> colMin(tmp2)
[1] -2.852465
> colMedians(tmp2)
[1] -0.1008644
> colRanges(tmp2)
          [,1]
[1,] -2.852465
[2,]  2.152114
> 
> 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] -1.498277 -2.039096 -1.636590 -3.095272 -1.588931  8.161939 -1.101544
 [8]  4.771588 -1.398279 -1.805469
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.0496687
[2,] -0.6067326
[3,] -0.1203187
[4,]  0.2952683
[5,]  1.7678652
> 
> rowApply(tmp,sum)
 [1]  0.52151926  4.91894651 -4.82966360  5.44846444 -0.04106703 -0.32249812
 [7] -1.02615705 -2.70196527 -4.06940868  0.87189823
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    4    6    6    4    4    7    7    1     4
 [2,]    2    8    1    3    8    3   10    1    3    10
 [3,]    1   10    7    2    7    5    3    3   10     1
 [4,]    5    1    8    8    5    2    9    6    2     3
 [5,]    3    3    4   10    2    6    2    9    7     6
 [6,]    7    5   10    9    9    8    8    4    6     9
 [7,]    6    6    5    4   10    1    6    2    5     7
 [8,]    9    2    9    5    3   10    5   10    8     8
 [9,]    4    7    2    1    6    9    1    5    9     2
[10,]    8    9    3    7    1    7    4    8    4     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.67476941  0.62121575 -2.37363135 -1.23555871 -0.05713761 -2.76956045
 [7]  2.92067513  5.30260497 -0.39443051  3.24767431  0.72894111  0.99613352
[13]  1.64225376  2.88019212 -1.73827081  1.80874502 -3.61184606  0.66233302
[19]  1.60561004 -0.63162505
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.02891868
[2,] -0.08272782
[3,]  0.01906862
[4,]  0.07869380
[5,]  0.33911467
> 
> rowApply(tmp,sum)
[1]  3.7415274  1.6100629  5.4210029  0.7901107 -2.6331551
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    3    8    9   12   13
[2,]   16    9    6   16    7
[3,]    4   16    8   14    1
[4,]    7   13    4   10    4
[5,]   17   17   14   11    2
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]        [,4]         [,5]       [,6]
[1,] -1.02891868  0.89962474 -0.7427297 -0.24362948  1.143312023 -1.6089257
[2,] -0.08272782  0.01649329  0.7338879  0.47604122  0.758331461 -0.3511046
[3,]  0.07869380 -0.38939797 -0.1296042 -0.48718326  0.521581990 -0.8880560
[4,]  0.01906862  0.57103018  0.4240378 -0.04738227 -0.009397524 -0.3091616
[5,]  0.33911467 -0.47653450 -2.6592232 -0.93340492 -2.470965565  0.3876875
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  0.3996585  2.3965318 -0.4824413  1.9119006  0.5018649  0.71150020
[2,]  1.4234545 -0.3205291  0.2130901 -1.2582843 -0.5078632 -0.55798126
[3,]  0.2896922  2.1915326  0.3163792  0.5994002  0.9409468  1.26272212
[4,] -0.2813750  1.7770131 -0.3089483  0.2818371 -0.6180981 -0.36085899
[5,]  1.0892450 -0.7419435 -0.1325102  1.7128207  0.4120907 -0.05924855
          [,13]      [,14]       [,15]       [,16]      [,17]      [,18]
[1,]  0.5879925  1.5848236  0.41031394  0.04817023 -2.3984361 -0.6835606
[2,] -1.8432111  0.4030876  0.05618452  1.07255987 -0.5906640  0.6241579
[3,]  2.1019890 -0.3055997 -1.12406721  0.20510199 -0.9330061  0.2446427
[4,] -0.9901141  1.4918591 -0.91256172  0.79552676 -0.5830583  1.5023971
[5,]  1.7855974 -0.2939785 -0.16814035 -0.31261383  0.8933184 -1.0253041
          [,19]      [,20]
[1,]  0.1199478  0.2145281
[2,]  0.5783160  0.7668240
[3,]  1.3176153 -0.3923805
[4,]  0.4520215 -2.1037248
[5,] -0.8622905  0.8831282
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.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:    E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  626  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  543  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    E:/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.3929964 -1.673071 0.1808757 1.427413 0.2128399 -1.500692 -0.6828315
         col8      col9      col10   col11     col12    col13      col14
row1 1.165061 0.1823223 -0.9126449 1.58777 0.9451178 0.170792 0.01477911
         col15     col16      col17     col18    col19     col20
row1 0.9408223 0.1513678 -0.7209336 0.2911687 1.453825 -1.764196
> tmp[,"col10"]
          col10
row1 -0.9126449
row2  2.1082290
row3  0.7008783
row4 -0.2949526
row5  0.9360881
> tmp[c("row1","row5"),]
           col1       col2      col3       col4       col5        col6
row1 -0.3929964 -1.6730706 0.1808757  1.4274126  0.2128399 -1.50069190
row5 -0.1385175  0.2021836 0.1868075 -0.9988668 -0.5060999  0.02504219
           col7     col8       col9      col10     col11       col12      col13
row1 -0.6828315 1.165061  0.1823223 -0.9126449 1.5877699  0.94511779  0.1707920
row5 -0.4850793 1.836651 -0.2812602  0.9360881 0.5256839 -0.02723311 -0.3150035
          col14      col15      col16      col17      col18      col19
row1 0.01477911  0.9408223  0.1513678 -0.7209336  0.2911687  1.4538246
row5 0.29172837 -1.5080685 -1.6102716 -1.1899423 -1.0865755 -0.9851569
          col20
row1 -1.7641964
row5  0.2104301
> tmp[,c("col6","col20")]
            col6       col20
row1 -1.50069190 -1.76419642
row2  1.70712125  2.27725888
row3  0.68405082 -0.04008696
row4  0.87876404  0.17943748
row5  0.02504219  0.21043012
> tmp[c("row1","row5"),c("col6","col20")]
            col6      col20
row1 -1.50069190 -1.7641964
row5  0.02504219  0.2104301
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3    col4     col5     col6     col7     col8
row1 48.12916 49.19221 51.42635 49.2258 50.27168 104.5185 48.52339 51.36248
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.50501 50.51308 50.07973 49.56742 49.58283 48.67902 51.64638 49.11046
       col17   col18    col19    col20
row1 49.5568 49.3898 49.31867 105.3235
> tmp[,"col10"]
        col10
row1 50.51308
row2 28.70475
row3 29.17950
row4 30.15464
row5 50.36886
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.12916 49.19221 51.42635 49.22580 50.27168 104.5185 48.52339 51.36248
row5 50.13123 50.07173 48.89153 49.87218 51.44963 106.8499 47.79011 48.41125
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.50501 50.51308 50.07973 49.56742 49.58283 48.67902 51.64638 49.11046
row5 50.19096 50.36886 50.38387 50.10053 48.39536 49.85032 50.16784 50.17469
        col17    col18    col19    col20
row1 49.55680 49.38980 49.31867 105.3235
row5 50.60626 48.46998 49.80642 103.7019
> tmp[,c("col6","col20")]
          col6     col20
row1 104.51847 105.32349
row2  73.76544  74.92110
row3  75.39657  75.92959
row4  75.09505  75.92550
row5 106.84989 103.70188
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.5185 105.3235
row5 106.8499 103.7019
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.5185 105.3235
row5 106.8499 103.7019
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8804255
[2,]  1.3260415
[3,]  1.1791059
[4,] -1.1207391
[5,] -0.6079569
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.4646774  0.6457002
[2,] -1.0326333  1.0123135
[3,]  0.3283261 -0.4195874
[4,]  0.7881224  0.3536940
[5,]  1.1221205  0.9608691
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.4353742 -1.97243717
[2,]  0.2797167  0.01258132
[3,] -0.8192626  1.67377545
[4,] -0.5757517  1.59744319
[5,] -2.2480170  0.23432258
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.4353742
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.4353742
[2,]  0.2797167
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]     [,2]       [,3]       [,4]       [,5]      [,6]      [,7]
row3 -0.3003954 0.119719 -1.2858047 -0.6861162 -0.3757553 -1.638416  1.894434
row1 -0.7481030 2.583061 -0.9867833  0.8931010  1.1354243  1.354806 -2.018516
          [,8]       [,9]       [,10]      [,11]     [,12]      [,13]
row3 -3.247591 -0.2607484 -0.04704542 -1.2059476 1.3813342 -0.4859410
row1  0.732507 -1.8369049  0.92076088  0.5233018 0.9442565 -0.8540122
          [,14]      [,15]      [,16]       [,17]     [,18]      [,19]    [,20]
row3  0.1210878 -0.0480118 -0.6415182 0.342352272 -1.269583 -1.5515907 1.233561
row1 -0.6612091  2.1447005  0.2123182 0.001416156 -1.060786 -0.7507957 1.440908
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]      [,5]       [,6]      [,7]
row2 -1.927998 0.8131812 0.9676133 0.3546222 -0.169985 -0.6238426 0.1448211
            [,8]       [,9]      [,10]
row2 -0.09901959 0.04117864 -0.9373565
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]        [,2]      [,3]      [,4]      [,5]     [,6]       [,7]
row5 0.542556 -0.03048578 0.2878586 -1.544807 0.7479892 1.261223 -0.6454238
          [,8]     [,9]      [,10]    [,11]      [,12]     [,13]    [,14]
row5 0.1874996 1.450195 -0.5792309 1.676828 -0.5798245 0.4928745 1.312724
         [,15]     [,16]     [,17]   [,18]      [,19]     [,20]
row5 0.7199686 0.3154272 -1.099943 1.69587 -0.5450279 0.1130206
> 
> 
> 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: 0x000001fcaceffef0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30406b046e60"
 [2] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30404e053a97"
 [3] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3040385030b" 
 [4] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30406c965270"
 [5] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30407a5f734a"
 [6] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30407ed2600d"
 [7] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30403cd7413c"
 [8] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30404f305199"
 [9] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3040c7f9b"   
[10] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM304034512dc2"
[11] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM304075a46b90"
[12] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM304022856f25"
[13] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM304041bb39cc"
[14] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM304076913406"
[15] "E:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM304038476dd4"
> 
> 
> ### 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: 0x000001fcafbff2f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001fcafbff2f0>
Warning message:
In dir.create(new.directory) :
  'E:\biocbuild\bbs-3.19-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001fcafbff2f0>
> rowMedians(tmp)
  [1]  0.127810695 -0.316351401  0.058245303 -0.269383752 -0.181307045
  [6] -0.398456082 -0.293914299  0.142868607 -0.315351420 -0.163077139
 [11]  0.029790108 -0.341961728  0.118953967  0.106644702 -0.016974811
 [16]  0.297845264 -0.046419584  0.545663753  0.098583577 -0.193994161
 [21] -0.142586238 -0.167650746 -0.202029344  0.325233216  0.183138964
 [26] -0.576374026 -0.836454057  0.183351508  0.008012296  0.099200475
 [31]  0.320559933  0.258377829  0.177021632  0.118297687 -0.154478783
 [36] -0.495005569 -0.358631906 -0.174732059  0.278293733 -0.767552470
 [41]  0.165199909 -0.114399401  0.442639950  0.384810666  0.008180979
 [46]  0.838792237  0.092303432  0.040895539 -0.096481104  0.219535793
 [51]  0.065988256 -0.083958300  0.232217206 -0.573184621  0.587156123
 [56]  0.428714497  0.076479169  0.679740822 -0.368402362  0.237279725
 [61]  0.048135065 -0.120620974 -0.208367730 -0.104976485 -0.475942252
 [66]  0.142097662 -0.668030088  0.338564198 -0.212670103  0.375676639
 [71]  0.430846953 -0.447092333 -0.049123918 -0.181300451  0.089322090
 [76]  0.336729596  0.512198655 -0.318494506  0.297321734 -0.228344530
 [81] -0.463256223  0.188584772 -0.235745912 -0.138384027 -0.305021500
 [86] -0.237924090  0.221962090 -0.123766972 -0.088440374 -0.269178137
 [91] -0.284654956  0.312584523 -0.032795822 -0.095451432 -0.244311067
 [96] -0.095241350  0.001235307 -0.294057792  0.581826981 -0.080085106
[101]  0.012459084  0.076276996 -0.590708868 -0.220383140  0.481556243
[106] -0.498840734  0.595176911 -0.245403950 -0.080361003 -0.428095061
[111] -0.399546634 -0.371406357  0.224153254  0.408566974  0.035870412
[116]  0.220168995 -0.146843302  0.018906748 -0.387804782 -0.031285877
[121]  0.047182173 -0.107730732  0.061925719 -0.003457197 -0.284020472
[126] -0.144390907 -0.114248703  0.143851950 -0.006208798  0.245855302
[131] -0.096017449 -0.055100288 -0.300249220  0.039566440 -0.577548272
[136] -0.017898449  0.105560318  0.181458522  0.259821371  0.272510588
[141] -0.818305225 -0.033160283 -0.398406642 -0.467657910 -0.252759070
[146]  0.090909022  0.498615312 -0.469147458  0.126021491 -0.368112476
[151] -0.154447341 -0.166935993  0.341160833  0.109890715  0.140608618
[156]  0.366119273 -0.351760456  0.493501378  0.041632015 -0.475343515
[161]  0.640464218  0.279964946  0.316475776  0.383314442  0.361504967
[166]  0.362463508  0.433373532 -0.526108193  0.061248804 -0.028350052
[171] -0.080994595  0.430054117  0.269216928  0.030125621 -0.050673305
[176] -0.360109805 -0.104561814  0.041089470 -0.055288451 -0.272671946
[181]  0.022028757  0.071103320  0.024896537 -0.556049478 -0.257043008
[186] -0.651450922  0.129018375 -0.002739938  0.072953416  0.051596277
[191]  0.218648463 -0.267470009 -0.190363347  0.067042498 -0.085137482
[196] -0.384833993 -0.521195653 -0.006684037 -0.550788111 -0.193856163
[201]  0.292303728  0.685497953  0.030425824 -0.465552550 -0.302618285
[206] -0.438122177  0.070647917  0.265191757 -0.139137246 -0.252457839
[211] -0.230318939  0.040808018  0.342908975 -0.046590691  0.538474490
[216] -0.569231958  0.084874243  0.067782623  0.081223039 -0.349737885
[221]  0.022755629  0.351757974  0.319347343 -0.059100996  0.071635623
[226]  0.282504036  0.519522421  0.078229769 -0.191334146  0.195251540
> 
> proc.time()
   user  system elapsed 
   3.71   18.56  884.28 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life"
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: 0x000001c68c4ff3b0>
> .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: 0x000001c68c4ff3b0>
> .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: 0x000001c68c4ff3b0>
> .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: 0x000001c68c4ff3b0>
> 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: 0x000001c68c4ffa10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001c68c4ffa10>
> .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: 0x000001c68c4ffa10>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001c68c4ffa10>
> .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: 0x000001c68c4ffa10>
> 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: 0x000001c68c4ff5f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001c68c4ff5f0>
> .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: 0x000001c68c4ff5f0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001c68c4ff5f0>
> .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: 0x000001c68c4ff5f0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000001c68c4ff5f0>
> .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: 0x000001c68c4ff5f0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000001c68c4ff5f0>
> .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: 0x000001c68c4ff5f0>
> 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: 0x000001c68c4ff6b0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000001c68c4ff6b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001c68c4ff6b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001c68c4ff6b0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1e40664e6580" "BufferedMatrixFile1e4067b01e89"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1e40664e6580" "BufferedMatrixFile1e4067b01e89"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001c68c4ff050>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001c68c4ff050>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001c68c4ff050>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001c68c4ff050>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000001c68c4ff050>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000001c68c4ff050>
> .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: 0x000001c68b87a290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001c68b87a290>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001c68b87a290>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000001c68b87a290>
> 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: 0x000001c68c4ff290>
> .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: 0x000001c68c4ff290>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.34    0.14    0.64 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life"
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.25    0.09    0.50 

Example timings