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

This page was generated on 2023-10-20 09:37:59 -0400 (Fri, 20 Oct 2023).

HostnameOSArch (*)R versionInstalled pkgs
kjohnson2macOS 12.6.1 Montereyarm644.3.1 (2023-06-16) -- "Beagle Scouts" 4347
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 245/2230HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.64.0  (landing page)
Ben Bolstad
Snapshot Date: 2023-10-15 14:00:07 -0400 (Sun, 15 Oct 2023)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_17
git_last_commit: 3e3f8d6
git_last_commit_date: 2023-04-25 09:44:48 -0400 (Tue, 25 Apr 2023)
kjohnson2macOS 12.6.1 Monterey / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published

CHECK results for BufferedMatrix on kjohnson2


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.64.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.64.0.tar.gz
StartedAt: 2023-10-17 06:56:04 -0400 (Tue, 17 Oct 2023)
EndedAt: 2023-10-17 06:57:20 -0400 (Tue, 17 Oct 2023)
EllapsedTime: 75.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.64.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck’
* using R version 4.3.1 (2023-06-16)
* using platform: aarch64-apple-darwin20 (64-bit)
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Monterey 12.6.7
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.64.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.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R 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
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... 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.17-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.3-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch 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 -single_module -multiply_defined suppress -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.3-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.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)

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.352   0.114   0.750 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)

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.17-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 459904 24.6     991195   53         NA   645631 34.5
Vcells 848492  6.5    8388608   64      16384  2024378 15.5
> 
> 
> 
> 
> ##
> ## 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] "Tue Oct 17 06:56:43 2023"
> 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] "Tue Oct 17 06:56:44 2023"
> 
> 
> 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: 0x6000029ac420>
> 
> 
> 
> 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] "Tue Oct 17 06:56:48 2023"
> 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] "Tue Oct 17 06:56:50 2023"
> 
> ColMode(tmp2)
<pointer: 0x6000029ac420>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]        [,2]       [,3]       [,4]
[1,] 99.4170117 -0.08029004 -0.4264962 -1.4637480
[2,]  0.4178291  2.07927878  1.4225125 -3.8411860
[3,]  2.9067727  0.31570541 -0.4937036 -1.1282164
[4,]  0.4451296 -1.06039735 -0.7369338  0.8012403
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]      [,4]
[1,] 99.4170117 0.08029004 0.4264962 1.4637480
[2,]  0.4178291 2.07927878 1.4225125 3.8411860
[3,]  2.9067727 0.31570541 0.4937036 1.1282164
[4,]  0.4451296 1.06039735 0.7369338 0.8012403
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9708080 0.2833550 0.6530668 1.2098545
[2,] 0.6463970 1.4419705 1.1926913 1.9598944
[3,] 1.7049260 0.5618767 0.7026405 1.0621753
[4,] 0.6671804 1.0297560 0.8584485 0.8951203
> 
> 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.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.12509 27.91384 31.95716 38.56229
[2,]  31.88180 41.49898 38.34943 48.44013
[3,]  44.95603 30.93447 32.52011 36.74997
[4,]  32.11693 36.35796 34.32142 34.75244
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000029a0fc0>
> exp(tmp5)
<pointer: 0x6000029a0fc0>
> log(tmp5,2)
<pointer: 0x6000029a0fc0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.487
> Min(tmp5)
[1] 54.64119
> mean(tmp5)
[1] 74.07806
> Sum(tmp5)
[1] 14815.61
> Var(tmp5)
[1] 863.864
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.98925 75.21129 71.95781 75.87991 71.60095 72.08657 73.18521 70.98547
 [9] 67.70831 71.17586
> rowSums(tmp5)
 [1] 1819.785 1504.226 1439.156 1517.598 1432.019 1441.731 1463.704 1419.709
 [9] 1354.166 1423.517
> rowVars(tmp5)
 [1] 7899.88989  123.52070   98.45051   87.08219   79.65358   42.63846
 [7]   44.77525   91.76350   50.99613  145.41171
> rowSd(tmp5)
 [1] 88.881325 11.113986  9.922223  9.331784  8.924886  6.529813  6.691431
 [8]  9.579327  7.141157 12.058678
> rowMax(tmp5)
 [1] 466.48701 100.82178  93.57009  94.86354  90.04269  86.00109  87.95009
 [8]  89.00202  83.96464  93.31726
> rowMin(tmp5)
 [1] 58.09900 56.19802 54.64119 58.73275 55.61955 57.13170 62.55514 55.49728
 [9] 58.71694 56.64705
> 
> colMeans(tmp5)
 [1] 113.89843  72.11378  72.08295  71.65642  70.89151  70.05488  80.50577
 [8]  71.58481  73.09323  68.79528  78.69644  70.28264  70.56683  72.45361
[15]  66.02590  71.52011  75.87241  73.53414  68.61044  69.32166
> colSums(tmp5)
 [1] 1138.9843  721.1378  720.8295  716.5642  708.9151  700.5488  805.0577
 [8]  715.8481  730.9323  687.9528  786.9644  702.8264  705.6683  724.5361
[15]  660.2590  715.2011  758.7241  735.3414  686.1044  693.2166
> colVars(tmp5)
 [1] 15483.69835    81.19411    86.87997   161.98673    56.15336    75.05016
 [7]    74.15944    32.56627   161.08392   168.77610    78.26153    66.01703
[13]    83.23561    60.17199    20.29787    69.15878    66.91422    72.02660
[19]    43.37221    70.84426
> colSd(tmp5)
 [1] 124.433510   9.010778   9.320943  12.727401   7.493555   8.663149
 [7]   8.611587   5.706686  12.691884  12.991386   8.846554   8.125086
[13]   9.123355   7.757061   4.505316   8.316176   8.180111   8.486849
[19]   6.585758   8.416903
> colMax(tmp5)
 [1] 466.48701  86.37470  90.93114 100.82178  78.78348  81.96821  93.31726
 [8]  79.71995  94.86354  97.58901  90.04269  84.87149  84.73798  84.00203
[15]  75.77950  84.29381  89.94874  91.14270  77.85886  84.54097
> colMin(tmp5)
 [1] 58.52622 58.09900 58.36353 58.71694 56.64705 56.19802 67.01062 62.38125
 [9] 55.49728 56.51925 68.35495 55.61955 55.84078 58.28617 60.85047 57.24391
[17] 63.10380 63.26743 54.64119 58.52776
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.98925 75.21129 71.95781       NA 71.60095 72.08657 73.18521 70.98547
 [9] 67.70831 71.17586
> rowSums(tmp5)
 [1] 1819.785 1504.226 1439.156       NA 1432.019 1441.731 1463.704 1419.709
 [9] 1354.166 1423.517
> rowVars(tmp5)
 [1] 7899.88989  123.52070   98.45051   80.23100   79.65358   42.63846
 [7]   44.77525   91.76350   50.99613  145.41171
> rowSd(tmp5)
 [1] 88.881325 11.113986  9.922223  8.957176  8.924886  6.529813  6.691431
 [8]  9.579327  7.141157 12.058678
> rowMax(tmp5)
 [1] 466.48701 100.82178  93.57009        NA  90.04269  86.00109  87.95009
 [8]  89.00202  83.96464  93.31726
> rowMin(tmp5)
 [1] 58.09900 56.19802 54.64119       NA 55.61955 57.13170 62.55514 55.49728
 [9] 58.71694 56.64705
> 
> colMeans(tmp5)
 [1] 113.89843  72.11378  72.08295  71.65642  70.89151  70.05488        NA
 [8]  71.58481  73.09323  68.79528  78.69644  70.28264  70.56683  72.45361
[15]  66.02590  71.52011  75.87241  73.53414  68.61044  69.32166
> colSums(tmp5)
 [1] 1138.9843  721.1378  720.8295  716.5642  708.9151  700.5488        NA
 [8]  715.8481  730.9323  687.9528  786.9644  702.8264  705.6683  724.5361
[15]  660.2590  715.2011  758.7241  735.3414  686.1044  693.2166
> colVars(tmp5)
 [1] 15483.69835    81.19411    86.87997   161.98673    56.15336    75.05016
 [7]          NA    32.56627   161.08392   168.77610    78.26153    66.01703
[13]    83.23561    60.17199    20.29787    69.15878    66.91422    72.02660
[19]    43.37221    70.84426
> colSd(tmp5)
 [1] 124.433510   9.010778   9.320943  12.727401   7.493555   8.663149
 [7]         NA   5.706686  12.691884  12.991386   8.846554   8.125086
[13]   9.123355   7.757061   4.505316   8.316176   8.180111   8.486849
[19]   6.585758   8.416903
> colMax(tmp5)
 [1] 466.48701  86.37470  90.93114 100.82178  78.78348  81.96821        NA
 [8]  79.71995  94.86354  97.58901  90.04269  84.87149  84.73798  84.00203
[15]  75.77950  84.29381  89.94874  91.14270  77.85886  84.54097
> colMin(tmp5)
 [1] 58.52622 58.09900 58.36353 58.71694 56.64705 56.19802       NA 62.38125
 [9] 55.49728 56.51925 68.35495 55.61955 55.84078 58.28617 60.85047 57.24391
[17] 63.10380 63.26743 54.64119 58.52776
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.487
> Min(tmp5,na.rm=TRUE)
[1] 54.64119
> mean(tmp5,na.rm=TRUE)
[1] 73.99796
> Sum(tmp5,na.rm=TRUE)
[1] 14725.59
> Var(tmp5,na.rm=TRUE)
[1] 866.9373
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.98925 75.21129 71.95781 75.13580 71.60095 72.08657 73.18521 70.98547
 [9] 67.70831 71.17586
> rowSums(tmp5,na.rm=TRUE)
 [1] 1819.785 1504.226 1439.156 1427.580 1432.019 1441.731 1463.704 1419.709
 [9] 1354.166 1423.517
> rowVars(tmp5,na.rm=TRUE)
 [1] 7899.88989  123.52070   98.45051   80.23100   79.65358   42.63846
 [7]   44.77525   91.76350   50.99613  145.41171
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.881325 11.113986  9.922223  8.957176  8.924886  6.529813  6.691431
 [8]  9.579327  7.141157 12.058678
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.48701 100.82178  93.57009  94.86354  90.04269  86.00109  87.95009
 [8]  89.00202  83.96464  93.31726
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.09900 56.19802 54.64119 58.73275 55.61955 57.13170 62.55514 55.49728
 [9] 58.71694 56.64705
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 113.89843  72.11378  72.08295  71.65642  70.89151  70.05488  79.44886
 [8]  71.58481  73.09323  68.79528  78.69644  70.28264  70.56683  72.45361
[15]  66.02590  71.52011  75.87241  73.53414  68.61044  69.32166
> colSums(tmp5,na.rm=TRUE)
 [1] 1138.9843  721.1378  720.8295  716.5642  708.9151  700.5488  715.0398
 [8]  715.8481  730.9323  687.9528  786.9644  702.8264  705.6683  724.5361
[15]  660.2590  715.2011  758.7241  735.3414  686.1044  693.2166
> colVars(tmp5,na.rm=TRUE)
 [1] 15483.69835    81.19411    86.87997   161.98673    56.15336    75.05016
 [7]    70.86256    32.56627   161.08392   168.77610    78.26153    66.01703
[13]    83.23561    60.17199    20.29787    69.15878    66.91422    72.02660
[19]    43.37221    70.84426
> colSd(tmp5,na.rm=TRUE)
 [1] 124.433510   9.010778   9.320943  12.727401   7.493555   8.663149
 [7]   8.417990   5.706686  12.691884  12.991386   8.846554   8.125086
[13]   9.123355   7.757061   4.505316   8.316176   8.180111   8.486849
[19]   6.585758   8.416903
> colMax(tmp5,na.rm=TRUE)
 [1] 466.48701  86.37470  90.93114 100.82178  78.78348  81.96821  93.31726
 [8]  79.71995  94.86354  97.58901  90.04269  84.87149  84.73798  84.00203
[15]  75.77950  84.29381  89.94874  91.14270  77.85886  84.54097
> colMin(tmp5,na.rm=TRUE)
 [1] 58.52622 58.09900 58.36353 58.71694 56.64705 56.19802 67.01062 62.38125
 [9] 55.49728 56.51925 68.35495 55.61955 55.84078 58.28617 60.85047 57.24391
[17] 63.10380 63.26743 54.64119 58.52776
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.98925 75.21129 71.95781      NaN 71.60095 72.08657 73.18521 70.98547
 [9] 67.70831 71.17586
> rowSums(tmp5,na.rm=TRUE)
 [1] 1819.785 1504.226 1439.156    0.000 1432.019 1441.731 1463.704 1419.709
 [9] 1354.166 1423.517
> rowVars(tmp5,na.rm=TRUE)
 [1] 7899.88989  123.52070   98.45051         NA   79.65358   42.63846
 [7]   44.77525   91.76350   50.99613  145.41171
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.881325 11.113986  9.922223        NA  8.924886  6.529813  6.691431
 [8]  9.579327  7.141157 12.058678
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.48701 100.82178  93.57009        NA  90.04269  86.00109  87.95009
 [8]  89.00202  83.96464  93.31726
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.09900 56.19802 54.64119       NA 55.61955 57.13170 62.55514 55.49728
 [9] 58.71694 56.64705
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 119.12635  71.71816  72.15488  71.58128  70.51910  70.59967       NaN
 [8]  70.68091  70.67431  69.91334  79.06035  69.80166  68.99226  71.76218
[15]  66.60095  70.10082  74.89298  72.52902  68.49230  68.90777
> colSums(tmp5,na.rm=TRUE)
 [1] 1072.1371  645.4635  649.3939  644.2315  634.6719  635.3970    0.0000
 [8]  636.1282  636.0688  629.2201  711.5431  628.2149  620.9303  645.8596
[15]  599.4086  630.9073  674.0368  652.7612  616.4307  620.1700
> colVars(tmp5,na.rm=TRUE)
 [1] 17111.68574    89.58262    97.68176   182.17156    61.61233    81.09254
 [7]          NA    27.44533   115.39357   175.80998    86.55440    71.66662
[13]    65.74819    62.31506    19.11495    55.14152    64.48670    69.66442
[19]    48.63671    77.77266
> colSd(tmp5,na.rm=TRUE)
 [1] 130.811642   9.464809   9.883408  13.497094   7.849352   9.005139
 [7]         NA   5.238829  10.742140  13.259336   9.303462   8.465614
[13]   8.108525   7.893989   4.372065   7.425733   8.030361   8.346521
[19]   6.974002   8.818881
> colMax(tmp5,na.rm=TRUE)
 [1] 466.48701  86.37470  90.93114 100.82178  78.78348  81.96821      -Inf
 [8]  77.17414  87.81363  97.58901  90.04269  84.87149  77.94437  84.00203
[15]  75.77950  83.31769  89.94874  91.14270  77.85886  84.54097
> colMin(tmp5,na.rm=TRUE)
 [1] 58.52622 58.09900 58.36353 58.71694 56.64705 56.19802      Inf 62.38125
 [9] 55.49728 56.51925 68.35495 55.61955 55.84078 58.28617 62.19121 57.24391
[17] 63.10380 63.26743 54.64119 58.52776
> 
> 
> 
> 
> 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] 196.8395 138.0618 195.1697 158.4822 270.4117 205.5616 175.0262 105.5279
 [9] 151.0430 160.5624
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 196.8395 138.0618 195.1697 158.4822 270.4117 205.5616 175.0262 105.5279
 [9] 151.0430 160.5624
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.842171e-14  0.000000e+00  2.842171e-14 -2.842171e-14  1.136868e-13
 [6]  0.000000e+00  8.526513e-14  1.421085e-13  0.000000e+00  5.684342e-14
[11] -1.136868e-13 -2.842171e-14  2.842171e-14 -8.526513e-14 -1.136868e-13
[16]  0.000000e+00  0.000000e+00 -5.684342e-14 -2.842171e-14  2.131628e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   17 
8   14 
8   19 
3   3 
3   20 
4   18 
8   1 
5   1 
9   10 
10   20 
9   20 
8   9 
7   11 
2   10 
1   1 
5   16 
8   7 
6   5 
8   11 
5   13 
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.055903
> Min(tmp)
[1] -2.469559
> mean(tmp)
[1] -0.008690042
> Sum(tmp)
[1] -0.8690042
> Var(tmp)
[1] 0.8051534
> 
> rowMeans(tmp)
[1] -0.008690042
> rowSums(tmp)
[1] -0.8690042
> rowVars(tmp)
[1] 0.8051534
> rowSd(tmp)
[1] 0.8973034
> rowMax(tmp)
[1] 2.055903
> rowMin(tmp)
[1] -2.469559
> 
> colMeans(tmp)
  [1] -0.890571940  1.707442121 -0.135929427 -0.860582342  0.049222299
  [6]  1.006116159  0.105337259 -0.402462675  0.118274881 -0.482955310
 [11]  1.244589860 -1.137442155  0.512483673  0.556952465  0.063256713
 [16]  2.049081927 -0.515493077 -0.419903733 -0.507122201  0.079062852
 [21]  0.509227832 -0.507949881  0.714441805 -0.651967478 -0.365207221
 [26] -0.190061320 -1.171459199  0.379994523 -0.640680594  0.878201756
 [31] -1.263854242  0.526671888  1.569915444  0.555341027  0.211244917
 [36]  0.471973724  0.400748650  0.745838824  0.815176197 -0.633901661
 [41]  1.755515228 -1.227810010 -1.990664926 -0.885319973 -0.567885317
 [46]  0.630063765 -0.530953020 -0.503839564  0.282512632 -0.226770573
 [51]  2.055903421 -0.158628605 -0.842316557 -0.001423204 -0.271457737
 [56] -0.996674773 -0.501805420 -1.658855407  0.716785199 -0.231150106
 [61]  0.993457834  0.246257223  0.976530628  0.635947815  0.428417225
 [66]  0.391530745 -1.304949200 -0.430408562  0.208036207  0.871720480
 [71] -0.520032146  0.755854234  0.042001917  0.863336003  0.273064314
 [76] -0.080226982 -2.469558654 -0.047322515 -0.300936088  0.979420567
 [81] -1.482674272 -1.205971364  0.697467002  1.238301997 -0.701416967
 [86] -2.428232928  0.397206831  0.938948250 -0.454465635 -0.326552668
 [91]  0.519411595 -0.829447458 -1.295070912  0.154858667 -0.942611100
 [96]  1.322574760  0.790523535 -0.021755085  0.183541993  0.725941113
> colSums(tmp)
  [1] -0.890571940  1.707442121 -0.135929427 -0.860582342  0.049222299
  [6]  1.006116159  0.105337259 -0.402462675  0.118274881 -0.482955310
 [11]  1.244589860 -1.137442155  0.512483673  0.556952465  0.063256713
 [16]  2.049081927 -0.515493077 -0.419903733 -0.507122201  0.079062852
 [21]  0.509227832 -0.507949881  0.714441805 -0.651967478 -0.365207221
 [26] -0.190061320 -1.171459199  0.379994523 -0.640680594  0.878201756
 [31] -1.263854242  0.526671888  1.569915444  0.555341027  0.211244917
 [36]  0.471973724  0.400748650  0.745838824  0.815176197 -0.633901661
 [41]  1.755515228 -1.227810010 -1.990664926 -0.885319973 -0.567885317
 [46]  0.630063765 -0.530953020 -0.503839564  0.282512632 -0.226770573
 [51]  2.055903421 -0.158628605 -0.842316557 -0.001423204 -0.271457737
 [56] -0.996674773 -0.501805420 -1.658855407  0.716785199 -0.231150106
 [61]  0.993457834  0.246257223  0.976530628  0.635947815  0.428417225
 [66]  0.391530745 -1.304949200 -0.430408562  0.208036207  0.871720480
 [71] -0.520032146  0.755854234  0.042001917  0.863336003  0.273064314
 [76] -0.080226982 -2.469558654 -0.047322515 -0.300936088  0.979420567
 [81] -1.482674272 -1.205971364  0.697467002  1.238301997 -0.701416967
 [86] -2.428232928  0.397206831  0.938948250 -0.454465635 -0.326552668
 [91]  0.519411595 -0.829447458 -1.295070912  0.154858667 -0.942611100
 [96]  1.322574760  0.790523535 -0.021755085  0.183541993  0.725941113
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.890571940  1.707442121 -0.135929427 -0.860582342  0.049222299
  [6]  1.006116159  0.105337259 -0.402462675  0.118274881 -0.482955310
 [11]  1.244589860 -1.137442155  0.512483673  0.556952465  0.063256713
 [16]  2.049081927 -0.515493077 -0.419903733 -0.507122201  0.079062852
 [21]  0.509227832 -0.507949881  0.714441805 -0.651967478 -0.365207221
 [26] -0.190061320 -1.171459199  0.379994523 -0.640680594  0.878201756
 [31] -1.263854242  0.526671888  1.569915444  0.555341027  0.211244917
 [36]  0.471973724  0.400748650  0.745838824  0.815176197 -0.633901661
 [41]  1.755515228 -1.227810010 -1.990664926 -0.885319973 -0.567885317
 [46]  0.630063765 -0.530953020 -0.503839564  0.282512632 -0.226770573
 [51]  2.055903421 -0.158628605 -0.842316557 -0.001423204 -0.271457737
 [56] -0.996674773 -0.501805420 -1.658855407  0.716785199 -0.231150106
 [61]  0.993457834  0.246257223  0.976530628  0.635947815  0.428417225
 [66]  0.391530745 -1.304949200 -0.430408562  0.208036207  0.871720480
 [71] -0.520032146  0.755854234  0.042001917  0.863336003  0.273064314
 [76] -0.080226982 -2.469558654 -0.047322515 -0.300936088  0.979420567
 [81] -1.482674272 -1.205971364  0.697467002  1.238301997 -0.701416967
 [86] -2.428232928  0.397206831  0.938948250 -0.454465635 -0.326552668
 [91]  0.519411595 -0.829447458 -1.295070912  0.154858667 -0.942611100
 [96]  1.322574760  0.790523535 -0.021755085  0.183541993  0.725941113
> colMin(tmp)
  [1] -0.890571940  1.707442121 -0.135929427 -0.860582342  0.049222299
  [6]  1.006116159  0.105337259 -0.402462675  0.118274881 -0.482955310
 [11]  1.244589860 -1.137442155  0.512483673  0.556952465  0.063256713
 [16]  2.049081927 -0.515493077 -0.419903733 -0.507122201  0.079062852
 [21]  0.509227832 -0.507949881  0.714441805 -0.651967478 -0.365207221
 [26] -0.190061320 -1.171459199  0.379994523 -0.640680594  0.878201756
 [31] -1.263854242  0.526671888  1.569915444  0.555341027  0.211244917
 [36]  0.471973724  0.400748650  0.745838824  0.815176197 -0.633901661
 [41]  1.755515228 -1.227810010 -1.990664926 -0.885319973 -0.567885317
 [46]  0.630063765 -0.530953020 -0.503839564  0.282512632 -0.226770573
 [51]  2.055903421 -0.158628605 -0.842316557 -0.001423204 -0.271457737
 [56] -0.996674773 -0.501805420 -1.658855407  0.716785199 -0.231150106
 [61]  0.993457834  0.246257223  0.976530628  0.635947815  0.428417225
 [66]  0.391530745 -1.304949200 -0.430408562  0.208036207  0.871720480
 [71] -0.520032146  0.755854234  0.042001917  0.863336003  0.273064314
 [76] -0.080226982 -2.469558654 -0.047322515 -0.300936088  0.979420567
 [81] -1.482674272 -1.205971364  0.697467002  1.238301997 -0.701416967
 [86] -2.428232928  0.397206831  0.938948250 -0.454465635 -0.326552668
 [91]  0.519411595 -0.829447458 -1.295070912  0.154858667 -0.942611100
 [96]  1.322574760  0.790523535 -0.021755085  0.183541993  0.725941113
> colMedians(tmp)
  [1] -0.890571940  1.707442121 -0.135929427 -0.860582342  0.049222299
  [6]  1.006116159  0.105337259 -0.402462675  0.118274881 -0.482955310
 [11]  1.244589860 -1.137442155  0.512483673  0.556952465  0.063256713
 [16]  2.049081927 -0.515493077 -0.419903733 -0.507122201  0.079062852
 [21]  0.509227832 -0.507949881  0.714441805 -0.651967478 -0.365207221
 [26] -0.190061320 -1.171459199  0.379994523 -0.640680594  0.878201756
 [31] -1.263854242  0.526671888  1.569915444  0.555341027  0.211244917
 [36]  0.471973724  0.400748650  0.745838824  0.815176197 -0.633901661
 [41]  1.755515228 -1.227810010 -1.990664926 -0.885319973 -0.567885317
 [46]  0.630063765 -0.530953020 -0.503839564  0.282512632 -0.226770573
 [51]  2.055903421 -0.158628605 -0.842316557 -0.001423204 -0.271457737
 [56] -0.996674773 -0.501805420 -1.658855407  0.716785199 -0.231150106
 [61]  0.993457834  0.246257223  0.976530628  0.635947815  0.428417225
 [66]  0.391530745 -1.304949200 -0.430408562  0.208036207  0.871720480
 [71] -0.520032146  0.755854234  0.042001917  0.863336003  0.273064314
 [76] -0.080226982 -2.469558654 -0.047322515 -0.300936088  0.979420567
 [81] -1.482674272 -1.205971364  0.697467002  1.238301997 -0.701416967
 [86] -2.428232928  0.397206831  0.938948250 -0.454465635 -0.326552668
 [91]  0.519411595 -0.829447458 -1.295070912  0.154858667 -0.942611100
 [96]  1.322574760  0.790523535 -0.021755085  0.183541993  0.725941113
> colRanges(tmp)
           [,1]     [,2]       [,3]       [,4]      [,5]     [,6]      [,7]
[1,] -0.8905719 1.707442 -0.1359294 -0.8605823 0.0492223 1.006116 0.1053373
[2,] -0.8905719 1.707442 -0.1359294 -0.8605823 0.0492223 1.006116 0.1053373
           [,8]      [,9]      [,10]   [,11]     [,12]     [,13]     [,14]
[1,] -0.4024627 0.1182749 -0.4829553 1.24459 -1.137442 0.5124837 0.5569525
[2,] -0.4024627 0.1182749 -0.4829553 1.24459 -1.137442 0.5124837 0.5569525
          [,15]    [,16]      [,17]      [,18]      [,19]      [,20]     [,21]
[1,] 0.06325671 2.049082 -0.5154931 -0.4199037 -0.5071222 0.07906285 0.5092278
[2,] 0.06325671 2.049082 -0.5154931 -0.4199037 -0.5071222 0.07906285 0.5092278
          [,22]     [,23]      [,24]      [,25]      [,26]     [,27]     [,28]
[1,] -0.5079499 0.7144418 -0.6519675 -0.3652072 -0.1900613 -1.171459 0.3799945
[2,] -0.5079499 0.7144418 -0.6519675 -0.3652072 -0.1900613 -1.171459 0.3799945
          [,29]     [,30]     [,31]     [,32]    [,33]    [,34]     [,35]
[1,] -0.6406806 0.8782018 -1.263854 0.5266719 1.569915 0.555341 0.2112449
[2,] -0.6406806 0.8782018 -1.263854 0.5266719 1.569915 0.555341 0.2112449
         [,36]     [,37]     [,38]     [,39]      [,40]    [,41]    [,42]
[1,] 0.4719737 0.4007486 0.7458388 0.8151762 -0.6339017 1.755515 -1.22781
[2,] 0.4719737 0.4007486 0.7458388 0.8151762 -0.6339017 1.755515 -1.22781
         [,43]    [,44]      [,45]     [,46]     [,47]      [,48]     [,49]
[1,] -1.990665 -0.88532 -0.5678853 0.6300638 -0.530953 -0.5038396 0.2825126
[2,] -1.990665 -0.88532 -0.5678853 0.6300638 -0.530953 -0.5038396 0.2825126
          [,50]    [,51]      [,52]      [,53]        [,54]      [,55]
[1,] -0.2267706 2.055903 -0.1586286 -0.8423166 -0.001423204 -0.2714577
[2,] -0.2267706 2.055903 -0.1586286 -0.8423166 -0.001423204 -0.2714577
          [,56]      [,57]     [,58]     [,59]      [,60]     [,61]     [,62]
[1,] -0.9966748 -0.5018054 -1.658855 0.7167852 -0.2311501 0.9934578 0.2462572
[2,] -0.9966748 -0.5018054 -1.658855 0.7167852 -0.2311501 0.9934578 0.2462572
         [,63]     [,64]     [,65]     [,66]     [,67]      [,68]     [,69]
[1,] 0.9765306 0.6359478 0.4284172 0.3915307 -1.304949 -0.4304086 0.2080362
[2,] 0.9765306 0.6359478 0.4284172 0.3915307 -1.304949 -0.4304086 0.2080362
         [,70]      [,71]     [,72]      [,73]    [,74]     [,75]       [,76]
[1,] 0.8717205 -0.5200321 0.7558542 0.04200192 0.863336 0.2730643 -0.08022698
[2,] 0.8717205 -0.5200321 0.7558542 0.04200192 0.863336 0.2730643 -0.08022698
         [,77]       [,78]      [,79]     [,80]     [,81]     [,82]    [,83]
[1,] -2.469559 -0.04732252 -0.3009361 0.9794206 -1.482674 -1.205971 0.697467
[2,] -2.469559 -0.04732252 -0.3009361 0.9794206 -1.482674 -1.205971 0.697467
        [,84]     [,85]     [,86]     [,87]     [,88]      [,89]      [,90]
[1,] 1.238302 -0.701417 -2.428233 0.3972068 0.9389482 -0.4544656 -0.3265527
[2,] 1.238302 -0.701417 -2.428233 0.3972068 0.9389482 -0.4544656 -0.3265527
         [,91]      [,92]     [,93]     [,94]      [,95]    [,96]     [,97]
[1,] 0.5194116 -0.8294475 -1.295071 0.1548587 -0.9426111 1.322575 0.7905235
[2,] 0.5194116 -0.8294475 -1.295071 0.1548587 -0.9426111 1.322575 0.7905235
           [,98]    [,99]    [,100]
[1,] -0.02175508 0.183542 0.7259411
[2,] -0.02175508 0.183542 0.7259411
> 
> 
> Max(tmp2)
[1] 2.428367
> Min(tmp2)
[1] -2.330207
> mean(tmp2)
[1] -0.2394029
> Sum(tmp2)
[1] -23.94029
> Var(tmp2)
[1] 0.9858359
> 
> rowMeans(tmp2)
  [1] -0.941513193 -0.096129349  0.193798531  0.335341038 -0.669731478
  [6]  0.020260445  0.942674055  1.762630997  0.908456197  0.371717597
 [11]  0.448412580 -0.126290274 -1.317246740 -1.151012471 -0.789488628
 [16] -0.349411005  1.644940998  1.321447850 -0.255007703  0.373646861
 [21]  0.676517002 -1.836736706  0.459297887  0.202176073 -1.924716104
 [26]  0.275168471 -0.704520201  0.620801657 -0.546400230 -0.098962647
 [31] -1.990098943  1.458419741 -0.590893272  0.585802695  0.008394127
 [36] -0.271437435 -1.427902683 -1.409466674 -0.532908549  1.339680963
 [41] -0.037808821 -1.359541608  1.912298713 -0.560557229  0.985997076
 [46] -1.384156988 -0.009357322  0.909245423 -0.306545571 -0.197141549
 [51] -1.370653371 -0.721353263 -0.483620366 -1.844359032  0.965192661
 [56]  0.550561119 -0.380728319 -1.655895207 -0.458478517 -1.261866393
 [61] -0.104521105  0.824239698 -1.249067015 -0.116477833  0.265505246
 [66]  0.248510739  0.764506159  0.205386119 -0.656104054 -0.261064993
 [71] -0.532172896  0.018368109 -1.829693359 -1.348746842 -0.837444743
 [76]  0.835033256 -0.775680734  0.837094192  0.385128861 -2.330206601
 [81] -0.177339854  1.505381867 -1.901192580 -0.637298150 -0.959124734
 [86] -0.878539590  2.428366898 -0.937972931 -1.280834773 -0.523312117
 [91]  1.072569190 -0.066641789  0.834337461 -0.766932263 -0.109629893
 [96] -0.501442052 -1.527237961 -1.325366328 -1.537427155 -1.204190346
> rowSums(tmp2)
  [1] -0.941513193 -0.096129349  0.193798531  0.335341038 -0.669731478
  [6]  0.020260445  0.942674055  1.762630997  0.908456197  0.371717597
 [11]  0.448412580 -0.126290274 -1.317246740 -1.151012471 -0.789488628
 [16] -0.349411005  1.644940998  1.321447850 -0.255007703  0.373646861
 [21]  0.676517002 -1.836736706  0.459297887  0.202176073 -1.924716104
 [26]  0.275168471 -0.704520201  0.620801657 -0.546400230 -0.098962647
 [31] -1.990098943  1.458419741 -0.590893272  0.585802695  0.008394127
 [36] -0.271437435 -1.427902683 -1.409466674 -0.532908549  1.339680963
 [41] -0.037808821 -1.359541608  1.912298713 -0.560557229  0.985997076
 [46] -1.384156988 -0.009357322  0.909245423 -0.306545571 -0.197141549
 [51] -1.370653371 -0.721353263 -0.483620366 -1.844359032  0.965192661
 [56]  0.550561119 -0.380728319 -1.655895207 -0.458478517 -1.261866393
 [61] -0.104521105  0.824239698 -1.249067015 -0.116477833  0.265505246
 [66]  0.248510739  0.764506159  0.205386119 -0.656104054 -0.261064993
 [71] -0.532172896  0.018368109 -1.829693359 -1.348746842 -0.837444743
 [76]  0.835033256 -0.775680734  0.837094192  0.385128861 -2.330206601
 [81] -0.177339854  1.505381867 -1.901192580 -0.637298150 -0.959124734
 [86] -0.878539590  2.428366898 -0.937972931 -1.280834773 -0.523312117
 [91]  1.072569190 -0.066641789  0.834337461 -0.766932263 -0.109629893
 [96] -0.501442052 -1.527237961 -1.325366328 -1.537427155 -1.204190346
> 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.941513193 -0.096129349  0.193798531  0.335341038 -0.669731478
  [6]  0.020260445  0.942674055  1.762630997  0.908456197  0.371717597
 [11]  0.448412580 -0.126290274 -1.317246740 -1.151012471 -0.789488628
 [16] -0.349411005  1.644940998  1.321447850 -0.255007703  0.373646861
 [21]  0.676517002 -1.836736706  0.459297887  0.202176073 -1.924716104
 [26]  0.275168471 -0.704520201  0.620801657 -0.546400230 -0.098962647
 [31] -1.990098943  1.458419741 -0.590893272  0.585802695  0.008394127
 [36] -0.271437435 -1.427902683 -1.409466674 -0.532908549  1.339680963
 [41] -0.037808821 -1.359541608  1.912298713 -0.560557229  0.985997076
 [46] -1.384156988 -0.009357322  0.909245423 -0.306545571 -0.197141549
 [51] -1.370653371 -0.721353263 -0.483620366 -1.844359032  0.965192661
 [56]  0.550561119 -0.380728319 -1.655895207 -0.458478517 -1.261866393
 [61] -0.104521105  0.824239698 -1.249067015 -0.116477833  0.265505246
 [66]  0.248510739  0.764506159  0.205386119 -0.656104054 -0.261064993
 [71] -0.532172896  0.018368109 -1.829693359 -1.348746842 -0.837444743
 [76]  0.835033256 -0.775680734  0.837094192  0.385128861 -2.330206601
 [81] -0.177339854  1.505381867 -1.901192580 -0.637298150 -0.959124734
 [86] -0.878539590  2.428366898 -0.937972931 -1.280834773 -0.523312117
 [91]  1.072569190 -0.066641789  0.834337461 -0.766932263 -0.109629893
 [96] -0.501442052 -1.527237961 -1.325366328 -1.537427155 -1.204190346
> rowMin(tmp2)
  [1] -0.941513193 -0.096129349  0.193798531  0.335341038 -0.669731478
  [6]  0.020260445  0.942674055  1.762630997  0.908456197  0.371717597
 [11]  0.448412580 -0.126290274 -1.317246740 -1.151012471 -0.789488628
 [16] -0.349411005  1.644940998  1.321447850 -0.255007703  0.373646861
 [21]  0.676517002 -1.836736706  0.459297887  0.202176073 -1.924716104
 [26]  0.275168471 -0.704520201  0.620801657 -0.546400230 -0.098962647
 [31] -1.990098943  1.458419741 -0.590893272  0.585802695  0.008394127
 [36] -0.271437435 -1.427902683 -1.409466674 -0.532908549  1.339680963
 [41] -0.037808821 -1.359541608  1.912298713 -0.560557229  0.985997076
 [46] -1.384156988 -0.009357322  0.909245423 -0.306545571 -0.197141549
 [51] -1.370653371 -0.721353263 -0.483620366 -1.844359032  0.965192661
 [56]  0.550561119 -0.380728319 -1.655895207 -0.458478517 -1.261866393
 [61] -0.104521105  0.824239698 -1.249067015 -0.116477833  0.265505246
 [66]  0.248510739  0.764506159  0.205386119 -0.656104054 -0.261064993
 [71] -0.532172896  0.018368109 -1.829693359 -1.348746842 -0.837444743
 [76]  0.835033256 -0.775680734  0.837094192  0.385128861 -2.330206601
 [81] -0.177339854  1.505381867 -1.901192580 -0.637298150 -0.959124734
 [86] -0.878539590  2.428366898 -0.937972931 -1.280834773 -0.523312117
 [91]  1.072569190 -0.066641789  0.834337461 -0.766932263 -0.109629893
 [96] -0.501442052 -1.527237961 -1.325366328 -1.537427155 -1.204190346
> 
> colMeans(tmp2)
[1] -0.2394029
> colSums(tmp2)
[1] -23.94029
> colVars(tmp2)
[1] 0.9858359
> colSd(tmp2)
[1] 0.9928927
> colMax(tmp2)
[1] 2.428367
> colMin(tmp2)
[1] -2.330207
> colMedians(tmp2)
[1] -0.2580363
> colRanges(tmp2)
          [,1]
[1,] -2.330207
[2,]  2.428367
> 
> 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.9720995 -2.1990541 -2.8065983 -1.8202434  1.1984866 -2.3061289
 [7] -0.6799602  5.3108711  4.3898145  3.1342137
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.1763952
[2,] -0.7695761
[3,] -0.5420147
[4,] -0.3539015
[5,]  1.5909281
> 
> rowApply(tmp,sum)
 [1] -2.8748051 -2.1298411 -1.7793315 -2.5738528  2.9776926  0.8014295
 [7] -4.8693185  0.6580190  5.8444305  3.1948789
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    3    4    4    1    6    7    1    9     1
 [2,]    8    1    7    2    9    7    9    4    2     3
 [3,]    1    2    3    5    3    8    8    2    5     6
 [4,]    7    4    6    3    2    1    5    5    7     8
 [5,]    9    6    2    7    4   10    2   10    3     4
 [6,]    4    8    9    6    5    5    1    9    1     2
 [7,]    2   10   10    1    7    4    4    3    4    10
 [8,]   10    7    5    9    8    2    6    8   10     9
 [9,]    5    5    1   10   10    3   10    7    6     5
[10,]    6    9    8    8    6    9    3    6    8     7
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.5762418 -0.9678961  0.2075174  0.9887812  0.3772691  0.4541604
 [7] -2.8343377 -0.2328239 -1.5255687 -2.0439036  0.6948342  3.8125891
[13] -3.1425601  1.2330121  3.3694903 -0.1112748  6.9142515  1.5691364
[19]  2.9143291  1.0870855
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.5654034
[2,]  0.4616635
[3,]  0.4747406
[4,]  0.9539809
[5,]  1.2512602
> 
> rowApply(tmp,sum)
[1]  4.7943435 -2.0871133  0.5282240  9.7144837  0.3903954
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13   19   15    1   18
[2,]    9    9    9    8    5
[3,]    2    2   18   18   11
[4,]   10   13    7    9   15
[5,]    4    5    8   15   13
> 
> 
> as.matrix(tmp)
           [,1]        [,2]        [,3]       [,4]       [,5]       [,6]
[1,]  0.4616635  0.21546542 -1.42999985  0.2794717 -0.2007421  1.1688353
[2,]  1.2512602 -0.52407467 -1.37776697  0.2976042 -1.1266855 -1.4511802
[3,]  0.4747406  0.04505533  0.97406343 -0.4264618 -0.3029741  0.5906349
[4,] -2.5654034  0.07986825  1.96859523  0.2660538  1.4971784 -0.4158536
[5,]  0.9539809 -0.78421042  0.07262555  0.5721134  0.5104923  0.5617240
           [,7]       [,8]       [,9]      [,10]      [,11]     [,12]
[1,] -1.5110280  0.6779371  0.9378502  0.7894007 -0.1860412 0.0554043
[2,]  0.5364908  1.2464306 -1.0214782 -1.1472460 -0.2928834 0.1370108
[3,] -1.5521683 -0.7548538  0.3705068 -0.9776392  0.4543135 0.1262998
[4,]  0.9811959 -0.6240363 -0.9236753 -1.4862969  0.9204542 1.7268323
[5,] -1.2888281 -0.7783015 -0.8887722  0.7778778 -0.2010089 1.7670419
           [,13]       [,14]      [,15]      [,16]     [,17]      [,18]
[1,]  0.94305007 -0.07263144 1.47743506 -0.9209848 1.4385864  0.4335194
[2,] -1.34235398  0.14376477 1.28769190 -0.8551980 1.2285015 -0.7081255
[3,] -0.98450479  1.12558571 0.12759924  0.8820757 0.3396272 -0.4914940
[4,] -0.05284359 -0.57915062 0.46590727  1.7819930 2.6268400  2.1561305
[5,] -1.70590780  0.61544368 0.01085681 -0.9991606 1.2806965  0.1791061
          [,19]       [,20]
[1,]  0.3426436 -0.10549177
[2,]  0.9134001  0.71772428
[3,]  1.2495409 -0.74172326
[4,]  0.5817158  1.30897887
[5,] -0.1729713 -0.09240264
> 
> 
> 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.17-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.17-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.17-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.17-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.2371397 -0.1907472 -0.4806215 0.1203408 0.2032009 0.2738994 -0.6477989
           col8      col9      col10    col11    col12     col13      col14
row1 -0.4407325 -1.998742 -0.2821482 0.773777 1.022356 0.9225898 -0.3145842
        col15    col16     col17      col18      col19      col20
row1 1.054912 0.818159 0.7660573 0.03538286 -0.6221022 -0.8458386
> tmp[,"col10"]
          col10
row1 -0.2821482
row2 -0.9101689
row3 -0.5106064
row4 -0.4103436
row5 -0.9141395
> tmp[c("row1","row5"),]
           col1       col2       col3      col4      col5      col6       col7
row1 -0.2371397 -0.1907472 -0.4806215 0.1203408 0.2032009 0.2738994 -0.6477989
row5  2.1540241 -0.4527049 -0.5338700 1.4139374 0.6702825 0.7890267  0.3779201
           col8       col9      col10     col11    col12     col13      col14
row1 -0.4407325 -1.9987418 -0.2821482 0.7737770 1.022356 0.9225898 -0.3145842
row5 -0.2120497 -0.7729827 -0.9141395 0.5894538 1.095317 0.1280187 -0.9237675
          col15     col16      col17       col18      col19      col20
row1  1.0549123 0.8181590 0.76605735  0.03538286 -0.6221022 -0.8458386
row5 -0.8939897 0.1504841 0.04382111 -0.73955296  0.3543816 -0.8275517
> tmp[,c("col6","col20")]
           col6      col20
row1  0.2738994 -0.8458386
row2 -0.4884005  0.1319816
row3  0.4845263  2.4004958
row4 -2.0181504  0.9171046
row5  0.7890267 -0.8275517
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.2738994 -0.8458386
row5 0.7890267 -0.8275517
> 
> 
> 
> 
> 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 47.47983 49.48446 51.59686 49.65203 50.26651 105.1205 50.17219 51.65087
        col9    col10    col11    col12    col13    col14    col15    col16
row1 51.5173 49.97279 50.35043 48.11641 49.36618 49.27869 51.22058 48.47149
        col17    col18    col19   col20
row1 51.06553 49.39188 50.65406 104.773
> tmp[,"col10"]
        col10
row1 49.97279
row2 28.51778
row3 31.22179
row4 30.09371
row5 48.82565
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 47.47983 49.48446 51.59686 49.65203 50.26651 105.1205 50.17219 51.65087
row5 50.77837 51.22115 47.84324 50.04389 50.07067 105.9167 47.45591 51.27778
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.51730 49.97279 50.35043 48.11641 49.36618 49.27869 51.22058 48.47149
row5 52.10735 48.82565 49.54083 49.64073 50.56507 50.84913 49.91664 52.41684
        col17    col18    col19    col20
row1 51.06553 49.39188 50.65406 104.7730
row5 49.52998 51.31660 49.29665 104.2837
> tmp[,c("col6","col20")]
          col6     col20
row1 105.12046 104.77305
row2  74.93053  74.91496
row3  74.38162  71.99706
row4  75.10584  73.97128
row5 105.91667 104.28366
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.1205 104.7730
row5 105.9167 104.2837
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.1205 104.7730
row5 105.9167 104.2837
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.1354418
[2,]  0.2007980
[3,]  1.6107218
[4,] -0.5896155
[5,] -0.6546034
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.7325208  0.09384546
[2,]  0.3291883  0.08124812
[3,]  1.0075261  1.86628144
[4,]  1.4541759  0.31485746
[5,] -1.4427908 -0.40579327
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.06558208  1.0813650
[2,] -0.35550227 -1.3655486
[3,] -0.05471552 -1.8823430
[4,]  0.06324094  1.9484447
[5,] -0.30822630  0.2653773
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] 0.06558208
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,]  0.06558208
[2,] -0.35550227
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]      [,3]     [,4]      [,5]      [,6]       [,7]
row3  0.7803706 -0.4856637 1.6410568 2.287453  1.898435 -1.364925 -1.4280472
row1 -0.2576403  1.2978485 0.3625786 1.048954 -0.129934  1.205617  0.3855539
          [,8]        [,9]      [,10]      [,11]      [,12]      [,13]
row3 1.0422280 -1.35720330 -0.3159257 -0.3786494 -0.9256798 -0.8626671
row1 0.5401539  0.04561126 -0.4921011 -0.1054021  0.5104126 -0.8455296
          [,14]      [,15]      [,16]      [,17]     [,18]      [,19]     [,20]
row3 -0.2390940 0.85878028 -0.6784978 -0.2870969 0.6579135 -0.5127142 0.3152839
row1 -0.8805598 0.07730108  2.0665201  0.4740497 1.4775209  1.7812348 0.4424580
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]        [,4]      [,5]     [,6]     [,7]
row2 -0.5335491 0.7296335 0.7624575 -0.00218895 0.1486318 1.575085 1.388113
            [,8]      [,9]      [,10]
row2 -0.05456278 -1.180319 -0.6020453
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]       [,3]       [,4]     [,5]      [,6]      [,7]
row5 0.4561631 -0.4230532 -0.2011505 0.04248554 -2.50907 -1.394998 0.6477708
          [,8]       [,9]      [,10]      [,11]     [,12]     [,13]    [,14]
row5 0.9849313 -0.2637437 -0.7204982 -0.3670872 -2.407482 0.2812346 1.174259
          [,15]      [,16]     [,17]     [,18]     [,19]     [,20]
row5 -0.3662353 -0.7706154 -1.467039 0.1054096 -1.424562 -1.147942
> 
> 
> 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: 0x6000029ab4e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e6e999e2e"
 [2] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e276016bc"
 [3] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e1574a4d6"
 [4] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e1cf1e89b"
 [5] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e4dde26f5"
 [6] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e33cfc6c3"
 [7] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1ee0246c8" 
 [8] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e3774fba7"
 [9] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e6135ad62"
[10] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1eb0a2eca" 
[11] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e4985d56f"
[12] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e717f901e"
[13] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e6dcedbc8"
[14] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e27bf5fca"
[15] "/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BMdf1e529db29" 
> 
> 
> ### 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: 0x6000029b6f40>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000029b6f40>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.17-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000029b6f40>
> rowMedians(tmp)
  [1] -0.270442637  0.457203743  0.167549560  0.207388402 -0.393620335
  [6] -0.127701880 -0.005239197 -0.279583759 -0.517933769 -0.093383290
 [11] -0.379359780 -0.329832165  0.168109341  0.035254282  0.154989483
 [16]  0.773532004 -0.429436901  0.030876618  0.462550828  0.289860928
 [21] -0.306504705  0.248139092  0.085911198 -0.135239759  0.423954176
 [26] -0.164949218 -0.092341033 -0.126405225 -0.029303169 -0.045627102
 [31] -0.106151853 -0.304479918  0.031313420 -0.243465474 -0.143221724
 [36] -0.490159688  0.119753811  0.264476864 -0.445405595 -0.048798730
 [41]  0.846661292  0.016671280 -0.223972191  0.222786151  0.432562117
 [46]  0.481967314 -0.440093476  0.058901740  0.346458816  0.118047265
 [51] -0.015919914  0.330236483 -0.311086384  0.488673519  0.117798536
 [56]  0.276834929  1.054646634 -0.379709358 -0.006897930 -0.182116112
 [61] -0.398375713  0.072853718  0.220468137 -0.130363483 -0.221072681
 [66]  0.152157921 -0.185032789 -0.073549818  0.131228019 -0.346913882
 [71] -0.671995204 -0.335347963  0.007943850  0.258812398 -0.157072440
 [76] -0.376124553  0.554985967  0.383569539 -0.254695146 -0.137208768
 [81] -0.512837716 -0.506933786  0.460449778 -0.678361207  0.013973149
 [86] -0.185834639 -0.291151881 -0.138386018 -0.104925239 -0.048424324
 [91] -0.227973540  0.023800597 -0.741702666 -0.054285898  0.386052501
 [96] -0.491152207 -0.085834979  0.653597114  0.019690683 -0.097115525
[101]  0.578522022 -0.156746333 -0.047512094 -0.153121161  0.686620823
[106]  0.279816133 -0.209654529 -0.184039682  0.246241893  0.339790962
[111] -0.104247727  0.242970201 -0.544564098 -0.361383528  0.036512347
[116] -0.050229761 -0.572325401  0.254283011  0.042912149 -0.092551617
[121]  0.398379918 -0.142273910 -0.018075508 -0.327677654  0.317906939
[126]  0.175374338  0.134297453  0.198121058 -0.061263949  0.195459060
[131]  0.206874612  0.197672181  0.561868609 -0.170399668  0.268629014
[136] -0.532053137 -0.033167645  0.690740639 -0.216966413  0.325554614
[141] -0.183812445  0.042064171  0.358125252 -0.459290345  0.505909205
[146]  0.256795149  0.363376857  0.694229246 -0.072428977 -0.129608921
[151] -0.089497577 -0.282090214  0.028265343  0.146419570  0.335813208
[156] -0.516141276 -0.081190603 -0.267956930 -0.329616948  0.115357411
[161]  0.619933152 -0.252864522  0.683951004 -0.364068443 -0.258859670
[166]  0.084768459  0.492415892  0.262946917 -0.337204407  0.254626500
[171]  0.064699550 -0.072978751  0.029769300  0.194776065 -0.034107905
[176]  0.037309861 -0.492557983  0.602133707  0.198669079  0.062081474
[181] -0.170205206  0.199232505 -0.084101412  0.020721427  0.156389276
[186] -0.059723512  0.425323928  0.633827452 -0.235843278  0.277345224
[191] -0.094994895 -0.205368115 -0.622683846  0.300426106  0.079905449
[196] -0.410703105 -0.017350868 -0.106335215  0.554891914  0.205010736
[201]  0.268380812 -0.050871733  0.263238124 -0.157795263  0.253228875
[206]  0.207512297  0.002156626  0.494329105 -0.166638425 -0.279464513
[211] -0.085580537 -0.193131071 -0.179886535  0.039523821  0.073048835
[216] -0.069299737  0.359952966 -0.306137691  0.436621701 -0.015967851
[221] -0.165581871  0.173302172  0.008968405 -0.420831540 -0.324528795
[226]  0.016725688 -0.678883931 -0.617296141 -0.330677877  0.110461486
> 
> proc.time()
   user  system elapsed 
  2.414   8.859  19.311 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)

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: 0x600002074720>
> .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: 0x600002074720>
> .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: 0x600002074720>
> .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: 0x600002074720>
> 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: 0x6000020709c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000020709c0>
> .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: 0x6000020709c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000020709c0>
> .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: 0x6000020709c0>
> 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: 0x60000207c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000207c360>
> .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: 0x60000207c360>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000207c360>
> .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: 0x60000207c360>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60000207c360>
> .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: 0x60000207c360>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60000207c360>
> .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: 0x60000207c360>
> 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: 0x600002074960>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002074960>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002074960>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002074960>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee05b3327e0f5" "BufferedMatrixFilee05b7f220f0f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee05b3327e0f5" "BufferedMatrixFilee05b7f220f0f"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002070ba0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002070ba0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002070ba0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002070ba0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002070ba0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002070ba0>
> .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: 0x600002070d80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002070d80>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002070d80>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002070d80>
> 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: 0x600002070f60>
> .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: 0x600002070f60>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.350   0.109   0.720 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)

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.342   0.078   0.669 

Example timings