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

This page was generated on 2024-07-13 11:39 -0400 (Sat, 13 Jul 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4677
palomino6Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4416
lconwaymacOS 12.7.1 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4444
kjohnson3macOS 13.6.5 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4393
palomino8Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4373
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 246/2243HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-07-12 14:00 -0400 (Fri, 12 Jul 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
palomino6Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  
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
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  


CHECK results for BufferedMatrix on palomino6

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: C:\Users\biocbuild\bbs-3.20-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=C:\Users\biocbuild\bbs-3.20-bioc\R\library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz
StartedAt: 2024-07-12 22:21:39 -0400 (Fri, 12 Jul 2024)
EndedAt: 2024-07-12 22:22:35 -0400 (Fri, 12 Jul 2024)
EllapsedTime: 55.8 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'C:/Users/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"C:/Users/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"C:/Users/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"C:/Users/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"C:/Users/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 -LC:/Users/biocbuild/bbs-3.20-bioc/R/bin/x64 -lR
installing to C:/Users/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.28    0.07    0.54 

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] "C:/Users/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 468464 25.1    1021772 54.6   633391 33.9
Vcells 853911  6.6    8388608 64.0  2003323 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] "Fri Jul 12 22:22:00 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] "Fri Jul 12 22:22:00 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: 0x000001c675767a10>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Jul 12 22:22:06 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Jul 12 22:22:09 2024"
> 
> ColMode(tmp2)
<pointer: 0x000001c675767a10>
> 
> 
> 
> ### 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,] 101.7985549  0.43450965 1.0257258 -0.5719922
[2,]   0.6513481 -0.34661411 0.7916667  0.2658728
[3,]  -0.7297492  0.08420910 0.1510774 -0.7169550
[4,]  -0.0324837  0.03576865 1.9435987  1.2049589
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]      [,4]
[1,] 101.7985549 0.43450965 1.0257258 0.5719922
[2,]   0.6513481 0.34661411 0.7916667 0.2658728
[3,]   0.7297492 0.08420910 0.1510774 0.7169550
[4,]   0.0324837 0.03576865 1.9435987 1.2049589
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0895270 0.6591735 1.0127812 0.7563016
[2,]  0.8070614 0.5887394 0.8897565 0.5156285
[3,]  0.8542536 0.2901880 0.3886868 0.8467320
[4,]  0.1802324 0.1891260 1.3941301 1.0977062
> 
> 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:    C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 227.69382 32.02624 36.15354 33.13501
[2,]  33.72196 31.23401 34.68923 30.42216
[3,]  34.27229 27.98609 29.03795 34.18427
[4,]  26.83481 26.92703 40.88490 37.18202
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001c6776ff470>
> exp(tmp5)
<pointer: 0x000001c6776ff470>
> log(tmp5,2)
<pointer: 0x000001c6776ff470>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 473.9149
> Min(tmp5)
[1] 54.59404
> mean(tmp5)
[1] 72.08928
> Sum(tmp5)
[1] 14417.86
> Var(tmp5)
[1] 886.8877
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.52613 68.72637 69.79263 70.11068 68.91701 67.52210 69.72265 70.22426
 [9] 71.68665 71.66434
> rowSums(tmp5)
 [1] 1850.523 1374.527 1395.853 1402.214 1378.340 1350.442 1394.453 1404.485
 [9] 1433.733 1433.287
> rowVars(tmp5)
 [1] 8136.23338   33.66853  101.58372   97.12410   87.10995   82.87737
 [7]   53.49346   39.91153   70.88302   82.40436
> rowSd(tmp5)
 [1] 90.201072  5.802459 10.078875  9.855156  9.333271  9.103701  7.313922
 [8]  6.317557  8.419205  9.077685
> rowMax(tmp5)
 [1] 473.91486  80.01383  86.88258  86.56111  90.03439  90.49119  84.10700
 [8]  81.77137  87.18560  91.25713
> rowMin(tmp5)
 [1] 57.62170 58.83546 54.59404 55.85314 56.22669 55.70033 56.72480 54.77746
 [9] 57.44164 59.21811
> 
> colMeans(tmp5)
 [1] 109.26063  68.00382  70.73275  71.17998  69.73759  68.29018  71.61885
 [8]  76.52292  65.08579  68.81036  76.09493  68.87690  71.33149  70.46394
[15]  69.23210  67.02213  65.18650  71.26549  73.87108  69.19820
> colSums(tmp5)
 [1] 1092.6063  680.0382  707.3275  711.7998  697.3759  682.9018  716.1885
 [8]  765.2292  650.8579  688.1036  760.9493  688.7690  713.3149  704.6394
[15]  692.3210  670.2213  651.8650  712.6549  738.7108  691.9820
> colVars(tmp5)
 [1] 16453.72350    85.74012    54.02461    43.78317    57.25676   101.45858
 [7]    84.75985   113.49920    80.99913    69.82286    77.23359    60.31442
[13]    69.11115    36.21614   127.83243    47.76402    67.18031    33.04180
[19]   116.94610    24.93210
> colSd(tmp5)
 [1] 128.272068   9.259596   7.350144   6.616885   7.566820  10.072665
 [7]   9.206511  10.653600   8.999952   8.356008   8.788264   7.766236
[13]   8.313312   6.017985  11.306300   6.911152   8.196360   5.748200
[19]  10.814162   4.993206
> colMax(tmp5)
 [1] 473.91486  82.90798  85.09656  81.63706  83.06227  86.90533  84.10700
 [8]  91.25713  82.57288  84.08511  86.56111  83.23785  81.82082  77.94304
[15]  90.49119  79.17205  78.38844  82.08219  90.03439  76.89712
> colMin(tmp5)
 [1] 55.85314 56.04508 60.43868 61.67184 59.96396 57.64410 55.70033 58.83546
 [9] 56.17440 59.63668 58.26760 56.10171 56.50760 60.21375 54.77746 59.20183
[17] 54.59404 65.05556 56.72480 59.69143
> 
> 
> ### 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.52613 68.72637 69.79263 70.11068 68.91701 67.52210       NA 70.22426
 [9] 71.68665 71.66434
> rowSums(tmp5)
 [1] 1850.523 1374.527 1395.853 1402.214 1378.340 1350.442       NA 1404.485
 [9] 1433.733 1433.287
> rowVars(tmp5)
 [1] 8136.23338   33.66853  101.58372   97.12410   87.10995   82.87737
 [7]   56.42246   39.91153   70.88302   82.40436
> rowSd(tmp5)
 [1] 90.201072  5.802459 10.078875  9.855156  9.333271  9.103701  7.511489
 [8]  6.317557  8.419205  9.077685
> rowMax(tmp5)
 [1] 473.91486  80.01383  86.88258  86.56111  90.03439  90.49119        NA
 [8]  81.77137  87.18560  91.25713
> rowMin(tmp5)
 [1] 57.62170 58.83546 54.59404 55.85314 56.22669 55.70033       NA 54.77746
 [9] 57.44164 59.21811
> 
> colMeans(tmp5)
 [1] 109.26063        NA  70.73275  71.17998  69.73759  68.29018  71.61885
 [8]  76.52292  65.08579  68.81036  76.09493  68.87690  71.33149  70.46394
[15]  69.23210  67.02213  65.18650  71.26549  73.87108  69.19820
> colSums(tmp5)
 [1] 1092.6063        NA  707.3275  711.7998  697.3759  682.9018  716.1885
 [8]  765.2292  650.8579  688.1036  760.9493  688.7690  713.3149  704.6394
[15]  692.3210  670.2213  651.8650  712.6549  738.7108  691.9820
> colVars(tmp5)
 [1] 16453.72350          NA    54.02461    43.78317    57.25676   101.45858
 [7]    84.75985   113.49920    80.99913    69.82286    77.23359    60.31442
[13]    69.11115    36.21614   127.83243    47.76402    67.18031    33.04180
[19]   116.94610    24.93210
> colSd(tmp5)
 [1] 128.272068         NA   7.350144   6.616885   7.566820  10.072665
 [7]   9.206511  10.653600   8.999952   8.356008   8.788264   7.766236
[13]   8.313312   6.017985  11.306300   6.911152   8.196360   5.748200
[19]  10.814162   4.993206
> colMax(tmp5)
 [1] 473.91486        NA  85.09656  81.63706  83.06227  86.90533  84.10700
 [8]  91.25713  82.57288  84.08511  86.56111  83.23785  81.82082  77.94304
[15]  90.49119  79.17205  78.38844  82.08219  90.03439  76.89712
> colMin(tmp5)
 [1] 55.85314       NA 60.43868 61.67184 59.96396 57.64410 55.70033 58.83546
 [9] 56.17440 59.63668 58.26760 56.10171 56.50760 60.21375 54.77746 59.20183
[17] 54.59404 65.05556 56.72480 59.69143
> 
> Max(tmp5,na.rm=TRUE)
[1] 473.9149
> Min(tmp5,na.rm=TRUE)
[1] 54.59404
> mean(tmp5,na.rm=TRUE)
[1] 72.10548
> Sum(tmp5,na.rm=TRUE)
[1] 14348.99
> Var(tmp5,na.rm=TRUE)
[1] 891.3142
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.52613 68.72637 69.79263 70.11068 68.91701 67.52210 69.76771 70.22426
 [9] 71.68665 71.66434
> rowSums(tmp5,na.rm=TRUE)
 [1] 1850.523 1374.527 1395.853 1402.214 1378.340 1350.442 1325.586 1404.485
 [9] 1433.733 1433.287
> rowVars(tmp5,na.rm=TRUE)
 [1] 8136.23338   33.66853  101.58372   97.12410   87.10995   82.87737
 [7]   56.42246   39.91153   70.88302   82.40436
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.201072  5.802459 10.078875  9.855156  9.333271  9.103701  7.511489
 [8]  6.317557  8.419205  9.077685
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.91486  80.01383  86.88258  86.56111  90.03439  90.49119  84.10700
 [8]  81.77137  87.18560  91.25713
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.62170 58.83546 54.59404 55.85314 56.22669 55.70033 56.72480 54.77746
 [9] 57.44164 59.21811
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.26063  67.90796  70.73275  71.17998  69.73759  68.29018  71.61885
 [8]  76.52292  65.08579  68.81036  76.09493  68.87690  71.33149  70.46394
[15]  69.23210  67.02213  65.18650  71.26549  73.87108  69.19820
> colSums(tmp5,na.rm=TRUE)
 [1] 1092.6063  611.1716  707.3275  711.7998  697.3759  682.9018  716.1885
 [8]  765.2292  650.8579  688.1036  760.9493  688.7690  713.3149  704.6394
[15]  692.3210  670.2213  651.8650  712.6549  738.7108  691.9820
> colVars(tmp5,na.rm=TRUE)
 [1] 16453.72350    96.35425    54.02461    43.78317    57.25676   101.45858
 [7]    84.75985   113.49920    80.99913    69.82286    77.23359    60.31442
[13]    69.11115    36.21614   127.83243    47.76402    67.18031    33.04180
[19]   116.94610    24.93210
> colSd(tmp5,na.rm=TRUE)
 [1] 128.272068   9.816020   7.350144   6.616885   7.566820  10.072665
 [7]   9.206511  10.653600   8.999952   8.356008   8.788264   7.766236
[13]   8.313312   6.017985  11.306300   6.911152   8.196360   5.748200
[19]  10.814162   4.993206
> colMax(tmp5,na.rm=TRUE)
 [1] 473.91486  82.90798  85.09656  81.63706  83.06227  86.90533  84.10700
 [8]  91.25713  82.57288  84.08511  86.56111  83.23785  81.82082  77.94304
[15]  90.49119  79.17205  78.38844  82.08219  90.03439  76.89712
> colMin(tmp5,na.rm=TRUE)
 [1] 55.85314 56.04508 60.43868 61.67184 59.96396 57.64410 55.70033 58.83546
 [9] 56.17440 59.63668 58.26760 56.10171 56.50760 60.21375 54.77746 59.20183
[17] 54.59404 65.05556 56.72480 59.69143
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.52613 68.72637 69.79263 70.11068 68.91701 67.52210      NaN 70.22426
 [9] 71.68665 71.66434
> rowSums(tmp5,na.rm=TRUE)
 [1] 1850.523 1374.527 1395.853 1402.214 1378.340 1350.442    0.000 1404.485
 [9] 1433.733 1433.287
> rowVars(tmp5,na.rm=TRUE)
 [1] 8136.23338   33.66853  101.58372   97.12410   87.10995   82.87737
 [7]         NA   39.91153   70.88302   82.40436
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.201072  5.802459 10.078875  9.855156  9.333271  9.103701        NA
 [8]  6.317557  8.419205  9.077685
> rowMax(tmp5,na.rm=TRUE)
 [1] 473.91486  80.01383  86.88258  86.56111  90.03439  90.49119        NA
 [8]  81.77137  87.18560  91.25713
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.62170 58.83546 54.59404 55.85314 56.22669 55.70033       NA 54.77746
 [9] 57.44164 59.21811
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.35098       NaN  71.23909  70.46077  70.53558  68.95691  70.23127
 [8]  76.80084  64.68763  68.62129  78.07575  67.91290  70.47300  70.23902
[15]  68.88641  66.78159  63.71961  71.73456  75.77623  69.65344
> colSums(tmp5,na.rm=TRUE)
 [1] 1029.1589    0.0000  641.1518  634.1470  634.8202  620.6122  632.0815
 [8]  691.2075  582.1887  617.5916  702.6817  611.2161  634.2570  632.1512
[15]  619.9777  601.0343  573.4765  645.6110  681.9860  626.8809
> colVars(tmp5,na.rm=TRUE)
 [1] 18218.93244          NA    57.89334    43.43686    57.25003   109.13999
 [7]    73.69457   126.81768    89.34057    78.14855    42.74698    57.39911
[13]    69.45869    40.17403   142.46706    53.08359    51.37074    34.69677
[19]    90.73173    25.71719
> colSd(tmp5,na.rm=TRUE)
 [1] 134.977526         NA   7.608767   6.590665   7.566375  10.447009
 [7]   8.584554  11.261336   9.452014   8.840167   6.538118   7.576220
[13]   8.334188   6.338298  11.935957   7.285848   7.167338   5.890396
[19]   9.525321   5.071212
> colMax(tmp5,na.rm=TRUE)
 [1] 473.91486      -Inf  85.09656  81.63706  83.06227  86.90533  81.77137
 [8]  91.25713  82.57288  84.08511  86.56111  83.23785  81.82082  77.94304
[15]  90.49119  79.17205  75.29803  82.08219  90.03439  76.89712
> colMin(tmp5,na.rm=TRUE)
 [1] 55.85314      Inf 60.43868 61.67184 59.96396 57.64410 55.70033 58.83546
 [9] 56.17440 59.63668 69.35499 56.10171 56.50760 60.21375 54.77746 59.20183
[17] 54.59404 65.05556 59.76797 59.69143
> 
> 
> 
> 
> 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] 247.20247 175.99979 171.80676 257.03312 345.24098 220.54451  92.70107
 [8] 195.65944 255.59058 324.11842
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 247.20247 175.99979 171.80676 257.03312 345.24098 220.54451  92.70107
 [8] 195.65944 255.59058 324.11842
> 
> 
> 
> 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.136868e-13  5.684342e-14 -1.421085e-13  5.684342e-14 -1.136868e-13
 [6] -1.705303e-13  1.705303e-13  5.684342e-14 -5.684342e-14 -1.136868e-13
[11] -2.842171e-14 -2.842171e-14  8.526513e-14 -2.842171e-14  5.684342e-14
[16]  0.000000e+00 -5.684342e-14 -4.263256e-14  5.684342e-14  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   9 
8   2 
4   4 
8   16 
8   13 
9   16 
4   18 
8   18 
2   6 
4   16 
4   15 
5   16 
5   9 
2   7 
7   9 
8   14 
7   3 
7   16 
7   15 
1   10 
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.063787
> Min(tmp)
[1] -2.332494
> mean(tmp)
[1] 0.04760018
> Sum(tmp)
[1] 4.760018
> Var(tmp)
[1] 1.029881
> 
> rowMeans(tmp)
[1] 0.04760018
> rowSums(tmp)
[1] 4.760018
> rowVars(tmp)
[1] 1.029881
> rowSd(tmp)
[1] 1.014831
> rowMax(tmp)
[1] 2.063787
> rowMin(tmp)
[1] -2.332494
> 
> colMeans(tmp)
  [1] -0.52792172  0.89285571 -1.21688243 -0.11823598  1.24211722  0.54876545
  [7] -0.19536731  1.16334189  0.46013984  0.64916192  0.18897069  1.39049843
 [13]  0.79585222  1.02382239 -0.34486976  1.33266380 -1.22287896  1.61282977
 [19]  0.58258033  0.99415230  1.77772613  0.79665418 -0.57159444 -1.96155867
 [25]  0.10543868  0.94013015  0.49894648 -1.16228469  1.42363194 -1.68597404
 [31] -0.04012450  0.76086792 -1.32314020 -0.84463043  1.68965755  0.05753542
 [37] -0.14563602 -0.78224587 -0.70696572  0.03822117  0.51334795  0.25197524
 [43] -0.35543629  0.97350540  0.13438148  1.34333543  0.33316051  0.63427246
 [49]  2.06378742 -2.20213496 -1.91727506 -0.14846869  0.29522618 -2.33249412
 [55]  0.46068771  0.33258406  0.29993425 -0.85949258  0.88422797 -1.90791432
 [61]  0.13426204 -1.05901426 -1.14193717 -0.80813216  1.27475148 -0.60219558
 [67] -0.49558885  0.16822889 -0.21323415 -0.61291472 -1.07333286  0.53016924
 [73] -0.96488858 -0.91343151  1.06750869 -1.50892739  1.91887664  1.03392917
 [79]  1.12046012  0.15788192 -0.23824805  1.41057259  0.19877583  0.79513096
 [85]  0.74563153 -1.03856346  0.78427621 -1.67276282 -1.54524238  0.23814338
 [91]  1.16059538  0.75187139 -0.94426543 -0.94449719  0.48955092 -0.81368156
 [97] -0.67733722  0.65213625  0.75368711 -0.27168752
> colSums(tmp)
  [1] -0.52792172  0.89285571 -1.21688243 -0.11823598  1.24211722  0.54876545
  [7] -0.19536731  1.16334189  0.46013984  0.64916192  0.18897069  1.39049843
 [13]  0.79585222  1.02382239 -0.34486976  1.33266380 -1.22287896  1.61282977
 [19]  0.58258033  0.99415230  1.77772613  0.79665418 -0.57159444 -1.96155867
 [25]  0.10543868  0.94013015  0.49894648 -1.16228469  1.42363194 -1.68597404
 [31] -0.04012450  0.76086792 -1.32314020 -0.84463043  1.68965755  0.05753542
 [37] -0.14563602 -0.78224587 -0.70696572  0.03822117  0.51334795  0.25197524
 [43] -0.35543629  0.97350540  0.13438148  1.34333543  0.33316051  0.63427246
 [49]  2.06378742 -2.20213496 -1.91727506 -0.14846869  0.29522618 -2.33249412
 [55]  0.46068771  0.33258406  0.29993425 -0.85949258  0.88422797 -1.90791432
 [61]  0.13426204 -1.05901426 -1.14193717 -0.80813216  1.27475148 -0.60219558
 [67] -0.49558885  0.16822889 -0.21323415 -0.61291472 -1.07333286  0.53016924
 [73] -0.96488858 -0.91343151  1.06750869 -1.50892739  1.91887664  1.03392917
 [79]  1.12046012  0.15788192 -0.23824805  1.41057259  0.19877583  0.79513096
 [85]  0.74563153 -1.03856346  0.78427621 -1.67276282 -1.54524238  0.23814338
 [91]  1.16059538  0.75187139 -0.94426543 -0.94449719  0.48955092 -0.81368156
 [97] -0.67733722  0.65213625  0.75368711 -0.27168752
> 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.52792172  0.89285571 -1.21688243 -0.11823598  1.24211722  0.54876545
  [7] -0.19536731  1.16334189  0.46013984  0.64916192  0.18897069  1.39049843
 [13]  0.79585222  1.02382239 -0.34486976  1.33266380 -1.22287896  1.61282977
 [19]  0.58258033  0.99415230  1.77772613  0.79665418 -0.57159444 -1.96155867
 [25]  0.10543868  0.94013015  0.49894648 -1.16228469  1.42363194 -1.68597404
 [31] -0.04012450  0.76086792 -1.32314020 -0.84463043  1.68965755  0.05753542
 [37] -0.14563602 -0.78224587 -0.70696572  0.03822117  0.51334795  0.25197524
 [43] -0.35543629  0.97350540  0.13438148  1.34333543  0.33316051  0.63427246
 [49]  2.06378742 -2.20213496 -1.91727506 -0.14846869  0.29522618 -2.33249412
 [55]  0.46068771  0.33258406  0.29993425 -0.85949258  0.88422797 -1.90791432
 [61]  0.13426204 -1.05901426 -1.14193717 -0.80813216  1.27475148 -0.60219558
 [67] -0.49558885  0.16822889 -0.21323415 -0.61291472 -1.07333286  0.53016924
 [73] -0.96488858 -0.91343151  1.06750869 -1.50892739  1.91887664  1.03392917
 [79]  1.12046012  0.15788192 -0.23824805  1.41057259  0.19877583  0.79513096
 [85]  0.74563153 -1.03856346  0.78427621 -1.67276282 -1.54524238  0.23814338
 [91]  1.16059538  0.75187139 -0.94426543 -0.94449719  0.48955092 -0.81368156
 [97] -0.67733722  0.65213625  0.75368711 -0.27168752
> colMin(tmp)
  [1] -0.52792172  0.89285571 -1.21688243 -0.11823598  1.24211722  0.54876545
  [7] -0.19536731  1.16334189  0.46013984  0.64916192  0.18897069  1.39049843
 [13]  0.79585222  1.02382239 -0.34486976  1.33266380 -1.22287896  1.61282977
 [19]  0.58258033  0.99415230  1.77772613  0.79665418 -0.57159444 -1.96155867
 [25]  0.10543868  0.94013015  0.49894648 -1.16228469  1.42363194 -1.68597404
 [31] -0.04012450  0.76086792 -1.32314020 -0.84463043  1.68965755  0.05753542
 [37] -0.14563602 -0.78224587 -0.70696572  0.03822117  0.51334795  0.25197524
 [43] -0.35543629  0.97350540  0.13438148  1.34333543  0.33316051  0.63427246
 [49]  2.06378742 -2.20213496 -1.91727506 -0.14846869  0.29522618 -2.33249412
 [55]  0.46068771  0.33258406  0.29993425 -0.85949258  0.88422797 -1.90791432
 [61]  0.13426204 -1.05901426 -1.14193717 -0.80813216  1.27475148 -0.60219558
 [67] -0.49558885  0.16822889 -0.21323415 -0.61291472 -1.07333286  0.53016924
 [73] -0.96488858 -0.91343151  1.06750869 -1.50892739  1.91887664  1.03392917
 [79]  1.12046012  0.15788192 -0.23824805  1.41057259  0.19877583  0.79513096
 [85]  0.74563153 -1.03856346  0.78427621 -1.67276282 -1.54524238  0.23814338
 [91]  1.16059538  0.75187139 -0.94426543 -0.94449719  0.48955092 -0.81368156
 [97] -0.67733722  0.65213625  0.75368711 -0.27168752
> colMedians(tmp)
  [1] -0.52792172  0.89285571 -1.21688243 -0.11823598  1.24211722  0.54876545
  [7] -0.19536731  1.16334189  0.46013984  0.64916192  0.18897069  1.39049843
 [13]  0.79585222  1.02382239 -0.34486976  1.33266380 -1.22287896  1.61282977
 [19]  0.58258033  0.99415230  1.77772613  0.79665418 -0.57159444 -1.96155867
 [25]  0.10543868  0.94013015  0.49894648 -1.16228469  1.42363194 -1.68597404
 [31] -0.04012450  0.76086792 -1.32314020 -0.84463043  1.68965755  0.05753542
 [37] -0.14563602 -0.78224587 -0.70696572  0.03822117  0.51334795  0.25197524
 [43] -0.35543629  0.97350540  0.13438148  1.34333543  0.33316051  0.63427246
 [49]  2.06378742 -2.20213496 -1.91727506 -0.14846869  0.29522618 -2.33249412
 [55]  0.46068771  0.33258406  0.29993425 -0.85949258  0.88422797 -1.90791432
 [61]  0.13426204 -1.05901426 -1.14193717 -0.80813216  1.27475148 -0.60219558
 [67] -0.49558885  0.16822889 -0.21323415 -0.61291472 -1.07333286  0.53016924
 [73] -0.96488858 -0.91343151  1.06750869 -1.50892739  1.91887664  1.03392917
 [79]  1.12046012  0.15788192 -0.23824805  1.41057259  0.19877583  0.79513096
 [85]  0.74563153 -1.03856346  0.78427621 -1.67276282 -1.54524238  0.23814338
 [91]  1.16059538  0.75187139 -0.94426543 -0.94449719  0.48955092 -0.81368156
 [97] -0.67733722  0.65213625  0.75368711 -0.27168752
> colRanges(tmp)
           [,1]      [,2]      [,3]      [,4]     [,5]      [,6]       [,7]
[1,] -0.5279217 0.8928557 -1.216882 -0.118236 1.242117 0.5487654 -0.1953673
[2,] -0.5279217 0.8928557 -1.216882 -0.118236 1.242117 0.5487654 -0.1953673
         [,8]      [,9]     [,10]     [,11]    [,12]     [,13]    [,14]
[1,] 1.163342 0.4601398 0.6491619 0.1889707 1.390498 0.7958522 1.023822
[2,] 1.163342 0.4601398 0.6491619 0.1889707 1.390498 0.7958522 1.023822
          [,15]    [,16]     [,17]   [,18]     [,19]     [,20]    [,21]
[1,] -0.3448698 1.332664 -1.222879 1.61283 0.5825803 0.9941523 1.777726
[2,] -0.3448698 1.332664 -1.222879 1.61283 0.5825803 0.9941523 1.777726
         [,22]      [,23]     [,24]     [,25]     [,26]     [,27]     [,28]
[1,] 0.7966542 -0.5715944 -1.961559 0.1054387 0.9401301 0.4989465 -1.162285
[2,] 0.7966542 -0.5715944 -1.961559 0.1054387 0.9401301 0.4989465 -1.162285
        [,29]     [,30]      [,31]     [,32]    [,33]      [,34]    [,35]
[1,] 1.423632 -1.685974 -0.0401245 0.7608679 -1.32314 -0.8446304 1.689658
[2,] 1.423632 -1.685974 -0.0401245 0.7608679 -1.32314 -0.8446304 1.689658
          [,36]     [,37]      [,38]      [,39]      [,40]     [,41]     [,42]
[1,] 0.05753542 -0.145636 -0.7822459 -0.7069657 0.03822117 0.5133479 0.2519752
[2,] 0.05753542 -0.145636 -0.7822459 -0.7069657 0.03822117 0.5133479 0.2519752
          [,43]     [,44]     [,45]    [,46]     [,47]     [,48]    [,49]
[1,] -0.3554363 0.9735054 0.1343815 1.343335 0.3331605 0.6342725 2.063787
[2,] -0.3554363 0.9735054 0.1343815 1.343335 0.3331605 0.6342725 2.063787
         [,50]     [,51]      [,52]     [,53]     [,54]     [,55]     [,56]
[1,] -2.202135 -1.917275 -0.1484687 0.2952262 -2.332494 0.4606877 0.3325841
[2,] -2.202135 -1.917275 -0.1484687 0.2952262 -2.332494 0.4606877 0.3325841
         [,57]      [,58]    [,59]     [,60]    [,61]     [,62]     [,63]
[1,] 0.2999342 -0.8594926 0.884228 -1.907914 0.134262 -1.059014 -1.141937
[2,] 0.2999342 -0.8594926 0.884228 -1.907914 0.134262 -1.059014 -1.141937
          [,64]    [,65]      [,66]      [,67]     [,68]      [,69]      [,70]
[1,] -0.8081322 1.274751 -0.6021956 -0.4955888 0.1682289 -0.2132342 -0.6129147
[2,] -0.8081322 1.274751 -0.6021956 -0.4955888 0.1682289 -0.2132342 -0.6129147
         [,71]     [,72]      [,73]      [,74]    [,75]     [,76]    [,77]
[1,] -1.073333 0.5301692 -0.9648886 -0.9134315 1.067509 -1.508927 1.918877
[2,] -1.073333 0.5301692 -0.9648886 -0.9134315 1.067509 -1.508927 1.918877
        [,78]   [,79]     [,80]     [,81]    [,82]     [,83]    [,84]     [,85]
[1,] 1.033929 1.12046 0.1578819 -0.238248 1.410573 0.1987758 0.795131 0.7456315
[2,] 1.033929 1.12046 0.1578819 -0.238248 1.410573 0.1987758 0.795131 0.7456315
         [,86]     [,87]     [,88]     [,89]     [,90]    [,91]     [,92]
[1,] -1.038563 0.7842762 -1.672763 -1.545242 0.2381434 1.160595 0.7518714
[2,] -1.038563 0.7842762 -1.672763 -1.545242 0.2381434 1.160595 0.7518714
          [,93]      [,94]     [,95]      [,96]      [,97]     [,98]     [,99]
[1,] -0.9442654 -0.9444972 0.4895509 -0.8136816 -0.6773372 0.6521363 0.7536871
[2,] -0.9442654 -0.9444972 0.4895509 -0.8136816 -0.6773372 0.6521363 0.7536871
         [,100]
[1,] -0.2716875
[2,] -0.2716875
> 
> 
> Max(tmp2)
[1] 2.820606
> Min(tmp2)
[1] -1.852501
> mean(tmp2)
[1] 0.05104207
> Sum(tmp2)
[1] 5.104207
> Var(tmp2)
[1] 0.9788721
> 
> rowMeans(tmp2)
  [1]  0.54265381 -1.51766254  0.36900537  2.45781360 -0.17933950 -1.05162911
  [7] -0.16154999 -0.19889649 -1.21677514 -0.96559281  0.83244124 -1.42895431
 [13] -0.89217978 -0.31089525 -0.27741539  0.74477569 -0.18265953 -0.48413410
 [19] -0.97236175  0.56109643 -0.13202384 -0.57144221  0.42511419  2.82060609
 [25]  0.21019367  1.01409060 -0.57437492  1.05689588  1.25262428  0.54226825
 [31]  0.58842672  0.18729935 -0.73183688  0.50731486 -1.85250143 -1.31378861
 [37]  1.29659627 -0.57178793 -0.11458927  1.94558908  0.55938665 -0.86010096
 [43]  1.59960647  0.19610105  1.51410848  0.36237043  0.14695422 -0.60137519
 [49] -0.03606366 -1.04395762 -1.35681567 -0.29035621 -0.08333441 -0.29729049
 [55]  0.51317286 -1.84587228  0.50604257 -0.99926295 -0.06693448  1.82204509
 [61]  0.60802680  1.12874583 -1.35039818  0.41681890  0.50242143  0.27352962
 [67] -0.83126599 -0.21999577 -1.52782414  1.67614172  0.45045998  0.33170424
 [73]  1.94438002  0.28259895 -0.74533043  0.08349970 -1.38980353  0.56469962
 [79] -0.87033407  0.82062552 -0.87303177  1.36669350  0.30627431 -0.93385325
 [85] -0.23282532  0.08806020  1.26132266  0.39689713  1.08465102  1.00901042
 [91] -0.05650117  0.32257008 -0.08194441 -1.56539232  2.04478973 -0.50031590
 [97]  0.49503504 -0.40719570 -0.54970997 -1.60986622
> rowSums(tmp2)
  [1]  0.54265381 -1.51766254  0.36900537  2.45781360 -0.17933950 -1.05162911
  [7] -0.16154999 -0.19889649 -1.21677514 -0.96559281  0.83244124 -1.42895431
 [13] -0.89217978 -0.31089525 -0.27741539  0.74477569 -0.18265953 -0.48413410
 [19] -0.97236175  0.56109643 -0.13202384 -0.57144221  0.42511419  2.82060609
 [25]  0.21019367  1.01409060 -0.57437492  1.05689588  1.25262428  0.54226825
 [31]  0.58842672  0.18729935 -0.73183688  0.50731486 -1.85250143 -1.31378861
 [37]  1.29659627 -0.57178793 -0.11458927  1.94558908  0.55938665 -0.86010096
 [43]  1.59960647  0.19610105  1.51410848  0.36237043  0.14695422 -0.60137519
 [49] -0.03606366 -1.04395762 -1.35681567 -0.29035621 -0.08333441 -0.29729049
 [55]  0.51317286 -1.84587228  0.50604257 -0.99926295 -0.06693448  1.82204509
 [61]  0.60802680  1.12874583 -1.35039818  0.41681890  0.50242143  0.27352962
 [67] -0.83126599 -0.21999577 -1.52782414  1.67614172  0.45045998  0.33170424
 [73]  1.94438002  0.28259895 -0.74533043  0.08349970 -1.38980353  0.56469962
 [79] -0.87033407  0.82062552 -0.87303177  1.36669350  0.30627431 -0.93385325
 [85] -0.23282532  0.08806020  1.26132266  0.39689713  1.08465102  1.00901042
 [91] -0.05650117  0.32257008 -0.08194441 -1.56539232  2.04478973 -0.50031590
 [97]  0.49503504 -0.40719570 -0.54970997 -1.60986622
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.54265381 -1.51766254  0.36900537  2.45781360 -0.17933950 -1.05162911
  [7] -0.16154999 -0.19889649 -1.21677514 -0.96559281  0.83244124 -1.42895431
 [13] -0.89217978 -0.31089525 -0.27741539  0.74477569 -0.18265953 -0.48413410
 [19] -0.97236175  0.56109643 -0.13202384 -0.57144221  0.42511419  2.82060609
 [25]  0.21019367  1.01409060 -0.57437492  1.05689588  1.25262428  0.54226825
 [31]  0.58842672  0.18729935 -0.73183688  0.50731486 -1.85250143 -1.31378861
 [37]  1.29659627 -0.57178793 -0.11458927  1.94558908  0.55938665 -0.86010096
 [43]  1.59960647  0.19610105  1.51410848  0.36237043  0.14695422 -0.60137519
 [49] -0.03606366 -1.04395762 -1.35681567 -0.29035621 -0.08333441 -0.29729049
 [55]  0.51317286 -1.84587228  0.50604257 -0.99926295 -0.06693448  1.82204509
 [61]  0.60802680  1.12874583 -1.35039818  0.41681890  0.50242143  0.27352962
 [67] -0.83126599 -0.21999577 -1.52782414  1.67614172  0.45045998  0.33170424
 [73]  1.94438002  0.28259895 -0.74533043  0.08349970 -1.38980353  0.56469962
 [79] -0.87033407  0.82062552 -0.87303177  1.36669350  0.30627431 -0.93385325
 [85] -0.23282532  0.08806020  1.26132266  0.39689713  1.08465102  1.00901042
 [91] -0.05650117  0.32257008 -0.08194441 -1.56539232  2.04478973 -0.50031590
 [97]  0.49503504 -0.40719570 -0.54970997 -1.60986622
> rowMin(tmp2)
  [1]  0.54265381 -1.51766254  0.36900537  2.45781360 -0.17933950 -1.05162911
  [7] -0.16154999 -0.19889649 -1.21677514 -0.96559281  0.83244124 -1.42895431
 [13] -0.89217978 -0.31089525 -0.27741539  0.74477569 -0.18265953 -0.48413410
 [19] -0.97236175  0.56109643 -0.13202384 -0.57144221  0.42511419  2.82060609
 [25]  0.21019367  1.01409060 -0.57437492  1.05689588  1.25262428  0.54226825
 [31]  0.58842672  0.18729935 -0.73183688  0.50731486 -1.85250143 -1.31378861
 [37]  1.29659627 -0.57178793 -0.11458927  1.94558908  0.55938665 -0.86010096
 [43]  1.59960647  0.19610105  1.51410848  0.36237043  0.14695422 -0.60137519
 [49] -0.03606366 -1.04395762 -1.35681567 -0.29035621 -0.08333441 -0.29729049
 [55]  0.51317286 -1.84587228  0.50604257 -0.99926295 -0.06693448  1.82204509
 [61]  0.60802680  1.12874583 -1.35039818  0.41681890  0.50242143  0.27352962
 [67] -0.83126599 -0.21999577 -1.52782414  1.67614172  0.45045998  0.33170424
 [73]  1.94438002  0.28259895 -0.74533043  0.08349970 -1.38980353  0.56469962
 [79] -0.87033407  0.82062552 -0.87303177  1.36669350  0.30627431 -0.93385325
 [85] -0.23282532  0.08806020  1.26132266  0.39689713  1.08465102  1.00901042
 [91] -0.05650117  0.32257008 -0.08194441 -1.56539232  2.04478973 -0.50031590
 [97]  0.49503504 -0.40719570 -0.54970997 -1.60986622
> 
> colMeans(tmp2)
[1] 0.05104207
> colSums(tmp2)
[1] 5.104207
> colVars(tmp2)
[1] 0.9788721
> colSd(tmp2)
[1] 0.9893796
> colMax(tmp2)
[1] 2.820606
> colMin(tmp2)
[1] -1.852501
> colMedians(tmp2)
[1] 0.02371802
> colRanges(tmp2)
          [,1]
[1,] -1.852501
[2,]  2.820606
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.8322399 -1.2352000  1.6460426 -2.3263693 -3.8229975 -3.7046441
 [7]  4.9268573 -2.6488207 -0.7264646  1.8959732
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8043895
[2,] -1.1062044
[3,]  0.1416326
[4,]  0.9046984
[5,]  1.1743264
> 
> rowApply(tmp,sum)
 [1] -4.4435950  0.5800416 -2.3426368  3.9648067  0.9239718 -1.4854850
 [7]  1.8813400 -4.2697395 -1.7521904  0.1156238
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    7    7    8    1    6    9    8    1     8
 [2,]    5    3    5    5    8    5    8    4    9     4
 [3,]    6   10    9    2    3   10    6    7    4     1
 [4,]    3    2    1   10   10    8    2    2    6     5
 [5,]    9    6    2    9    2    3    5    5    2     3
 [6,]    8    1    6    4    6    1    3    9    5     2
 [7,]   10    8   10    3    7    9    4    6    8     7
 [8,]    4    4    4    7    9    2    7    1    3     6
 [9,]    1    5    8    6    4    4   10    3   10     9
[10,]    7    9    3    1    5    7    1   10    7    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.73987909  1.48203817 -2.22329840  1.60610375  3.38884657 -2.70254902
 [7]  0.01073257  1.13745201  1.08931856 -0.02002270  2.29246924 -0.65301268
[13] -3.74406021 -0.79542753  3.58297337 -0.63523780 -1.47637894  1.20479044
[19] -2.48584895 -0.90106118
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.3981497
[2,] -0.1165806
[3,]  0.7639370
[4,]  1.9237774
[5,]  2.5668950
> 
> rowApply(tmp,sum)
[1]  2.4475825 -4.0138175  3.8388035  2.0555242  0.5696136
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    9   20   20   16    7
[2,]   15   12   17    7   13
[3,]    2   16    9    1   10
[4,]   20    6   18    3    9
[5,]   14   15    1   20   17
> 
> 
> as.matrix(tmp)
           [,1]       [,2]         [,3]       [,4]       [,5]        [,6]
[1,] -0.1165806  0.4899350 -1.159263316  2.5510508  0.4674433 -1.72995055
[2,]  1.9237774  0.2230026  0.487087872 -1.0601102  0.4840619  1.08593355
[3,]  2.5668950  1.0593546  0.055471138  1.2259451 -1.7043684  0.08678832
[4,]  0.7639370 -0.4436249 -1.600079238 -0.9161389  2.9880482 -0.02994239
[5,] -0.3981497  0.1533708 -0.006514855 -0.1946431  1.1536616 -2.11537794
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -0.5779939  0.3271274  0.1688875  1.7311513  1.3308044  0.2936343
[2,]  0.7029874 -1.2793540 -0.6764417  0.3082962 -0.4092240 -0.2493787
[3,]  0.9825049 -1.0934546  1.0583138 -0.7197137  0.5812757  1.2510378
[4,] -1.5538125  0.6793400  0.4812998 -0.4223091  1.3947535 -0.6018316
[5,]  0.4570466  2.5037932  0.0572591 -0.9174474 -0.6051404 -1.3464745
          [,13]      [,14]       [,15]       [,16]      [,17]      [,18]
[1,] -1.0051607 -0.7286601 0.840771401 -0.30716803 -0.6843892 -0.1636691
[2,] -1.4179117 -0.7723018 0.728534798 -1.42543233  0.1983614  0.4581777
[3,] -0.9331827  0.9875323 0.694315593 -0.25715461  1.0367548 -0.5102464
[4,] -0.1219759  0.8779799 0.003503397 -0.01184907 -0.7874025  0.4438694
[5,] -0.2658292 -1.1599778 1.315848181  1.36636624 -1.2397034  0.9766588
          [,19]      [,20]
[1,] -0.0545560  0.7741685
[2,] -1.0790676 -2.2448163
[3,] -0.8504885 -1.6787768
[4,] -0.5856272  1.4973864
[5,]  0.0838904  0.7509769
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  664  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  576  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  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.7337941 0.459849 0.8764147 -0.2849767 0.1378042 0.3230238 -0.932052
          col8      col9      col10      col11    col12      col13     col14
row1 -2.156593 -1.252266 0.04923202 -0.4656811 1.260407 -0.8657595 0.7653107
         col15     col16      col17     col18     col19    col20
row1 -1.053883 0.3399226 -0.6205752 0.1380679 -1.231085 1.405303
> tmp[,"col10"]
           col10
row1  0.04923202
row2  1.04759639
row3  0.01723095
row4  0.04273980
row5 -1.95366665
> tmp[c("row1","row5"),]
            col1      col2      col3       col4      col5       col6       col7
row1  0.73379414 0.4598490 0.8764147 -0.2849767 0.1378042  0.3230238 -0.9320520
row5 -0.05186736 0.3982432 0.8491230  0.7125223 0.2831988 -0.5627262  0.7989547
          col8      col9       col10      col11     col12      col13      col14
row1 -2.156593 -1.252266  0.04923202 -0.4656811 1.2604067 -0.8657595  0.7653107
row5 -1.119680  0.616955 -1.95366665  0.5080229 0.4258796  0.7471939 -0.3738301
          col15      col16      col17     col18     col19      col20
row1 -1.0538830  0.3399226 -0.6205752 0.1380679 -1.231085  1.4053030
row5 -0.3839169 -0.2158151 -0.1868736 0.4068390 -1.119513 -0.2111668
> tmp[,c("col6","col20")]
           col6      col20
row1  0.3230238  1.4053030
row2 -1.1488180 -0.1317626
row3 -0.9057898  0.3238900
row4 -0.8026014 -1.6311428
row5 -0.5627262 -0.2111668
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.3230238  1.4053030
row5 -0.5627262 -0.2111668
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6    col7     col8
row1 49.28125 50.89183 52.66398 50.41845 48.01306 105.1985 48.8049 50.23662
         col9   col10    col11    col12    col13    col14    col15    col16
row1 50.11331 50.7625 50.06847 51.60152 50.06402 48.85839 52.33254 49.53669
       col17    col18    col19    col20
row1 48.1256 49.72467 48.99675 104.7161
> tmp[,"col10"]
        col10
row1 50.76250
row2 30.54058
row3 30.13142
row4 30.58757
row5 49.14469
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6    col7     col8
row1 49.28125 50.89183 52.66398 50.41845 48.01306 105.1985 48.8049 50.23662
row5 47.69482 50.19668 50.00996 48.95156 50.37310 105.8028 49.5469 50.03399
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.11331 50.76250 50.06847 51.60152 50.06402 48.85839 52.33254 49.53669
row5 50.09482 49.14469 49.94233 50.08648 50.84894 51.37346 48.80833 49.41732
        col17    col18    col19    col20
row1 48.12560 49.72467 48.99675 104.7161
row5 51.52241 51.17945 51.01954 105.1343
> tmp[,c("col6","col20")]
          col6     col20
row1 105.19853 104.71615
row2  75.82064  73.72092
row3  76.39507  74.04394
row4  73.29990  75.37217
row5 105.80284 105.13431
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.1985 104.7161
row5 105.8028 105.1343
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.1985 104.7161
row5 105.8028 105.1343
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.70371170
[2,] -0.53873487
[3,] -0.51037171
[4,] -0.08063295
[5,] -0.54888876
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.7427752  0.3726106
[2,] -0.1847203  0.3013220
[3,] -2.3919852  0.5630425
[4,]  0.7674540 -0.6795661
[5,] -0.7511505  0.4705123
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -0.17680291 -0.12678420
[2,] -0.94552782 -0.64780465
[3,]  0.25629945 -0.05337168
[4,] -0.04380159 -0.11856033
[5,]  0.05646960  0.83873639
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.1768029
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.1768029
[2,] -0.9455278
> 
> 
> 
> 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.1879512 -1.8924896  0.4024357 -0.1878145 -0.7890707  0.7953074
row1 -0.5411493  0.1426077 -0.9817745 -0.8433198 -0.8582333 -1.2653740
            [,7]      [,8]        [,9]     [,10]      [,11]      [,12]
row3 -0.09326211 1.0039743  0.05667032 0.1405681 -0.9365526 -1.1193774
row1  1.10065708 0.9198301 -0.68540770 2.5135215 -2.6774157 -0.4493679
         [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
row3 -1.603790  0.2562128 -0.5820470 -0.7736032 -0.0379590 -1.1207926
row1  1.275949 -0.2954460 -0.9030697  1.1668785 -0.8736793  0.8885243
          [,19]     [,20]
row3  0.6464133 0.3429548
row1 -0.2691671 1.6324269
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]        [,2]     [,3]     [,4]        [,5]       [,6]      [,7]
row2 0.5065406 0.001618431 1.267467 2.272545 -0.09858287 -0.5856316 0.4681629
          [,8]      [,9]      [,10]
row2 0.4136521 0.8104926 -0.7268877
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
        [,1]       [,2]      [,3]      [,4]      [,5]       [,6]      [,7]
row5 1.68319 -0.6185981 0.6017955 -1.666613 0.1686404 -0.8009634 0.6300037
          [,8]      [,9]     [,10]    [,11]       [,12]     [,13]     [,14]
row5 0.1087917 -2.230025 -2.155513 1.652356 -0.07772057 0.1388898 0.5222463
         [,15]     [,16]     [,17]      [,18]     [,19]      [,20]
row5 -1.542782 0.4038064 -1.494723 -0.8368518 -1.378741 -0.8358376
> 
> 
> 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: 0x000001c6792cebb0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30770bd33754" 
 [2] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3077025714028"
 [3] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM307705c0e32b1"
 [4] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM307702476500a"
 [5] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3077064db512d"
 [6] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3077077923f43"
 [7] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30770bf5710"  
 [8] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30770168018fb"
 [9] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3077077547258"
[10] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3077028d111ca"
[11] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3077068e14801"
[12] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM307706e261f1e"
[13] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30770182e6683"
[14] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM3077076a21ddd"
[15] "C:/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM30770697419d" 
> 
> 
> ### 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: 0x000001c678dd4010>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001c678dd4010>
Warning message:
In dir.create(new.directory) :
  'C:\Users\biocbuild\bbs-3.20-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001c678dd4010>
> rowMedians(tmp)
  [1]  0.8124981436  0.5184978084 -0.3611455791  0.1887832739 -0.0793257640
  [6] -0.4107452787  0.8534246710  0.0705177221 -0.4465521202  0.4008887072
 [11] -0.2290553013 -0.2469908873 -0.1673472616 -0.0491534133 -0.1856819776
 [16] -0.4209441248 -0.2201206671  0.2881380678 -0.0455382253  0.0010776612
 [21] -0.0306015269 -0.1837953741  0.4496835798 -0.0478194778  0.0048134716
 [26]  0.0627707878 -0.0856608364  0.0944607899  0.0809150039 -0.1579292795
 [31]  0.2855625922  0.0333274091 -0.2802514310 -0.2422188765 -0.3587173504
 [36] -0.2192056173  0.1674863734 -0.0296076329 -0.4010633802 -0.3040314873
 [41]  0.0825501308  0.3680556775 -0.0887051815  0.5783225311  0.3324230040
 [46]  0.0262970701 -0.0004712707  0.1506036837 -0.1443472473 -0.2479062445
 [51] -0.4909974847  0.2854150916 -0.4047784466  0.5143596679 -0.0847165883
 [56] -0.5150956080  0.5865779730  0.0897430328  0.0929679141 -0.5442150562
 [61] -0.0109005121 -0.4243266846  0.0272803474 -0.3151267608 -0.1176927241
 [66]  0.4825882684  0.0427748293  0.1934252723 -0.1976327269  0.4301409505
 [71] -0.0500970508  0.2648090024  0.1725507674 -0.3513327128 -0.4551871250
 [76] -0.6316262755  0.2989853597 -0.4144587754  0.3148130059  0.1314379775
 [81] -0.1465926469 -0.4509354616  0.1903474466  0.0495208734 -0.1710030666
 [86] -0.0967303001 -0.0981391432 -0.2194175011  0.0022316648 -0.4263840990
 [91]  0.5885188110 -0.4472767907  0.5256190646  0.2613430062  0.0406260937
 [96] -0.1227488299 -0.3015984672 -0.2698684213 -0.9142991216 -0.1719764202
[101]  0.5291512286 -0.5989816362  0.3010445533  0.1444679035 -0.0017575551
[106] -0.5496031772  0.3915229707 -0.0006373665  0.1995004008  0.4348695638
[111] -0.0662901996 -0.2225386047  0.3367292814  0.7700394157 -0.4166529156
[116] -0.1511476307 -0.2884341371  0.1724746019 -0.1446629082 -0.0620516651
[121]  0.3536132498 -0.3299026656  0.0487072551  0.0820066503 -0.0685958340
[126] -0.1067741216  0.8630036216 -0.1613815291  0.1514437234  0.1319444365
[131]  0.0241855480 -0.5166862487 -0.0206726452 -0.4678664250 -0.0526463962
[136] -0.1567801711  0.4365296602  0.4513934065  0.3987951077  0.0163702687
[141]  0.2220017646 -0.4612282238 -0.0554927088  0.2208541302 -0.0746384431
[146]  0.1549956283  0.7760813912 -0.0978778611  0.1045444979  0.1858748461
[151]  0.0261746919 -0.2794567589 -0.5594067599 -0.2901645204  0.0173241806
[156] -0.2994507927 -0.1070833126  0.2489342382 -0.1035560904 -0.2319760931
[161]  0.0030867991  0.0444010946 -0.2730017812 -0.3667620272  0.1164767242
[166] -0.2798272787  0.3379127204 -0.8133750171 -0.2182712695 -0.1135115917
[171] -0.2155529027 -0.0696402476 -0.0452475292 -0.1963190422 -0.1904478254
[176] -0.1300009825  0.1678079739 -0.2845471860  0.1393598771 -0.0089817641
[181]  0.0502994616 -0.1444643432  0.0572998007 -0.2703512499 -0.3858473675
[186]  0.1082759879  0.4624905109  0.2641707627  0.2367233885 -0.1977461748
[191]  0.0555657205 -0.7303958625  0.3320525272 -0.0350119199  0.1413376203
[196]  0.2995533894  0.4727051568  0.1507514708  0.0989708088  0.0991941184
[201]  0.0403087788 -0.4191392030 -0.0928702935  0.0220608257 -0.8031912381
[206]  0.0983474013 -0.6241363638  0.2559060695  0.7731521436  0.1313473563
[211] -0.2173434442  0.1195140034 -0.7189651151 -0.0281518218 -0.0311362908
[216]  0.0998503801  0.3828991942 -0.1668602121  0.1258671590 -0.4894345112
[221] -0.4407696727  0.3089867110  0.7175627737 -0.2258114348 -0.1502383391
[226] -0.0642914852 -0.0559211215 -0.3272769799  0.2365640858  0.4259091391
> 
> proc.time()
   user  system elapsed 
   2.31   14.32   29.53 

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: 0x00000241cb7fe4d0>
> .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: 0x00000241cb7fe4d0>
> .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: 0x00000241cb7fe4d0>
> .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: 0x00000241cb7fe4d0>
> 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: 0x00000241cb7fe8f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000241cb7fe8f0>
> .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: 0x00000241cb7fe8f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000241cb7fe8f0>
> .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: 0x00000241cb7fe8f0>
> 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: 0x00000241cb7fead0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000241cb7fead0>
> .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: 0x00000241cb7fead0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000241cb7fead0>
> .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: 0x00000241cb7fead0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x00000241cb7fead0>
> .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: 0x00000241cb7fead0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x00000241cb7fead0>
> .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: 0x00000241cb7fead0>
> 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: 0x00000241cb7fee90>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x00000241cb7fee90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000241cb7fee90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000241cb7fee90>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile30c1c4be8111a" "BufferedMatrixFile30c1c7eb462ca"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile30c1c4be8111a" "BufferedMatrixFile30c1c7eb462ca"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000241cb7feef0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000241cb7feef0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000241cb7feef0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000241cb7feef0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x00000241cb7feef0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x00000241cb7feef0>
> .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: 0x00000241cd1ffad0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000241cd1ffad0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000241cd1ffad0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x00000241cd1ffad0>
> 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: 0x00000241cd1ff9b0>
> .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: 0x00000241cd1ff9b0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.26    0.07    0.43 

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.18    0.07    0.25 

Example timings