Back to Mac ARM64 build report for BioC 3.19
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2024-05-07 11:32:30 -0400 (Tue, 07 May 2024).

HostnameOSArch (*)R versionInstalled pkgs
kjohnson3macOS 13.6.5 Venturaarm644.4.0 (2024-04-24) -- "Puppy Cup" 4461
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/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-05-06 14:00:02 -0400 (Mon, 06 May 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
kjohnson3macOS 13.6.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published

CHECK results for BufferedMatrix on kjohnson3


To the developers/maintainers of the BufferedMatrix package:
- 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.68.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-05-06 20:05:54 -0400 (Mon, 06 May 2024)
EndedAt: 2024-05-06 20:06:09 -0400 (Mon, 06 May 2024)
EllapsedTime: 15.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.68.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck’
* using R version 4.4.0 (2024-04-24)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Ventura 13.6.5
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.68.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.19-bioc-mac-arm64/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 ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
  Running ‘Rcodetesting.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.19-bioc-mac-arm64/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.4-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** 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.4-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 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.113   0.033   0.142 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 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.19-bioc-mac-arm64/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 474154 25.4    1035437 55.3         NA   638577 34.2
Vcells 877598  6.7    8388608 64.0     196608  2072866 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon May  6 20:06:03 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon May  6 20:06:03 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600003af0660>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon May  6 20:06:04 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon May  6 20:06:04 2024"
> 
> ColMode(tmp2)
<pointer: 0x600003af0660>
> 
> 
> 
> ### 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,] 98.4229901 -0.7179900  0.4692752 -0.2789668
[2,]  0.5452138 -1.2953496  0.3572201  0.1475281
[3,]  0.6860532  0.4318072 -0.3908537  0.1211217
[4,] -0.4335475  1.6486702  0.5607235  1.5430302
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 98.4229901 0.7179900 0.4692752 0.2789668
[2,]  0.5452138 1.2953496 0.3572201 0.1475281
[3,]  0.6860532 0.4318072 0.3908537 0.1211217
[4,]  0.4335475 1.6486702 0.5607235 1.5430302
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9208362 0.8473429 0.6850367 0.5281730
[2,] 0.7383859 1.1381343 0.5976789 0.3840938
[3,] 0.8282833 0.6571204 0.6251830 0.3480255
[4,] 0.6584432 1.2840055 0.7488147 1.2421877
> 
> 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.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 222.63135 34.19142 32.31964 30.56070
[2,]  32.92907 37.67669 31.33401 28.98847
[3,]  33.96889 32.00301 31.64268 28.60138
[4,]  32.01798 39.48873 33.04887 38.96491
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003af8780>
> exp(tmp5)
<pointer: 0x600003af8780>
> log(tmp5,2)
<pointer: 0x600003af8780>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 463.378
> Min(tmp5)
[1] 53.1703
> mean(tmp5)
[1] 73.78958
> Sum(tmp5)
[1] 14757.92
> Var(tmp5)
[1] 835.683
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.11203 70.03213 71.09027 72.15939 70.43776 73.38730 68.85543 75.06141
 [9] 73.00625 74.75386
> rowSums(tmp5)
 [1] 1782.241 1400.643 1421.805 1443.188 1408.755 1467.746 1377.109 1501.228
 [9] 1460.125 1495.077
> rowVars(tmp5)
 [1] 7786.96330  100.37453   59.87681   49.26732   63.72913   96.62407
 [7]   92.36180   51.62527   88.24867   50.19532
> rowSd(tmp5)
 [1] 88.243772 10.018709  7.738011  7.019068  7.983053  9.829754  9.610505
 [8]  7.185072  9.394076  7.084866
> rowMax(tmp5)
 [1] 463.37799  93.72052  87.53247  82.19061  84.96564  91.02946  90.87415
 [8]  88.36661  92.46983  85.14006
> rowMin(tmp5)
 [1] 59.81193 59.05733 59.53002 53.17290 58.83691 53.17030 53.61625 58.34215
 [9] 55.38610 62.11249
> 
> colMeans(tmp5)
 [1] 110.19706  72.79534  71.12838  70.00693  73.04580  72.42638  69.32480
 [8]  72.77123  73.54907  69.49873  75.71313  74.56252  70.70508  65.32053
[15]  72.07752  76.81387  70.88168  74.02623  71.35664  69.59077
> colSums(tmp5)
 [1] 1101.9706  727.9534  711.2838  700.0693  730.4580  724.2638  693.2480
 [8]  727.7123  735.4907  694.9873  757.1313  745.6252  707.0508  653.2053
[15]  720.7752  768.1387  708.8168  740.2623  713.5664  695.9077
> colVars(tmp5)
 [1] 15478.52887    51.84622    30.65161    68.92900    93.55465    21.52806
 [7]    62.04032   139.07674    78.93475    37.67729   104.96156    81.50044
[13]    45.22967    83.51078   113.57650    28.25557    28.44979   143.95079
[19]    50.78902    46.65398
> colSd(tmp5)
 [1] 124.412736   7.200432   5.536389   8.302349   9.672365   4.639834
 [7]   7.876568  11.793080   8.884523   6.138183  10.245075   9.027759
[13]   6.725300   9.138423  10.657228   5.315597   5.333835  11.997949
[19]   7.126642   6.830372
> colMax(tmp5)
 [1] 463.37799  82.19061  80.90391  82.01655  88.07549  78.80439  78.37026
 [8]  92.46983  90.87415  79.57611  85.83123  93.72052  83.64824  82.13575
[15]  91.02946  87.53247  79.38058  85.51290  80.55211  76.76601
> colMin(tmp5)
 [1] 53.17030 59.75069 65.21763 59.53002 59.77273 65.41921 58.82169 58.50998
 [9] 62.13330 59.81193 57.51167 60.95602 62.91333 53.17290 58.83691 68.05680
[17] 62.11249 53.61625 59.05733 55.61830
> 
> 
> ### 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.11203 70.03213 71.09027       NA 70.43776 73.38730 68.85543 75.06141
 [9] 73.00625 74.75386
> rowSums(tmp5)
 [1] 1782.241 1400.643 1421.805       NA 1408.755 1467.746 1377.109 1501.228
 [9] 1460.125 1495.077
> rowVars(tmp5)
 [1] 7786.96330  100.37453   59.87681   51.99904   63.72913   96.62407
 [7]   92.36180   51.62527   88.24867   50.19532
> rowSd(tmp5)
 [1] 88.243772 10.018709  7.738011  7.211036  7.983053  9.829754  9.610505
 [8]  7.185072  9.394076  7.084866
> rowMax(tmp5)
 [1] 463.37799  93.72052  87.53247        NA  84.96564  91.02946  90.87415
 [8]  88.36661  92.46983  85.14006
> rowMin(tmp5)
 [1] 59.81193 59.05733 59.53002       NA 58.83691 53.17030 53.61625 58.34215
 [9] 55.38610 62.11249
> 
> colMeans(tmp5)
 [1] 110.19706  72.79534  71.12838  70.00693  73.04580  72.42638  69.32480
 [8]  72.77123  73.54907  69.49873  75.71313  74.56252  70.70508  65.32053
[15]  72.07752  76.81387  70.88168  74.02623  71.35664        NA
> colSums(tmp5)
 [1] 1101.9706  727.9534  711.2838  700.0693  730.4580  724.2638  693.2480
 [8]  727.7123  735.4907  694.9873  757.1313  745.6252  707.0508  653.2053
[15]  720.7752  768.1387  708.8168  740.2623  713.5664        NA
> colVars(tmp5)
 [1] 15478.52887    51.84622    30.65161    68.92900    93.55465    21.52806
 [7]    62.04032   139.07674    78.93475    37.67729   104.96156    81.50044
[13]    45.22967    83.51078   113.57650    28.25557    28.44979   143.95079
[19]    50.78902          NA
> colSd(tmp5)
 [1] 124.412736   7.200432   5.536389   8.302349   9.672365   4.639834
 [7]   7.876568  11.793080   8.884523   6.138183  10.245075   9.027759
[13]   6.725300   9.138423  10.657228   5.315597   5.333835  11.997949
[19]   7.126642         NA
> colMax(tmp5)
 [1] 463.37799  82.19061  80.90391  82.01655  88.07549  78.80439  78.37026
 [8]  92.46983  90.87415  79.57611  85.83123  93.72052  83.64824  82.13575
[15]  91.02946  87.53247  79.38058  85.51290  80.55211        NA
> colMin(tmp5)
 [1] 53.17030 59.75069 65.21763 59.53002 59.77273 65.41921 58.82169 58.50998
 [9] 62.13330 59.81193 57.51167 60.95602 62.91333 53.17290 58.83691 68.05680
[17] 62.11249 53.61625 59.05733       NA
> 
> Max(tmp5,na.rm=TRUE)
[1] 463.378
> Min(tmp5,na.rm=TRUE)
[1] 53.1703
> mean(tmp5,na.rm=TRUE)
[1] 73.7993
> Sum(tmp5,na.rm=TRUE)
[1] 14686.06
> Var(tmp5,na.rm=TRUE)
[1] 839.8847
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.11203 70.03213 71.09027 72.17531 70.43776 73.38730 68.85543 75.06141
 [9] 73.00625 74.75386
> rowSums(tmp5,na.rm=TRUE)
 [1] 1782.241 1400.643 1421.805 1371.331 1408.755 1467.746 1377.109 1501.228
 [9] 1460.125 1495.077
> rowVars(tmp5,na.rm=TRUE)
 [1] 7786.96330  100.37453   59.87681   51.99904   63.72913   96.62407
 [7]   92.36180   51.62527   88.24867   50.19532
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.243772 10.018709  7.738011  7.211036  7.983053  9.829754  9.610505
 [8]  7.185072  9.394076  7.084866
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.37799  93.72052  87.53247  82.19061  84.96564  91.02946  90.87415
 [8]  88.36661  92.46983  85.14006
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.81193 59.05733 59.53002 53.17290 58.83691 53.17030 53.61625 58.34215
 [9] 55.38610 62.11249
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.19706  72.79534  71.12838  70.00693  73.04580  72.42638  69.32480
 [8]  72.77123  73.54907  69.49873  75.71313  74.56252  70.70508  65.32053
[15]  72.07752  76.81387  70.88168  74.02623  71.35664  69.33896
> colSums(tmp5,na.rm=TRUE)
 [1] 1101.9706  727.9534  711.2838  700.0693  730.4580  724.2638  693.2480
 [8]  727.7123  735.4907  694.9873  757.1313  745.6252  707.0508  653.2053
[15]  720.7752  768.1387  708.8168  740.2623  713.5664  624.0507
> colVars(tmp5,na.rm=TRUE)
 [1] 15478.52887    51.84622    30.65161    68.92900    93.55465    21.52806
 [7]    62.04032   139.07674    78.93475    37.67729   104.96156    81.50044
[13]    45.22967    83.51078   113.57650    28.25557    28.44979   143.95079
[19]    50.78902    51.77243
> colSd(tmp5,na.rm=TRUE)
 [1] 124.412736   7.200432   5.536389   8.302349   9.672365   4.639834
 [7]   7.876568  11.793080   8.884523   6.138183  10.245075   9.027759
[13]   6.725300   9.138423  10.657228   5.315597   5.333835  11.997949
[19]   7.126642   7.195306
> colMax(tmp5,na.rm=TRUE)
 [1] 463.37799  82.19061  80.90391  82.01655  88.07549  78.80439  78.37026
 [8]  92.46983  90.87415  79.57611  85.83123  93.72052  83.64824  82.13575
[15]  91.02946  87.53247  79.38058  85.51290  80.55211  76.76601
> colMin(tmp5,na.rm=TRUE)
 [1] 53.17030 59.75069 65.21763 59.53002 59.77273 65.41921 58.82169 58.50998
 [9] 62.13330 59.81193 57.51167 60.95602 62.91333 53.17290 58.83691 68.05680
[17] 62.11249 53.61625 59.05733 55.61830
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.11203 70.03213 71.09027      NaN 70.43776 73.38730 68.85543 75.06141
 [9] 73.00625 74.75386
> rowSums(tmp5,na.rm=TRUE)
 [1] 1782.241 1400.643 1421.805    0.000 1408.755 1467.746 1377.109 1501.228
 [9] 1460.125 1495.077
> rowVars(tmp5,na.rm=TRUE)
 [1] 7786.96330  100.37453   59.87681         NA   63.72913   96.62407
 [7]   92.36180   51.62527   88.24867   50.19532
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.243772 10.018709  7.738011        NA  7.983053  9.829754  9.610505
 [8]  7.185072  9.394076  7.084866
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.37799  93.72052  87.53247        NA  84.96564  91.02946  90.87415
 [8]  88.36661  92.46983  85.14006
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.81193 59.05733 59.53002       NA 58.83691 53.17030 53.61625 58.34215
 [9] 55.38610 62.11249
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.03660  71.75142  71.38854  68.77433  73.75200  72.21830  68.56227
 [8]  73.73817  73.30782  69.62062  75.41229  75.65983  70.71288  66.67026
[15]  71.16503  77.02921  70.34703  73.65855  71.27021       NaN
> colSums(tmp5,na.rm=TRUE)
 [1] 1035.3294  645.7628  642.4969  618.9689  663.7680  649.9647  617.0604
 [8]  663.6435  659.7704  626.5856  678.7106  680.9385  636.4160  600.0324
[15]  640.4852  693.2629  633.1233  662.9269  641.4319    0.0000
> colVars(tmp5,na.rm=TRUE)
 [1] 17149.85738    46.06713    33.72160    60.45291    99.63845    23.73197
 [7]    63.25396   145.94288    88.14681    42.21981   117.06362    78.14203
[13]    50.88269    73.45450   118.40638    31.26584    28.79025   160.42376
[19]    57.05360          NA
> colSd(tmp5,na.rm=TRUE)
 [1] 130.957464   6.787277   5.807030   7.775147   9.981906   4.871547
 [7]   7.953236  12.080682   9.388653   6.497677  10.819594   8.839798
[13]   7.133210   8.570560  10.881469   5.591587   5.365654  12.665850
[19]   7.553384         NA
> colMax(tmp5,na.rm=TRUE)
 [1] 463.37799  80.18752  80.90391  82.01655  88.07549  78.80439  78.37026
 [8]  92.46983  90.87415  79.57611  85.83123  93.72052  83.64824  82.13575
[15]  91.02946  87.53247  79.38058  85.51290  80.55211      -Inf
> colMin(tmp5,na.rm=TRUE)
 [1] 53.17030 59.75069 65.21763 59.53002 59.77273 65.41921 58.82169 58.50998
 [9] 62.13330 59.81193 57.51167 60.95602 62.91333 55.38610 58.83691 68.05680
[17] 62.11249 53.61625 59.05733      Inf
> 
> 
> 
> 
> 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] 225.5461 405.8657 193.3752 180.2943 125.1649 166.4227 264.9393 248.7579
 [9] 177.1746 158.9296
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 225.5461 405.8657 193.3752 180.2943 125.1649 166.4227 264.9393 248.7579
 [9] 177.1746 158.9296
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -8.526513e-14  5.684342e-14  0.000000e+00 -8.526513e-14  0.000000e+00
 [6]  2.842171e-13 -1.421085e-14  0.000000e+00 -5.684342e-14  0.000000e+00
[11]  2.842171e-14  2.273737e-13  1.136868e-13  1.705303e-13  7.105427e-14
[16]  4.263256e-14 -8.526513e-14  7.105427e-14  2.842171e-14 -8.526513e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   15 
2   10 
9   8 
8   1 
10   13 
3   3 
5   7 
7   16 
3   3 
3   16 
5   2 
7   2 
3   9 
5   8 
2   2 
9   12 
1   13 
2   1 
1   18 
9   7 
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.206403
> Min(tmp)
[1] -2.451894
> mean(tmp)
[1] 0.01485967
> Sum(tmp)
[1] 1.485967
> Var(tmp)
[1] 0.9881573
> 
> rowMeans(tmp)
[1] 0.01485967
> rowSums(tmp)
[1] 1.485967
> rowVars(tmp)
[1] 0.9881573
> rowSd(tmp)
[1] 0.994061
> rowMax(tmp)
[1] 2.206403
> rowMin(tmp)
[1] -2.451894
> 
> colMeans(tmp)
  [1] -1.169919549 -0.341340074 -0.492366920  1.022009275 -0.082380027
  [6] -0.382840654  1.477847687 -0.318370071  1.014361168  0.045077646
 [11]  1.165386867  1.406000266  0.276345268 -1.647247844 -0.215557239
 [16]  0.005001830 -0.087594856 -0.064904272 -0.847981775  0.446806740
 [21] -0.481982504 -0.048123889  0.621890367  1.359837818 -1.379645554
 [26]  2.206403396  0.481740067  1.300702070 -0.191027725 -0.615345698
 [31]  1.253859693 -0.264731381  0.349581410 -2.451894493 -0.115617572
 [36]  0.570107995  1.406379044  0.757389600  2.126709826 -0.206405073
 [41] -1.455348899 -1.439538588 -0.913928067  0.266968902 -1.548508700
 [46]  1.172678799  1.308559147 -1.986344252 -0.832380281 -1.260202379
 [51] -0.344877161  1.695641758  0.126235523  1.569986219 -1.211309128
 [56] -0.197309332  0.772516644 -1.160297142  2.065460759 -1.456536681
 [61] -0.888322588  1.125707674 -1.427048985  0.403438714 -1.373109421
 [66]  0.415443947 -1.113659028 -1.197943142 -0.118976181  0.543606348
 [71] -0.548607323 -0.225308206  0.305553130 -0.256367103  0.182897298
 [76] -0.649619861  0.368932291  0.208916400 -0.201725263 -0.006629843
 [81]  0.354122787 -0.997077504  1.003453955  0.599691973 -0.081075255
 [86]  0.817218875  0.229528436  0.382308638  0.199607591 -0.721777808
 [91]  0.186545452  1.157918305  0.400522575 -0.402557219 -0.669730066
 [96]  0.755119385  1.858928895  0.180381081 -0.151572064 -2.222397890
> colSums(tmp)
  [1] -1.169919549 -0.341340074 -0.492366920  1.022009275 -0.082380027
  [6] -0.382840654  1.477847687 -0.318370071  1.014361168  0.045077646
 [11]  1.165386867  1.406000266  0.276345268 -1.647247844 -0.215557239
 [16]  0.005001830 -0.087594856 -0.064904272 -0.847981775  0.446806740
 [21] -0.481982504 -0.048123889  0.621890367  1.359837818 -1.379645554
 [26]  2.206403396  0.481740067  1.300702070 -0.191027725 -0.615345698
 [31]  1.253859693 -0.264731381  0.349581410 -2.451894493 -0.115617572
 [36]  0.570107995  1.406379044  0.757389600  2.126709826 -0.206405073
 [41] -1.455348899 -1.439538588 -0.913928067  0.266968902 -1.548508700
 [46]  1.172678799  1.308559147 -1.986344252 -0.832380281 -1.260202379
 [51] -0.344877161  1.695641758  0.126235523  1.569986219 -1.211309128
 [56] -0.197309332  0.772516644 -1.160297142  2.065460759 -1.456536681
 [61] -0.888322588  1.125707674 -1.427048985  0.403438714 -1.373109421
 [66]  0.415443947 -1.113659028 -1.197943142 -0.118976181  0.543606348
 [71] -0.548607323 -0.225308206  0.305553130 -0.256367103  0.182897298
 [76] -0.649619861  0.368932291  0.208916400 -0.201725263 -0.006629843
 [81]  0.354122787 -0.997077504  1.003453955  0.599691973 -0.081075255
 [86]  0.817218875  0.229528436  0.382308638  0.199607591 -0.721777808
 [91]  0.186545452  1.157918305  0.400522575 -0.402557219 -0.669730066
 [96]  0.755119385  1.858928895  0.180381081 -0.151572064 -2.222397890
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.169919549 -0.341340074 -0.492366920  1.022009275 -0.082380027
  [6] -0.382840654  1.477847687 -0.318370071  1.014361168  0.045077646
 [11]  1.165386867  1.406000266  0.276345268 -1.647247844 -0.215557239
 [16]  0.005001830 -0.087594856 -0.064904272 -0.847981775  0.446806740
 [21] -0.481982504 -0.048123889  0.621890367  1.359837818 -1.379645554
 [26]  2.206403396  0.481740067  1.300702070 -0.191027725 -0.615345698
 [31]  1.253859693 -0.264731381  0.349581410 -2.451894493 -0.115617572
 [36]  0.570107995  1.406379044  0.757389600  2.126709826 -0.206405073
 [41] -1.455348899 -1.439538588 -0.913928067  0.266968902 -1.548508700
 [46]  1.172678799  1.308559147 -1.986344252 -0.832380281 -1.260202379
 [51] -0.344877161  1.695641758  0.126235523  1.569986219 -1.211309128
 [56] -0.197309332  0.772516644 -1.160297142  2.065460759 -1.456536681
 [61] -0.888322588  1.125707674 -1.427048985  0.403438714 -1.373109421
 [66]  0.415443947 -1.113659028 -1.197943142 -0.118976181  0.543606348
 [71] -0.548607323 -0.225308206  0.305553130 -0.256367103  0.182897298
 [76] -0.649619861  0.368932291  0.208916400 -0.201725263 -0.006629843
 [81]  0.354122787 -0.997077504  1.003453955  0.599691973 -0.081075255
 [86]  0.817218875  0.229528436  0.382308638  0.199607591 -0.721777808
 [91]  0.186545452  1.157918305  0.400522575 -0.402557219 -0.669730066
 [96]  0.755119385  1.858928895  0.180381081 -0.151572064 -2.222397890
> colMin(tmp)
  [1] -1.169919549 -0.341340074 -0.492366920  1.022009275 -0.082380027
  [6] -0.382840654  1.477847687 -0.318370071  1.014361168  0.045077646
 [11]  1.165386867  1.406000266  0.276345268 -1.647247844 -0.215557239
 [16]  0.005001830 -0.087594856 -0.064904272 -0.847981775  0.446806740
 [21] -0.481982504 -0.048123889  0.621890367  1.359837818 -1.379645554
 [26]  2.206403396  0.481740067  1.300702070 -0.191027725 -0.615345698
 [31]  1.253859693 -0.264731381  0.349581410 -2.451894493 -0.115617572
 [36]  0.570107995  1.406379044  0.757389600  2.126709826 -0.206405073
 [41] -1.455348899 -1.439538588 -0.913928067  0.266968902 -1.548508700
 [46]  1.172678799  1.308559147 -1.986344252 -0.832380281 -1.260202379
 [51] -0.344877161  1.695641758  0.126235523  1.569986219 -1.211309128
 [56] -0.197309332  0.772516644 -1.160297142  2.065460759 -1.456536681
 [61] -0.888322588  1.125707674 -1.427048985  0.403438714 -1.373109421
 [66]  0.415443947 -1.113659028 -1.197943142 -0.118976181  0.543606348
 [71] -0.548607323 -0.225308206  0.305553130 -0.256367103  0.182897298
 [76] -0.649619861  0.368932291  0.208916400 -0.201725263 -0.006629843
 [81]  0.354122787 -0.997077504  1.003453955  0.599691973 -0.081075255
 [86]  0.817218875  0.229528436  0.382308638  0.199607591 -0.721777808
 [91]  0.186545452  1.157918305  0.400522575 -0.402557219 -0.669730066
 [96]  0.755119385  1.858928895  0.180381081 -0.151572064 -2.222397890
> colMedians(tmp)
  [1] -1.169919549 -0.341340074 -0.492366920  1.022009275 -0.082380027
  [6] -0.382840654  1.477847687 -0.318370071  1.014361168  0.045077646
 [11]  1.165386867  1.406000266  0.276345268 -1.647247844 -0.215557239
 [16]  0.005001830 -0.087594856 -0.064904272 -0.847981775  0.446806740
 [21] -0.481982504 -0.048123889  0.621890367  1.359837818 -1.379645554
 [26]  2.206403396  0.481740067  1.300702070 -0.191027725 -0.615345698
 [31]  1.253859693 -0.264731381  0.349581410 -2.451894493 -0.115617572
 [36]  0.570107995  1.406379044  0.757389600  2.126709826 -0.206405073
 [41] -1.455348899 -1.439538588 -0.913928067  0.266968902 -1.548508700
 [46]  1.172678799  1.308559147 -1.986344252 -0.832380281 -1.260202379
 [51] -0.344877161  1.695641758  0.126235523  1.569986219 -1.211309128
 [56] -0.197309332  0.772516644 -1.160297142  2.065460759 -1.456536681
 [61] -0.888322588  1.125707674 -1.427048985  0.403438714 -1.373109421
 [66]  0.415443947 -1.113659028 -1.197943142 -0.118976181  0.543606348
 [71] -0.548607323 -0.225308206  0.305553130 -0.256367103  0.182897298
 [76] -0.649619861  0.368932291  0.208916400 -0.201725263 -0.006629843
 [81]  0.354122787 -0.997077504  1.003453955  0.599691973 -0.081075255
 [86]  0.817218875  0.229528436  0.382308638  0.199607591 -0.721777808
 [91]  0.186545452  1.157918305  0.400522575 -0.402557219 -0.669730066
 [96]  0.755119385  1.858928895  0.180381081 -0.151572064 -2.222397890
> colRanges(tmp)
         [,1]       [,2]       [,3]     [,4]        [,5]       [,6]     [,7]
[1,] -1.16992 -0.3413401 -0.4923669 1.022009 -0.08238003 -0.3828407 1.477848
[2,] -1.16992 -0.3413401 -0.4923669 1.022009 -0.08238003 -0.3828407 1.477848
           [,8]     [,9]      [,10]    [,11] [,12]     [,13]     [,14]
[1,] -0.3183701 1.014361 0.04507765 1.165387 1.406 0.2763453 -1.647248
[2,] -0.3183701 1.014361 0.04507765 1.165387 1.406 0.2763453 -1.647248
          [,15]      [,16]       [,17]       [,18]      [,19]     [,20]
[1,] -0.2155572 0.00500183 -0.08759486 -0.06490427 -0.8479818 0.4468067
[2,] -0.2155572 0.00500183 -0.08759486 -0.06490427 -0.8479818 0.4468067
          [,21]       [,22]     [,23]    [,24]     [,25]    [,26]     [,27]
[1,] -0.4819825 -0.04812389 0.6218904 1.359838 -1.379646 2.206403 0.4817401
[2,] -0.4819825 -0.04812389 0.6218904 1.359838 -1.379646 2.206403 0.4817401
        [,28]      [,29]      [,30]   [,31]      [,32]     [,33]     [,34]
[1,] 1.300702 -0.1910277 -0.6153457 1.25386 -0.2647314 0.3495814 -2.451894
[2,] 1.300702 -0.1910277 -0.6153457 1.25386 -0.2647314 0.3495814 -2.451894
          [,35]    [,36]    [,37]     [,38]   [,39]      [,40]     [,41]
[1,] -0.1156176 0.570108 1.406379 0.7573896 2.12671 -0.2064051 -1.455349
[2,] -0.1156176 0.570108 1.406379 0.7573896 2.12671 -0.2064051 -1.455349
         [,42]      [,43]     [,44]     [,45]    [,46]    [,47]     [,48]
[1,] -1.439539 -0.9139281 0.2669689 -1.548509 1.172679 1.308559 -1.986344
[2,] -1.439539 -0.9139281 0.2669689 -1.548509 1.172679 1.308559 -1.986344
          [,49]     [,50]      [,51]    [,52]     [,53]    [,54]     [,55]
[1,] -0.8323803 -1.260202 -0.3448772 1.695642 0.1262355 1.569986 -1.211309
[2,] -0.8323803 -1.260202 -0.3448772 1.695642 0.1262355 1.569986 -1.211309
          [,56]     [,57]     [,58]    [,59]     [,60]      [,61]    [,62]
[1,] -0.1973093 0.7725166 -1.160297 2.065461 -1.456537 -0.8883226 1.125708
[2,] -0.1973093 0.7725166 -1.160297 2.065461 -1.456537 -0.8883226 1.125708
         [,63]     [,64]     [,65]     [,66]     [,67]     [,68]      [,69]
[1,] -1.427049 0.4034387 -1.373109 0.4154439 -1.113659 -1.197943 -0.1189762
[2,] -1.427049 0.4034387 -1.373109 0.4154439 -1.113659 -1.197943 -0.1189762
         [,70]      [,71]      [,72]     [,73]      [,74]     [,75]      [,76]
[1,] 0.5436063 -0.5486073 -0.2253082 0.3055531 -0.2563671 0.1828973 -0.6496199
[2,] 0.5436063 -0.5486073 -0.2253082 0.3055531 -0.2563671 0.1828973 -0.6496199
         [,77]     [,78]      [,79]        [,80]     [,81]      [,82]    [,83]
[1,] 0.3689323 0.2089164 -0.2017253 -0.006629843 0.3541228 -0.9970775 1.003454
[2,] 0.3689323 0.2089164 -0.2017253 -0.006629843 0.3541228 -0.9970775 1.003454
        [,84]       [,85]     [,86]     [,87]     [,88]     [,89]      [,90]
[1,] 0.599692 -0.08107525 0.8172189 0.2295284 0.3823086 0.1996076 -0.7217778
[2,] 0.599692 -0.08107525 0.8172189 0.2295284 0.3823086 0.1996076 -0.7217778
         [,91]    [,92]     [,93]      [,94]      [,95]     [,96]    [,97]
[1,] 0.1865455 1.157918 0.4005226 -0.4025572 -0.6697301 0.7551194 1.858929
[2,] 0.1865455 1.157918 0.4005226 -0.4025572 -0.6697301 0.7551194 1.858929
         [,98]      [,99]    [,100]
[1,] 0.1803811 -0.1515721 -2.222398
[2,] 0.1803811 -0.1515721 -2.222398
> 
> 
> Max(tmp2)
[1] 2.385948
> Min(tmp2)
[1] -2.112772
> mean(tmp2)
[1] -0.1655998
> Sum(tmp2)
[1] -16.55998
> Var(tmp2)
[1] 0.9294322
> 
> rowMeans(tmp2)
  [1] -0.59794939  1.53955261  0.27800466 -0.28802585  2.34257821  0.62683097
  [7]  1.24771997 -1.64459283 -1.91040724  0.20748999  0.12598907 -1.93823628
 [13] -1.24491324  0.41647201 -1.08328746 -0.71548198 -0.88085899 -1.17059773
 [19] -0.82386528  0.93684416 -0.55182937 -0.07842751 -0.71243778 -0.23308123
 [25]  0.54845477 -1.86629183 -0.10820660  0.11072822 -0.01370104 -0.71677305
 [31] -0.94686909  1.47233944 -1.17236483 -1.18337715 -0.08820305  0.32140085
 [37]  1.14979992 -1.05646740 -0.07917257  0.40872605 -0.44892378 -1.29156152
 [43]  1.76568393 -0.08045730  0.03163346 -0.99733702 -0.39193556 -0.19031628
 [49] -1.34009849 -1.11844156  0.93146764  1.00545135  0.16766027 -0.49582931
 [55] -0.05163235 -1.31626094 -0.79292033  0.89789285  1.42423660 -0.93004211
 [61] -0.38208852 -0.59745515  0.62485995 -0.06640194 -1.58943490 -0.28356544
 [67] -1.51244532  0.84343465  2.38594786  0.92294393 -1.97895302 -0.89978770
 [73]  0.37556310  0.78292800 -2.11277226  0.13051901 -0.71692093 -0.17798267
 [79] -1.03164732  0.36462023 -0.93972691  0.89499120 -0.44767413  0.04859949
 [85] -1.09178703  0.10706784 -1.04046733  0.54718338  0.07332495  0.03143998
 [91] -0.79706429  0.29420736  0.44915089  1.00027121 -0.23951566 -0.77804498
 [97]  0.61421690  1.38628273 -0.44054130  1.28096561
> rowSums(tmp2)
  [1] -0.59794939  1.53955261  0.27800466 -0.28802585  2.34257821  0.62683097
  [7]  1.24771997 -1.64459283 -1.91040724  0.20748999  0.12598907 -1.93823628
 [13] -1.24491324  0.41647201 -1.08328746 -0.71548198 -0.88085899 -1.17059773
 [19] -0.82386528  0.93684416 -0.55182937 -0.07842751 -0.71243778 -0.23308123
 [25]  0.54845477 -1.86629183 -0.10820660  0.11072822 -0.01370104 -0.71677305
 [31] -0.94686909  1.47233944 -1.17236483 -1.18337715 -0.08820305  0.32140085
 [37]  1.14979992 -1.05646740 -0.07917257  0.40872605 -0.44892378 -1.29156152
 [43]  1.76568393 -0.08045730  0.03163346 -0.99733702 -0.39193556 -0.19031628
 [49] -1.34009849 -1.11844156  0.93146764  1.00545135  0.16766027 -0.49582931
 [55] -0.05163235 -1.31626094 -0.79292033  0.89789285  1.42423660 -0.93004211
 [61] -0.38208852 -0.59745515  0.62485995 -0.06640194 -1.58943490 -0.28356544
 [67] -1.51244532  0.84343465  2.38594786  0.92294393 -1.97895302 -0.89978770
 [73]  0.37556310  0.78292800 -2.11277226  0.13051901 -0.71692093 -0.17798267
 [79] -1.03164732  0.36462023 -0.93972691  0.89499120 -0.44767413  0.04859949
 [85] -1.09178703  0.10706784 -1.04046733  0.54718338  0.07332495  0.03143998
 [91] -0.79706429  0.29420736  0.44915089  1.00027121 -0.23951566 -0.77804498
 [97]  0.61421690  1.38628273 -0.44054130  1.28096561
> 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.59794939  1.53955261  0.27800466 -0.28802585  2.34257821  0.62683097
  [7]  1.24771997 -1.64459283 -1.91040724  0.20748999  0.12598907 -1.93823628
 [13] -1.24491324  0.41647201 -1.08328746 -0.71548198 -0.88085899 -1.17059773
 [19] -0.82386528  0.93684416 -0.55182937 -0.07842751 -0.71243778 -0.23308123
 [25]  0.54845477 -1.86629183 -0.10820660  0.11072822 -0.01370104 -0.71677305
 [31] -0.94686909  1.47233944 -1.17236483 -1.18337715 -0.08820305  0.32140085
 [37]  1.14979992 -1.05646740 -0.07917257  0.40872605 -0.44892378 -1.29156152
 [43]  1.76568393 -0.08045730  0.03163346 -0.99733702 -0.39193556 -0.19031628
 [49] -1.34009849 -1.11844156  0.93146764  1.00545135  0.16766027 -0.49582931
 [55] -0.05163235 -1.31626094 -0.79292033  0.89789285  1.42423660 -0.93004211
 [61] -0.38208852 -0.59745515  0.62485995 -0.06640194 -1.58943490 -0.28356544
 [67] -1.51244532  0.84343465  2.38594786  0.92294393 -1.97895302 -0.89978770
 [73]  0.37556310  0.78292800 -2.11277226  0.13051901 -0.71692093 -0.17798267
 [79] -1.03164732  0.36462023 -0.93972691  0.89499120 -0.44767413  0.04859949
 [85] -1.09178703  0.10706784 -1.04046733  0.54718338  0.07332495  0.03143998
 [91] -0.79706429  0.29420736  0.44915089  1.00027121 -0.23951566 -0.77804498
 [97]  0.61421690  1.38628273 -0.44054130  1.28096561
> rowMin(tmp2)
  [1] -0.59794939  1.53955261  0.27800466 -0.28802585  2.34257821  0.62683097
  [7]  1.24771997 -1.64459283 -1.91040724  0.20748999  0.12598907 -1.93823628
 [13] -1.24491324  0.41647201 -1.08328746 -0.71548198 -0.88085899 -1.17059773
 [19] -0.82386528  0.93684416 -0.55182937 -0.07842751 -0.71243778 -0.23308123
 [25]  0.54845477 -1.86629183 -0.10820660  0.11072822 -0.01370104 -0.71677305
 [31] -0.94686909  1.47233944 -1.17236483 -1.18337715 -0.08820305  0.32140085
 [37]  1.14979992 -1.05646740 -0.07917257  0.40872605 -0.44892378 -1.29156152
 [43]  1.76568393 -0.08045730  0.03163346 -0.99733702 -0.39193556 -0.19031628
 [49] -1.34009849 -1.11844156  0.93146764  1.00545135  0.16766027 -0.49582931
 [55] -0.05163235 -1.31626094 -0.79292033  0.89789285  1.42423660 -0.93004211
 [61] -0.38208852 -0.59745515  0.62485995 -0.06640194 -1.58943490 -0.28356544
 [67] -1.51244532  0.84343465  2.38594786  0.92294393 -1.97895302 -0.89978770
 [73]  0.37556310  0.78292800 -2.11277226  0.13051901 -0.71692093 -0.17798267
 [79] -1.03164732  0.36462023 -0.93972691  0.89499120 -0.44767413  0.04859949
 [85] -1.09178703  0.10706784 -1.04046733  0.54718338  0.07332495  0.03143998
 [91] -0.79706429  0.29420736  0.44915089  1.00027121 -0.23951566 -0.77804498
 [97]  0.61421690  1.38628273 -0.44054130  1.28096561
> 
> colMeans(tmp2)
[1] -0.1655998
> colSums(tmp2)
[1] -16.55998
> colVars(tmp2)
[1] 0.9294322
> colSd(tmp2)
[1] 0.9640707
> colMax(tmp2)
[1] 2.385948
> colMin(tmp2)
[1] -2.112772
> colMedians(tmp2)
[1] -0.1430946
> colRanges(tmp2)
          [,1]
[1,] -2.112772
[2,]  2.385948
> 
> 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]  4.6582200 -3.0734560  0.8213564  1.0309270  5.9505403 -0.9618034
 [7]  0.6780877  2.6353436 -3.6087822  2.3620454
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.3770892
[2,] -0.2416668
[3,]  0.4389835
[4,]  1.5626658
[5,]  2.4405062
> 
> rowApply(tmp,sum)
 [1]  1.9169413 -1.9156911  4.3191585  5.0948223  1.1262070 -1.8638457
 [7]  2.4359750 -0.9354202  4.4888933 -4.1745618
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    4    9   10    6   10    9    2    7     8
 [2,]    8    6    4    1    3    4    6    6    6     5
 [3,]   10    9    8    3    7    3    3    5    2     3
 [4,]    2    7    1    8    1    9    7    7    8    10
 [5,]    7    3   10    2    5    5   10    8   10     6
 [6,]    5    5    2    6    2    8    1    9    5     4
 [7,]    6    8    3    4    4    7    5    4    3     9
 [8,]    9    2    7    9   10    2    8    3    4     7
 [9,]    3   10    5    5    8    1    2    1    1     1
[10,]    4    1    6    7    9    6    4   10    9     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.20717197 -1.30192758  1.08032075  3.18780313 -3.12184395  1.67064379
 [7] -0.54916666  1.04225624 -3.52404228 -1.48779868 -0.04328124 -0.95427222
[13] -3.80496584 -1.71778197  5.04377548 -2.81367604  3.63167025 -0.96046483
[19] -0.62236232 -2.03572497
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.01803677
[2,]  0.28955718
[3,]  0.48809724
[4,]  0.84334956
[5,]  1.60420476
> 
> rowApply(tmp,sum)
[1]  2.0557076  4.2556187 -0.1359141 -6.2569718 -3.9921074
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   17   19   15   14   13
[2,]    7   16    7    7    3
[3,]   16    3    2   20   15
[4,]   19    6   14   18   16
[5,]   14    4    4    4    9
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
[1,]  0.84334956 -0.1012484  0.6419776  1.2817558  0.4047143  1.27554311
[2,]  1.60420476  1.4385017 -0.8118483 -0.5546013 -0.6950151  1.48885042
[3,]  0.48809724 -0.5017333 -1.1733563  0.3920515 -0.7601767  0.08464321
[4,]  0.28955718 -1.0134826  1.8938010  1.4665463 -1.7044186  1.30236826
[5,] -0.01803677 -1.1239650  0.5297468  0.6020509 -0.3669478 -2.48076122
           [,7]       [,8]       [,9]      [,10]       [,11]       [,12]
[1,]  0.5824666  1.5506772  0.1706306 -0.6589263  0.14889808 -0.03565131
[2,]  0.7880884 -1.0029577 -0.9988331 -0.3063652 -0.14770131 -0.41537349
[3,]  1.0479237  0.3186264 -2.4715665  0.5044325  0.01235355 -0.47779707
[4,] -2.1687959 -0.4531702  0.3290240 -0.4118162 -1.78492100 -0.42671594
[5,] -0.7988494  0.6290805 -0.5532973 -0.6151235  1.72808944  0.40126559
          [,13]       [,14]       [,15]      [,16]        [,17]      [,18]
[1,] -1.2287952 -0.02538186 -0.02748165 -1.7076662  0.004402858 -0.3059508
[2,]  0.1999495 -0.61220665  2.04089501 -0.5035280  0.579243206  1.5979952
[3,] -1.0270037  1.08044893  1.66357449 -0.4072075  1.904107911 -0.5410546
[4,] -1.4494698 -2.93876117  0.58082465  0.2209833  1.509605939 -0.2514510
[5,] -0.2996465  0.77811878  0.78596298 -0.4162576 -0.365689669 -1.4600036
           [,19]      [,20]
[1,] -0.57097572 -0.1866306
[2,]  0.39030185  0.1760190
[3,]  0.36610346 -0.6383812
[4,] -0.02344321 -1.2232370
[5,] -0.78434870 -0.1634952
> 
> 
> 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.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  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.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  710  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  612  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  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.4370343 -1.898285 0.1826253 -1.386301 -1.247755 1.06206 1.053516
          col8       col9    col10      col11     col12     col13     col14
row1 -1.526789 0.01910348 2.873342 -0.6180586 0.6938238 -0.157587 -1.175463
        col15     col16     col17       col18     col19      col20
row1 1.104128 0.7799782 0.1622106 0.009006303 0.4425133 -0.8292366
> tmp[,"col10"]
          col10
row1  2.8733424
row2 -0.3970679
row3 -2.3776688
row4  0.1499388
row5  0.2898531
> tmp[c("row1","row5"),]
           col1      col2      col3       col4      col5    col6      col7
row1 -0.4370343 -1.898285 0.1826253 -1.3863010 -1.247755 1.06206  1.053516
row5  0.7852470  1.060454 0.2654473 -0.4486266 -1.563926 1.85349 -1.769620
           col8        col9     col10      col11     col12      col13
row1 -1.5267888  0.01910348 2.8733424 -0.6180586 0.6938238 -0.1575870
row5 -0.6813992 -0.19329616 0.2898531 -0.2224912 0.6904898 -0.3856849
          col14     col15      col16       col17        col18      col19
row1 -1.1754631 1.1041279  0.7799782  0.16221057  0.009006303  0.4425133
row5  0.0586333 0.3138147 -0.8662359 -0.03797018 -0.081854091 -0.9930434
          col20
row1 -0.8292366
row5 -0.4666902
> tmp[,c("col6","col20")]
          col6      col20
row1 1.0620597 -0.8292366
row2 0.1517996  2.1608600
row3 0.1286769 -0.7561271
row4 0.4737659 -1.0355725
row5 1.8534899 -0.4666902
> tmp[c("row1","row5"),c("col6","col20")]
        col6      col20
row1 1.06206 -0.8292366
row5 1.85349 -0.4666902
> 
> 
> 
> 
> 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.92574 51.54228 50.47893 50.44222 49.57576 107.626 50.55046 50.89434
         col9    col10    col11    col12    col13    col14    col15    col16
row1 52.78416 48.66321 49.21742 50.59519 50.78542 50.69081 49.09691 49.74975
        col17    col18    col19   col20
row1 50.97983 50.46156 49.47069 105.419
> tmp[,"col10"]
        col10
row1 48.66321
row2 29.96677
row3 30.93988
row4 30.60727
row5 51.82700
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.92574 51.54228 50.47893 50.44222 49.57576 107.6260 50.55046 50.89434
row5 50.05363 50.63734 47.53169 48.15534 50.62953 105.9003 49.69409 49.46175
         col9    col10    col11    col12    col13    col14    col15    col16
row1 52.78416 48.66321 49.21742 50.59519 50.78542 50.69081 49.09691 49.74975
row5 50.44408 51.82700 50.31481 50.33563 50.20971 50.84778 49.68222 50.59911
        col17    col18    col19    col20
row1 50.97983 50.46156 49.47069 105.4190
row5 49.80117 49.36975 49.37038 106.2423
> tmp[,c("col6","col20")]
          col6     col20
row1 107.62595 105.41896
row2  75.19137  75.10166
row3  75.62388  75.89875
row4  74.42448  76.50841
row5 105.90031 106.24234
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 107.6260 105.4190
row5 105.9003 106.2423
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 107.6260 105.4190
row5 105.9003 106.2423
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.5819391
[2,]  1.1824274
[3,] -1.1495611
[4,] -0.6229201
[5,] -0.4978991
> tmp[,c("col17","col7")]
           col17       col7
[1,]  0.74232819  0.2422719
[2,] -0.61974033  0.5633050
[3,]  1.58290117 -0.7960525
[4,] -0.02000313  0.9676056
[5,]  0.31144681 -0.3347164
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,]  1.45078544 -0.95514193
[2,] -0.32879470  0.39102423
[3,]  0.09815759 -0.07802455
[4,]  0.14109477  0.91171278
[5,]  0.58085323 -1.56256829
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.450785
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  1.4507854
[2,] -0.3287947
> 
> 
> 
> 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  1.8131682 0.04853101 -0.6503088  0.2788511  0.68724867 -0.1480857
row1 -0.9071228 0.23342508 -0.3083675 -0.5441631 -0.08843278 -1.5527019
          [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
row3 0.2362562  0.1690005 -2.5709156 -0.1068235 -0.8613681  1.2366956
row1 0.6804388 -0.8250977  0.3855747  0.1937885  1.4425332 -0.5979821
          [,13]     [,14]      [,15]      [,16]      [,17]       [,18]
row3  0.1337328 0.8494334 -1.0523348 -0.8062992  0.6006338  0.06405658
row1 -1.3669427 1.4110730  0.1280311  1.0983285 -0.9535008 -1.20290556
          [,19]      [,20]
row3 -2.8297559  0.5755643
row1 -0.2971016 -0.1866976
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]        [,2]      [,3]        [,4]     [,5]       [,6]      [,7]
row2 -0.8333021 -0.07015597 -1.797444 -0.03798448 2.047034 -0.6253627 -1.609031
          [,8]       [,9]     [,10]
row2 -0.647348 -0.5100416 0.8638067
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]      [,5]      [,6]       [,7]
row5 -1.830635 -2.145529 0.7282279 -0.1504023 0.8822051 0.8494639 -0.9740297
          [,8]      [,9]       [,10]      [,11]    [,12]    [,13]    [,14]
row5 0.7651173 0.2100739 -0.03974964 -0.4820016 1.536457 1.502017 -1.35937
        [,15]      [,16]     [,17]     [,18]      [,19]    [,20]
row5 2.071295 -0.3794626 0.6264607 0.7577379 -0.4618007 1.946601
> 
> 
> 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: 0x600003ada100>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e1141b3d9f"
 [2] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e186a9c09" 
 [3] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e1f2a1730" 
 [4] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e114585817"
 [5] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e133ff5870"
 [6] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e141073bbb"
 [7] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e141e29357"
 [8] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e1237568c" 
 [9] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e17f130276"
[10] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e13906d227"
[11] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e16ecf1bb0"
[12] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e15f22f8a5"
[13] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e170f2496e"
[14] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e132b30eb0"
[15] "/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM83e19895ed1" 
> 
> 
> ### 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: 0x600003ac8720>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003ac8720>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.19-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600003ac8720>
> rowMedians(tmp)
  [1] -0.411395433  0.072153975 -0.008155704  0.213410426  0.315482953
  [6] -0.401733117 -0.115167274 -0.158903677 -0.137660916 -0.184300443
 [11] -0.068286385  0.552280133 -0.013430630  0.011304412 -0.203666676
 [16] -0.201976888  0.462335329 -0.703638815 -0.524844475 -0.536807783
 [21] -0.276769270  0.515591691 -0.287636001 -0.276504406  0.043613736
 [26] -0.758093813 -0.125963178  0.120219873  0.356098520 -0.319064738
 [31]  0.221585049  0.363986039 -0.172085431  0.008823142  0.531209045
 [36]  0.295134259 -0.021385870  0.100462232  0.441365996 -0.114410854
 [41] -0.042603464 -0.005316359 -0.197776947 -0.310120435  0.265491821
 [46] -0.539740633 -0.017953384  0.035009416  0.167403770  0.079759484
 [51] -0.353371892  0.046756332  0.617938667 -0.045986769  0.239345384
 [56] -0.048103579  0.262282899  0.285598769 -0.558104648  0.110826785
 [61] -0.274706009  0.157490519 -0.205491375  0.216300097  0.349059524
 [66]  0.276692267  0.442943552  0.443126187  0.486252054  0.592425306
 [71]  0.456315111  0.484413081  0.018880851 -0.198311950  0.379592488
 [76] -0.410410479  0.374190120  0.041803969  0.480767486 -0.058004538
 [81]  0.052131588  0.310884453  0.115834534 -0.110582944  0.142047518
 [86] -0.355408602  0.218094790  0.540466256  0.031128553  0.174929837
 [91] -0.045950452 -0.459735463 -0.057900609 -0.153438834  0.493781715
 [96] -0.439478068  0.212109618  0.401043941  0.035325947  0.050544766
[101] -0.805471000  0.331352885  0.395518165 -0.678231749  0.255824650
[106]  0.463311536  0.016260920 -0.276114821  0.002887415  0.279284321
[111]  0.023890835  0.097920231 -0.161947283  0.349412697  0.481316327
[116]  0.102800232  0.406297933  0.009794933  0.140863558 -0.237915465
[121] -0.160113661 -0.377619697 -0.197434608 -0.172428317  0.202572394
[126] -0.417470972 -0.194575985 -0.046501539 -0.100027391 -0.943144999
[131] -0.627325213  0.096228694  0.435651970 -0.274182830  0.453850403
[136] -0.005115961 -0.196267514  0.387147115  0.169731338  0.303322283
[141]  0.159602565  0.159401687  0.041007343  0.073240013 -0.436486126
[146]  0.626317261  0.203931973  0.094148406  0.009070218 -0.345607986
[151]  0.201744189  0.445484484 -0.213201477  0.043409790  0.261339092
[156]  0.046405151 -0.308583811  0.050599636 -0.056225121 -0.450510649
[161]  0.221036919  0.277669011 -0.651436891  0.527483421 -0.380360187
[166]  0.084531278  0.276943436  0.391309686 -0.148723063 -0.103340907
[171] -0.374212579  0.448405486  0.141448096 -0.024222020  0.006368959
[176]  0.475791751  0.391088203 -0.071542401 -0.492804143 -0.334413769
[181] -0.170842003  0.005739075  0.618814189  0.241213169  0.103298109
[186]  0.137691873 -0.465601755  0.308875363 -0.170647571 -0.019692516
[191]  0.584757209  0.670796308 -0.282511257 -0.145781907 -0.312871295
[196]  0.110506293  0.100395934 -0.145578210 -0.147551298  0.427334099
[201]  0.157238459 -0.167934451 -0.059083260 -0.288790493 -0.544889120
[206]  0.209453868 -0.055839337 -0.022845214 -0.343539940 -0.046261199
[211]  0.353036340  0.400893434 -0.230620946 -0.331067290 -0.105392045
[216] -0.638443800 -0.216426915  0.097391220  0.057629031 -0.171670193
[221] -0.457021416 -0.327077714  0.070434148 -0.539780713  0.141404246
[226]  0.037666256 -0.113328171 -0.084017255 -0.554920933  0.213077784
> 
> proc.time()
   user  system elapsed 
  0.589   2.587   3.201 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 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: 0x6000025f4000>
> .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: 0x6000025f4000>
> .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: 0x6000025f4000>
> .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: 0x6000025f4000>
> 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: 0x6000025f4780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025f4780>
> .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: 0x6000025f4780>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025f4780>
> .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: 0x6000025f4780>
> 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: 0x6000025f4960>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025f4960>
> .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: 0x6000025f4960>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000025f4960>
> .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: 0x6000025f4960>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000025f4960>
> .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: 0x6000025f4960>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000025f4960>
> .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: 0x6000025f4960>
> 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: 0x6000025f4b40>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000025f4b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025f4b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025f4b40>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile84523264d41"  "BufferedMatrixFile84524799e804"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile84523264d41"  "BufferedMatrixFile84524799e804"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025f4c60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025f4c60>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000025f4c60>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000025f4c60>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000025f4c60>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000025f4c60>
> .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: 0x6000025f4e40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000025f4e40>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000025f4e40>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000025f4e40>
> 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: 0x6000025f5020>
> .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: 0x6000025f5020>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.114   0.034   0.145 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 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.115   0.024   0.136 

Example timings