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

This page was generated on 2025-04-22 13:17 -0400 (Tue, 22 Apr 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4831
palomino7Windows Server 2022 Datacenterx644.5.0 RC (2025-04-04 r88126 ucrt) -- "How About a Twenty-Six" 4573
lconwaymacOS 12.7.1 Montereyx86_644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4599
kjohnson3macOS 13.7.1 Venturaarm644.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six" 4553
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4570
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 252/2341HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.72.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-04-21 13:40 -0400 (Mon, 21 Apr 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_21
git_last_commit: aa9e634
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  YES
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  YES
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  YES
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  YES
kunpeng2Linux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on kjohnson3

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.72.0
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.72.0.tar.gz
StartedAt: 2025-04-21 18:27:52 -0400 (Mon, 21 Apr 2025)
EndedAt: 2025-04-21 18:28:09 -0400 (Mon, 21 Apr 2025)
EllapsedTime: 17.2 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.72.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 RC (2025-04-04 r88126)
* using platform: aarch64-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 Ventura 13.7.1
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.72.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking 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 15.0.0 (clang-1500.1.0.2.5)’
* 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-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.72.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/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 arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.5-arm64/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 version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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.117   0.038   0.153 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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 480809 25.7    1056568 56.5         NA   634342 33.9
Vcells 890978  6.8    8388608 64.0     196608  2109696 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] "Mon Apr 21 18:28:02 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] "Mon Apr 21 18:28:02 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: 0x6000005c8660>
> 
> 
> 
> 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] "Mon Apr 21 18:28:03 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] "Mon Apr 21 18:28:03 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000005c8660>
> 
> 
> 
> ### 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.5083293 -1.6343230  1.3842826 0.6942150
[2,] -0.4480056  0.4305315  1.1011430 0.4150054
[3,] -0.5583099 -1.3550827 -0.7232661 1.1806224
[4,]  1.4160752 -0.4051207 -0.2623078 0.6933438
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.5083293 1.6343230 1.3842826 0.6942150
[2,]  0.4480056 0.4305315 1.1011430 0.4150054
[3,]  0.5583099 1.3550827 0.7232661 1.1806224
[4,]  1.4160752 0.4051207 0.2623078 0.6933438
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9753862 1.2784064 1.1765554 0.8331956
[2,] 0.6693322 0.6561490 1.0493536 0.6442091
[3,] 0.7472014 1.1640802 0.8504505 1.0865645
[4,] 1.1899896 0.6364909 0.5121600 0.8326727
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.26219 39.41839 38.14984 34.02617
[2,]  32.14133 31.99202 36.59468 31.85710
[3,]  33.03032 37.99588 34.22777 37.04627
[4,]  38.31597 31.77003 30.38391 34.02007
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000005cc000>
> exp(tmp5)
<pointer: 0x6000005cc000>
> log(tmp5,2)
<pointer: 0x6000005cc000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.7724
> Min(tmp5)
[1] 54.2224
> mean(tmp5)
[1] 72.69919
> Sum(tmp5)
[1] 14539.84
> Var(tmp5)
[1] 853.5796
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.16518 72.07074 70.75158 74.47589 69.83677 69.88752 68.74595 70.92844
 [9] 69.75013 67.37966
> rowSums(tmp5)
 [1] 1863.304 1441.415 1415.032 1489.518 1396.735 1397.750 1374.919 1418.569
 [9] 1395.003 1347.593
> rowVars(tmp5)
 [1] 7808.84198   63.36778   57.64407  100.48204   80.67691   55.23808
 [7]   59.00064   48.96604   69.66607   71.96711
> rowSd(tmp5)
 [1] 88.367652  7.960388  7.592369 10.024073  8.982033  7.432232  7.681188
 [8]  6.997574  8.346620  8.483343
> rowMax(tmp5)
 [1] 466.77237  84.26369  85.86990  96.14931  87.29147  79.65407  84.07298
 [8]  84.17482  83.49458  85.19445
> rowMin(tmp5)
 [1] 54.83600 56.18087 58.51304 56.53670 55.87586 54.22240 56.93186 60.55325
 [9] 57.61244 56.31653
> 
> colMeans(tmp5)
 [1] 110.43198  71.34249  72.57170  73.16182  72.03460  71.22005  70.34824
 [8]  71.86051  71.83235  68.94128  71.31682  68.26817  66.22678  69.25825
[15]  68.72911  75.21992  65.87975  73.32878  70.47575  71.53536
> colSums(tmp5)
 [1] 1104.3198  713.4249  725.7170  731.6182  720.3460  712.2005  703.4824
 [8]  718.6051  718.3235  689.4128  713.1682  682.6817  662.2678  692.5825
[15]  687.2911  752.1992  658.7975  733.2878  704.7575  715.3536
> colVars(tmp5)
 [1] 15711.53149    80.27362    36.83637    18.52971    63.34714    71.90716
 [7]    59.71275    61.68390    74.06836    69.24226   109.84400    41.00646
[13]   123.92485   104.06624    26.44583    42.63842    67.36776   118.39759
[19]    63.08237   151.73102
> colSd(tmp5)
 [1] 125.345648   8.959555   6.069297   4.304615   7.959092   8.479809
 [7]   7.727403   7.853910   8.606298   8.321193  10.480649   6.403628
[13]  11.132154  10.201286   5.142551   6.529810   8.207786  10.881065
[19]   7.942441  12.317915
> colMax(tmp5)
 [1] 466.77237  82.04421  79.79850  78.32440  84.26369  81.04332  85.19445
 [8]  84.01679  85.86990  83.22438  85.92673  78.54929  88.96517  83.49458
[15]  75.79491  81.70705  78.75174  87.29147  82.39201  96.14931
> colMin(tmp5)
 [1] 62.20304 54.22240 63.24012 66.30637 59.00555 57.57939 58.59409 58.62201
 [9] 57.65809 56.53670 56.17874 59.45960 54.83600 54.97219 62.78085 61.25241
[17] 54.84097 56.18087 57.61244 56.31653
> 
> 
> ### 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] 93.16518 72.07074 70.75158       NA 69.83677 69.88752 68.74595 70.92844
 [9] 69.75013 67.37966
> rowSums(tmp5)
 [1] 1863.304 1441.415 1415.032       NA 1396.735 1397.750 1374.919 1418.569
 [9] 1395.003 1347.593
> rowVars(tmp5)
 [1] 7808.84198   63.36778   57.64407  104.43790   80.67691   55.23808
 [7]   59.00064   48.96604   69.66607   71.96711
> rowSd(tmp5)
 [1] 88.367652  7.960388  7.592369 10.219486  8.982033  7.432232  7.681188
 [8]  6.997574  8.346620  8.483343
> rowMax(tmp5)
 [1] 466.77237  84.26369  85.86990        NA  87.29147  79.65407  84.07298
 [8]  84.17482  83.49458  85.19445
> rowMin(tmp5)
 [1] 54.83600 56.18087 58.51304       NA 55.87586 54.22240 56.93186 60.55325
 [9] 57.61244 56.31653
> 
> colMeans(tmp5)
 [1]       NA 71.34249 72.57170 73.16182 72.03460 71.22005 70.34824 71.86051
 [9] 71.83235 68.94128 71.31682 68.26817 66.22678 69.25825 68.72911 75.21992
[17] 65.87975 73.32878 70.47575 71.53536
> colSums(tmp5)
 [1]       NA 713.4249 725.7170 731.6182 720.3460 712.2005 703.4824 718.6051
 [9] 718.3235 689.4128 713.1682 682.6817 662.2678 692.5825 687.2911 752.1992
[17] 658.7975 733.2878 704.7575 715.3536
> colVars(tmp5)
 [1]        NA  80.27362  36.83637  18.52971  63.34714  71.90716  59.71275
 [8]  61.68390  74.06836  69.24226 109.84400  41.00646 123.92485 104.06624
[15]  26.44583  42.63842  67.36776 118.39759  63.08237 151.73102
> colSd(tmp5)
 [1]        NA  8.959555  6.069297  4.304615  7.959092  8.479809  7.727403
 [8]  7.853910  8.606298  8.321193 10.480649  6.403628 11.132154 10.201286
[15]  5.142551  6.529810  8.207786 10.881065  7.942441 12.317915
> colMax(tmp5)
 [1]       NA 82.04421 79.79850 78.32440 84.26369 81.04332 85.19445 84.01679
 [9] 85.86990 83.22438 85.92673 78.54929 88.96517 83.49458 75.79491 81.70705
[17] 78.75174 87.29147 82.39201 96.14931
> colMin(tmp5)
 [1]       NA 54.22240 63.24012 66.30637 59.00555 57.57939 58.59409 58.62201
 [9] 57.65809 56.53670 56.17874 59.45960 54.83600 54.97219 62.78085 61.25241
[17] 54.84097 56.18087 57.61244 56.31653
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.7724
> Min(tmp5,na.rm=TRUE)
[1] 54.2224
> mean(tmp5,na.rm=TRUE)
[1] 72.66376
> Sum(tmp5,na.rm=TRUE)
[1] 14460.09
> Var(tmp5,na.rm=TRUE)
[1] 857.6382
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.16518 72.07074 70.75158 74.19833 69.83677 69.88752 68.74595 70.92844
 [9] 69.75013 67.37966
> rowSums(tmp5,na.rm=TRUE)
 [1] 1863.304 1441.415 1415.032 1409.768 1396.735 1397.750 1374.919 1418.569
 [9] 1395.003 1347.593
> rowVars(tmp5,na.rm=TRUE)
 [1] 7808.84198   63.36778   57.64407  104.43790   80.67691   55.23808
 [7]   59.00064   48.96604   69.66607   71.96711
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.367652  7.960388  7.592369 10.219486  8.982033  7.432232  7.681188
 [8]  6.997574  8.346620  8.483343
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.77237  84.26369  85.86990  96.14931  87.29147  79.65407  84.07298
 [8]  84.17482  83.49458  85.19445
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.83600 56.18087 58.51304 56.53670 55.87586 54.22240 56.93186 60.55325
 [9] 57.61244 56.31653
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.84113  71.34249  72.57170  73.16182  72.03460  71.22005  70.34824
 [8]  71.86051  71.83235  68.94128  71.31682  68.26817  66.22678  69.25825
[15]  68.72911  75.21992  65.87975  73.32878  70.47575  71.53536
> colSums(tmp5,na.rm=TRUE)
 [1] 1024.5701  713.4249  725.7170  731.6182  720.3460  712.2005  703.4824
 [8]  718.6051  718.3235  689.4128  713.1682  682.6817  662.2678  692.5825
[15]  687.2911  752.1992  658.7975  733.2878  704.7575  715.3536
> colVars(tmp5,na.rm=TRUE)
 [1] 17544.72235    80.27362    36.83637    18.52971    63.34714    71.90716
 [7]    59.71275    61.68390    74.06836    69.24226   109.84400    41.00646
[13]   123.92485   104.06624    26.44583    42.63842    67.36776   118.39759
[19]    63.08237   151.73102
> colSd(tmp5,na.rm=TRUE)
 [1] 132.456492   8.959555   6.069297   4.304615   7.959092   8.479809
 [7]   7.727403   7.853910   8.606298   8.321193  10.480649   6.403628
[13]  11.132154  10.201286   5.142551   6.529810   8.207786  10.881065
[19]   7.942441  12.317915
> colMax(tmp5,na.rm=TRUE)
 [1] 466.77237  82.04421  79.79850  78.32440  84.26369  81.04332  85.19445
 [8]  84.01679  85.86990  83.22438  85.92673  78.54929  88.96517  83.49458
[15]  75.79491  81.70705  78.75174  87.29147  82.39201  96.14931
> colMin(tmp5,na.rm=TRUE)
 [1] 62.20304 54.22240 63.24012 66.30637 59.00555 57.57939 58.59409 58.62201
 [9] 57.65809 56.53670 56.17874 59.45960 54.83600 54.97219 62.78085 61.25241
[17] 54.84097 56.18087 57.61244 56.31653
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.16518 72.07074 70.75158      NaN 69.83677 69.88752 68.74595 70.92844
 [9] 69.75013 67.37966
> rowSums(tmp5,na.rm=TRUE)
 [1] 1863.304 1441.415 1415.032    0.000 1396.735 1397.750 1374.919 1418.569
 [9] 1395.003 1347.593
> rowVars(tmp5,na.rm=TRUE)
 [1] 7808.84198   63.36778   57.64407         NA   80.67691   55.23808
 [7]   59.00064   48.96604   69.66607   71.96711
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.367652  7.960388  7.592369        NA  8.982033  7.432232  7.681188
 [8]  6.997574  8.346620  8.483343
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.77237  84.26369  85.86990        NA  87.29147  79.65407  84.07298
 [8]  84.17482  83.49458  85.19445
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.83600 56.18087 58.51304       NA 55.87586 54.22240 56.93186 60.55325
 [9] 57.61244 56.31653
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.92219 73.60854 73.42332 72.30040 71.47231 70.53423 73.33145
 [9] 71.02849 70.31956 69.69349 67.86937 63.70029 67.95805 68.21694 74.58137
[17] 65.44408 72.70612 69.28364 68.80047
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 647.2997 662.4769 660.8099 650.7036 643.2508 634.8081 659.9831
 [9] 639.2565 632.8761 627.2414 610.8244 573.3026 611.6225 613.9525 671.2323
[17] 588.9967 654.3551 623.5528 619.2042
> colVars(tmp5,na.rm=TRUE)
 [1]        NA  86.52718  29.34670  20.07662  70.47077  80.17971  66.78769
 [8]  45.05300  76.05734  56.52622  93.92872  44.34305  67.60511  98.05635
[15]  26.80050  43.38107  73.65336 128.83565  54.98011  86.55201
> colSd(tmp5,na.rm=TRUE)
 [1]        NA  9.301999  5.417259  4.480694  8.394687  8.954312  8.172374
 [8]  6.712153  8.721086  7.518392  9.691683  6.659057  8.222233  9.902341
[15]  5.176920  6.586431  8.582154 11.350579  7.414857  9.303333
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 82.04421 79.79850 78.32440 84.26369 81.04332 85.19445 84.01679
 [9] 85.86990 83.22438 84.07298 78.54929 78.14383 83.49458 75.79491 81.70705
[17] 78.75174 87.29147 82.39201 84.17482
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 54.22240 64.49702 66.30637 59.00555 57.57939 58.59409 63.45831
 [9] 57.65809 58.51304 56.17874 59.45960 54.83600 54.97219 62.78085 61.25241
[17] 54.84097 56.18087 57.61244 56.31653
> 
> 
> 
> 
> 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] 146.8975 212.5134 236.4326 275.1779 114.1189 179.7934 298.2909 262.6244
 [9] 141.9550 125.5644
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 146.8975 212.5134 236.4326 275.1779 114.1189 179.7934 298.2909 262.6244
 [9] 141.9550 125.5644
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.705303e-13 -4.263256e-14  0.000000e+00 -5.684342e-14  5.684342e-14
 [6] -2.842171e-14  1.705303e-13  0.000000e+00 -1.136868e-13  5.684342e-14
[11] -1.989520e-13  0.000000e+00  0.000000e+00 -1.705303e-13 -1.136868e-13
[16] -2.273737e-13  0.000000e+00  8.526513e-14 -1.278977e-13  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
5   4 
3   14 
1   5 
10   17 
3   16 
10   4 
10   1 
8   13 
6   18 
1   10 
9   11 
3   10 
1   6 
2   4 
9   2 
5   16 
1   18 
7   17 
2   7 
3   3 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.042412
> Min(tmp)
[1] -2.345345
> mean(tmp)
[1] -0.01073302
> Sum(tmp)
[1] -1.073302
> Var(tmp)
[1] 1.024238
> 
> rowMeans(tmp)
[1] -0.01073302
> rowSums(tmp)
[1] -1.073302
> rowVars(tmp)
[1] 1.024238
> rowSd(tmp)
[1] 1.012046
> rowMax(tmp)
[1] 2.042412
> rowMin(tmp)
[1] -2.345345
> 
> colMeans(tmp)
  [1] -1.163376603  1.652879022  1.325247831  0.966296067 -1.790915353
  [6]  1.029538769  1.932330660  0.169356720 -0.462676644 -0.597716982
 [11] -0.649265319  0.632213083 -1.256579973 -0.568960634 -0.877538068
 [16] -0.267548050  0.375990596  0.263350138 -0.880952100  1.099395210
 [21]  0.005304298 -1.363499263 -2.345345392  2.042412420  1.226268004
 [26]  0.056355664 -0.027401896 -0.742454600  1.354705836 -1.501300913
 [31]  0.628515726  1.722826660 -0.687245815  0.889700312  0.335648967
 [36]  0.542895275 -1.448786543 -0.624623609 -1.909220122 -0.213324709
 [41] -1.296433502  0.247331291 -1.178322523  0.820071396  0.261278057
 [46]  0.459632851 -0.246542245  0.631275270  1.739671112 -0.109738174
 [51] -1.492077719 -0.215468322 -0.609727804  0.617026573 -0.109730009
 [56]  0.954514764 -0.634741416  1.782976187 -1.252626740 -0.869744153
 [61]  0.097550670 -0.512614614 -0.791363326  1.816898568  0.078672626
 [66]  0.256277868 -0.172721492 -0.821757667 -0.823771729  1.320970967
 [71]  0.958373872  1.102524461  0.534693723  1.534982644  0.575756454
 [76]  0.641551004  0.626695414  0.722747560 -0.941959346 -0.703675508
 [81] -1.003716586  1.122707897  1.291542490  0.635411816  0.259022616
 [86] -2.130628728 -1.870675639  0.574269210 -1.113834849 -1.588509460
 [91] -0.801202050 -0.191582981 -0.238764078 -0.733408288 -0.297294082
 [96]  0.632764221  0.490751777 -0.159993947 -0.177498909  0.356381707
> colSums(tmp)
  [1] -1.163376603  1.652879022  1.325247831  0.966296067 -1.790915353
  [6]  1.029538769  1.932330660  0.169356720 -0.462676644 -0.597716982
 [11] -0.649265319  0.632213083 -1.256579973 -0.568960634 -0.877538068
 [16] -0.267548050  0.375990596  0.263350138 -0.880952100  1.099395210
 [21]  0.005304298 -1.363499263 -2.345345392  2.042412420  1.226268004
 [26]  0.056355664 -0.027401896 -0.742454600  1.354705836 -1.501300913
 [31]  0.628515726  1.722826660 -0.687245815  0.889700312  0.335648967
 [36]  0.542895275 -1.448786543 -0.624623609 -1.909220122 -0.213324709
 [41] -1.296433502  0.247331291 -1.178322523  0.820071396  0.261278057
 [46]  0.459632851 -0.246542245  0.631275270  1.739671112 -0.109738174
 [51] -1.492077719 -0.215468322 -0.609727804  0.617026573 -0.109730009
 [56]  0.954514764 -0.634741416  1.782976187 -1.252626740 -0.869744153
 [61]  0.097550670 -0.512614614 -0.791363326  1.816898568  0.078672626
 [66]  0.256277868 -0.172721492 -0.821757667 -0.823771729  1.320970967
 [71]  0.958373872  1.102524461  0.534693723  1.534982644  0.575756454
 [76]  0.641551004  0.626695414  0.722747560 -0.941959346 -0.703675508
 [81] -1.003716586  1.122707897  1.291542490  0.635411816  0.259022616
 [86] -2.130628728 -1.870675639  0.574269210 -1.113834849 -1.588509460
 [91] -0.801202050 -0.191582981 -0.238764078 -0.733408288 -0.297294082
 [96]  0.632764221  0.490751777 -0.159993947 -0.177498909  0.356381707
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.163376603  1.652879022  1.325247831  0.966296067 -1.790915353
  [6]  1.029538769  1.932330660  0.169356720 -0.462676644 -0.597716982
 [11] -0.649265319  0.632213083 -1.256579973 -0.568960634 -0.877538068
 [16] -0.267548050  0.375990596  0.263350138 -0.880952100  1.099395210
 [21]  0.005304298 -1.363499263 -2.345345392  2.042412420  1.226268004
 [26]  0.056355664 -0.027401896 -0.742454600  1.354705836 -1.501300913
 [31]  0.628515726  1.722826660 -0.687245815  0.889700312  0.335648967
 [36]  0.542895275 -1.448786543 -0.624623609 -1.909220122 -0.213324709
 [41] -1.296433502  0.247331291 -1.178322523  0.820071396  0.261278057
 [46]  0.459632851 -0.246542245  0.631275270  1.739671112 -0.109738174
 [51] -1.492077719 -0.215468322 -0.609727804  0.617026573 -0.109730009
 [56]  0.954514764 -0.634741416  1.782976187 -1.252626740 -0.869744153
 [61]  0.097550670 -0.512614614 -0.791363326  1.816898568  0.078672626
 [66]  0.256277868 -0.172721492 -0.821757667 -0.823771729  1.320970967
 [71]  0.958373872  1.102524461  0.534693723  1.534982644  0.575756454
 [76]  0.641551004  0.626695414  0.722747560 -0.941959346 -0.703675508
 [81] -1.003716586  1.122707897  1.291542490  0.635411816  0.259022616
 [86] -2.130628728 -1.870675639  0.574269210 -1.113834849 -1.588509460
 [91] -0.801202050 -0.191582981 -0.238764078 -0.733408288 -0.297294082
 [96]  0.632764221  0.490751777 -0.159993947 -0.177498909  0.356381707
> colMin(tmp)
  [1] -1.163376603  1.652879022  1.325247831  0.966296067 -1.790915353
  [6]  1.029538769  1.932330660  0.169356720 -0.462676644 -0.597716982
 [11] -0.649265319  0.632213083 -1.256579973 -0.568960634 -0.877538068
 [16] -0.267548050  0.375990596  0.263350138 -0.880952100  1.099395210
 [21]  0.005304298 -1.363499263 -2.345345392  2.042412420  1.226268004
 [26]  0.056355664 -0.027401896 -0.742454600  1.354705836 -1.501300913
 [31]  0.628515726  1.722826660 -0.687245815  0.889700312  0.335648967
 [36]  0.542895275 -1.448786543 -0.624623609 -1.909220122 -0.213324709
 [41] -1.296433502  0.247331291 -1.178322523  0.820071396  0.261278057
 [46]  0.459632851 -0.246542245  0.631275270  1.739671112 -0.109738174
 [51] -1.492077719 -0.215468322 -0.609727804  0.617026573 -0.109730009
 [56]  0.954514764 -0.634741416  1.782976187 -1.252626740 -0.869744153
 [61]  0.097550670 -0.512614614 -0.791363326  1.816898568  0.078672626
 [66]  0.256277868 -0.172721492 -0.821757667 -0.823771729  1.320970967
 [71]  0.958373872  1.102524461  0.534693723  1.534982644  0.575756454
 [76]  0.641551004  0.626695414  0.722747560 -0.941959346 -0.703675508
 [81] -1.003716586  1.122707897  1.291542490  0.635411816  0.259022616
 [86] -2.130628728 -1.870675639  0.574269210 -1.113834849 -1.588509460
 [91] -0.801202050 -0.191582981 -0.238764078 -0.733408288 -0.297294082
 [96]  0.632764221  0.490751777 -0.159993947 -0.177498909  0.356381707
> colMedians(tmp)
  [1] -1.163376603  1.652879022  1.325247831  0.966296067 -1.790915353
  [6]  1.029538769  1.932330660  0.169356720 -0.462676644 -0.597716982
 [11] -0.649265319  0.632213083 -1.256579973 -0.568960634 -0.877538068
 [16] -0.267548050  0.375990596  0.263350138 -0.880952100  1.099395210
 [21]  0.005304298 -1.363499263 -2.345345392  2.042412420  1.226268004
 [26]  0.056355664 -0.027401896 -0.742454600  1.354705836 -1.501300913
 [31]  0.628515726  1.722826660 -0.687245815  0.889700312  0.335648967
 [36]  0.542895275 -1.448786543 -0.624623609 -1.909220122 -0.213324709
 [41] -1.296433502  0.247331291 -1.178322523  0.820071396  0.261278057
 [46]  0.459632851 -0.246542245  0.631275270  1.739671112 -0.109738174
 [51] -1.492077719 -0.215468322 -0.609727804  0.617026573 -0.109730009
 [56]  0.954514764 -0.634741416  1.782976187 -1.252626740 -0.869744153
 [61]  0.097550670 -0.512614614 -0.791363326  1.816898568  0.078672626
 [66]  0.256277868 -0.172721492 -0.821757667 -0.823771729  1.320970967
 [71]  0.958373872  1.102524461  0.534693723  1.534982644  0.575756454
 [76]  0.641551004  0.626695414  0.722747560 -0.941959346 -0.703675508
 [81] -1.003716586  1.122707897  1.291542490  0.635411816  0.259022616
 [86] -2.130628728 -1.870675639  0.574269210 -1.113834849 -1.588509460
 [91] -0.801202050 -0.191582981 -0.238764078 -0.733408288 -0.297294082
 [96]  0.632764221  0.490751777 -0.159993947 -0.177498909  0.356381707
> colRanges(tmp)
          [,1]     [,2]     [,3]      [,4]      [,5]     [,6]     [,7]
[1,] -1.163377 1.652879 1.325248 0.9662961 -1.790915 1.029539 1.932331
[2,] -1.163377 1.652879 1.325248 0.9662961 -1.790915 1.029539 1.932331
          [,8]       [,9]     [,10]      [,11]     [,12]    [,13]      [,14]
[1,] 0.1693567 -0.4626766 -0.597717 -0.6492653 0.6322131 -1.25658 -0.5689606
[2,] 0.1693567 -0.4626766 -0.597717 -0.6492653 0.6322131 -1.25658 -0.5689606
          [,15]      [,16]     [,17]     [,18]      [,19]    [,20]       [,21]
[1,] -0.8775381 -0.2675481 0.3759906 0.2633501 -0.8809521 1.099395 0.005304298
[2,] -0.8775381 -0.2675481 0.3759906 0.2633501 -0.8809521 1.099395 0.005304298
         [,22]     [,23]    [,24]    [,25]      [,26]      [,27]      [,28]
[1,] -1.363499 -2.345345 2.042412 1.226268 0.05635566 -0.0274019 -0.7424546
[2,] -1.363499 -2.345345 2.042412 1.226268 0.05635566 -0.0274019 -0.7424546
        [,29]     [,30]     [,31]    [,32]      [,33]     [,34]    [,35]
[1,] 1.354706 -1.501301 0.6285157 1.722827 -0.6872458 0.8897003 0.335649
[2,] 1.354706 -1.501301 0.6285157 1.722827 -0.6872458 0.8897003 0.335649
         [,36]     [,37]      [,38]    [,39]      [,40]     [,41]     [,42]
[1,] 0.5428953 -1.448787 -0.6246236 -1.90922 -0.2133247 -1.296434 0.2473313
[2,] 0.5428953 -1.448787 -0.6246236 -1.90922 -0.2133247 -1.296434 0.2473313
         [,43]     [,44]     [,45]     [,46]      [,47]     [,48]    [,49]
[1,] -1.178323 0.8200714 0.2612781 0.4596329 -0.2465422 0.6312753 1.739671
[2,] -1.178323 0.8200714 0.2612781 0.4596329 -0.2465422 0.6312753 1.739671
          [,50]     [,51]      [,52]      [,53]     [,54]    [,55]     [,56]
[1,] -0.1097382 -1.492078 -0.2154683 -0.6097278 0.6170266 -0.10973 0.9545148
[2,] -0.1097382 -1.492078 -0.2154683 -0.6097278 0.6170266 -0.10973 0.9545148
          [,57]    [,58]     [,59]      [,60]      [,61]      [,62]      [,63]
[1,] -0.6347414 1.782976 -1.252627 -0.8697442 0.09755067 -0.5126146 -0.7913633
[2,] -0.6347414 1.782976 -1.252627 -0.8697442 0.09755067 -0.5126146 -0.7913633
        [,64]      [,65]     [,66]      [,67]      [,68]      [,69]    [,70]
[1,] 1.816899 0.07867263 0.2562779 -0.1727215 -0.8217577 -0.8237717 1.320971
[2,] 1.816899 0.07867263 0.2562779 -0.1727215 -0.8217577 -0.8237717 1.320971
         [,71]    [,72]     [,73]    [,74]     [,75]    [,76]     [,77]
[1,] 0.9583739 1.102524 0.5346937 1.534983 0.5757565 0.641551 0.6266954
[2,] 0.9583739 1.102524 0.5346937 1.534983 0.5757565 0.641551 0.6266954
         [,78]      [,79]      [,80]     [,81]    [,82]    [,83]     [,84]
[1,] 0.7227476 -0.9419593 -0.7036755 -1.003717 1.122708 1.291542 0.6354118
[2,] 0.7227476 -0.9419593 -0.7036755 -1.003717 1.122708 1.291542 0.6354118
         [,85]     [,86]     [,87]     [,88]     [,89]     [,90]     [,91]
[1,] 0.2590226 -2.130629 -1.870676 0.5742692 -1.113835 -1.588509 -0.801202
[2,] 0.2590226 -2.130629 -1.870676 0.5742692 -1.113835 -1.588509 -0.801202
         [,92]      [,93]      [,94]      [,95]     [,96]     [,97]      [,98]
[1,] -0.191583 -0.2387641 -0.7334083 -0.2972941 0.6327642 0.4907518 -0.1599939
[2,] -0.191583 -0.2387641 -0.7334083 -0.2972941 0.6327642 0.4907518 -0.1599939
          [,99]    [,100]
[1,] -0.1774989 0.3563817
[2,] -0.1774989 0.3563817
> 
> 
> Max(tmp2)
[1] 2.266167
> Min(tmp2)
[1] -3.160073
> mean(tmp2)
[1] -0.06130444
> Sum(tmp2)
[1] -6.130444
> Var(tmp2)
[1] 0.9574394
> 
> rowMeans(tmp2)
  [1] -0.053622098 -0.167510755 -0.666279986 -0.449514495 -0.397950409
  [6] -0.636237547  0.866802546  0.020294529  0.926571589  0.533534428
 [11]  0.491704181  1.167437490  1.115928281 -0.737980449 -0.551757710
 [16]  1.986020322 -0.089698141  1.255518436 -1.120931935  0.649160471
 [21]  0.515357785  1.065520412  0.426608685 -0.287866493 -0.972366528
 [26]  1.455875208  0.758654597 -1.356765904 -1.319029579  0.425789312
 [31]  0.138769762  0.205002682 -0.638002160 -0.635741550 -0.674933516
 [36]  0.141305354 -0.796872074 -1.411928656  0.257318108  0.370826042
 [41] -0.230307172 -3.160072829 -1.214121130 -1.674444962 -0.120056169
 [46]  1.779161649  1.179963616 -0.038944152  1.180277941 -2.637074391
 [51]  0.777641952  0.602658661 -0.698305362 -0.319982982  0.508750158
 [56]  1.128214356  0.800685237  1.529327595 -0.522422076 -2.442301143
 [61] -0.836690587  0.047860320 -0.329918229  0.603789693  0.126703005
 [66] -0.348570189 -1.299548943  0.432464074  0.268095771 -0.285826038
 [71]  1.355488780  0.191891871 -0.106759616 -0.583072860 -1.537021077
 [76] -0.175054081 -0.283168996 -0.960982149  0.232357989 -0.124335449
 [81] -0.228475777 -0.171602328 -0.088249339  1.431033416 -1.180728052
 [86] -1.087973509 -0.563197417  0.370458975  2.266167427  0.940121771
 [91] -0.548051118  0.006863233 -0.103545236 -0.094707843  1.789045334
 [96] -0.726485543 -1.414611719  0.337287248 -0.337393530 -1.351761949
> rowSums(tmp2)
  [1] -0.053622098 -0.167510755 -0.666279986 -0.449514495 -0.397950409
  [6] -0.636237547  0.866802546  0.020294529  0.926571589  0.533534428
 [11]  0.491704181  1.167437490  1.115928281 -0.737980449 -0.551757710
 [16]  1.986020322 -0.089698141  1.255518436 -1.120931935  0.649160471
 [21]  0.515357785  1.065520412  0.426608685 -0.287866493 -0.972366528
 [26]  1.455875208  0.758654597 -1.356765904 -1.319029579  0.425789312
 [31]  0.138769762  0.205002682 -0.638002160 -0.635741550 -0.674933516
 [36]  0.141305354 -0.796872074 -1.411928656  0.257318108  0.370826042
 [41] -0.230307172 -3.160072829 -1.214121130 -1.674444962 -0.120056169
 [46]  1.779161649  1.179963616 -0.038944152  1.180277941 -2.637074391
 [51]  0.777641952  0.602658661 -0.698305362 -0.319982982  0.508750158
 [56]  1.128214356  0.800685237  1.529327595 -0.522422076 -2.442301143
 [61] -0.836690587  0.047860320 -0.329918229  0.603789693  0.126703005
 [66] -0.348570189 -1.299548943  0.432464074  0.268095771 -0.285826038
 [71]  1.355488780  0.191891871 -0.106759616 -0.583072860 -1.537021077
 [76] -0.175054081 -0.283168996 -0.960982149  0.232357989 -0.124335449
 [81] -0.228475777 -0.171602328 -0.088249339  1.431033416 -1.180728052
 [86] -1.087973509 -0.563197417  0.370458975  2.266167427  0.940121771
 [91] -0.548051118  0.006863233 -0.103545236 -0.094707843  1.789045334
 [96] -0.726485543 -1.414611719  0.337287248 -0.337393530 -1.351761949
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.053622098 -0.167510755 -0.666279986 -0.449514495 -0.397950409
  [6] -0.636237547  0.866802546  0.020294529  0.926571589  0.533534428
 [11]  0.491704181  1.167437490  1.115928281 -0.737980449 -0.551757710
 [16]  1.986020322 -0.089698141  1.255518436 -1.120931935  0.649160471
 [21]  0.515357785  1.065520412  0.426608685 -0.287866493 -0.972366528
 [26]  1.455875208  0.758654597 -1.356765904 -1.319029579  0.425789312
 [31]  0.138769762  0.205002682 -0.638002160 -0.635741550 -0.674933516
 [36]  0.141305354 -0.796872074 -1.411928656  0.257318108  0.370826042
 [41] -0.230307172 -3.160072829 -1.214121130 -1.674444962 -0.120056169
 [46]  1.779161649  1.179963616 -0.038944152  1.180277941 -2.637074391
 [51]  0.777641952  0.602658661 -0.698305362 -0.319982982  0.508750158
 [56]  1.128214356  0.800685237  1.529327595 -0.522422076 -2.442301143
 [61] -0.836690587  0.047860320 -0.329918229  0.603789693  0.126703005
 [66] -0.348570189 -1.299548943  0.432464074  0.268095771 -0.285826038
 [71]  1.355488780  0.191891871 -0.106759616 -0.583072860 -1.537021077
 [76] -0.175054081 -0.283168996 -0.960982149  0.232357989 -0.124335449
 [81] -0.228475777 -0.171602328 -0.088249339  1.431033416 -1.180728052
 [86] -1.087973509 -0.563197417  0.370458975  2.266167427  0.940121771
 [91] -0.548051118  0.006863233 -0.103545236 -0.094707843  1.789045334
 [96] -0.726485543 -1.414611719  0.337287248 -0.337393530 -1.351761949
> rowMin(tmp2)
  [1] -0.053622098 -0.167510755 -0.666279986 -0.449514495 -0.397950409
  [6] -0.636237547  0.866802546  0.020294529  0.926571589  0.533534428
 [11]  0.491704181  1.167437490  1.115928281 -0.737980449 -0.551757710
 [16]  1.986020322 -0.089698141  1.255518436 -1.120931935  0.649160471
 [21]  0.515357785  1.065520412  0.426608685 -0.287866493 -0.972366528
 [26]  1.455875208  0.758654597 -1.356765904 -1.319029579  0.425789312
 [31]  0.138769762  0.205002682 -0.638002160 -0.635741550 -0.674933516
 [36]  0.141305354 -0.796872074 -1.411928656  0.257318108  0.370826042
 [41] -0.230307172 -3.160072829 -1.214121130 -1.674444962 -0.120056169
 [46]  1.779161649  1.179963616 -0.038944152  1.180277941 -2.637074391
 [51]  0.777641952  0.602658661 -0.698305362 -0.319982982  0.508750158
 [56]  1.128214356  0.800685237  1.529327595 -0.522422076 -2.442301143
 [61] -0.836690587  0.047860320 -0.329918229  0.603789693  0.126703005
 [66] -0.348570189 -1.299548943  0.432464074  0.268095771 -0.285826038
 [71]  1.355488780  0.191891871 -0.106759616 -0.583072860 -1.537021077
 [76] -0.175054081 -0.283168996 -0.960982149  0.232357989 -0.124335449
 [81] -0.228475777 -0.171602328 -0.088249339  1.431033416 -1.180728052
 [86] -1.087973509 -0.563197417  0.370458975  2.266167427  0.940121771
 [91] -0.548051118  0.006863233 -0.103545236 -0.094707843  1.789045334
 [96] -0.726485543 -1.414611719  0.337287248 -0.337393530 -1.351761949
> 
> colMeans(tmp2)
[1] -0.06130444
> colSums(tmp2)
[1] -6.130444
> colVars(tmp2)
[1] 0.9574394
> colSd(tmp2)
[1] 0.9784883
> colMax(tmp2)
[1] 2.266167
> colMin(tmp2)
[1] -3.160073
> colMedians(tmp2)
[1] -0.09912654
> colRanges(tmp2)
          [,1]
[1,] -3.160073
[2,]  2.266167
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.7756342 -6.1229917 -1.3571686  1.3316764  0.7046070 -2.4786336
 [7] -1.0725301  0.6762948  2.7075214 -0.3059694
> colApply(tmp,quantile)[,1]
             [,1]
[1,] -2.220825702
[2,] -0.524936790
[3,]  0.002595891
[4,]  0.319896580
[5,]  1.060304605
> 
> rowApply(tmp,sum)
 [1] -3.620366  2.949392 -1.123890 -0.251046  1.138190 -1.067406  1.198549
 [8] -6.505870  1.722545 -3.132927
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    5    5    4    6    5    3    1   10    10
 [2,]    6    2    1    5    7    1    1    4    6     8
 [3,]    5    6    8    2    2    3    8   10    8     4
 [4,]    4    3   10    1    8   10    7    9    5     3
 [5,]   10    4    6    9    4    7    4    5    1     7
 [6,]    7   10    4    3    1    2    9    3    4     5
 [7,]    2    7    2    6    9    6    6    8    3     6
 [8,]    9    9    7   10    3    4    2    2    2     9
 [9,]    8    8    9    8    5    8    5    7    7     2
[10,]    3    1    3    7   10    9   10    6    9     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.54653787  2.74981696 -4.10836998  0.08887193  1.36817091  0.11205954
 [7]  2.81324753 -1.15052385  1.73552484  1.16585083  0.67042798  1.96007194
[13] -0.13183750  1.36059793 -2.37995914  5.58828253 -0.40554903 -2.70659155
[19] -3.61403205 -3.48992807
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.2683588
[2,] -1.4243596
[3,] -1.1738971
[4,]  0.8067597
[5,]  2.5133179
> 
> rowApply(tmp,sum)
[1] -0.7102461  0.6260321  2.8459024 -3.4035391  0.7214447
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   15   20    4    2
[2,]   14    4   12   20   18
[3,]    5    1    2    3   17
[4,]   11   14    3   18    7
[5,]   17    3   15   19    8
> 
> 
> as.matrix(tmp)
           [,1]       [,2]      [,3]       [,4]       [,5]         [,6]
[1,] -2.2683588  0.6924329 -1.111167  0.2212012  0.9304984 -1.520831256
[2,]  0.8067597 -1.0466388 -1.501978  0.7909567 -1.4037665  0.556952689
[3,]  2.5133179  0.3621930 -1.468643 -1.4273952  0.9525740  1.571909636
[4,] -1.1738971  1.4859540 -1.255432  0.9406322  1.2918258  0.003889806
[5,] -1.4243596  1.2558759  1.228850 -0.4365230 -0.4029609 -0.499861332
          [,7]        [,8]       [,9]       [,10]       [,11]      [,12]
[1,] 0.9606317 -0.05099362  0.0520435  1.07208797  0.61366512  0.7165275
[2,] 0.5755528  0.89839679  1.0008131 -0.14403022  0.07247199 -1.0453477
[3,] 0.2751237 -1.02805118 -1.6333245 -0.19035111 -0.29699539  1.0084313
[4,] 0.4413028 -0.89684688  0.4623517  0.04098121  0.09964978  0.5573789
[5,] 0.5606365 -0.07302896  1.8536410  0.38716298  0.18163647  0.7230819
           [,13]       [,14]      [,15]      [,16]       [,17]      [,18]
[1,] -0.01328683  0.86020841 -2.2974959  2.0051872  0.31223916 -1.2501719
[2,]  1.28308857  0.46867395 -0.9128105  1.3354536  0.17146361 -0.9151807
[3,] -0.86478090  0.84490972  1.2182201  1.5961386 -0.01845452 -0.6365125
[4,] -1.38097131 -0.72222134  0.5149624 -0.6573351 -0.26197140  0.2156257
[5,]  0.84411298 -0.09097281 -0.9028353  1.3088382 -0.60882588 -0.1203523
          [,19]       [,20]
[1,] -0.7204741  0.08580961
[2,] -1.4112099  1.04641066
[3,]  0.4743182 -0.40672557
[4,] -0.5328623 -2.57655570
[5,] -1.4238040 -1.63886708
> 
> 
> 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 :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2       col3    col4      col5      col6       col7
row1 0.8018281 0.1955674 0.06117053 2.62044 0.9828861 0.2546188 0.05936395
          col8       col9     col10      col11     col12    col13     col14
row1 -1.399804 -0.3642422 -1.915967 -0.4214954 0.1987895 1.257657 0.2453605
          col15      col16    col17    col18    col19    col20
row1 0.01141393 -0.2298121 1.278854 1.759073 1.453046 1.669672
> tmp[,"col10"]
          col10
row1 -1.9159675
row2 -1.5025703
row3 -0.6300875
row4  1.6668900
row5  0.2814327
> tmp[c("row1","row5"),]
           col1      col2        col3      col4      col5       col6       col7
row1 0.80182810 0.1955674  0.06117053 2.6204403 0.9828861  0.2546188 0.05936395
row5 0.09602017 0.1031055 -0.51258714 0.3474406 0.2091569 -0.6442742 3.21509846
          col8       col9      col10      col11      col12     col13      col14
row1 -1.399804 -0.3642422 -1.9159675 -0.4214954 0.19878953 1.2576568  0.2453605
row5 -1.296924  0.5795363  0.2814327 -0.6086124 0.01062964 0.8409116 -0.8320694
           col15       col16     col17    col18     col19     col20
row1  0.01141393 -0.22981206  1.278854 1.759073 1.4530463 1.6696716
row5 -1.48225090 -0.05745326 -1.816980 1.871378 0.8362428 0.4188716
> tmp[,c("col6","col20")]
            col6      col20
row1  0.25461884  1.6696716
row2 -0.75008955  0.3929057
row3 -0.26152930 -0.2571028
row4 -0.08036693 -0.3160421
row5 -0.64427415  0.4188716
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  0.2546188 1.6696716
row5 -0.6442742 0.4188716
> 
> 
> 
> 
> 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 48.43148 49.42598 50.05279 49.23376 49.42451 106.0673 49.21554 48.92236
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.95299 49.41896 51.04449 49.67443 50.96345 51.51392 49.82939 50.20726
        col17    col18    col19    col20
row1 51.08416 50.50965 50.04441 102.6817
> tmp[,"col10"]
        col10
row1 49.41896
row2 28.29840
row3 29.24058
row4 28.10668
row5 50.50141
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.43148 49.42598 50.05279 49.23376 49.42451 106.0673 49.21554 48.92236
row5 51.29031 49.12823 48.51751 50.18578 50.43280 105.9317 49.73290 46.58753
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.95299 49.41896 51.04449 49.67443 50.96345 51.51392 49.82939 50.20726
row5 47.75197 50.50141 49.22539 49.85343 51.11033 50.62667 48.27786 50.16835
        col17    col18    col19    col20
row1 51.08416 50.50965 50.04441 102.6817
row5 49.17311 48.66731 48.75297 102.8647
> tmp[,c("col6","col20")]
          col6     col20
row1 106.06734 102.68170
row2  74.80547  74.08764
row3  75.06937  75.81755
row4  75.11793  75.21155
row5 105.93169 102.86465
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.0673 102.6817
row5 105.9317 102.8647
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.0673 102.6817
row5 105.9317 102.8647
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.5625972
[2,]  0.2164148
[3,]  0.4037054
[4,] -0.6446547
[5,]  0.6893585
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.5470845  0.4725790
[2,] -1.1149943  0.4676923
[3,]  1.3678497 -0.9989161
[4,]  0.3976685  1.7617032
[5,] -1.0652337  1.0320506
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.08079349 -1.0253469
[2,] -1.48228102  1.0324284
[3,] -0.80287348 -0.6881787
[4,]  0.15775305 -0.5978752
[5,]  1.35128988 -1.7266764
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.08079349
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.08079349
[2,] -1.48228102
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3  0.2793857 -0.3319159 -1.0688837 -0.6336419 -1.0257035  0.8875961
row1 -0.8349019 -0.4726103 -0.9076398  0.3863372 -0.3449535 -0.1596183
            [,7]       [,8]     [,9]      [,10]      [,11]     [,12]      [,13]
row3  0.08713018 -0.1200480 1.701535 -1.5662310 -0.7080082 0.8200414 -0.3957788
row1 -0.58987172 -0.3091615 0.970409  0.4970068  0.8228862 0.0987731  0.9214925
          [,14]      [,15]     [,16]      [,17]    [,18]        [,19]     [,20]
row3 -0.3764016 -0.8871589 0.5185493 -0.5451779 0.209241 -0.003309072 -1.785154
row1  0.7448344  2.1996346 0.7394022  0.2313322 0.885325 -0.058486330 -1.519169
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]      [,4]     [,5]      [,6]     [,7]
row2 -0.5703136 0.1254694 0.6564561 -1.524031 2.224859 0.4035497 0.209372
          [,8]     [,9]      [,10]
row2 -1.223874 1.575989 -0.1922435
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]     [,3]     [,4]     [,5]      [,6]     [,7]
row5 -0.4264544 0.3214965 0.650929 1.470017 1.489615 0.7228472 1.040199
          [,8]      [,9]    [,10]     [,11]    [,12]       [,13]      [,14]
row5 0.1545214 -1.812929 1.230899 -1.083142 0.428636 -0.02037981 -0.5355843
          [,15]     [,16]      [,17]      [,18]     [,19]      [,20]
row5 -0.6994515 -1.033231 -0.6615528 -0.3137409 0.4926946 -0.1586776
> 
> 
> 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: 0x6000005fc120>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f6808e7e5" 
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f6b06f82"  
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f63f68c028"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f6761fa29d"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f616ed2e01"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f62d674f69"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f6598e8dc8"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f61dfe7367"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f62c4a7e93"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f64ebbfb9c"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f61783e726"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f654bc7bd9"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f622670f05"
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f61c0b22e8"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM61f61f20bbba"
> 
> 
> ### 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: 0x6000005f8240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000005f8240>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000005f8240>
> rowMedians(tmp)
  [1]  0.2512266465  0.3944888773 -0.2293012348  0.3346475219 -0.2917450794
  [6] -0.1952179654  0.4240309422  0.3415708387 -0.2282915340 -0.0606945076
 [11]  0.0019411893 -0.0455427030  0.4731621115  0.0928902828  0.4140940632
 [16] -0.0746791560  0.2762959577  0.2142942679 -0.5780558957  0.3192923645
 [21]  0.0909162035  0.4971115589  0.1444693978  0.1964308707  0.1820340210
 [26]  0.1125748674  0.1363169696 -0.0259446979 -0.1072493534 -0.6707876434
 [31]  0.0086765911 -0.1240914111  0.0782709073 -0.0644267780 -0.0060383365
 [36] -0.1606342071  0.1226218240 -0.5093508181  0.5287155949 -0.1878262753
 [41] -0.2166898817 -0.2781940504 -0.1045911362 -0.8766145889 -0.1879217920
 [46] -0.1214893936  0.3902974899  0.3775757180 -0.5156403309  0.0571561619
 [51]  0.4954316586  0.5428297016  0.0135577245 -0.2097961984  0.2196822498
 [56] -0.0731946926 -0.3001465476  0.0394991338  0.3807347771  0.1203088797
 [61] -0.0033586732  0.1632051028  0.1425105966  0.2821411972  0.1436755799
 [66] -0.1924162035 -0.0009898620 -0.0756155336 -0.3740681031 -0.1012554886
 [71] -0.2803765239 -0.1116572312 -0.2575386944  0.0034603775  0.2270498986
 [76] -0.4923186166  0.3004597250  0.0188061588 -0.1548351450 -0.3203561078
 [81]  0.2181385422 -0.6005279816 -0.0621201946 -0.4207451110  0.5497815215
 [86] -0.2155044163 -0.1876521239  0.2926487567  0.1889523568 -0.1847306571
 [91] -0.1986961356  0.1426047243 -0.0803549822  0.1236095438 -0.1719964314
 [96] -0.2852835319 -0.3060486100  0.0684421281 -0.0928746491 -0.1917689518
[101] -0.2281941878 -0.3346819095  0.3024065260  0.2690837824  0.6437721653
[106]  0.1332180878 -0.7780505215 -0.2398931319  0.1644046348 -0.2789792064
[111]  0.3360602402 -0.1342833081  0.0980749067  0.0775631603  0.0305357078
[116] -0.2778549023  0.0687899687  0.1586963154 -0.1663632278  0.0219920390
[121] -0.0621044006  0.0283567681  0.2252182050 -0.3494378324 -0.6460300519
[126] -0.1915306565 -0.2661782905  0.1306987613 -0.5961478238  0.0558202515
[131] -0.1783361506 -0.1828510703  0.1395548626  0.1211252928 -0.1672319277
[136] -0.1661053845 -0.0785488146  0.2305888316 -0.4652186320 -0.3292897071
[141]  0.2419562682 -0.1764286931  0.4887751966  0.3122535454  0.1748642779
[146]  0.0973636726 -0.2958614258  0.2654612367 -0.0368040596  0.1376050034
[151]  0.6615734973 -0.0635118888  0.1288845744  0.1446682742 -0.0353993711
[156] -0.1822508893  0.2596358248 -0.3931177958  0.0324079055  0.0602176991
[161]  0.3313620268  0.2038543236 -0.6943165055  0.4012160839  0.3275038833
[166] -0.5274962585  0.4491278322 -0.1547232892 -0.1716454132 -0.0620819638
[171]  0.3274391754 -0.1939220290  0.3031098462 -0.1412843588  0.3089978881
[176] -0.1981395907 -0.7540513626 -0.1362994465 -0.9945417076  0.3511275144
[181]  0.2728855620  0.0536816255  0.2090736722  0.0332241884  0.0714956106
[186] -0.1069090542  0.0155477626  0.3837884899 -0.5609436264 -0.2921118889
[191]  0.3405368664 -0.0925537168  0.2970014221  0.2530584737  0.3285144615
[196] -0.3161014479 -0.0404154486 -0.1597963206 -0.2357760823  0.1727291626
[201] -0.0004987433 -0.0360398074 -0.3545379701  0.0641406394  0.2891120316
[206] -0.4912716337  0.1553118847  0.2324371135 -0.0130442021  0.0370679413
[211] -0.4427204370 -0.0853134003 -0.0061086761 -0.1514320956 -0.4079424749
[216] -0.0662614326  0.0209520275  0.3509401068 -0.8071579719 -0.4416803481
[221] -0.2217453197 -0.0329880105 -0.4577285289  0.4655755841  0.1945284736
[226]  0.3650431048 -0.0346051609 -0.1540935631  0.2954212547 -0.2671186737
> 
> proc.time()
   user  system elapsed 
  0.629   3.307   4.113 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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: 0x600002d64000>
> .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: 0x600002d64000>
> .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: 0x600002d64000>
> .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: 0x600002d64000>
> 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: 0x600002d64780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002d64780>
> .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: 0x600002d64780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002d64780>
> .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: 0x600002d64780>
> 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: 0x600002d64960>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002d64960>
> .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: 0x600002d64960>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002d64960>
> .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: 0x600002d64960>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002d64960>
> .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: 0x600002d64960>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002d64960>
> .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: 0x600002d64960>
> 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: 0x600002d64b40>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002d64b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002d64b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002d64b40>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile63d23ab3b5e1" "BufferedMatrixFile63d2410b05f3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile63d23ab3b5e1" "BufferedMatrixFile63d2410b05f3"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002d64de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002d64de0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002d64de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002d64de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002d64de0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002d64de0>
> .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: 0x600002d64fc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002d64fc0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002d64fc0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002d64fc0>
> 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: 0x600002d651a0>
> .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: 0x600002d651a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.110   0.040   0.148 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.0 RC (2025-04-04 r88126) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-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.111   0.026   0.137 

Example timings