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

This page was generated on 2025-02-06 12:07 -0500 (Thu, 06 Feb 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4753
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4501
merida1macOS 12.7.5 Montereyx86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4524
kjohnson1macOS 13.6.6 Venturaarm644.4.2 (2024-10-31) -- "Pile of Leaves" 4476
taishanLinux (openEuler 24.03 LTS)aarch644.4.2 (2024-10-31) -- "Pile of Leaves" 4407
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 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-02-03 13:00 -0500 (Mon, 03 Feb 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows 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
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on merida1

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.70.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.70.0.tar.gz
StartedAt: 2025-02-04 00:39:48 -0500 (Tue, 04 Feb 2025)
EndedAt: 2025-02-04 00:41:14 -0500 (Tue, 04 Feb 2025)
EllapsedTime: 85.4 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.70.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.2 (2024-10-31)
* using platform: x86_64-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 Monterey 12.7.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.70.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.20-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
* used SDK: ‘MacOSX11.3.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking 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.20-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-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/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 x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/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-x86_64/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.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-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.602   0.212   0.831 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-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.20-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 474188 25.4    1035498 55.4         NA   638648 34.2
Vcells 877698  6.7    8388608 64.0      65536  2071806 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] "Tue Feb  4 00:40:30 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Feb  4 00:40:31 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x6000014bc000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Feb  4 00:40:37 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Feb  4 00:40:40 2025"
> 
> ColMode(tmp2)
<pointer: 0x6000014bc000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]       [,4]
[1,] 99.5140915 -0.3685723 -0.6249777  0.7070072
[2,]  1.3153707 -1.2812095  0.7364815  0.3391511
[3,]  0.5890352  0.8490275  0.4874497  0.9722867
[4,]  0.6399357  1.0028905 -0.9137558 -0.3644999
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.5140915 0.3685723 0.6249777 0.7070072
[2,]  1.3153707 1.2812095 0.7364815 0.3391511
[3,]  0.5890352 0.8490275 0.4874497 0.9722867
[4,]  0.6399357 1.0028905 0.9137558 0.3644999
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9756750 0.6071016 0.7905553 0.8408372
[2,] 1.1468961 1.1319053 0.8581850 0.5823668
[3,] 0.7674863 0.9214269 0.6981760 0.9860460
[4,] 0.7999598 1.0014442 0.9559058 0.6037382
> 
> 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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.27084 31.43959 33.53053 34.11538
[2,]  37.78433 37.60026 34.31833 31.16282
[3,]  33.26390 35.06330 32.46921 35.83275
[4,]  33.63953 36.01733 35.47281 31.40188
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000014f0000>
> exp(tmp5)
<pointer: 0x6000014f0000>
> log(tmp5,2)
<pointer: 0x6000014f0000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.7904
> Min(tmp5)
[1] 53.33024
> mean(tmp5)
[1] 72.68514
> Sum(tmp5)
[1] 14537.03
> Var(tmp5)
[1] 844.0032
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 87.48264 71.87172 69.80695 72.74876 71.73647 70.85791 72.77400 72.12551
 [9] 67.90305 69.54440
> rowSums(tmp5)
 [1] 1749.653 1437.434 1396.139 1454.975 1434.729 1417.158 1455.480 1442.510
 [9] 1358.061 1390.888
> rowVars(tmp5)
 [1] 8030.18513   65.47777   61.47084   59.04447   64.46399   47.69199
 [7]   44.42844   50.06896   65.09146   72.73324
> rowSd(tmp5)
 [1] 89.611300  8.091834  7.840334  7.684040  8.028947  6.905939  6.665466
 [8]  7.075942  8.067928  8.528378
> rowMax(tmp5)
 [1] 466.79037  89.33987  82.70988  87.57080  86.55496  86.98942  83.00438
 [8]  85.86101  84.95347  87.29058
> rowMin(tmp5)
 [1] 56.85155 58.75486 53.33024 54.08158 54.19063 56.42473 61.25317 60.55214
 [9] 56.66880 57.38904
> 
> colMeans(tmp5)
 [1] 109.78259  69.94734  68.42155  70.58069  67.92745  63.24460  69.75745
 [8]  71.70075  73.64184  71.59934  73.24571  73.56930  73.74584  74.83113
[15]  67.41813  70.30900  69.06370  71.45526  73.31122  70.14991
> colSums(tmp5)
 [1] 1097.8259  699.4734  684.2155  705.8069  679.2745  632.4460  697.5745
 [8]  717.0075  736.4184  715.9934  732.4571  735.6930  737.4584  748.3113
[15]  674.1813  703.0900  690.6370  714.5526  733.1122  701.4991
> colVars(tmp5)
 [1] 15776.67033    67.54805    25.51784    42.97349    90.47147    36.84840
 [7]    52.31460    99.67415    44.34778    81.22090    74.40574    49.23435
[13]    58.47101    24.03323    31.06927    30.90236    58.05584    76.45721
[19]    41.87722   131.55725
> colSd(tmp5)
 [1] 125.605216   8.218762   5.051519   6.555417   9.511649   6.070288
 [7]   7.232883   9.983694   6.659413   9.012264   8.625876   7.016719
[13]   7.646634   4.902370   5.573982   5.558989   7.619439   8.743981
[19]   6.471261  11.469841
> colMax(tmp5)
 [1] 466.79037  80.14429  75.17140  81.90379  80.05731  73.93550  80.81136
 [8]  85.27458  84.95347  78.59106  86.55496  87.57080  86.98942  82.14745
[15]  75.25070  78.75969  86.24140  89.33987  83.89147  87.29058
> colMin(tmp5)
 [1] 61.00830 56.42473 61.40023 62.70919 54.08158 54.19063 57.38904 57.99057
 [9] 60.53288 53.33024 59.72767 61.04313 58.95502 67.80116 59.57023 61.25317
[17] 60.26114 60.71348 63.15053 55.63161
> 
> 
> ### 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] 87.48264 71.87172 69.80695 72.74876 71.73647 70.85791       NA 72.12551
 [9] 67.90305 69.54440
> rowSums(tmp5)
 [1] 1749.653 1437.434 1396.139 1454.975 1434.729 1417.158       NA 1442.510
 [9] 1358.061 1390.888
> rowVars(tmp5)
 [1] 8030.18513   65.47777   61.47084   59.04447   64.46399   47.69199
 [7]   43.11895   50.06896   65.09146   72.73324
> rowSd(tmp5)
 [1] 89.611300  8.091834  7.840334  7.684040  8.028947  6.905939  6.566502
 [8]  7.075942  8.067928  8.528378
> rowMax(tmp5)
 [1] 466.79037  89.33987  82.70988  87.57080  86.55496  86.98942        NA
 [8]  85.86101  84.95347  87.29058
> rowMin(tmp5)
 [1] 56.85155 58.75486 53.33024 54.08158 54.19063 56.42473       NA 60.55214
 [9] 56.66880 57.38904
> 
> colMeans(tmp5)
 [1] 109.78259  69.94734  68.42155  70.58069  67.92745  63.24460        NA
 [8]  71.70075  73.64184  71.59934  73.24571  73.56930  73.74584  74.83113
[15]  67.41813  70.30900  69.06370  71.45526  73.31122  70.14991
> colSums(tmp5)
 [1] 1097.8259  699.4734  684.2155  705.8069  679.2745  632.4460        NA
 [8]  717.0075  736.4184  715.9934  732.4571  735.6930  737.4584  748.3113
[15]  674.1813  703.0900  690.6370  714.5526  733.1122  701.4991
> colVars(tmp5)
 [1] 15776.67033    67.54805    25.51784    42.97349    90.47147    36.84840
 [7]          NA    99.67415    44.34778    81.22090    74.40574    49.23435
[13]    58.47101    24.03323    31.06927    30.90236    58.05584    76.45721
[19]    41.87722   131.55725
> colSd(tmp5)
 [1] 125.605216   8.218762   5.051519   6.555417   9.511649   6.070288
 [7]         NA   9.983694   6.659413   9.012264   8.625876   7.016719
[13]   7.646634   4.902370   5.573982   5.558989   7.619439   8.743981
[19]   6.471261  11.469841
> colMax(tmp5)
 [1] 466.79037  80.14429  75.17140  81.90379  80.05731  73.93550        NA
 [8]  85.27458  84.95347  78.59106  86.55496  87.57080  86.98942  82.14745
[15]  75.25070  78.75969  86.24140  89.33987  83.89147  87.29058
> colMin(tmp5)
 [1] 61.00830 56.42473 61.40023 62.70919 54.08158 54.19063       NA 57.99057
 [9] 60.53288 53.33024 59.72767 61.04313 58.95502 67.80116 59.57023 61.25317
[17] 60.26114 60.71348 63.15053 55.63161
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.7904
> Min(tmp5,na.rm=TRUE)
[1] 53.33024
> mean(tmp5,na.rm=TRUE)
[1] 72.64431
> Sum(tmp5,na.rm=TRUE)
[1] 14456.22
> Var(tmp5,na.rm=TRUE)
[1] 847.9306
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.48264 71.87172 69.80695 72.74876 71.73647 70.85791 72.35098 72.12551
 [9] 67.90305 69.54440
> rowSums(tmp5,na.rm=TRUE)
 [1] 1749.653 1437.434 1396.139 1454.975 1434.729 1417.158 1374.669 1442.510
 [9] 1358.061 1390.888
> rowVars(tmp5,na.rm=TRUE)
 [1] 8030.18513   65.47777   61.47084   59.04447   64.46399   47.69199
 [7]   43.11895   50.06896   65.09146   72.73324
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.611300  8.091834  7.840334  7.684040  8.028947  6.905939  6.566502
 [8]  7.075942  8.067928  8.528378
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.79037  89.33987  82.70988  87.57080  86.55496  86.98942  83.00438
 [8]  85.86101  84.95347  87.29058
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.85155 58.75486 53.33024 54.08158 54.19063 56.42473 61.25317 60.55214
 [9] 56.66880 57.38904
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.78259  69.94734  68.42155  70.58069  67.92745  63.24460  68.52923
 [8]  71.70075  73.64184  71.59934  73.24571  73.56930  73.74584  74.83113
[15]  67.41813  70.30900  69.06370  71.45526  73.31122  70.14991
> colSums(tmp5,na.rm=TRUE)
 [1] 1097.8259  699.4734  684.2155  705.8069  679.2745  632.4460  616.7631
 [8]  717.0075  736.4184  715.9934  732.4571  735.6930  737.4584  748.3113
[15]  674.1813  703.0900  690.6370  714.5526  733.1122  701.4991
> colVars(tmp5,na.rm=TRUE)
 [1] 15776.67033    67.54805    25.51784    42.97349    90.47147    36.84840
 [7]    41.88324    99.67415    44.34778    81.22090    74.40574    49.23435
[13]    58.47101    24.03323    31.06927    30.90236    58.05584    76.45721
[19]    41.87722   131.55725
> colSd(tmp5,na.rm=TRUE)
 [1] 125.605216   8.218762   5.051519   6.555417   9.511649   6.070288
 [7]   6.471726   9.983694   6.659413   9.012264   8.625876   7.016719
[13]   7.646634   4.902370   5.573982   5.558989   7.619439   8.743981
[19]   6.471261  11.469841
> colMax(tmp5,na.rm=TRUE)
 [1] 466.79037  80.14429  75.17140  81.90379  80.05731  73.93550  79.78191
 [8]  85.27458  84.95347  78.59106  86.55496  87.57080  86.98942  82.14745
[15]  75.25070  78.75969  86.24140  89.33987  83.89147  87.29058
> colMin(tmp5,na.rm=TRUE)
 [1] 61.00830 56.42473 61.40023 62.70919 54.08158 54.19063 57.38904 57.99057
 [9] 60.53288 53.33024 59.72767 61.04313 58.95502 67.80116 59.57023 61.25317
[17] 60.26114 60.71348 63.15053 55.63161
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 87.48264 71.87172 69.80695 72.74876 71.73647 70.85791      NaN 72.12551
 [9] 67.90305 69.54440
> rowSums(tmp5,na.rm=TRUE)
 [1] 1749.653 1437.434 1396.139 1454.975 1434.729 1417.158    0.000 1442.510
 [9] 1358.061 1390.888
> rowVars(tmp5,na.rm=TRUE)
 [1] 8030.18513   65.47777   61.47084   59.04447   64.46399   47.69199
 [7]         NA   50.06896   65.09146   72.73324
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.611300  8.091834  7.840334  7.684040  8.028947  6.905939        NA
 [8]  7.075942  8.067928  8.528378
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.79037  89.33987  82.70988  87.57080  86.55496  86.98942        NA
 [8]  85.86101  84.95347  87.29058
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.85155 58.75486 53.33024 54.08158 54.19063 56.42473       NA 60.55214
 [9] 56.66880 57.38904
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.75680  68.81435  69.13261  70.64158  67.35532  62.93130       NaN
 [8]  70.68745  74.07985  71.06612  73.01151  74.09504  73.59370  74.23593
[15]  67.44677  71.31521  69.07736  70.58057  72.23420  69.92045
> colSums(tmp5,na.rm=TRUE)
 [1] 1032.8112  619.3291  622.1935  635.7742  606.1978  566.3817    0.0000
 [8]  636.1871  666.7186  639.5951  657.1036  666.8554  662.3433  668.1234
[15]  607.0210  641.8369  621.6962  635.2251  650.1078  629.2840
> colVars(tmp5,na.rm=TRUE)
 [1] 17470.39875    61.55020    23.01958    48.30348    98.09784    40.35016
 [7]          NA   100.58213    47.73290    88.17497    83.08939    52.27914
[13]    65.51952    23.05201    34.94370    23.37514    65.31073    77.40716
[19]    34.06225   147.40956
> colSd(tmp5,na.rm=TRUE)
 [1] 132.175636   7.845393   4.797872   6.950070   9.904436   6.352178
 [7]         NA  10.029064   6.908900   9.390153   9.115338   7.230432
[13]   8.094413   4.801251   5.911320   4.834785   8.081505   8.798134
[19]   5.836287  12.141234
> colMax(tmp5,na.rm=TRUE)
 [1] 466.79037  78.92540  75.17140  81.90379  80.05731  73.93550      -Inf
 [8]  85.27458  84.95347  78.59106  86.55496  87.57080  86.98942  82.14745
[15]  75.25070  78.75969  86.24140  89.33987  83.89147  87.29058
> colMin(tmp5,na.rm=TRUE)
 [1] 61.00830 56.42473 61.40023 62.70919 54.08158 54.19063      Inf 57.99057
 [9] 60.53288 53.33024 59.72767 61.04313 58.95502 67.80116 59.57023 64.78391
[17] 60.26114 60.71348 63.15053 55.63161
> 
> 
> 
> 
> 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] 257.9482 171.2771 176.8015 363.9950 125.8587 299.8414 148.1842 190.2311
 [9] 371.6026 175.6800
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 257.9482 171.2771 176.8015 363.9950 125.8587 299.8414 148.1842 190.2311
 [9] 371.6026 175.6800
> 
> 
> 
> 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.136868e-13  0.000000e+00  1.136868e-13 -2.842171e-13 -2.842171e-14
 [6]  1.989520e-13 -2.842171e-14  1.136868e-13  0.000000e+00 -1.136868e-13
[11]  2.842171e-14  2.842171e-14  0.000000e+00  5.684342e-14 -1.989520e-13
[16] -2.557954e-13  2.273737e-13  8.526513e-14  1.705303e-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)
+ }
4   15 
3   8 
9   12 
5   7 
5   1 
9   6 
6   17 
4   4 
6   11 
2   2 
8   1 
10   14 
9   11 
7   15 
3   13 
10   19 
8   5 
8   15 
10   12 
4   10 
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.537421
> Min(tmp)
[1] -2.497992
> mean(tmp)
[1] 0.01073605
> Sum(tmp)
[1] 1.073605
> Var(tmp)
[1] 0.9112792
> 
> rowMeans(tmp)
[1] 0.01073605
> rowSums(tmp)
[1] 1.073605
> rowVars(tmp)
[1] 0.9112792
> rowSd(tmp)
[1] 0.9546095
> rowMax(tmp)
[1] 2.537421
> rowMin(tmp)
[1] -2.497992
> 
> colMeans(tmp)
  [1]  0.601672636 -0.164962544  0.078819016  0.793775917 -0.116227842
  [6]  0.634570352 -0.563669408  0.505972152  0.113937136 -0.375612717
 [11]  0.317797521 -1.518242405 -1.256877292 -1.062552397  0.739793502
 [16] -0.043596317 -1.848266535  0.518868334  2.537421298  1.801866174
 [21] -0.985454242  0.205245216  1.407649487 -0.817826052 -0.493243669
 [26]  1.432760176 -0.731154192 -0.488744449 -0.367053557 -0.711984852
 [31] -0.049321995 -0.749113743  0.771903429 -2.497992151  1.119667406
 [36] -0.144357155  0.780932989 -0.551503162 -1.893818430  0.401672544
 [41] -1.099816796 -0.801198438 -0.375202554 -1.761036191 -0.068536912
 [46] -0.345435175  0.405421540 -1.044575759  0.260399598 -0.510332117
 [51]  0.245570629  0.192566925  0.005216335 -0.552008821 -0.071828801
 [56] -0.354338898 -0.396070847 -1.266697949  1.410448233  0.514083504
 [61]  0.682407712  1.455856842 -0.405749127 -1.525139312  0.308110306
 [66]  1.069069138  0.658081932 -0.646763448 -1.560285833  2.188431809
 [71]  0.158177601 -1.358330143  0.126331278 -0.743804100  0.804830304
 [76]  0.060725326  0.099426073  1.424279699 -0.731763185  0.715619071
 [81] -0.237734907 -0.245749548 -0.247562307 -0.137456379  0.344736753
 [86]  1.554426523 -0.515758032  0.189640225 -0.923328534 -0.657194694
 [91]  0.597754644  1.265013042  1.463457440  0.552705460  1.879000881
 [96]  0.543983691  0.828855543  1.506283862 -0.285576379 -0.900781466
> colSums(tmp)
  [1]  0.601672636 -0.164962544  0.078819016  0.793775917 -0.116227842
  [6]  0.634570352 -0.563669408  0.505972152  0.113937136 -0.375612717
 [11]  0.317797521 -1.518242405 -1.256877292 -1.062552397  0.739793502
 [16] -0.043596317 -1.848266535  0.518868334  2.537421298  1.801866174
 [21] -0.985454242  0.205245216  1.407649487 -0.817826052 -0.493243669
 [26]  1.432760176 -0.731154192 -0.488744449 -0.367053557 -0.711984852
 [31] -0.049321995 -0.749113743  0.771903429 -2.497992151  1.119667406
 [36] -0.144357155  0.780932989 -0.551503162 -1.893818430  0.401672544
 [41] -1.099816796 -0.801198438 -0.375202554 -1.761036191 -0.068536912
 [46] -0.345435175  0.405421540 -1.044575759  0.260399598 -0.510332117
 [51]  0.245570629  0.192566925  0.005216335 -0.552008821 -0.071828801
 [56] -0.354338898 -0.396070847 -1.266697949  1.410448233  0.514083504
 [61]  0.682407712  1.455856842 -0.405749127 -1.525139312  0.308110306
 [66]  1.069069138  0.658081932 -0.646763448 -1.560285833  2.188431809
 [71]  0.158177601 -1.358330143  0.126331278 -0.743804100  0.804830304
 [76]  0.060725326  0.099426073  1.424279699 -0.731763185  0.715619071
 [81] -0.237734907 -0.245749548 -0.247562307 -0.137456379  0.344736753
 [86]  1.554426523 -0.515758032  0.189640225 -0.923328534 -0.657194694
 [91]  0.597754644  1.265013042  1.463457440  0.552705460  1.879000881
 [96]  0.543983691  0.828855543  1.506283862 -0.285576379 -0.900781466
> 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.601672636 -0.164962544  0.078819016  0.793775917 -0.116227842
  [6]  0.634570352 -0.563669408  0.505972152  0.113937136 -0.375612717
 [11]  0.317797521 -1.518242405 -1.256877292 -1.062552397  0.739793502
 [16] -0.043596317 -1.848266535  0.518868334  2.537421298  1.801866174
 [21] -0.985454242  0.205245216  1.407649487 -0.817826052 -0.493243669
 [26]  1.432760176 -0.731154192 -0.488744449 -0.367053557 -0.711984852
 [31] -0.049321995 -0.749113743  0.771903429 -2.497992151  1.119667406
 [36] -0.144357155  0.780932989 -0.551503162 -1.893818430  0.401672544
 [41] -1.099816796 -0.801198438 -0.375202554 -1.761036191 -0.068536912
 [46] -0.345435175  0.405421540 -1.044575759  0.260399598 -0.510332117
 [51]  0.245570629  0.192566925  0.005216335 -0.552008821 -0.071828801
 [56] -0.354338898 -0.396070847 -1.266697949  1.410448233  0.514083504
 [61]  0.682407712  1.455856842 -0.405749127 -1.525139312  0.308110306
 [66]  1.069069138  0.658081932 -0.646763448 -1.560285833  2.188431809
 [71]  0.158177601 -1.358330143  0.126331278 -0.743804100  0.804830304
 [76]  0.060725326  0.099426073  1.424279699 -0.731763185  0.715619071
 [81] -0.237734907 -0.245749548 -0.247562307 -0.137456379  0.344736753
 [86]  1.554426523 -0.515758032  0.189640225 -0.923328534 -0.657194694
 [91]  0.597754644  1.265013042  1.463457440  0.552705460  1.879000881
 [96]  0.543983691  0.828855543  1.506283862 -0.285576379 -0.900781466
> colMin(tmp)
  [1]  0.601672636 -0.164962544  0.078819016  0.793775917 -0.116227842
  [6]  0.634570352 -0.563669408  0.505972152  0.113937136 -0.375612717
 [11]  0.317797521 -1.518242405 -1.256877292 -1.062552397  0.739793502
 [16] -0.043596317 -1.848266535  0.518868334  2.537421298  1.801866174
 [21] -0.985454242  0.205245216  1.407649487 -0.817826052 -0.493243669
 [26]  1.432760176 -0.731154192 -0.488744449 -0.367053557 -0.711984852
 [31] -0.049321995 -0.749113743  0.771903429 -2.497992151  1.119667406
 [36] -0.144357155  0.780932989 -0.551503162 -1.893818430  0.401672544
 [41] -1.099816796 -0.801198438 -0.375202554 -1.761036191 -0.068536912
 [46] -0.345435175  0.405421540 -1.044575759  0.260399598 -0.510332117
 [51]  0.245570629  0.192566925  0.005216335 -0.552008821 -0.071828801
 [56] -0.354338898 -0.396070847 -1.266697949  1.410448233  0.514083504
 [61]  0.682407712  1.455856842 -0.405749127 -1.525139312  0.308110306
 [66]  1.069069138  0.658081932 -0.646763448 -1.560285833  2.188431809
 [71]  0.158177601 -1.358330143  0.126331278 -0.743804100  0.804830304
 [76]  0.060725326  0.099426073  1.424279699 -0.731763185  0.715619071
 [81] -0.237734907 -0.245749548 -0.247562307 -0.137456379  0.344736753
 [86]  1.554426523 -0.515758032  0.189640225 -0.923328534 -0.657194694
 [91]  0.597754644  1.265013042  1.463457440  0.552705460  1.879000881
 [96]  0.543983691  0.828855543  1.506283862 -0.285576379 -0.900781466
> colMedians(tmp)
  [1]  0.601672636 -0.164962544  0.078819016  0.793775917 -0.116227842
  [6]  0.634570352 -0.563669408  0.505972152  0.113937136 -0.375612717
 [11]  0.317797521 -1.518242405 -1.256877292 -1.062552397  0.739793502
 [16] -0.043596317 -1.848266535  0.518868334  2.537421298  1.801866174
 [21] -0.985454242  0.205245216  1.407649487 -0.817826052 -0.493243669
 [26]  1.432760176 -0.731154192 -0.488744449 -0.367053557 -0.711984852
 [31] -0.049321995 -0.749113743  0.771903429 -2.497992151  1.119667406
 [36] -0.144357155  0.780932989 -0.551503162 -1.893818430  0.401672544
 [41] -1.099816796 -0.801198438 -0.375202554 -1.761036191 -0.068536912
 [46] -0.345435175  0.405421540 -1.044575759  0.260399598 -0.510332117
 [51]  0.245570629  0.192566925  0.005216335 -0.552008821 -0.071828801
 [56] -0.354338898 -0.396070847 -1.266697949  1.410448233  0.514083504
 [61]  0.682407712  1.455856842 -0.405749127 -1.525139312  0.308110306
 [66]  1.069069138  0.658081932 -0.646763448 -1.560285833  2.188431809
 [71]  0.158177601 -1.358330143  0.126331278 -0.743804100  0.804830304
 [76]  0.060725326  0.099426073  1.424279699 -0.731763185  0.715619071
 [81] -0.237734907 -0.245749548 -0.247562307 -0.137456379  0.344736753
 [86]  1.554426523 -0.515758032  0.189640225 -0.923328534 -0.657194694
 [91]  0.597754644  1.265013042  1.463457440  0.552705460  1.879000881
 [96]  0.543983691  0.828855543  1.506283862 -0.285576379 -0.900781466
> colRanges(tmp)
          [,1]       [,2]       [,3]      [,4]       [,5]      [,6]       [,7]
[1,] 0.6016726 -0.1649625 0.07881902 0.7937759 -0.1162278 0.6345704 -0.5636694
[2,] 0.6016726 -0.1649625 0.07881902 0.7937759 -0.1162278 0.6345704 -0.5636694
          [,8]      [,9]      [,10]     [,11]     [,12]     [,13]     [,14]
[1,] 0.5059722 0.1139371 -0.3756127 0.3177975 -1.518242 -1.256877 -1.062552
[2,] 0.5059722 0.1139371 -0.3756127 0.3177975 -1.518242 -1.256877 -1.062552
         [,15]       [,16]     [,17]     [,18]    [,19]    [,20]      [,21]
[1,] 0.7397935 -0.04359632 -1.848267 0.5188683 2.537421 1.801866 -0.9854542
[2,] 0.7397935 -0.04359632 -1.848267 0.5188683 2.537421 1.801866 -0.9854542
         [,22]    [,23]      [,24]      [,25]   [,26]      [,27]      [,28]
[1,] 0.2052452 1.407649 -0.8178261 -0.4932437 1.43276 -0.7311542 -0.4887444
[2,] 0.2052452 1.407649 -0.8178261 -0.4932437 1.43276 -0.7311542 -0.4887444
          [,29]      [,30]       [,31]      [,32]     [,33]     [,34]    [,35]
[1,] -0.3670536 -0.7119849 -0.04932199 -0.7491137 0.7719034 -2.497992 1.119667
[2,] -0.3670536 -0.7119849 -0.04932199 -0.7491137 0.7719034 -2.497992 1.119667
          [,36]    [,37]      [,38]     [,39]     [,40]     [,41]      [,42]
[1,] -0.1443572 0.780933 -0.5515032 -1.893818 0.4016725 -1.099817 -0.8011984
[2,] -0.1443572 0.780933 -0.5515032 -1.893818 0.4016725 -1.099817 -0.8011984
          [,43]     [,44]       [,45]      [,46]     [,47]     [,48]     [,49]
[1,] -0.3752026 -1.761036 -0.06853691 -0.3454352 0.4054215 -1.044576 0.2603996
[2,] -0.3752026 -1.761036 -0.06853691 -0.3454352 0.4054215 -1.044576 0.2603996
          [,50]     [,51]     [,52]       [,53]      [,54]      [,55]
[1,] -0.5103321 0.2455706 0.1925669 0.005216335 -0.5520088 -0.0718288
[2,] -0.5103321 0.2455706 0.1925669 0.005216335 -0.5520088 -0.0718288
          [,56]      [,57]     [,58]    [,59]     [,60]     [,61]    [,62]
[1,] -0.3543389 -0.3960708 -1.266698 1.410448 0.5140835 0.6824077 1.455857
[2,] -0.3543389 -0.3960708 -1.266698 1.410448 0.5140835 0.6824077 1.455857
          [,63]     [,64]     [,65]    [,66]     [,67]      [,68]     [,69]
[1,] -0.4057491 -1.525139 0.3081103 1.069069 0.6580819 -0.6467634 -1.560286
[2,] -0.4057491 -1.525139 0.3081103 1.069069 0.6580819 -0.6467634 -1.560286
        [,70]     [,71]    [,72]     [,73]      [,74]     [,75]      [,76]
[1,] 2.188432 0.1581776 -1.35833 0.1263313 -0.7438041 0.8048303 0.06072533
[2,] 2.188432 0.1581776 -1.35833 0.1263313 -0.7438041 0.8048303 0.06072533
          [,77]   [,78]      [,79]     [,80]      [,81]      [,82]      [,83]
[1,] 0.09942607 1.42428 -0.7317632 0.7156191 -0.2377349 -0.2457495 -0.2475623
[2,] 0.09942607 1.42428 -0.7317632 0.7156191 -0.2377349 -0.2457495 -0.2475623
          [,84]     [,85]    [,86]     [,87]     [,88]      [,89]      [,90]
[1,] -0.1374564 0.3447368 1.554427 -0.515758 0.1896402 -0.9233285 -0.6571947
[2,] -0.1374564 0.3447368 1.554427 -0.515758 0.1896402 -0.9233285 -0.6571947
         [,91]    [,92]    [,93]     [,94]    [,95]     [,96]     [,97]
[1,] 0.5977546 1.265013 1.463457 0.5527055 1.879001 0.5439837 0.8288555
[2,] 0.5977546 1.265013 1.463457 0.5527055 1.879001 0.5439837 0.8288555
        [,98]      [,99]     [,100]
[1,] 1.506284 -0.2855764 -0.9007815
[2,] 1.506284 -0.2855764 -0.9007815
> 
> 
> Max(tmp2)
[1] 2.95658
> Min(tmp2)
[1] -1.932972
> mean(tmp2)
[1] 0.08675139
> Sum(tmp2)
[1] 8.675139
> Var(tmp2)
[1] 1.011206
> 
> rowMeans(tmp2)
  [1] -0.183956521 -0.263573876  0.440580053 -0.065539882 -0.508846295
  [6] -0.752303977  0.431224634 -0.623134651 -0.533380652  0.180257369
 [11] -1.427950943  0.362736040 -1.582134596 -1.228142423  1.459128037
 [16]  0.465683051  0.236544271 -0.551555696  1.285045212  1.168342633
 [21]  2.151744665 -1.005262440  0.229810314  0.341678408 -1.094866167
 [26] -0.964679354  0.482140791 -0.121211968 -1.229755540  1.714634891
 [31]  0.232026935 -0.231958399  0.493216092 -0.586873172  1.409939228
 [36]  1.454551285  0.998174988 -0.394444106  0.325478585  1.451204800
 [41]  0.214693140  1.216613429  0.079975453  1.827802544  0.628984883
 [46]  0.202734917  1.264857366  0.215501289 -0.300339726 -0.762713166
 [51] -1.671674575  0.001562922 -1.294377855  1.265711952 -0.495737428
 [56] -0.225852673  0.404902712 -0.488426492 -0.223439604  0.719217996
 [61]  0.421983462 -0.447083346  0.030565115 -1.566335957 -1.872552664
 [66] -1.166315606  1.104850820  2.471692106  0.113331727  0.343635037
 [71]  0.072714050  0.227102497 -1.932972323  2.956579777  0.869086731
 [76] -1.082983137  1.496602313 -0.307217929 -0.574230253  0.294228969
 [81] -0.253465062  1.368270600 -1.698594142  0.513232165  0.638557275
 [86] -1.333773521  1.165787313 -1.915557044  0.375606942  0.615545566
 [91] -0.106829486 -1.018351599  1.064623800 -0.186378915 -0.817739145
 [96]  1.601504616  0.133757346  0.300350270  0.558773303 -0.327431166
> rowSums(tmp2)
  [1] -0.183956521 -0.263573876  0.440580053 -0.065539882 -0.508846295
  [6] -0.752303977  0.431224634 -0.623134651 -0.533380652  0.180257369
 [11] -1.427950943  0.362736040 -1.582134596 -1.228142423  1.459128037
 [16]  0.465683051  0.236544271 -0.551555696  1.285045212  1.168342633
 [21]  2.151744665 -1.005262440  0.229810314  0.341678408 -1.094866167
 [26] -0.964679354  0.482140791 -0.121211968 -1.229755540  1.714634891
 [31]  0.232026935 -0.231958399  0.493216092 -0.586873172  1.409939228
 [36]  1.454551285  0.998174988 -0.394444106  0.325478585  1.451204800
 [41]  0.214693140  1.216613429  0.079975453  1.827802544  0.628984883
 [46]  0.202734917  1.264857366  0.215501289 -0.300339726 -0.762713166
 [51] -1.671674575  0.001562922 -1.294377855  1.265711952 -0.495737428
 [56] -0.225852673  0.404902712 -0.488426492 -0.223439604  0.719217996
 [61]  0.421983462 -0.447083346  0.030565115 -1.566335957 -1.872552664
 [66] -1.166315606  1.104850820  2.471692106  0.113331727  0.343635037
 [71]  0.072714050  0.227102497 -1.932972323  2.956579777  0.869086731
 [76] -1.082983137  1.496602313 -0.307217929 -0.574230253  0.294228969
 [81] -0.253465062  1.368270600 -1.698594142  0.513232165  0.638557275
 [86] -1.333773521  1.165787313 -1.915557044  0.375606942  0.615545566
 [91] -0.106829486 -1.018351599  1.064623800 -0.186378915 -0.817739145
 [96]  1.601504616  0.133757346  0.300350270  0.558773303 -0.327431166
> 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.183956521 -0.263573876  0.440580053 -0.065539882 -0.508846295
  [6] -0.752303977  0.431224634 -0.623134651 -0.533380652  0.180257369
 [11] -1.427950943  0.362736040 -1.582134596 -1.228142423  1.459128037
 [16]  0.465683051  0.236544271 -0.551555696  1.285045212  1.168342633
 [21]  2.151744665 -1.005262440  0.229810314  0.341678408 -1.094866167
 [26] -0.964679354  0.482140791 -0.121211968 -1.229755540  1.714634891
 [31]  0.232026935 -0.231958399  0.493216092 -0.586873172  1.409939228
 [36]  1.454551285  0.998174988 -0.394444106  0.325478585  1.451204800
 [41]  0.214693140  1.216613429  0.079975453  1.827802544  0.628984883
 [46]  0.202734917  1.264857366  0.215501289 -0.300339726 -0.762713166
 [51] -1.671674575  0.001562922 -1.294377855  1.265711952 -0.495737428
 [56] -0.225852673  0.404902712 -0.488426492 -0.223439604  0.719217996
 [61]  0.421983462 -0.447083346  0.030565115 -1.566335957 -1.872552664
 [66] -1.166315606  1.104850820  2.471692106  0.113331727  0.343635037
 [71]  0.072714050  0.227102497 -1.932972323  2.956579777  0.869086731
 [76] -1.082983137  1.496602313 -0.307217929 -0.574230253  0.294228969
 [81] -0.253465062  1.368270600 -1.698594142  0.513232165  0.638557275
 [86] -1.333773521  1.165787313 -1.915557044  0.375606942  0.615545566
 [91] -0.106829486 -1.018351599  1.064623800 -0.186378915 -0.817739145
 [96]  1.601504616  0.133757346  0.300350270  0.558773303 -0.327431166
> rowMin(tmp2)
  [1] -0.183956521 -0.263573876  0.440580053 -0.065539882 -0.508846295
  [6] -0.752303977  0.431224634 -0.623134651 -0.533380652  0.180257369
 [11] -1.427950943  0.362736040 -1.582134596 -1.228142423  1.459128037
 [16]  0.465683051  0.236544271 -0.551555696  1.285045212  1.168342633
 [21]  2.151744665 -1.005262440  0.229810314  0.341678408 -1.094866167
 [26] -0.964679354  0.482140791 -0.121211968 -1.229755540  1.714634891
 [31]  0.232026935 -0.231958399  0.493216092 -0.586873172  1.409939228
 [36]  1.454551285  0.998174988 -0.394444106  0.325478585  1.451204800
 [41]  0.214693140  1.216613429  0.079975453  1.827802544  0.628984883
 [46]  0.202734917  1.264857366  0.215501289 -0.300339726 -0.762713166
 [51] -1.671674575  0.001562922 -1.294377855  1.265711952 -0.495737428
 [56] -0.225852673  0.404902712 -0.488426492 -0.223439604  0.719217996
 [61]  0.421983462 -0.447083346  0.030565115 -1.566335957 -1.872552664
 [66] -1.166315606  1.104850820  2.471692106  0.113331727  0.343635037
 [71]  0.072714050  0.227102497 -1.932972323  2.956579777  0.869086731
 [76] -1.082983137  1.496602313 -0.307217929 -0.574230253  0.294228969
 [81] -0.253465062  1.368270600 -1.698594142  0.513232165  0.638557275
 [86] -1.333773521  1.165787313 -1.915557044  0.375606942  0.615545566
 [91] -0.106829486 -1.018351599  1.064623800 -0.186378915 -0.817739145
 [96]  1.601504616  0.133757346  0.300350270  0.558773303 -0.327431166
> 
> colMeans(tmp2)
[1] 0.08675139
> colSums(tmp2)
[1] 8.675139
> colVars(tmp2)
[1] 1.011206
> colSd(tmp2)
[1] 1.005588
> colMax(tmp2)
[1] 2.95658
> colMin(tmp2)
[1] -1.932972
> colMedians(tmp2)
[1] 0.1570074
> colRanges(tmp2)
          [,1]
[1,] -1.932972
[2,]  2.956580
> 
> 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.8460094  0.2961248  2.3029075  3.0799779  3.3257070 -3.0798014
 [7] -0.7038997  1.1723957 -8.2694120  0.8323506
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8017189
[2,] -0.7603030
[3,]  0.3096222
[4,]  0.7261680
[5,]  2.0962229
> 
> rowApply(tmp,sum)
 [1] -2.0280069  0.7564602  6.9999978 -0.5828130  2.8585299 -2.2433278
 [7] -0.2886259 -3.7417590  0.6082190 -1.5363143
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    5    6    9   10    1    2    5    5    10
 [2,]    5    1   10    8    8    6   10    1    3     1
 [3,]   10    6    2    3    6    9    5    3    9     5
 [4,]    8   10    3    4    1   10    6    6   10     4
 [5,]    4    8    1   10    7    4    9    8    8     6
 [6,]    1    9    8    5    4    2    7    4    1     7
 [7,]    9    4    4    1    9    3    8   10    4     3
 [8,]    7    7    7    6    3    8    4    2    7     8
 [9,]    3    2    5    2    5    7    1    9    2     2
[10,]    6    3    9    7    2    5    3    7    6     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.4393042 -0.3386134  0.3183947 -0.1186315  1.2548939  4.0127787
 [7]  1.3412990  1.5053138  1.0557234 -1.4026140 -0.8241976  2.0562824
[13] -1.7045023 -1.5355672 -2.4466490  0.5103387  1.0583916 -2.3726096
[19]  0.6628793 -2.6247744
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.48501436
[2,] -0.38293401
[3,] -0.05886909
[4,]  0.66222468
[5,]  1.70389700
> 
> rowApply(tmp,sum)
[1]  3.4851169 -1.0213350  3.2778981 -0.6048533 -4.2893858
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1   20   15    8    8
[2,]   17   10    8    7   10
[3,]    9   11   12   11   14
[4,]    2   19   16    5    9
[5,]    7   18    5   18   12
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]       [,4]       [,5]      [,6]
[1,] -1.48501436  1.0341180 -0.16131336 -0.9889640 -0.1875366 1.5494583
[2,]  1.70389700 -0.2123908 -0.08725920  1.3651389  0.8553834 0.3467429
[3,]  0.66222468 -0.2495447  0.21201065  0.7065106 -0.3145590 1.2483996
[4,] -0.05886909 -0.5821713  0.09421987 -0.8378973  1.0284587 0.5569950
[5,] -0.38293401 -0.3286244  0.26073677 -0.3634197 -0.1268526 0.3111829
           [,7]          [,8]        [,9]      [,10]      [,11]       [,12]
[1,]  1.2952787  0.2226027535  2.19865075 -0.1821991 -0.6269618  0.48235466
[2,]  0.5558791  0.5740707776 -0.96410585  0.7988293 -0.7983119 -0.04704562
[3,]  1.3701744 -0.0992777539 -0.23551682  1.6355218 -0.3094602  1.63880671
[4,] -1.3728040  0.0005479801  0.14938459 -2.3784610  0.0831623  1.74245338
[5,] -0.5072291  0.8073700074 -0.09268922 -1.2763051  0.8273739 -1.76028676
          [,13]      [,14]       [,15]      [,16]       [,17]      [,18]
[1,] -0.8075014 -0.6503344  0.31490807  0.5927644  0.32628113  0.2461790
[2,] -0.7844932 -0.5775462 -1.08898679 -0.2958582 -0.01551979 -1.1855162
[3,] -0.5059754 -1.1101978 -0.06192541  0.2500168  0.36418182 -0.3547033
[4,] -0.8417300  0.4427214 -1.18873075 -0.6139245  0.62763733  0.2630948
[5,]  1.2351978  0.3597898 -0.42191410  0.5773402 -0.24418890 -1.3416639
          [,19]      [,20]
[1,]  0.6566345 -0.3442884
[2,] -0.7750496 -0.3891929
[3,] -0.2726951 -1.2960936
[4,]  1.7856463  0.4954131
[5,] -0.7316568 -1.0906125
> 
> 
> 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.20-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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-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 1.909674 -0.09260703 0.498084 -0.03323992 1.00846 -1.73208 -0.4831878
         col8     col9     col10    col11     col12   col13    col14     col15
row1 1.604958 1.760382 0.6592904 2.588081 -2.404761 1.50159 -2.52827 -2.051197
         col16      col17     col18      col19      col20
row1 0.1325836 -0.4699077 0.6204899 -0.2588035 -0.5707402
> tmp[,"col10"]
          col10
row1  0.6592904
row2  1.3304621
row3  0.6255414
row4  1.4658745
row5 -0.2522519
> tmp[c("row1","row5"),]
           col1        col2        col3        col4      col5      col6
row1 1.90967417 -0.09260703 0.498083956 -0.03323992  1.008460 -1.732080
row5 0.06959473  1.81551500 0.007305859 -0.78207549 -1.445471  1.602404
           col7     col8     col9      col10    col11      col12      col13
row1 -0.4831878 1.604958 1.760382  0.6592904 2.588081 -2.4047606  1.5015904
row5  2.4650488 1.237019 1.032706 -0.2522519 1.506272  0.3057758 -0.1507529
         col14     col15      col16      col17      col18      col19      col20
row1 -2.528270 -2.051197  0.1325836 -0.4699077  0.6204899 -0.2588035 -0.5707402
row5  1.354269 -0.388302 -0.3211829  0.5491110 -0.7541373  0.5420821  0.6332146
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.7320799 -0.5707402
row2  2.9694628  1.1476862
row3 -0.2812736 -0.6139874
row4  0.2826005 -0.6414885
row5  1.6024044  0.6332146
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 -1.732080 -0.5707402
row5  1.602404  0.6332146
> 
> 
> 
> 
> 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 50.27744 49.8822 49.89919 51.79403 51.37771 105.7877 49.2601 47.72249
         col9   col10    col11    col12    col13    col14    col15    col16
row1 49.91098 50.2827 49.90793 49.49766 50.20473 50.50048 50.11832 50.22772
        col17    col18    col19    col20
row1 50.69191 49.57847 50.78884 104.1763
> tmp[,"col10"]
        col10
row1 50.28270
row2 29.60872
row3 29.30065
row4 31.01962
row5 50.25373
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.27744 49.88220 49.89919 51.79403 51.37771 105.7877 49.26010 47.72249
row5 50.51230 49.82826 52.40479 48.98547 51.44545 105.1508 51.35262 49.40558
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.91098 50.28270 49.90793 49.49766 50.20473 50.50048 50.11832 50.22772
row5 49.64918 50.25373 49.54058 50.16807 49.40749 50.19976 50.03846 48.64561
        col17    col18    col19    col20
row1 50.69191 49.57847 50.78884 104.1763
row5 49.92876 50.39391 49.73940 104.7953
> tmp[,c("col6","col20")]
          col6     col20
row1 105.78767 104.17625
row2  74.32516  75.43799
row3  76.43120  75.36415
row4  75.59931  74.99091
row5 105.15077 104.79533
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.7877 104.1763
row5 105.1508 104.7953
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.7877 104.1763
row5 105.1508 104.7953
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -1.2088890
[2,] -0.5252352
[3,]  1.4767448
[4,] -1.0646221
[5,] -1.2414558
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.9733381 -0.5751563
[2,]  0.8139470 -1.0240337
[3,]  0.1623051  0.7532597
[4,]  1.7343151 -2.1261913
[5,] -0.5879139 -1.4720302
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,] -0.3509797 -0.4243261
[2,] -2.2255987 -0.2770550
[3,] -1.1974867 -0.6466171
[4,]  1.3419083 -1.3296794
[5,]  0.5524406  0.1696859
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3509797
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.3509797
[2,] -2.2255987
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]      [,4]      [,5]       [,6]       [,7]
row3 -1.0938509 -1.004341 -0.4270229 0.4651515 0.1030819 -1.6967288  1.3333038
row1 -0.2826371 -1.227557 -1.2893811 1.7796031 0.2804823 -0.4510582 -0.3218276
           [,8]      [,9]       [,10]      [,11]     [,12]     [,13]      [,14]
row3 -1.7209723 1.9966326 -0.05622325 -0.6774970 -0.228001 0.2067511 1.39701019
row1  0.4115266 0.5579799  0.41585353  0.1010964  2.077937 0.4773228 0.08246275
          [,15]     [,16]      [,17]     [,18]      [,19]     [,20]
row3 -1.2977466 0.0932216  0.6873312 0.1081629 -0.4720911 0.7887280
row1  0.8272865 0.3580718 -0.4292304 0.7616397 -1.5094483 0.4481654
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]       [,7]
row2 -0.1963406 0.4001278 -1.076031 0.2964687 -1.061527 0.4343241 -0.8046574
           [,8]      [,9]     [,10]
row2 -0.3353526 0.2905646 -1.101653
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]      [,2]       [,3]       [,4]       [,5]       [,6]      [,7]
row5 1.072978 -1.189921 -0.6807817 -0.1573065 -0.3939618 -0.2759849 0.5758342
          [,8]      [,9]     [,10]     [,11]    [,12]    [,13]   [,14]
row5 0.7526603 0.7419944 0.7538755 0.2060046 1.019058 0.767128 2.23314
         [,15]     [,16]      [,17]    [,18]     [,19]     [,20]
row5 -1.231316 -1.422809 -0.8426541 0.726272 0.6032613 0.3810405
> 
> 
> 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: 0x6000014fc060>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf719f9f8d8"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf76a403a3a"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf71eaeec55"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf76e1dd02f"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf7674ef623"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf77101a8d1"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf723f26b4d"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf7629eab"  
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf74a9eecbf"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf77c915df" 
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf722bae777"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf71cb24771"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf77c705a6e"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf734412b95"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BMddf722945e00"
> 
> 
> ### 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: 0x6000014a01e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000014a01e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000014a01e0>
> rowMedians(tmp)
  [1]  0.0035761641 -0.1040322152 -0.2504694126 -0.1531715600  0.1554015504
  [6]  0.0146206242  0.4051993108 -1.0051758430 -0.2228014683  0.7515507228
 [11] -0.4068303112  0.5313413122 -0.1826784010 -0.4769876444 -0.3843536569
 [16]  0.0043686935  0.5424999918  0.1165037830  0.2945930637  0.1044685726
 [21] -0.0075075800  0.1094042592  0.5453805001  0.1966804654  0.3836507337
 [26]  0.1796886975  0.2429280226  0.4775342326 -0.4603582536 -0.2676103534
 [31] -0.5019302995  0.3532026501  0.3956769174  0.0066881232  0.3647856881
 [36]  0.3750608559  0.0245339169 -0.1382076532  0.0718561734  0.0727720454
 [41]  0.2622059874 -0.1067258612 -0.0600484619 -0.7128266281  0.0800038032
 [46] -0.2200284984  0.3315678258  0.4163733844  0.1292936781 -0.3247414973
 [51] -0.1452068494  0.6673067202 -0.0617876443  0.0916527681 -0.1276226693
 [56]  0.1650911723  0.4033064161 -0.0783557295  0.4792459698  0.2426946772
 [61] -0.2246277802  0.0171734883  0.0747427977  0.2092679907  0.4327730023
 [66] -0.0171942161 -0.0992323748  0.3494106228 -0.1684624168  0.2853883253
 [71]  0.0704839872 -0.2657050492 -0.1687321360 -0.1504786953  0.0591890221
 [76] -0.1723418718 -0.6555980199 -0.7340816783 -0.4260345145  0.2383603655
 [81] -0.2327022511 -0.2317865055 -0.3605409113  0.4297760488 -0.1769575402
 [86]  0.1165816414 -0.0597566145 -0.0260138988 -0.1223887222  0.0892396995
 [91]  0.3503383741  0.2487215967 -0.0110375669  0.2554754774 -0.0332505056
 [96]  0.4221780464  0.3744879631  0.4594837950 -0.0936310397  0.1690020179
[101]  0.1884841624 -0.5583610822  0.5850229629  0.0746453102  0.5669493099
[106]  0.0208408379  0.2406315037 -0.0930212382  0.3718332376  0.0627000584
[111] -0.2185385039  0.1369442917  0.4877912446  0.0098938127  0.0026731622
[116]  0.6893559415 -0.3180226718 -0.2755960851  0.1036331619  0.5647578637
[121]  0.2652454044  0.8467333674  0.1663823630 -0.1910261774 -0.0096605725
[126]  0.2929052715 -0.5613652883  0.2730123907 -0.1421099637 -0.0570231996
[131] -0.3111881584  0.1755112622 -0.3338029861  0.2250147369  0.3689177812
[136]  0.4070142947 -0.2153024548  0.2539692184  0.2790529826 -0.2763960763
[141] -0.0533141376  0.0779742564 -0.3976899425  0.2284674944  0.3751710709
[146]  0.2027951644 -0.2260303780  0.5167984689 -0.0373356467  0.1563467068
[151]  0.1471624379 -0.2107219578  0.0088983961  0.2321897771  0.2271539308
[156] -0.0136959852  0.0562073643 -0.2544491052 -0.2499331374  0.2379580496
[161] -0.5436081273 -0.0459076631  0.0420954237  0.2035721421  0.0321038072
[166] -0.1603489005  0.1208462776  0.2939092013  0.0295338097  0.2041681751
[171] -0.1041820383  0.3320139722 -0.0378891870 -0.0210987226 -0.7909034083
[176]  0.0621289715  0.6603287477 -0.2129895280  0.0129849374  0.3775090735
[181] -0.3345407627 -0.7341888323  0.5486595021 -0.3158821874 -0.5200891287
[186] -0.2289468981 -0.5154019422 -0.1707034138  0.1324762166 -0.2256623120
[191] -0.0516057694  0.3119201376  0.5811226218 -0.1359111832 -0.3057230340
[196] -0.2225422467  0.1041914987 -0.0523571337 -0.2253181480 -0.1368576973
[201] -0.2363396927 -0.2345699301 -0.2848576803  0.4014776388 -0.0615824000
[206] -0.0483322887  0.5788233141 -0.0468328975 -0.3989491335  0.2628577973
[211]  0.0482573677 -0.0334566927  0.7228344058  0.0720949805  0.0441964022
[216]  0.2979798988 -0.4452236549 -0.2203262004  0.2572667397 -0.4199482857
[221] -0.0731343637  0.3915217784 -0.0398365900 -0.1046345297 -0.1799549843
[226] -0.2953180783 -0.0001444492 -0.1665129723  0.3694563252 -0.6723477722
> 
> proc.time()
   user  system elapsed 
  5.217  19.979  29.880 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-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: 0x600000454000>
> .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: 0x600000454000>
> .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: 0x600000454000>
> .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: 0x600000454000>
> 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: 0x600000464120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000464120>
> .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: 0x600000464120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000464120>
> .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: 0x600000464120>
> 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: 0x600000440000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000440000>
> .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: 0x600000440000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000440000>
> .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: 0x600000440000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600000440000>
> .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: 0x600000440000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600000440000>
> .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: 0x600000440000>
> 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: 0x600000440180>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000440180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000440180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000440180>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee1d33c7b46cd" "BufferedMatrixFilee1d369d3800a"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilee1d33c7b46cd" "BufferedMatrixFilee1d369d3800a"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000440420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000440420>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000440420>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000440420>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000440420>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000440420>
> .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: 0x600000464180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000464180>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000464180>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000464180>
> 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: 0x600000464300>
> .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: 0x600000464300>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.605   0.223   0.892 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-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.588   0.141   0.726 

Example timings