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

This page was generated on 2024-10-18 20:41 -0400 (Fri, 18 Oct 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4763
palomino7Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4500
merida1macOS 12.7.5 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4530
kjohnson1macOS 13.6.6 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4480
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-10-16 14:00 -0400 (Wed, 16 Oct 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on kjohnson1

To the developers/maintainers of the BufferedMatrix package:
- Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information.
- Use the following Renviron settings to reproduce errors and warnings.
- If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information.

raw results


Summary

Package: BufferedMatrix
Version: 1.68.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-10-17 14:39:57 -0400 (Thu, 17 Oct 2024)
EndedAt: 2024-10-17 14:40:43 -0400 (Thu, 17 Oct 2024)
EllapsedTime: 45.5 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Ventura 13.6.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.68.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
* used SDK: ‘MacOSX11.3.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 1 WARNING, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.361   0.125   0.523 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.19-bioc/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 474153 25.4    1035428 55.3         NA   638588 34.2
Vcells 877591  6.7    8388608 64.0      65536  2072106 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Oct 17 14:40:20 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Oct 17 14:40:20 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x6000020680c0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Oct 17 14:40:23 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Oct 17 14:40:24 2024"
> 
> ColMode(tmp2)
<pointer: 0x6000020680c0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.2324894  0.3034554 -0.4772048  1.2069532
[2,]   2.0363116  0.1384889  0.3511449 -0.7937053
[3,]  -0.8993159 -0.9074649 -0.7382138  0.6442463
[4,]  -1.3894777  0.1156486  0.8177855  0.3266826
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.2324894 0.3034554 0.4772048 1.2069532
[2,]   2.0363116 0.1384889 0.3511449 0.7937053
[3,]   0.8993159 0.9074649 0.7382138 0.6442463
[4,]   1.3894777 0.1156486 0.8177855 0.3266826
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0116177 0.5508679 0.6908001 1.0986142
[2,]  1.4269939 0.3721410 0.5925748 0.8909014
[3,]  0.9483227 0.9526095 0.8591937 0.8026496
[4,]  1.1787611 0.3400715 0.9043149 0.5715616
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.34867 30.81213 32.38521 37.19310
[2,]  41.30625 28.85990 31.27689 34.70272
[3,]  35.38254 35.43356 34.33015 33.67074
[4,]  38.17709 28.51636 34.86093 31.04230
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x60000206c7e0>
> exp(tmp5)
<pointer: 0x60000206c7e0>
> log(tmp5,2)
<pointer: 0x60000206c7e0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.0337
> Min(tmp5)
[1] 54.04427
> mean(tmp5)
[1] 72.87379
> Sum(tmp5)
[1] 14574.76
> Var(tmp5)
[1] 870.0687
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.99316 71.38906 75.37889 68.94396 70.75158 70.06056 71.60621 71.80274
 [9] 69.03544 69.77626
> rowSums(tmp5)
 [1] 1799.863 1427.781 1507.578 1378.879 1415.032 1401.211 1432.124 1436.055
 [9] 1380.709 1395.525
> rowVars(tmp5)
 [1] 8042.90965   77.15285   44.97954   57.61743   43.88705  105.45229
 [7]   72.78593   75.32983   97.95154  119.49988
> rowSd(tmp5)
 [1] 89.682271  8.783669  6.706679  7.590615  6.624730 10.268996  8.531467
 [8]  8.679276  9.897047 10.931600
> rowMax(tmp5)
 [1] 469.03372  85.97355  90.90038  81.54256  84.34986  95.47833  85.01566
 [8]  87.18504  89.63773  91.39254
> rowMin(tmp5)
 [1] 55.63462 58.31142 64.33843 57.08509 61.85236 55.35897 58.04426 56.95813
 [9] 54.04427 54.15374
> 
> colMeans(tmp5)
 [1] 112.37696  73.03563  67.93404  67.52586  71.73846  74.07477  71.63508
 [8]  68.77155  69.32221  71.07113  73.79574  72.30165  70.49102  74.21331
[15]  70.98094  70.30596  70.67568  72.37085  67.91875  66.93611
> colSums(tmp5)
 [1] 1123.7696  730.3563  679.3404  675.2586  717.3846  740.7477  716.3508
 [8]  687.7155  693.2221  710.7113  737.9574  723.0165  704.9102  742.1331
[15]  709.8094  703.0596  706.7568  723.7085  679.1875  669.3611
> colVars(tmp5)
 [1] 15793.80927   141.86879    66.85697    50.51308    57.04009   115.65829
 [7]   131.64038    70.29153    48.66105    98.71317    65.66159    71.97742
[13]    42.27373    82.95398    61.42905    84.93942   112.45027    79.58010
[19]    86.25031    48.72313
> colSd(tmp5)
 [1] 125.673423  11.910869   8.176611   7.107255   7.552489  10.754454
 [7]  11.473464   8.384005   6.975747   9.935450   8.103184   8.483951
[13]   6.501825   9.107908   7.837669   9.216259  10.604257   8.920768
[19]   9.287104   6.980195
> colMax(tmp5)
 [1] 469.03372  91.39254  87.18504  77.41256  82.26168  89.63773  95.47833
 [8]  81.43842  80.51368  85.90993  86.53264  87.09670  84.05269  85.01566
[15]  79.63502  82.62244  90.90038  84.78067  82.89429  77.39624
> colMin(tmp5)
 [1] 61.06473 59.35307 58.88750 56.39560 54.15374 58.92019 57.28933 58.17265
 [9] 56.95813 57.08509 63.20342 54.98240 64.30410 62.40215 55.63462 56.16687
[17] 57.70359 58.07452 54.04427 55.35897
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 89.99316 71.38906 75.37889 68.94396       NA 70.06056 71.60621 71.80274
 [9] 69.03544 69.77626
> rowSums(tmp5)
 [1] 1799.863 1427.781 1507.578 1378.879       NA 1401.211 1432.124 1436.055
 [9] 1380.709 1395.525
> rowVars(tmp5)
 [1] 8042.90965   77.15285   44.97954   57.61743   46.27259  105.45229
 [7]   72.78593   75.32983   97.95154  119.49988
> rowSd(tmp5)
 [1] 89.682271  8.783669  6.706679  7.590615  6.802396 10.268996  8.531467
 [8]  8.679276  9.897047 10.931600
> rowMax(tmp5)
 [1] 469.03372  85.97355  90.90038  81.54256        NA  95.47833  85.01566
 [8]  87.18504  89.63773  91.39254
> rowMin(tmp5)
 [1] 55.63462 58.31142 64.33843 57.08509       NA 55.35897 58.04426 56.95813
 [9] 54.04427 54.15374
> 
> colMeans(tmp5)
 [1] 112.37696  73.03563  67.93404  67.52586  71.73846  74.07477  71.63508
 [8]  68.77155  69.32221  71.07113        NA  72.30165  70.49102  74.21331
[15]  70.98094  70.30596  70.67568  72.37085  67.91875  66.93611
> colSums(tmp5)
 [1] 1123.7696  730.3563  679.3404  675.2586  717.3846  740.7477  716.3508
 [8]  687.7155  693.2221  710.7113        NA  723.0165  704.9102  742.1331
[15]  709.8094  703.0596  706.7568  723.7085  679.1875  669.3611
> colVars(tmp5)
 [1] 15793.80927   141.86879    66.85697    50.51308    57.04009   115.65829
 [7]   131.64038    70.29153    48.66105    98.71317          NA    71.97742
[13]    42.27373    82.95398    61.42905    84.93942   112.45027    79.58010
[19]    86.25031    48.72313
> colSd(tmp5)
 [1] 125.673423  11.910869   8.176611   7.107255   7.552489  10.754454
 [7]  11.473464   8.384005   6.975747   9.935450         NA   8.483951
[13]   6.501825   9.107908   7.837669   9.216259  10.604257   8.920768
[19]   9.287104   6.980195
> colMax(tmp5)
 [1] 469.03372  91.39254  87.18504  77.41256  82.26168  89.63773  95.47833
 [8]  81.43842  80.51368  85.90993        NA  87.09670  84.05269  85.01566
[15]  79.63502  82.62244  90.90038  84.78067  82.89429  77.39624
> colMin(tmp5)
 [1] 61.06473 59.35307 58.88750 56.39560 54.15374 58.92019 57.28933 58.17265
 [9] 56.95813 57.08509       NA 54.98240 64.30410 62.40215 55.63462 56.16687
[17] 57.70359 58.07452 54.04427 55.35897
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.0337
> Min(tmp5,na.rm=TRUE)
[1] 54.04427
> mean(tmp5,na.rm=TRUE)
[1] 72.88922
> Sum(tmp5,na.rm=TRUE)
[1] 14504.95
> Var(tmp5,na.rm=TRUE)
[1] 874.4151
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.99316 71.38906 75.37889 68.94396 70.80151 70.06056 71.60621 71.80274
 [9] 69.03544 69.77626
> rowSums(tmp5,na.rm=TRUE)
 [1] 1799.863 1427.781 1507.578 1378.879 1345.229 1401.211 1432.124 1436.055
 [9] 1380.709 1395.525
> rowVars(tmp5,na.rm=TRUE)
 [1] 8042.90965   77.15285   44.97954   57.61743   46.27259  105.45229
 [7]   72.78593   75.32983   97.95154  119.49988
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.682271  8.783669  6.706679  7.590615  6.802396 10.268996  8.531467
 [8]  8.679276  9.897047 10.931600
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.03372  85.97355  90.90038  81.54256  84.34986  95.47833  85.01566
 [8]  87.18504  89.63773  91.39254
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.63462 58.31142 64.33843 57.08509 61.85236 55.35897 58.04426 56.95813
 [9] 54.04427 54.15374
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.37696  73.03563  67.93404  67.52586  71.73846  74.07477  71.63508
 [8]  68.77155  69.32221  71.07113  74.23939  72.30165  70.49102  74.21331
[15]  70.98094  70.30596  70.67568  72.37085  67.91875  66.93611
> colSums(tmp5,na.rm=TRUE)
 [1] 1123.7696  730.3563  679.3404  675.2586  717.3846  740.7477  716.3508
 [8]  687.7155  693.2221  710.7113  668.1545  723.0165  704.9102  742.1331
[15]  709.8094  703.0596  706.7568  723.7085  679.1875  669.3611
> colVars(tmp5,na.rm=TRUE)
 [1] 15793.80927   141.86879    66.85697    50.51308    57.04009   115.65829
 [7]   131.64038    70.29153    48.66105    98.71317    71.65505    71.97742
[13]    42.27373    82.95398    61.42905    84.93942   112.45027    79.58010
[19]    86.25031    48.72313
> colSd(tmp5,na.rm=TRUE)
 [1] 125.673423  11.910869   8.176611   7.107255   7.552489  10.754454
 [7]  11.473464   8.384005   6.975747   9.935450   8.464931   8.483951
[13]   6.501825   9.107908   7.837669   9.216259  10.604257   8.920768
[19]   9.287104   6.980195
> colMax(tmp5,na.rm=TRUE)
 [1] 469.03372  91.39254  87.18504  77.41256  82.26168  89.63773  95.47833
 [8]  81.43842  80.51368  85.90993  86.53264  87.09670  84.05269  85.01566
[15]  79.63502  82.62244  90.90038  84.78067  82.89429  77.39624
> colMin(tmp5,na.rm=TRUE)
 [1] 61.06473 59.35307 58.88750 56.39560 54.15374 58.92019 57.28933 58.17265
 [9] 56.95813 57.08509 63.20342 54.98240 64.30410 62.40215 55.63462 56.16687
[17] 57.70359 58.07452 54.04427 55.35897
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.99316 71.38906 75.37889 68.94396      NaN 70.06056 71.60621 71.80274
 [9] 69.03544 69.77626
> rowSums(tmp5,na.rm=TRUE)
 [1] 1799.863 1427.781 1507.578 1378.879    0.000 1401.211 1432.124 1436.055
 [9] 1380.709 1395.525
> rowVars(tmp5,na.rm=TRUE)
 [1] 8042.90965   77.15285   44.97954   57.61743         NA  105.45229
 [7]   72.78593   75.32983   97.95154  119.49988
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.682271  8.783669  6.706679  7.590615        NA 10.268996  8.531467
 [8]  8.679276  9.897047 10.931600
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.03372  85.97355  90.90038  81.54256        NA  95.47833  85.01566
 [8]  87.18504  89.63773  91.39254
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.63462 58.31142 64.33843 57.08509       NA 55.35897 58.04426 56.95813
 [9] 54.04427 54.15374
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.16450  73.36075  68.60978  67.04788  71.36443  75.29261  71.60579
 [8]  68.51964  69.65067  70.29346       NaN  71.17487  71.17846  75.20892
[15]  71.70146  71.05918  70.54384  71.03985  68.21201  65.92423
> colSums(tmp5,na.rm=TRUE)
 [1] 1045.4805  660.2468  617.4880  603.4309  642.2799  677.6335  644.4521
 [8]  616.6768  626.8560  632.6411    0.0000  640.5739  640.6061  676.8803
[15]  645.3132  639.5326  634.8946  639.3586  613.9081  593.3181
> colVars(tmp5,na.rm=TRUE)
 [1] 17606.64890   158.41321    70.07704    54.25693    62.59625   113.43033
 [7]   148.08577    78.36407    53.53001   104.24862          NA    66.69129
[13]    42.24156    82.17177    63.26719    89.17432   126.31103    69.59752
[19]    96.06411    43.29455
> colSd(tmp5,na.rm=TRUE)
 [1] 132.690048  12.586231   8.371203   7.365931   7.911779  10.650367
 [7]  12.169050   8.852348   7.316420  10.210221         NA   8.166474
[13]   6.499351   9.064864   7.954067   9.443216  11.238818   8.342513
[19]   9.801230   6.579859
> colMax(tmp5,na.rm=TRUE)
 [1] 469.03372  91.39254  87.18504  77.41256  82.26168  89.63773  95.47833
 [8]  81.43842  80.51368  85.90993      -Inf  87.09670  84.05269  85.01566
[15]  79.63502  82.62244  90.90038  84.78067  82.89429  77.39624
> colMin(tmp5,na.rm=TRUE)
 [1] 61.06473 59.35307 58.88750 56.39560 54.15374 58.92019 57.28933 58.17265
 [9] 56.95813 57.08509      Inf 54.98240 64.54002 62.40215 55.63462 56.16687
[17] 57.70359 58.07452 54.04427 55.35897
> 
> 
> 
> 
> 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] 191.22590 349.23734 140.85146 192.19619 233.31077 140.17855 220.30465
 [8] 484.61502 307.30812  93.50804
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 191.22590 349.23734 140.85146 192.19619 233.31077 140.17855 220.30465
 [8] 484.61502 307.30812  93.50804
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.421085e-13 -1.136868e-13  1.421085e-13  1.421085e-13  2.842171e-14
 [6]  5.684342e-14 -5.684342e-14  1.136868e-13  9.947598e-14  1.136868e-13
[11] -5.684342e-14  5.684342e-14  1.421085e-13 -2.842171e-14  1.136868e-13
[16]  0.000000e+00 -2.842171e-14 -1.136868e-13  1.136868e-13  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   4 
1   10 
5   9 
4   14 
7   13 
4   16 
2   6 
7   6 
8   15 
3   15 
2   2 
4   5 
9   10 
7   5 
9   13 
1   4 
9   16 
7   5 
3   8 
3   17 
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.413917
> Min(tmp)
[1] -2.58916
> mean(tmp)
[1] 0.1027062
> Sum(tmp)
[1] 10.27062
> Var(tmp)
[1] 0.9820057
> 
> rowMeans(tmp)
[1] 0.1027062
> rowSums(tmp)
[1] 10.27062
> rowVars(tmp)
[1] 0.9820057
> rowSd(tmp)
[1] 0.990962
> rowMax(tmp)
[1] 2.413917
> rowMin(tmp)
[1] -2.58916
> 
> colMeans(tmp)
  [1] -0.77230658 -0.75125748 -0.18541607 -0.02322832  1.54200218 -0.49698357
  [7] -1.38746494 -0.50183047 -0.02371466  0.18760665 -0.80637185  0.01579363
 [13] -0.74618672 -2.58916000 -0.51564642 -0.14419381  0.82738463 -0.02315726
 [19] -0.94736382  0.57331282  0.15996312  0.47978819  1.11144928  1.34326211
 [25]  1.29930647 -2.47076686 -0.45140687 -0.61684257 -0.51973555 -0.87261147
 [31] -0.05283985  2.41391653 -0.83645405  1.18842989 -1.43354456  0.48970552
 [37]  0.95867748  0.57293307 -1.06745727 -0.58698136 -1.10742515  0.76131119
 [43]  0.58667671 -0.11892055 -1.17064262  0.45417485  1.46562768  0.78382528
 [49]  1.68964131  1.45823207  1.22100448  0.11961414  1.08551690  0.22149115
 [55]  0.09533596  1.05050658 -0.97987463  1.18892007 -0.60310503  1.22355150
 [61] -0.64148005  0.42012346  0.11308882  0.94653634  0.44517062 -1.29021925
 [67]  1.56609677  0.50036867 -0.94801352 -1.02677579  0.96953061 -0.52711141
 [73] -0.66445723  0.23860406 -0.02692245 -1.42088859  2.09689474  0.20439519
 [79]  0.19192552 -1.10068360  0.88370456  0.90587034 -0.09356482 -0.35075801
 [85]  0.79879271 -0.32459698  0.76699366 -1.71443170  0.42438475  2.27066632
 [91] -1.52676397  0.30365230  0.87414119  1.36902054  1.41409217  0.80467832
 [97] -0.32630193 -0.26277853  0.43876641 -0.19719849
> colSums(tmp)
  [1] -0.77230658 -0.75125748 -0.18541607 -0.02322832  1.54200218 -0.49698357
  [7] -1.38746494 -0.50183047 -0.02371466  0.18760665 -0.80637185  0.01579363
 [13] -0.74618672 -2.58916000 -0.51564642 -0.14419381  0.82738463 -0.02315726
 [19] -0.94736382  0.57331282  0.15996312  0.47978819  1.11144928  1.34326211
 [25]  1.29930647 -2.47076686 -0.45140687 -0.61684257 -0.51973555 -0.87261147
 [31] -0.05283985  2.41391653 -0.83645405  1.18842989 -1.43354456  0.48970552
 [37]  0.95867748  0.57293307 -1.06745727 -0.58698136 -1.10742515  0.76131119
 [43]  0.58667671 -0.11892055 -1.17064262  0.45417485  1.46562768  0.78382528
 [49]  1.68964131  1.45823207  1.22100448  0.11961414  1.08551690  0.22149115
 [55]  0.09533596  1.05050658 -0.97987463  1.18892007 -0.60310503  1.22355150
 [61] -0.64148005  0.42012346  0.11308882  0.94653634  0.44517062 -1.29021925
 [67]  1.56609677  0.50036867 -0.94801352 -1.02677579  0.96953061 -0.52711141
 [73] -0.66445723  0.23860406 -0.02692245 -1.42088859  2.09689474  0.20439519
 [79]  0.19192552 -1.10068360  0.88370456  0.90587034 -0.09356482 -0.35075801
 [85]  0.79879271 -0.32459698  0.76699366 -1.71443170  0.42438475  2.27066632
 [91] -1.52676397  0.30365230  0.87414119  1.36902054  1.41409217  0.80467832
 [97] -0.32630193 -0.26277853  0.43876641 -0.19719849
> 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.77230658 -0.75125748 -0.18541607 -0.02322832  1.54200218 -0.49698357
  [7] -1.38746494 -0.50183047 -0.02371466  0.18760665 -0.80637185  0.01579363
 [13] -0.74618672 -2.58916000 -0.51564642 -0.14419381  0.82738463 -0.02315726
 [19] -0.94736382  0.57331282  0.15996312  0.47978819  1.11144928  1.34326211
 [25]  1.29930647 -2.47076686 -0.45140687 -0.61684257 -0.51973555 -0.87261147
 [31] -0.05283985  2.41391653 -0.83645405  1.18842989 -1.43354456  0.48970552
 [37]  0.95867748  0.57293307 -1.06745727 -0.58698136 -1.10742515  0.76131119
 [43]  0.58667671 -0.11892055 -1.17064262  0.45417485  1.46562768  0.78382528
 [49]  1.68964131  1.45823207  1.22100448  0.11961414  1.08551690  0.22149115
 [55]  0.09533596  1.05050658 -0.97987463  1.18892007 -0.60310503  1.22355150
 [61] -0.64148005  0.42012346  0.11308882  0.94653634  0.44517062 -1.29021925
 [67]  1.56609677  0.50036867 -0.94801352 -1.02677579  0.96953061 -0.52711141
 [73] -0.66445723  0.23860406 -0.02692245 -1.42088859  2.09689474  0.20439519
 [79]  0.19192552 -1.10068360  0.88370456  0.90587034 -0.09356482 -0.35075801
 [85]  0.79879271 -0.32459698  0.76699366 -1.71443170  0.42438475  2.27066632
 [91] -1.52676397  0.30365230  0.87414119  1.36902054  1.41409217  0.80467832
 [97] -0.32630193 -0.26277853  0.43876641 -0.19719849
> colMin(tmp)
  [1] -0.77230658 -0.75125748 -0.18541607 -0.02322832  1.54200218 -0.49698357
  [7] -1.38746494 -0.50183047 -0.02371466  0.18760665 -0.80637185  0.01579363
 [13] -0.74618672 -2.58916000 -0.51564642 -0.14419381  0.82738463 -0.02315726
 [19] -0.94736382  0.57331282  0.15996312  0.47978819  1.11144928  1.34326211
 [25]  1.29930647 -2.47076686 -0.45140687 -0.61684257 -0.51973555 -0.87261147
 [31] -0.05283985  2.41391653 -0.83645405  1.18842989 -1.43354456  0.48970552
 [37]  0.95867748  0.57293307 -1.06745727 -0.58698136 -1.10742515  0.76131119
 [43]  0.58667671 -0.11892055 -1.17064262  0.45417485  1.46562768  0.78382528
 [49]  1.68964131  1.45823207  1.22100448  0.11961414  1.08551690  0.22149115
 [55]  0.09533596  1.05050658 -0.97987463  1.18892007 -0.60310503  1.22355150
 [61] -0.64148005  0.42012346  0.11308882  0.94653634  0.44517062 -1.29021925
 [67]  1.56609677  0.50036867 -0.94801352 -1.02677579  0.96953061 -0.52711141
 [73] -0.66445723  0.23860406 -0.02692245 -1.42088859  2.09689474  0.20439519
 [79]  0.19192552 -1.10068360  0.88370456  0.90587034 -0.09356482 -0.35075801
 [85]  0.79879271 -0.32459698  0.76699366 -1.71443170  0.42438475  2.27066632
 [91] -1.52676397  0.30365230  0.87414119  1.36902054  1.41409217  0.80467832
 [97] -0.32630193 -0.26277853  0.43876641 -0.19719849
> colMedians(tmp)
  [1] -0.77230658 -0.75125748 -0.18541607 -0.02322832  1.54200218 -0.49698357
  [7] -1.38746494 -0.50183047 -0.02371466  0.18760665 -0.80637185  0.01579363
 [13] -0.74618672 -2.58916000 -0.51564642 -0.14419381  0.82738463 -0.02315726
 [19] -0.94736382  0.57331282  0.15996312  0.47978819  1.11144928  1.34326211
 [25]  1.29930647 -2.47076686 -0.45140687 -0.61684257 -0.51973555 -0.87261147
 [31] -0.05283985  2.41391653 -0.83645405  1.18842989 -1.43354456  0.48970552
 [37]  0.95867748  0.57293307 -1.06745727 -0.58698136 -1.10742515  0.76131119
 [43]  0.58667671 -0.11892055 -1.17064262  0.45417485  1.46562768  0.78382528
 [49]  1.68964131  1.45823207  1.22100448  0.11961414  1.08551690  0.22149115
 [55]  0.09533596  1.05050658 -0.97987463  1.18892007 -0.60310503  1.22355150
 [61] -0.64148005  0.42012346  0.11308882  0.94653634  0.44517062 -1.29021925
 [67]  1.56609677  0.50036867 -0.94801352 -1.02677579  0.96953061 -0.52711141
 [73] -0.66445723  0.23860406 -0.02692245 -1.42088859  2.09689474  0.20439519
 [79]  0.19192552 -1.10068360  0.88370456  0.90587034 -0.09356482 -0.35075801
 [85]  0.79879271 -0.32459698  0.76699366 -1.71443170  0.42438475  2.27066632
 [91] -1.52676397  0.30365230  0.87414119  1.36902054  1.41409217  0.80467832
 [97] -0.32630193 -0.26277853  0.43876641 -0.19719849
> colRanges(tmp)
           [,1]       [,2]       [,3]        [,4]     [,5]       [,6]      [,7]
[1,] -0.7723066 -0.7512575 -0.1854161 -0.02322832 1.542002 -0.4969836 -1.387465
[2,] -0.7723066 -0.7512575 -0.1854161 -0.02322832 1.542002 -0.4969836 -1.387465
           [,8]        [,9]     [,10]      [,11]      [,12]      [,13]    [,14]
[1,] -0.5018305 -0.02371466 0.1876066 -0.8063718 0.01579363 -0.7461867 -2.58916
[2,] -0.5018305 -0.02371466 0.1876066 -0.8063718 0.01579363 -0.7461867 -2.58916
          [,15]      [,16]     [,17]       [,18]      [,19]     [,20]     [,21]
[1,] -0.5156464 -0.1441938 0.8273846 -0.02315726 -0.9473638 0.5733128 0.1599631
[2,] -0.5156464 -0.1441938 0.8273846 -0.02315726 -0.9473638 0.5733128 0.1599631
         [,22]    [,23]    [,24]    [,25]     [,26]      [,27]      [,28]
[1,] 0.4797882 1.111449 1.343262 1.299306 -2.470767 -0.4514069 -0.6168426
[2,] 0.4797882 1.111449 1.343262 1.299306 -2.470767 -0.4514069 -0.6168426
          [,29]      [,30]       [,31]    [,32]      [,33]   [,34]     [,35]
[1,] -0.5197355 -0.8726115 -0.05283985 2.413917 -0.8364541 1.18843 -1.433545
[2,] -0.5197355 -0.8726115 -0.05283985 2.413917 -0.8364541 1.18843 -1.433545
         [,36]     [,37]     [,38]     [,39]      [,40]     [,41]     [,42]
[1,] 0.4897055 0.9586775 0.5729331 -1.067457 -0.5869814 -1.107425 0.7613112
[2,] 0.4897055 0.9586775 0.5729331 -1.067457 -0.5869814 -1.107425 0.7613112
         [,43]      [,44]     [,45]     [,46]    [,47]     [,48]    [,49]
[1,] 0.5866767 -0.1189205 -1.170643 0.4541748 1.465628 0.7838253 1.689641
[2,] 0.5866767 -0.1189205 -1.170643 0.4541748 1.465628 0.7838253 1.689641
        [,50]    [,51]     [,52]    [,53]     [,54]      [,55]    [,56]
[1,] 1.458232 1.221004 0.1196141 1.085517 0.2214912 0.09533596 1.050507
[2,] 1.458232 1.221004 0.1196141 1.085517 0.2214912 0.09533596 1.050507
          [,57]   [,58]     [,59]    [,60]    [,61]     [,62]     [,63]
[1,] -0.9798746 1.18892 -0.603105 1.223552 -0.64148 0.4201235 0.1130888
[2,] -0.9798746 1.18892 -0.603105 1.223552 -0.64148 0.4201235 0.1130888
         [,64]     [,65]     [,66]    [,67]     [,68]      [,69]     [,70]
[1,] 0.9465363 0.4451706 -1.290219 1.566097 0.5003687 -0.9480135 -1.026776
[2,] 0.9465363 0.4451706 -1.290219 1.566097 0.5003687 -0.9480135 -1.026776
         [,71]      [,72]      [,73]     [,74]       [,75]     [,76]    [,77]
[1,] 0.9695306 -0.5271114 -0.6644572 0.2386041 -0.02692245 -1.420889 2.096895
[2,] 0.9695306 -0.5271114 -0.6644572 0.2386041 -0.02692245 -1.420889 2.096895
         [,78]     [,79]     [,80]     [,81]     [,82]       [,83]     [,84]
[1,] 0.2043952 0.1919255 -1.100684 0.8837046 0.9058703 -0.09356482 -0.350758
[2,] 0.2043952 0.1919255 -1.100684 0.8837046 0.9058703 -0.09356482 -0.350758
         [,85]     [,86]     [,87]     [,88]     [,89]    [,90]     [,91]
[1,] 0.7987927 -0.324597 0.7669937 -1.714432 0.4243848 2.270666 -1.526764
[2,] 0.7987927 -0.324597 0.7669937 -1.714432 0.4243848 2.270666 -1.526764
         [,92]     [,93]    [,94]    [,95]     [,96]      [,97]      [,98]
[1,] 0.3036523 0.8741412 1.369021 1.414092 0.8046783 -0.3263019 -0.2627785
[2,] 0.3036523 0.8741412 1.369021 1.414092 0.8046783 -0.3263019 -0.2627785
         [,99]     [,100]
[1,] 0.4387664 -0.1971985
[2,] 0.4387664 -0.1971985
> 
> 
> Max(tmp2)
[1] 2.689517
> Min(tmp2)
[1] -2.008832
> mean(tmp2)
[1] 0.2143694
> Sum(tmp2)
[1] 21.43694
> Var(tmp2)
[1] 0.6737114
> 
> rowMeans(tmp2)
  [1]  0.007744053 -0.591952238  0.595340542  0.674818669 -0.260266790
  [6] -0.023595295 -0.472873273 -1.021032675  0.929116923  1.243218891
 [11]  1.303301237  0.480327215  0.401815207  0.073862888  0.713218978
 [16]  1.115286345  1.340548292 -0.182964555  0.653633124 -0.031744117
 [21] -0.248290336  0.635887580 -0.369157912 -0.713771067  1.071539124
 [26]  0.615604850  0.433257001  2.689516741 -1.228958756 -0.683403563
 [31]  0.138358487 -0.468139264  1.079766762  0.033392196  2.595320184
 [36]  0.631952681  0.171107792  0.350246808 -1.201613600  1.419029857
 [41] -0.859296327 -0.269961463  0.907923071  0.365210427  1.140924308
 [46] -0.475785079  0.346300474  1.152535718  0.885977547 -0.944178243
 [51] -0.119282267 -1.160580668 -0.130195153  0.125693435 -0.329433160
 [56] -0.967112820 -0.885136953 -0.262128379 -0.019420321 -1.358597839
 [61]  0.405858235  1.547198803  1.187412298  1.263652752 -1.496966262
 [66] -0.551391222 -0.203957898  0.245610336 -0.491481814  1.150643758
 [71] -0.065993029 -2.008831635  0.282659989  0.589320222  0.076164815
 [76]  1.321522200  0.364249910  0.398401368  0.547207082 -0.449648903
 [81] -0.623200999  0.636250651 -0.495665489  0.159428220  1.583174095
 [86]  0.440494670  0.896020744  0.884903144  0.490282552  0.107043389
 [91] -0.050426381 -0.233545376 -0.319839078  0.351521122  0.489191484
 [96]  0.260751560  0.778554068  0.405757823 -0.307928614  0.829632633
> rowSums(tmp2)
  [1]  0.007744053 -0.591952238  0.595340542  0.674818669 -0.260266790
  [6] -0.023595295 -0.472873273 -1.021032675  0.929116923  1.243218891
 [11]  1.303301237  0.480327215  0.401815207  0.073862888  0.713218978
 [16]  1.115286345  1.340548292 -0.182964555  0.653633124 -0.031744117
 [21] -0.248290336  0.635887580 -0.369157912 -0.713771067  1.071539124
 [26]  0.615604850  0.433257001  2.689516741 -1.228958756 -0.683403563
 [31]  0.138358487 -0.468139264  1.079766762  0.033392196  2.595320184
 [36]  0.631952681  0.171107792  0.350246808 -1.201613600  1.419029857
 [41] -0.859296327 -0.269961463  0.907923071  0.365210427  1.140924308
 [46] -0.475785079  0.346300474  1.152535718  0.885977547 -0.944178243
 [51] -0.119282267 -1.160580668 -0.130195153  0.125693435 -0.329433160
 [56] -0.967112820 -0.885136953 -0.262128379 -0.019420321 -1.358597839
 [61]  0.405858235  1.547198803  1.187412298  1.263652752 -1.496966262
 [66] -0.551391222 -0.203957898  0.245610336 -0.491481814  1.150643758
 [71] -0.065993029 -2.008831635  0.282659989  0.589320222  0.076164815
 [76]  1.321522200  0.364249910  0.398401368  0.547207082 -0.449648903
 [81] -0.623200999  0.636250651 -0.495665489  0.159428220  1.583174095
 [86]  0.440494670  0.896020744  0.884903144  0.490282552  0.107043389
 [91] -0.050426381 -0.233545376 -0.319839078  0.351521122  0.489191484
 [96]  0.260751560  0.778554068  0.405757823 -0.307928614  0.829632633
> 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.007744053 -0.591952238  0.595340542  0.674818669 -0.260266790
  [6] -0.023595295 -0.472873273 -1.021032675  0.929116923  1.243218891
 [11]  1.303301237  0.480327215  0.401815207  0.073862888  0.713218978
 [16]  1.115286345  1.340548292 -0.182964555  0.653633124 -0.031744117
 [21] -0.248290336  0.635887580 -0.369157912 -0.713771067  1.071539124
 [26]  0.615604850  0.433257001  2.689516741 -1.228958756 -0.683403563
 [31]  0.138358487 -0.468139264  1.079766762  0.033392196  2.595320184
 [36]  0.631952681  0.171107792  0.350246808 -1.201613600  1.419029857
 [41] -0.859296327 -0.269961463  0.907923071  0.365210427  1.140924308
 [46] -0.475785079  0.346300474  1.152535718  0.885977547 -0.944178243
 [51] -0.119282267 -1.160580668 -0.130195153  0.125693435 -0.329433160
 [56] -0.967112820 -0.885136953 -0.262128379 -0.019420321 -1.358597839
 [61]  0.405858235  1.547198803  1.187412298  1.263652752 -1.496966262
 [66] -0.551391222 -0.203957898  0.245610336 -0.491481814  1.150643758
 [71] -0.065993029 -2.008831635  0.282659989  0.589320222  0.076164815
 [76]  1.321522200  0.364249910  0.398401368  0.547207082 -0.449648903
 [81] -0.623200999  0.636250651 -0.495665489  0.159428220  1.583174095
 [86]  0.440494670  0.896020744  0.884903144  0.490282552  0.107043389
 [91] -0.050426381 -0.233545376 -0.319839078  0.351521122  0.489191484
 [96]  0.260751560  0.778554068  0.405757823 -0.307928614  0.829632633
> rowMin(tmp2)
  [1]  0.007744053 -0.591952238  0.595340542  0.674818669 -0.260266790
  [6] -0.023595295 -0.472873273 -1.021032675  0.929116923  1.243218891
 [11]  1.303301237  0.480327215  0.401815207  0.073862888  0.713218978
 [16]  1.115286345  1.340548292 -0.182964555  0.653633124 -0.031744117
 [21] -0.248290336  0.635887580 -0.369157912 -0.713771067  1.071539124
 [26]  0.615604850  0.433257001  2.689516741 -1.228958756 -0.683403563
 [31]  0.138358487 -0.468139264  1.079766762  0.033392196  2.595320184
 [36]  0.631952681  0.171107792  0.350246808 -1.201613600  1.419029857
 [41] -0.859296327 -0.269961463  0.907923071  0.365210427  1.140924308
 [46] -0.475785079  0.346300474  1.152535718  0.885977547 -0.944178243
 [51] -0.119282267 -1.160580668 -0.130195153  0.125693435 -0.329433160
 [56] -0.967112820 -0.885136953 -0.262128379 -0.019420321 -1.358597839
 [61]  0.405858235  1.547198803  1.187412298  1.263652752 -1.496966262
 [66] -0.551391222 -0.203957898  0.245610336 -0.491481814  1.150643758
 [71] -0.065993029 -2.008831635  0.282659989  0.589320222  0.076164815
 [76]  1.321522200  0.364249910  0.398401368  0.547207082 -0.449648903
 [81] -0.623200999  0.636250651 -0.495665489  0.159428220  1.583174095
 [86]  0.440494670  0.896020744  0.884903144  0.490282552  0.107043389
 [91] -0.050426381 -0.233545376 -0.319839078  0.351521122  0.489191484
 [96]  0.260751560  0.778554068  0.405757823 -0.307928614  0.829632633
> 
> colMeans(tmp2)
[1] 0.2143694
> colSums(tmp2)
[1] 21.43694
> colVars(tmp2)
[1] 0.6737114
> colSd(tmp2)
[1] 0.8207992
> colMax(tmp2)
[1] 2.689517
> colMin(tmp2)
[1] -2.008832
> colMedians(tmp2)
[1] 0.2531809
> colRanges(tmp2)
          [,1]
[1,] -2.008832
[2,]  2.689517
> 
> 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] -1.07071028  3.52609428 -0.03831111  1.56574342  2.98376591  5.60088783
 [7]  0.25393573 -0.68722763 -3.16486150 -5.52770715
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.98953959
[2,] -0.67918172
[3,] -0.04065358
[4,]  0.40374731
[5,]  0.84870834
> 
> rowApply(tmp,sum)
 [1]  1.54984204 -5.94246307  1.35421357  2.56419549  2.81625712  0.91569372
 [7] -0.51490867  0.04692501  1.48983742 -0.83798314
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    7    5    4    7    1    7   10    3     3
 [2,]    7    9   10    2    6    5    9    3    9     8
 [3,]   10    6    3    7    9    9    1    5    4     5
 [4,]    9    2    4    9    4    6    5    9    5     9
 [5,]    5    3    2   10    3   10    2    6    6    10
 [6,]    2   10    9    8    8    4    8    4   10     7
 [7,]    4    5    1    6    5    3   10    2    7     4
 [8,]    6    4    8    3   10    7    6    8    2     2
 [9,]    1    8    6    1    1    2    4    7    1     6
[10,]    3    1    7    5    2    8    3    1    8     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.606704e+00 -2.191438e+00 -3.366250e-01 -5.929937e-05  2.565252e+00
 [6]  2.013765e-01  1.766818e+00 -3.299363e+00 -3.438975e+00  6.264983e-01
[11]  3.048710e+00 -3.122798e-01 -1.672171e+00 -2.629509e+00 -5.861959e+00
[16]  6.005086e-02 -1.239032e+00  1.747208e+00 -7.912324e-01 -1.393890e+00
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1938667
[2,]  0.6969757
[3,]  1.0153944
[4,]  1.2207753
[5,]  1.8674259
> 
> rowApply(tmp,sum)
[1] -0.3366117 -4.6443614 -2.1048302  0.6482734 -2.1063856
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   17   10   15   17   19
[2,]    8    1   10   15   10
[3,]    2   18   17    3   15
[4,]   12   11   16   10    8
[5,]    3   15   19   14   18
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]        [,4]       [,5]        [,6]
[1,]  1.0153944 -0.5996495 -1.5876507  0.03117982 -1.0941493 -0.02026725
[2,] -0.1938667 -2.2229416  1.0630542 -0.12087473  0.4076336 -1.07981537
[3,]  0.6969757 -0.1983875  0.7793155  0.73409200  1.3817944  0.13227538
[4,]  1.2207753  1.0273387 -1.2209263 -0.09992455  0.6742150  1.79131377
[5,]  1.8674259 -0.1977979  0.6295823 -0.54453183  1.1957579 -0.62213005
            [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -0.04569931  1.1979981 -0.9195888  0.70991764  1.0134845 -0.6925137
[2,]  1.26810176 -1.6130139 -0.3028266  0.95343208  1.3113810  0.8415403
[3,] -1.09586006 -2.1932331  0.1259097 -0.29767237 -1.1207852 -0.5691463
[4,]  1.02833622 -1.0217416 -1.0026488 -0.83392401  2.8174545 -2.0276665
[5,]  0.61193976  0.3306277 -1.3398202  0.09474494 -0.9728247  2.1355064
          [,13]      [,14]       [,15]      [,16]        [,17]       [,18]
[1,]  1.2354663  1.2846192 -1.63705687  0.1892608 -0.002442166 -0.60015013
[2,]  0.3736412 -1.3894986 -1.26869720 -1.7156156  0.313536364 -0.40900346
[3,]  0.5662786  0.1471471 -1.53294733 -1.1201760 -0.690926747  2.08266034
[4,] -0.6580594 -0.9723636 -1.51531722  1.8701523 -0.068030439  0.01767057
[5,] -3.1894973 -1.6994134  0.09205944  0.8364293 -0.791169198  0.65603044
          [,19]       [,20]
[1,]  0.8029086 -0.61767330
[2,] -0.8862642  0.02573602
[3,]  0.8825800 -0.81472438
[4,] -0.6302090  0.25182857
[5,] -0.9602478 -0.23905721
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2      col3       col4      col5      col6     col7
row1 0.3768937 1.638743 -1.215039 -0.6689996 0.5914061 -0.683199 1.028494
           col8        col9      col10    col11     col12    col13     col14
row1 -0.1717831 -0.05018495 -0.3585846 1.590723 -1.013061 1.091576 0.5272803
         col15      col16    col17    col18      col19   col20
row1 0.2156961 -0.7461668 0.223029 1.600489 -0.9801789 1.02791
> tmp[,"col10"]
          col10
row1 -0.3585846
row2  0.6866988
row3  1.0939823
row4 -2.0287255
row5 -1.4475553
> tmp[c("row1","row5"),]
          col1       col2      col3       col4      col5      col6        col7
row1 0.3768937  1.6387427 -1.215039 -0.6689996 0.5914061 -0.683199  1.02849414
row5 1.8595642 -0.2822902  1.325591 -0.1472374 1.3658404 -1.449963 -0.06200609
           col8        col9      col10      col11     col12     col13
row1 -0.1717831 -0.05018495 -0.3585846  1.5907235 -1.013061 1.0915755
row5 -1.7869539  0.30094288 -1.4475553 -0.1259027 -2.166994 0.4127158
          col14     col15      col16      col17      col18      col19
row1  0.5272803 0.2156961 -0.7461668  0.2230290  1.6004893 -0.9801789
row5 -0.0448244 1.1382228 -0.7589478 -0.3541132 -0.4923265 -0.1760045
           col20
row1  1.02790980
row5 -0.04191003
> tmp[,c("col6","col20")]
           col6       col20
row1 -0.6831990  1.02790980
row2  0.7270493 -0.45448138
row3  0.5067656 -0.51253339
row4 -0.4885695 -0.66979964
row5 -1.4499634 -0.04191003
> tmp[c("row1","row5"),c("col6","col20")]
          col6       col20
row1 -0.683199  1.02790980
row5 -1.449963 -0.04191003
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3     col4     col5    col6     col7     col8
row1 49.27662 50.85556 47.41074 50.15545 49.76515 105.768 49.01174 50.83474
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.87831 47.91808 48.70917 49.90001 50.02998 50.23448 49.33871 49.48325
        col17    col18    col19    col20
row1 51.01047 48.19635 49.68456 106.1994
> tmp[,"col10"]
        col10
row1 47.91808
row2 30.49493
row3 28.86661
row4 30.18776
row5 52.56305
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.27662 50.85556 47.41074 50.15545 49.76515 105.7680 49.01174 50.83474
row5 51.01299 51.23174 51.92168 48.73780 50.80572 104.6176 49.46173 50.63371
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.87831 47.91808 48.70917 49.90001 50.02998 50.23448 49.33871 49.48325
row5 51.46435 52.56305 50.82289 47.90560 48.18645 51.55539 49.60476 50.80650
        col17    col18    col19    col20
row1 51.01047 48.19635 49.68456 106.1994
row5 50.09028 48.33087 47.58602 103.8291
> tmp[,c("col6","col20")]
          col6     col20
row1 105.76798 106.19937
row2  76.14900  74.79493
row3  76.52228  74.34067
row4  74.58624  74.46920
row5 104.61760 103.82905
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7680 106.1994
row5 104.6176 103.8291
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7680 106.1994
row5 104.6176 103.8291
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.3930548
[2,] -0.5728722
[3,] -1.5188732
[4,] -0.2624557
[5,] -0.2052780
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.5125632  0.06756412
[2,]  1.1589388 -0.65654912
[3,]  1.1173230 -0.46205598
[4,] -0.6471841  0.03525412
[5,] -0.0522316  1.00133560
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.76983055  0.5034170
[2,] -0.41620757  0.5849640
[3,]  0.03344779 -0.7293052
[4,] -1.08569690 -1.4184855
[5,]  0.50533211  0.1962718
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.7698305
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.7698305
[2,] -0.4162076
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3  0.1959864 -2.1713704 -0.3314154 -0.8226735 -1.2357549  0.9375554
row1 -0.5424274 -0.7032724 -0.9831599 -0.1203631 -0.2154912 -0.4512512
           [,7]        [,8]        [,9]      [,10]     [,11]      [,12]
row3 1.77754394 -0.98999439 -0.04404288 -0.2089625 0.3875419  0.6020302
row1 0.01637004  0.08307587 -0.86993921  0.4284599 2.0446504 -0.6818614
          [,13]      [,14]     [,15]      [,16]      [,17]     [,18]      [,19]
row3  0.9568196 -0.1176856 0.3945884 0.01309039 -0.1912647 -2.149098 -0.5215430
row1 -1.2900184 -0.1785346 1.3423110 0.85336834  0.8965679  1.373967  0.6332313
           [,20]
row3 -0.04449863
row1 -0.89135469
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]       [,3]       [,4]      [,5]     [,6]        [,7]
row2 0.7780084 0.09201129 -0.1866156 -0.3814467 -1.326071 -2.43203 -0.07206164
          [,8]     [,9]    [,10]
row2 -1.671375 1.258766 2.681048
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]     [,3]      [,4]      [,5]     [,6]      [,7]
row5 1.278507 0.4627211 1.015857 0.5902035 -1.239517 1.034913 -1.046362
          [,8]      [,9]     [,10]    [,11]   [,12]     [,13]    [,14]
row5 0.6084373 0.9318177 0.8878956 0.952094 0.26515 0.3814306 1.098239
         [,15]     [,16]    [,17]      [,18]      [,19]     [,20]
row5 0.7001606 -1.038518 -1.12344 -0.2322372 -0.9656001 -1.044714
> 
> 
> 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: 0x600002078600>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe310237a6307"
 [2] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe31037fb72c3"
 [3] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe3105d2b7ceb"
 [4] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe31052165816"
 [5] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe31038f13674"
 [6] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe310642e16e0"
 [7] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe310ddfff82" 
 [8] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe3106cffb6eb"
 [9] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe3108423635" 
[10] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe31032f4d5cf"
[11] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe3106801232b"
[12] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe31022ac1165"
[13] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe3104eaa0fab"
[14] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe3107eeacbe5"
[15] "/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BMe31068f0687b"
> 
> 
> ### 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: 0x60000206ccc0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000206ccc0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000206ccc0>
> rowMedians(tmp)
  [1] -0.2733306915 -0.2138925767 -0.1045233924 -0.1412274570 -0.1143872613
  [6] -0.2301515190 -0.0674470038 -0.3561554327  0.4008261400  0.8532584498
 [11]  0.1631114066 -0.5978157691  0.2007881217  0.7466431039 -0.4131473419
 [16]  0.2328673813  0.2342781127  0.1811472607 -0.0346660260  0.0431174947
 [21]  0.3115285115 -0.5932369728 -0.4251323947  0.0408162249  0.1562468664
 [26]  0.0827660531  0.0797292415 -0.0138960230 -0.0712293550 -0.0731393605
 [31]  0.3496295225 -0.1722092664 -0.1449187404  0.1404211668  0.2737139624
 [36]  0.3217220483  0.2470668707 -0.1879118111  0.1311284469 -0.4618036494
 [41] -0.3625557605  0.2014107764 -0.0862934249  0.8328051583  0.2865040575
 [46] -0.3977542980  0.1302399518 -0.3938183972  0.1397931099  0.3359439644
 [51] -0.2655876681 -0.3674094597  0.1545433290  0.1524117132  0.0441276757
 [56]  0.1774113197  0.0006987812  0.1329564677 -0.2553916920  0.1901816937
 [61] -0.1425156124 -0.2279600844  0.3015396265 -0.2895801705  0.9313424163
 [66]  0.1473664491  0.3205299028  0.2565063894  0.0959350062  0.2704258837
 [71]  0.1812922689  0.6288860390  0.1964333314 -0.3320428226  0.0946343897
 [76] -0.3100640119  0.4412635159  0.1316360784 -0.2323612117  0.6680021998
 [81]  0.3885410698 -0.6004237970  0.3357539632  0.1933498824  0.2381222106
 [86] -0.2851351342  0.0291276586  0.2248595662  0.3109348735  0.1467220391
 [91] -0.1296240425 -0.4617351036 -0.2351134394  0.2892941888 -0.6199566872
 [96] -0.1617034502  0.2795352971 -0.4482335478  0.1609031589  0.3240401960
[101] -0.0989762945  0.1948059346  0.1838732279  0.6493108558 -0.1973777358
[106] -0.7923510507  0.1367344730 -0.3123009921 -0.1996064020 -0.1612087833
[111] -0.4171601795  0.0264098417  0.0066474893 -0.4011673329 -0.2847363590
[116]  0.2970950187  0.1488629173 -0.0974855123 -0.2837756572  0.0386510681
[121]  0.0121556993 -0.0092058000 -0.3279958358  0.0887992626 -0.4870070297
[126]  0.0916919792  0.0229328227  0.2642552123  0.0734812001  0.4025469665
[131]  0.3501549448 -0.0409504923 -0.0867321914  0.1599324486 -0.0948709105
[136] -0.2957193938 -0.4105792265 -0.4050002947 -0.1063761392 -0.3162387132
[141]  0.1888561738 -0.2923600906 -0.3272271036 -0.1613781302  0.2959514790
[146] -0.6609291221  0.3442197695  0.3167082554  0.6457883036 -0.2583185528
[151]  0.0102360417  0.3084175496 -0.2700520990  0.0245821733  0.1332653113
[156] -0.4786517440 -0.7222529492 -0.5092064248 -0.2150228201  0.1118044788
[161] -0.1463668622  0.5713977219 -0.1259742498  0.3327564786 -0.4685832410
[166] -0.3512949303 -0.0039355733 -0.0233510466 -0.1712480243 -0.1493946628
[171] -0.1849405644  0.6041040478 -0.0864164754 -0.1752744569  0.0522959718
[176]  0.3781931076  0.4997341464  0.2200462934  0.2266256493  0.2308185539
[181]  0.1412600871  0.1759331354 -0.1677302137  0.1699087112  0.7757051149
[186] -0.2097582405  0.0226111012 -0.6206132900 -0.2497657985  0.3284152082
[191] -0.1951449521  0.1653217077  0.0371469274  0.0316977111 -0.0526070202
[196]  0.2076119078  0.1007865908  0.1419647833 -0.0064361561  0.1149669992
[201]  0.2853467281 -0.1758755403  0.0255272379 -0.3067361458  0.0149848064
[206]  0.0010951164  0.0101170316  0.1366957657 -0.3243723094  0.0045565089
[211] -0.1117419113  0.0622967149 -0.4929578221  0.7486937581 -0.2044765066
[216] -0.2760136205  0.0003300573 -0.3238106500 -0.5275193478  0.6459060766
[221]  0.4481736076 -0.1466718008  0.2874629435 -0.3655956653 -0.3808281849
[226] -0.1843236953 -0.1198406379 -0.1680740260 -0.1233858096  0.2188915910
> 
> proc.time()
   user  system elapsed 
  2.256   8.333  12.288 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x600002b441e0>
> .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: 0x600002b441e0>
> .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: 0x600002b441e0>
> .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: 0x600002b441e0>
> 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: 0x600002b642a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b642a0>
> .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: 0x600002b642a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b642a0>
> .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: 0x600002b642a0>
> 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: 0x600002b64480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b64480>
> .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: 0x600002b64480>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002b64480>
> .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: 0x600002b64480>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600002b64480>
> .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: 0x600002b64480>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600002b64480>
> .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: 0x600002b64480>
> 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: 0x600002b64660>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002b64660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b64660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b64660>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee33f4ab2c0b5" "BufferedMatrixFilee33f5f60c726"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee33f4ab2c0b5" "BufferedMatrixFilee33f5f60c726"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b64900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b64900>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002b64900>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002b64900>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002b64900>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002b64900>
> .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: 0x600002b64ae0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002b64ae0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002b64ae0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002b64ae0>
> 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: 0x600002b64cc0>
> .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: 0x600002b64cc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.361   0.142   0.502 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.358   0.087   0.459 

Example timings