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

This page was generated on 2024-06-28 17:46 -0400 (Fri, 28 Jun 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 (2024-04-24) -- "Puppy Cup" 4760
palomino3Windows Server 2022 Datacenterx644.4.0 (2024-04-24 ucrt) -- "Puppy Cup" 4494
merida1macOS 12.7.4 Montereyx86_644.4.0 (2024-04-24) -- "Puppy Cup" 4508
kjohnson1macOS 13.6.6 Venturaarm644.4.0 (2024-04-24) -- "Puppy Cup" 4466
palomino7Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4362
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-06-26 14:00 -0400 (Wed, 26 Jun 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
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.4 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
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  


CHECK results for BufferedMatrix on palomino7

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

raw results


Summary

Package: BufferedMatrix
Version: 1.68.0
Command: F:\biocbuild\bbs-3.19-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.19-bioc\R\library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-06-26 23:41:48 -0400 (Wed, 26 Jun 2024)
EndedAt: 2024-06-26 23:43:02 -0400 (Wed, 26 Jun 2024)
EllapsedTime: 74.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'F:/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 'F:/biocbuild/bbs-3.19-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found '_exit', possibly from '_exit' (C)
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

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

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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'F:/biocbuild/bbs-3.19-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 13.2.0'
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"c:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"c:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function 'dbm_ReadOnlyMode':
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: 'sort_double' defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"c:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"c:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c init_package.c -o init_package.o
gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -Lc:/rtools44/x86_64-w64-mingw32.static.posix/lib/x64 -Lc:/rtools44/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.19-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.19-bioc/R/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for 'rowMeans' in package 'BufferedMatrix'
Creating a new generic function for 'rowSums' in package 'BufferedMatrix'
Creating a new generic function for 'colMeans' in package 'BufferedMatrix'
Creating a new generic function for 'colSums' in package 'BufferedMatrix'
Creating a generic function for 'ncol' from package 'base' in package 'BufferedMatrix'
Creating a generic function for 'nrow' from package 'base' in package 'BufferedMatrix'
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R 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.32    0.12    0.64 

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] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 468463 25.1    1021758 54.6   633414 33.9
Vcells 853871  6.6    8388608 64.0  2003098 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 Jun 26 23:42:17 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 Jun 26 23:42:17 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: 0x000001d23d6ff3b0>
> 
> 
> 
> 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 Jun 26 23:42:24 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 Jun 26 23:42:26 2024"
> 
> ColMode(tmp2)
<pointer: 0x000001d23d6ff3b0>
> 
> 
> 
> ### 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.143396  1.8832468 -0.6768216 -0.4327710
[2,]  -0.472305  0.8225508  1.6844578 -0.9664929
[3,]  -1.184838 -0.9703975 -0.4779062 -0.2917089
[4,]  -0.101914  1.1771228  0.9199079 -0.7720828
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 100.143396 1.8832468 0.6768216 0.4327710
[2,]   0.472305 0.8225508 1.6844578 0.9664929
[3,]   1.184838 0.9703975 0.4779062 0.2917089
[4,]   0.101914 1.1771228 0.9199079 0.7720828
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0071673 1.3723144 0.8226917 0.6578533
[2,]  0.6872445 0.9069459 1.2978667 0.9831037
[3,]  1.0885028 0.9850876 0.6913076 0.5401008
[4,]  0.3192396 1.0849529 0.9591183 0.8786824
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.21507 40.60639 33.90374 32.01130
[2,]  32.34475 34.89201 39.66312 35.79753
[3,]  37.06987 35.82127 32.39098 30.69272
[4,]  28.29431 37.02665 35.51109 34.55891
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001d23d6ff4d0>
> exp(tmp5)
<pointer: 0x000001d23d6ff4d0>
> log(tmp5,2)
<pointer: 0x000001d23d6ff4d0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.7557
> Min(tmp5)
[1] 54.1191
> mean(tmp5)
[1] 72.92062
> Sum(tmp5)
[1] 14584.12
> Var(tmp5)
[1] 862.3119
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.40912 70.00402 69.60084 72.91929 70.14388 69.04078 71.97667 72.86470
 [9] 71.45411 70.79276
> rowSums(tmp5)
 [1] 1808.182 1400.080 1392.017 1458.386 1402.878 1380.816 1439.533 1457.294
 [9] 1429.082 1415.855
> rowVars(tmp5)
 [1] 8028.15415   57.20265   64.19310   55.62842   43.51280   87.31963
 [7]   97.18957  108.51508   55.02969   60.40488
> rowSd(tmp5)
 [1] 89.599967  7.563243  8.012060  7.458446  6.596423  9.344497  9.858477
 [8] 10.417057  7.418200  7.772057
> rowMax(tmp5)
 [1] 468.75566  82.55360  83.64548  83.86895  86.63915  83.61096 100.27754
 [8]  97.26418  87.36553  87.84458
> rowMin(tmp5)
 [1] 55.23718 54.69538 55.95074 58.89090 61.26274 54.46289 54.11910 55.79033
 [9] 58.00997 59.76629
> 
> colMeans(tmp5)
 [1] 106.68743  71.38929  75.63331  73.58694  73.21843  71.41416  78.56938
 [8]  74.24395  69.26091  69.03001  70.85359  71.60320  66.12785  69.00595
[15]  67.78933  70.63217  73.40790  65.30736  72.00532  68.64586
> colSums(tmp5)
 [1] 1066.8743  713.8929  756.3331  735.8694  732.1843  714.1416  785.6938
 [8]  742.4395  692.6091  690.3001  708.5359  716.0320  661.2785  690.0595
[15]  677.8933  706.3217  734.0790  653.0736  720.0532  686.4586
> colVars(tmp5)
 [1] 16232.72205    56.70263    34.53615    44.43695    97.83610    37.94809
 [7]    65.86563    54.54952    60.55590    74.55882   151.56402   101.12547
[13]    81.10760    64.90752    50.61700    81.51982    97.89338    36.20418
[19]    47.44821    48.74732
> colSd(tmp5)
 [1] 127.407700   7.530115   5.876747   6.666104   9.891213   6.160202
 [7]   8.115764   7.385765   7.781767   8.634745  12.311134  10.056116
[13]   9.005976   8.056520   7.114562   9.028833   9.894108   6.016991
[19]   6.888266   6.981928
> colMax(tmp5)
 [1] 468.75566  84.51688  86.63915  85.22693  87.84458  82.58522  97.26418
 [8]  84.84116  78.83321  83.86895 100.27754  82.11889  79.44079  87.36553
[15]  78.94180  82.29846  88.50453  76.89317  81.17103  78.15848
> colMin(tmp5)
 [1] 54.94897 58.00997 67.41759 63.88287 54.69538 60.46404 69.28167 64.51263
 [9] 59.47512 55.02120 55.23718 54.11910 54.46289 61.01830 55.95074 57.66066
[17] 61.26274 56.59897 63.36376 56.85098
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.40912 70.00402 69.60084 72.91929 70.14388 69.04078 71.97667 72.86470
 [9] 71.45411       NA
> rowSums(tmp5)
 [1] 1808.182 1400.080 1392.017 1458.386 1402.878 1380.816 1439.533 1457.294
 [9] 1429.082       NA
> rowVars(tmp5)
 [1] 8028.15415   57.20265   64.19310   55.62842   43.51280   87.31963
 [7]   97.18957  108.51508   55.02969   62.47681
> rowSd(tmp5)
 [1] 89.599967  7.563243  8.012060  7.458446  6.596423  9.344497  9.858477
 [8] 10.417057  7.418200  7.904228
> rowMax(tmp5)
 [1] 468.75566  82.55360  83.64548  83.86895  86.63915  83.61096 100.27754
 [8]  97.26418  87.36553        NA
> rowMin(tmp5)
 [1] 55.23718 54.69538 55.95074 58.89090 61.26274 54.46289 54.11910 55.79033
 [9] 58.00997       NA
> 
> colMeans(tmp5)
 [1] 106.68743  71.38929  75.63331  73.58694  73.21843  71.41416  78.56938
 [8]        NA  69.26091  69.03001  70.85359  71.60320  66.12785  69.00595
[15]  67.78933  70.63217  73.40790  65.30736  72.00532  68.64586
> colSums(tmp5)
 [1] 1066.8743  713.8929  756.3331  735.8694  732.1843  714.1416  785.6938
 [8]        NA  692.6091  690.3001  708.5359  716.0320  661.2785  690.0595
[15]  677.8933  706.3217  734.0790  653.0736  720.0532  686.4586
> colVars(tmp5)
 [1] 16232.72205    56.70263    34.53615    44.43695    97.83610    37.94809
 [7]    65.86563          NA    60.55590    74.55882   151.56402   101.12547
[13]    81.10760    64.90752    50.61700    81.51982    97.89338    36.20418
[19]    47.44821    48.74732
> colSd(tmp5)
 [1] 127.407700   7.530115   5.876747   6.666104   9.891213   6.160202
 [7]   8.115764         NA   7.781767   8.634745  12.311134  10.056116
[13]   9.005976   8.056520   7.114562   9.028833   9.894108   6.016991
[19]   6.888266   6.981928
> colMax(tmp5)
 [1] 468.75566  84.51688  86.63915  85.22693  87.84458  82.58522  97.26418
 [8]        NA  78.83321  83.86895 100.27754  82.11889  79.44079  87.36553
[15]  78.94180  82.29846  88.50453  76.89317  81.17103  78.15848
> colMin(tmp5)
 [1] 54.94897 58.00997 67.41759 63.88287 54.69538 60.46404 69.28167       NA
 [9] 59.47512 55.02120 55.23718 54.11910 54.46289 61.01830 55.95074 57.66066
[17] 61.26274 56.59897 63.36376 56.85098
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.7557
> Min(tmp5,na.rm=TRUE)
[1] 54.1191
> mean(tmp5,na.rm=TRUE)
[1] 72.90776
> Sum(tmp5,na.rm=TRUE)
[1] 14508.65
> Var(tmp5,na.rm=TRUE)
[1] 866.6338
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.40912 70.00402 69.60084 72.91929 70.14388 69.04078 71.97667 72.86470
 [9] 71.45411 70.54615
> rowSums(tmp5,na.rm=TRUE)
 [1] 1808.182 1400.080 1392.017 1458.386 1402.878 1380.816 1439.533 1457.294
 [9] 1429.082 1340.377
> rowVars(tmp5,na.rm=TRUE)
 [1] 8028.15415   57.20265   64.19310   55.62842   43.51280   87.31963
 [7]   97.18957  108.51508   55.02969   62.47681
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.599967  7.563243  8.012060  7.458446  6.596423  9.344497  9.858477
 [8] 10.417057  7.418200  7.904228
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.75566  82.55360  83.64548  83.86895  86.63915  83.61096 100.27754
 [8]  97.26418  87.36553  87.84458
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.23718 54.69538 55.95074 58.89090 61.26274 54.46289 54.11910 55.79033
 [9] 58.00997 59.76629
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 106.68743  71.38929  75.63331  73.58694  73.21843  71.41416  78.56938
 [8]  74.10679  69.26091  69.03001  70.85359  71.60320  66.12785  69.00595
[15]  67.78933  70.63217  73.40790  65.30736  72.00532  68.64586
> colSums(tmp5,na.rm=TRUE)
 [1] 1066.8743  713.8929  756.3331  735.8694  732.1843  714.1416  785.6938
 [8]  666.9611  692.6091  690.3001  708.5359  716.0320  661.2785  690.0595
[15]  677.8933  706.3217  734.0790  653.0736  720.0532  686.4586
> colVars(tmp5,na.rm=TRUE)
 [1] 16232.72205    56.70263    34.53615    44.43695    97.83610    37.94809
 [7]    65.86563    61.15659    60.55590    74.55882   151.56402   101.12547
[13]    81.10760    64.90752    50.61700    81.51982    97.89338    36.20418
[19]    47.44821    48.74732
> colSd(tmp5,na.rm=TRUE)
 [1] 127.407700   7.530115   5.876747   6.666104   9.891213   6.160202
 [7]   8.115764   7.820268   7.781767   8.634745  12.311134  10.056116
[13]   9.005976   8.056520   7.114562   9.028833   9.894108   6.016991
[19]   6.888266   6.981928
> colMax(tmp5,na.rm=TRUE)
 [1] 468.75566  84.51688  86.63915  85.22693  87.84458  82.58522  97.26418
 [8]  84.84116  78.83321  83.86895 100.27754  82.11889  79.44079  87.36553
[15]  78.94180  82.29846  88.50453  76.89317  81.17103  78.15848
> colMin(tmp5,na.rm=TRUE)
 [1] 54.94897 58.00997 67.41759 63.88287 54.69538 60.46404 69.28167 64.51263
 [9] 59.47512 55.02120 55.23718 54.11910 54.46289 61.01830 55.95074 57.66066
[17] 61.26274 56.59897 63.36376 56.85098
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.40912 70.00402 69.60084 72.91929 70.14388 69.04078 71.97667 72.86470
 [9] 71.45411      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1808.182 1400.080 1392.017 1458.386 1402.878 1380.816 1439.533 1457.294
 [9] 1429.082    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8028.15415   57.20265   64.19310   55.62842   43.51280   87.31963
 [7]   97.18957  108.51508   55.02969         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.599967  7.563243  8.012060  7.458446  6.596423  9.344497  9.858477
 [8] 10.417057  7.418200        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.75566  82.55360  83.64548  83.86895  86.63915  83.61096 100.27754
 [8]  97.26418  87.36553        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.23718 54.69538 55.95074 58.89090 61.26274 54.46289 54.11910 55.79033
 [9] 58.00997       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.88535  71.78943  75.35601  73.81273  71.59331  72.63084  79.17758
 [8]       NaN  68.48672  69.59510  72.08551  70.47678  65.96266  68.50132
[15]  68.64500  70.78186  72.83737  64.42820  72.05864  68.92971
> colSums(tmp5,na.rm=TRUE)
 [1] 1006.9681  646.1049  678.2041  664.3145  644.3398  653.6776  712.5982
 [8]    0.0000  616.3805  626.3559  648.7696  634.2910  593.6640  616.5119
[15]  617.8050  637.0367  655.5363  579.8538  648.5277  620.3674
> colVars(tmp5,na.rm=TRUE)
 [1] 17957.85550    61.98917    37.98814    49.41803    80.35395    26.03812
 [7]    69.93739          NA    61.38250    80.28626   153.43615    99.49182
[13]    90.93906    70.15616    48.70714    91.45774   106.46811    32.03435
[19]    53.34726    53.93432
> colSd(tmp5,na.rm=TRUE)
 [1] 134.006923   7.873320   6.163452   7.029796   8.964036   5.102756
 [7]   8.362858         NA   7.834698   8.960260  12.386935   9.974559
[13]   9.536197   8.375927   6.979050   9.563354  10.318339   5.659889
[19]   7.303921   7.343999
> colMax(tmp5,na.rm=TRUE)
 [1] 468.75566  84.51688  86.63915  85.22693  83.64548  82.58522  97.26418
 [8]      -Inf  78.83321  83.86895 100.27754  82.11889  79.44079  87.36553
[15]  78.94180  82.29846  88.50453  76.89317  81.17103  78.15848
> colMin(tmp5,na.rm=TRUE)
 [1] 54.94897 58.00997 67.41759 63.88287 54.69538 67.17499 69.28167      Inf
 [9] 59.47512 55.02120 55.23718 54.11910 54.46289 61.01830 55.95074 57.66066
[17] 61.26274 56.59897 63.36376 56.85098
> 
> 
> 
> 
> 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] 200.8928 412.4074 342.2236 314.0395 336.7268 245.6385 228.4983 226.1128
 [9] 205.9356 221.0540
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 200.8928 412.4074 342.2236 314.0395 336.7268 245.6385 228.4983 226.1128
 [9] 205.9356 221.0540
> 
> 
> 
> 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] -2.842171e-14  1.136868e-13  0.000000e+00 -3.979039e-13  0.000000e+00
 [6]  2.842171e-14 -1.136868e-13 -1.136868e-13 -2.842171e-14 -1.136868e-13
[11] -8.526513e-14  1.705303e-13  1.421085e-13 -9.947598e-14  2.273737e-13
[16]  1.705303e-13  5.684342e-14  4.263256e-14 -2.273737e-13  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   18 
8   20 
5   3 
6   10 
2   7 
8   14 
5   4 
7   17 
10   14 
4   3 
6   8 
2   5 
7   2 
8   13 
1   7 
3   5 
10   1 
1   11 
6   19 
9   20 
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.967668
> Min(tmp)
[1] -1.880175
> mean(tmp)
[1] 0.01354353
> Sum(tmp)
[1] 1.354353
> Var(tmp)
[1] 0.8675303
> 
> rowMeans(tmp)
[1] 0.01354353
> rowSums(tmp)
[1] 1.354353
> rowVars(tmp)
[1] 0.8675303
> rowSd(tmp)
[1] 0.9314131
> rowMax(tmp)
[1] 2.967668
> rowMin(tmp)
[1] -1.880175
> 
> colMeans(tmp)
  [1]  0.201010935  0.267411398 -0.524034676  0.319129422 -0.092085663
  [6]  0.395086052 -0.234685848  1.317599056 -1.830152406 -1.525211026
 [11]  0.400522367 -0.496202059  0.100038751 -0.578979760 -1.117263045
 [16] -1.777072653 -0.039493033 -0.682259890  0.002998240  0.126326897
 [21] -0.323549451  0.236102249  0.575989045  0.477140816  0.178189978
 [26]  0.550256406  0.704181765 -1.297690893  2.619758681  0.666237197
 [31] -0.617821147  1.416379284  1.133925612  0.050448315 -0.439129713
 [36]  0.482165936  0.021079888  1.916905240  0.879835339 -1.045738053
 [41] -1.056186625  0.986672151  0.822372621  0.254458117  2.967667569
 [46] -0.389711577 -0.816782126 -1.248538817 -0.910217594 -1.488991263
 [51] -1.058501911  0.547441732  0.486642434 -0.661589393 -0.096258323
 [56]  0.557926424 -0.174193778 -0.305735394 -0.848328603 -1.880174631
 [61] -0.198628046 -0.218230243  0.329259787  0.707230780 -0.642351152
 [66] -0.875919653  0.126683641 -0.184171807 -0.521515217 -0.988188970
 [71]  0.015940726  1.316098463  1.798555592 -1.869826304  0.390255625
 [76] -0.645253745  0.699154728  0.009629475 -0.811424068 -1.298766865
 [81] -0.319101512 -0.041656131  1.169332372  1.163460328  0.041495088
 [86]  0.289181031  0.641791502  1.214535955  0.952243683  0.459565511
 [91] -0.149721488  0.756613551  0.229907015 -0.398668518 -0.156245322
 [96] -0.667875474  1.565769341  1.238437602 -0.693156683 -1.185407684
> colSums(tmp)
  [1]  0.201010935  0.267411398 -0.524034676  0.319129422 -0.092085663
  [6]  0.395086052 -0.234685848  1.317599056 -1.830152406 -1.525211026
 [11]  0.400522367 -0.496202059  0.100038751 -0.578979760 -1.117263045
 [16] -1.777072653 -0.039493033 -0.682259890  0.002998240  0.126326897
 [21] -0.323549451  0.236102249  0.575989045  0.477140816  0.178189978
 [26]  0.550256406  0.704181765 -1.297690893  2.619758681  0.666237197
 [31] -0.617821147  1.416379284  1.133925612  0.050448315 -0.439129713
 [36]  0.482165936  0.021079888  1.916905240  0.879835339 -1.045738053
 [41] -1.056186625  0.986672151  0.822372621  0.254458117  2.967667569
 [46] -0.389711577 -0.816782126 -1.248538817 -0.910217594 -1.488991263
 [51] -1.058501911  0.547441732  0.486642434 -0.661589393 -0.096258323
 [56]  0.557926424 -0.174193778 -0.305735394 -0.848328603 -1.880174631
 [61] -0.198628046 -0.218230243  0.329259787  0.707230780 -0.642351152
 [66] -0.875919653  0.126683641 -0.184171807 -0.521515217 -0.988188970
 [71]  0.015940726  1.316098463  1.798555592 -1.869826304  0.390255625
 [76] -0.645253745  0.699154728  0.009629475 -0.811424068 -1.298766865
 [81] -0.319101512 -0.041656131  1.169332372  1.163460328  0.041495088
 [86]  0.289181031  0.641791502  1.214535955  0.952243683  0.459565511
 [91] -0.149721488  0.756613551  0.229907015 -0.398668518 -0.156245322
 [96] -0.667875474  1.565769341  1.238437602 -0.693156683 -1.185407684
> 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.201010935  0.267411398 -0.524034676  0.319129422 -0.092085663
  [6]  0.395086052 -0.234685848  1.317599056 -1.830152406 -1.525211026
 [11]  0.400522367 -0.496202059  0.100038751 -0.578979760 -1.117263045
 [16] -1.777072653 -0.039493033 -0.682259890  0.002998240  0.126326897
 [21] -0.323549451  0.236102249  0.575989045  0.477140816  0.178189978
 [26]  0.550256406  0.704181765 -1.297690893  2.619758681  0.666237197
 [31] -0.617821147  1.416379284  1.133925612  0.050448315 -0.439129713
 [36]  0.482165936  0.021079888  1.916905240  0.879835339 -1.045738053
 [41] -1.056186625  0.986672151  0.822372621  0.254458117  2.967667569
 [46] -0.389711577 -0.816782126 -1.248538817 -0.910217594 -1.488991263
 [51] -1.058501911  0.547441732  0.486642434 -0.661589393 -0.096258323
 [56]  0.557926424 -0.174193778 -0.305735394 -0.848328603 -1.880174631
 [61] -0.198628046 -0.218230243  0.329259787  0.707230780 -0.642351152
 [66] -0.875919653  0.126683641 -0.184171807 -0.521515217 -0.988188970
 [71]  0.015940726  1.316098463  1.798555592 -1.869826304  0.390255625
 [76] -0.645253745  0.699154728  0.009629475 -0.811424068 -1.298766865
 [81] -0.319101512 -0.041656131  1.169332372  1.163460328  0.041495088
 [86]  0.289181031  0.641791502  1.214535955  0.952243683  0.459565511
 [91] -0.149721488  0.756613551  0.229907015 -0.398668518 -0.156245322
 [96] -0.667875474  1.565769341  1.238437602 -0.693156683 -1.185407684
> colMin(tmp)
  [1]  0.201010935  0.267411398 -0.524034676  0.319129422 -0.092085663
  [6]  0.395086052 -0.234685848  1.317599056 -1.830152406 -1.525211026
 [11]  0.400522367 -0.496202059  0.100038751 -0.578979760 -1.117263045
 [16] -1.777072653 -0.039493033 -0.682259890  0.002998240  0.126326897
 [21] -0.323549451  0.236102249  0.575989045  0.477140816  0.178189978
 [26]  0.550256406  0.704181765 -1.297690893  2.619758681  0.666237197
 [31] -0.617821147  1.416379284  1.133925612  0.050448315 -0.439129713
 [36]  0.482165936  0.021079888  1.916905240  0.879835339 -1.045738053
 [41] -1.056186625  0.986672151  0.822372621  0.254458117  2.967667569
 [46] -0.389711577 -0.816782126 -1.248538817 -0.910217594 -1.488991263
 [51] -1.058501911  0.547441732  0.486642434 -0.661589393 -0.096258323
 [56]  0.557926424 -0.174193778 -0.305735394 -0.848328603 -1.880174631
 [61] -0.198628046 -0.218230243  0.329259787  0.707230780 -0.642351152
 [66] -0.875919653  0.126683641 -0.184171807 -0.521515217 -0.988188970
 [71]  0.015940726  1.316098463  1.798555592 -1.869826304  0.390255625
 [76] -0.645253745  0.699154728  0.009629475 -0.811424068 -1.298766865
 [81] -0.319101512 -0.041656131  1.169332372  1.163460328  0.041495088
 [86]  0.289181031  0.641791502  1.214535955  0.952243683  0.459565511
 [91] -0.149721488  0.756613551  0.229907015 -0.398668518 -0.156245322
 [96] -0.667875474  1.565769341  1.238437602 -0.693156683 -1.185407684
> colMedians(tmp)
  [1]  0.201010935  0.267411398 -0.524034676  0.319129422 -0.092085663
  [6]  0.395086052 -0.234685848  1.317599056 -1.830152406 -1.525211026
 [11]  0.400522367 -0.496202059  0.100038751 -0.578979760 -1.117263045
 [16] -1.777072653 -0.039493033 -0.682259890  0.002998240  0.126326897
 [21] -0.323549451  0.236102249  0.575989045  0.477140816  0.178189978
 [26]  0.550256406  0.704181765 -1.297690893  2.619758681  0.666237197
 [31] -0.617821147  1.416379284  1.133925612  0.050448315 -0.439129713
 [36]  0.482165936  0.021079888  1.916905240  0.879835339 -1.045738053
 [41] -1.056186625  0.986672151  0.822372621  0.254458117  2.967667569
 [46] -0.389711577 -0.816782126 -1.248538817 -0.910217594 -1.488991263
 [51] -1.058501911  0.547441732  0.486642434 -0.661589393 -0.096258323
 [56]  0.557926424 -0.174193778 -0.305735394 -0.848328603 -1.880174631
 [61] -0.198628046 -0.218230243  0.329259787  0.707230780 -0.642351152
 [66] -0.875919653  0.126683641 -0.184171807 -0.521515217 -0.988188970
 [71]  0.015940726  1.316098463  1.798555592 -1.869826304  0.390255625
 [76] -0.645253745  0.699154728  0.009629475 -0.811424068 -1.298766865
 [81] -0.319101512 -0.041656131  1.169332372  1.163460328  0.041495088
 [86]  0.289181031  0.641791502  1.214535955  0.952243683  0.459565511
 [91] -0.149721488  0.756613551  0.229907015 -0.398668518 -0.156245322
 [96] -0.667875474  1.565769341  1.238437602 -0.693156683 -1.185407684
> colRanges(tmp)
          [,1]      [,2]       [,3]      [,4]        [,5]      [,6]       [,7]
[1,] 0.2010109 0.2674114 -0.5240347 0.3191294 -0.09208566 0.3950861 -0.2346858
[2,] 0.2010109 0.2674114 -0.5240347 0.3191294 -0.09208566 0.3950861 -0.2346858
         [,8]      [,9]     [,10]     [,11]      [,12]     [,13]      [,14]
[1,] 1.317599 -1.830152 -1.525211 0.4005224 -0.4962021 0.1000388 -0.5789798
[2,] 1.317599 -1.830152 -1.525211 0.4005224 -0.4962021 0.1000388 -0.5789798
         [,15]     [,16]       [,17]      [,18]      [,19]     [,20]      [,21]
[1,] -1.117263 -1.777073 -0.03949303 -0.6822599 0.00299824 0.1263269 -0.3235495
[2,] -1.117263 -1.777073 -0.03949303 -0.6822599 0.00299824 0.1263269 -0.3235495
         [,22]    [,23]     [,24]   [,25]     [,26]     [,27]     [,28]
[1,] 0.2361022 0.575989 0.4771408 0.17819 0.5502564 0.7041818 -1.297691
[2,] 0.2361022 0.575989 0.4771408 0.17819 0.5502564 0.7041818 -1.297691
        [,29]     [,30]      [,31]    [,32]    [,33]      [,34]      [,35]
[1,] 2.619759 0.6662372 -0.6178211 1.416379 1.133926 0.05044832 -0.4391297
[2,] 2.619759 0.6662372 -0.6178211 1.416379 1.133926 0.05044832 -0.4391297
         [,36]      [,37]    [,38]     [,39]     [,40]     [,41]     [,42]
[1,] 0.4821659 0.02107989 1.916905 0.8798353 -1.045738 -1.056187 0.9866722
[2,] 0.4821659 0.02107989 1.916905 0.8798353 -1.045738 -1.056187 0.9866722
         [,43]     [,44]    [,45]      [,46]      [,47]     [,48]      [,49]
[1,] 0.8223726 0.2544581 2.967668 -0.3897116 -0.8167821 -1.248539 -0.9102176
[2,] 0.8223726 0.2544581 2.967668 -0.3897116 -0.8167821 -1.248539 -0.9102176
         [,50]     [,51]     [,52]     [,53]      [,54]       [,55]     [,56]
[1,] -1.488991 -1.058502 0.5474417 0.4866424 -0.6615894 -0.09625832 0.5579264
[2,] -1.488991 -1.058502 0.5474417 0.4866424 -0.6615894 -0.09625832 0.5579264
          [,57]      [,58]      [,59]     [,60]     [,61]      [,62]     [,63]
[1,] -0.1741938 -0.3057354 -0.8483286 -1.880175 -0.198628 -0.2182302 0.3292598
[2,] -0.1741938 -0.3057354 -0.8483286 -1.880175 -0.198628 -0.2182302 0.3292598
         [,64]      [,65]      [,66]     [,67]      [,68]      [,69]     [,70]
[1,] 0.7072308 -0.6423512 -0.8759197 0.1266836 -0.1841718 -0.5215152 -0.988189
[2,] 0.7072308 -0.6423512 -0.8759197 0.1266836 -0.1841718 -0.5215152 -0.988189
          [,71]    [,72]    [,73]     [,74]     [,75]      [,76]     [,77]
[1,] 0.01594073 1.316098 1.798556 -1.869826 0.3902556 -0.6452537 0.6991547
[2,] 0.01594073 1.316098 1.798556 -1.869826 0.3902556 -0.6452537 0.6991547
           [,78]      [,79]     [,80]      [,81]       [,82]    [,83]   [,84]
[1,] 0.009629475 -0.8114241 -1.298767 -0.3191015 -0.04165613 1.169332 1.16346
[2,] 0.009629475 -0.8114241 -1.298767 -0.3191015 -0.04165613 1.169332 1.16346
          [,85]    [,86]     [,87]    [,88]     [,89]     [,90]      [,91]
[1,] 0.04149509 0.289181 0.6417915 1.214536 0.9522437 0.4595655 -0.1497215
[2,] 0.04149509 0.289181 0.6417915 1.214536 0.9522437 0.4595655 -0.1497215
         [,92]    [,93]      [,94]      [,95]      [,96]    [,97]    [,98]
[1,] 0.7566136 0.229907 -0.3986685 -0.1562453 -0.6678755 1.565769 1.238438
[2,] 0.7566136 0.229907 -0.3986685 -0.1562453 -0.6678755 1.565769 1.238438
          [,99]    [,100]
[1,] -0.6931567 -1.185408
[2,] -0.6931567 -1.185408
> 
> 
> Max(tmp2)
[1] 3.112976
> Min(tmp2)
[1] -2.801919
> mean(tmp2)
[1] -0.04182181
> Sum(tmp2)
[1] -4.182181
> Var(tmp2)
[1] 1.065246
> 
> rowMeans(tmp2)
  [1]  2.20179979  0.59781824  0.48363245  1.68589531 -0.49091229 -1.21420768
  [7] -0.40276217 -1.04407523 -0.35104407 -0.47703086  0.04818909 -0.36069213
 [13] -1.58339390  0.12447618 -0.84390513 -0.11882746 -0.40342063 -0.02124200
 [19]  0.24379760  0.73879614  0.67369253  1.47112002  0.69831528 -0.74138891
 [25]  0.04839442 -0.73727971 -1.00086851 -0.17650250  0.17041409 -0.26543464
 [31] -0.43238662 -0.15015709 -0.86234552  0.78751418 -0.37685775 -0.51369475
 [37]  0.84813293 -0.12497260  0.29227057 -0.19571583  1.99731219  0.08172164
 [43] -1.13102180  0.21255589  0.86725177 -0.57221997  0.27990161 -1.24726391
 [49] -2.55745904  0.52984290 -0.45148014 -1.94560635  0.44900898 -0.76498045
 [55]  0.01379537  1.81501227 -0.59874692 -0.68035100  0.41049578 -0.96831537
 [61] -0.17546213 -0.56397881 -0.74180985 -0.32234545  0.79216763  0.75195170
 [67] -1.46957299  1.02526299  0.71138381  0.46175133 -1.66965670 -0.46344184
 [73] -1.79024857  3.11297598 -0.13597613  0.70418277 -1.17816010 -0.54966909
 [79] -0.22428582 -0.32794091  0.29134945 -0.93352235  0.66253891  0.52211275
 [85]  0.24801631 -0.33293686  0.62126566  1.81737797 -1.53712918 -1.25832300
 [91]  0.12228599  2.54938727 -0.68292830  0.67174852  0.92206286  0.74230816
 [97] -0.93130152  1.23090057 -2.80191922  1.98280259
> rowSums(tmp2)
  [1]  2.20179979  0.59781824  0.48363245  1.68589531 -0.49091229 -1.21420768
  [7] -0.40276217 -1.04407523 -0.35104407 -0.47703086  0.04818909 -0.36069213
 [13] -1.58339390  0.12447618 -0.84390513 -0.11882746 -0.40342063 -0.02124200
 [19]  0.24379760  0.73879614  0.67369253  1.47112002  0.69831528 -0.74138891
 [25]  0.04839442 -0.73727971 -1.00086851 -0.17650250  0.17041409 -0.26543464
 [31] -0.43238662 -0.15015709 -0.86234552  0.78751418 -0.37685775 -0.51369475
 [37]  0.84813293 -0.12497260  0.29227057 -0.19571583  1.99731219  0.08172164
 [43] -1.13102180  0.21255589  0.86725177 -0.57221997  0.27990161 -1.24726391
 [49] -2.55745904  0.52984290 -0.45148014 -1.94560635  0.44900898 -0.76498045
 [55]  0.01379537  1.81501227 -0.59874692 -0.68035100  0.41049578 -0.96831537
 [61] -0.17546213 -0.56397881 -0.74180985 -0.32234545  0.79216763  0.75195170
 [67] -1.46957299  1.02526299  0.71138381  0.46175133 -1.66965670 -0.46344184
 [73] -1.79024857  3.11297598 -0.13597613  0.70418277 -1.17816010 -0.54966909
 [79] -0.22428582 -0.32794091  0.29134945 -0.93352235  0.66253891  0.52211275
 [85]  0.24801631 -0.33293686  0.62126566  1.81737797 -1.53712918 -1.25832300
 [91]  0.12228599  2.54938727 -0.68292830  0.67174852  0.92206286  0.74230816
 [97] -0.93130152  1.23090057 -2.80191922  1.98280259
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  2.20179979  0.59781824  0.48363245  1.68589531 -0.49091229 -1.21420768
  [7] -0.40276217 -1.04407523 -0.35104407 -0.47703086  0.04818909 -0.36069213
 [13] -1.58339390  0.12447618 -0.84390513 -0.11882746 -0.40342063 -0.02124200
 [19]  0.24379760  0.73879614  0.67369253  1.47112002  0.69831528 -0.74138891
 [25]  0.04839442 -0.73727971 -1.00086851 -0.17650250  0.17041409 -0.26543464
 [31] -0.43238662 -0.15015709 -0.86234552  0.78751418 -0.37685775 -0.51369475
 [37]  0.84813293 -0.12497260  0.29227057 -0.19571583  1.99731219  0.08172164
 [43] -1.13102180  0.21255589  0.86725177 -0.57221997  0.27990161 -1.24726391
 [49] -2.55745904  0.52984290 -0.45148014 -1.94560635  0.44900898 -0.76498045
 [55]  0.01379537  1.81501227 -0.59874692 -0.68035100  0.41049578 -0.96831537
 [61] -0.17546213 -0.56397881 -0.74180985 -0.32234545  0.79216763  0.75195170
 [67] -1.46957299  1.02526299  0.71138381  0.46175133 -1.66965670 -0.46344184
 [73] -1.79024857  3.11297598 -0.13597613  0.70418277 -1.17816010 -0.54966909
 [79] -0.22428582 -0.32794091  0.29134945 -0.93352235  0.66253891  0.52211275
 [85]  0.24801631 -0.33293686  0.62126566  1.81737797 -1.53712918 -1.25832300
 [91]  0.12228599  2.54938727 -0.68292830  0.67174852  0.92206286  0.74230816
 [97] -0.93130152  1.23090057 -2.80191922  1.98280259
> rowMin(tmp2)
  [1]  2.20179979  0.59781824  0.48363245  1.68589531 -0.49091229 -1.21420768
  [7] -0.40276217 -1.04407523 -0.35104407 -0.47703086  0.04818909 -0.36069213
 [13] -1.58339390  0.12447618 -0.84390513 -0.11882746 -0.40342063 -0.02124200
 [19]  0.24379760  0.73879614  0.67369253  1.47112002  0.69831528 -0.74138891
 [25]  0.04839442 -0.73727971 -1.00086851 -0.17650250  0.17041409 -0.26543464
 [31] -0.43238662 -0.15015709 -0.86234552  0.78751418 -0.37685775 -0.51369475
 [37]  0.84813293 -0.12497260  0.29227057 -0.19571583  1.99731219  0.08172164
 [43] -1.13102180  0.21255589  0.86725177 -0.57221997  0.27990161 -1.24726391
 [49] -2.55745904  0.52984290 -0.45148014 -1.94560635  0.44900898 -0.76498045
 [55]  0.01379537  1.81501227 -0.59874692 -0.68035100  0.41049578 -0.96831537
 [61] -0.17546213 -0.56397881 -0.74180985 -0.32234545  0.79216763  0.75195170
 [67] -1.46957299  1.02526299  0.71138381  0.46175133 -1.66965670 -0.46344184
 [73] -1.79024857  3.11297598 -0.13597613  0.70418277 -1.17816010 -0.54966909
 [79] -0.22428582 -0.32794091  0.29134945 -0.93352235  0.66253891  0.52211275
 [85]  0.24801631 -0.33293686  0.62126566  1.81737797 -1.53712918 -1.25832300
 [91]  0.12228599  2.54938727 -0.68292830  0.67174852  0.92206286  0.74230816
 [97] -0.93130152  1.23090057 -2.80191922  1.98280259
> 
> colMeans(tmp2)
[1] -0.04182181
> colSums(tmp2)
[1] -4.182181
> colVars(tmp2)
[1] 1.065246
> colSd(tmp2)
[1] 1.032107
> colMax(tmp2)
[1] 3.112976
> colMin(tmp2)
[1] -2.801919
> colMedians(tmp2)
[1] -0.1430666
> colRanges(tmp2)
          [,1]
[1,] -2.801919
[2,]  3.112976
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.9805494  0.4353658  7.6865210 -0.3829532  2.6911583 -1.9315042
 [7] -1.9173107  1.7064543 -2.1263243  1.7778978
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -2.40475469
[2,] -0.77264484
[3,]  0.08039998
[4,]  0.58766789
[5,]  1.75134267
> 
> rowApply(tmp,sum)
 [1] -1.54788732 -2.41030913 -0.06026317  1.99049770  4.20782801 -3.35282091
 [7]  0.19925865  4.11379261  0.39633850  3.42232059
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    6    8    3    4    3    6   10    1     8
 [2,]   10    2    2    9    5    1    9    2   10     1
 [3,]    7   10    9   10   10    9    5    8    8     3
 [4,]    5    9    3    4    1    6    2    4    9     9
 [5,]    9    4    5    1    3   10    7    9    7     4
 [6,]    4    1    1    5    7    7   10    5    3     5
 [7,]    1    8    6    8    9    2    1    1    6     7
 [8,]    6    3   10    7    6    4    8    6    4     6
 [9,]    3    7    4    2    8    8    3    3    5     2
[10,]    8    5    7    6    2    5    4    7    2    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.78371004  0.72565429 -0.84304232 -0.48988888 -4.02085042 -1.88376608
 [7]  4.52259848 -0.88859405 -0.04422513  0.85385639 -1.18750857 -1.85527489
[13] -0.22763695 -3.32631905  0.21068261 -0.09422975 -1.94460726 -3.41244083
[19] -4.48210704 -1.48012632
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.18247301
[2,] -0.28323713
[3,] -0.28309335
[4,] -0.08022969
[5,]  0.04532313
> 
> rowApply(tmp,sum)
[1] -8.917645 -3.785079 -5.319884 -6.777322  3.148394
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4   13   12    8    8
[2,]   17   19   17   13    3
[3,]    6    9   10   16   11
[4,]   10   12   18    9    6
[5,]   13   11    1    2   16
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.18247301  0.16331983 -1.0472355 -0.7420996 -0.2515472 -0.3856365
[2,]  0.04532313  1.12497816 -0.2118368 -0.0195202 -0.1563479  0.1791392
[3,] -0.28309335  0.71138260 -0.4547251  0.8223029 -2.4412939 -0.3104906
[4,] -0.28323713 -0.02942797  0.7374585 -0.2507608 -2.3536552 -2.0238088
[5,] -0.08022969 -1.24459833  0.1332966 -0.2998111  1.1819938  0.6570306
          [,7]        [,8]        [,9]      [,10]       [,11]      [,12]
[1,]  1.055937 -0.03871290  0.08921719 -0.7371211 -0.84877319 -1.4259439
[2,] -0.276561 -1.06954867  0.63224446  2.2688121  0.09226225  0.1537140
[3,]  1.234174  2.08722999 -1.56822092 -0.7405212 -0.75665521 -0.2511566
[4,]  1.248913 -0.08947919  1.40871033 -1.1448677 -0.18810514 -0.1445704
[5,]  1.260136 -1.77808328 -0.60617618  1.2075542  0.51376272 -0.1873181
          [,13]      [,14]      [,15]       [,16]      [,17]        [,18]
[1,] -0.9000239 -1.3013156 -1.0726285  1.10890215 -1.4189965  0.064046038
[2,]  0.5576970 -1.0595225 -0.6244596 -1.48157227 -0.7633704 -1.961876628
[3,] -0.2829734 -0.5021709 -0.9765073  0.27208069 -0.8093389 -0.567811790
[4,] -1.1146670  1.0721995  1.7226172  0.04929757  0.6055251 -0.945132359
[5,]  1.5123303 -1.5355095  1.1616608 -0.04293789  0.4415734 -0.001666095
          [,19]      [,20]
[1,] -0.7655592  0.7189996
[2,] -0.1755984 -1.0390348
[3,]  0.1321132 -0.6342082
[4,] -2.8649049 -2.1894265
[5,] -0.8081577  1.6635436
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  625  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  541  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2      col3     col4     col5      col6      col7
row1 0.1496145 1.029281 0.3216949 0.218197 2.374122 0.2006049 -2.172151
          col8      col9     col10    col11     col12       col13    col14
row1 0.4944888 -1.583619 -1.078555 1.124241 0.7629744 -0.06456712 1.277911
          col15      col16      col17    col18    col19      col20
row1 -0.6072915 -0.5924559 -0.6363366 1.857558 1.742723 -0.5378218
> tmp[,"col10"]
          col10
row1 -1.0785553
row2 -0.2405146
row3  0.9108251
row4 -0.6423363
row5  0.4728519
> tmp[c("row1","row5"),]
           col1        col2      col3      col4     col5       col6       col7
row1  0.1496145  1.02928094 0.3216949 0.2181970 2.374122  0.2006049 -2.1721512
row5 -0.3346903 -0.06624449 0.3060129 0.3930427 1.017316 -0.4588076 -0.3959901
          col8      col9      col10     col11      col12       col13
row1 0.4944888 -1.583619 -1.0785553  1.124241  0.7629744 -0.06456712
row5 0.4085723  1.002164  0.4728519 -1.227800 -0.5966612 -0.58870350
           col14      col15      col16       col17     col18      col19
row1  1.27791069 -0.6072915 -0.5924559 -0.63633658 1.8575581  1.7427230
row5 -0.09600222 -1.3094098 -0.3761264  0.06643017 0.7112496 -0.1165628
          col20
row1 -0.5378218
row5  0.6078347
> tmp[,c("col6","col20")]
           col6      col20
row1  0.2006049 -0.5378218
row2  0.6391375 -1.0838558
row3 -0.1550318 -0.1535668
row4 -0.3847510  0.9210371
row5 -0.4588076  0.6078347
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.2006049 -0.5378218
row5 -0.4588076  0.6078347
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.96657 50.15792 49.55109 50.16242 51.04503 105.7308 49.89277 49.77956
        col9    col10    col11    col12    col13    col14    col15    col16
row1 51.3235 51.54323 51.37521 50.91943 50.35116 48.86473 51.10933 50.22962
        col17    col18    col19    col20
row1 49.38842 49.26667 50.15636 105.3817
> tmp[,"col10"]
        col10
row1 51.54323
row2 31.10677
row3 28.96854
row4 28.16448
row5 48.99213
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.96657 50.15792 49.55109 50.16242 51.04503 105.7308 49.89277 49.77956
row5 49.63913 50.10073 49.38636 51.37124 49.51380 104.2074 49.24194 51.40941
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.32350 51.54323 51.37521 50.91943 50.35116 48.86473 51.10933 50.22962
row5 49.38989 48.99213 51.11032 51.29785 49.60006 49.63678 51.11207 50.47554
        col17    col18    col19    col20
row1 49.38842 49.26667 50.15636 105.3817
row5 48.34404 50.25956 49.40351 103.9040
> tmp[,c("col6","col20")]
          col6     col20
row1 105.73078 105.38166
row2  75.84100  74.82188
row3  75.80440  73.98570
row4  76.89119  73.40104
row5 104.20741 103.90397
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7308 105.3817
row5 104.2074 103.9040
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7308 105.3817
row5 104.2074 103.9040
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.5765550
[2,]  0.8127357
[3,] -0.5412797
[4,] -0.2613019
[5,] -0.6675983
> tmp[,c("col17","col7")]
           col17      col7
[1,] -0.36810197 0.5034628
[2,] -1.77902877 1.6863377
[3,] -1.28735514 0.1320823
[4,]  0.02064328 0.7396808
[5,]  1.64632814 0.1146010
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6        col20
[1,] -0.5087269  0.001683495
[2,]  0.1501184 -1.236607198
[3,] -0.4428585 -1.173789766
[4,]  0.6405833 -1.379345509
[5,]  0.2528411 -0.974872118
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5087269
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5087269
[2,]  0.1501184
> 
> 
> 
> 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 -1.630552 -0.1281606 -0.1099228 -1.715138  0.1816991 0.3272493 0.2611674
row1  1.568788 -0.5891923  0.7832159 -1.328117 -0.1672002 0.1016309 0.1458440
           [,8]        [,9]     [,10]      [,11]      [,12]     [,13]
row3  0.7936203  1.40007493 -0.193199  0.7091259  0.4830611 -1.033595
row1 -0.6415585 -0.06715261  1.761571 -0.8250440 -0.2697986  1.581393
          [,14]      [,15]    [,16]      [,17]      [,18]      [,19]    [,20]
row3 0.38928523 -0.3189055 0.226018 -0.2793789 -0.2905949  0.3888795 1.305105
row1 0.02866406  0.2936973 0.668718  0.2101376  2.2671581 -1.0329236 0.249102
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
        [,1]      [,2]     [,3]     [,4]      [,5]      [,6]      [,7]
row2 1.56213 -1.107036 1.791967 0.605019 0.4295307 0.3933665 0.5685645
          [,8]      [,9]      [,10]
row2 -1.945188 0.2750221 -0.5631887
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]      [,3]       [,4]      [,5]      [,6]      [,7]
row5 1.093281 0.6441113 -1.551872 -0.3785434 -1.794466 0.8684151 -1.143244
         [,8]      [,9]     [,10]     [,11]      [,12]      [,13]    [,14]
row5 2.300471 0.4728379 -0.896909 0.1213821 -0.1695352 -0.9479821 1.867354
         [,15]    [,16]    [,17]     [,18]     [,19]    [,20]
row5 0.5909493 1.233422 1.457519 0.5507602 -0.419031 1.190592
> 
> 
> 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: 0x000001d23d6ffcb0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac779add5" 
 [2] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac12402f59"
 [3] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac19ec11cb"
 [4] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac4bd91f61"
 [5] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac2ba1e85" 
 [6] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac3a5d36fb"
 [7] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac7a02d5e" 
 [8] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac738e3f74"
 [9] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac725621"  
[10] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac64dc4808"
[11] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac7758781b"
[12] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac3e2c759d"
[13] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac4a4a5374"
[14] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac79d97ab2"
[15] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM60ac2eff74bf"
> 
> 
> ### 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: 0x000001d2403ffb90>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001d2403ffb90>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.19-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001d2403ffb90>
> rowMedians(tmp)
  [1]  0.515245462  0.210621687 -0.298887993 -0.200707814  0.126809025
  [6] -0.375414595  0.595648062  0.244191949  0.282829381  0.763303059
 [11] -0.167233612  0.119854024 -0.022991928 -0.057961777  0.055721104
 [16]  0.048021315  0.219816974 -0.027944328  0.082056565 -0.111460693
 [21] -0.112507861 -0.007373959 -0.460833707 -0.566789694 -0.408231849
 [26]  0.672456515  0.346193889 -0.160138357  0.020130509  0.009723136
 [31] -0.113632266 -0.031390374  0.143166731 -0.193371545  0.132600177
 [36] -0.173167511  0.080601366 -0.053054194 -0.005529931  0.042438283
 [41] -0.431126963 -0.347218485  0.403395901  0.589759713  0.328220973
 [46]  0.165269244 -0.492379631  0.306027750  0.120130220  0.148058024
 [51] -0.871204928 -0.202944060  0.234277135  0.271412409  0.333054111
 [56] -0.373932313  0.116883773 -0.206036879  0.159421532  0.065372945
 [61]  0.019952307 -0.298901637  0.134217430  0.065335075 -0.653333030
 [66]  0.692564058 -0.183812516  0.061117621 -0.313198971  0.248246819
 [71] -0.342859703  0.542543159  0.299990416 -0.092896862  0.058179430
 [76]  0.191295148  0.190991200 -0.059975540 -0.104544859  0.531712439
 [81]  0.199586545 -0.190258788  0.085541341 -0.085100443 -0.010219371
 [86] -0.127029284  0.310545361  0.945812327  0.327460778 -0.265322062
 [91]  0.205338696 -0.446189542  0.105908573 -0.091472976 -0.149040323
 [96] -0.351565261  0.140633904  0.164299146 -0.203445793 -0.329969964
[101]  0.257568799 -0.381475209  0.430769295  0.376031662 -0.267116514
[106]  0.277066030  0.171460641  0.152174583  0.005686763 -0.520216253
[111] -0.284308336  0.028404225 -0.379460820  0.220975699 -0.416524925
[116]  0.060090098 -0.438004113  0.132068219  0.250215441  0.210141418
[121]  0.291640727 -0.022776930 -0.717772122  0.105956082 -0.159378621
[126] -0.059611652  0.263345950 -0.028363430  0.540006172 -0.369742262
[131]  0.345184157 -0.220254676  0.463688789  0.163984726 -0.515189175
[136]  0.051387067  0.296447036  0.332642539 -0.048011394 -0.255244472
[141] -0.064677089  0.005987792  0.051476068  0.029793570 -0.459304961
[146]  0.007086811  0.431411700 -0.056520409 -0.130895111 -0.094132805
[151]  0.514274174  0.478063381  0.393487897 -0.299921109 -0.405486378
[156]  0.754380291 -0.406907969  0.581411335  0.312636699 -0.202620825
[161] -0.623671238 -0.162596852 -0.223910616 -0.132038468  0.437292049
[166]  0.209213618  0.614885135  0.098071594 -0.225916737 -0.078871600
[171] -0.385946032 -0.238202591  0.241806176 -0.076156613  0.148910271
[176]  0.079325254 -0.350583373  0.132872274 -0.255865815 -0.394931072
[181] -0.279508083 -0.010556785 -0.314816101  0.042147852 -0.340661875
[186]  0.288446736 -0.404181577 -0.130597341 -0.213848165  0.193433915
[191]  0.177368280 -0.556495739  0.241994471  0.106254254  0.244579135
[196] -0.197292656  0.542925152 -0.255404694 -0.265690828 -0.199222211
[201] -0.029969637  0.182753675  0.601992135  0.396015014 -0.452521897
[206]  0.029441004 -0.208311932 -0.250152714 -0.419130511  0.165842149
[211]  0.244431521  0.058571249 -0.104608426  0.013755378 -0.118372723
[216] -0.257484852 -0.404612953  0.318215881 -0.435590025 -0.330542822
[221] -0.084297041 -0.029154002 -0.097246006  0.664191444 -0.247192405
[226]  0.258511377 -0.117323915  0.070668579 -0.062495868 -0.026200258
> 
> proc.time()
   user  system elapsed 
   3.59   15.90   35.17 

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: 0x000001bbd44fd830>
> .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: 0x000001bbd44fd830>
> .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: 0x000001bbd44fd830>
> .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: 0x000001bbd44fd830>
> 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: 0x000001bbd44fd950>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001bbd44fd950>
> .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: 0x000001bbd44fd950>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001bbd44fd950>
> .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: 0x000001bbd44fd950>
> 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: 0x000001bbd44fdb90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001bbd44fdb90>
> .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: 0x000001bbd44fdb90>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001bbd44fdb90>
> .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: 0x000001bbd44fdb90>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000001bbd44fdb90>
> .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: 0x000001bbd44fdb90>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000001bbd44fdb90>
> .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: 0x000001bbd44fdb90>
> 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: 0x000001bbd44fd170>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000001bbd44fd170>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001bbd44fd170>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001bbd44fd170>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile521874a8219d" "BufferedMatrixFile5218c14643"  
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile521874a8219d" "BufferedMatrixFile5218c14643"  
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001bbd44fd290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001bbd44fd290>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001bbd44fd290>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001bbd44fd290>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000001bbd44fd290>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000001bbd44fd290>
> .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: 0x000001bbd44fd770>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001bbd44fd770>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001bbd44fd770>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000001bbd44fd770>
> 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: 0x000001bbd387ab30>
> .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: 0x000001bbd387ab30>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.35    0.18    2.04 

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.32    0.09    0.39 

Example timings