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

This page was generated on 2025-03-17 11:39 -0400 (Mon, 17 Mar 2025).

HostnameOSArch (*)R versionInstalled pkgs
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2025-03-01 r87860 ucrt) -- "Unsuffered Consequences" 4545
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences" 4576
kjohnson3macOS 13.7.1 Venturaarm64R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences" 4528
kunpeng2Linux (openEuler 24.03 LTS)aarch64R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" 4459
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

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


CHECK results for BufferedMatrix on 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.71.1
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.71.1.tar.gz
StartedAt: 2025-03-16 18:26:28 -0400 (Sun, 16 Mar 2025)
EndedAt: 2025-03-16 18:26:45 -0400 (Sun, 16 Mar 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.71.1.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-03-02 r87868)
* using platform: 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.71.1’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 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.71.1’
** 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 -Wl,-framework -Wl,CoreFoundation
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 Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences"
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.111   0.041   0.148 

BufferedMatrix.Rcheck/tests/objectTesting.Rout

R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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 480271 25.7    1055041 56.4         NA   634322 33.9
Vcells 890108  6.8    8388608 64.0     196608  2109036 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] "Sun Mar 16 18:26:38 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] "Sun Mar 16 18:26:38 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: 0x6000011c4000>
> 
> 
> 
> 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] "Sun Mar 16 18:26:39 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] "Sun Mar 16 18:26:39 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000011c4000>
> 
> 
> 
> ### 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,] 100.9578583 -1.2843778  0.0900955  0.9091096
[2,]  -1.6977468  1.0134237  0.4596458 -0.6832384
[3,]   0.7192806  0.6496045  1.0980168  0.6055721
[4,]  -0.7877016  1.7160507 -1.5645345 -2.1669722
> 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,] 100.9578583 1.2843778 0.0900955 0.9091096
[2,]   1.6977468 1.0134237 0.4596458 0.6832384
[3,]   0.7192806 0.6496045 1.0980168 0.6055721
[4,]   0.7877016 1.7160507 1.5645345 2.1669722
> 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,] 10.0477788 1.1333039 0.3001591 0.9534724
[2,]  1.3029761 1.0066895 0.6779719 0.8265824
[3,]  0.8481041 0.8059805 1.0478629 0.7781851
[4,]  0.8875256 1.3099812 1.2508135 1.4720639
> 
> 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,] 226.43565 37.61742 28.09169 35.44383
[2,]  39.72751 36.08032 32.23936 33.94906
[3,]  34.20032 33.70941 36.57665 33.38742
[4,]  34.66296 39.81586 39.07267 41.88761
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000011c0000>
> exp(tmp5)
<pointer: 0x6000011c0000>
> log(tmp5,2)
<pointer: 0x6000011c0000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.2961
> Min(tmp5)
[1] 54.20809
> mean(tmp5)
[1] 73.19068
> Sum(tmp5)
[1] 14638.14
> Var(tmp5)
[1] 876.0149
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.65376 69.60237 71.60517 72.49224 70.59563 68.17145 71.08255 73.83562
 [9] 74.71920 70.14878
> rowSums(tmp5)
 [1] 1793.075 1392.047 1432.103 1449.845 1411.913 1363.429 1421.651 1476.712
 [9] 1494.384 1402.976
> rowVars(tmp5)
 [1] 8174.27892   51.39181   63.77048   60.03013  141.16993   34.20816
 [7]   85.62899   89.04451   52.80683   69.83917
> rowSd(tmp5)
 [1] 90.411719  7.168808  7.985642  7.747912 11.881495  5.848774  9.253593
 [8]  9.436340  7.266831  8.356984
> rowMax(tmp5)
 [1] 471.29613  82.68760  85.11581  87.18358  93.95197  80.56191  97.57058
 [8]  89.98598  90.10024  90.91486
> rowMin(tmp5)
 [1] 54.20809 56.06956 55.44218 59.74766 54.95726 59.74499 56.50711 57.14161
 [9] 61.67974 55.72254
> 
> colMeans(tmp5)
 [1] 113.92438  73.31902  71.45273  76.14903  71.36569  71.44658  68.65295
 [8]  67.02441  70.04925  70.84614  69.28732  73.67539  74.06717  74.19344
[15]  72.20746  68.31159  66.22624  70.80276  69.00125  71.81076
> colSums(tmp5)
 [1] 1139.2438  733.1902  714.5273  761.4903  713.6569  714.4658  686.5295
 [8]  670.2441  700.4925  708.4614  692.8732  736.7539  740.6717  741.9344
[15]  722.0746  683.1159  662.2624  708.0276  690.0125  718.1076
> colVars(tmp5)
 [1] 15801.59536   114.76103   138.35208    46.18028    47.65026   115.32240
 [7]    42.27079    57.83182    41.51487   127.30045    60.19828   120.25919
[13]    72.68514    60.89496    87.73003    28.01661    73.97779    97.29193
[19]    86.64157    74.68334
> colSd(tmp5)
 [1] 125.704397  10.712658  11.762316   6.795607   6.902917  10.738827
 [7]   6.501599   7.604724   6.443204  11.282750   7.758755  10.966275
[13]   8.525558   7.803523   9.366431   5.293072   8.601034   9.863667
[19]   9.308146   8.641952
> colMax(tmp5)
 [1] 471.29613  90.91486  90.10024  87.18358  82.89313  92.27725  78.97651
 [8]  77.48095  77.05778  85.11581  82.09797  97.57058  93.95197  89.98598
[15]  85.18103  74.86559  79.58674  83.41484  84.92884  84.98487
> colMin(tmp5)
 [1] 65.91637 56.50711 57.09893 67.58848 58.58504 58.23324 56.13525 58.08617
 [9] 55.44218 54.20809 57.93562 59.74766 65.95368 63.11101 60.99079 57.15758
[17] 54.95726 57.29043 55.72254 59.20860
> 
> 
> ### 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] 89.65376 69.60237 71.60517 72.49224       NA 68.17145 71.08255 73.83562
 [9] 74.71920 70.14878
> rowSums(tmp5)
 [1] 1793.075 1392.047 1432.103 1449.845       NA 1363.429 1421.651 1476.712
 [9] 1494.384 1402.976
> rowVars(tmp5)
 [1] 8174.27892   51.39181   63.77048   60.03013  136.57213   34.20816
 [7]   85.62899   89.04451   52.80683   69.83917
> rowSd(tmp5)
 [1] 90.411719  7.168808  7.985642  7.747912 11.686408  5.848774  9.253593
 [8]  9.436340  7.266831  8.356984
> rowMax(tmp5)
 [1] 471.29613  82.68760  85.11581  87.18358        NA  80.56191  97.57058
 [8]  89.98598  90.10024  90.91486
> rowMin(tmp5)
 [1] 54.20809 56.06956 55.44218 59.74766       NA 59.74499 56.50711 57.14161
 [9] 61.67974 55.72254
> 
> colMeans(tmp5)
 [1] 113.92438  73.31902  71.45273  76.14903  71.36569  71.44658  68.65295
 [8]  67.02441  70.04925  70.84614  69.28732  73.67539  74.06717  74.19344
[15]        NA  68.31159  66.22624  70.80276  69.00125  71.81076
> colSums(tmp5)
 [1] 1139.2438  733.1902  714.5273  761.4903  713.6569  714.4658  686.5295
 [8]  670.2441  700.4925  708.4614  692.8732  736.7539  740.6717  741.9344
[15]        NA  683.1159  662.2624  708.0276  690.0125  718.1076
> colVars(tmp5)
 [1] 15801.59536   114.76103   138.35208    46.18028    47.65026   115.32240
 [7]    42.27079    57.83182    41.51487   127.30045    60.19828   120.25919
[13]    72.68514    60.89496          NA    28.01661    73.97779    97.29193
[19]    86.64157    74.68334
> colSd(tmp5)
 [1] 125.704397  10.712658  11.762316   6.795607   6.902917  10.738827
 [7]   6.501599   7.604724   6.443204  11.282750   7.758755  10.966275
[13]   8.525558   7.803523         NA   5.293072   8.601034   9.863667
[19]   9.308146   8.641952
> colMax(tmp5)
 [1] 471.29613  90.91486  90.10024  87.18358  82.89313  92.27725  78.97651
 [8]  77.48095  77.05778  85.11581  82.09797  97.57058  93.95197  89.98598
[15]        NA  74.86559  79.58674  83.41484  84.92884  84.98487
> colMin(tmp5)
 [1] 65.91637 56.50711 57.09893 67.58848 58.58504 58.23324 56.13525 58.08617
 [9] 55.44218 54.20809 57.93562 59.74766 65.95368 63.11101       NA 57.15758
[17] 54.95726 57.29043 55.72254 59.20860
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.2961
> Min(tmp5,na.rm=TRUE)
[1] 54.20809
> mean(tmp5,na.rm=TRUE)
[1] 73.13042
> Sum(tmp5,na.rm=TRUE)
[1] 14552.95
> Var(tmp5,na.rm=TRUE)
[1] 879.7094
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.65376 69.60237 71.60517 72.49224 69.82798 68.17145 71.08255 73.83562
 [9] 74.71920 70.14878
> rowSums(tmp5,na.rm=TRUE)
 [1] 1793.075 1392.047 1432.103 1449.845 1326.732 1363.429 1421.651 1476.712
 [9] 1494.384 1402.976
> rowVars(tmp5,na.rm=TRUE)
 [1] 8174.27892   51.39181   63.77048   60.03013  136.57213   34.20816
 [7]   85.62899   89.04451   52.80683   69.83917
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.411719  7.168808  7.985642  7.747912 11.686408  5.848774  9.253593
 [8]  9.436340  7.266831  8.356984
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.29613  82.68760  85.11581  87.18358  93.95197  80.56191  97.57058
 [8]  89.98598  90.10024  90.91486
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.20809 56.06956 55.44218 59.74766 54.95726 59.74499 56.50711 57.14161
 [9] 61.67974 55.72254
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.92438  73.31902  71.45273  76.14903  71.36569  71.44658  68.65295
 [8]  67.02441  70.04925  70.84614  69.28732  73.67539  74.06717  74.19344
[15]  70.76595  68.31159  66.22624  70.80276  69.00125  71.81076
> colSums(tmp5,na.rm=TRUE)
 [1] 1139.2438  733.1902  714.5273  761.4903  713.6569  714.4658  686.5295
 [8]  670.2441  700.4925  708.4614  692.8732  736.7539  740.6717  741.9344
[15]  636.8935  683.1159  662.2624  708.0276  690.0125  718.1076
> colVars(tmp5,na.rm=TRUE)
 [1] 15801.59536   114.76103   138.35208    46.18028    47.65026   115.32240
 [7]    42.27079    57.83182    41.51487   127.30045    60.19828   120.25919
[13]    72.68514    60.89496    75.31940    28.01661    73.97779    97.29193
[19]    86.64157    74.68334
> colSd(tmp5,na.rm=TRUE)
 [1] 125.704397  10.712658  11.762316   6.795607   6.902917  10.738827
 [7]   6.501599   7.604724   6.443204  11.282750   7.758755  10.966275
[13]   8.525558   7.803523   8.678675   5.293072   8.601034   9.863667
[19]   9.308146   8.641952
> colMax(tmp5,na.rm=TRUE)
 [1] 471.29613  90.91486  90.10024  87.18358  82.89313  92.27725  78.97651
 [8]  77.48095  77.05778  85.11581  82.09797  97.57058  93.95197  89.98598
[15]  84.62495  74.86559  79.58674  83.41484  84.92884  84.98487
> colMin(tmp5,na.rm=TRUE)
 [1] 65.91637 56.50711 57.09893 67.58848 58.58504 58.23324 56.13525 58.08617
 [9] 55.44218 54.20809 57.93562 59.74766 65.95368 63.11101 60.99079 57.15758
[17] 54.95726 57.29043 55.72254 59.20860
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.65376 69.60237 71.60517 72.49224      NaN 68.17145 71.08255 73.83562
 [9] 74.71920 70.14878
> rowSums(tmp5,na.rm=TRUE)
 [1] 1793.075 1392.047 1432.103 1449.845    0.000 1363.429 1421.651 1476.712
 [9] 1494.384 1402.976
> rowVars(tmp5,na.rm=TRUE)
 [1] 8174.27892   51.39181   63.77048   60.03013         NA   34.20816
 [7]   85.62899   89.04451   52.80683   69.83917
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.411719  7.168808  7.985642  7.747912        NA  5.848774  9.253593
 [8]  9.436340  7.266831  8.356984
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.29613  82.68760  85.11581  87.18358        NA  80.56191  97.57058
 [8]  89.98598  90.10024  90.91486
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.20809 56.06956 55.44218 59.74766       NA 59.74499 56.50711 57.14161
 [9] 61.67974 55.72254
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 119.25860  74.70382  70.29287  75.22872  72.78576  69.74733  68.92586
 [8]  65.86257  70.06839  71.89948  67.86392  74.56281  71.85774  75.42482
[15]       NaN  69.55092  67.47835  72.02698  68.06441  73.21100
> colSums(tmp5,na.rm=TRUE)
 [1] 1073.3274  672.3344  632.6358  677.0585  655.0718  627.7260  620.3328
 [8]  592.7631  630.6155  647.0954  610.7753  671.0653  646.7197  678.8233
[15]    0.0000  625.9583  607.3051  648.2429  612.5797  658.8990
> colVars(tmp5,na.rm=TRUE)
 [1] 17456.68798   107.53245   140.51167    42.42436    30.91976    97.25379
 [7]    46.71670    49.87480    46.70011   130.73071    44.92964   126.43196
[13]    26.85336    51.44848          NA    14.23927    65.58753    92.59270
[19]    87.59800    61.96120
> colSd(tmp5,na.rm=TRUE)
 [1] 132.123760  10.369785  11.853762   6.513399   5.560554   9.861733
 [7]   6.834961   7.062209   6.833748  11.433753   6.702958  11.244197
[13]   5.182023   7.172760         NA   3.773495   8.098613   9.622510
[19]   9.359381   7.871544
> colMax(tmp5,na.rm=TRUE)
 [1] 471.29613  90.91486  90.10024  87.18358  82.89313  92.27725  78.97651
 [8]  77.36040  77.05778  85.11581  78.50810  97.57058  81.16587  89.98598
[15]      -Inf  74.86559  79.58674  83.41484  84.92884  84.98487
> colMin(tmp5,na.rm=TRUE)
 [1] 69.67365 56.50711 57.09893 67.58848 66.45843 58.23324 56.13525 58.08617
 [9] 55.44218 54.20809 57.93562 59.74766 65.95368 65.37059      Inf 63.81158
[17] 59.30055 57.29043 55.72254 59.74499
> 
> 
> 
> 
> 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] 254.4538 385.1740 170.0564 168.1752 262.3748 149.5780 387.1602 158.4448
 [9] 109.2809 244.6575
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 254.4538 385.1740 170.0564 168.1752 262.3748 149.5780 387.1602 158.4448
 [9] 109.2809 244.6575
> 
> 
> 
> 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]  4.263256e-14  1.136868e-13  5.684342e-14  0.000000e+00  0.000000e+00
 [6]  0.000000e+00  0.000000e+00 -5.684342e-14 -1.705303e-13 -5.684342e-14
[11]  1.136868e-13 -2.842171e-14  5.684342e-14  1.705303e-13  2.273737e-13
[16]  0.000000e+00  2.842171e-13  5.684342e-14  0.000000e+00 -2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
1   19 
10   14 
8   17 
8   4 
8   20 
1   11 
9   17 
7   9 
5   12 
4   8 
2   2 
5   4 
6   7 
8   14 
3   17 
2   11 
5   16 
10   20 
7   8 
7   9 
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.192359
> Min(tmp)
[1] -2.091027
> mean(tmp)
[1] -0.03759271
> Sum(tmp)
[1] -3.759271
> Var(tmp)
[1] 0.8916395
> 
> rowMeans(tmp)
[1] -0.03759271
> rowSums(tmp)
[1] -3.759271
> rowVars(tmp)
[1] 0.8916395
> rowSd(tmp)
[1] 0.9442666
> rowMax(tmp)
[1] 2.192359
> rowMin(tmp)
[1] -2.091027
> 
> colMeans(tmp)
  [1] -0.412440004 -0.246282262 -0.680963307  1.176745776 -0.775457513
  [6] -1.049595857  0.750360140 -0.973207910 -0.087846573  0.988829160
 [11] -0.166588072  0.667114146  0.995690213  0.004791148 -0.634900673
 [16]  1.328905605  1.305764620 -0.467727825 -0.305707863 -1.434934767
 [21]  1.215105990 -0.673478167 -0.031590157  0.951860211  0.410747581
 [26]  0.989296609  1.030140210  0.367441738 -1.619055041 -0.605444129
 [31] -0.339518037 -0.487935437  0.691696222  1.058446734 -0.777706447
 [36]  0.488032846  1.315696264  0.163985572  0.288745522 -1.424835035
 [41] -0.140798521 -0.827973552 -0.397315622  0.187559307 -1.823297885
 [46]  1.718010906 -0.402643998 -1.688547579  0.016173691 -0.819519695
 [51] -0.180020397  1.009843484  2.192358904  0.050488493  1.155435474
 [56]  0.424424570 -0.014557221 -0.012893764  0.628845075 -1.234195578
 [61] -0.739853820 -0.661470234  1.010654187  1.557224550 -1.043326733
 [66]  1.161819806 -2.091026636  1.119644509 -0.678412095 -0.860765930
 [71]  0.454652836 -0.641276582  1.268722014  0.452445156 -1.702276142
 [76] -1.106935327  0.397345599 -0.344036382  0.366606285  0.476177827
 [81] -0.723492900 -0.579819313  1.691471314  0.191889731  1.290829832
 [86] -1.862261370 -0.523548769  0.069687564  1.378605409 -1.577913740
 [91] -1.492519714 -0.616078236  0.190561209 -0.034633757 -0.749649597
 [96] -0.354774502 -1.275607565  0.095376875 -0.127271177  0.018407730
> colSums(tmp)
  [1] -0.412440004 -0.246282262 -0.680963307  1.176745776 -0.775457513
  [6] -1.049595857  0.750360140 -0.973207910 -0.087846573  0.988829160
 [11] -0.166588072  0.667114146  0.995690213  0.004791148 -0.634900673
 [16]  1.328905605  1.305764620 -0.467727825 -0.305707863 -1.434934767
 [21]  1.215105990 -0.673478167 -0.031590157  0.951860211  0.410747581
 [26]  0.989296609  1.030140210  0.367441738 -1.619055041 -0.605444129
 [31] -0.339518037 -0.487935437  0.691696222  1.058446734 -0.777706447
 [36]  0.488032846  1.315696264  0.163985572  0.288745522 -1.424835035
 [41] -0.140798521 -0.827973552 -0.397315622  0.187559307 -1.823297885
 [46]  1.718010906 -0.402643998 -1.688547579  0.016173691 -0.819519695
 [51] -0.180020397  1.009843484  2.192358904  0.050488493  1.155435474
 [56]  0.424424570 -0.014557221 -0.012893764  0.628845075 -1.234195578
 [61] -0.739853820 -0.661470234  1.010654187  1.557224550 -1.043326733
 [66]  1.161819806 -2.091026636  1.119644509 -0.678412095 -0.860765930
 [71]  0.454652836 -0.641276582  1.268722014  0.452445156 -1.702276142
 [76] -1.106935327  0.397345599 -0.344036382  0.366606285  0.476177827
 [81] -0.723492900 -0.579819313  1.691471314  0.191889731  1.290829832
 [86] -1.862261370 -0.523548769  0.069687564  1.378605409 -1.577913740
 [91] -1.492519714 -0.616078236  0.190561209 -0.034633757 -0.749649597
 [96] -0.354774502 -1.275607565  0.095376875 -0.127271177  0.018407730
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.412440004 -0.246282262 -0.680963307  1.176745776 -0.775457513
  [6] -1.049595857  0.750360140 -0.973207910 -0.087846573  0.988829160
 [11] -0.166588072  0.667114146  0.995690213  0.004791148 -0.634900673
 [16]  1.328905605  1.305764620 -0.467727825 -0.305707863 -1.434934767
 [21]  1.215105990 -0.673478167 -0.031590157  0.951860211  0.410747581
 [26]  0.989296609  1.030140210  0.367441738 -1.619055041 -0.605444129
 [31] -0.339518037 -0.487935437  0.691696222  1.058446734 -0.777706447
 [36]  0.488032846  1.315696264  0.163985572  0.288745522 -1.424835035
 [41] -0.140798521 -0.827973552 -0.397315622  0.187559307 -1.823297885
 [46]  1.718010906 -0.402643998 -1.688547579  0.016173691 -0.819519695
 [51] -0.180020397  1.009843484  2.192358904  0.050488493  1.155435474
 [56]  0.424424570 -0.014557221 -0.012893764  0.628845075 -1.234195578
 [61] -0.739853820 -0.661470234  1.010654187  1.557224550 -1.043326733
 [66]  1.161819806 -2.091026636  1.119644509 -0.678412095 -0.860765930
 [71]  0.454652836 -0.641276582  1.268722014  0.452445156 -1.702276142
 [76] -1.106935327  0.397345599 -0.344036382  0.366606285  0.476177827
 [81] -0.723492900 -0.579819313  1.691471314  0.191889731  1.290829832
 [86] -1.862261370 -0.523548769  0.069687564  1.378605409 -1.577913740
 [91] -1.492519714 -0.616078236  0.190561209 -0.034633757 -0.749649597
 [96] -0.354774502 -1.275607565  0.095376875 -0.127271177  0.018407730
> colMin(tmp)
  [1] -0.412440004 -0.246282262 -0.680963307  1.176745776 -0.775457513
  [6] -1.049595857  0.750360140 -0.973207910 -0.087846573  0.988829160
 [11] -0.166588072  0.667114146  0.995690213  0.004791148 -0.634900673
 [16]  1.328905605  1.305764620 -0.467727825 -0.305707863 -1.434934767
 [21]  1.215105990 -0.673478167 -0.031590157  0.951860211  0.410747581
 [26]  0.989296609  1.030140210  0.367441738 -1.619055041 -0.605444129
 [31] -0.339518037 -0.487935437  0.691696222  1.058446734 -0.777706447
 [36]  0.488032846  1.315696264  0.163985572  0.288745522 -1.424835035
 [41] -0.140798521 -0.827973552 -0.397315622  0.187559307 -1.823297885
 [46]  1.718010906 -0.402643998 -1.688547579  0.016173691 -0.819519695
 [51] -0.180020397  1.009843484  2.192358904  0.050488493  1.155435474
 [56]  0.424424570 -0.014557221 -0.012893764  0.628845075 -1.234195578
 [61] -0.739853820 -0.661470234  1.010654187  1.557224550 -1.043326733
 [66]  1.161819806 -2.091026636  1.119644509 -0.678412095 -0.860765930
 [71]  0.454652836 -0.641276582  1.268722014  0.452445156 -1.702276142
 [76] -1.106935327  0.397345599 -0.344036382  0.366606285  0.476177827
 [81] -0.723492900 -0.579819313  1.691471314  0.191889731  1.290829832
 [86] -1.862261370 -0.523548769  0.069687564  1.378605409 -1.577913740
 [91] -1.492519714 -0.616078236  0.190561209 -0.034633757 -0.749649597
 [96] -0.354774502 -1.275607565  0.095376875 -0.127271177  0.018407730
> colMedians(tmp)
  [1] -0.412440004 -0.246282262 -0.680963307  1.176745776 -0.775457513
  [6] -1.049595857  0.750360140 -0.973207910 -0.087846573  0.988829160
 [11] -0.166588072  0.667114146  0.995690213  0.004791148 -0.634900673
 [16]  1.328905605  1.305764620 -0.467727825 -0.305707863 -1.434934767
 [21]  1.215105990 -0.673478167 -0.031590157  0.951860211  0.410747581
 [26]  0.989296609  1.030140210  0.367441738 -1.619055041 -0.605444129
 [31] -0.339518037 -0.487935437  0.691696222  1.058446734 -0.777706447
 [36]  0.488032846  1.315696264  0.163985572  0.288745522 -1.424835035
 [41] -0.140798521 -0.827973552 -0.397315622  0.187559307 -1.823297885
 [46]  1.718010906 -0.402643998 -1.688547579  0.016173691 -0.819519695
 [51] -0.180020397  1.009843484  2.192358904  0.050488493  1.155435474
 [56]  0.424424570 -0.014557221 -0.012893764  0.628845075 -1.234195578
 [61] -0.739853820 -0.661470234  1.010654187  1.557224550 -1.043326733
 [66]  1.161819806 -2.091026636  1.119644509 -0.678412095 -0.860765930
 [71]  0.454652836 -0.641276582  1.268722014  0.452445156 -1.702276142
 [76] -1.106935327  0.397345599 -0.344036382  0.366606285  0.476177827
 [81] -0.723492900 -0.579819313  1.691471314  0.191889731  1.290829832
 [86] -1.862261370 -0.523548769  0.069687564  1.378605409 -1.577913740
 [91] -1.492519714 -0.616078236  0.190561209 -0.034633757 -0.749649597
 [96] -0.354774502 -1.275607565  0.095376875 -0.127271177  0.018407730
> colRanges(tmp)
         [,1]       [,2]       [,3]     [,4]       [,5]      [,6]      [,7]
[1,] -0.41244 -0.2462823 -0.6809633 1.176746 -0.7754575 -1.049596 0.7503601
[2,] -0.41244 -0.2462823 -0.6809633 1.176746 -0.7754575 -1.049596 0.7503601
           [,8]        [,9]     [,10]      [,11]     [,12]     [,13]
[1,] -0.9732079 -0.08784657 0.9888292 -0.1665881 0.6671141 0.9956902
[2,] -0.9732079 -0.08784657 0.9888292 -0.1665881 0.6671141 0.9956902
           [,14]      [,15]    [,16]    [,17]      [,18]      [,19]     [,20]
[1,] 0.004791148 -0.6349007 1.328906 1.305765 -0.4677278 -0.3057079 -1.434935
[2,] 0.004791148 -0.6349007 1.328906 1.305765 -0.4677278 -0.3057079 -1.434935
        [,21]      [,22]       [,23]     [,24]     [,25]     [,26]   [,27]
[1,] 1.215106 -0.6734782 -0.03159016 0.9518602 0.4107476 0.9892966 1.03014
[2,] 1.215106 -0.6734782 -0.03159016 0.9518602 0.4107476 0.9892966 1.03014
         [,28]     [,29]      [,30]     [,31]      [,32]     [,33]    [,34]
[1,] 0.3674417 -1.619055 -0.6054441 -0.339518 -0.4879354 0.6916962 1.058447
[2,] 0.3674417 -1.619055 -0.6054441 -0.339518 -0.4879354 0.6916962 1.058447
          [,35]     [,36]    [,37]     [,38]     [,39]     [,40]      [,41]
[1,] -0.7777064 0.4880328 1.315696 0.1639856 0.2887455 -1.424835 -0.1407985
[2,] -0.7777064 0.4880328 1.315696 0.1639856 0.2887455 -1.424835 -0.1407985
          [,42]      [,43]     [,44]     [,45]    [,46]     [,47]     [,48]
[1,] -0.8279736 -0.3973156 0.1875593 -1.823298 1.718011 -0.402644 -1.688548
[2,] -0.8279736 -0.3973156 0.1875593 -1.823298 1.718011 -0.402644 -1.688548
          [,49]      [,50]      [,51]    [,52]    [,53]      [,54]    [,55]
[1,] 0.01617369 -0.8195197 -0.1800204 1.009843 2.192359 0.05048849 1.155435
[2,] 0.01617369 -0.8195197 -0.1800204 1.009843 2.192359 0.05048849 1.155435
         [,56]       [,57]       [,58]     [,59]     [,60]      [,61]
[1,] 0.4244246 -0.01455722 -0.01289376 0.6288451 -1.234196 -0.7398538
[2,] 0.4244246 -0.01455722 -0.01289376 0.6288451 -1.234196 -0.7398538
          [,62]    [,63]    [,64]     [,65]   [,66]     [,67]    [,68]
[1,] -0.6614702 1.010654 1.557225 -1.043327 1.16182 -2.091027 1.119645
[2,] -0.6614702 1.010654 1.557225 -1.043327 1.16182 -2.091027 1.119645
          [,69]      [,70]     [,71]      [,72]    [,73]     [,74]     [,75]
[1,] -0.6784121 -0.8607659 0.4546528 -0.6412766 1.268722 0.4524452 -1.702276
[2,] -0.6784121 -0.8607659 0.4546528 -0.6412766 1.268722 0.4524452 -1.702276
         [,76]     [,77]      [,78]     [,79]     [,80]      [,81]      [,82]
[1,] -1.106935 0.3973456 -0.3440364 0.3666063 0.4761778 -0.7234929 -0.5798193
[2,] -1.106935 0.3973456 -0.3440364 0.3666063 0.4761778 -0.7234929 -0.5798193
        [,83]     [,84]   [,85]     [,86]      [,87]      [,88]    [,89]
[1,] 1.691471 0.1918897 1.29083 -1.862261 -0.5235488 0.06968756 1.378605
[2,] 1.691471 0.1918897 1.29083 -1.862261 -0.5235488 0.06968756 1.378605
         [,90]    [,91]      [,92]     [,93]       [,94]      [,95]      [,96]
[1,] -1.577914 -1.49252 -0.6160782 0.1905612 -0.03463376 -0.7496496 -0.3547745
[2,] -1.577914 -1.49252 -0.6160782 0.1905612 -0.03463376 -0.7496496 -0.3547745
         [,97]      [,98]      [,99]     [,100]
[1,] -1.275608 0.09537687 -0.1272712 0.01840773
[2,] -1.275608 0.09537687 -0.1272712 0.01840773
> 
> 
> Max(tmp2)
[1] 2.351822
> Min(tmp2)
[1] -2.387472
> mean(tmp2)
[1] 0.0224396
> Sum(tmp2)
[1] 2.24396
> Var(tmp2)
[1] 0.8969815
> 
> rowMeans(tmp2)
  [1]  0.872098994 -0.821537060 -0.461319073 -0.439759105  0.686214177
  [6]  2.351822141  1.012581601 -0.877943216 -0.609052785  0.049438231
 [11]  0.133123666  1.914475935  0.020550039 -0.383139834 -0.602095162
 [16]  1.681819790 -0.744693641 -0.454320657  0.947941429  1.192741957
 [21] -0.562361964 -0.728637051  0.700478763 -0.499180688 -0.446730913
 [26] -0.218057174  1.832041395  0.450448500 -0.350465414  0.997409509
 [31] -0.012120179  0.838798587 -1.228987886  0.326200374  0.030540189
 [36] -0.647842545  0.846898584  0.426154941 -1.588718033 -0.118078913
 [41] -0.003235685  0.725457597  0.099546574 -1.731735418  0.462450274
 [46] -1.388989978  0.534025455 -0.810344421  1.611995416 -0.012645703
 [51] -0.405789186 -1.953053630  0.910512850 -0.147409592  1.359325571
 [56]  0.349631755 -0.177165055  0.266623769  1.200729350  0.146348198
 [61]  1.255829527 -0.074748003  0.250859615  0.831363140  0.314287335
 [66]  0.524024806 -2.128130756  0.193199954 -1.160839585  0.989656917
 [71] -0.686350448  0.888118410 -0.383542369 -2.387471906  1.147657875
 [76] -0.836119927  1.579667271  0.742660340  1.345130895 -0.053884822
 [81] -1.540738762 -0.816143043 -1.888123006  1.693726563 -1.051738334
 [86]  0.001166260  0.217041849 -0.225535062  0.035565134 -0.389339828
 [91] -0.131705843 -0.026775165  0.357648355 -0.114677902  0.971889293
 [96] -0.638665878 -0.697882674 -0.547663928 -0.957215311 -0.911256952
> rowSums(tmp2)
  [1]  0.872098994 -0.821537060 -0.461319073 -0.439759105  0.686214177
  [6]  2.351822141  1.012581601 -0.877943216 -0.609052785  0.049438231
 [11]  0.133123666  1.914475935  0.020550039 -0.383139834 -0.602095162
 [16]  1.681819790 -0.744693641 -0.454320657  0.947941429  1.192741957
 [21] -0.562361964 -0.728637051  0.700478763 -0.499180688 -0.446730913
 [26] -0.218057174  1.832041395  0.450448500 -0.350465414  0.997409509
 [31] -0.012120179  0.838798587 -1.228987886  0.326200374  0.030540189
 [36] -0.647842545  0.846898584  0.426154941 -1.588718033 -0.118078913
 [41] -0.003235685  0.725457597  0.099546574 -1.731735418  0.462450274
 [46] -1.388989978  0.534025455 -0.810344421  1.611995416 -0.012645703
 [51] -0.405789186 -1.953053630  0.910512850 -0.147409592  1.359325571
 [56]  0.349631755 -0.177165055  0.266623769  1.200729350  0.146348198
 [61]  1.255829527 -0.074748003  0.250859615  0.831363140  0.314287335
 [66]  0.524024806 -2.128130756  0.193199954 -1.160839585  0.989656917
 [71] -0.686350448  0.888118410 -0.383542369 -2.387471906  1.147657875
 [76] -0.836119927  1.579667271  0.742660340  1.345130895 -0.053884822
 [81] -1.540738762 -0.816143043 -1.888123006  1.693726563 -1.051738334
 [86]  0.001166260  0.217041849 -0.225535062  0.035565134 -0.389339828
 [91] -0.131705843 -0.026775165  0.357648355 -0.114677902  0.971889293
 [96] -0.638665878 -0.697882674 -0.547663928 -0.957215311 -0.911256952
> 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.872098994 -0.821537060 -0.461319073 -0.439759105  0.686214177
  [6]  2.351822141  1.012581601 -0.877943216 -0.609052785  0.049438231
 [11]  0.133123666  1.914475935  0.020550039 -0.383139834 -0.602095162
 [16]  1.681819790 -0.744693641 -0.454320657  0.947941429  1.192741957
 [21] -0.562361964 -0.728637051  0.700478763 -0.499180688 -0.446730913
 [26] -0.218057174  1.832041395  0.450448500 -0.350465414  0.997409509
 [31] -0.012120179  0.838798587 -1.228987886  0.326200374  0.030540189
 [36] -0.647842545  0.846898584  0.426154941 -1.588718033 -0.118078913
 [41] -0.003235685  0.725457597  0.099546574 -1.731735418  0.462450274
 [46] -1.388989978  0.534025455 -0.810344421  1.611995416 -0.012645703
 [51] -0.405789186 -1.953053630  0.910512850 -0.147409592  1.359325571
 [56]  0.349631755 -0.177165055  0.266623769  1.200729350  0.146348198
 [61]  1.255829527 -0.074748003  0.250859615  0.831363140  0.314287335
 [66]  0.524024806 -2.128130756  0.193199954 -1.160839585  0.989656917
 [71] -0.686350448  0.888118410 -0.383542369 -2.387471906  1.147657875
 [76] -0.836119927  1.579667271  0.742660340  1.345130895 -0.053884822
 [81] -1.540738762 -0.816143043 -1.888123006  1.693726563 -1.051738334
 [86]  0.001166260  0.217041849 -0.225535062  0.035565134 -0.389339828
 [91] -0.131705843 -0.026775165  0.357648355 -0.114677902  0.971889293
 [96] -0.638665878 -0.697882674 -0.547663928 -0.957215311 -0.911256952
> rowMin(tmp2)
  [1]  0.872098994 -0.821537060 -0.461319073 -0.439759105  0.686214177
  [6]  2.351822141  1.012581601 -0.877943216 -0.609052785  0.049438231
 [11]  0.133123666  1.914475935  0.020550039 -0.383139834 -0.602095162
 [16]  1.681819790 -0.744693641 -0.454320657  0.947941429  1.192741957
 [21] -0.562361964 -0.728637051  0.700478763 -0.499180688 -0.446730913
 [26] -0.218057174  1.832041395  0.450448500 -0.350465414  0.997409509
 [31] -0.012120179  0.838798587 -1.228987886  0.326200374  0.030540189
 [36] -0.647842545  0.846898584  0.426154941 -1.588718033 -0.118078913
 [41] -0.003235685  0.725457597  0.099546574 -1.731735418  0.462450274
 [46] -1.388989978  0.534025455 -0.810344421  1.611995416 -0.012645703
 [51] -0.405789186 -1.953053630  0.910512850 -0.147409592  1.359325571
 [56]  0.349631755 -0.177165055  0.266623769  1.200729350  0.146348198
 [61]  1.255829527 -0.074748003  0.250859615  0.831363140  0.314287335
 [66]  0.524024806 -2.128130756  0.193199954 -1.160839585  0.989656917
 [71] -0.686350448  0.888118410 -0.383542369 -2.387471906  1.147657875
 [76] -0.836119927  1.579667271  0.742660340  1.345130895 -0.053884822
 [81] -1.540738762 -0.816143043 -1.888123006  1.693726563 -1.051738334
 [86]  0.001166260  0.217041849 -0.225535062  0.035565134 -0.389339828
 [91] -0.131705843 -0.026775165  0.357648355 -0.114677902  0.971889293
 [96] -0.638665878 -0.697882674 -0.547663928 -0.957215311 -0.911256952
> 
> colMeans(tmp2)
[1] 0.0224396
> colSums(tmp2)
[1] 2.24396
> colVars(tmp2)
[1] 0.8969815
> colSd(tmp2)
[1] 0.9470911
> colMax(tmp2)
[1] 2.351822
> colMin(tmp2)
[1] -2.387472
> colMedians(tmp2)
[1] -0.007677932
> colRanges(tmp2)
          [,1]
[1,] -2.387472
[2,]  2.351822
> 
> 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.6003090  2.5309132 -5.3682921 -1.4150207  4.1094588  0.9102203
 [7] -2.3734795  4.8594262 -2.0581577 -1.0217426
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1464809
[2,] -0.7695897
[3,] -0.2791085
[4,]  0.1854990
[5,]  0.7618937
> 
> rowApply(tmp,sum)
 [1] -1.1676949  0.2606878 -4.3069375  3.3624182 -0.8663087 -3.3092213
 [7]  2.0539623  0.4859533 -0.9161196  1.9762772
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    5   10    5    3    1    5    6    2     6
 [2,]    8    9    8    4    7    7    1   10    9     4
 [3,]    5    1    4   10    1    4    9    4    4     2
 [4,]    6   10    1    1    5    8    4    9    3     3
 [5,]    9    3    9    9    8    5    2    5    8     9
 [6,]    3    6    2    7    9    6   10    2    5    10
 [7,]    1    2    5    2    4    9    6    8   10     5
 [8,]   10    8    7    3    6   10    3    7    7     7
 [9,]    7    4    6    6    2    2    8    3    1     8
[10,]    2    7    3    8   10    3    7    1    6     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.63686144 -1.22703807 -0.92749515  1.00832254 -1.91934498  1.11166999
 [7] -0.07551814  2.76129491  1.13526505 -0.28518916  5.65974902  3.38914204
[13]  2.00119796 -2.90430564 -1.37857134  2.33446139 -1.42610850  0.43503769
[19] -1.18222347  1.15561341
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5058304
[2,] -0.5537243
[3,] -0.2985445
[4,] -0.1956548
[5,]  0.9168926
> 
> rowApply(tmp,sum)
[1]  2.062383  2.085829 -5.036359  2.078520  6.838726
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4    8   18    3    6
[2,]   18    7    4    4    9
[3,]    1    9    8   11   15
[4,]   16   17    2    6   16
[5,]   12    3   13    2   12
> 
> 
> as.matrix(tmp)
           [,1]         [,2]       [,3]       [,4]        [,5]       [,6]
[1,] -0.5537243  1.176746719 -1.3664512  0.8682327  0.03528044 -0.1405869
[2,] -0.2985445 -0.473014617 -0.2978228  1.3834633 -1.11309895  1.4012303
[3,]  0.9168926 -1.192094555 -0.5802110 -2.1439357 -0.01946305 -0.2352079
[4,] -1.5058304 -0.747170731  0.2616495 -0.1679731 -1.51579081 -0.5827625
[5,] -0.1956548  0.008495116  1.0553403  1.0685354  0.69372738  0.6689969
            [,7]       [,8]       [,9]      [,10]      [,11]     [,12]
[1,] -0.24795565  1.0270920  0.5026929  1.4951368  1.4801562 0.1445225
[2,] -1.51821307 -0.1885751 -0.8239058 -1.0359307  1.8964945 2.2107339
[3,]  1.31539146 -0.6454809 -0.3389760 -2.1629565  0.6656896 0.5953446
[4,]  0.46363576  0.8003755  0.6842774  0.4659939 -0.1317760 0.2553849
[5,] -0.08837665  1.7678833  1.1111765  0.9525674  1.7491846 0.1831562
          [,13]      [,14]      [,15]       [,16]      [,17]       [,18]
[1,] -0.1463332 -0.6414246 -0.5101419 -0.43107114  0.8375045 -0.36238015
[2,]  0.9712352  0.7493856 -1.7930742 -0.04087074 -0.6624755 -0.08484913
[3,] -0.1856424 -0.6142913  0.6623525  0.99241723 -1.6199781 -0.70105170
[4,]  2.6154975 -1.7741505  0.7290242  0.70107118  0.1374500  0.56624988
[5,] -1.2535592 -0.6238249 -0.4667319  1.11291485 -0.1186093  1.01706878
          [,19]       [,20]
[1,] -1.1151974  0.01028474
[2,]  0.8103079  0.99335334
[3,] -0.3006629  0.55550491
[4,] -0.1340229  0.95738671
[5,] -0.4426482 -1.36091629
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  649  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  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.4604991 -1.248786 -0.5178177 -1.276851 0.1780917 0.5129452 -1.620301
          col8       col9      col10     col11     col12       col13    col14
row1 0.4101992 -0.6073337 -0.3094485 0.3365768 0.3043903 -0.06248499 1.877395
          col15     col16      col17    col18    col19      col20
row1 -0.3664288 0.3302158 -0.6287118 1.515556 1.273757 -0.3666041
> tmp[,"col10"]
          col10
row1 -0.3094485
row2 -1.3976914
row3  0.5155544
row4  0.5288460
row5 -0.4191572
> tmp[c("row1","row5"),]
           col1       col2       col3      col4       col5      col6      col7
row1 -0.4604991 -1.2487862 -0.5178177 -1.276851  0.1780917 0.5129452 -1.620301
row5  1.8664188  0.9584107 -0.7718082  1.251206 -0.7794445 0.2367778 -2.233968
           col8       col9      col10     col11     col12       col13
row1  0.4101992 -0.6073337 -0.3094485 0.3365768 0.3043903 -0.06248499
row5 -1.0152785  0.7015303 -0.4191572 1.2685140 0.9454655 -1.09096607
          col14      col15     col16      col17     col18      col19
row1  1.8773949 -0.3664288 0.3302158 -0.6287118 1.5155565  1.2737570
row5 -0.8783661  0.9383748 0.2469391  0.1524019 0.8329353 -0.5198323
           col20
row1 -0.36660408
row5 -0.05753876
> tmp[,c("col6","col20")]
           col6       col20
row1  0.5129452 -0.36660408
row2  0.4271091  1.92645938
row3 -1.5941717  1.11737628
row4  0.7569471  2.02430926
row5  0.2367778 -0.05753876
> tmp[c("row1","row5"),c("col6","col20")]
          col6       col20
row1 0.5129452 -0.36660408
row5 0.2367778 -0.05753876
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.57173 51.50194 50.72979 49.13074 51.36844 105.0607 50.12713 49.76975
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.03205 49.98324 50.23229 48.74013 51.99815 50.40187 49.26081 50.38243
       col17    col18    col19    col20
row1 51.0409 49.51828 49.97054 105.7419
> tmp[,"col10"]
        col10
row1 49.98324
row2 28.09336
row3 30.95104
row4 30.85955
row5 49.84851
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.57173 51.50194 50.72979 49.13074 51.36844 105.0607 50.12713 49.76975
row5 50.38722 50.32144 49.17699 49.79747 48.68727 105.5376 51.08525 49.03228
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.03205 49.98324 50.23229 48.74013 51.99815 50.40187 49.26081 50.38243
row5 48.72302 49.84851 50.94891 50.60311 50.87458 50.25106 49.41731 50.86717
        col17    col18    col19    col20
row1 51.04090 49.51828 49.97054 105.7419
row5 50.81106 48.48186 48.63514 105.4614
> tmp[,c("col6","col20")]
          col6     col20
row1 105.06066 105.74185
row2  75.02409  75.94511
row3  75.84379  74.75370
row4  74.39067  76.22020
row5 105.53760 105.46136
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.0607 105.7419
row5 105.5376 105.4614
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.0607 105.7419
row5 105.5376 105.4614
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.2036100
[2,] -0.4831599
[3,] -0.8623952
[4,]  1.5451152
[5,]  1.2557244
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.5904688  0.8847998
[2,]  0.2013838  0.1110622
[3,] -0.7722339  2.3120806
[4,]  0.3973044  0.1518357
[5,]  0.6937618 -0.9366233
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.2808279  0.9682893
[2,] -1.1065338 -1.5249796
[3,]  0.9911783  0.5589894
[4,]  1.8363649  1.5810691
[5,]  1.4798939 -1.6218598
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.2808279
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.2808279
[2,] -1.1065338
> 
> 
> 
> 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.2537090 0.08618019 -0.3119902  0.4154712 0.08329386 -0.2671878
row1 0.6427571 0.16628341  0.7549231 -0.2424674 0.82514791 -1.3000766
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
row3 -0.8214937 -0.05079295  1.0270800 -0.8700395 -0.9923527  0.3153013
row1 -1.4684491  0.27800001 -0.6661987 -1.2428837  1.1482125 -1.2435246
          [,13]      [,14]     [,15]      [,16]     [,17]      [,18]     [,19]
row3 -0.8040854 -0.5096831 0.7413222 -0.8305697 0.7454832 -2.0596472 1.5345393
row1 -0.3059939 -0.9273286 0.8089935 -1.0766175 1.0218895  0.6779049 0.4407201
        [,20]
row3 1.858272
row1 1.433495
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]     [,3]      [,4]      [,5]     [,6]       [,7]
row2 -1.941775 -0.4367697 1.512234 0.7473534 -1.555866 0.423518 -0.8481515
          [,8]       [,9]      [,10]
row2 -1.032215 -0.6427955 0.04265501
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]     [,2]      [,3]     [,4]      [,5]     [,6]       [,7]
row5 0.06154212 1.167638 0.3484968 1.699715 -1.147287 1.106283 -0.4996393
          [,8]     [,9]     [,10]    [,11]     [,12]     [,13]     [,14]
row5 0.3978697 1.017604 0.6131531 1.440184 -2.779549 0.7069475 0.3865234
         [,15]      [,16]     [,17]     [,18]     [,19]     [,20]
row5 -1.270247 -0.6415321 -0.781403 0.7555753 0.9592276 -1.682933
> 
> 
> 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: 0x6000011f80c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde63aaca73"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde61d17723"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde7ee4cd00"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde5f4efc15"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde3a87f795"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde348f7538"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde3658ca7d"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde7f55f06a"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde631b0075"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde1bb3428" 
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde295d2efb"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde24b775f4"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde8a0f901" 
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde3bb514"  
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM7cde4fed342a"
> 
> 
> ### 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: 0x6000011e4420>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000011e4420>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000011e4420>
> rowMedians(tmp)
  [1] -0.2499183386 -0.1350138407  0.0507113795 -0.4042207923  0.0825521007
  [6]  0.0209204707  0.8219259430  0.0925691400  0.1114912151 -0.1430201295
 [11]  0.3485278965  0.0931202615 -0.3814940221  0.5079699900 -0.0946381085
 [16] -0.3148447270  0.2098982880 -0.2183760952  0.3006756251  0.1475081024
 [21]  0.3308979136 -0.4600746585 -0.3906742464 -0.0239675803  0.2643526211
 [26]  0.1317859945  0.2103119028 -0.0411079030 -0.1984102780  0.1078244869
 [31] -0.2518170240  0.0936231502 -0.3065461165  0.3568488062  0.3551010575
 [36]  0.1259486055 -0.2638605307  0.2659052468 -0.7653352550  0.1212468928
 [41]  0.3062285000 -0.1576047125  0.4485001601  0.0533077053  0.0528035169
 [46]  0.5296368198 -0.1837199169 -0.2838636544 -0.0323891318  0.0816172999
 [51] -0.0621805761  0.1549315420 -0.1038372609  0.3016874842 -0.1018866201
 [56]  0.0015605641 -0.0159776270  1.0302162455 -0.0698691849 -0.1904050251
 [61]  0.0299327933  0.2409278430 -0.0008711806  0.4072966478  0.1542470703
 [66] -0.3324201832 -0.1363061846  0.0435422858  0.3929697769 -0.3839811405
 [71]  0.0804957150 -0.5336478828 -0.2905942823 -0.1998382455 -0.3254733945
 [76] -0.2853771152  0.5471047993  0.1941088614  0.2083174890  0.0143912259
 [81]  0.3374907488 -0.5060073572  0.1253524498  0.1161133403  0.3039649328
 [86] -0.2071904297 -0.0491320288  0.3747432656 -0.2252432870 -0.1458947089
 [91] -0.0531516691  0.2180540623 -0.3392818926  0.2564584573 -0.4725295767
 [96] -0.6204021136 -0.2603391274 -0.3909504826  0.0427864671 -0.0794787072
[101]  0.3416213142  0.1811605552  0.0519574020 -0.1508185707 -0.1837281046
[106] -0.1692580719  0.5042811040  0.2551015174  0.2356451107 -0.4180647754
[111]  0.0016271917 -0.6538927727  0.1857610475  0.0474921998  0.0435423228
[116] -0.0786928546 -0.0312255393  0.4014592621 -0.4221400827 -0.1590640859
[121]  0.4933093011  0.0728071592  0.1132914868 -0.0845187500 -0.0652679681
[126]  0.2246293557  0.0029795418 -0.1782221948  0.1162730919 -0.5524860598
[131] -0.0045013753 -0.3909926222  0.2838350037  0.5143353821 -0.2200241723
[136]  0.1573800575  0.1342842134 -1.1599202727 -0.4605998544  0.1238194948
[141]  0.4085896873 -0.1734106408  0.3816088471 -0.0330642447 -0.2983883750
[146] -0.3515616261  0.4877559541 -0.2701180963  0.0829927199 -0.3651784252
[151]  0.6887514966  0.1496459758 -0.0853898432  0.2130415153 -0.2507632826
[156]  0.3871520232 -0.5208489904 -0.3265350874  0.4798179946  0.0599354110
[161] -0.3843594655 -0.3247564891 -0.1231283686  0.2121359405 -0.4653763805
[166]  0.4617376946 -0.0369738814 -0.1085703186  0.5464073317  0.4278007633
[171] -0.3370065758 -0.0455956203 -0.2662665511 -0.2069481205  0.0417471588
[176]  0.2040315838  0.2209874916 -0.0374015381  0.5705958286  0.4019347197
[181]  0.2481860587 -0.4217286174  0.4974814605  0.1586764512 -0.1577077474
[186]  0.3868050577  0.4159159289  0.1448308313 -0.0422889426 -0.0389469686
[191] -0.2145186228  0.3428332217  0.2713837843 -0.1400351209 -0.1720205279
[196] -0.1070786870  0.9175123441  0.0176225528  0.8424551875  0.0174685014
[201]  0.0922589073  0.0368502950 -0.4307243428 -0.0737388319  0.0800620698
[206]  0.0530919794 -0.0064854173 -0.0266877711 -0.3640493996 -0.4680784241
[211] -0.3465778294 -0.0260212557 -0.4903609069  0.5040160495  0.1473310586
[216]  0.2345855854  0.0460994860 -0.3743425915  0.0428504670 -0.4206558482
[221] -0.2696142176 -0.2421263591 -0.1753712821 -0.2241880561 -0.1906060562
[226]  0.0766232216 -0.0207066112  0.2306718717 -0.0107985859 -0.2235883630
> 
> proc.time()
   user  system elapsed 
  0.639   3.171   3.978 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout

R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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: 0x600003e98000>
> .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: 0x600003e98000>
> .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: 0x600003e98000>
> .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: 0x600003e98000>
> 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: 0x600003e953e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e953e0>
> .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: 0x600003e953e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e953e0>
> .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: 0x600003e953e0>
> 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: 0x600003e955c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e955c0>
> .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: 0x600003e955c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003e955c0>
> .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: 0x600003e955c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003e955c0>
> .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: 0x600003e955c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003e955c0>
> .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: 0x600003e955c0>
> 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: 0x600003e957a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003e957a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e957a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e957a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile7d283e680f23" "BufferedMatrixFile7d28e7f292c" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile7d283e680f23" "BufferedMatrixFile7d28e7f292c" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003e9c240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003e9c240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003e9c240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003e9c240>
> .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: 0x600003e9c420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003e9c420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003e9c420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003e9c420>
> 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: 0x600003e9c600>
> .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: 0x600003e9c600>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.113   0.043   0.153 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout

R Under development (unstable) (2025-03-02 r87868) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: 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.112   0.032   0.136 

Example timings