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

This page was generated on 2025-03-28 11:53 -0400 (Fri, 28 Mar 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_64R Under development (unstable) (2025-03-13 r87965) -- "Unsuffered Consequences" 4783
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2025-03-01 r87860 ucrt) -- "Unsuffered Consequences" 4552
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences" 4581
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4518
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 249/2315HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.71.1  (landing page)
Ben Bolstad
Snapshot Date: 2025-03-27 13:40 -0400 (Thu, 27 Mar 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 824836d
git_last_commit_date: 2024-12-14 17:47:34 -0400 (Sat, 14 Dec 2024)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on lconway

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.71.1
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.71.1.tar.gz
StartedAt: 2025-03-27 20:00:31 -0400 (Thu, 27 Mar 2025)
EndedAt: 2025-03-27 20:01:26 -0400 (Thu, 27 Mar 2025)
EllapsedTime: 55.1 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.71.1.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-03-02 r87868)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 14.2.0
* running under: macOS Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.71.1’
* 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 for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.sdk’
* 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 is not available
* 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: 1 WARNING, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.71.1’
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** 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
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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.339   0.157   0.488 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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] "/Users/biocbuild/bbs-3.21-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) limit (Mb) max used (Mb)
Ncells 480291 25.7    1055038 56.4         NA   634442 33.9
Vcells 890168  6.8    8388608 64.0      98304  2107859 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Mar 27 20:00:56 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Mar 27 20:00:56 2025"
> 
> 
> 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: 0x600001ad0000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Mar 27 20:01:01 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Mar 27 20:01:03 2025"
> 
> ColMode(tmp2)
<pointer: 0x600001ad0000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]       [,4]
[1,] 99.6655965  0.1484671  0.8296873  0.4987719
[2,] -1.1776359  2.2283464  1.2232380  1.1425273
[3,]  0.3952731 -1.7261228 -1.6829212  3.3920364
[4,]  0.4364120  0.2562666 -1.9925793 -0.6894853
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.6655965 0.1484671 0.8296873 0.4987719
[2,]  1.1776359 2.2283464 1.2232380 1.1425273
[3,]  0.3952731 1.7261228 1.6829212 3.3920364
[4,]  0.4364120 0.2562666 1.9925793 0.6894853
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9832658 0.3853142 0.9108717 0.7062379
[2,] 1.0851893 1.4927647 1.1060009 1.0688907
[3,] 0.6287074 1.3138199 1.2972745 1.8417482
[4,] 0.6606149 0.5062278 1.4115875 0.8303525
> 
> 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:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.49825 29.00161 34.93840 32.56115
[2,]  37.02953 42.15599 37.28325 36.83143
[3,]  31.68235 39.86432 39.65567 46.80952
[4,]  32.04256 30.31855 41.10845 33.99301
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001a88000>
> exp(tmp5)
<pointer: 0x600001a88000>
> log(tmp5,2)
<pointer: 0x600001a88000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.2637
> Min(tmp5)
[1] 53.13942
> mean(tmp5)
[1] 73.17857
> Sum(tmp5)
[1] 14635.71
> Var(tmp5)
[1] 866.203
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.80416 71.57617 71.19861 71.39812 71.31213 73.11932 70.99082 69.56299
 [9] 71.00270 72.82067
> rowSums(tmp5)
 [1] 1776.083 1431.523 1423.972 1427.962 1426.243 1462.386 1419.816 1391.260
 [9] 1420.054 1456.413
> rowVars(tmp5)
 [1] 7987.10446   98.19393  115.73242   54.22298   94.59983   83.45284
 [7]   90.75558   98.72565   82.07386   72.71157
> rowSd(tmp5)
 [1] 89.370602  9.909285 10.757901  7.363625  9.726245  9.135253  9.526572
 [8]  9.936078  9.059463  8.527108
> rowMax(tmp5)
 [1] 467.26370  90.40602  97.42788  85.56186  87.99912  84.56905  90.35100
 [8]  86.36914  86.90931  91.56817
> rowMin(tmp5)
 [1] 58.44028 57.37847 53.91465 61.42164 55.07040 58.52087 57.35597 54.83822
 [9] 53.13942 59.51877
> 
> colMeans(tmp5)
 [1] 108.79749  75.43970  72.93667  72.19453  72.43400  70.13980  73.34643
 [8]  71.57258  70.15306  71.96346  71.73004  71.87515  66.90604  74.67336
[15]  69.59442  71.07498  66.92420  74.01730  64.34322  73.45494
> colSums(tmp5)
 [1] 1087.9749  754.3970  729.3667  721.9453  724.3400  701.3980  733.4643
 [8]  715.7258  701.5306  719.6346  717.3004  718.7515  669.0604  746.7336
[15]  695.9442  710.7498  669.2420  740.1730  643.4322  734.5494
> colVars(tmp5)
 [1] 15952.95735   156.52757    68.51552   114.70422    57.48096    81.88780
 [7]    44.72979    44.93367   164.31342    71.76547    75.27255    62.22238
[13]    64.04480    98.01061    34.97097    69.25840    44.04007   123.47005
[19]    40.17828   140.67010
> colSd(tmp5)
 [1] 126.305017  12.511098   8.277410  10.710006   7.581620   9.049188
 [7]   6.688034   6.703258  12.818480   8.471450   8.675975   7.888116
[13]   8.002800   9.900031   5.913626   8.322163   6.636269  11.111708
[19]   6.338634  11.860443
> colMax(tmp5)
 [1] 467.26370  90.35100  85.56186  97.42788  83.80173  82.53958  85.69440
 [8]  82.88396  90.40602  82.92277  86.36914  81.96764  82.75094  89.08994
[15]  77.13165  84.56905  77.91614  87.05260  75.68209  91.56817
> colMin(tmp5)
 [1] 55.46780 54.83822 59.96473 58.17140 58.72844 57.35597 65.99459 63.85540
 [9] 53.91465 61.42164 58.44028 60.57705 57.51156 60.88979 58.52087 59.63622
[17] 57.05036 53.13942 55.07040 56.21665
> 
> 
> ### 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] 88.80416 71.57617 71.19861 71.39812 71.31213 73.11932       NA 69.56299
 [9] 71.00270 72.82067
> rowSums(tmp5)
 [1] 1776.083 1431.523 1423.972 1427.962 1426.243 1462.386       NA 1391.260
 [9] 1420.054 1456.413
> rowVars(tmp5)
 [1] 7987.10446   98.19393  115.73242   54.22298   94.59983   83.45284
 [7]   94.83162   98.72565   82.07386   72.71157
> rowSd(tmp5)
 [1] 89.370602  9.909285 10.757901  7.363625  9.726245  9.135253  9.738153
 [8]  9.936078  9.059463  8.527108
> rowMax(tmp5)
 [1] 467.26370  90.40602  97.42788  85.56186  87.99912  84.56905        NA
 [8]  86.36914  86.90931  91.56817
> rowMin(tmp5)
 [1] 58.44028 57.37847 53.91465 61.42164 55.07040 58.52087       NA 54.83822
 [9] 53.13942 59.51877
> 
> colMeans(tmp5)
 [1] 108.79749  75.43970  72.93667  72.19453  72.43400  70.13980  73.34643
 [8]        NA  70.15306  71.96346  71.73004  71.87515  66.90604  74.67336
[15]  69.59442  71.07498  66.92420  74.01730  64.34322  73.45494
> colSums(tmp5)
 [1] 1087.9749  754.3970  729.3667  721.9453  724.3400  701.3980  733.4643
 [8]        NA  701.5306  719.6346  717.3004  718.7515  669.0604  746.7336
[15]  695.9442  710.7498  669.2420  740.1730  643.4322  734.5494
> colVars(tmp5)
 [1] 15952.95735   156.52757    68.51552   114.70422    57.48096    81.88780
 [7]    44.72979          NA   164.31342    71.76547    75.27255    62.22238
[13]    64.04480    98.01061    34.97097    69.25840    44.04007   123.47005
[19]    40.17828   140.67010
> colSd(tmp5)
 [1] 126.305017  12.511098   8.277410  10.710006   7.581620   9.049188
 [7]   6.688034         NA  12.818480   8.471450   8.675975   7.888116
[13]   8.002800   9.900031   5.913626   8.322163   6.636269  11.111708
[19]   6.338634  11.860443
> colMax(tmp5)
 [1] 467.26370  90.35100  85.56186  97.42788  83.80173  82.53958  85.69440
 [8]        NA  90.40602  82.92277  86.36914  81.96764  82.75094  89.08994
[15]  77.13165  84.56905  77.91614  87.05260  75.68209  91.56817
> colMin(tmp5)
 [1] 55.46780 54.83822 59.96473 58.17140 58.72844 57.35597 65.99459       NA
 [9] 53.91465 61.42164 58.44028 60.57705 57.51156 60.88979 58.52087 59.63622
[17] 57.05036 53.13942 55.07040 56.21665
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.2637
> Min(tmp5,na.rm=TRUE)
[1] 53.13942
> mean(tmp5,na.rm=TRUE)
[1] 73.16914
> Sum(tmp5,na.rm=TRUE)
[1] 14560.66
> Var(tmp5,na.rm=TRUE)
[1] 870.5599
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.80416 71.57617 71.19861 71.39812 71.31213 73.11932 70.77692 69.56299
 [9] 71.00270 72.82067
> rowSums(tmp5,na.rm=TRUE)
 [1] 1776.083 1431.523 1423.972 1427.962 1426.243 1462.386 1344.761 1391.260
 [9] 1420.054 1456.413
> rowVars(tmp5,na.rm=TRUE)
 [1] 7987.10446   98.19393  115.73242   54.22298   94.59983   83.45284
 [7]   94.83162   98.72565   82.07386   72.71157
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.370602  9.909285 10.757901  7.363625  9.726245  9.135253  9.738153
 [8]  9.936078  9.059463  8.527108
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.26370  90.40602  97.42788  85.56186  87.99912  84.56905  90.35100
 [8]  86.36914  86.90931  91.56817
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.44028 57.37847 53.91465 61.42164 55.07040 58.52087 57.35597 54.83822
 [9] 53.13942 59.51877
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.79749  75.43970  72.93667  72.19453  72.43400  70.13980  73.34643
 [8]  71.18564  70.15306  71.96346  71.73004  71.87515  66.90604  74.67336
[15]  69.59442  71.07498  66.92420  74.01730  64.34322  73.45494
> colSums(tmp5,na.rm=TRUE)
 [1] 1087.9749  754.3970  729.3667  721.9453  724.3400  701.3980  733.4643
 [8]  640.6708  701.5306  719.6346  717.3004  718.7515  669.0604  746.7336
[15]  695.9442  710.7498  669.2420  740.1730  643.4322  734.5494
> colVars(tmp5,na.rm=TRUE)
 [1] 15952.95735   156.52757    68.51552   114.70422    57.48096    81.88780
 [7]    44.72979    48.86605   164.31342    71.76547    75.27255    62.22238
[13]    64.04480    98.01061    34.97097    69.25840    44.04007   123.47005
[19]    40.17828   140.67010
> colSd(tmp5,na.rm=TRUE)
 [1] 126.305017  12.511098   8.277410  10.710006   7.581620   9.049188
 [7]   6.688034   6.990426  12.818480   8.471450   8.675975   7.888116
[13]   8.002800   9.900031   5.913626   8.322163   6.636269  11.111708
[19]   6.338634  11.860443
> colMax(tmp5,na.rm=TRUE)
 [1] 467.26370  90.35100  85.56186  97.42788  83.80173  82.53958  85.69440
 [8]  82.88396  90.40602  82.92277  86.36914  81.96764  82.75094  89.08994
[15]  77.13165  84.56905  77.91614  87.05260  75.68209  91.56817
> colMin(tmp5,na.rm=TRUE)
 [1] 55.46780 54.83822 59.96473 58.17140 58.72844 57.35597 65.99459 63.85540
 [9] 53.91465 61.42164 58.44028 60.57705 57.51156 60.88979 58.52087 59.63622
[17] 57.05036 53.13942 55.07040 56.21665
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.80416 71.57617 71.19861 71.39812 71.31213 73.11932      NaN 69.56299
 [9] 71.00270 72.82067
> rowSums(tmp5,na.rm=TRUE)
 [1] 1776.083 1431.523 1423.972 1427.962 1426.243 1462.386    0.000 1391.260
 [9] 1420.054 1456.413
> rowVars(tmp5,na.rm=TRUE)
 [1] 7987.10446   98.19393  115.73242   54.22298   94.59983   83.45284
 [7]         NA   98.72565   82.07386   72.71157
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.370602  9.909285 10.757901  7.363625  9.726245  9.135253        NA
 [8]  9.936078  9.059463  8.527108
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.26370  90.40602  97.42788  85.56186  87.99912  84.56905        NA
 [8]  86.36914  86.90931  91.56817
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.44028 57.37847 53.91465 61.42164 55.07040 58.52087       NA 54.83822
 [9] 53.13942 59.51877
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.50374  73.78289  72.53202  71.69467  72.03852  71.56022  74.16331
 [8]       NaN  71.21305  70.74576  70.74751  70.94937  66.41081  76.20487
[15]  70.14371  70.61761  67.53044  74.23958  63.08335  75.08600
> colSums(tmp5,na.rm=TRUE)
 [1] 1030.5336  664.0460  652.7882  645.2520  648.3467  644.0420  667.4697
 [8]    0.0000  640.9174  636.7119  636.7275  638.5443  597.6972  685.8439
[15]  631.2933  635.5585  607.7739  668.1562  567.7502  675.7740
> colVars(tmp5,na.rm=TRUE)
 [1] 17580.76249   145.21200    75.23793   126.23129    62.90656    69.42569
 [7]    42.81413          NA   172.21234    64.05471    73.82105    60.35808
[13]    69.29126    83.87486    35.94804    75.56227    45.41048   138.34798
[19]    27.34363   128.32488
> colSd(tmp5,na.rm=TRUE)
 [1] 132.592468  12.050394   8.673980  11.235270   7.931366   8.332208
 [7]   6.543250         NA  13.122970   8.003419   8.591918   7.769046
[13]   8.324137   9.158322   5.995668   8.692656   6.738730  11.762142
[19]   5.229114  11.328057
> colMax(tmp5,na.rm=TRUE)
 [1] 467.26370  87.74218  85.56186  97.42788  83.80173  82.53958  85.69440
 [8]      -Inf  90.40602  82.09910  86.36914  81.96764  82.75094  89.08994
[15]  77.13165  84.56905  77.91614  87.05260  70.96026  91.56817
> colMin(tmp5,na.rm=TRUE)
 [1] 55.46780 54.83822 59.96473 58.17140 58.72844 57.37847 66.79029      Inf
 [9] 53.91465 61.42164 58.44028 60.57705 57.51156 61.53931 58.52087 59.63622
[17] 57.05036 53.13942 55.07040 56.21665
> 
> 
> 
> 
> 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] 335.14943 145.92930 283.74792 256.81215 186.33634 289.24028  97.92746
 [8] 134.80685 335.51143 182.47933
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 335.14943 145.92930 283.74792 256.81215 186.33634 289.24028  97.92746
 [8] 134.80685 335.51143 182.47933
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-13 -1.136868e-13  1.705303e-13  1.421085e-14 -5.684342e-14
 [6]  2.842171e-14  8.526513e-14 -8.526513e-14 -8.526513e-14 -8.526513e-14
[11]  0.000000e+00  5.684342e-14  0.000000e+00  8.526513e-14 -1.421085e-13
[16] -1.705303e-13 -2.842171e-14  0.000000e+00 -1.136868e-13  5.684342e-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)
+ }
8   12 
6   12 
8   4 
3   17 
9   11 
1   12 
7   6 
3   6 
3   1 
9   19 
7   16 
1   9 
5   2 
9   12 
7   18 
2   3 
6   10 
8   5 
1   13 
2   3 
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.612677
> Min(tmp)
[1] -2.237441
> mean(tmp)
[1] 0.02651416
> Sum(tmp)
[1] 2.651416
> Var(tmp)
[1] 0.9486064
> 
> rowMeans(tmp)
[1] 0.02651416
> rowSums(tmp)
[1] 2.651416
> rowVars(tmp)
[1] 0.9486064
> rowSd(tmp)
[1] 0.9739643
> rowMax(tmp)
[1] 2.612677
> rowMin(tmp)
[1] -2.237441
> 
> colMeans(tmp)
  [1]  1.896589602  0.834884079 -0.965919632 -1.809911375 -0.633962694
  [6]  1.265727920  0.401893316 -0.380266482 -0.080944078  0.919550476
 [11]  1.120941769 -0.377795634 -0.685089853  0.857187394  1.070470208
 [16] -0.650313169  1.230725100 -1.146800390  0.104250661  0.747695372
 [21]  0.078030632  2.612677143  0.949788231 -0.009550016 -0.100774203
 [26] -0.287380260  0.154848137 -0.822307525 -1.473696741 -0.487935527
 [31] -0.465129641  0.174405663  1.105780720  1.128349980  1.958036104
 [36] -0.554115967  0.524577771  0.835632143 -0.468681232  0.541928372
 [41]  0.042948007  0.496781879  0.654209847  1.072456506  1.420000469
 [46]  0.385873564  0.498995824  0.805786910 -0.576526047  1.570588189
 [51] -0.381075254 -0.243156667  0.834948762 -1.023649990 -0.885950743
 [56]  0.863612721 -0.475409876  1.039635468 -1.305510772 -0.082831277
 [61] -1.611577179  0.872565108 -0.029520167  0.047251814 -0.063889866
 [66]  0.998862263 -1.885560465  0.577980109  0.424474872 -1.177640256
 [71]  0.398177779 -0.459747922 -0.866184104  0.653575686 -0.709656803
 [76] -0.518390336 -0.531350245 -0.580226594 -1.497413569 -1.216298364
 [81]  2.460761058 -1.430557156  0.281649226 -1.732953274 -0.763368028
 [86] -0.070185770  0.700714087  0.281631805  0.285167936 -0.929180699
 [91]  0.335466866 -0.818208535  0.197488758  1.740371911 -0.269152169
 [96] -1.126819227  0.486743124 -0.895608189 -2.237441387 -0.495659730
> colSums(tmp)
  [1]  1.896589602  0.834884079 -0.965919632 -1.809911375 -0.633962694
  [6]  1.265727920  0.401893316 -0.380266482 -0.080944078  0.919550476
 [11]  1.120941769 -0.377795634 -0.685089853  0.857187394  1.070470208
 [16] -0.650313169  1.230725100 -1.146800390  0.104250661  0.747695372
 [21]  0.078030632  2.612677143  0.949788231 -0.009550016 -0.100774203
 [26] -0.287380260  0.154848137 -0.822307525 -1.473696741 -0.487935527
 [31] -0.465129641  0.174405663  1.105780720  1.128349980  1.958036104
 [36] -0.554115967  0.524577771  0.835632143 -0.468681232  0.541928372
 [41]  0.042948007  0.496781879  0.654209847  1.072456506  1.420000469
 [46]  0.385873564  0.498995824  0.805786910 -0.576526047  1.570588189
 [51] -0.381075254 -0.243156667  0.834948762 -1.023649990 -0.885950743
 [56]  0.863612721 -0.475409876  1.039635468 -1.305510772 -0.082831277
 [61] -1.611577179  0.872565108 -0.029520167  0.047251814 -0.063889866
 [66]  0.998862263 -1.885560465  0.577980109  0.424474872 -1.177640256
 [71]  0.398177779 -0.459747922 -0.866184104  0.653575686 -0.709656803
 [76] -0.518390336 -0.531350245 -0.580226594 -1.497413569 -1.216298364
 [81]  2.460761058 -1.430557156  0.281649226 -1.732953274 -0.763368028
 [86] -0.070185770  0.700714087  0.281631805  0.285167936 -0.929180699
 [91]  0.335466866 -0.818208535  0.197488758  1.740371911 -0.269152169
 [96] -1.126819227  0.486743124 -0.895608189 -2.237441387 -0.495659730
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.896589602  0.834884079 -0.965919632 -1.809911375 -0.633962694
  [6]  1.265727920  0.401893316 -0.380266482 -0.080944078  0.919550476
 [11]  1.120941769 -0.377795634 -0.685089853  0.857187394  1.070470208
 [16] -0.650313169  1.230725100 -1.146800390  0.104250661  0.747695372
 [21]  0.078030632  2.612677143  0.949788231 -0.009550016 -0.100774203
 [26] -0.287380260  0.154848137 -0.822307525 -1.473696741 -0.487935527
 [31] -0.465129641  0.174405663  1.105780720  1.128349980  1.958036104
 [36] -0.554115967  0.524577771  0.835632143 -0.468681232  0.541928372
 [41]  0.042948007  0.496781879  0.654209847  1.072456506  1.420000469
 [46]  0.385873564  0.498995824  0.805786910 -0.576526047  1.570588189
 [51] -0.381075254 -0.243156667  0.834948762 -1.023649990 -0.885950743
 [56]  0.863612721 -0.475409876  1.039635468 -1.305510772 -0.082831277
 [61] -1.611577179  0.872565108 -0.029520167  0.047251814 -0.063889866
 [66]  0.998862263 -1.885560465  0.577980109  0.424474872 -1.177640256
 [71]  0.398177779 -0.459747922 -0.866184104  0.653575686 -0.709656803
 [76] -0.518390336 -0.531350245 -0.580226594 -1.497413569 -1.216298364
 [81]  2.460761058 -1.430557156  0.281649226 -1.732953274 -0.763368028
 [86] -0.070185770  0.700714087  0.281631805  0.285167936 -0.929180699
 [91]  0.335466866 -0.818208535  0.197488758  1.740371911 -0.269152169
 [96] -1.126819227  0.486743124 -0.895608189 -2.237441387 -0.495659730
> colMin(tmp)
  [1]  1.896589602  0.834884079 -0.965919632 -1.809911375 -0.633962694
  [6]  1.265727920  0.401893316 -0.380266482 -0.080944078  0.919550476
 [11]  1.120941769 -0.377795634 -0.685089853  0.857187394  1.070470208
 [16] -0.650313169  1.230725100 -1.146800390  0.104250661  0.747695372
 [21]  0.078030632  2.612677143  0.949788231 -0.009550016 -0.100774203
 [26] -0.287380260  0.154848137 -0.822307525 -1.473696741 -0.487935527
 [31] -0.465129641  0.174405663  1.105780720  1.128349980  1.958036104
 [36] -0.554115967  0.524577771  0.835632143 -0.468681232  0.541928372
 [41]  0.042948007  0.496781879  0.654209847  1.072456506  1.420000469
 [46]  0.385873564  0.498995824  0.805786910 -0.576526047  1.570588189
 [51] -0.381075254 -0.243156667  0.834948762 -1.023649990 -0.885950743
 [56]  0.863612721 -0.475409876  1.039635468 -1.305510772 -0.082831277
 [61] -1.611577179  0.872565108 -0.029520167  0.047251814 -0.063889866
 [66]  0.998862263 -1.885560465  0.577980109  0.424474872 -1.177640256
 [71]  0.398177779 -0.459747922 -0.866184104  0.653575686 -0.709656803
 [76] -0.518390336 -0.531350245 -0.580226594 -1.497413569 -1.216298364
 [81]  2.460761058 -1.430557156  0.281649226 -1.732953274 -0.763368028
 [86] -0.070185770  0.700714087  0.281631805  0.285167936 -0.929180699
 [91]  0.335466866 -0.818208535  0.197488758  1.740371911 -0.269152169
 [96] -1.126819227  0.486743124 -0.895608189 -2.237441387 -0.495659730
> colMedians(tmp)
  [1]  1.896589602  0.834884079 -0.965919632 -1.809911375 -0.633962694
  [6]  1.265727920  0.401893316 -0.380266482 -0.080944078  0.919550476
 [11]  1.120941769 -0.377795634 -0.685089853  0.857187394  1.070470208
 [16] -0.650313169  1.230725100 -1.146800390  0.104250661  0.747695372
 [21]  0.078030632  2.612677143  0.949788231 -0.009550016 -0.100774203
 [26] -0.287380260  0.154848137 -0.822307525 -1.473696741 -0.487935527
 [31] -0.465129641  0.174405663  1.105780720  1.128349980  1.958036104
 [36] -0.554115967  0.524577771  0.835632143 -0.468681232  0.541928372
 [41]  0.042948007  0.496781879  0.654209847  1.072456506  1.420000469
 [46]  0.385873564  0.498995824  0.805786910 -0.576526047  1.570588189
 [51] -0.381075254 -0.243156667  0.834948762 -1.023649990 -0.885950743
 [56]  0.863612721 -0.475409876  1.039635468 -1.305510772 -0.082831277
 [61] -1.611577179  0.872565108 -0.029520167  0.047251814 -0.063889866
 [66]  0.998862263 -1.885560465  0.577980109  0.424474872 -1.177640256
 [71]  0.398177779 -0.459747922 -0.866184104  0.653575686 -0.709656803
 [76] -0.518390336 -0.531350245 -0.580226594 -1.497413569 -1.216298364
 [81]  2.460761058 -1.430557156  0.281649226 -1.732953274 -0.763368028
 [86] -0.070185770  0.700714087  0.281631805  0.285167936 -0.929180699
 [91]  0.335466866 -0.818208535  0.197488758  1.740371911 -0.269152169
 [96] -1.126819227  0.486743124 -0.895608189 -2.237441387 -0.495659730
> colRanges(tmp)
        [,1]      [,2]       [,3]      [,4]       [,5]     [,6]      [,7]
[1,] 1.89659 0.8348841 -0.9659196 -1.809911 -0.6339627 1.265728 0.4018933
[2,] 1.89659 0.8348841 -0.9659196 -1.809911 -0.6339627 1.265728 0.4018933
           [,8]        [,9]     [,10]    [,11]      [,12]      [,13]     [,14]
[1,] -0.3802665 -0.08094408 0.9195505 1.120942 -0.3777956 -0.6850899 0.8571874
[2,] -0.3802665 -0.08094408 0.9195505 1.120942 -0.3777956 -0.6850899 0.8571874
       [,15]      [,16]    [,17]   [,18]     [,19]     [,20]      [,21]
[1,] 1.07047 -0.6503132 1.230725 -1.1468 0.1042507 0.7476954 0.07803063
[2,] 1.07047 -0.6503132 1.230725 -1.1468 0.1042507 0.7476954 0.07803063
        [,22]     [,23]        [,24]      [,25]      [,26]     [,27]      [,28]
[1,] 2.612677 0.9497882 -0.009550016 -0.1007742 -0.2873803 0.1548481 -0.8223075
[2,] 2.612677 0.9497882 -0.009550016 -0.1007742 -0.2873803 0.1548481 -0.8223075
         [,29]      [,30]      [,31]     [,32]    [,33]   [,34]    [,35]
[1,] -1.473697 -0.4879355 -0.4651296 0.1744057 1.105781 1.12835 1.958036
[2,] -1.473697 -0.4879355 -0.4651296 0.1744057 1.105781 1.12835 1.958036
         [,36]     [,37]     [,38]      [,39]     [,40]      [,41]     [,42]
[1,] -0.554116 0.5245778 0.8356321 -0.4686812 0.5419284 0.04294801 0.4967819
[2,] -0.554116 0.5245778 0.8356321 -0.4686812 0.5419284 0.04294801 0.4967819
         [,43]    [,44] [,45]     [,46]     [,47]     [,48]     [,49]    [,50]
[1,] 0.6542098 1.072457  1.42 0.3858736 0.4989958 0.8057869 -0.576526 1.570588
[2,] 0.6542098 1.072457  1.42 0.3858736 0.4989958 0.8057869 -0.576526 1.570588
          [,51]      [,52]     [,53]    [,54]      [,55]     [,56]      [,57]
[1,] -0.3810753 -0.2431567 0.8349488 -1.02365 -0.8859507 0.8636127 -0.4754099
[2,] -0.3810753 -0.2431567 0.8349488 -1.02365 -0.8859507 0.8636127 -0.4754099
        [,58]     [,59]       [,60]     [,61]     [,62]       [,63]      [,64]
[1,] 1.039635 -1.305511 -0.08283128 -1.611577 0.8725651 -0.02952017 0.04725181
[2,] 1.039635 -1.305511 -0.08283128 -1.611577 0.8725651 -0.02952017 0.04725181
           [,65]     [,66]    [,67]     [,68]     [,69]    [,70]     [,71]
[1,] -0.06388987 0.9988623 -1.88556 0.5779801 0.4244749 -1.17764 0.3981778
[2,] -0.06388987 0.9988623 -1.88556 0.5779801 0.4244749 -1.17764 0.3981778
          [,72]      [,73]     [,74]      [,75]      [,76]      [,77]
[1,] -0.4597479 -0.8661841 0.6535757 -0.7096568 -0.5183903 -0.5313502
[2,] -0.4597479 -0.8661841 0.6535757 -0.7096568 -0.5183903 -0.5313502
          [,78]     [,79]     [,80]    [,81]     [,82]     [,83]     [,84]
[1,] -0.5802266 -1.497414 -1.216298 2.460761 -1.430557 0.2816492 -1.732953
[2,] -0.5802266 -1.497414 -1.216298 2.460761 -1.430557 0.2816492 -1.732953
         [,85]       [,86]     [,87]     [,88]     [,89]      [,90]     [,91]
[1,] -0.763368 -0.07018577 0.7007141 0.2816318 0.2851679 -0.9291807 0.3354669
[2,] -0.763368 -0.07018577 0.7007141 0.2816318 0.2851679 -0.9291807 0.3354669
          [,92]     [,93]    [,94]      [,95]     [,96]     [,97]      [,98]
[1,] -0.8182085 0.1974888 1.740372 -0.2691522 -1.126819 0.4867431 -0.8956082
[2,] -0.8182085 0.1974888 1.740372 -0.2691522 -1.126819 0.4867431 -0.8956082
         [,99]     [,100]
[1,] -2.237441 -0.4956597
[2,] -2.237441 -0.4956597
> 
> 
> Max(tmp2)
[1] 2.519686
> Min(tmp2)
[1] -2.311405
> mean(tmp2)
[1] 0.08063297
> Sum(tmp2)
[1] 8.063297
> Var(tmp2)
[1] 0.9711021
> 
> rowMeans(tmp2)
  [1] -0.282040138 -1.198391336 -0.988798024  0.464387250  0.083743859
  [6]  0.230340593  1.695216533  0.244832621  2.519685950 -2.303885983
 [11] -0.961233197  1.254596700 -0.050104044 -1.478654891 -0.615429135
 [16] -1.245415241 -2.311405149 -0.208178269  0.787927561  0.325056906
 [21] -0.454866608 -1.119296187  0.406623552  0.393326615 -0.977885920
 [26]  0.379921851 -0.956359851  0.972535199  1.203916924  0.802564678
 [31] -0.015697469 -0.537478132  0.015688114  1.270550001 -0.750773662
 [36] -0.455849088 -1.907368752 -0.684754245 -1.236728757  1.046260490
 [41]  0.705173245  0.952398663  0.198695233 -0.555491580 -0.011363207
 [46]  0.261455651  1.390816579  0.806771944 -0.457047485  0.816814906
 [51] -0.590931960 -1.209411440 -0.639479436  0.817219885  0.004756462
 [56] -0.409394186  0.001848666  1.879340066  0.934053816  2.412284885
 [61] -0.936098643 -0.009339883 -0.534999865  0.691412356 -0.175328356
 [66]  0.292010110  2.252339589 -0.149328030  2.171429180  0.009389004
 [71]  0.398272273  0.274783048 -0.618569588  1.008078448 -0.576665290
 [76]  0.686565148  0.236435751 -0.722958406  1.111831454  1.305625786
 [81] -1.020416991  0.304976508  2.287010821  0.052543703  0.820884725
 [86]  0.561053683 -0.831572936  1.559508488  0.853424037 -0.218221462
 [91] -0.359109336 -0.535755944 -0.294785890 -0.906696627  0.451847751
 [96] -0.660796571  0.358170345 -0.621114408 -0.643986458 -0.473642299
> rowSums(tmp2)
  [1] -0.282040138 -1.198391336 -0.988798024  0.464387250  0.083743859
  [6]  0.230340593  1.695216533  0.244832621  2.519685950 -2.303885983
 [11] -0.961233197  1.254596700 -0.050104044 -1.478654891 -0.615429135
 [16] -1.245415241 -2.311405149 -0.208178269  0.787927561  0.325056906
 [21] -0.454866608 -1.119296187  0.406623552  0.393326615 -0.977885920
 [26]  0.379921851 -0.956359851  0.972535199  1.203916924  0.802564678
 [31] -0.015697469 -0.537478132  0.015688114  1.270550001 -0.750773662
 [36] -0.455849088 -1.907368752 -0.684754245 -1.236728757  1.046260490
 [41]  0.705173245  0.952398663  0.198695233 -0.555491580 -0.011363207
 [46]  0.261455651  1.390816579  0.806771944 -0.457047485  0.816814906
 [51] -0.590931960 -1.209411440 -0.639479436  0.817219885  0.004756462
 [56] -0.409394186  0.001848666  1.879340066  0.934053816  2.412284885
 [61] -0.936098643 -0.009339883 -0.534999865  0.691412356 -0.175328356
 [66]  0.292010110  2.252339589 -0.149328030  2.171429180  0.009389004
 [71]  0.398272273  0.274783048 -0.618569588  1.008078448 -0.576665290
 [76]  0.686565148  0.236435751 -0.722958406  1.111831454  1.305625786
 [81] -1.020416991  0.304976508  2.287010821  0.052543703  0.820884725
 [86]  0.561053683 -0.831572936  1.559508488  0.853424037 -0.218221462
 [91] -0.359109336 -0.535755944 -0.294785890 -0.906696627  0.451847751
 [96] -0.660796571  0.358170345 -0.621114408 -0.643986458 -0.473642299
> 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.282040138 -1.198391336 -0.988798024  0.464387250  0.083743859
  [6]  0.230340593  1.695216533  0.244832621  2.519685950 -2.303885983
 [11] -0.961233197  1.254596700 -0.050104044 -1.478654891 -0.615429135
 [16] -1.245415241 -2.311405149 -0.208178269  0.787927561  0.325056906
 [21] -0.454866608 -1.119296187  0.406623552  0.393326615 -0.977885920
 [26]  0.379921851 -0.956359851  0.972535199  1.203916924  0.802564678
 [31] -0.015697469 -0.537478132  0.015688114  1.270550001 -0.750773662
 [36] -0.455849088 -1.907368752 -0.684754245 -1.236728757  1.046260490
 [41]  0.705173245  0.952398663  0.198695233 -0.555491580 -0.011363207
 [46]  0.261455651  1.390816579  0.806771944 -0.457047485  0.816814906
 [51] -0.590931960 -1.209411440 -0.639479436  0.817219885  0.004756462
 [56] -0.409394186  0.001848666  1.879340066  0.934053816  2.412284885
 [61] -0.936098643 -0.009339883 -0.534999865  0.691412356 -0.175328356
 [66]  0.292010110  2.252339589 -0.149328030  2.171429180  0.009389004
 [71]  0.398272273  0.274783048 -0.618569588  1.008078448 -0.576665290
 [76]  0.686565148  0.236435751 -0.722958406  1.111831454  1.305625786
 [81] -1.020416991  0.304976508  2.287010821  0.052543703  0.820884725
 [86]  0.561053683 -0.831572936  1.559508488  0.853424037 -0.218221462
 [91] -0.359109336 -0.535755944 -0.294785890 -0.906696627  0.451847751
 [96] -0.660796571  0.358170345 -0.621114408 -0.643986458 -0.473642299
> rowMin(tmp2)
  [1] -0.282040138 -1.198391336 -0.988798024  0.464387250  0.083743859
  [6]  0.230340593  1.695216533  0.244832621  2.519685950 -2.303885983
 [11] -0.961233197  1.254596700 -0.050104044 -1.478654891 -0.615429135
 [16] -1.245415241 -2.311405149 -0.208178269  0.787927561  0.325056906
 [21] -0.454866608 -1.119296187  0.406623552  0.393326615 -0.977885920
 [26]  0.379921851 -0.956359851  0.972535199  1.203916924  0.802564678
 [31] -0.015697469 -0.537478132  0.015688114  1.270550001 -0.750773662
 [36] -0.455849088 -1.907368752 -0.684754245 -1.236728757  1.046260490
 [41]  0.705173245  0.952398663  0.198695233 -0.555491580 -0.011363207
 [46]  0.261455651  1.390816579  0.806771944 -0.457047485  0.816814906
 [51] -0.590931960 -1.209411440 -0.639479436  0.817219885  0.004756462
 [56] -0.409394186  0.001848666  1.879340066  0.934053816  2.412284885
 [61] -0.936098643 -0.009339883 -0.534999865  0.691412356 -0.175328356
 [66]  0.292010110  2.252339589 -0.149328030  2.171429180  0.009389004
 [71]  0.398272273  0.274783048 -0.618569588  1.008078448 -0.576665290
 [76]  0.686565148  0.236435751 -0.722958406  1.111831454  1.305625786
 [81] -1.020416991  0.304976508  2.287010821  0.052543703  0.820884725
 [86]  0.561053683 -0.831572936  1.559508488  0.853424037 -0.218221462
 [91] -0.359109336 -0.535755944 -0.294785890 -0.906696627  0.451847751
 [96] -0.660796571  0.358170345 -0.621114408 -0.643986458 -0.473642299
> 
> colMeans(tmp2)
[1] 0.08063297
> colSums(tmp2)
[1] 8.063297
> colVars(tmp2)
[1] 0.9711021
> colSd(tmp2)
[1] 0.9854451
> colMax(tmp2)
[1] 2.519686
> colMin(tmp2)
[1] -2.311405
> colMedians(tmp2)
[1] 0.007072733
> colRanges(tmp2)
          [,1]
[1,] -2.311405
[2,]  2.519686
> 
> 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] -2.5025935  1.4669756 -0.6834297 -3.8731925  5.7166044 -0.6077226
 [7]  8.7301826  1.4871365 -4.4957503  0.6221203
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.93144917
[2,] -0.51285090
[3,] -0.05923903
[4,]  0.18652452
[5,]  1.30435112
> 
> rowApply(tmp,sum)
 [1]  2.75149168  3.09637000  3.62065149 -1.80574291  2.71044503  0.83716554
 [7] -0.08016221  1.09767215 -4.88854616 -1.47901375
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    1    8    1    4    7    6    5    6     6
 [2,]    6    3    9    5    9    4    1    9    2     5
 [3,]    1    7    5    9    6    1    4    6   10     3
 [4,]    2    2    1   10    3    2    5    3    7     2
 [5,]    9    5    6    8    7   10   10    2    3    10
 [6,]    3    8    4    2    1    6    9    4    9     8
 [7,]   10    9   10    6   10    9    2    8    5     4
 [8,]    8   10    7    7    8    5    8    7    1     7
 [9,]    5    4    2    3    2    3    3    1    4     9
[10,]    4    6    3    4    5    8    7   10    8     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.3341941 -2.9367896  0.9732163 -1.9929314 -1.1523276 -4.0368656
 [7]  0.7260721 -2.8159348  2.5317477 -4.2133114  2.8616342  0.5446277
[13] -0.6777031  3.3912593 -3.4325202 -2.5745374 -3.1626653  3.2846990
[19]  3.7007189  0.1160122
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.58793345
[2,] -0.34194524
[3,] -0.25369265
[4,]  0.02353248
[5,]  0.82584475
> 
> rowApply(tmp,sum)
[1]  2.014214 -4.974663  1.061904 -1.758649 -5.542600
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    7    9    8   18
[2,]    4    6    1   15   17
[3,]   11    3   12   16   19
[4,]   19    1   18    1   11
[5,]   18   16    6    4    4
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]        [,4]       [,5]       [,6]
[1,]  0.02353248 -0.7592185  0.2600566  1.00416722  0.8577883  0.6247474
[2,] -0.58793345 -0.6883390 -1.5351761 -2.22768784  0.6031078 -1.0193306
[3,] -0.34194524 -2.3720074  0.4124731  1.08256958 -0.7570344 -1.8946144
[4,] -0.25369265  0.3842230  0.6741738 -1.80823739 -0.6631915  0.1491967
[5,]  0.82584475  0.4985522  1.1616889 -0.04374302 -1.1929977 -1.8968647
           [,7]       [,8]       [,9]      [,10]       [,11]      [,12]
[1,] -0.9616546  0.3613853 -0.3005701  0.6170677  0.47018269  0.2319422
[2,] -0.2603693 -0.5119324  0.6795873 -1.2132629  0.32305690  0.1609486
[3,]  1.0418030 -1.3960539  0.8741455 -0.7372070  1.77725414  0.5224402
[4,]  1.1006351 -1.6674470  1.1324874  0.2225041 -0.05582847 -0.5459318
[5,] -0.1943421  0.3981132  0.1460976 -3.1024133  0.34696896  0.1752286
          [,13]      [,14]      [,15]       [,16]      [,17]       [,18]
[1,] -1.2676763  0.6901223  1.6932551  0.14811768 -1.7856216  0.04890767
[2,] -0.2444181  0.1662028 -1.6155288 -0.36341900 -0.5617723  1.76327181
[3,]  0.4082189  3.4966727 -0.4626319 -1.34596798 -1.0888103  1.01585122
[4,]  0.8212100 -0.6066100 -0.8486318  0.08402475  0.6987599 -0.03456117
[5,] -0.3950377 -0.3551285 -2.1989827 -1.09729288 -0.4252210  0.49122944
          [,19]      [,20]
[1,]  0.6453682 -0.5876853
[2,]  1.4182938  0.7400378
[3,]  0.3683319  0.4584167
[4,] -0.1903600 -0.3513720
[5,]  1.4590851 -0.1433849
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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.2120096 0.3111301 -2.25217 0.9892139 1.528963 -0.4307043 0.5294793
           col8      col9       col10    col11      col12     col13     col14
row1 0.06175362 -1.331713 -0.08945914 1.088718 -0.1339928 -1.363032 -1.230935
         col15      col16    col17     col18     col19     col20
row1 0.2004633 -0.4354035 2.264343 -1.083627 -1.300331 -1.900628
> tmp[,"col10"]
           col10
row1 -0.08945914
row2 -1.44509822
row3 -0.81719556
row4  0.10716528
row5 -0.55495420
> tmp[c("row1","row5"),]
           col1       col2      col3       col4       col5       col6
row1  0.2120096  0.3111301 -2.252170  0.9892139  1.5289629 -0.4307043
row5 -1.3263012 -1.8212481  1.834946 -0.3385454 -0.2662794  0.2301634
            col7       col8       col9       col10    col11      col12
row1 0.529479250 0.06175362 -1.3317128 -0.08945914 1.088718 -0.1339928
row5 0.008759723 0.47338812  0.2475705 -0.55495420 1.237337  0.3461808
          col13      col14     col15      col16       col17     col18
row1 -1.3630320 -1.2309352 0.2004633 -0.4354035  2.26434318 -1.083627
row5 -0.1096652 -0.5885351 0.7590660 -0.8139933 -0.03628988 -0.398006
          col19      col20
row1 -1.3003313 -1.9006278
row5 -0.5895293 -0.7233096
> tmp[,c("col6","col20")]
            col6       col20
row1 -0.43070429 -1.90062783
row2 -1.66382914  1.69276233
row3  1.79105535  0.19906719
row4  0.03034452  0.08661463
row5  0.23016340 -0.72330963
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.4307043 -1.9006278
row5  0.2301634 -0.7233096
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6    col7     col8
row1 50.05136 50.46245 51.03441 51.11253 48.92401 104.8698 50.6082 47.70256
         col9    col10   col11    col12    col13    col14    col15    col16
row1 50.11045 48.90419 49.2606 49.18968 49.84126 50.26705 50.41606 49.43528
        col17    col18   col19    col20
row1 50.18335 51.06329 50.4688 105.6287
> tmp[,"col10"]
        col10
row1 48.90419
row2 30.42905
row3 30.41899
row4 30.22638
row5 50.88239
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.05136 50.46245 51.03441 51.11253 48.92401 104.8698 50.60820 47.70256
row5 50.31022 50.46280 48.16701 49.00917 50.09548 104.6213 48.72699 50.41134
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.11045 48.90419 49.26060 49.18968 49.84126 50.26705 50.41606 49.43528
row5 49.36800 50.88239 48.46375 49.45305 49.89999 50.09209 49.71994 50.74127
        col17    col18    col19    col20
row1 50.18335 51.06329 50.46880 105.6287
row5 50.67380 50.09635 49.87199 104.2777
> tmp[,c("col6","col20")]
          col6     col20
row1 104.86976 105.62873
row2  76.21319  77.01878
row3  75.86838  75.16216
row4  73.78087  74.28408
row5 104.62135 104.27765
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.8698 105.6287
row5 104.6213 104.2777
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.8698 105.6287
row5 104.6213 104.2777
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -1.16728069
[2,] -0.01545286
[3,] -0.55464182
[4,] -0.10323899
[5,]  2.18936627
> tmp[,c("col17","col7")]
          col17        col7
[1,]  1.2003546 -1.66365037
[2,]  0.6052660 -1.08624394
[3,] -0.6225195  0.04661716
[4,] -1.0418863  0.23602685
[5,]  0.9422002  0.03691252
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.9791782 -1.8232745
[2,] -0.2265028 -1.0101809
[3,]  0.3856856 -0.4281318
[4,]  1.3357317  0.3056942
[5,]  1.1865141 -0.3594322
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9791782
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9791782
[2,] -0.2265028
> 
> 
> 
> 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.70381202 -0.5620929 -0.3903651 -0.9701104  1.942884 -0.24146299
row1  0.05483471 -0.6469547 -0.3769169  1.0425160 -1.459007  0.04650051
           [,7]      [,8]       [,9]     [,10]      [,11]     [,12]      [,13]
row3 -0.2600884 1.3976000  0.7865235 2.5863825  0.5390881  0.816154  0.8232203
row1  0.4189600 0.3506974 -1.1603252 0.1462168 -0.9945674 -0.842831 -0.4106163
          [,14]      [,15]      [,16]      [,17]     [,18]     [,19]     [,20]
row3 -1.0496021  0.6494588  0.5033691 -0.2719899 1.0181090 1.1391758 0.9846642
row1  0.4938553 -1.2858766 -0.7860082 -0.1500368 0.2176228 0.9385928 0.2882700
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]       [,4]     [,5]    [,6]      [,7]
row2 0.2787434 -0.8270983 -0.5726914 -0.5668674 1.582554 2.53558 -1.295531
          [,8]     [,9]      [,10]
row2 0.1068237 1.128008 -0.1607856
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]      [,4]      [,5]       [,6]     [,7]
row5 0.1485406 -1.546554 -1.374303 -1.465393 -0.140952 -0.1432165 2.714233
         [,8]      [,9]      [,10]      [,11]      [,12]    [,13]     [,14]
row5 1.043376 0.8902445 -0.5555493 -0.3788487 -0.6372748 1.183724 0.2761796
        [,15]    [,16]    [,17]    [,18]     [,19]     [,20]
row5 0.794042 1.672018 1.968901 1.581702 0.1731454 0.7504365
> 
> 
> 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: 0x600001a982a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b26839d968"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b22df0704d"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b245ce6cb" 
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b26f341ba9"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b246042d48"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b23c38f5e1"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b23f96a5aa"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b23b565c83"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b222d3bae4"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b27a92e098"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b240d75a06"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b27a57612b"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b27eac8ccc"
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b2724fe60c"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BMc3b25b885875"
> 
> 
> ### 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: 0x600001a38000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001a38000>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001a38000>
> rowMedians(tmp)
  [1]  0.491715229  0.451375619  0.297592488  0.376959809  0.476398405
  [6]  0.165698585 -0.102570031 -0.302017434 -0.635985944 -0.102822691
 [11] -0.630173561 -0.314093072 -0.045455823  0.164081371  0.076884042
 [16]  0.365566320 -0.533241023 -0.312935173  0.314901206  0.454529584
 [21] -0.589593147 -0.133519187  0.107416812  0.361861396  1.081836949
 [26] -0.063427552  0.291338880  0.756404162  0.368044466 -0.255486409
 [31] -0.104823577  0.198425012  0.038389412 -0.068682739 -0.166682840
 [36]  0.129796993 -0.069033166 -0.346807448 -0.303893070  0.174630187
 [41] -0.173024149  0.297043246  0.267559682 -0.824212061 -0.190905921
 [46]  0.287431387  0.148063957  0.006449487 -0.016117775  0.233159256
 [51]  0.257555588 -0.536043851 -0.229308243  0.402522167  0.505667388
 [56]  0.676634985 -0.174796778 -0.129970996 -0.216153273  0.099233479
 [61]  0.085855368  0.612921061  0.072887507  0.219425259 -0.156879390
 [66]  0.059071232  0.149237865  0.049411047 -0.762507409 -0.425339872
 [71]  0.234147955  0.144064765  0.148554182 -0.330973429  0.250142434
 [76]  0.552095613 -0.357348783  0.209750552  0.136086155 -0.328037090
 [81]  0.251312017  0.108047092  0.163341954  0.056389394  0.062805840
 [86] -0.372661323  0.402385627 -0.416121809 -0.058252468  0.015098546
 [91]  0.048497203 -0.075983201 -0.140451938  0.110464793  0.001091780
 [96] -0.583740210  0.177115699 -0.273260298 -0.163821468  0.088993561
[101]  0.144583346  0.365671106  0.096311005  0.225724226  0.226565491
[106] -0.260099119  0.839204312  0.005995107 -0.265039994 -0.622325258
[111] -0.078031672 -0.690538269 -0.521785104 -0.339152156 -0.141462549
[116]  0.281225645 -0.043374247 -0.176769730  0.531955700 -0.115498608
[121] -0.099057372  0.665190600 -0.216461794 -0.220502757 -0.600186034
[126] -0.419518800 -0.627332374  0.365860757  0.223610779  0.580164146
[131]  0.298824701 -0.184657385  0.711937720  0.262668807  0.078977069
[136]  0.624635976  0.402993178 -0.136001014  0.304468638 -0.083070312
[141]  0.133105754  0.114619887  0.487764027  0.022577287 -0.265584388
[146]  0.115488758 -0.198926823 -0.211587764  0.080006317 -0.242728515
[151] -0.341485067 -0.007938497 -0.149296250  0.132801707 -0.303595454
[156]  0.170767802  0.032337953 -0.068639452  0.163429359 -0.371788350
[161] -0.064453828 -0.199401363  0.052824705 -0.085749091  0.387219971
[166] -0.028963092 -0.094147624  0.114886656 -0.286217191  0.136093068
[171]  0.451727773 -0.094039779  0.400945991 -0.301025861 -0.418638287
[176] -0.063501677 -0.359919964  0.108757302 -0.596223550 -0.065779010
[181]  0.390358205 -0.081632898  0.143889134 -0.376967767  0.236378130
[186]  0.342167454  0.116801168  0.094761401 -0.082017963  0.256664679
[191] -0.009857821  0.143821309 -0.089013950  0.390979871 -0.184163606
[196] -0.576508596 -0.124694188 -0.177313463 -0.126169022 -0.014520932
[201] -0.021382033 -0.046355201 -0.282259937  0.188302583 -0.266463894
[206] -0.020670333 -0.110908004 -0.201936351  0.274009454  0.046540633
[211]  0.146959554 -0.174552149 -0.177176649  0.439178228  0.259110270
[216]  0.614625373  0.185264484 -0.276800635  0.023837417 -0.305766700
[221] -0.033859627 -0.204010971 -0.497947593 -0.016584492  0.231866419
[226]  0.153870306  0.162887669  0.134028388 -0.136818035  0.381139442
> 
> proc.time()
   user  system elapsed 
  2.743  16.444  20.036 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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: 0x600003bf8000>
> .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: 0x600003bf8000>
> .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: 0x600003bf8000>
> .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: 0x600003bf8000>
> 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: 0x600003bfc360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc360>
> .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: 0x600003bfc360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bfc360>
> .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: 0x600003bfc360>
> 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: 0x600003bb00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bb00c0>
> .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: 0x600003bb00c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003bb00c0>
> .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: 0x600003bb00c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003bb00c0>
> .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: 0x600003bb00c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003bb00c0>
> .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: 0x600003bb00c0>
> 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: 0x600003bf00c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003bf00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bf00c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bf00c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec9612244becb" "BufferedMatrixFilec9614f4a1300"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec9612244becb" "BufferedMatrixFilec9614f4a1300"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bc8000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bc8000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003bc8000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003bc8000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003bc8000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003bc8000>
> .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: 0x600003bc8180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003bc8180>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003bc8180>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003bc8180>
> 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: 0x600003bac060>
> .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: 0x600003bac060>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.355   0.172   0.515 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

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.335   0.100   0.423 

Example timings