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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_64R Under development (unstable) (2025-03-13 r87965) -- "Unsuffered Consequences" 4777
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2025-03-01 r87860 ucrt) -- "Unsuffered Consequences" 4545
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences" 4576
kjohnson3macOS 13.7.1 Venturaarm64R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences" 4528
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4458
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/2313HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.71.1  (landing page)
Ben Bolstad
Snapshot Date: 2025-03-20 13:40 -0400 (Thu, 20 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
kjohnson3macOS 13.7.1 Ventura / arm64  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-20 19:42:30 -0400 (Thu, 20 Mar 2025)
EndedAt: 2025-03-20 19:43:20 -0400 (Thu, 20 Mar 2025)
EllapsedTime: 50.5 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.343   0.150   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 20 19:42:54 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 20 19:42:54 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: 0x600001ff0000>
> 
> 
> 
> 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 20 19:42:59 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 20 19:43:01 2025"
> 
> ColMode(tmp2)
<pointer: 0x600001ff0000>
> 
> 
> 
> ### 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.5483493  0.1890729 -1.6207225 0.3270184
[2,]  0.2678773 -0.5703456 -0.1164796 0.9175882
[3,]  0.6948394  1.0275439  0.1655387 2.0126216
[4,]  0.7815814  1.1148010 -0.5294338 0.5912750
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.5483493 0.1890729 1.6207225 0.3270184
[2,]  0.2678773 0.5703456 0.1164796 0.9175882
[3,]  0.6948394 1.0275439 0.1655387 2.0126216
[4,]  0.7815814 1.1148010 0.5294338 0.5912750
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9773919 0.4348251 1.2730760 0.5718552
[2,] 0.5175687 0.7552123 0.3412911 0.9579082
[3,] 0.8335703 1.0136784 0.4068645 1.4186690
[4,] 0.8840709 1.0558414 0.7276221 0.7689441
> 
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.32227 29.53732 39.35148 31.04557
[2,]  30.44356 33.12247 28.52939 35.49667
[3,]  34.03054 36.16433 29.23418 41.19931
[4,]  34.62229 36.67321 32.80565 33.28072
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001fec000>
> exp(tmp5)
<pointer: 0x600001fec000>
> log(tmp5,2)
<pointer: 0x600001fec000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.8974
> Min(tmp5)
[1] 53.10019
> mean(tmp5)
[1] 71.85016
> Sum(tmp5)
[1] 14370.03
> Var(tmp5)
[1] 859.4981
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.40337 65.33155 69.25642 67.28750 73.52262 68.11663 76.41579 68.30855
 [9] 69.59557 70.26361
> rowSums(tmp5)
 [1] 1808.067 1306.631 1385.128 1345.750 1470.452 1362.333 1528.316 1366.171
 [9] 1391.911 1405.272
> rowVars(tmp5)
 [1] 7941.09914   56.78048   52.36654   68.84590   65.67305   47.74760
 [7]   91.28683   70.46587   25.35998   85.66091
> rowSd(tmp5)
 [1] 89.112845  7.535282  7.236473  8.297343  8.103891  6.909964  9.554414
 [8]  8.394395  5.035869  9.255318
> rowMax(tmp5)
 [1] 466.89741  81.33070  85.75097  82.55602  87.59836  79.75834  92.51758
 [8]  84.12810  79.49515  88.94603
> rowMin(tmp5)
 [1] 56.99665 55.01681 56.91624 53.63958 55.59003 58.64905 56.30344 53.10019
 [9] 60.43225 56.62140
> 
> colMeans(tmp5)
 [1] 109.78416  66.45222  70.04204  70.16366  68.78187  72.26776  67.97144
 [8]  72.54782  68.87135  71.10127  70.97417  67.07739  63.52400  73.95304
[15]  71.76662  67.24892  70.08082  71.79610  70.52710  72.07151
> colSums(tmp5)
 [1] 1097.8416  664.5222  700.4204  701.6366  687.8187  722.6776  679.7144
 [8]  725.4782  688.7135  711.0127  709.7417  670.7739  635.2400  739.5304
[15]  717.6662  672.4892  700.8082  717.9610  705.2710  720.7151
> colVars(tmp5)
 [1] 15825.28047    78.14038    88.00765    68.57937    88.98737    97.73069
 [7]    42.16576    69.52915   122.30644    22.48079    79.87217    27.46264
[13]    39.30809    52.00784    68.42178    82.28775    70.65864   127.18489
[19]    82.09988    58.39177
> colSd(tmp5)
 [1] 125.798571   8.839705   9.381239   8.281266   9.433312   9.885883
 [7]   6.493517   8.338414  11.059224   4.741391   8.937123   5.240481
[13]   6.269617   7.211646   8.271746   9.071259   8.405870  11.277628
[19]   9.060898   7.641451
> colMax(tmp5)
 [1] 466.89741  78.26495  81.90496  85.75097  85.24978  85.87529  80.99293
 [8]  83.79643  88.94603  81.46497  84.12810  77.67460  75.10996  87.69272
[15]  88.83979  82.55602  87.21515  92.51758  81.69411  85.41519
> colMin(tmp5)
 [1] 59.67566 53.10019 55.59003 56.30344 56.99665 56.91624 56.34907 58.23568
 [9] 53.63958 65.39411 56.74463 61.12786 55.01681 66.59774 60.07216 54.95892
[17] 58.53527 56.83910 56.25645 61.65913
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.40337       NA 69.25642 67.28750 73.52262 68.11663 76.41579 68.30855
 [9] 69.59557 70.26361
> rowSums(tmp5)
 [1] 1808.067       NA 1385.128 1345.750 1470.452 1362.333 1528.316 1366.171
 [9] 1391.911 1405.272
> rowVars(tmp5)
 [1] 7941.09914   55.21653   52.36654   68.84590   65.67305   47.74760
 [7]   91.28683   70.46587   25.35998   85.66091
> rowSd(tmp5)
 [1] 89.112845  7.430783  7.236473  8.297343  8.103891  6.909964  9.554414
 [8]  8.394395  5.035869  9.255318
> rowMax(tmp5)
 [1] 466.89741        NA  85.75097  82.55602  87.59836  79.75834  92.51758
 [8]  84.12810  79.49515  88.94603
> rowMin(tmp5)
 [1] 56.99665       NA 56.91624 53.63958 55.59003 58.64905 56.30344 53.10019
 [9] 60.43225 56.62140
> 
> colMeans(tmp5)
 [1] 109.78416  66.45222  70.04204  70.16366  68.78187  72.26776        NA
 [8]  72.54782  68.87135  71.10127  70.97417  67.07739  63.52400  73.95304
[15]  71.76662  67.24892  70.08082  71.79610  70.52710  72.07151
> colSums(tmp5)
 [1] 1097.8416  664.5222  700.4204  701.6366  687.8187  722.6776        NA
 [8]  725.4782  688.7135  711.0127  709.7417  670.7739  635.2400  739.5304
[15]  717.6662  672.4892  700.8082  717.9610  705.2710  720.7151
> colVars(tmp5)
 [1] 15825.28047    78.14038    88.00765    68.57937    88.98737    97.73069
 [7]          NA    69.52915   122.30644    22.48079    79.87217    27.46264
[13]    39.30809    52.00784    68.42178    82.28775    70.65864   127.18489
[19]    82.09988    58.39177
> colSd(tmp5)
 [1] 125.798571   8.839705   9.381239   8.281266   9.433312   9.885883
 [7]         NA   8.338414  11.059224   4.741391   8.937123   5.240481
[13]   6.269617   7.211646   8.271746   9.071259   8.405870  11.277628
[19]   9.060898   7.641451
> colMax(tmp5)
 [1] 466.89741  78.26495  81.90496  85.75097  85.24978  85.87529        NA
 [8]  83.79643  88.94603  81.46497  84.12810  77.67460  75.10996  87.69272
[15]  88.83979  82.55602  87.21515  92.51758  81.69411  85.41519
> colMin(tmp5)
 [1] 59.67566 53.10019 55.59003 56.30344 56.99665 56.91624       NA 58.23568
 [9] 53.63958 65.39411 56.74463 61.12786 55.01681 66.59774 60.07216 54.95892
[17] 58.53527 56.83910 56.25645 61.65913
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.8974
> Min(tmp5,na.rm=TRUE)
[1] 53.10019
> mean(tmp5,na.rm=TRUE)
[1] 71.92806
> Sum(tmp5,na.rm=TRUE)
[1] 14313.68
> Var(tmp5,na.rm=TRUE)
[1] 862.6193
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.40337 65.80431 69.25642 67.28750 73.52262 68.11663 76.41579 68.30855
 [9] 69.59557 70.26361
> rowSums(tmp5,na.rm=TRUE)
 [1] 1808.067 1250.282 1385.128 1345.750 1470.452 1362.333 1528.316 1366.171
 [9] 1391.911 1405.272
> rowVars(tmp5,na.rm=TRUE)
 [1] 7941.09914   55.21653   52.36654   68.84590   65.67305   47.74760
 [7]   91.28683   70.46587   25.35998   85.66091
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.112845  7.430783  7.236473  8.297343  8.103891  6.909964  9.554414
 [8]  8.394395  5.035869  9.255318
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.89741  81.33070  85.75097  82.55602  87.59836  79.75834  92.51758
 [8]  84.12810  79.49515  88.94603
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.99665 55.01681 56.91624 53.63958 55.59003 58.64905 56.30344 53.10019
 [9] 60.43225 56.62140
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.78416  66.45222  70.04204  70.16366  68.78187  72.26776  69.26281
 [8]  72.54782  68.87135  71.10127  70.97417  67.07739  63.52400  73.95304
[15]  71.76662  67.24892  70.08082  71.79610  70.52710  72.07151
> colSums(tmp5,na.rm=TRUE)
 [1] 1097.8416  664.5222  700.4204  701.6366  687.8187  722.6776  623.3653
 [8]  725.4782  688.7135  711.0127  709.7417  670.7739  635.2400  739.5304
[15]  717.6662  672.4892  700.8082  717.9610  705.2710  720.7151
> colVars(tmp5,na.rm=TRUE)
 [1] 15825.28047    78.14038    88.00765    68.57937    88.98737    97.73069
 [7]    28.67545    69.52915   122.30644    22.48079    79.87217    27.46264
[13]    39.30809    52.00784    68.42178    82.28775    70.65864   127.18489
[19]    82.09988    58.39177
> colSd(tmp5,na.rm=TRUE)
 [1] 125.798571   8.839705   9.381239   8.281266   9.433312   9.885883
 [7]   5.354946   8.338414  11.059224   4.741391   8.937123   5.240481
[13]   6.269617   7.211646   8.271746   9.071259   8.405870  11.277628
[19]   9.060898   7.641451
> colMax(tmp5,na.rm=TRUE)
 [1] 466.89741  78.26495  81.90496  85.75097  85.24978  85.87529  80.99293
 [8]  83.79643  88.94603  81.46497  84.12810  77.67460  75.10996  87.69272
[15]  88.83979  82.55602  87.21515  92.51758  81.69411  85.41519
> colMin(tmp5,na.rm=TRUE)
 [1] 59.67566 53.10019 55.59003 56.30344 56.99665 56.91624 63.58136 58.23568
 [9] 53.63958 65.39411 56.74463 61.12786 55.01681 66.59774 60.07216 54.95892
[17] 58.53527 56.83910 56.25645 61.65913
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.40337      NaN 69.25642 67.28750 73.52262 68.11663 76.41579 68.30855
 [9] 69.59557 70.26361
> rowSums(tmp5,na.rm=TRUE)
 [1] 1808.067    0.000 1385.128 1345.750 1470.452 1362.333 1528.316 1366.171
 [9] 1391.911 1405.272
> rowVars(tmp5,na.rm=TRUE)
 [1] 7941.09914         NA   52.36654   68.84590   65.67305   47.74760
 [7]   91.28683   70.46587   25.35998   85.66091
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.112845        NA  7.236473  8.297343  8.103891  6.909964  9.554414
 [8]  8.394395  5.035869  9.255318
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.89741        NA  85.75097  82.55602  87.59836  79.75834  92.51758
 [8]  84.12810  79.49515  88.94603
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.99665       NA 56.91624 53.63958 55.59003 58.64905 56.30344 53.10019
 [9] 60.43225 56.62140
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.94192  66.17579  71.22669  69.75055  69.15007  73.93257       NaN
 [8]  73.37977  68.72293  71.43639  72.55522  66.63117  64.46925  74.77030
[15]  72.07977  67.80084  68.83083  73.45799  71.62275  71.29144
> colSums(tmp5,na.rm=TRUE)
 [1] 1034.4773  595.5821  641.0402  627.7549  622.3506  665.3931    0.0000
 [8]  660.4180  618.5063  642.9275  652.9970  599.6805  580.2232  672.9327
[15]  648.7179  610.2076  619.4775  661.1219  644.6048  641.6230
> colVars(tmp5,na.rm=TRUE)
 [1] 17504.16218    87.04828    83.22040    75.23185    98.58559    78.76660
 [7]          NA    70.43364   137.34691    24.02745    61.73402    28.65547
[13]    34.16989    50.99486    75.87129    89.14680    61.91322   112.01192
[19]    78.85719    58.84498
> colSd(tmp5,na.rm=TRUE)
 [1] 132.303296   9.329967   9.122521   8.673630   9.929027   8.875055
 [7]         NA   8.392475  11.719510   4.901781   7.857100   5.353080
[13]   5.845502   7.141069   8.710413   9.441758   7.868495  10.583568
[19]   8.880157   7.671048
> colMax(tmp5,na.rm=TRUE)
 [1] 466.89741  78.26495  81.90496  85.75097  85.24978  85.87529      -Inf
 [8]  83.79643  88.94603  81.46497  84.12810  77.67460  75.10996  87.69272
[15]  88.83979  82.55602  87.21515  92.51758  81.69411  85.41519
> colMin(tmp5,na.rm=TRUE)
 [1] 59.67566 53.10019 55.59003 56.30344 56.99665 56.91624      Inf 58.23568
 [9] 53.63958 65.39411 59.80390 61.12786 58.18989 67.16529 60.07216 54.95892
[17] 58.53527 62.34342 56.25645 61.65913
> 
> 
> 
> 
> 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] 287.7343 235.0350 171.8282 244.6791 266.3862 236.1659 363.0856 226.3336
 [9] 182.9164 204.1310
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 287.7343 235.0350 171.8282 244.6791 266.3862 236.1659 363.0856 226.3336
 [9] 182.9164 204.1310
> 
> 
> 
> 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]  8.526513e-14 -1.421085e-14 -5.684342e-14 -8.526513e-14  2.842171e-14
 [6]  7.105427e-14  1.136868e-13 -1.421085e-14 -8.526513e-14  4.263256e-14
[11] -5.684342e-14  5.684342e-14  4.263256e-14 -1.705303e-13 -2.842171e-13
[16] -5.684342e-14 -5.684342e-14 -5.684342e-14  1.278977e-13 -7.105427e-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)
+ }
6   9 
4   7 
2   7 
3   18 
1   11 
1   11 
8   10 
3   13 
1   15 
4   13 
5   10 
4   3 
7   20 
8   6 
1   6 
8   11 
1   5 
7   18 
6   10 
1   4 
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] 1.702344
> Min(tmp)
[1] -3.153578
> mean(tmp)
[1] -0.1478192
> Sum(tmp)
[1] -14.78192
> Var(tmp)
[1] 0.889854
> 
> rowMeans(tmp)
[1] -0.1478192
> rowSums(tmp)
[1] -14.78192
> rowVars(tmp)
[1] 0.889854
> rowSd(tmp)
[1] 0.9433207
> rowMax(tmp)
[1] 1.702344
> rowMin(tmp)
[1] -3.153578
> 
> colMeans(tmp)
  [1] -0.084640311 -0.944402529 -0.753759379 -0.219428526  1.702344098
  [6]  0.271054325 -0.091767527 -1.330881680  0.774810254  1.339842898
 [11] -1.698955005 -0.763365480  1.145082895 -0.278397131 -0.278114284
 [16]  0.923767439 -1.057823708 -1.026124626  1.014055041  1.213796193
 [21] -0.406799919 -0.675060606 -1.447979352 -1.135168072 -1.367750661
 [26]  0.967974960 -1.599100501 -3.153577719  0.562683310  0.078922915
 [31] -0.481033097  0.125075813 -0.620736123 -0.327399476  0.358604720
 [36] -0.350913880 -1.273115543 -1.035237895  0.388638032  1.088651777
 [41] -0.659582217 -1.382766207  0.211096678 -0.043145101  0.186563558
 [46]  0.244163824 -1.011014747  0.666270367 -0.495076872  0.003572096
 [51] -1.225991843  0.433849048 -1.135957872 -0.410892672 -0.203703317
 [56]  0.267286688  0.095514896  0.963818692 -0.291883401  0.228670128
 [61]  0.566627666  1.112118755 -0.612995395 -1.081857450 -1.128129628
 [66] -1.333135894 -1.819915871  1.445834952  0.737635032 -0.640178011
 [71] -1.869682092 -0.134902860  0.590895782  1.459665908 -0.594106166
 [76] -0.308144004 -0.184830554  1.392686094  0.575212472 -1.498737138
 [81]  0.275580633 -0.488756957  0.248134209  0.958971215  0.951714072
 [86] -0.223959187 -0.133262031  1.280695331 -0.103701787 -0.348617400
 [91]  1.050446322  0.089266242  0.221249292 -1.566148358  1.201079296
 [96]  0.757371874  0.672942332 -1.384029613 -1.455443215  0.545927175
> colSums(tmp)
  [1] -0.084640311 -0.944402529 -0.753759379 -0.219428526  1.702344098
  [6]  0.271054325 -0.091767527 -1.330881680  0.774810254  1.339842898
 [11] -1.698955005 -0.763365480  1.145082895 -0.278397131 -0.278114284
 [16]  0.923767439 -1.057823708 -1.026124626  1.014055041  1.213796193
 [21] -0.406799919 -0.675060606 -1.447979352 -1.135168072 -1.367750661
 [26]  0.967974960 -1.599100501 -3.153577719  0.562683310  0.078922915
 [31] -0.481033097  0.125075813 -0.620736123 -0.327399476  0.358604720
 [36] -0.350913880 -1.273115543 -1.035237895  0.388638032  1.088651777
 [41] -0.659582217 -1.382766207  0.211096678 -0.043145101  0.186563558
 [46]  0.244163824 -1.011014747  0.666270367 -0.495076872  0.003572096
 [51] -1.225991843  0.433849048 -1.135957872 -0.410892672 -0.203703317
 [56]  0.267286688  0.095514896  0.963818692 -0.291883401  0.228670128
 [61]  0.566627666  1.112118755 -0.612995395 -1.081857450 -1.128129628
 [66] -1.333135894 -1.819915871  1.445834952  0.737635032 -0.640178011
 [71] -1.869682092 -0.134902860  0.590895782  1.459665908 -0.594106166
 [76] -0.308144004 -0.184830554  1.392686094  0.575212472 -1.498737138
 [81]  0.275580633 -0.488756957  0.248134209  0.958971215  0.951714072
 [86] -0.223959187 -0.133262031  1.280695331 -0.103701787 -0.348617400
 [91]  1.050446322  0.089266242  0.221249292 -1.566148358  1.201079296
 [96]  0.757371874  0.672942332 -1.384029613 -1.455443215  0.545927175
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.084640311 -0.944402529 -0.753759379 -0.219428526  1.702344098
  [6]  0.271054325 -0.091767527 -1.330881680  0.774810254  1.339842898
 [11] -1.698955005 -0.763365480  1.145082895 -0.278397131 -0.278114284
 [16]  0.923767439 -1.057823708 -1.026124626  1.014055041  1.213796193
 [21] -0.406799919 -0.675060606 -1.447979352 -1.135168072 -1.367750661
 [26]  0.967974960 -1.599100501 -3.153577719  0.562683310  0.078922915
 [31] -0.481033097  0.125075813 -0.620736123 -0.327399476  0.358604720
 [36] -0.350913880 -1.273115543 -1.035237895  0.388638032  1.088651777
 [41] -0.659582217 -1.382766207  0.211096678 -0.043145101  0.186563558
 [46]  0.244163824 -1.011014747  0.666270367 -0.495076872  0.003572096
 [51] -1.225991843  0.433849048 -1.135957872 -0.410892672 -0.203703317
 [56]  0.267286688  0.095514896  0.963818692 -0.291883401  0.228670128
 [61]  0.566627666  1.112118755 -0.612995395 -1.081857450 -1.128129628
 [66] -1.333135894 -1.819915871  1.445834952  0.737635032 -0.640178011
 [71] -1.869682092 -0.134902860  0.590895782  1.459665908 -0.594106166
 [76] -0.308144004 -0.184830554  1.392686094  0.575212472 -1.498737138
 [81]  0.275580633 -0.488756957  0.248134209  0.958971215  0.951714072
 [86] -0.223959187 -0.133262031  1.280695331 -0.103701787 -0.348617400
 [91]  1.050446322  0.089266242  0.221249292 -1.566148358  1.201079296
 [96]  0.757371874  0.672942332 -1.384029613 -1.455443215  0.545927175
> colMin(tmp)
  [1] -0.084640311 -0.944402529 -0.753759379 -0.219428526  1.702344098
  [6]  0.271054325 -0.091767527 -1.330881680  0.774810254  1.339842898
 [11] -1.698955005 -0.763365480  1.145082895 -0.278397131 -0.278114284
 [16]  0.923767439 -1.057823708 -1.026124626  1.014055041  1.213796193
 [21] -0.406799919 -0.675060606 -1.447979352 -1.135168072 -1.367750661
 [26]  0.967974960 -1.599100501 -3.153577719  0.562683310  0.078922915
 [31] -0.481033097  0.125075813 -0.620736123 -0.327399476  0.358604720
 [36] -0.350913880 -1.273115543 -1.035237895  0.388638032  1.088651777
 [41] -0.659582217 -1.382766207  0.211096678 -0.043145101  0.186563558
 [46]  0.244163824 -1.011014747  0.666270367 -0.495076872  0.003572096
 [51] -1.225991843  0.433849048 -1.135957872 -0.410892672 -0.203703317
 [56]  0.267286688  0.095514896  0.963818692 -0.291883401  0.228670128
 [61]  0.566627666  1.112118755 -0.612995395 -1.081857450 -1.128129628
 [66] -1.333135894 -1.819915871  1.445834952  0.737635032 -0.640178011
 [71] -1.869682092 -0.134902860  0.590895782  1.459665908 -0.594106166
 [76] -0.308144004 -0.184830554  1.392686094  0.575212472 -1.498737138
 [81]  0.275580633 -0.488756957  0.248134209  0.958971215  0.951714072
 [86] -0.223959187 -0.133262031  1.280695331 -0.103701787 -0.348617400
 [91]  1.050446322  0.089266242  0.221249292 -1.566148358  1.201079296
 [96]  0.757371874  0.672942332 -1.384029613 -1.455443215  0.545927175
> colMedians(tmp)
  [1] -0.084640311 -0.944402529 -0.753759379 -0.219428526  1.702344098
  [6]  0.271054325 -0.091767527 -1.330881680  0.774810254  1.339842898
 [11] -1.698955005 -0.763365480  1.145082895 -0.278397131 -0.278114284
 [16]  0.923767439 -1.057823708 -1.026124626  1.014055041  1.213796193
 [21] -0.406799919 -0.675060606 -1.447979352 -1.135168072 -1.367750661
 [26]  0.967974960 -1.599100501 -3.153577719  0.562683310  0.078922915
 [31] -0.481033097  0.125075813 -0.620736123 -0.327399476  0.358604720
 [36] -0.350913880 -1.273115543 -1.035237895  0.388638032  1.088651777
 [41] -0.659582217 -1.382766207  0.211096678 -0.043145101  0.186563558
 [46]  0.244163824 -1.011014747  0.666270367 -0.495076872  0.003572096
 [51] -1.225991843  0.433849048 -1.135957872 -0.410892672 -0.203703317
 [56]  0.267286688  0.095514896  0.963818692 -0.291883401  0.228670128
 [61]  0.566627666  1.112118755 -0.612995395 -1.081857450 -1.128129628
 [66] -1.333135894 -1.819915871  1.445834952  0.737635032 -0.640178011
 [71] -1.869682092 -0.134902860  0.590895782  1.459665908 -0.594106166
 [76] -0.308144004 -0.184830554  1.392686094  0.575212472 -1.498737138
 [81]  0.275580633 -0.488756957  0.248134209  0.958971215  0.951714072
 [86] -0.223959187 -0.133262031  1.280695331 -0.103701787 -0.348617400
 [91]  1.050446322  0.089266242  0.221249292 -1.566148358  1.201079296
 [96]  0.757371874  0.672942332 -1.384029613 -1.455443215  0.545927175
> colRanges(tmp)
            [,1]       [,2]       [,3]       [,4]     [,5]      [,6]
[1,] -0.08464031 -0.9444025 -0.7537594 -0.2194285 1.702344 0.2710543
[2,] -0.08464031 -0.9444025 -0.7537594 -0.2194285 1.702344 0.2710543
            [,7]      [,8]      [,9]    [,10]     [,11]      [,12]    [,13]
[1,] -0.09176753 -1.330882 0.7748103 1.339843 -1.698955 -0.7633655 1.145083
[2,] -0.09176753 -1.330882 0.7748103 1.339843 -1.698955 -0.7633655 1.145083
          [,14]      [,15]     [,16]     [,17]     [,18]    [,19]    [,20]
[1,] -0.2783971 -0.2781143 0.9237674 -1.057824 -1.026125 1.014055 1.213796
[2,] -0.2783971 -0.2781143 0.9237674 -1.057824 -1.026125 1.014055 1.213796
          [,21]      [,22]     [,23]     [,24]     [,25]    [,26]     [,27]
[1,] -0.4067999 -0.6750606 -1.447979 -1.135168 -1.367751 0.967975 -1.599101
[2,] -0.4067999 -0.6750606 -1.447979 -1.135168 -1.367751 0.967975 -1.599101
         [,28]     [,29]      [,30]      [,31]     [,32]      [,33]      [,34]
[1,] -3.153578 0.5626833 0.07892292 -0.4810331 0.1250758 -0.6207361 -0.3273995
[2,] -3.153578 0.5626833 0.07892292 -0.4810331 0.1250758 -0.6207361 -0.3273995
         [,35]      [,36]     [,37]     [,38]    [,39]    [,40]      [,41]
[1,] 0.3586047 -0.3509139 -1.273116 -1.035238 0.388638 1.088652 -0.6595822
[2,] 0.3586047 -0.3509139 -1.273116 -1.035238 0.388638 1.088652 -0.6595822
         [,42]     [,43]      [,44]     [,45]     [,46]     [,47]     [,48]
[1,] -1.382766 0.2110967 -0.0431451 0.1865636 0.2441638 -1.011015 0.6662704
[2,] -1.382766 0.2110967 -0.0431451 0.1865636 0.2441638 -1.011015 0.6662704
          [,49]       [,50]     [,51]    [,52]     [,53]      [,54]      [,55]
[1,] -0.4950769 0.003572096 -1.225992 0.433849 -1.135958 -0.4108927 -0.2037033
[2,] -0.4950769 0.003572096 -1.225992 0.433849 -1.135958 -0.4108927 -0.2037033
         [,56]     [,57]     [,58]      [,59]     [,60]     [,61]    [,62]
[1,] 0.2672867 0.0955149 0.9638187 -0.2918834 0.2286701 0.5666277 1.112119
[2,] 0.2672867 0.0955149 0.9638187 -0.2918834 0.2286701 0.5666277 1.112119
          [,63]     [,64]    [,65]     [,66]     [,67]    [,68]    [,69]
[1,] -0.6129954 -1.081857 -1.12813 -1.333136 -1.819916 1.445835 0.737635
[2,] -0.6129954 -1.081857 -1.12813 -1.333136 -1.819916 1.445835 0.737635
         [,70]     [,71]      [,72]     [,73]    [,74]      [,75]     [,76]
[1,] -0.640178 -1.869682 -0.1349029 0.5908958 1.459666 -0.5941062 -0.308144
[2,] -0.640178 -1.869682 -0.1349029 0.5908958 1.459666 -0.5941062 -0.308144
          [,77]    [,78]     [,79]     [,80]     [,81]     [,82]     [,83]
[1,] -0.1848306 1.392686 0.5752125 -1.498737 0.2755806 -0.488757 0.2481342
[2,] -0.1848306 1.392686 0.5752125 -1.498737 0.2755806 -0.488757 0.2481342
         [,84]     [,85]      [,86]     [,87]    [,88]      [,89]      [,90]
[1,] 0.9589712 0.9517141 -0.2239592 -0.133262 1.280695 -0.1037018 -0.3486174
[2,] 0.9589712 0.9517141 -0.2239592 -0.133262 1.280695 -0.1037018 -0.3486174
        [,91]      [,92]     [,93]     [,94]    [,95]     [,96]     [,97]
[1,] 1.050446 0.08926624 0.2212493 -1.566148 1.201079 0.7573719 0.6729423
[2,] 1.050446 0.08926624 0.2212493 -1.566148 1.201079 0.7573719 0.6729423
        [,98]     [,99]    [,100]
[1,] -1.38403 -1.455443 0.5459272
[2,] -1.38403 -1.455443 0.5459272
> 
> 
> Max(tmp2)
[1] 2.762366
> Min(tmp2)
[1] -2.394399
> mean(tmp2)
[1] 0.1735328
> Sum(tmp2)
[1] 17.35328
> Var(tmp2)
[1] 1.200902
> 
> rowMeans(tmp2)
  [1] -1.375217073 -0.545532516  0.279428738  0.234421468 -0.008790002
  [6]  0.608050496 -0.153514155  0.838809567 -0.388592080  0.865432560
 [11] -0.263016382 -1.064577730 -1.064882917  0.633135123 -1.334886291
 [16]  2.043179750  0.327357367 -0.439932147  1.960958256  0.434258807
 [21]  0.181690640 -0.130817919 -1.080738745 -0.128943877 -0.061750133
 [26] -0.359589470  2.649385156 -1.067374812 -0.326727937 -0.173925135
 [31]  2.213068064  0.399083281  0.550997502  1.135107531  0.703357486
 [36] -0.151760008  0.142013419  0.785545486  2.424559009  0.581973521
 [41]  0.379013183 -0.314143351  0.708112295  2.762366378 -0.432973089
 [46]  1.527332310 -0.319711227  0.939606793 -1.531735213 -0.447603538
 [51] -1.227861177 -0.508381557 -0.223366012 -0.731682602  0.649164441
 [56] -0.020015572 -0.746708301 -0.581884578  2.399404051 -1.160173782
 [61] -0.734006895 -1.538236882  0.581704019  0.093195756  2.279089960
 [66] -0.796815764  0.797855059 -0.815666307 -0.561079657  0.581944707
 [71] -1.084652532  0.601905678  0.131689220  0.761748496 -0.060660189
 [76]  1.991554524  1.114361456 -2.156274506  0.360842727  0.507130013
 [81]  0.757809265  2.095765079  0.310132530  1.084792242  0.611057278
 [86]  0.037046471 -0.877182728  1.670037636  1.785072954 -1.652150392
 [91]  0.798187009  0.515175214  1.519002155 -0.765041003 -1.154729097
 [96]  0.919131902  0.226775583 -2.394399036 -1.950837858  0.772000636
> rowSums(tmp2)
  [1] -1.375217073 -0.545532516  0.279428738  0.234421468 -0.008790002
  [6]  0.608050496 -0.153514155  0.838809567 -0.388592080  0.865432560
 [11] -0.263016382 -1.064577730 -1.064882917  0.633135123 -1.334886291
 [16]  2.043179750  0.327357367 -0.439932147  1.960958256  0.434258807
 [21]  0.181690640 -0.130817919 -1.080738745 -0.128943877 -0.061750133
 [26] -0.359589470  2.649385156 -1.067374812 -0.326727937 -0.173925135
 [31]  2.213068064  0.399083281  0.550997502  1.135107531  0.703357486
 [36] -0.151760008  0.142013419  0.785545486  2.424559009  0.581973521
 [41]  0.379013183 -0.314143351  0.708112295  2.762366378 -0.432973089
 [46]  1.527332310 -0.319711227  0.939606793 -1.531735213 -0.447603538
 [51] -1.227861177 -0.508381557 -0.223366012 -0.731682602  0.649164441
 [56] -0.020015572 -0.746708301 -0.581884578  2.399404051 -1.160173782
 [61] -0.734006895 -1.538236882  0.581704019  0.093195756  2.279089960
 [66] -0.796815764  0.797855059 -0.815666307 -0.561079657  0.581944707
 [71] -1.084652532  0.601905678  0.131689220  0.761748496 -0.060660189
 [76]  1.991554524  1.114361456 -2.156274506  0.360842727  0.507130013
 [81]  0.757809265  2.095765079  0.310132530  1.084792242  0.611057278
 [86]  0.037046471 -0.877182728  1.670037636  1.785072954 -1.652150392
 [91]  0.798187009  0.515175214  1.519002155 -0.765041003 -1.154729097
 [96]  0.919131902  0.226775583 -2.394399036 -1.950837858  0.772000636
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.375217073 -0.545532516  0.279428738  0.234421468 -0.008790002
  [6]  0.608050496 -0.153514155  0.838809567 -0.388592080  0.865432560
 [11] -0.263016382 -1.064577730 -1.064882917  0.633135123 -1.334886291
 [16]  2.043179750  0.327357367 -0.439932147  1.960958256  0.434258807
 [21]  0.181690640 -0.130817919 -1.080738745 -0.128943877 -0.061750133
 [26] -0.359589470  2.649385156 -1.067374812 -0.326727937 -0.173925135
 [31]  2.213068064  0.399083281  0.550997502  1.135107531  0.703357486
 [36] -0.151760008  0.142013419  0.785545486  2.424559009  0.581973521
 [41]  0.379013183 -0.314143351  0.708112295  2.762366378 -0.432973089
 [46]  1.527332310 -0.319711227  0.939606793 -1.531735213 -0.447603538
 [51] -1.227861177 -0.508381557 -0.223366012 -0.731682602  0.649164441
 [56] -0.020015572 -0.746708301 -0.581884578  2.399404051 -1.160173782
 [61] -0.734006895 -1.538236882  0.581704019  0.093195756  2.279089960
 [66] -0.796815764  0.797855059 -0.815666307 -0.561079657  0.581944707
 [71] -1.084652532  0.601905678  0.131689220  0.761748496 -0.060660189
 [76]  1.991554524  1.114361456 -2.156274506  0.360842727  0.507130013
 [81]  0.757809265  2.095765079  0.310132530  1.084792242  0.611057278
 [86]  0.037046471 -0.877182728  1.670037636  1.785072954 -1.652150392
 [91]  0.798187009  0.515175214  1.519002155 -0.765041003 -1.154729097
 [96]  0.919131902  0.226775583 -2.394399036 -1.950837858  0.772000636
> rowMin(tmp2)
  [1] -1.375217073 -0.545532516  0.279428738  0.234421468 -0.008790002
  [6]  0.608050496 -0.153514155  0.838809567 -0.388592080  0.865432560
 [11] -0.263016382 -1.064577730 -1.064882917  0.633135123 -1.334886291
 [16]  2.043179750  0.327357367 -0.439932147  1.960958256  0.434258807
 [21]  0.181690640 -0.130817919 -1.080738745 -0.128943877 -0.061750133
 [26] -0.359589470  2.649385156 -1.067374812 -0.326727937 -0.173925135
 [31]  2.213068064  0.399083281  0.550997502  1.135107531  0.703357486
 [36] -0.151760008  0.142013419  0.785545486  2.424559009  0.581973521
 [41]  0.379013183 -0.314143351  0.708112295  2.762366378 -0.432973089
 [46]  1.527332310 -0.319711227  0.939606793 -1.531735213 -0.447603538
 [51] -1.227861177 -0.508381557 -0.223366012 -0.731682602  0.649164441
 [56] -0.020015572 -0.746708301 -0.581884578  2.399404051 -1.160173782
 [61] -0.734006895 -1.538236882  0.581704019  0.093195756  2.279089960
 [66] -0.796815764  0.797855059 -0.815666307 -0.561079657  0.581944707
 [71] -1.084652532  0.601905678  0.131689220  0.761748496 -0.060660189
 [76]  1.991554524  1.114361456 -2.156274506  0.360842727  0.507130013
 [81]  0.757809265  2.095765079  0.310132530  1.084792242  0.611057278
 [86]  0.037046471 -0.877182728  1.670037636  1.785072954 -1.652150392
 [91]  0.798187009  0.515175214  1.519002155 -0.765041003 -1.154729097
 [96]  0.919131902  0.226775583 -2.394399036 -1.950837858  0.772000636
> 
> colMeans(tmp2)
[1] 0.1735328
> colSums(tmp2)
[1] 17.35328
> colVars(tmp2)
[1] 1.200902
> colSd(tmp2)
[1] 1.095857
> colMax(tmp2)
[1] 2.762366
> colMin(tmp2)
[1] -2.394399
> colMedians(tmp2)
[1] 0.161852
> colRanges(tmp2)
          [,1]
[1,] -2.394399
[2,]  2.762366
> 
> 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] -3.0261232  1.0564689 -3.0402369 -7.3327101 -0.4472298  0.2651516
 [7]  2.2756327 -1.7454099  4.3035312 -4.1362891
> colApply(tmp,quantile)[,1]
             [,1]
[1,] -2.033173765
[2,] -0.899251660
[3,]  0.009354082
[4,]  0.393430960
[5,]  0.799708278
> 
> rowApply(tmp,sum)
 [1] -1.9924222  3.0198544 -5.7290452  1.1028285  1.2503028 -0.3677105
 [7] -2.8711946 -3.2087777 -5.5649874  2.5339373
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    9    1    5    7    5    1    9    9     8
 [2,]    8    7    6    9    9    3    4    3    6     5
 [3,]    5    1    9    7    2    2    3    7    7     2
 [4,]    2    8    2    1    3    8    2    2    4     1
 [5,]   10    2    4    3    5    9    7    6   10     3
 [6,]    6    3   10    8    8    6    6    4    1     6
 [7,]    4    6    7    4   10    7    8    8    3     9
 [8,]    3    5    8   10    4    1    5    5    5     4
 [9,]    7    4    5    6    6   10   10   10    8    10
[10,]    9   10    3    2    1    4    9    1    2     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.6719176  3.4176205 -0.9827612 -3.3695367 -1.9774853  0.7412575
 [7]  6.8031248  3.7956936 -3.6678340  0.5930730 -1.0175163  3.0015158
[13] -0.8243805  1.5355443 -3.2595134 -4.0659803 -0.7670719  3.4340253
[19] -1.8562510 -0.8246003
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.4778869
[2,] -1.2491203
[3,] -0.6778013
[4,]  0.2303989
[5,]  1.5024920
> 
> rowApply(tmp,sum)
[1] 11.549645  8.100682 -9.234259 -8.852059 -2.527002
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   17    1    7    6   13
[2,]   10   18   20   16   19
[3,]    8    2    9   15   15
[4,]    2    8    4    4   10
[5,]   14    7    1   12    5
> 
> 
> as.matrix(tmp)
           [,1]      [,2]       [,3]        [,4]       [,5]       [,6]
[1,]  1.5024920 0.2730071  0.0967222 -0.48905816  0.9799344  1.4191370
[2,] -1.2491203 1.2350392 -1.1212210  0.08172621 -0.1521614  0.8795793
[3,] -0.6778013 0.9714281 -0.6605829 -1.15410884 -1.9071686 -0.4313287
[4,] -1.4778869 0.1935685  0.1496272 -1.56405153 -0.1548589 -1.5966591
[5,]  0.2303989 0.7445777  0.5526933 -0.24404442 -0.7432308  0.4705290
           [,7]        [,8]       [,9]      [,10]      [,11]       [,12]
[1,]  3.5664030  0.77177022 -2.0979624  1.7213660 -0.2062352  0.05560456
[2,]  0.8402256  0.60697089 -0.2505283  1.3206939  0.4711923  1.15464766
[3,] -0.5199350 -0.09594218  0.1579226 -0.2430554 -0.9814726  0.86581494
[4,]  0.9573447  1.93292925 -0.9940833 -1.2399257 -0.1488742  1.53664068
[5,]  1.9590864  0.57996538 -0.4831827 -0.9660058 -0.1521265 -0.61119204
          [,13]      [,14]      [,15]      [,16]      [,17]        [,18]
[1,]  0.2257128  0.0762103  1.0914486  0.3107707 -0.2237006  1.797658508
[2,]  0.2533205  0.9280810 -0.6689531 -0.2819334  0.9460647  2.608248169
[3,] -0.1270717 -1.4586952  0.5321817 -1.7064759 -0.1355436  0.006243103
[4,] -1.8012271  1.4268618 -2.1167249 -1.5303316 -0.8765496 -0.754568557
[5,]  0.6248850  0.5630864 -2.0974658 -0.8580101 -0.4773427 -0.223555973
          [,19]      [,20]
[1,]  0.8725012 -0.1941375
[2,] -0.3655959  0.8644060
[3,] -1.0051875 -0.6634807
[4,] -0.8971892  0.1038997
[5,] -0.4607797 -0.9352880
> 
> 
> 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 :  654  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 :  567  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.0739043 -0.336983 -1.177113 0.01035385 1.551458 1.657147 0.9125913
           col8      col9      col10      col11     col12    col13     col14
row1 -0.4632858 0.6806568 -0.1786963 0.04530452 0.1632008 1.152188 0.9245888
        col15      col16      col17      col18     col19      col20
row1 1.213559 -0.9383858 -0.6560729 -0.9787725 0.2666587 -0.6919161
> tmp[,"col10"]
           col10
row1 -0.17869630
row2  0.03371543
row3  1.79436828
row4 -0.55193288
row5 -0.46090755
> tmp[c("row1","row5"),]
           col1       col2      col3        col4      col5       col6      col7
row1  0.0739043 -0.3369830 -1.177113  0.01035385 1.5514584  1.6571471 0.9125913
row5 -0.1774558  0.4364496  1.039266 -0.91192472 0.3232876 -0.1768801 0.3966924
           col8      col9      col10      col11     col12     col13     col14
row1 -0.4632858 0.6806568 -0.1786963 0.04530452 0.1632008 1.1521876 0.9245888
row5 -1.2740416 1.3266391 -0.4609075 0.03866288 1.0483522 0.2247771 0.8227399
         col15      col16      col17      col18     col19      col20
row1  1.213559 -0.9383858 -0.6560729 -0.9787725 0.2666587 -0.6919161
row5 -1.223020 -0.4783482 -1.4652028  0.9174073 0.6130782  0.2298588
> tmp[,c("col6","col20")]
           col6       col20
row1  1.6571471 -0.69191605
row2 -0.2872181 -0.04105727
row3 -0.2180809  1.42695779
row4 -0.4736571 -0.25789981
row5 -0.1768801  0.22985876
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  1.6571471 -0.6919161
row5 -0.1768801  0.2298588
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5   col6     col7     col8
row1 49.66773 49.46338 47.70178 49.70818 49.70693 104.02 49.70828 48.91531
         col9    col10   col11    col12    col13    col14    col15    col16
row1 49.71367 50.35018 48.1584 52.07192 48.75835 49.74868 47.51258 50.31676
        col17    col18    col19    col20
row1 51.18852 52.00863 49.19248 104.5429
> tmp[,"col10"]
        col10
row1 50.35018
row2 28.82469
row3 30.32728
row4 29.43712
row5 48.46822
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.66773 49.46338 47.70178 49.70818 49.70693 104.0200 49.70828 48.91531
row5 50.00336 49.48040 49.59369 50.69733 49.33194 105.1016 49.92827 49.51428
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.71367 50.35018 48.15840 52.07192 48.75835 49.74868 47.51258 50.31676
row5 48.05057 48.46822 51.09506 49.43823 48.18138 51.14336 49.64632 49.37303
        col17    col18    col19    col20
row1 51.18852 52.00863 49.19248 104.5429
row5 50.05867 50.35204 50.91500 103.7949
> tmp[,c("col6","col20")]
          col6     col20
row1 104.02004 104.54285
row2  75.96241  75.29411
row3  74.62554  74.95277
row4  75.50242  75.40575
row5 105.10156 103.79494
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.0200 104.5429
row5 105.1016 103.7949
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.0200 104.5429
row5 105.1016 103.7949
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  2.5590183
[2,]  1.1069495
[3,] -0.8306050
[4,] -0.1548442
[5,] -0.2651481
> tmp[,c("col17","col7")]
         col17        col7
[1,]  1.714073 -1.00188813
[2,]  0.366543 -0.26190854
[3,] -1.271100  0.95504346
[4,]  1.082812  1.98925449
[5,] -1.192963 -0.08166097
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.5016521  1.0625742
[2,]  0.5490390  0.6845523
[3,]  1.2646645  1.9777122
[4,] -1.0558310  0.1081644
[5,]  0.4325209 -0.1253315
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.5016521
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.5016521
[2,]  0.5490390
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]       [,2]      [,3]      [,4]      [,5]     [,6]      [,7]
row3  0.14115201  0.5961177 -1.200336 1.3320457 -1.293864 1.001835 -1.352228
row1 -0.01275308 -0.4445429  1.397367 0.7332728 -1.105802 1.315113  1.537154
           [,8]       [,9]     [,10]      [,11]      [,12]      [,13]
row3 -1.4510281 -0.7849569 0.2185064  0.3867011  0.6959117 -0.7793154
row1 -0.5507435  0.1092431 0.8458496 -0.2605931 -0.3831287  0.7105416
          [,14]      [,15]      [,16]        [,17]     [,18]      [,19]
row3 -0.3326215  0.0407681 -0.7134538  0.110682897 0.4816639 -0.3752734
row1 -0.7410453 -0.1456669 -0.4478331 -0.006749889 0.1234863  0.1660047
         [,20]
row3  0.703779
row1 -1.575948
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]     [,2]     [,3]       [,4]       [,5]      [,6]     [,7]
row2 0.7852653 2.673472 0.914058 -0.6309629 -0.9317577 0.2034586 1.176023
          [,8]     [,9]     [,10]
row2 -1.248811 1.586946 -1.174322
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]      [,3]    [,4]       [,5]     [,6]      [,7]
row5 2.246448 0.1675827 0.2413862 2.04568 -0.9247631 2.453759 0.3585678
         [,8]      [,9]      [,10]     [,11]    [,12]     [,13]      [,14]
row5 0.225315 0.3581842 -0.0996739 -0.723294 1.838446 0.7818277 -0.7234692
          [,15]      [,16]    [,17]    [,18]      [,19]      [,20]
row5 0.09678188 -0.8160882 0.496889 1.541648 -0.3672109 -0.7373644
> 
> 
> 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: 0x600001f98120>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de3ff7ae47"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de1dd2d820"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de7d6b2c2b"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de720fb61" 
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de657a0ef" 
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de6306ae29"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de4b943889"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de700bd122"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de17cf48a6"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de29aa9680"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de7e7ec2de"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de342bbdb3"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de23b34d87"
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de50a6ec60"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM104de7ee8bbfd"
> 
> 
> ### 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: 0x600001f906c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001f906c0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001f906c0>
> rowMedians(tmp)
  [1]  0.175308085  0.283574896  0.061117052  0.528938608  0.236522262
  [6] -0.244583345  0.383240067 -0.271356065  0.369761531  0.054757395
 [11]  0.130053902 -0.759689439 -0.230076527 -0.206095009  0.299431158
 [16] -0.340986253 -0.253016657 -0.021798580  0.294314236 -0.077933825
 [21] -0.107419772 -0.283470915 -0.152886854 -0.223396592 -0.307904853
 [26] -0.457808590  0.607668095  0.758140361  0.287585867 -0.250807573
 [31] -0.092621629  0.105072113 -0.159746366  0.242036490 -0.158691000
 [36] -0.003614251  0.605566837  0.260358786  0.094072526  0.086814887
 [41]  0.136142394  0.555094326  0.181759975  0.095305902  0.356344321
 [46]  0.033150261 -0.150871398 -0.014107001  0.784145341  0.351345486
 [51]  0.910718701 -0.075491129  0.428604710  0.100373614  0.139698521
 [56]  0.037457725 -0.084831745  0.109026833 -0.047342720  0.162372165
 [61] -0.290864523  0.329936161 -0.121683016 -0.014970740 -0.061561157
 [66]  0.630675309  0.292180589  0.287551580  0.396039262 -0.066223616
 [71]  0.048261851 -0.384192535 -0.098667965  0.447381866 -0.059367381
 [76] -0.393458769  0.298510348  0.070851653  0.383167288 -0.125542382
 [81]  0.260243645 -0.288946765 -0.139743119  0.467698340 -0.374535034
 [86]  0.258596905  0.298341864  0.056104967  0.265315834 -0.605927179
 [91] -0.347965220 -0.571307656  0.133629040 -0.338483492  0.350465337
 [96]  0.196009417  0.127146787 -0.007753598 -0.035827645  0.563739306
[101]  0.234547933 -0.090207412 -0.028464147  0.252507574  0.130134246
[106] -0.049174150  0.799503653 -0.366693388 -0.143964809  0.022415588
[111]  0.278598719  0.322805011 -0.052149972 -0.179722821 -0.163400225
[116]  0.118309261  0.500131325  0.444034274 -0.042408852 -0.026275140
[121]  0.515374993  0.653230624 -0.272471087  0.330797730 -0.290475159
[126]  0.526158418 -0.060554016 -0.221315948  0.149105176 -0.270001015
[131] -0.373519681  0.134279889  0.132869798  0.449672670 -0.571353471
[136] -0.063403908 -0.325586112 -0.647243837 -0.408303053 -0.477710761
[141]  0.077901604  0.096867861 -0.527831478 -0.023273558 -0.107116797
[146]  0.011490313 -0.079975199  0.010949694 -0.518218143 -0.269577129
[151] -0.410764983 -0.158706805  0.255782532  0.027039493  0.570792767
[156] -0.350391695 -0.283329509 -0.071125449  0.809281589 -0.417269623
[161]  0.310101130  0.102914179  0.092943905 -0.156660463 -0.268965663
[166]  0.156212446 -0.114174505  0.172320885  0.219417359  0.262483491
[171]  0.209023672 -0.329938892  0.052223330 -0.148345683  0.113517363
[176] -0.176798368 -0.197160213  0.408879221  0.088311079 -0.117050097
[181] -0.175828334  0.509076649 -0.711100612  0.270775457  0.112999453
[186] -0.057703299  0.236874870  0.093458780  0.355499530  0.099655246
[191] -0.132070618  0.140794189 -0.830784052 -0.355339913  0.465566629
[196]  0.228451308 -0.228316874 -0.282312603 -0.187897290  0.050207194
[201] -0.167429957  0.206272861 -0.345036017 -0.254762129 -0.018411447
[206]  0.398843469 -0.681180344 -0.414562291 -0.464946278 -0.188955477
[211] -0.104823341 -0.181998013  0.007574187  0.053282116  0.120232099
[216]  0.062355654  0.612042722 -0.020524987 -0.317154209 -0.444333533
[221] -0.263584183  0.237668926 -0.085489066  0.281467119  0.373240446
[226] -0.380948153  0.545288186 -0.171089401  0.076249017  0.080571395
> 
> proc.time()
   user  system elapsed 
  2.569  15.257  18.557 

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: 0x6000025483c0>
> .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: 0x6000025483c0>
> .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: 0x6000025483c0>
> .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: 0x6000025483c0>
> 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: 0x600002540000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002540000>
> .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: 0x600002540000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002540000>
> .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: 0x600002540000>
> 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: 0x60000251c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000251c000>
> .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: 0x60000251c000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000251c000>
> .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: 0x60000251c000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60000251c000>
> .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: 0x60000251c000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60000251c000>
> .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: 0x60000251c000>
> 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: 0x600002518000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002518000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002518000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002518000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile10be0407fa0"  "BufferedMatrixFile10be0a7ae181"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile10be0407fa0"  "BufferedMatrixFile10be0a7ae181"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002564420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002564420>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002564420>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002564420>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002564420>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002564420>
> .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: 0x600002564600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002564600>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002564600>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002564600>
> 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: 0x6000025647e0>
> .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: 0x6000025647e0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.308   0.137   0.440 

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.317   0.085   0.394 

Example timings