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

This page was generated on 2025-04-02 19:31 -0400 (Wed, 02 Apr 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.3 (2025-02-28) -- "Trophy Case" 4764
palomino8Windows Server 2022 Datacenterx644.4.3 (2025-02-28 ucrt) -- "Trophy Case" 4495
merida1macOS 12.7.5 Montereyx86_644.4.3 (2025-02-28) -- "Trophy Case" 4522
kjohnson1macOS 13.6.6 Venturaarm644.4.3 (2025-02-28) -- "Trophy Case" 4449
taishanLinux (openEuler 24.03 LTS)aarch644.4.3 (2025-02-28) -- "Trophy Case" 4426
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-03-31 13:00 -0400 (Mon, 31 Mar 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 -0400 (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-04-01 00:12:25 -0400 (Tue, 01 Apr 2025)
EndedAt: 2025-04-01 00:13:39 -0400 (Tue, 01 Apr 2025)
EllapsedTime: 74.7 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.3 (2025-02-28)
* 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.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 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.569   0.208   0.750 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 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 473668 25.3    1034025 55.3         NA   638622 34.2
Vcells 877290  6.7    8388608 64.0      65536  2072022 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 Apr  1 00:13:01 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 Apr  1 00:13:02 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: 0x600001ad0000>
> 
> 
> 
> 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 Apr  1 00:13:08 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 Apr  1 00:13:10 2025"
> 
> ColMode(tmp2)
<pointer: 0x600001ad0000>
> 
> 
> 
> ### 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.1051682  0.1034748 -0.39326113  0.7008453
[2,]  0.3522688 -2.1062924 -0.11984523  1.2861813
[3,]  0.9127070 -0.9275914 -0.60336335 -0.5876376
[4,]  0.5630499 -0.4174468  0.04057377  0.4424707
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]       [,3]      [,4]
[1,] 99.1051682 0.1034748 0.39326113 0.7008453
[2,]  0.3522688 2.1062924 0.11984523 1.2861813
[3,]  0.9127070 0.9275914 0.60336335 0.5876376
[4,]  0.5630499 0.4174468 0.04057377 0.4424707
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9551579 0.3216750 0.6271054 0.8371650
[2,] 0.5935224 1.4513072 0.3461867 1.1340993
[3,] 0.9553570 0.9631155 0.7767647 0.7665752
[4,] 0.7503665 0.6461012 0.2014293 0.6651847
> 
> 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 :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.65675 28.32022 31.66431 34.07250
[2,]  31.28749 41.61936 28.58171 37.62717
[3,]  35.46628 35.55875 33.37101 33.25339
[4,]  33.06672 31.87846 27.05487 32.09432
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600001ad0060>
> exp(tmp5)
<pointer: 0x600001ad0060>
> log(tmp5,2)
<pointer: 0x600001ad0060>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.5122
> Min(tmp5)
[1] 54.46178
> mean(tmp5)
[1] 73.00767
> Sum(tmp5)
[1] 14601.53
> Var(tmp5)
[1] 858.0246
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.40016 72.01688 69.47718 68.53124 67.12926 76.06635 71.49083 69.92089
 [9] 71.76996 72.27395
> rowSums(tmp5)
 [1] 1828.003 1440.338 1389.544 1370.625 1342.585 1521.327 1429.817 1398.418
 [9] 1435.399 1445.479
> rowVars(tmp5)
 [1] 7805.72059  110.72292   50.91673   75.27807   31.28502  103.11564
 [7]   48.01097   90.84599  101.61696  116.97775
> rowSd(tmp5)
 [1] 88.349989 10.522496  7.135596  8.676294  5.593301 10.154587  6.928995
 [8]  9.531316 10.080524 10.815625
> rowMax(tmp5)
 [1] 465.51222  90.70710  79.68890  85.26181  77.31707  92.01381  83.60612
 [8]  92.29787  87.83918  90.93416
> rowMin(tmp5)
 [1] 58.68817 54.86463 56.28796 56.13916 57.99916 58.75558 58.69572 56.67713
 [9] 57.18744 54.46178
> 
> colMeans(tmp5)
 [1] 112.27329  72.25175  66.73997  69.52174  69.68279  72.31701  70.67570
 [8]  74.71190  67.29829  70.36936  68.68005  68.64995  76.13026  71.53453
[15]  76.45139  70.46206  66.63807  68.43038  72.15916  75.17575
> colSums(tmp5)
 [1] 1122.7329  722.5175  667.3997  695.2174  696.8279  723.1701  706.7570
 [8]  747.1190  672.9829  703.6936  686.8005  686.4995  761.3026  715.3453
[15]  764.5139  704.6206  666.3807  684.3038  721.5916  751.7575
> colVars(tmp5)
 [1] 15446.90416   130.12234    37.60281    21.11138    76.55136    57.23504
 [7]    83.36765   120.43248    66.65532    62.83647   101.29056    39.58611
[13]    93.65497    70.51708   100.65454    70.20626    70.98118   113.17191
[19]   184.57382    37.58905
> colSd(tmp5)
 [1] 124.285575  11.407118   6.132113   4.594712   8.749364   7.565384
 [7]   9.130589  10.974173   8.164271   7.926946  10.064321   6.291749
[13]   9.677550   8.397445  10.032674   8.378917   8.425033  10.638229
[19]  13.585795   6.130991
> colMax(tmp5)
 [1] 465.51222  86.62525  76.16116  78.31603  82.85988  83.13429  84.53723
 [8]  88.59129  77.49851  79.03479  83.62142  81.57931  90.93416  83.53809
[15]  92.29787  85.26181  81.89958  87.34101  91.09296  85.76129
> colMin(tmp5)
 [1] 62.81319 55.81824 56.31116 61.43819 57.18744 56.28796 54.46178 57.99916
 [9] 56.13916 58.69572 57.09794 59.41544 59.74489 59.85761 62.65881 57.75213
[17] 56.67713 59.42726 54.86463 65.94967
> 
> 
> ### 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]       NA 72.01688 69.47718 68.53124 67.12926 76.06635 71.49083 69.92089
 [9] 71.76996 72.27395
> rowSums(tmp5)
 [1]       NA 1440.338 1389.544 1370.625 1342.585 1521.327 1429.817 1398.418
 [9] 1435.399 1445.479
> rowVars(tmp5)
 [1] 8199.84397  110.72292   50.91673   75.27807   31.28502  103.11564
 [7]   48.01097   90.84599  101.61696  116.97775
> rowSd(tmp5)
 [1] 90.552990 10.522496  7.135596  8.676294  5.593301 10.154587  6.928995
 [8]  9.531316 10.080524 10.815625
> rowMax(tmp5)
 [1]       NA 90.70710 79.68890 85.26181 77.31707 92.01381 83.60612 92.29787
 [9] 87.83918 90.93416
> rowMin(tmp5)
 [1]       NA 54.86463 56.28796 56.13916 57.99916 58.75558 58.69572 56.67713
 [9] 57.18744 54.46178
> 
> colMeans(tmp5)
 [1] 112.27329  72.25175  66.73997  69.52174  69.68279  72.31701  70.67570
 [8]  74.71190  67.29829  70.36936  68.68005  68.64995  76.13026  71.53453
[15]  76.45139  70.46206        NA  68.43038  72.15916  75.17575
> colSums(tmp5)
 [1] 1122.7329  722.5175  667.3997  695.2174  696.8279  723.1701  706.7570
 [8]  747.1190  672.9829  703.6936  686.8005  686.4995  761.3026  715.3453
[15]  764.5139  704.6206        NA  684.3038  721.5916  751.7575
> colVars(tmp5)
 [1] 15446.90416   130.12234    37.60281    21.11138    76.55136    57.23504
 [7]    83.36765   120.43248    66.65532    62.83647   101.29056    39.58611
[13]    93.65497    70.51708   100.65454    70.20626          NA   113.17191
[19]   184.57382    37.58905
> colSd(tmp5)
 [1] 124.285575  11.407118   6.132113   4.594712   8.749364   7.565384
 [7]   9.130589  10.974173   8.164271   7.926946  10.064321   6.291749
[13]   9.677550   8.397445  10.032674   8.378917         NA  10.638229
[19]  13.585795   6.130991
> colMax(tmp5)
 [1] 465.51222  86.62525  76.16116  78.31603  82.85988  83.13429  84.53723
 [8]  88.59129  77.49851  79.03479  83.62142  81.57931  90.93416  83.53809
[15]  92.29787  85.26181        NA  87.34101  91.09296  85.76129
> colMin(tmp5)
 [1] 62.81319 55.81824 56.31116 61.43819 57.18744 56.28796 54.46178 57.99916
 [9] 56.13916 58.69572 57.09794 59.41544 59.74489 59.85761 62.65881 57.75213
[17]       NA 59.42726 54.86463 65.94967
> 
> Max(tmp5,na.rm=TRUE)
[1] 465.5122
> Min(tmp5,na.rm=TRUE)
[1] 54.46178
> mean(tmp5,na.rm=TRUE)
[1] 73.04589
> Sum(tmp5,na.rm=TRUE)
[1] 14536.13
> Var(tmp5,na.rm=TRUE)
[1] 862.0644
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.76851 72.01688 69.47718 68.53124 67.12926 76.06635 71.49083 69.92089
 [9] 71.76996 72.27395
> rowSums(tmp5,na.rm=TRUE)
 [1] 1762.602 1440.338 1389.544 1370.625 1342.585 1521.327 1429.817 1398.418
 [9] 1435.399 1445.479
> rowVars(tmp5,na.rm=TRUE)
 [1] 8199.84397  110.72292   50.91673   75.27807   31.28502  103.11564
 [7]   48.01097   90.84599  101.61696  116.97775
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.552990 10.522496  7.135596  8.676294  5.593301 10.154587  6.928995
 [8]  9.531316 10.080524 10.815625
> rowMax(tmp5,na.rm=TRUE)
 [1] 465.51222  90.70710  79.68890  85.26181  77.31707  92.01381  83.60612
 [8]  92.29787  87.83918  90.93416
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.68817 54.86463 56.28796 56.13916 57.99916 58.75558 58.69572 56.67713
 [9] 57.18744 54.46178
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.27329  72.25175  66.73997  69.52174  69.68279  72.31701  70.67570
 [8]  74.71190  67.29829  70.36936  68.68005  68.64995  76.13026  71.53453
[15]  76.45139  70.46206  66.77546  68.43038  72.15916  75.17575
> colSums(tmp5,na.rm=TRUE)
 [1] 1122.7329  722.5175  667.3997  695.2174  696.8279  723.1701  706.7570
 [8]  747.1190  672.9829  703.6936  686.8005  686.4995  761.3026  715.3453
[15]  764.5139  704.6206  600.9791  684.3038  721.5916  751.7575
> colVars(tmp5,na.rm=TRUE)
 [1] 15446.90416   130.12234    37.60281    21.11138    76.55136    57.23504
 [7]    83.36765   120.43248    66.65532    62.83647   101.29056    39.58611
[13]    93.65497    70.51708   100.65454    70.20626    79.64148   113.17191
[19]   184.57382    37.58905
> colSd(tmp5,na.rm=TRUE)
 [1] 124.285575  11.407118   6.132113   4.594712   8.749364   7.565384
 [7]   9.130589  10.974173   8.164271   7.926946  10.064321   6.291749
[13]   9.677550   8.397445  10.032674   8.378917   8.924208  10.638229
[19]  13.585795   6.130991
> colMax(tmp5,na.rm=TRUE)
 [1] 465.51222  86.62525  76.16116  78.31603  82.85988  83.13429  84.53723
 [8]  88.59129  77.49851  79.03479  83.62142  81.57931  90.93416  83.53809
[15]  92.29787  85.26181  81.89958  87.34101  91.09296  85.76129
> colMin(tmp5,na.rm=TRUE)
 [1] 62.81319 55.81824 56.31116 61.43819 57.18744 56.28796 54.46178 57.99916
 [9] 56.13916 58.69572 57.09794 59.41544 59.74489 59.85761 62.65881 57.75213
[17] 56.67713 59.42726 54.86463 65.94967
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 72.01688 69.47718 68.53124 67.12926 76.06635 71.49083 69.92089
 [9] 71.76996 72.27395
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1440.338 1389.544 1370.625 1342.585 1521.327 1429.817 1398.418
 [9] 1435.399 1445.479
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA 110.72292  50.91673  75.27807  31.28502 103.11564  48.01097
 [8]  90.84599 101.61696 116.97775
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA 10.522496  7.135596  8.676294  5.593301 10.154587  6.928995
 [8]  9.531316 10.080524 10.815625
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 90.70710 79.68890 85.26181 77.31707 92.01381 83.60612 92.29787
 [9] 87.83918 90.93416
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 54.86463 56.28796 56.13916 57.99916 58.75558 58.69572 56.67713
 [9] 57.18744 54.46178
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 73.02452 73.73030 66.83273 69.36666 69.25182 72.08620 70.24304 75.25941
 [9] 66.42610 69.86439 69.79026 67.21336 76.57495 71.63975 77.22700 70.40470
[17]      NaN 68.56970 70.05540 74.94547
> colSums(tmp5,na.rm=TRUE)
 [1] 657.2206 663.5727 601.4946 624.2999 623.2664 648.7758 632.1874 677.3347
 [9] 597.8349 628.7795 628.1124 604.9202 689.1745 644.7577 695.0430 633.6423
[17]   0.0000 617.1273 630.4986 674.5092
> colVars(tmp5,na.rm=TRUE)
 [1]  47.52529 121.79403  42.20635  23.47975  84.03086  63.79007  91.68262
 [8] 132.11412  66.42911  67.82227 100.08553  21.31656 103.13715  79.20717
[15] 106.46886  78.94503        NA 127.10003 157.85540  41.69111
> colSd(tmp5,na.rm=TRUE)
 [1]  6.893859 11.036033  6.496642  4.845591  9.166835  7.986869  9.575104
 [8] 11.494091  8.150405  8.235427 10.004275  4.616986 10.155646  8.899841
[15] 10.318375  8.885101        NA 11.273865 12.564052  6.456866
> colMax(tmp5,na.rm=TRUE)
 [1] 81.99504 86.62525 76.16116 78.31603 82.85988 83.13429 84.53723 88.59129
 [9] 77.49851 79.03479 83.62142 71.88857 90.93416 83.53809 92.29787 85.26181
[17]     -Inf 87.34101 89.33007 85.76129
> colMin(tmp5,na.rm=TRUE)
 [1] 62.81319 55.81824 56.31116 61.43819 57.18744 56.28796 54.46178 57.99916
 [9] 56.13916 58.69572 57.09794 59.41544 59.74489 59.85761 62.65881 57.75213
[17]      Inf 59.42726 54.86463 65.94967
> 
> 
> 
> 
> 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] 316.0806 277.6753 162.4774 260.0123 305.0097 221.0187 102.7335 165.0827
 [9] 241.5494 152.1963
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 316.0806 277.6753 162.4774 260.0123 305.0097 221.0187 102.7335 165.0827
 [9] 241.5494 152.1963
> 
> 
> 
> 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.278977e-13 -1.136868e-13 -5.684342e-14 -5.684342e-14 -2.842171e-14
 [6]  2.842171e-14  0.000000e+00  0.000000e+00  5.684342e-14 -5.684342e-14
[11]  8.526513e-14 -5.684342e-14  0.000000e+00 -1.705303e-13 -1.705303e-13
[16] -1.705303e-13 -2.842171e-14 -1.989520e-13 -5.684342e-14  2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   19 
2   13 
2   1 
4   17 
3   17 
10   11 
10   19 
1   13 
2   6 
6   18 
8   4 
8   12 
9   13 
4   13 
4   1 
8   4 
1   6 
4   8 
10   18 
9   12 
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.429932
> Min(tmp)
[1] -2.070279
> mean(tmp)
[1] 0.08158677
> Sum(tmp)
[1] 8.158677
> Var(tmp)
[1] 0.9718563
> 
> rowMeans(tmp)
[1] 0.08158677
> rowSums(tmp)
[1] 8.158677
> rowVars(tmp)
[1] 0.9718563
> rowSd(tmp)
[1] 0.9858277
> rowMax(tmp)
[1] 2.429932
> rowMin(tmp)
[1] -2.070279
> 
> colMeans(tmp)
  [1] -0.11953861 -1.86720651  0.30662549 -0.87685291  1.12793411  0.88545117
  [7] -1.43778296 -1.64437113 -1.08113144 -0.47534572 -0.21475558  0.56843283
 [13] -0.36590865 -0.38371919  1.67184630  0.52131900 -1.23755756  0.25537161
 [19]  1.87647431 -0.36266387  0.76905461  1.61843696  0.61393425 -0.46918647
 [25]  0.30529808  1.33511670  1.53509112  0.74562157 -0.06646442  0.97368776
 [31] -2.07027853  1.59322283  0.76900810 -0.44794685  0.95413592  1.58451495
 [37]  0.21177113  0.04905762 -0.41491412 -1.01059626  0.17487434 -0.15522150
 [43]  1.37162757 -0.71307639 -1.56485710 -0.20970039  1.65597856 -1.55026197
 [49]  0.11345550  0.58807951  0.56909401  0.49281305  0.54186292 -1.45672791
 [55] -1.39239742  0.37280554  0.22908080  0.35665050 -0.46273425 -1.59166913
 [61]  0.52691380  0.87257533 -1.06872967  0.97489655 -0.14857523 -0.44510211
 [67] -0.18842331 -1.10658421  0.28910353 -1.22319611 -0.94214064 -0.22369078
 [73]  1.35501137 -0.82017116  0.38352298 -0.15581420  1.66120239  0.60747468
 [79]  0.65153782  0.74673540 -0.35774142  0.64155075  1.00127509 -0.16159157
 [85]  0.29935521  0.80315651  2.42993153  0.14698075 -0.91827974 -0.72992144
 [91] -0.14767008  0.75579723  1.56175845 -0.50527547 -0.81332538  0.08051257
 [97]  0.90123584 -1.54074131 -1.54744287  1.41770360
> colSums(tmp)
  [1] -0.11953861 -1.86720651  0.30662549 -0.87685291  1.12793411  0.88545117
  [7] -1.43778296 -1.64437113 -1.08113144 -0.47534572 -0.21475558  0.56843283
 [13] -0.36590865 -0.38371919  1.67184630  0.52131900 -1.23755756  0.25537161
 [19]  1.87647431 -0.36266387  0.76905461  1.61843696  0.61393425 -0.46918647
 [25]  0.30529808  1.33511670  1.53509112  0.74562157 -0.06646442  0.97368776
 [31] -2.07027853  1.59322283  0.76900810 -0.44794685  0.95413592  1.58451495
 [37]  0.21177113  0.04905762 -0.41491412 -1.01059626  0.17487434 -0.15522150
 [43]  1.37162757 -0.71307639 -1.56485710 -0.20970039  1.65597856 -1.55026197
 [49]  0.11345550  0.58807951  0.56909401  0.49281305  0.54186292 -1.45672791
 [55] -1.39239742  0.37280554  0.22908080  0.35665050 -0.46273425 -1.59166913
 [61]  0.52691380  0.87257533 -1.06872967  0.97489655 -0.14857523 -0.44510211
 [67] -0.18842331 -1.10658421  0.28910353 -1.22319611 -0.94214064 -0.22369078
 [73]  1.35501137 -0.82017116  0.38352298 -0.15581420  1.66120239  0.60747468
 [79]  0.65153782  0.74673540 -0.35774142  0.64155075  1.00127509 -0.16159157
 [85]  0.29935521  0.80315651  2.42993153  0.14698075 -0.91827974 -0.72992144
 [91] -0.14767008  0.75579723  1.56175845 -0.50527547 -0.81332538  0.08051257
 [97]  0.90123584 -1.54074131 -1.54744287  1.41770360
> 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.11953861 -1.86720651  0.30662549 -0.87685291  1.12793411  0.88545117
  [7] -1.43778296 -1.64437113 -1.08113144 -0.47534572 -0.21475558  0.56843283
 [13] -0.36590865 -0.38371919  1.67184630  0.52131900 -1.23755756  0.25537161
 [19]  1.87647431 -0.36266387  0.76905461  1.61843696  0.61393425 -0.46918647
 [25]  0.30529808  1.33511670  1.53509112  0.74562157 -0.06646442  0.97368776
 [31] -2.07027853  1.59322283  0.76900810 -0.44794685  0.95413592  1.58451495
 [37]  0.21177113  0.04905762 -0.41491412 -1.01059626  0.17487434 -0.15522150
 [43]  1.37162757 -0.71307639 -1.56485710 -0.20970039  1.65597856 -1.55026197
 [49]  0.11345550  0.58807951  0.56909401  0.49281305  0.54186292 -1.45672791
 [55] -1.39239742  0.37280554  0.22908080  0.35665050 -0.46273425 -1.59166913
 [61]  0.52691380  0.87257533 -1.06872967  0.97489655 -0.14857523 -0.44510211
 [67] -0.18842331 -1.10658421  0.28910353 -1.22319611 -0.94214064 -0.22369078
 [73]  1.35501137 -0.82017116  0.38352298 -0.15581420  1.66120239  0.60747468
 [79]  0.65153782  0.74673540 -0.35774142  0.64155075  1.00127509 -0.16159157
 [85]  0.29935521  0.80315651  2.42993153  0.14698075 -0.91827974 -0.72992144
 [91] -0.14767008  0.75579723  1.56175845 -0.50527547 -0.81332538  0.08051257
 [97]  0.90123584 -1.54074131 -1.54744287  1.41770360
> colMin(tmp)
  [1] -0.11953861 -1.86720651  0.30662549 -0.87685291  1.12793411  0.88545117
  [7] -1.43778296 -1.64437113 -1.08113144 -0.47534572 -0.21475558  0.56843283
 [13] -0.36590865 -0.38371919  1.67184630  0.52131900 -1.23755756  0.25537161
 [19]  1.87647431 -0.36266387  0.76905461  1.61843696  0.61393425 -0.46918647
 [25]  0.30529808  1.33511670  1.53509112  0.74562157 -0.06646442  0.97368776
 [31] -2.07027853  1.59322283  0.76900810 -0.44794685  0.95413592  1.58451495
 [37]  0.21177113  0.04905762 -0.41491412 -1.01059626  0.17487434 -0.15522150
 [43]  1.37162757 -0.71307639 -1.56485710 -0.20970039  1.65597856 -1.55026197
 [49]  0.11345550  0.58807951  0.56909401  0.49281305  0.54186292 -1.45672791
 [55] -1.39239742  0.37280554  0.22908080  0.35665050 -0.46273425 -1.59166913
 [61]  0.52691380  0.87257533 -1.06872967  0.97489655 -0.14857523 -0.44510211
 [67] -0.18842331 -1.10658421  0.28910353 -1.22319611 -0.94214064 -0.22369078
 [73]  1.35501137 -0.82017116  0.38352298 -0.15581420  1.66120239  0.60747468
 [79]  0.65153782  0.74673540 -0.35774142  0.64155075  1.00127509 -0.16159157
 [85]  0.29935521  0.80315651  2.42993153  0.14698075 -0.91827974 -0.72992144
 [91] -0.14767008  0.75579723  1.56175845 -0.50527547 -0.81332538  0.08051257
 [97]  0.90123584 -1.54074131 -1.54744287  1.41770360
> colMedians(tmp)
  [1] -0.11953861 -1.86720651  0.30662549 -0.87685291  1.12793411  0.88545117
  [7] -1.43778296 -1.64437113 -1.08113144 -0.47534572 -0.21475558  0.56843283
 [13] -0.36590865 -0.38371919  1.67184630  0.52131900 -1.23755756  0.25537161
 [19]  1.87647431 -0.36266387  0.76905461  1.61843696  0.61393425 -0.46918647
 [25]  0.30529808  1.33511670  1.53509112  0.74562157 -0.06646442  0.97368776
 [31] -2.07027853  1.59322283  0.76900810 -0.44794685  0.95413592  1.58451495
 [37]  0.21177113  0.04905762 -0.41491412 -1.01059626  0.17487434 -0.15522150
 [43]  1.37162757 -0.71307639 -1.56485710 -0.20970039  1.65597856 -1.55026197
 [49]  0.11345550  0.58807951  0.56909401  0.49281305  0.54186292 -1.45672791
 [55] -1.39239742  0.37280554  0.22908080  0.35665050 -0.46273425 -1.59166913
 [61]  0.52691380  0.87257533 -1.06872967  0.97489655 -0.14857523 -0.44510211
 [67] -0.18842331 -1.10658421  0.28910353 -1.22319611 -0.94214064 -0.22369078
 [73]  1.35501137 -0.82017116  0.38352298 -0.15581420  1.66120239  0.60747468
 [79]  0.65153782  0.74673540 -0.35774142  0.64155075  1.00127509 -0.16159157
 [85]  0.29935521  0.80315651  2.42993153  0.14698075 -0.91827974 -0.72992144
 [91] -0.14767008  0.75579723  1.56175845 -0.50527547 -0.81332538  0.08051257
 [97]  0.90123584 -1.54074131 -1.54744287  1.41770360
> colRanges(tmp)
           [,1]      [,2]      [,3]       [,4]     [,5]      [,6]      [,7]
[1,] -0.1195386 -1.867207 0.3066255 -0.8768529 1.127934 0.8854512 -1.437783
[2,] -0.1195386 -1.867207 0.3066255 -0.8768529 1.127934 0.8854512 -1.437783
          [,8]      [,9]      [,10]      [,11]     [,12]      [,13]      [,14]
[1,] -1.644371 -1.081131 -0.4753457 -0.2147556 0.5684328 -0.3659087 -0.3837192
[2,] -1.644371 -1.081131 -0.4753457 -0.2147556 0.5684328 -0.3659087 -0.3837192
        [,15]    [,16]     [,17]     [,18]    [,19]      [,20]     [,21]
[1,] 1.671846 0.521319 -1.237558 0.2553716 1.876474 -0.3626639 0.7690546
[2,] 1.671846 0.521319 -1.237558 0.2553716 1.876474 -0.3626639 0.7690546
        [,22]     [,23]      [,24]     [,25]    [,26]    [,27]     [,28]
[1,] 1.618437 0.6139342 -0.4691865 0.3052981 1.335117 1.535091 0.7456216
[2,] 1.618437 0.6139342 -0.4691865 0.3052981 1.335117 1.535091 0.7456216
           [,29]     [,30]     [,31]    [,32]     [,33]      [,34]     [,35]
[1,] -0.06646442 0.9736878 -2.070279 1.593223 0.7690081 -0.4479469 0.9541359
[2,] -0.06646442 0.9736878 -2.070279 1.593223 0.7690081 -0.4479469 0.9541359
        [,36]     [,37]      [,38]      [,39]     [,40]     [,41]      [,42]
[1,] 1.584515 0.2117711 0.04905762 -0.4149141 -1.010596 0.1748743 -0.1552215
[2,] 1.584515 0.2117711 0.04905762 -0.4149141 -1.010596 0.1748743 -0.1552215
        [,43]      [,44]     [,45]      [,46]    [,47]     [,48]     [,49]
[1,] 1.371628 -0.7130764 -1.564857 -0.2097004 1.655979 -1.550262 0.1134555
[2,] 1.371628 -0.7130764 -1.564857 -0.2097004 1.655979 -1.550262 0.1134555
         [,50]    [,51]     [,52]     [,53]     [,54]     [,55]     [,56]
[1,] 0.5880795 0.569094 0.4928131 0.5418629 -1.456728 -1.392397 0.3728055
[2,] 0.5880795 0.569094 0.4928131 0.5418629 -1.456728 -1.392397 0.3728055
         [,57]     [,58]      [,59]     [,60]     [,61]     [,62]    [,63]
[1,] 0.2290808 0.3566505 -0.4627342 -1.591669 0.5269138 0.8725753 -1.06873
[2,] 0.2290808 0.3566505 -0.4627342 -1.591669 0.5269138 0.8725753 -1.06873
         [,64]      [,65]      [,66]      [,67]     [,68]     [,69]     [,70]
[1,] 0.9748965 -0.1485752 -0.4451021 -0.1884233 -1.106584 0.2891035 -1.223196
[2,] 0.9748965 -0.1485752 -0.4451021 -0.1884233 -1.106584 0.2891035 -1.223196
          [,71]      [,72]    [,73]      [,74]    [,75]      [,76]    [,77]
[1,] -0.9421406 -0.2236908 1.355011 -0.8201712 0.383523 -0.1558142 1.661202
[2,] -0.9421406 -0.2236908 1.355011 -0.8201712 0.383523 -0.1558142 1.661202
         [,78]     [,79]     [,80]      [,81]     [,82]    [,83]      [,84]
[1,] 0.6074747 0.6515378 0.7467354 -0.3577414 0.6415507 1.001275 -0.1615916
[2,] 0.6074747 0.6515378 0.7467354 -0.3577414 0.6415507 1.001275 -0.1615916
         [,85]     [,86]    [,87]     [,88]      [,89]      [,90]      [,91]
[1,] 0.2993552 0.8031565 2.429932 0.1469807 -0.9182797 -0.7299214 -0.1476701
[2,] 0.2993552 0.8031565 2.429932 0.1469807 -0.9182797 -0.7299214 -0.1476701
         [,92]    [,93]      [,94]      [,95]      [,96]     [,97]     [,98]
[1,] 0.7557972 1.561758 -0.5052755 -0.8133254 0.08051257 0.9012358 -1.540741
[2,] 0.7557972 1.561758 -0.5052755 -0.8133254 0.08051257 0.9012358 -1.540741
         [,99]   [,100]
[1,] -1.547443 1.417704
[2,] -1.547443 1.417704
> 
> 
> Max(tmp2)
[1] 2.469414
> Min(tmp2)
[1] -3.766395
> mean(tmp2)
[1] -0.1387799
> Sum(tmp2)
[1] -13.87799
> Var(tmp2)
[1] 1.002525
> 
> rowMeans(tmp2)
  [1]  1.3921879791  0.0001771936  0.3575897222  0.7443222765 -3.7663954668
  [6] -0.0322521191 -1.0646845756  0.0146279808 -0.6921776787 -0.6974673768
 [11] -0.4835810899 -0.8508480530  0.2875440855  0.0540048278  0.0007046087
 [16]  1.5426581911 -0.0280833038  1.5575258214 -0.9655119067 -0.6873350978
 [21] -1.0528146638  0.8051648403 -0.5319166036 -0.8050230724  1.6238550056
 [26] -0.1349440812  0.2601540200 -0.7040365917  2.4694135240  0.6655621867
 [31] -0.7062258792  0.7742273837 -0.3639354634 -0.3846925170 -0.3538352128
 [36]  1.4960234661  0.8854081973  1.9857472404 -0.5936634802 -0.2457954271
 [41] -1.7297977642  0.2294397213 -0.0313239603  1.5313581625 -1.3166897649
 [46]  0.0414960019  0.4492656286  0.6018192129  1.3449574010  1.1706683048
 [51]  0.4499489604 -0.7352096616 -0.7607704698 -0.6828300521 -1.1503660661
 [56] -0.6442664003 -1.7386411300  0.2872077481 -0.6757355376  2.1238297921
 [61]  0.7243778331 -0.6541464554  1.1450202615 -1.7030192058  0.0669651278
 [66] -1.5448223601 -1.4376052927 -0.2259632052 -0.3934019739 -0.7260947529
 [71]  0.9986466446  0.3837178474 -0.1170150892 -1.8411230081 -0.4334288523
 [76] -1.4656972527  0.8747929172 -1.2235626622 -0.0106945460 -0.6598709575
 [81] -0.1899377792 -1.7771287052 -0.6976481624 -0.6020860905  1.0224818701
 [86] -0.2690130824 -0.1718854276 -0.6505266787 -0.0170930785  0.2668890282
 [91] -0.4663224331  0.5030222062 -0.1978808676 -0.4502773335  0.2750087358
 [96] -0.1814190350  0.3971942134 -1.8314549843 -0.0095541251 -1.1234696245
> rowSums(tmp2)
  [1]  1.3921879791  0.0001771936  0.3575897222  0.7443222765 -3.7663954668
  [6] -0.0322521191 -1.0646845756  0.0146279808 -0.6921776787 -0.6974673768
 [11] -0.4835810899 -0.8508480530  0.2875440855  0.0540048278  0.0007046087
 [16]  1.5426581911 -0.0280833038  1.5575258214 -0.9655119067 -0.6873350978
 [21] -1.0528146638  0.8051648403 -0.5319166036 -0.8050230724  1.6238550056
 [26] -0.1349440812  0.2601540200 -0.7040365917  2.4694135240  0.6655621867
 [31] -0.7062258792  0.7742273837 -0.3639354634 -0.3846925170 -0.3538352128
 [36]  1.4960234661  0.8854081973  1.9857472404 -0.5936634802 -0.2457954271
 [41] -1.7297977642  0.2294397213 -0.0313239603  1.5313581625 -1.3166897649
 [46]  0.0414960019  0.4492656286  0.6018192129  1.3449574010  1.1706683048
 [51]  0.4499489604 -0.7352096616 -0.7607704698 -0.6828300521 -1.1503660661
 [56] -0.6442664003 -1.7386411300  0.2872077481 -0.6757355376  2.1238297921
 [61]  0.7243778331 -0.6541464554  1.1450202615 -1.7030192058  0.0669651278
 [66] -1.5448223601 -1.4376052927 -0.2259632052 -0.3934019739 -0.7260947529
 [71]  0.9986466446  0.3837178474 -0.1170150892 -1.8411230081 -0.4334288523
 [76] -1.4656972527  0.8747929172 -1.2235626622 -0.0106945460 -0.6598709575
 [81] -0.1899377792 -1.7771287052 -0.6976481624 -0.6020860905  1.0224818701
 [86] -0.2690130824 -0.1718854276 -0.6505266787 -0.0170930785  0.2668890282
 [91] -0.4663224331  0.5030222062 -0.1978808676 -0.4502773335  0.2750087358
 [96] -0.1814190350  0.3971942134 -1.8314549843 -0.0095541251 -1.1234696245
> 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]  1.3921879791  0.0001771936  0.3575897222  0.7443222765 -3.7663954668
  [6] -0.0322521191 -1.0646845756  0.0146279808 -0.6921776787 -0.6974673768
 [11] -0.4835810899 -0.8508480530  0.2875440855  0.0540048278  0.0007046087
 [16]  1.5426581911 -0.0280833038  1.5575258214 -0.9655119067 -0.6873350978
 [21] -1.0528146638  0.8051648403 -0.5319166036 -0.8050230724  1.6238550056
 [26] -0.1349440812  0.2601540200 -0.7040365917  2.4694135240  0.6655621867
 [31] -0.7062258792  0.7742273837 -0.3639354634 -0.3846925170 -0.3538352128
 [36]  1.4960234661  0.8854081973  1.9857472404 -0.5936634802 -0.2457954271
 [41] -1.7297977642  0.2294397213 -0.0313239603  1.5313581625 -1.3166897649
 [46]  0.0414960019  0.4492656286  0.6018192129  1.3449574010  1.1706683048
 [51]  0.4499489604 -0.7352096616 -0.7607704698 -0.6828300521 -1.1503660661
 [56] -0.6442664003 -1.7386411300  0.2872077481 -0.6757355376  2.1238297921
 [61]  0.7243778331 -0.6541464554  1.1450202615 -1.7030192058  0.0669651278
 [66] -1.5448223601 -1.4376052927 -0.2259632052 -0.3934019739 -0.7260947529
 [71]  0.9986466446  0.3837178474 -0.1170150892 -1.8411230081 -0.4334288523
 [76] -1.4656972527  0.8747929172 -1.2235626622 -0.0106945460 -0.6598709575
 [81] -0.1899377792 -1.7771287052 -0.6976481624 -0.6020860905  1.0224818701
 [86] -0.2690130824 -0.1718854276 -0.6505266787 -0.0170930785  0.2668890282
 [91] -0.4663224331  0.5030222062 -0.1978808676 -0.4502773335  0.2750087358
 [96] -0.1814190350  0.3971942134 -1.8314549843 -0.0095541251 -1.1234696245
> rowMin(tmp2)
  [1]  1.3921879791  0.0001771936  0.3575897222  0.7443222765 -3.7663954668
  [6] -0.0322521191 -1.0646845756  0.0146279808 -0.6921776787 -0.6974673768
 [11] -0.4835810899 -0.8508480530  0.2875440855  0.0540048278  0.0007046087
 [16]  1.5426581911 -0.0280833038  1.5575258214 -0.9655119067 -0.6873350978
 [21] -1.0528146638  0.8051648403 -0.5319166036 -0.8050230724  1.6238550056
 [26] -0.1349440812  0.2601540200 -0.7040365917  2.4694135240  0.6655621867
 [31] -0.7062258792  0.7742273837 -0.3639354634 -0.3846925170 -0.3538352128
 [36]  1.4960234661  0.8854081973  1.9857472404 -0.5936634802 -0.2457954271
 [41] -1.7297977642  0.2294397213 -0.0313239603  1.5313581625 -1.3166897649
 [46]  0.0414960019  0.4492656286  0.6018192129  1.3449574010  1.1706683048
 [51]  0.4499489604 -0.7352096616 -0.7607704698 -0.6828300521 -1.1503660661
 [56] -0.6442664003 -1.7386411300  0.2872077481 -0.6757355376  2.1238297921
 [61]  0.7243778331 -0.6541464554  1.1450202615 -1.7030192058  0.0669651278
 [66] -1.5448223601 -1.4376052927 -0.2259632052 -0.3934019739 -0.7260947529
 [71]  0.9986466446  0.3837178474 -0.1170150892 -1.8411230081 -0.4334288523
 [76] -1.4656972527  0.8747929172 -1.2235626622 -0.0106945460 -0.6598709575
 [81] -0.1899377792 -1.7771287052 -0.6976481624 -0.6020860905  1.0224818701
 [86] -0.2690130824 -0.1718854276 -0.6505266787 -0.0170930785  0.2668890282
 [91] -0.4663224331  0.5030222062 -0.1978808676 -0.4502773335  0.2750087358
 [96] -0.1814190350  0.3971942134 -1.8314549843 -0.0095541251 -1.1234696245
> 
> colMeans(tmp2)
[1] -0.1387799
> colSums(tmp2)
[1] -13.87799
> colVars(tmp2)
[1] 1.002525
> colSd(tmp2)
[1] 1.001262
> colMax(tmp2)
[1] 2.469414
> colMin(tmp2)
[1] -3.766395
> colMedians(tmp2)
[1] -0.1856784
> colRanges(tmp2)
          [,1]
[1,] -3.766395
[2,]  2.469414
> 
> 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] -6.3978824 -1.9937269 -5.2147521 -0.2022783 -0.9570171  3.7781407
 [7]  0.2192748  0.2153994  1.0148842 -0.2872577
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -3.3824652
[2,] -0.8133229
[3,] -0.4202179
[4,]  0.1023559
[5,]  0.7252500
> 
> rowApply(tmp,sum)
 [1] -2.2399558 -3.4153739 -2.2339283 -0.9390056 -1.6580861 -1.8892403
 [7] -1.1797613 -0.3308806  0.7161709  3.3448457
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    1    5    9    4    5    2    6    8     4
 [2,]   10    4    8    3    5    6    6    4    3     8
 [3,]    2    2    1    4    3    1    9    3    6    10
 [4,]    8    8    2    2    1    4    4   10    9     9
 [5,]    7    7    6    8    2    3    8    7    1     2
 [6,]    3    3   10    6   10    8   10    9   10     7
 [7,]    4    5    7   10    7    7    3    5    7     6
 [8,]    6   10    4    5    6    2    7    8    2     3
 [9,]    9    6    9    7    8    9    1    2    5     1
[10,]    5    9    3    1    9   10    5    1    4     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.4418036 -6.6582566  0.9681691 -0.1507722  0.1161875 -0.1256616
 [7] -0.1383755 -0.8866072  4.5463103  1.5195293  1.2728479  0.4984938
[13] -2.2925777  1.6671763 -1.9242858 -2.0036186 -0.3196411  0.6024083
[19]  0.2912125  3.6067074
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5689467
[2,] -1.3704104
[3,] -0.5447731
[4,] -0.1651117
[5,]  0.2074383
> 
> rowApply(tmp,sum)
[1]  2.2938535  0.1481281 -4.3718980  1.5312695 -2.4539105
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    4   14   10    3    2
[2,]    3    1   16    1    4
[3,]   11    6   17   12   11
[4,]   10   16    8   17    1
[5,]   13    3   19    4   19
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
[1,] -0.5447731 -0.8029159  0.1563891  0.1544812  0.3747859  1.07652943
[2,]  0.2074383 -2.2411536 -0.1614992  0.6565377 -1.4375541 -0.04962799
[3,] -0.1651117  0.3509457  0.3656711 -0.3017745  1.0104940 -0.97169861
[4,] -1.3704104 -2.6572734  0.7140195  1.2078963 -1.0669040 -0.38039569
[5,] -1.5689467 -1.3078594 -0.1064115 -1.8679129  1.2353657  0.19953130
           [,7]       [,8]       [,9]      [,10]       [,11]       [,12]
[1,]  1.1453637 -0.2261215  1.1342932  0.9814347 -0.23693923  0.94000178
[2,] -2.0962561 -0.1999460  1.7761208  0.6569065  0.01632034  0.08824273
[3,]  0.5434791 -1.4277781  1.7181520 -0.7894618 -0.05621838  0.16049452
[4,]  0.7371294  1.3895230 -0.5229319  0.8087372  0.37059475 -1.87857957
[5,] -0.4680915 -0.4222846  0.4406763 -0.1380874  1.17909040  1.18833439
           [,13]      [,14]      [,15]       [,16]       [,17]      [,18]
[1,] -0.08299349  0.2617973 -1.6705155 -1.11278907 -0.44932524 -0.3105207
[2,]  0.23440564  1.6061424 -0.7238157 -0.11810267  0.06858484  0.1941093
[3,] -1.47534989  0.1708452 -0.6896321 -0.03465725 -0.28305885 -0.9993037
[4,] -0.72536248 -0.5340722  1.0680657  0.02004424  1.29125633  1.7633624
[5,] -0.24327743  0.1624635  0.0916119 -0.75811387 -0.94709819 -0.0452391
           [,19]      [,20]
[1,]  0.68866775  0.8170031
[2,] -0.04484276  1.7161175
[3,]  0.07130013 -1.5692349
[4,]  1.05423810  0.2423324
[5,] -1.47815067  2.4004893
> 
> 
> 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 :  655  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 :  567  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 0.6216749 -0.25973 0.2799877 0.2129633 0.113811 0.5934298 -0.5724716
          col8      col9     col10      col11     col12    col13     col14
row1 -2.549046 -2.318313 0.1607926 -0.9232986 -1.537908 1.209114 0.1956376
         col15     col16     col17   col18      col19     col20
row1 0.5882577 -1.892201 -1.616813 2.00109 -0.6760903 0.5174747
> tmp[,"col10"]
           col10
row1  0.16079259
row2  0.09415456
row3  0.61850097
row4  1.58944113
row5 -1.27307917
> tmp[c("row1","row5"),]
           col1      col2       col3       col4       col5      col6       col7
row1  0.6216749 -0.259730  0.2799877  0.2129633  0.1138110 0.5934298 -0.5724716
row5 -0.3023155 -1.076172 -0.6609632 -1.2763961 -0.8729613 1.4701254  1.8669179
           col8       col9      col10      col11       col12    col13     col14
row1 -2.5490462 -2.3183127  0.1607926 -0.9232986 -1.53790784 1.209114 0.1956376
row5  0.2516744  0.1528744 -1.2730792  1.7311973  0.07069345 1.621279 0.8401331
         col15      col16     col17     col18      col19      col20
row1 0.5882577 -1.8922008 -1.616813 2.0010900 -0.6760903  0.5174747
row5 0.3960694 -0.9356172 -2.090879 0.6130921  2.4088784 -2.3382840
> tmp[,c("col6","col20")]
           col6      col20
row1  0.5934298  0.5174747
row2 -0.4306524  0.3537646
row3  0.8116122  0.3377167
row4 -1.5570924 -0.8548229
row5  1.4701254 -2.3382840
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.5934298  0.5174747
row5 1.4701254 -2.3382840
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1   col2     col3     col4     col5     col6     col7     col8
row1 49.12938 50.049 50.12247 49.91194 50.19603 106.2384 49.96089 51.04738
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.56787 49.13979 49.80134 50.79547 48.62925 48.41317 51.47723 48.39572
        col17    col18    col19    col20
row1 51.00445 48.25907 47.97565 105.4785
> tmp[,"col10"]
        col10
row1 49.13979
row2 29.18641
row3 29.98744
row4 29.50488
row5 50.43833
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.12938 50.04900 50.12247 49.91194 50.19603 106.2384 49.96089 51.04738
row5 49.48759 48.41792 50.91038 51.82989 50.31005 104.1624 50.34394 49.43053
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.56787 49.13979 49.80134 50.79547 48.62925 48.41317 51.47723 48.39572
row5 50.01371 50.43833 51.29968 51.60881 50.78978 50.27922 49.91415 50.56907
        col17    col18    col19    col20
row1 51.00445 48.25907 47.97565 105.4785
row5 49.50829 51.10261 49.46911 104.2698
> tmp[,c("col6","col20")]
          col6     col20
row1 106.23841 105.47855
row2  74.48417  74.15261
row3  74.71060  75.95204
row4  74.97630  74.96275
row5 104.16243 104.26982
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.2384 105.4785
row5 104.1624 104.2698
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.2384 105.4785
row5 104.1624 104.2698
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.1973660
[2,]  0.9572285
[3,]  0.6871701
[4,] -1.1278560
[5,]  1.0189606
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.0512156  0.5159743
[2,] -0.9760616  0.7821885
[3,]  0.9591849  2.3855420
[4,] -1.8770868 -0.3945583
[5,]  0.8861799  0.1998446
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
          col6       col20
[1,]  0.103357 -1.63666199
[2,]  1.064749 -0.13664471
[3,] -1.449004  0.74773464
[4,] -1.431958 -0.09492106
[5,]  1.506494  0.01008524
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 0.103357
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
         col6
[1,] 0.103357
[2,] 1.064749
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3  0.5911642 -1.8719480 -0.7803995 -1.2341828 -0.2769755  0.5589559
row1 -1.0271767  0.8884266  1.2971895  0.6503826 -0.3738449 -1.1932656
          [,7]       [,8]       [,9]      [,10]     [,11]     [,12]     [,13]
row3 0.8958641  1.0013615  0.5511124  0.1743410 0.4626751 1.4792293  1.016289
row1 1.4350746 -0.4187808 -0.5489281 -0.2267474 0.1024530 0.5322504 -2.484911
         [,14]      [,15]      [,16]      [,17]      [,18]     [,19]     [,20]
row3 -1.019031 -0.5651294 -0.3712044 -0.4089143 -0.1540632 -1.446590 -1.119878
row1  1.070273 -1.4073092  0.6814162 -0.7583925  0.1868131 -1.435023 -2.244002
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]       [,4]       [,5]       [,6]       [,7]
row2 1.113738 -0.962421 0.3121871 -0.3975965 -0.8804163 -0.1999689 -0.2730022
          [,8]      [,9]      [,10]
row2 0.3781846 -1.499077 -0.4157991
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]      [,4]     [,5]      [,6]       [,7]
row5 0.4180823 0.6652152 -1.486779 -1.805505 -2.26426 0.9727924 -0.6556056
           [,8]      [,9]     [,10]    [,11]      [,12]     [,13]    [,14]
row5 -0.2182564 -1.203206 0.1813855 1.401175 -0.2732219 0.7064237 1.253885
        [,15]     [,16]     [,17]     [,18]     [,19]    [,20]
row5 0.320933 -1.583583 0.7276033 0.5980282 0.5312304 0.114346
> 
> 
> 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: 0x600001ac4060>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c1686831dc"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c110a19811"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c161068c9e"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c174fa0ad5"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c14bdd61f2"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c133497dc7"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c11de0ae1f"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c19c7848c" 
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c19cf0858" 
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c1772cce6f"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c11ea51689"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c1686a8c16"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c12b132de8"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c1782af06f"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM139c14b0f450b"
> 
> 
> ### 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: 0x600001a9c000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600001a9c000>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600001a9c000>
> rowMedians(tmp)
  [1] -0.4976786158 -0.2931706004  0.4783915465 -0.0261899861  0.1874622752
  [6] -0.0208355789  0.0192982702 -0.3411441847 -0.2629933115 -0.5425474033
 [11] -0.1324860811 -0.2606437744 -0.2743922485 -0.3268941575 -0.4919560553
 [16]  0.0641355728  0.3709114261  0.0819403755 -0.4840177126  0.0231117781
 [21] -0.4667513994  0.3237742843  0.0776623221  0.0373211716 -0.4226615403
 [26] -0.0865776241  0.2637339208 -0.2429772668  0.0662666486  0.0381585154
 [31] -0.3508498210 -0.2706339316  0.1285039040  0.1602833470 -0.1193136737
 [36] -0.3124989730 -0.2249786866  0.5720106529  0.0202475152 -0.1903864138
 [41] -0.5460137076 -0.1077566487 -0.7755783841  0.0249597996 -0.3864090406
 [46]  0.2768771828  0.6213824277 -0.4335539670 -0.1645323883 -0.2318991291
 [51] -0.3128939660  0.5876366771 -0.1525596196  0.0993268601  0.1383899119
 [56]  0.2641939681 -0.3079921375 -0.1332390282 -0.0963362244 -0.4296788165
 [61] -0.4431080247  0.0743448594  0.0026817567 -0.6853345845 -0.5018463400
 [66] -0.2194177580 -0.6109993930  0.1775293182  0.2444366297  0.3337978803
 [71] -0.1115438713  0.0399154193 -0.3090858335  0.0004417457 -0.1427714575
 [76] -0.4536184841  0.1429318772  0.1650532902  0.0087896557  0.4289960721
 [81]  0.2012648628  0.3863662385  0.1162316041  0.0701871679  0.0138189120
 [86] -0.2871020443 -0.2609618762 -0.0443576233 -0.4543339500  0.4087399612
 [91]  0.1668002976  0.0683824935  0.5177900852  0.2852727212 -0.2649963074
 [96]  0.1483132578  0.0957972522  0.6973924673 -0.3480488647 -0.0441485237
[101]  0.2104511841  0.1818878114 -0.1700889527 -0.1145045145 -0.0174752102
[106] -0.0344075258  0.3280729354 -0.2295113348 -0.2513334725 -0.2046082191
[111]  0.1794241340 -0.2317765895 -0.2898230669  0.6448936245  0.0728040888
[116] -0.4246556934  0.5661924718  0.3002715424  0.1591500628  0.3747180078
[121]  0.2652254322 -0.1871286517 -0.7984796269  0.0456510485 -0.1156038940
[126]  0.4318376660 -0.7318008434 -0.5204470408 -0.2404925202 -0.3034460676
[131] -0.0674615417  0.0894622996  0.2239888096  0.1953477740  0.4145179984
[136] -0.1008852912 -0.0342198514  0.2048564259 -0.3824002902  0.1750689868
[141] -0.4215510784  0.0726990893  0.4284428326  0.1888722991 -0.1702660294
[146] -0.3755685069  0.4146896061 -0.1575357087  0.0801539967  0.0948622903
[151] -0.4729724099 -0.0692886284 -0.2351645281  0.1482511225 -0.3512281442
[156] -0.0537274277 -0.0587725371  0.2130011273 -0.1595566038  0.5826337403
[161]  0.5085131143 -0.0572669112  0.1852620468  0.0854847607 -0.2375277884
[166]  0.1114074399  0.2143132831 -0.3944758434 -0.2846386536  0.0134352708
[171]  0.0483682576 -0.4512108067 -0.2481580802 -0.3220625115 -0.0822659543
[176] -0.0107837068  0.0358043302 -0.2356133409 -0.2748153044  0.0047981246
[181]  0.1618022784  0.0277484898 -0.1601108813  0.4930030031 -0.1657050246
[186]  0.4496775641 -0.2989486094  0.1684703054  0.4158629110 -0.0632900142
[191]  0.3419876439  0.0037464336 -0.4048846694  0.2328406263  0.6940523566
[196]  0.1349343501 -0.1962362601 -0.3532981824 -0.1254453252 -0.1454219619
[201]  0.2313028974  0.0928644477 -0.4170999269 -0.3067830876  0.4709598665
[206]  0.1198416444  0.6606883622 -0.3553124643  0.0740090492 -0.1539983735
[211]  0.0228429941  0.1472664607  0.1230899957 -0.0167324629 -0.0633370188
[216] -0.3777601148  0.1098396065 -0.0402223774 -0.5149620685  0.6419894963
[221] -0.0882203945  0.0497747009  0.0519718332 -0.3249488325  0.2648514098
[226]  0.0204343400 -0.0721420217 -0.3320032714  0.3315661931  0.1166968501
> 
> proc.time()
   user  system elapsed 
  5.106  18.747  25.757 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 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: 0x6000019b4000>
> .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: 0x6000019b4000>
> .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: 0x6000019b4000>
> .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: 0x6000019b4000>
> 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: 0x6000019b40c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019b40c0>
> .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: 0x6000019b40c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019b40c0>
> .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: 0x6000019b40c0>
> 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: 0x6000019bc000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019bc000>
> .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: 0x6000019bc000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000019bc000>
> .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: 0x6000019bc000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x6000019bc000>
> .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: 0x6000019bc000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x6000019bc000>
> .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: 0x6000019bc000>
> 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: 0x6000019a0000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000019a0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019a0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019a0000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile13e7c2d2c52c2" "BufferedMatrixFile13e7c38ed55b9"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile13e7c2d2c52c2" "BufferedMatrixFile13e7c38ed55b9"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019a4120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019a4120>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000019a4120>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000019a4120>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000019a4120>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000019a4120>
> .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: 0x6000019a4300>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000019a4300>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000019a4300>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000019a4300>
> 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: 0x6000019a8000>
> .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: 0x6000019a8000>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.567   0.213   0.766 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.3 (2025-02-28) -- "Trophy Case"
Copyright (C) 2025 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.583   0.137   0.688 

Example timings