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

This page was generated on 2024-08-15 11:41 -0400 (Thu, 15 Aug 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4703
palomino8Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4440
lconwaymacOS 12.7.1 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4472
kjohnson3macOS 13.6.5 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4420
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.4.1 (2024-06-14) -- "Race for Your Life" 4413
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/2255HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-08-14 14:00 -0400 (Wed, 14 Aug 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: d422a05
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo2Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.6.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on palomino8

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

raw results


Summary

Package: BufferedMatrix
Version: 1.69.0
Command: F:\biocbuild\bbs-3.20-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.20-bioc\R\library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz
StartedAt: 2024-08-14 22:51:37 -0400 (Wed, 14 Aug 2024)
EndedAt: 2024-08-14 22:54:18 -0400 (Wed, 14 Aug 2024)
EllapsedTime: 161.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'F:/biocbuild/bbs-3.20-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.69.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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'F:/biocbuild/bbs-3.20-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.20-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.20-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.20-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.20-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.20-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.20-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.35    0.31    1.34 

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.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 468463 25.1    1021760 54.6   633411 33.9
Vcells 853871  6.6    8388608 64.0  2003095 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 Aug 14 22:52:11 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 Aug 14 22:52:13 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: 0x000002cf124ff8f0>
> 
> 
> 
> 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 Aug 14 22:52:45 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 Aug 14 22:52:56 2024"
> 
> ColMode(tmp2)
<pointer: 0x000002cf124ff8f0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]       [,4]
[1,] 99.6144646  3.0014403  0.1870207  0.9384668
[2,]  1.3204737 -2.0481167 -0.3310702  1.2748685
[3,] -0.3416812  1.5520175  1.2694945 -0.6554801
[4,]  1.2389287  0.1190015  0.3978675  0.6652192
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.6144646 3.0014403 0.1870207 0.9384668
[2,]  1.3204737 2.0481167 0.3310702 1.2748685
[3,]  0.3416812 1.5520175 1.2694945 0.6554801
[4,]  1.2389287 0.1190015 0.3978675 0.6652192
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
         [,1]     [,2]      [,3]      [,4]
[1,] 9.980705 1.732467 0.4324589 0.9687450
[2,] 1.149119 1.431124 0.5753870 1.1291007
[3,] 0.584535 1.245800 1.1267185 0.8096173
[4,] 1.113072 0.344966 0.6307674 0.8156097
> 
> 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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.42151 45.32611 29.51161 35.62592
[2,]  37.81166 41.35936 31.08494 37.56588
[3,]  31.18703 39.01002 37.53668 33.75165
[4,]  37.36965 28.56866 31.70554 33.82132
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000002cf124ffa10>
> exp(tmp5)
<pointer: 0x000002cf124ffa10>
> log(tmp5,2)
<pointer: 0x000002cf124ffa10>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.104
> Min(tmp5)
[1] 53.27808
> mean(tmp5)
[1] 73.65157
> Sum(tmp5)
[1] 14730.31
> Var(tmp5)
[1] 863.4754
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.41901 71.06020 74.23962 72.30170 69.33065 72.55288 70.37917 73.42348
 [9] 72.20571 68.60323
> rowSums(tmp5)
 [1] 1848.380 1421.204 1484.792 1446.034 1386.613 1451.058 1407.583 1468.470
 [9] 1444.114 1372.065
> rowVars(tmp5)
 [1] 7862.16209   65.39750   97.81625   59.36969   32.65071  105.76874
 [7]  128.10533   91.68468   89.30087   70.12942
> rowSd(tmp5)
 [1] 88.668834  8.086872  9.890210  7.705173  5.714080 10.284393 11.318362
 [8]  9.575212  9.449914  8.374331
> rowMax(tmp5)
 [1] 467.10397  86.33656  90.61629  91.00232  79.58999  89.33192  91.27256
 [8]  90.27378  88.55183  84.69909
> rowMin(tmp5)
 [1] 56.99484 61.07557 56.94369 59.17122 55.11731 53.87727 53.82002 55.07683
 [9] 53.27808 55.41406
> 
> colMeans(tmp5)
 [1] 111.98587  73.15001  69.38056  70.93075  69.77342  70.31447  71.14466
 [8]  72.42316  75.20264  74.12828  71.95502  72.27001  67.97824  70.88337
[15]  71.38981  68.11567  73.27517  72.67218  72.47361  73.58443
> colSums(tmp5)
 [1] 1119.8587  731.5001  693.8056  709.3075  697.7342  703.1447  711.4466
 [8]  724.2316  752.0264  741.2828  719.5502  722.7001  679.7824  708.8337
[15]  713.8981  681.1567  732.7517  726.7218  724.7361  735.8443
> colVars(tmp5)
 [1] 15615.27286   194.90361    37.92177    97.41307    57.54830    99.27365
 [7]    82.17952    41.25711    54.20897    19.87117    98.34915    86.93198
[13]    63.59959   131.76373    85.57348    70.62451   118.63102   201.71734
[19]    52.69105    88.32604
> colSd(tmp5)
 [1] 124.961085  13.960788   6.158065   9.869806   7.586060   9.963616
 [7]   9.065292   6.423170   7.362674   4.457710   9.917114   9.323732
[13]   7.974935  11.478838   9.250594   8.403839  10.891787  14.202723
[19]   7.258860   9.398193
> colMax(tmp5)
 [1] 467.10397  94.34035  78.12768  83.27584  82.53619  82.22571  83.55414
 [8]  83.35733  87.69423  79.58999  91.27256  91.00232  80.29358  90.12611
[15]  86.33656  84.39956  90.27378  90.61629  84.27697  86.75665
> colMin(tmp5)
 [1] 59.80413 55.07683 61.42455 55.11731 57.61658 53.27808 58.87079 63.29021
 [9] 62.28398 66.44260 56.23874 56.94369 56.99484 53.82002 61.86835 57.95206
[17] 61.84811 54.68088 62.83565 61.13318
> 
> 
> ### 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] 92.41901       NA 74.23962 72.30170 69.33065 72.55288 70.37917 73.42348
 [9] 72.20571 68.60323
> rowSums(tmp5)
 [1] 1848.380       NA 1484.792 1446.034 1386.613 1451.058 1407.583 1468.470
 [9] 1444.114 1372.065
> rowVars(tmp5)
 [1] 7862.16209   63.20071   97.81625   59.36969   32.65071  105.76874
 [7]  128.10533   91.68468   89.30087   70.12942
> rowSd(tmp5)
 [1] 88.668834  7.949887  9.890210  7.705173  5.714080 10.284393 11.318362
 [8]  9.575212  9.449914  8.374331
> rowMax(tmp5)
 [1] 467.10397        NA  90.61629  91.00232  79.58999  89.33192  91.27256
 [8]  90.27378  88.55183  84.69909
> rowMin(tmp5)
 [1] 56.99484       NA 56.94369 59.17122 55.11731 53.87727 53.82002 55.07683
 [9] 53.27808 55.41406
> 
> colMeans(tmp5)
 [1] 111.98587  73.15001  69.38056  70.93075  69.77342  70.31447  71.14466
 [8]  72.42316  75.20264  74.12828        NA  72.27001  67.97824  70.88337
[15]  71.38981  68.11567  73.27517  72.67218  72.47361  73.58443
> colSums(tmp5)
 [1] 1119.8587  731.5001  693.8056  709.3075  697.7342  703.1447  711.4466
 [8]  724.2316  752.0264  741.2828        NA  722.7001  679.7824  708.8337
[15]  713.8981  681.1567  732.7517  726.7218  724.7361  735.8443
> colVars(tmp5)
 [1] 15615.27286   194.90361    37.92177    97.41307    57.54830    99.27365
 [7]    82.17952    41.25711    54.20897    19.87117          NA    86.93198
[13]    63.59959   131.76373    85.57348    70.62451   118.63102   201.71734
[19]    52.69105    88.32604
> colSd(tmp5)
 [1] 124.961085  13.960788   6.158065   9.869806   7.586060   9.963616
 [7]   9.065292   6.423170   7.362674   4.457710         NA   9.323732
[13]   7.974935  11.478838   9.250594   8.403839  10.891787  14.202723
[19]   7.258860   9.398193
> colMax(tmp5)
 [1] 467.10397  94.34035  78.12768  83.27584  82.53619  82.22571  83.55414
 [8]  83.35733  87.69423  79.58999        NA  91.00232  80.29358  90.12611
[15]  86.33656  84.39956  90.27378  90.61629  84.27697  86.75665
> colMin(tmp5)
 [1] 59.80413 55.07683 61.42455 55.11731 57.61658 53.27808 58.87079 63.29021
 [9] 62.28398 66.44260       NA 56.94369 56.99484 53.82002 61.86835 57.95206
[17] 61.84811 54.68088 62.83565 61.13318
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.104
> Min(tmp5,na.rm=TRUE)
[1] 53.27808
> mean(tmp5,na.rm=TRUE)
[1] 73.71476
> Sum(tmp5,na.rm=TRUE)
[1] 14669.24
> Var(tmp5,na.rm=TRUE)
[1] 867.0336
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.41901 71.58571 74.23962 72.30170 69.33065 72.55288 70.37917 73.42348
 [9] 72.20571 68.60323
> rowSums(tmp5,na.rm=TRUE)
 [1] 1848.380 1360.128 1484.792 1446.034 1386.613 1451.058 1407.583 1468.470
 [9] 1444.114 1372.065
> rowVars(tmp5,na.rm=TRUE)
 [1] 7862.16209   63.20071   97.81625   59.36969   32.65071  105.76874
 [7]  128.10533   91.68468   89.30087   70.12942
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.668834  7.949887  9.890210  7.705173  5.714080 10.284393 11.318362
 [8]  9.575212  9.449914  8.374331
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.10397  86.33656  90.61629  91.00232  79.58999  89.33192  91.27256
 [8]  90.27378  88.55183  84.69909
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.99484 61.84811 56.94369 59.17122 55.11731 53.87727 53.82002 55.07683
 [9] 53.27808 55.41406
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.98587  73.15001  69.38056  70.93075  69.77342  70.31447  71.14466
 [8]  72.42316  75.20264  74.12828  73.16385  72.27001  67.97824  70.88337
[15]  71.38981  68.11567  73.27517  72.67218  72.47361  73.58443
> colSums(tmp5,na.rm=TRUE)
 [1] 1119.8587  731.5001  693.8056  709.3075  697.7342  703.1447  711.4466
 [8]  724.2316  752.0264  741.2828  658.4746  722.7001  679.7824  708.8337
[15]  713.8981  681.1567  732.7517  726.7218  724.7361  735.8443
> colVars(tmp5,na.rm=TRUE)
 [1] 15615.27286   194.90361    37.92177    97.41307    57.54830    99.27365
 [7]    82.17952    41.25711    54.20897    19.87117    94.20358    86.93198
[13]    63.59959   131.76373    85.57348    70.62451   118.63102   201.71734
[19]    52.69105    88.32604
> colSd(tmp5,na.rm=TRUE)
 [1] 124.961085  13.960788   6.158065   9.869806   7.586060   9.963616
 [7]   9.065292   6.423170   7.362674   4.457710   9.705853   9.323732
[13]   7.974935  11.478838   9.250594   8.403839  10.891787  14.202723
[19]   7.258860   9.398193
> colMax(tmp5,na.rm=TRUE)
 [1] 467.10397  94.34035  78.12768  83.27584  82.53619  82.22571  83.55414
 [8]  83.35733  87.69423  79.58999  91.27256  91.00232  80.29358  90.12611
[15]  86.33656  84.39956  90.27378  90.61629  84.27697  86.75665
> colMin(tmp5,na.rm=TRUE)
 [1] 59.80413 55.07683 61.42455 55.11731 57.61658 53.27808 58.87079 63.29021
 [9] 62.28398 66.44260 56.23874 56.94369 56.99484 53.82002 61.86835 57.95206
[17] 61.84811 54.68088 62.83565 61.13318
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.41901      NaN 74.23962 72.30170 69.33065 72.55288 70.37917 73.42348
 [9] 72.20571 68.60323
> rowSums(tmp5,na.rm=TRUE)
 [1] 1848.380    0.000 1484.792 1446.034 1386.613 1451.058 1407.583 1468.470
 [9] 1444.114 1372.065
> rowVars(tmp5,na.rm=TRUE)
 [1] 7862.16209         NA   97.81625   59.36969   32.65071  105.76874
 [7]  128.10533   91.68468   89.30087   70.12942
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.668834        NA  9.890210  7.705173  5.714080 10.284393 11.318362
 [8]  9.575212  9.449914  8.374331
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.10397        NA  90.61629  91.00232  79.58999  89.33192  91.27256
 [8]  90.27378  88.55183  84.69909
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.99484       NA 56.94369 59.17122 55.11731 53.87727 53.82002 55.07683
 [9] 53.27808 55.41406
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.68430  71.71289  69.90071  70.12434  69.97806  68.99100  71.75552
 [8]  73.43793  75.09493  73.85483       NaN  72.36408  67.44364  71.30406
[15]  69.72906  68.06814  74.54485  73.63270  73.48282  74.52220
> colSums(tmp5,na.rm=TRUE)
 [1] 1041.1587  645.4160  629.1064  631.1190  629.8026  620.9190  645.7997
 [8]  660.9414  675.8544  664.6935    0.0000  651.2767  606.9928  641.7365
[15]  627.5615  612.6133  670.9036  662.6943  661.3453  670.6998
> colVars(tmp5,na.rm=TRUE)
 [1] 17413.30032   196.03178    39.61826   102.27383    64.27070    91.97761
 [7]    88.25408    34.82941    60.85459    21.51388          NA    97.69891
[13]    68.33436   146.24313    65.24165    79.42716   115.32407   216.55277
[19]    47.81929    89.47333
> colSd(tmp5,na.rm=TRUE)
 [1] 131.959465  14.001135   6.294304  10.113053   8.016901   9.590496
 [7]   9.394364   5.901645   7.800935   4.638306         NA   9.884276
[13]   8.266460  12.093103   8.077231   8.912192  10.738905  14.715732
[19]   6.915149   9.459034
> colMax(tmp5,na.rm=TRUE)
 [1] 467.10397  94.34035  78.12768  83.27584  82.53619  77.96534  83.55414
 [8]  83.35733  87.69423  79.58999      -Inf  91.00232  80.29358  90.12611
[15]  85.30363  84.39956  90.27378  90.61629  84.27697  86.75665
> colMin(tmp5,na.rm=TRUE)
 [1] 59.80413 55.07683 61.42455 55.11731 57.61658 53.27808 58.87079 67.08512
 [9] 62.28398 66.44260      Inf 56.94369 56.99484 53.82002 61.86835 57.95206
[17] 62.77904 54.68088 62.83565 61.13318
> 
> 
> 
> 
> 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] 306.9430 279.0321 356.9567 123.0352 220.0614 210.7713 349.3557 311.6808
 [9] 376.1124 306.1938
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 306.9430 279.0321 356.9567 123.0352 220.0614 210.7713 349.3557 311.6808
 [9] 376.1124 306.1938
> 
> 
> 
> 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] -1.989520e-13 -5.684342e-14 -5.684342e-14  2.273737e-13  1.136868e-13
 [6] -5.684342e-14 -7.105427e-14 -2.842171e-14 -5.684342e-14  0.000000e+00
[11]  1.136868e-13  0.000000e+00 -5.684342e-14  5.684342e-14 -2.273737e-13
[16] -5.684342e-14  8.526513e-14  2.842171e-14  1.136868e-13  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   13 
3   10 
8   14 
7   15 
9   11 
5   19 
9   20 
7   16 
7   3 
10   19 
5   6 
8   10 
7   13 
4   12 
10   19 
3   11 
8   16 
2   20 
5   18 
10   5 
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.431375
> Min(tmp)
[1] -2.28366
> mean(tmp)
[1] 0.1278625
> Sum(tmp)
[1] 12.78625
> Var(tmp)
[1] 1.111051
> 
> rowMeans(tmp)
[1] 0.1278625
> rowSums(tmp)
[1] 12.78625
> rowVars(tmp)
[1] 1.111051
> rowSd(tmp)
[1] 1.054064
> rowMax(tmp)
[1] 2.431375
> rowMin(tmp)
[1] -2.28366
> 
> colMeans(tmp)
  [1]  0.918048291 -0.005244206 -1.264680627  0.990449446  0.124345754
  [6] -0.598876848  1.671579216 -0.748048176 -0.822628340  2.431374546
 [11] -0.613208080  0.962096599  0.772342493 -0.291442889  0.465953649
 [16]  1.385104638 -0.231559556  0.693557379  0.745749826  1.050113543
 [21] -2.283659565  1.465380902 -2.016947023 -0.262519217 -1.037798165
 [26]  2.034563204  0.384106439 -0.615098222 -0.779773644  0.336442890
 [31]  0.548952613  2.029703139 -0.297936323  1.077127899 -0.423468114
 [36] -1.055239831 -1.849616358  0.577028361 -0.739852380 -0.370540628
 [41] -0.532585278  0.666706067  0.044475620  0.921856563 -0.058140206
 [46]  0.491227215 -0.997730953 -0.398797999 -1.272280748  1.051291710
 [51]  1.984380387  0.547330401 -0.507282157  0.977270011  0.380725025
 [56]  1.262110662  1.057356595 -0.805573142  0.373694794 -0.036463618
 [61] -0.742528728  0.317383130 -0.823413682  0.158088825 -1.522524613
 [66]  1.464008986  0.194614156  1.643398789 -0.420904954 -0.989918627
 [71]  0.454799591  0.977082305  1.029109212 -2.165938678 -1.276260526
 [76]  0.803913006  1.849710338  0.256506385  1.382337544 -0.231555954
 [81]  0.066461645  0.746036489 -1.408728768  0.831115567 -1.456976608
 [86] -0.980905728 -0.397009564  0.117598555  0.432517505  0.014062187
 [91] -1.305810203  1.478218316  1.140112858  0.355430972  0.063451972
 [96]  1.443449728 -2.110838312  0.140909634  2.094645163 -0.340850633
> colSums(tmp)
  [1]  0.918048291 -0.005244206 -1.264680627  0.990449446  0.124345754
  [6] -0.598876848  1.671579216 -0.748048176 -0.822628340  2.431374546
 [11] -0.613208080  0.962096599  0.772342493 -0.291442889  0.465953649
 [16]  1.385104638 -0.231559556  0.693557379  0.745749826  1.050113543
 [21] -2.283659565  1.465380902 -2.016947023 -0.262519217 -1.037798165
 [26]  2.034563204  0.384106439 -0.615098222 -0.779773644  0.336442890
 [31]  0.548952613  2.029703139 -0.297936323  1.077127899 -0.423468114
 [36] -1.055239831 -1.849616358  0.577028361 -0.739852380 -0.370540628
 [41] -0.532585278  0.666706067  0.044475620  0.921856563 -0.058140206
 [46]  0.491227215 -0.997730953 -0.398797999 -1.272280748  1.051291710
 [51]  1.984380387  0.547330401 -0.507282157  0.977270011  0.380725025
 [56]  1.262110662  1.057356595 -0.805573142  0.373694794 -0.036463618
 [61] -0.742528728  0.317383130 -0.823413682  0.158088825 -1.522524613
 [66]  1.464008986  0.194614156  1.643398789 -0.420904954 -0.989918627
 [71]  0.454799591  0.977082305  1.029109212 -2.165938678 -1.276260526
 [76]  0.803913006  1.849710338  0.256506385  1.382337544 -0.231555954
 [81]  0.066461645  0.746036489 -1.408728768  0.831115567 -1.456976608
 [86] -0.980905728 -0.397009564  0.117598555  0.432517505  0.014062187
 [91] -1.305810203  1.478218316  1.140112858  0.355430972  0.063451972
 [96]  1.443449728 -2.110838312  0.140909634  2.094645163 -0.340850633
> 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.918048291 -0.005244206 -1.264680627  0.990449446  0.124345754
  [6] -0.598876848  1.671579216 -0.748048176 -0.822628340  2.431374546
 [11] -0.613208080  0.962096599  0.772342493 -0.291442889  0.465953649
 [16]  1.385104638 -0.231559556  0.693557379  0.745749826  1.050113543
 [21] -2.283659565  1.465380902 -2.016947023 -0.262519217 -1.037798165
 [26]  2.034563204  0.384106439 -0.615098222 -0.779773644  0.336442890
 [31]  0.548952613  2.029703139 -0.297936323  1.077127899 -0.423468114
 [36] -1.055239831 -1.849616358  0.577028361 -0.739852380 -0.370540628
 [41] -0.532585278  0.666706067  0.044475620  0.921856563 -0.058140206
 [46]  0.491227215 -0.997730953 -0.398797999 -1.272280748  1.051291710
 [51]  1.984380387  0.547330401 -0.507282157  0.977270011  0.380725025
 [56]  1.262110662  1.057356595 -0.805573142  0.373694794 -0.036463618
 [61] -0.742528728  0.317383130 -0.823413682  0.158088825 -1.522524613
 [66]  1.464008986  0.194614156  1.643398789 -0.420904954 -0.989918627
 [71]  0.454799591  0.977082305  1.029109212 -2.165938678 -1.276260526
 [76]  0.803913006  1.849710338  0.256506385  1.382337544 -0.231555954
 [81]  0.066461645  0.746036489 -1.408728768  0.831115567 -1.456976608
 [86] -0.980905728 -0.397009564  0.117598555  0.432517505  0.014062187
 [91] -1.305810203  1.478218316  1.140112858  0.355430972  0.063451972
 [96]  1.443449728 -2.110838312  0.140909634  2.094645163 -0.340850633
> colMin(tmp)
  [1]  0.918048291 -0.005244206 -1.264680627  0.990449446  0.124345754
  [6] -0.598876848  1.671579216 -0.748048176 -0.822628340  2.431374546
 [11] -0.613208080  0.962096599  0.772342493 -0.291442889  0.465953649
 [16]  1.385104638 -0.231559556  0.693557379  0.745749826  1.050113543
 [21] -2.283659565  1.465380902 -2.016947023 -0.262519217 -1.037798165
 [26]  2.034563204  0.384106439 -0.615098222 -0.779773644  0.336442890
 [31]  0.548952613  2.029703139 -0.297936323  1.077127899 -0.423468114
 [36] -1.055239831 -1.849616358  0.577028361 -0.739852380 -0.370540628
 [41] -0.532585278  0.666706067  0.044475620  0.921856563 -0.058140206
 [46]  0.491227215 -0.997730953 -0.398797999 -1.272280748  1.051291710
 [51]  1.984380387  0.547330401 -0.507282157  0.977270011  0.380725025
 [56]  1.262110662  1.057356595 -0.805573142  0.373694794 -0.036463618
 [61] -0.742528728  0.317383130 -0.823413682  0.158088825 -1.522524613
 [66]  1.464008986  0.194614156  1.643398789 -0.420904954 -0.989918627
 [71]  0.454799591  0.977082305  1.029109212 -2.165938678 -1.276260526
 [76]  0.803913006  1.849710338  0.256506385  1.382337544 -0.231555954
 [81]  0.066461645  0.746036489 -1.408728768  0.831115567 -1.456976608
 [86] -0.980905728 -0.397009564  0.117598555  0.432517505  0.014062187
 [91] -1.305810203  1.478218316  1.140112858  0.355430972  0.063451972
 [96]  1.443449728 -2.110838312  0.140909634  2.094645163 -0.340850633
> colMedians(tmp)
  [1]  0.918048291 -0.005244206 -1.264680627  0.990449446  0.124345754
  [6] -0.598876848  1.671579216 -0.748048176 -0.822628340  2.431374546
 [11] -0.613208080  0.962096599  0.772342493 -0.291442889  0.465953649
 [16]  1.385104638 -0.231559556  0.693557379  0.745749826  1.050113543
 [21] -2.283659565  1.465380902 -2.016947023 -0.262519217 -1.037798165
 [26]  2.034563204  0.384106439 -0.615098222 -0.779773644  0.336442890
 [31]  0.548952613  2.029703139 -0.297936323  1.077127899 -0.423468114
 [36] -1.055239831 -1.849616358  0.577028361 -0.739852380 -0.370540628
 [41] -0.532585278  0.666706067  0.044475620  0.921856563 -0.058140206
 [46]  0.491227215 -0.997730953 -0.398797999 -1.272280748  1.051291710
 [51]  1.984380387  0.547330401 -0.507282157  0.977270011  0.380725025
 [56]  1.262110662  1.057356595 -0.805573142  0.373694794 -0.036463618
 [61] -0.742528728  0.317383130 -0.823413682  0.158088825 -1.522524613
 [66]  1.464008986  0.194614156  1.643398789 -0.420904954 -0.989918627
 [71]  0.454799591  0.977082305  1.029109212 -2.165938678 -1.276260526
 [76]  0.803913006  1.849710338  0.256506385  1.382337544 -0.231555954
 [81]  0.066461645  0.746036489 -1.408728768  0.831115567 -1.456976608
 [86] -0.980905728 -0.397009564  0.117598555  0.432517505  0.014062187
 [91] -1.305810203  1.478218316  1.140112858  0.355430972  0.063451972
 [96]  1.443449728 -2.110838312  0.140909634  2.094645163 -0.340850633
> colRanges(tmp)
          [,1]         [,2]      [,3]      [,4]      [,5]       [,6]     [,7]
[1,] 0.9180483 -0.005244206 -1.264681 0.9904494 0.1243458 -0.5988768 1.671579
[2,] 0.9180483 -0.005244206 -1.264681 0.9904494 0.1243458 -0.5988768 1.671579
           [,8]       [,9]    [,10]      [,11]     [,12]     [,13]      [,14]
[1,] -0.7480482 -0.8226283 2.431375 -0.6132081 0.9620966 0.7723425 -0.2914429
[2,] -0.7480482 -0.8226283 2.431375 -0.6132081 0.9620966 0.7723425 -0.2914429
         [,15]    [,16]      [,17]     [,18]     [,19]    [,20]    [,21]
[1,] 0.4659536 1.385105 -0.2315596 0.6935574 0.7457498 1.050114 -2.28366
[2,] 0.4659536 1.385105 -0.2315596 0.6935574 0.7457498 1.050114 -2.28366
        [,22]     [,23]      [,24]     [,25]    [,26]     [,27]      [,28]
[1,] 1.465381 -2.016947 -0.2625192 -1.037798 2.034563 0.3841064 -0.6150982
[2,] 1.465381 -2.016947 -0.2625192 -1.037798 2.034563 0.3841064 -0.6150982
          [,29]     [,30]     [,31]    [,32]      [,33]    [,34]      [,35]
[1,] -0.7797736 0.3364429 0.5489526 2.029703 -0.2979363 1.077128 -0.4234681
[2,] -0.7797736 0.3364429 0.5489526 2.029703 -0.2979363 1.077128 -0.4234681
        [,36]     [,37]     [,38]      [,39]      [,40]      [,41]     [,42]
[1,] -1.05524 -1.849616 0.5770284 -0.7398524 -0.3705406 -0.5325853 0.6667061
[2,] -1.05524 -1.849616 0.5770284 -0.7398524 -0.3705406 -0.5325853 0.6667061
          [,43]     [,44]       [,45]     [,46]     [,47]     [,48]     [,49]
[1,] 0.04447562 0.9218566 -0.05814021 0.4912272 -0.997731 -0.398798 -1.272281
[2,] 0.04447562 0.9218566 -0.05814021 0.4912272 -0.997731 -0.398798 -1.272281
        [,50]   [,51]     [,52]      [,53]   [,54]    [,55]    [,56]    [,57]
[1,] 1.051292 1.98438 0.5473304 -0.5072822 0.97727 0.380725 1.262111 1.057357
[2,] 1.051292 1.98438 0.5473304 -0.5072822 0.97727 0.380725 1.262111 1.057357
          [,58]     [,59]       [,60]      [,61]     [,62]      [,63]     [,64]
[1,] -0.8055731 0.3736948 -0.03646362 -0.7425287 0.3173831 -0.8234137 0.1580888
[2,] -0.8055731 0.3736948 -0.03646362 -0.7425287 0.3173831 -0.8234137 0.1580888
         [,65]    [,66]     [,67]    [,68]     [,69]      [,70]     [,71]
[1,] -1.522525 1.464009 0.1946142 1.643399 -0.420905 -0.9899186 0.4547996
[2,] -1.522525 1.464009 0.1946142 1.643399 -0.420905 -0.9899186 0.4547996
         [,72]    [,73]     [,74]     [,75]    [,76]   [,77]     [,78]    [,79]
[1,] 0.9770823 1.029109 -2.165939 -1.276261 0.803913 1.84971 0.2565064 1.382338
[2,] 0.9770823 1.029109 -2.165939 -1.276261 0.803913 1.84971 0.2565064 1.382338
         [,80]      [,81]     [,82]     [,83]     [,84]     [,85]      [,86]
[1,] -0.231556 0.06646165 0.7460365 -1.408729 0.8311156 -1.456977 -0.9809057
[2,] -0.231556 0.06646165 0.7460365 -1.408729 0.8311156 -1.456977 -0.9809057
          [,87]     [,88]     [,89]      [,90]    [,91]    [,92]    [,93]
[1,] -0.3970096 0.1175986 0.4325175 0.01406219 -1.30581 1.478218 1.140113
[2,] -0.3970096 0.1175986 0.4325175 0.01406219 -1.30581 1.478218 1.140113
        [,94]      [,95]   [,96]     [,97]     [,98]    [,99]     [,100]
[1,] 0.355431 0.06345197 1.44345 -2.110838 0.1409096 2.094645 -0.3408506
[2,] 0.355431 0.06345197 1.44345 -2.110838 0.1409096 2.094645 -0.3408506
> 
> 
> Max(tmp2)
[1] 3.160195
> Min(tmp2)
[1] -1.946156
> mean(tmp2)
[1] 0.06928395
> Sum(tmp2)
[1] 6.928395
> Var(tmp2)
[1] 1.052556
> 
> rowMeans(tmp2)
  [1] -1.946156156  1.391927442  1.259158894  0.485754795 -0.658825018
  [6]  0.236771088  0.009075148  0.390670771 -0.385187546 -0.354006990
 [11]  2.078266200 -1.226930432 -0.069628484 -1.578069459  1.460945257
 [16] -1.367950496  0.051919988 -1.137147200 -1.843350052 -0.839997213
 [21]  1.304022812  0.271191230  0.129357500  0.070733970 -0.172191234
 [26] -1.002310651  0.641708481  0.202961112 -0.377207992  0.031560576
 [31]  0.513845268  3.160195216  1.437226490 -1.220273245 -0.732547055
 [36] -1.630597903 -0.501513514  1.702837904  1.115759964  0.668317415
 [41]  0.950109757 -0.149574860  1.890466826  1.063831373 -0.363845027
 [46] -0.531060540 -0.925966343 -0.087407652  0.596472138  0.080487283
 [51] -1.049944002  0.998728341 -0.098135379  0.161804063  0.309329232
 [56]  0.299784559 -1.268975983 -0.796516589 -0.163724119 -0.534913260
 [61]  0.491430665 -0.841426958  0.330588355 -0.766660654 -0.120979449
 [66]  0.739035568 -0.874271089 -0.613109377 -0.435765706  1.705099576
 [71]  0.542235579  1.146855368 -1.463488665  0.338864058 -0.184676779
 [76]  2.816912343  1.875333534  1.004405028  0.841926542 -1.443157060
 [81] -0.506889832 -0.522641302  0.567113217 -1.213090760  0.597316159
 [86]  0.582837578  0.355701307 -1.647491041 -0.030010567 -1.705288582
 [91]  1.459333162  0.994466510  0.291208181  1.436633136 -0.510405522
 [96]  0.045923359  0.125361265  0.007675247 -0.949642591  0.509868185
> rowSums(tmp2)
  [1] -1.946156156  1.391927442  1.259158894  0.485754795 -0.658825018
  [6]  0.236771088  0.009075148  0.390670771 -0.385187546 -0.354006990
 [11]  2.078266200 -1.226930432 -0.069628484 -1.578069459  1.460945257
 [16] -1.367950496  0.051919988 -1.137147200 -1.843350052 -0.839997213
 [21]  1.304022812  0.271191230  0.129357500  0.070733970 -0.172191234
 [26] -1.002310651  0.641708481  0.202961112 -0.377207992  0.031560576
 [31]  0.513845268  3.160195216  1.437226490 -1.220273245 -0.732547055
 [36] -1.630597903 -0.501513514  1.702837904  1.115759964  0.668317415
 [41]  0.950109757 -0.149574860  1.890466826  1.063831373 -0.363845027
 [46] -0.531060540 -0.925966343 -0.087407652  0.596472138  0.080487283
 [51] -1.049944002  0.998728341 -0.098135379  0.161804063  0.309329232
 [56]  0.299784559 -1.268975983 -0.796516589 -0.163724119 -0.534913260
 [61]  0.491430665 -0.841426958  0.330588355 -0.766660654 -0.120979449
 [66]  0.739035568 -0.874271089 -0.613109377 -0.435765706  1.705099576
 [71]  0.542235579  1.146855368 -1.463488665  0.338864058 -0.184676779
 [76]  2.816912343  1.875333534  1.004405028  0.841926542 -1.443157060
 [81] -0.506889832 -0.522641302  0.567113217 -1.213090760  0.597316159
 [86]  0.582837578  0.355701307 -1.647491041 -0.030010567 -1.705288582
 [91]  1.459333162  0.994466510  0.291208181  1.436633136 -0.510405522
 [96]  0.045923359  0.125361265  0.007675247 -0.949642591  0.509868185
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.946156156  1.391927442  1.259158894  0.485754795 -0.658825018
  [6]  0.236771088  0.009075148  0.390670771 -0.385187546 -0.354006990
 [11]  2.078266200 -1.226930432 -0.069628484 -1.578069459  1.460945257
 [16] -1.367950496  0.051919988 -1.137147200 -1.843350052 -0.839997213
 [21]  1.304022812  0.271191230  0.129357500  0.070733970 -0.172191234
 [26] -1.002310651  0.641708481  0.202961112 -0.377207992  0.031560576
 [31]  0.513845268  3.160195216  1.437226490 -1.220273245 -0.732547055
 [36] -1.630597903 -0.501513514  1.702837904  1.115759964  0.668317415
 [41]  0.950109757 -0.149574860  1.890466826  1.063831373 -0.363845027
 [46] -0.531060540 -0.925966343 -0.087407652  0.596472138  0.080487283
 [51] -1.049944002  0.998728341 -0.098135379  0.161804063  0.309329232
 [56]  0.299784559 -1.268975983 -0.796516589 -0.163724119 -0.534913260
 [61]  0.491430665 -0.841426958  0.330588355 -0.766660654 -0.120979449
 [66]  0.739035568 -0.874271089 -0.613109377 -0.435765706  1.705099576
 [71]  0.542235579  1.146855368 -1.463488665  0.338864058 -0.184676779
 [76]  2.816912343  1.875333534  1.004405028  0.841926542 -1.443157060
 [81] -0.506889832 -0.522641302  0.567113217 -1.213090760  0.597316159
 [86]  0.582837578  0.355701307 -1.647491041 -0.030010567 -1.705288582
 [91]  1.459333162  0.994466510  0.291208181  1.436633136 -0.510405522
 [96]  0.045923359  0.125361265  0.007675247 -0.949642591  0.509868185
> rowMin(tmp2)
  [1] -1.946156156  1.391927442  1.259158894  0.485754795 -0.658825018
  [6]  0.236771088  0.009075148  0.390670771 -0.385187546 -0.354006990
 [11]  2.078266200 -1.226930432 -0.069628484 -1.578069459  1.460945257
 [16] -1.367950496  0.051919988 -1.137147200 -1.843350052 -0.839997213
 [21]  1.304022812  0.271191230  0.129357500  0.070733970 -0.172191234
 [26] -1.002310651  0.641708481  0.202961112 -0.377207992  0.031560576
 [31]  0.513845268  3.160195216  1.437226490 -1.220273245 -0.732547055
 [36] -1.630597903 -0.501513514  1.702837904  1.115759964  0.668317415
 [41]  0.950109757 -0.149574860  1.890466826  1.063831373 -0.363845027
 [46] -0.531060540 -0.925966343 -0.087407652  0.596472138  0.080487283
 [51] -1.049944002  0.998728341 -0.098135379  0.161804063  0.309329232
 [56]  0.299784559 -1.268975983 -0.796516589 -0.163724119 -0.534913260
 [61]  0.491430665 -0.841426958  0.330588355 -0.766660654 -0.120979449
 [66]  0.739035568 -0.874271089 -0.613109377 -0.435765706  1.705099576
 [71]  0.542235579  1.146855368 -1.463488665  0.338864058 -0.184676779
 [76]  2.816912343  1.875333534  1.004405028  0.841926542 -1.443157060
 [81] -0.506889832 -0.522641302  0.567113217 -1.213090760  0.597316159
 [86]  0.582837578  0.355701307 -1.647491041 -0.030010567 -1.705288582
 [91]  1.459333162  0.994466510  0.291208181  1.436633136 -0.510405522
 [96]  0.045923359  0.125361265  0.007675247 -0.949642591  0.509868185
> 
> colMeans(tmp2)
[1] 0.06928395
> colSums(tmp2)
[1] 6.928395
> colVars(tmp2)
[1] 1.052556
> colSd(tmp2)
[1] 1.025942
> colMax(tmp2)
[1] 3.160195
> colMin(tmp2)
[1] -1.946156
> colMedians(tmp2)
[1] 0.04892167
> colRanges(tmp2)
          [,1]
[1,] -1.946156
[2,]  3.160195
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.93084357  2.48553881 -3.49400756 -2.68415235  5.39229448  0.77195039
 [7] -7.25237020 -0.06839657  2.39511019  0.07111087
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.96329178
[2,] -0.14796674
[3,]  0.05393971
[4,]  0.74311185
[5,]  1.51420128
> 
> rowApply(tmp,sum)
 [1]  3.7819817 -0.1099937  0.6352221  3.1839220 -0.8548876 -2.6136593
 [7]  4.1103111 -4.2728514 -0.9558064 -3.3563169
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    5    5    9    8    6    9    4    5     3
 [2,]    3   10   10    6    3    5    1    3    4     9
 [3,]    5    6    6    5    4    7    6    6    2     1
 [4,]    9    1    3    3    7    8    2    1    6     5
 [5,]   10    4    9    4   10    4    8    8    7     7
 [6,]    4    7    2    7    1   10    7    2    9    10
 [7,]    1    9    7    2    9    1    3    5    1     4
 [8,]    6    3    4   10    2    3    4    7    3     6
 [9,]    2    8    8    1    6    2   10    9   10     8
[10,]    8    2    1    8    5    9    5   10    8     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.618363989  2.300160788  1.371996002  1.427450963  0.820852570
 [6]  1.124922365  4.175207335 -0.687696767  0.064983349 -5.214241685
[11]  0.003526699  0.965120568 -4.166392041 -1.605534570 -0.624437577
[16] -0.998984572  1.082082565  0.433841169  3.580371429  0.536280774
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.6572911
[2,] -1.2408122
[3,]  0.2723648
[4,]  0.3629013
[5,]  0.6444733
> 
> rowApply(tmp,sum)
[1]  0.3917797  0.3859784 -4.7218204  3.2834234  3.6317843
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13    2    3   13   15
[2,]   14   11    6   19   16
[3,]   18   12    8   16    5
[4,]    5    4   16   15   17
[5,]    8    7   14    4   19
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]        [,5]       [,6]
[1,]  0.2723648  0.3495435  1.0012866 -0.3029965  0.08967606  1.0773515
[2,] -1.2408122  0.4031350  0.4251505 -0.7147756 -0.37049990  0.4947898
[3,] -1.6572911 -0.9891587 -0.6501461  0.8676407  0.43494122 -0.1713153
[4,]  0.3629013  1.8597469  1.1683474  0.8517586 -0.65672084 -0.7966731
[5,]  0.6444733  0.6768941 -0.5726425  0.7258238  1.32345603  0.5207695
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,] 1.10900111 -2.7145622  0.1456347  0.1904353  0.7150241 -0.1774183
[2,] 1.24641684  1.3873477  0.5928911 -2.3218145  0.3451602 -0.1428298
[3,] 0.09056989  1.2639132 -0.6097648 -1.0449692  0.1929003  1.0380281
[4,] 1.55218403 -0.3348035  0.6262382 -0.6340897 -0.5925346 -0.1881769
[5,] 0.17703547 -0.2895920 -0.6900158 -1.4038036 -0.6570232  0.4355175
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  0.1415644 -1.5140706 -0.8867673 -0.2736461  0.7561149 -0.5112233
[2,]  0.5442836 -0.5695051  0.6049842 -1.1633468  0.3720290 -0.6722176
[3,] -2.4409316 -0.6650193 -1.8119578  1.0727456  0.8848922 -0.3108185
[4,] -2.2684259 -0.1795694  2.6181897 -0.2864472 -1.2131127  1.3167913
[5,] -0.1428826  1.3226298 -1.1488863 -0.3482901  0.2821591  0.6113091
          [,19]      [,20]
[1,]  0.7041818  0.2202851
[2,]  0.6150849  0.5505073
[3,]  0.8421796 -1.0582589
[4,] -0.1190184  0.1968382
[5,]  1.5379435  0.6269091
> 
> 
> 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.20-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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  543  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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.145366 0.6763614 0.2152627 1.268439 -0.6597425 0.6355925 -2.120843
           col8     col9     col10     col11       col12      col13    col14
row1 -0.5056222 -1.66994 -1.981056 -1.150869 -0.01821097 -0.3486545 -2.55979
          col15     col16      col17     col18     col19      col20
row1 -0.7063093 -2.265934 -0.3042022 -1.356521 0.5454391 -0.2547687
> tmp[,"col10"]
           col10
row1 -1.98105579
row2 -0.01285233
row3  0.80658728
row4  1.10001813
row5  0.59052941
> tmp[c("row1","row5"),]
           col1      col2       col3        col4       col5       col6
row1  0.1453660 0.6763614  0.2152627  1.26843939 -0.6597425  0.6355925
row5 -0.7648496 0.9483757 -1.8501798 -0.04029684 -0.7616815 -0.3335746
          col7       col8       col9      col10      col11       col12
row1 -2.120843 -0.5056222 -1.6699396 -1.9810558 -1.1508690 -0.01821097
row5 -0.245996  0.5061372 -0.1175964  0.5905294 -0.8624632  0.95870994
          col13     col14      col15      col16      col17     col18     col19
row1 -0.3486545 -2.559790 -0.7063093 -2.2659335 -0.3042022 -1.356521 0.5454391
row5  1.6271362  1.193112 -0.5887328  0.8313982  1.1585171  1.541471 1.5544882
          col20
row1 -0.2547687
row5 -1.6578166
> tmp[,c("col6","col20")]
           col6      col20
row1  0.6355925 -0.2547687
row2 -0.5784424 -0.4111974
row3 -1.4923761 -0.3646743
row4  0.3897216  1.9939181
row5 -0.3335746 -1.6578166
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.6355925 -0.2547687
row5 -0.3335746 -1.6578166
> 
> 
> 
> 
> 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 50.42216 49.84952 51.33606 51.40211 50.69643 103.5014 48.61299 50.50808
         col9    col10   col11    col12   col13    col14   col15    col16
row1 50.73474 49.97248 49.4614 50.12623 48.1796 50.19092 50.8014 51.65537
        col17    col18    col19    col20
row1 50.20322 49.79283 51.26712 104.9258
> tmp[,"col10"]
        col10
row1 49.97248
row2 28.38205
row3 30.40901
row4 32.15102
row5 50.55521
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.42216 49.84952 51.33606 51.40211 50.69643 103.5014 48.61299 50.50808
row5 51.10417 50.34787 52.12237 48.25894 49.24972 106.2857 51.25979 49.26351
         col9    col10    col11    col12   col13    col14    col15    col16
row1 50.73474 49.97248 49.46140 50.12623 48.1796 50.19092 50.80140 51.65537
row5 48.78587 50.55521 49.13624 51.17550 49.1438 49.39463 50.54454 49.36557
        col17    col18    col19    col20
row1 50.20322 49.79283 51.26712 104.9258
row5 49.27848 50.89474 50.05032 103.9426
> tmp[,c("col6","col20")]
          col6     col20
row1 103.50145 104.92582
row2  74.64838  75.12592
row3  76.14541  75.20265
row4  73.82457  73.69745
row5 106.28574 103.94260
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 103.5014 104.9258
row5 106.2857 103.9426
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 103.5014 104.9258
row5 106.2857 103.9426
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.58768907
[2,] -0.24227057
[3,] -0.04286161
[4,]  1.37403514
[5,] -1.69408899
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.9978858 -2.0614408
[2,]  1.0842517  0.3257688
[3,] -0.4080783 -0.6593050
[4,]  0.1150028 -0.8133824
[5,] -1.1365252 -0.6602829
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.08198092 -0.5814605
[2,]  0.09270301  0.4465646
[3,]  2.11308760  0.5921889
[4,] -1.68326494  0.1769130
[5,] -0.65038070  0.6892237
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.08198092
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.08198092
[2,]  0.09270301
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]      [,5]       [,6]
row3 0.02112387 -0.8297453  1.2939416 -1.4122096 0.4793997 -0.5307283
row1 0.10820556  0.2099913 -0.2736278  0.1894607 0.9987710 -0.2667696
           [,7]      [,8]      [,9]      [,10]      [,11]       [,12]
row3  0.8554466  2.855675  1.322328  1.2526667  1.0578177 0.418795487
row1 -2.4176700 -1.142707 -1.048634 -0.1096922 -0.4839359 0.004188126
          [,13]      [,14]      [,15]    [,16]      [,17]     [,18]       [,19]
row3  0.4254559  0.8922340 -1.5566383 1.609051  0.9985107  1.012354  1.90756381
row1 -0.3191350 -0.2729061 -0.3685037 1.576807 -2.0291798 -1.668908 -0.03602221
          [,20]
row3 -0.1276938
row1 -0.6824479
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]        [,3]       [,4]      [,5]       [,6]       [,7]
row2 -0.9634559 -1.46776 -0.09624913 -0.4176308 0.3653287 -0.1111401 -0.8134864
           [,8]       [,9]     [,10]
row2 -0.2730029 -0.3903885 0.2642643
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]     [,3]       [,4]      [,5]      [,6]     [,7]
row5 -0.1752693 0.8290126 0.708299 -0.6335955 0.9002308 0.1497179 1.487922
         [,8]      [,9]       [,10]     [,11]     [,12]      [,13]     [,14]
row5 1.686969 -1.103056 -0.04350857 0.1193001 0.5906333 -0.5683044 0.1127107
        [,15]    [,16]     [,17]      [,18]      [,19]       [,20]
row5 1.763402 1.754807 0.2759802 -0.4612566 -0.3391462 -0.00628025
> 
> 
> 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: 0x000002cf124ff110>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM374041f95485"
 [2] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3740f2a7e92" 
 [3] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM37402fbf45b6"
 [4] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM374050493059"
 [5] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3740213e2a02"
 [6] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3740114a5ae9"
 [7] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3740331a310c"
 [8] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM374072914f22"
 [9] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM37401c8377d7"
[10] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3740156935"  
[11] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM37403eb66a35"
[12] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM374047a610b7"
[13] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM37404dc65882"
[14] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3740128935f5"
[15] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3740769c1591"
> 
> 
> ### 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: 0x000002cf151ffb30>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000002cf151ffb30>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.20-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000002cf151ffb30>
> rowMedians(tmp)
  [1]  0.336069331 -0.290181076 -0.104930498 -0.278894171 -0.275163227
  [6]  0.523896256  0.094572632  0.129929894 -0.003445909  0.298567434
 [11]  0.258672662  0.147740152 -0.034066125  0.368099036 -0.484769502
 [16] -0.176331089  0.384621370 -0.091195136 -0.097499657  0.142052953
 [21] -0.667582238 -0.717127796 -0.038415039  0.661103127 -0.010507586
 [26] -0.060564835  0.035313532 -0.696587650  0.387513067 -0.269368059
 [31]  0.310513440 -0.301583378  0.040441920 -0.230810630 -0.480401525
 [36]  0.142696304 -0.556584262  0.162128712  0.488304734 -0.394986553
 [41]  0.036116594  0.090741409  0.130950175  0.308513744 -0.031141549
 [46]  0.452432345  0.102849527 -0.117812705  0.359736565 -0.311428845
 [51]  0.326388545 -0.413631997  0.249640695  0.108135677 -0.302541137
 [56]  0.549277461 -0.078216582 -0.510134943 -0.413791627  0.265437166
 [61] -0.521063268  0.270700892 -0.014165881  0.244954923 -0.065041417
 [66] -0.246983398  0.381163335  0.134070334  0.521394424  0.013770342
 [71]  0.068225000 -0.104774938 -0.181036202 -0.414091349  0.262984098
 [76]  0.350793708  0.123069038 -0.337178569 -0.140945974 -0.016523662
 [81] -0.235230975  0.259072115 -0.544152173 -0.105074415 -0.187030490
 [86]  0.224341478 -0.444185349  0.198083261 -0.570774898  0.281794405
 [91]  0.397015573 -0.456167054 -0.885494263  0.064912137 -0.835599217
 [96] -0.210205416  0.096293330 -0.075867715  0.104749103 -0.881188417
[101]  0.343029577  0.202099692 -0.508289593 -0.307656346  0.565584491
[106] -0.199678618  0.431110828  0.120992407 -0.082389928 -0.191457725
[111]  0.137023809 -0.231527039  0.557845558 -0.110864478  0.124108584
[116]  0.303274568 -0.258857338  0.023723783 -0.205006961  0.023834034
[121] -0.130817196  0.523035870  0.048895610  0.219302896 -0.630547242
[126] -0.407479731 -0.315364883 -0.182471094  0.050573371 -0.229847379
[131]  0.029136955  0.015670887 -0.147084532 -0.290271413  0.641568134
[136] -0.352030592 -0.008070950 -0.290683211 -0.240942064  0.467731284
[141] -0.111005459  0.082521623 -0.266859638 -0.385492486 -0.033595057
[146] -0.655448641 -0.001433192 -0.087878340  0.236103611  0.343450395
[151]  0.130962698  0.454556997  0.117630815 -0.244065813 -0.687117218
[156] -0.015214338 -0.636352748  0.088982426 -0.710548657 -0.267445887
[161] -0.332806077 -0.181847059  0.183821682  0.191154494 -0.403151693
[166] -0.278738092 -0.219477740  0.278182277 -0.123611258 -0.750469816
[171] -0.352176089  0.138765097  0.235101346 -0.275745799 -0.150513034
[176] -0.307932809 -0.300321937 -0.071778056 -0.403753028  0.463874856
[181] -0.122694398  0.166373146 -0.269931079 -0.472535763 -0.046958065
[186]  0.015234955 -0.328860415  0.166317168 -0.353726126  0.568481225
[191]  0.018444307 -0.020297463 -0.317531190 -0.307595727  0.464032959
[196] -0.090110346  0.073361635 -0.472396790 -0.072823775 -0.225829865
[201] -0.157511061  0.152006712  0.103265893 -0.158405627  0.012058509
[206] -0.666016470  0.152235668  0.242242648  0.188955369 -0.451118664
[211] -0.130371476  0.106565696 -0.365992956 -0.242511151 -0.178594269
[216]  0.006595958 -0.173402150 -0.110303421  0.013738533 -0.583587349
[221] -0.129694120 -0.109389387  0.007071794  0.189569072  0.453597803
[226]  0.200338909  0.285615967  0.351364492 -0.098877648 -0.125741058
> 
> proc.time()
   user  system elapsed 
   4.37   26.01  122.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: 0x000002cb0b0f9710>
> .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: 0x000002cb0b0f9710>
> .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: 0x000002cb0b0f9710>
> .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: 0x000002cb0b0f9710>
> 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: 0x000002cb0b0f98f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002cb0b0f98f0>
> .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: 0x000002cb0b0f98f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002cb0b0f98f0>
> .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: 0x000002cb0b0f98f0>
> 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: 0x000002cb0b0f92f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002cb0b0f92f0>
> .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: 0x000002cb0b0f92f0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002cb0b0f92f0>
> .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: 0x000002cb0b0f92f0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000002cb0b0f92f0>
> .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: 0x000002cb0b0f92f0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000002cb0b0f92f0>
> .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: 0x000002cb0b0f92f0>
> 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: 0x000002cb0b0f9470>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000002cb0b0f9470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002cb0b0f9470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002cb0b0f9470>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1068142b3cd3" "BufferedMatrixFile10687ed52dc2"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1068142b3cd3" "BufferedMatrixFile10687ed52dc2"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002cb0b0f9890>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002cb0b0f9890>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002cb0b0f9890>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002cb0b0f9890>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000002cb0b0f9890>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000002cb0b0f9890>
> .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: 0x000002cb0b0f9050>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002cb0b0f9050>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002cb0b0f9050>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000002cb0b0f9050>
> 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: 0x000002cb0b0f9a70>
> .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: 0x000002cb0b0f9a70>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.29    0.17    0.96 

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

Example timings