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

This page was generated on 2025-01-24 11:41 -0500 (Fri, 24 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_64R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" 4609
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2025-01-21 r87610 ucrt) -- "Unsuffered Consequences" 4393
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" 3839
kjohnson3macOS 13.7.1 Venturaarm64R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" 3835
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch64R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" 4408
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 246/2286HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.71.1  (landing page)
Ben Bolstad
Snapshot Date: 2025-01-23 13:40 -0500 (Thu, 23 Jan 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 824836d
git_last_commit_date: 2024-12-14 17:47:34 -0500 (Sat, 14 Dec 2024)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on lconway

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.71.1
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.71.1.tar.gz
StartedAt: 2025-01-23 18:03:01 -0500 (Thu, 23 Jan 2025)
EndedAt: 2025-01-23 18:04:32 -0500 (Thu, 23 Jan 2025)
EllapsedTime: 90.9 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.71.1.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-01-20 r87609)
* using platform: x86_64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 14.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.71.1’
* 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.21-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.21-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.5-x86_64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.71.1’
** 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.5-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 Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences"
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.333   0.152   0.486 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences"
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.21-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 480184 25.7    1054627 56.4         NA   634654 33.9
Vcells 889953  6.8    8388608 64.0      98304  2107350 16.1
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Jan 23 18:03:25 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] "Thu Jan 23 18:03:25 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: 0x600000dc0000>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Jan 23 18:03:29 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] "Thu Jan 23 18:03:31 2025"
> 
> ColMode(tmp2)
<pointer: 0x600000dc0000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
          [,1]        [,2]       [,3]      [,4]
[1,] 98.531942 -1.22855182 -0.9777973 0.6180342
[2,] -1.638092  1.39365043 -1.5328392 1.2872574
[3,]  1.538712 -1.32941489 -2.9500980 0.8152481
[4,]  1.540366 -0.08026813 -0.5060671 1.5855785
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]       [,2]      [,3]      [,4]
[1,] 98.531942 1.22855182 0.9777973 0.6180342
[2,]  1.638092 1.39365043 1.5328392 1.2872574
[3,]  1.538712 1.32941489 2.9500980 0.8152481
[4,]  1.540366 0.08026813 0.5060671 1.5855785
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
         [,1]      [,2]      [,3]      [,4]
[1,] 9.926326 1.1084006 0.9888364 0.7861515
[2,] 1.279880 1.1805297 1.2380788 1.1345737
[3,] 1.240448 1.1530026 1.7175849 0.9029109
[4,] 1.241115 0.2833163 0.7113839 1.2591976
> 
> 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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 222.79520 37.31256 35.86616 33.47955
[2,]  39.43689 38.19895 38.91363 37.63299
[3,]  38.94320 37.85944 45.12595 34.84436
[4,]  38.95151 27.91343 32.61991 39.17755
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000dcc000>
> exp(tmp5)
<pointer: 0x600000dcc000>
> log(tmp5,2)
<pointer: 0x600000dcc000>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 463.719
> Min(tmp5)
[1] 52.95219
> mean(tmp5)
[1] 73.18997
> Sum(tmp5)
[1] 14637.99
> Var(tmp5)
[1] 842.468
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.24081 69.98172 71.50793 70.66749 70.84046 70.66421 71.02577 73.78805
 [9] 71.39531 71.78794
> rowSums(tmp5)
 [1] 1804.816 1399.634 1430.159 1413.350 1416.809 1413.284 1420.515 1475.761
 [9] 1427.906 1435.759
> rowVars(tmp5)
 [1] 7810.02908   80.06105   94.95924   50.81003   55.93839   66.38631
 [7]  100.59505   61.92421   30.28550  122.91885
> rowSd(tmp5)
 [1] 88.374369  8.947684  9.744703  7.128116  7.479197  8.147780 10.029709
 [8]  7.869194  5.503226 11.086877
> rowMax(tmp5)
 [1] 463.71902  86.02173  93.92375  81.71318  85.60920  82.20215  99.47429
 [8]  91.44456  84.13067  90.22914
> rowMin(tmp5)
 [1] 53.10713 54.34425 57.33841 58.09815 56.74534 53.56419 52.95219 60.77943
 [9] 60.29031 54.23515
> 
> colMeans(tmp5)
 [1] 110.56793  75.20138  75.46660  75.39512  69.76141  69.94991  73.49480
 [8]  73.92770  69.38414  76.15503  71.43998  67.76499  69.39337  73.26272
[15]  69.42274  66.78378  68.75513  68.70184  68.97597  69.99483
> colSums(tmp5)
 [1] 1105.6793  752.0138  754.6660  753.9512  697.6141  699.4991  734.9480
 [8]  739.2770  693.8414  761.5503  714.3998  677.6499  693.9337  732.6272
[15]  694.2274  667.8378  687.5513  687.0184  689.7597  699.9483
> colVars(tmp5)
 [1] 15477.57948    62.41749   109.40635    36.22250    64.11405   129.71966
 [7]    59.48994   116.66059    18.88027   140.04648    25.97741    61.07252
[13]    85.94043    29.19603    58.48714    48.68322    42.72364    81.62567
[19]   107.89497    63.66385
> colSd(tmp5)
 [1] 124.408920   7.900474  10.459749   6.018513   8.007125  11.389454
 [7]   7.712972  10.800953   4.345143  11.834123   5.096804   7.814891
[13]   9.270406   5.403335   7.647689   6.977336   6.536333   9.034693
[19]  10.387250   7.978963
> colMax(tmp5)
 [1] 463.71902  83.55706  93.92375  84.03521  81.71318  92.76543  87.71533
 [8]  91.44456  74.78826  99.47429  82.62315  84.09270  90.22914  80.77258
[15]  79.56582  73.94968  78.74816  89.25714  80.60601  88.95077
> colMin(tmp5)
 [1] 56.74534 58.09815 60.29031 67.85638 55.36702 54.23515 62.65090 60.01061
 [9] 61.86705 58.90991 65.96822 57.72322 58.09627 61.29260 53.10713 53.56419
[17] 60.77943 56.30732 52.95219 60.22937
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 90.24081 69.98172 71.50793 70.66749 70.84046 70.66421       NA 73.78805
 [9] 71.39531 71.78794
> rowSums(tmp5)
 [1] 1804.816 1399.634 1430.159 1413.350 1416.809 1413.284       NA 1475.761
 [9] 1427.906 1435.759
> rowVars(tmp5)
 [1] 7810.02908   80.06105   94.95924   50.81003   55.93839   66.38631
 [7]  105.23538   61.92421   30.28550  122.91885
> rowSd(tmp5)
 [1] 88.374369  8.947684  9.744703  7.128116  7.479197  8.147780 10.258429
 [8]  7.869194  5.503226 11.086877
> rowMax(tmp5)
 [1] 463.71902  86.02173  93.92375  81.71318  85.60920  82.20215        NA
 [8]  91.44456  84.13067  90.22914
> rowMin(tmp5)
 [1] 53.10713 54.34425 57.33841 58.09815 56.74534 53.56419       NA 60.77943
 [9] 60.29031 54.23515
> 
> colMeans(tmp5)
 [1]       NA 75.20138 75.46660 75.39512 69.76141 69.94991 73.49480 73.92770
 [9] 69.38414 76.15503 71.43998 67.76499 69.39337 73.26272 69.42274 66.78378
[17] 68.75513 68.70184 68.97597 69.99483
> colSums(tmp5)
 [1]       NA 752.0138 754.6660 753.9512 697.6141 699.4991 734.9480 739.2770
 [9] 693.8414 761.5503 714.3998 677.6499 693.9337 732.6272 694.2274 667.8378
[17] 687.5513 687.0184 689.7597 699.9483
> colVars(tmp5)
 [1]        NA  62.41749 109.40635  36.22250  64.11405 129.71966  59.48994
 [8] 116.66059  18.88027 140.04648  25.97741  61.07252  85.94043  29.19603
[15]  58.48714  48.68322  42.72364  81.62567 107.89497  63.66385
> colSd(tmp5)
 [1]        NA  7.900474 10.459749  6.018513  8.007125 11.389454  7.712972
 [8] 10.800953  4.345143 11.834123  5.096804  7.814891  9.270406  5.403335
[15]  7.647689  6.977336  6.536333  9.034693 10.387250  7.978963
> colMax(tmp5)
 [1]       NA 83.55706 93.92375 84.03521 81.71318 92.76543 87.71533 91.44456
 [9] 74.78826 99.47429 82.62315 84.09270 90.22914 80.77258 79.56582 73.94968
[17] 78.74816 89.25714 80.60601 88.95077
> colMin(tmp5)
 [1]       NA 58.09815 60.29031 67.85638 55.36702 54.23515 62.65090 60.01061
 [9] 61.86705 58.90991 65.96822 57.72322 58.09627 61.29260 53.10713 53.56419
[17] 60.77943 56.30732 52.95219 60.22937
> 
> Max(tmp5,na.rm=TRUE)
[1] 463.719
> Min(tmp5,na.rm=TRUE)
[1] 52.95219
> mean(tmp5,na.rm=TRUE)
[1] 73.18061
> Sum(tmp5,na.rm=TRUE)
[1] 14562.94
> Var(tmp5,na.rm=TRUE)
[1] 846.7052
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.24081 69.98172 71.50793 70.66749 70.84046 70.66421 70.81382 73.78805
 [9] 71.39531 71.78794
> rowSums(tmp5,na.rm=TRUE)
 [1] 1804.816 1399.634 1430.159 1413.350 1416.809 1413.284 1345.463 1475.761
 [9] 1427.906 1435.759
> rowVars(tmp5,na.rm=TRUE)
 [1] 7810.02908   80.06105   94.95924   50.81003   55.93839   66.38631
 [7]  105.23538   61.92421   30.28550  122.91885
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.374369  8.947684  9.744703  7.128116  7.479197  8.147780 10.258429
 [8]  7.869194  5.503226 11.086877
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.71902  86.02173  93.92375  81.71318  85.60920  82.20215  99.47429
 [8]  91.44456  84.13067  90.22914
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.10713 54.34425 57.33841 58.09815 56.74534 53.56419 52.95219 60.77943
 [9] 60.29031 54.23515
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.51407  75.20138  75.46660  75.39512  69.76141  69.94991  73.49480
 [8]  73.92770  69.38414  76.15503  71.43998  67.76499  69.39337  73.26272
[15]  69.42274  66.78378  68.75513  68.70184  68.97597  69.99483
> colSums(tmp5,na.rm=TRUE)
 [1] 1030.6266  752.0138  754.6660  753.9512  697.6141  699.4991  734.9480
 [8]  739.2770  693.8414  761.5503  714.3998  677.6499  693.9337  732.6272
[15]  694.2274  667.8378  687.5513  687.0184  689.7597  699.9483
> colVars(tmp5,na.rm=TRUE)
 [1] 17237.09152    62.41749   109.40635    36.22250    64.11405   129.71966
 [7]    59.48994   116.66059    18.88027   140.04648    25.97741    61.07252
[13]    85.94043    29.19603    58.48714    48.68322    42.72364    81.62567
[19]   107.89497    63.66385
> colSd(tmp5,na.rm=TRUE)
 [1] 131.290104   7.900474  10.459749   6.018513   8.007125  11.389454
 [7]   7.712972  10.800953   4.345143  11.834123   5.096804   7.814891
[13]   9.270406   5.403335   7.647689   6.977336   6.536333   9.034693
[19]  10.387250   7.978963
> colMax(tmp5,na.rm=TRUE)
 [1] 463.71902  83.55706  93.92375  84.03521  81.71318  92.76543  87.71533
 [8]  91.44456  74.78826  99.47429  82.62315  84.09270  90.22914  80.77258
[15]  79.56582  73.94968  78.74816  89.25714  80.60601  88.95077
> colMin(tmp5,na.rm=TRUE)
 [1] 56.74534 58.09815 60.29031 67.85638 55.36702 54.23515 62.65090 60.01061
 [9] 61.86705 58.90991 65.96822 57.72322 58.09627 61.29260 53.10713 53.56419
[17] 60.77943 56.30732 52.95219 60.22937
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.24081 69.98172 71.50793 70.66749 70.84046 70.66421      NaN 73.78805
 [9] 71.39531 71.78794
> rowSums(tmp5,na.rm=TRUE)
 [1] 1804.816 1399.634 1430.159 1413.350 1416.809 1413.284    0.000 1475.761
 [9] 1427.906 1435.759
> rowVars(tmp5,na.rm=TRUE)
 [1] 7810.02908   80.06105   94.95924   50.81003   55.93839   66.38631
 [7]         NA   61.92421   30.28550  122.91885
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.374369  8.947684  9.744703  7.128116  7.479197  8.147780        NA
 [8]  7.869194  5.503226 11.086877
> rowMax(tmp5,na.rm=TRUE)
 [1] 463.71902  86.02173  93.92375  81.71318  85.60920  82.20215        NA
 [8]  91.44456  84.13067  90.22914
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.10713 54.34425 57.33841 58.09815 56.74534 53.56419       NA 60.77943
 [9] 60.29031 54.23515
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 75.41103 75.63172 76.14884 69.62749 70.82824 74.65634 74.70890
 [9] 69.03624 73.56400 71.59809 67.32805 69.62461 72.52781 70.00861 66.27460
[17] 69.42835 66.41792 70.75639 70.51738
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 678.6992 680.6855 685.3395 626.6474 637.4542 671.9071 672.3801
 [9] 621.3261 662.0760 644.3828 605.9525 626.6215 652.7503 630.0775 596.4714
[17] 624.8551 597.7613 636.8075 634.6564
> colVars(tmp5,na.rm=TRUE)
 [1]        NA  69.72520 122.77542  34.35935  71.92655 137.25554  51.74789
 [8] 124.37767  19.87866  82.02622  28.94335  66.55885  96.08138  26.76962
[15]  61.93646  51.85198  42.96537  33.14552  85.72053  68.54992
> colSd(tmp5,na.rm=TRUE)
 [1]        NA  8.350162 11.080407  5.861685  8.480952 11.715611  7.193600
 [8] 11.152474  4.458549  9.056833  5.379903  8.158361  9.802111  5.173936
[15]  7.869972  7.200832  6.554797  5.757215  9.258538  8.279488
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 83.55706 93.92375 84.03521 81.71318 92.76543 87.71533 91.44456
 [9] 74.78826 86.02173 82.62315 84.09270 90.22914 80.77258 79.56582 73.94968
[17] 78.74816 73.28529 80.60601 88.95077
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 58.09815 60.29031 67.85638 55.36702 54.23515 62.65090 60.01061
 [9] 61.86705 58.90991 65.96822 57.72322 58.09627 61.29260 53.10713 53.56419
[17] 60.77943 56.30732 54.34425 60.22937
> 
> 
> 
> 
> 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] 152.5665 246.4368 171.5124 210.9892 294.9032 167.7516 203.1330 137.6115
 [9] 179.0013 160.9072
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 152.5665 246.4368 171.5124 210.9892 294.9032 167.7516 203.1330 137.6115
 [9] 179.0013 160.9072
> 
> 
> 
> 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] -5.684342e-14  5.684342e-14 -1.136868e-13  2.273737e-13 -5.684342e-14
 [6]  1.563194e-13  8.526513e-14  2.842171e-14 -9.947598e-14  5.684342e-14
[11]  1.136868e-13 -1.136868e-13  0.000000e+00 -5.684342e-14  1.421085e-14
[16]  0.000000e+00 -5.684342e-14  7.105427e-14  2.842171e-14 -1.705303e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   6 
6   10 
2   17 
4   1 
6   1 
5   3 
10   12 
2   6 
6   11 
3   7 
4   1 
9   11 
2   4 
9   8 
4   5 
2   17 
2   14 
6   10 
4   10 
5   9 
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.81849
> Min(tmp)
[1] -2.669154
> mean(tmp)
[1] 0.06187548
> Sum(tmp)
[1] 6.187548
> Var(tmp)
[1] 0.8492407
> 
> rowMeans(tmp)
[1] 0.06187548
> rowSums(tmp)
[1] 6.187548
> rowVars(tmp)
[1] 0.8492407
> rowSd(tmp)
[1] 0.9215426
> rowMax(tmp)
[1] 2.81849
> rowMin(tmp)
[1] -2.669154
> 
> colMeans(tmp)
  [1]  0.164962058 -0.716608966 -0.557693969 -0.981810604  0.425585693
  [6]  0.421968411 -0.813755902 -0.269169078 -0.457509422  0.612322284
 [11] -0.080264890  0.487858976 -1.585537248 -0.543962997 -0.504709452
 [16]  2.818490009 -0.033531643  0.594955638  0.007445648 -1.197629436
 [21]  0.203415312  0.902058184 -0.797138589  0.476382098  1.388430418
 [26]  0.431235100 -1.193399877  1.188993422  0.661102016 -0.739607425
 [31]  2.202459912 -0.020365314  0.331820277 -0.058108662  0.703448902
 [36] -0.519616541  0.551019584 -0.082048876  1.390983735  0.220846868
 [41] -0.068273285  1.644856051 -0.336914704  1.226207435  1.617564933
 [46]  0.535310805 -0.192563179 -0.809838305 -0.258507563  0.888849978
 [51]  0.192825221  0.068930418 -0.230025679 -2.669153843 -1.369584836
 [56] -0.272684764  1.539184250  0.814907582 -2.373914022 -0.229594876
 [61]  0.130817663 -0.578224669  1.111343496  0.009256047  0.145400899
 [66] -1.523443045  0.472492243 -0.444961760  1.082108803  0.816867169
 [71] -0.029400442 -0.160271267  0.947376308 -0.238697268 -1.034599802
 [76]  0.702139975  0.268118158 -1.175435319 -1.701302442 -1.464252076
 [81]  0.492044970  0.381371971  0.695725685 -0.169497230  0.232477830
 [86]  0.116949846  1.165159412  0.025239071  1.081832752 -1.090311406
 [91]  0.567253320 -0.784332489 -0.117089237  0.374483872 -0.395579742
 [96]  1.181410080 -0.682784361  0.236235210 -0.650165228  1.440893534
> colSums(tmp)
  [1]  0.164962058 -0.716608966 -0.557693969 -0.981810604  0.425585693
  [6]  0.421968411 -0.813755902 -0.269169078 -0.457509422  0.612322284
 [11] -0.080264890  0.487858976 -1.585537248 -0.543962997 -0.504709452
 [16]  2.818490009 -0.033531643  0.594955638  0.007445648 -1.197629436
 [21]  0.203415312  0.902058184 -0.797138589  0.476382098  1.388430418
 [26]  0.431235100 -1.193399877  1.188993422  0.661102016 -0.739607425
 [31]  2.202459912 -0.020365314  0.331820277 -0.058108662  0.703448902
 [36] -0.519616541  0.551019584 -0.082048876  1.390983735  0.220846868
 [41] -0.068273285  1.644856051 -0.336914704  1.226207435  1.617564933
 [46]  0.535310805 -0.192563179 -0.809838305 -0.258507563  0.888849978
 [51]  0.192825221  0.068930418 -0.230025679 -2.669153843 -1.369584836
 [56] -0.272684764  1.539184250  0.814907582 -2.373914022 -0.229594876
 [61]  0.130817663 -0.578224669  1.111343496  0.009256047  0.145400899
 [66] -1.523443045  0.472492243 -0.444961760  1.082108803  0.816867169
 [71] -0.029400442 -0.160271267  0.947376308 -0.238697268 -1.034599802
 [76]  0.702139975  0.268118158 -1.175435319 -1.701302442 -1.464252076
 [81]  0.492044970  0.381371971  0.695725685 -0.169497230  0.232477830
 [86]  0.116949846  1.165159412  0.025239071  1.081832752 -1.090311406
 [91]  0.567253320 -0.784332489 -0.117089237  0.374483872 -0.395579742
 [96]  1.181410080 -0.682784361  0.236235210 -0.650165228  1.440893534
> 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.164962058 -0.716608966 -0.557693969 -0.981810604  0.425585693
  [6]  0.421968411 -0.813755902 -0.269169078 -0.457509422  0.612322284
 [11] -0.080264890  0.487858976 -1.585537248 -0.543962997 -0.504709452
 [16]  2.818490009 -0.033531643  0.594955638  0.007445648 -1.197629436
 [21]  0.203415312  0.902058184 -0.797138589  0.476382098  1.388430418
 [26]  0.431235100 -1.193399877  1.188993422  0.661102016 -0.739607425
 [31]  2.202459912 -0.020365314  0.331820277 -0.058108662  0.703448902
 [36] -0.519616541  0.551019584 -0.082048876  1.390983735  0.220846868
 [41] -0.068273285  1.644856051 -0.336914704  1.226207435  1.617564933
 [46]  0.535310805 -0.192563179 -0.809838305 -0.258507563  0.888849978
 [51]  0.192825221  0.068930418 -0.230025679 -2.669153843 -1.369584836
 [56] -0.272684764  1.539184250  0.814907582 -2.373914022 -0.229594876
 [61]  0.130817663 -0.578224669  1.111343496  0.009256047  0.145400899
 [66] -1.523443045  0.472492243 -0.444961760  1.082108803  0.816867169
 [71] -0.029400442 -0.160271267  0.947376308 -0.238697268 -1.034599802
 [76]  0.702139975  0.268118158 -1.175435319 -1.701302442 -1.464252076
 [81]  0.492044970  0.381371971  0.695725685 -0.169497230  0.232477830
 [86]  0.116949846  1.165159412  0.025239071  1.081832752 -1.090311406
 [91]  0.567253320 -0.784332489 -0.117089237  0.374483872 -0.395579742
 [96]  1.181410080 -0.682784361  0.236235210 -0.650165228  1.440893534
> colMin(tmp)
  [1]  0.164962058 -0.716608966 -0.557693969 -0.981810604  0.425585693
  [6]  0.421968411 -0.813755902 -0.269169078 -0.457509422  0.612322284
 [11] -0.080264890  0.487858976 -1.585537248 -0.543962997 -0.504709452
 [16]  2.818490009 -0.033531643  0.594955638  0.007445648 -1.197629436
 [21]  0.203415312  0.902058184 -0.797138589  0.476382098  1.388430418
 [26]  0.431235100 -1.193399877  1.188993422  0.661102016 -0.739607425
 [31]  2.202459912 -0.020365314  0.331820277 -0.058108662  0.703448902
 [36] -0.519616541  0.551019584 -0.082048876  1.390983735  0.220846868
 [41] -0.068273285  1.644856051 -0.336914704  1.226207435  1.617564933
 [46]  0.535310805 -0.192563179 -0.809838305 -0.258507563  0.888849978
 [51]  0.192825221  0.068930418 -0.230025679 -2.669153843 -1.369584836
 [56] -0.272684764  1.539184250  0.814907582 -2.373914022 -0.229594876
 [61]  0.130817663 -0.578224669  1.111343496  0.009256047  0.145400899
 [66] -1.523443045  0.472492243 -0.444961760  1.082108803  0.816867169
 [71] -0.029400442 -0.160271267  0.947376308 -0.238697268 -1.034599802
 [76]  0.702139975  0.268118158 -1.175435319 -1.701302442 -1.464252076
 [81]  0.492044970  0.381371971  0.695725685 -0.169497230  0.232477830
 [86]  0.116949846  1.165159412  0.025239071  1.081832752 -1.090311406
 [91]  0.567253320 -0.784332489 -0.117089237  0.374483872 -0.395579742
 [96]  1.181410080 -0.682784361  0.236235210 -0.650165228  1.440893534
> colMedians(tmp)
  [1]  0.164962058 -0.716608966 -0.557693969 -0.981810604  0.425585693
  [6]  0.421968411 -0.813755902 -0.269169078 -0.457509422  0.612322284
 [11] -0.080264890  0.487858976 -1.585537248 -0.543962997 -0.504709452
 [16]  2.818490009 -0.033531643  0.594955638  0.007445648 -1.197629436
 [21]  0.203415312  0.902058184 -0.797138589  0.476382098  1.388430418
 [26]  0.431235100 -1.193399877  1.188993422  0.661102016 -0.739607425
 [31]  2.202459912 -0.020365314  0.331820277 -0.058108662  0.703448902
 [36] -0.519616541  0.551019584 -0.082048876  1.390983735  0.220846868
 [41] -0.068273285  1.644856051 -0.336914704  1.226207435  1.617564933
 [46]  0.535310805 -0.192563179 -0.809838305 -0.258507563  0.888849978
 [51]  0.192825221  0.068930418 -0.230025679 -2.669153843 -1.369584836
 [56] -0.272684764  1.539184250  0.814907582 -2.373914022 -0.229594876
 [61]  0.130817663 -0.578224669  1.111343496  0.009256047  0.145400899
 [66] -1.523443045  0.472492243 -0.444961760  1.082108803  0.816867169
 [71] -0.029400442 -0.160271267  0.947376308 -0.238697268 -1.034599802
 [76]  0.702139975  0.268118158 -1.175435319 -1.701302442 -1.464252076
 [81]  0.492044970  0.381371971  0.695725685 -0.169497230  0.232477830
 [86]  0.116949846  1.165159412  0.025239071  1.081832752 -1.090311406
 [91]  0.567253320 -0.784332489 -0.117089237  0.374483872 -0.395579742
 [96]  1.181410080 -0.682784361  0.236235210 -0.650165228  1.440893534
> colRanges(tmp)
          [,1]      [,2]      [,3]       [,4]      [,5]      [,6]       [,7]
[1,] 0.1649621 -0.716609 -0.557694 -0.9818106 0.4255857 0.4219684 -0.8137559
[2,] 0.1649621 -0.716609 -0.557694 -0.9818106 0.4255857 0.4219684 -0.8137559
           [,8]       [,9]     [,10]       [,11]    [,12]     [,13]     [,14]
[1,] -0.2691691 -0.4575094 0.6123223 -0.08026489 0.487859 -1.585537 -0.543963
[2,] -0.2691691 -0.4575094 0.6123223 -0.08026489 0.487859 -1.585537 -0.543963
          [,15]   [,16]       [,17]     [,18]       [,19]     [,20]     [,21]
[1,] -0.5047095 2.81849 -0.03353164 0.5949556 0.007445648 -1.197629 0.2034153
[2,] -0.5047095 2.81849 -0.03353164 0.5949556 0.007445648 -1.197629 0.2034153
         [,22]      [,23]     [,24]   [,25]     [,26]   [,27]    [,28]    [,29]
[1,] 0.9020582 -0.7971386 0.4763821 1.38843 0.4312351 -1.1934 1.188993 0.661102
[2,] 0.9020582 -0.7971386 0.4763821 1.38843 0.4312351 -1.1934 1.188993 0.661102
          [,30]   [,31]       [,32]     [,33]       [,34]     [,35]      [,36]
[1,] -0.7396074 2.20246 -0.02036531 0.3318203 -0.05810866 0.7034489 -0.5196165
[2,] -0.7396074 2.20246 -0.02036531 0.3318203 -0.05810866 0.7034489 -0.5196165
         [,37]       [,38]    [,39]     [,40]       [,41]    [,42]      [,43]
[1,] 0.5510196 -0.08204888 1.390984 0.2208469 -0.06827328 1.644856 -0.3369147
[2,] 0.5510196 -0.08204888 1.390984 0.2208469 -0.06827328 1.644856 -0.3369147
        [,44]    [,45]     [,46]      [,47]      [,48]      [,49]   [,50]
[1,] 1.226207 1.617565 0.5353108 -0.1925632 -0.8098383 -0.2585076 0.88885
[2,] 1.226207 1.617565 0.5353108 -0.1925632 -0.8098383 -0.2585076 0.88885
         [,51]      [,52]      [,53]     [,54]     [,55]      [,56]    [,57]
[1,] 0.1928252 0.06893042 -0.2300257 -2.669154 -1.369585 -0.2726848 1.539184
[2,] 0.1928252 0.06893042 -0.2300257 -2.669154 -1.369585 -0.2726848 1.539184
         [,58]     [,59]      [,60]     [,61]      [,62]    [,63]       [,64]
[1,] 0.8149076 -2.373914 -0.2295949 0.1308177 -0.5782247 1.111343 0.009256047
[2,] 0.8149076 -2.373914 -0.2295949 0.1308177 -0.5782247 1.111343 0.009256047
         [,65]     [,66]     [,67]      [,68]    [,69]     [,70]       [,71]
[1,] 0.1454009 -1.523443 0.4724922 -0.4449618 1.082109 0.8168672 -0.02940044
[2,] 0.1454009 -1.523443 0.4724922 -0.4449618 1.082109 0.8168672 -0.02940044
          [,72]     [,73]      [,74]   [,75]   [,76]     [,77]     [,78]
[1,] -0.1602713 0.9473763 -0.2386973 -1.0346 0.70214 0.2681182 -1.175435
[2,] -0.1602713 0.9473763 -0.2386973 -1.0346 0.70214 0.2681182 -1.175435
         [,79]     [,80]    [,81]    [,82]     [,83]      [,84]     [,85]
[1,] -1.701302 -1.464252 0.492045 0.381372 0.6957257 -0.1694972 0.2324778
[2,] -1.701302 -1.464252 0.492045 0.381372 0.6957257 -0.1694972 0.2324778
         [,86]    [,87]      [,88]    [,89]     [,90]     [,91]      [,92]
[1,] 0.1169498 1.165159 0.02523907 1.081833 -1.090311 0.5672533 -0.7843325
[2,] 0.1169498 1.165159 0.02523907 1.081833 -1.090311 0.5672533 -0.7843325
          [,93]     [,94]      [,95]   [,96]      [,97]     [,98]      [,99]
[1,] -0.1170892 0.3744839 -0.3955797 1.18141 -0.6827844 0.2362352 -0.6501652
[2,] -0.1170892 0.3744839 -0.3955797 1.18141 -0.6827844 0.2362352 -0.6501652
       [,100]
[1,] 1.440894
[2,] 1.440894
> 
> 
> Max(tmp2)
[1] 2.495103
> Min(tmp2)
[1] -1.909844
> mean(tmp2)
[1] 0.047431
> Sum(tmp2)
[1] 4.7431
> Var(tmp2)
[1] 0.8903538
> 
> rowMeans(tmp2)
  [1] -0.51616143  0.62296005  1.01808419 -0.19965594 -0.23839729  0.50357398
  [7] -0.22671909  0.72734123  0.19707463 -0.32074749  0.79491546  0.30333871
 [13] -1.28585166 -0.25930651  2.35841360 -0.12901909  1.01737915 -0.14279214
 [19]  0.07554095 -1.17979480 -0.62698252  1.91928712  2.49510332 -0.25349711
 [25] -0.37652605 -0.67853617  0.72005610 -0.06898962  0.46024875 -0.03729540
 [31]  0.26480119  1.26264124  0.44633847 -0.62409851 -1.61850017  0.12584672
 [37] -0.30332972  0.55574296 -1.07346608 -0.69612440 -1.23527009  1.17186564
 [43]  0.75282762 -0.97483969 -1.42201525 -1.01587972  0.31564644  1.51239747
 [49] -0.26217216 -0.30151434  1.57422627  0.34168517 -0.04810525 -0.02616606
 [55]  1.10951200 -0.23729789 -0.28796392  0.62229318  0.14747108 -1.10243776
 [61]  0.04391241  0.58391751 -0.06451687  0.33296662 -0.44376281 -0.08564358
 [67]  0.32237854  0.14436307 -1.59726662 -0.52873257  1.12542095 -0.93970005
 [73]  0.49285355  1.29079115 -0.07913483 -0.09917138  0.49035054  0.58947995
 [79]  0.89430033 -1.11378041  0.38849349  0.68535411  0.83758938 -1.90984385
 [85] -0.43784168 -1.44111320 -1.70513393 -0.49636851 -1.07647354 -1.41262787
 [91]  1.84454718  0.75848149  2.38608309  0.03871760  0.94898450  1.43947874
 [97]  0.21978846 -0.54031503 -1.66197893 -1.12890606
> rowSums(tmp2)
  [1] -0.51616143  0.62296005  1.01808419 -0.19965594 -0.23839729  0.50357398
  [7] -0.22671909  0.72734123  0.19707463 -0.32074749  0.79491546  0.30333871
 [13] -1.28585166 -0.25930651  2.35841360 -0.12901909  1.01737915 -0.14279214
 [19]  0.07554095 -1.17979480 -0.62698252  1.91928712  2.49510332 -0.25349711
 [25] -0.37652605 -0.67853617  0.72005610 -0.06898962  0.46024875 -0.03729540
 [31]  0.26480119  1.26264124  0.44633847 -0.62409851 -1.61850017  0.12584672
 [37] -0.30332972  0.55574296 -1.07346608 -0.69612440 -1.23527009  1.17186564
 [43]  0.75282762 -0.97483969 -1.42201525 -1.01587972  0.31564644  1.51239747
 [49] -0.26217216 -0.30151434  1.57422627  0.34168517 -0.04810525 -0.02616606
 [55]  1.10951200 -0.23729789 -0.28796392  0.62229318  0.14747108 -1.10243776
 [61]  0.04391241  0.58391751 -0.06451687  0.33296662 -0.44376281 -0.08564358
 [67]  0.32237854  0.14436307 -1.59726662 -0.52873257  1.12542095 -0.93970005
 [73]  0.49285355  1.29079115 -0.07913483 -0.09917138  0.49035054  0.58947995
 [79]  0.89430033 -1.11378041  0.38849349  0.68535411  0.83758938 -1.90984385
 [85] -0.43784168 -1.44111320 -1.70513393 -0.49636851 -1.07647354 -1.41262787
 [91]  1.84454718  0.75848149  2.38608309  0.03871760  0.94898450  1.43947874
 [97]  0.21978846 -0.54031503 -1.66197893 -1.12890606
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -0.51616143  0.62296005  1.01808419 -0.19965594 -0.23839729  0.50357398
  [7] -0.22671909  0.72734123  0.19707463 -0.32074749  0.79491546  0.30333871
 [13] -1.28585166 -0.25930651  2.35841360 -0.12901909  1.01737915 -0.14279214
 [19]  0.07554095 -1.17979480 -0.62698252  1.91928712  2.49510332 -0.25349711
 [25] -0.37652605 -0.67853617  0.72005610 -0.06898962  0.46024875 -0.03729540
 [31]  0.26480119  1.26264124  0.44633847 -0.62409851 -1.61850017  0.12584672
 [37] -0.30332972  0.55574296 -1.07346608 -0.69612440 -1.23527009  1.17186564
 [43]  0.75282762 -0.97483969 -1.42201525 -1.01587972  0.31564644  1.51239747
 [49] -0.26217216 -0.30151434  1.57422627  0.34168517 -0.04810525 -0.02616606
 [55]  1.10951200 -0.23729789 -0.28796392  0.62229318  0.14747108 -1.10243776
 [61]  0.04391241  0.58391751 -0.06451687  0.33296662 -0.44376281 -0.08564358
 [67]  0.32237854  0.14436307 -1.59726662 -0.52873257  1.12542095 -0.93970005
 [73]  0.49285355  1.29079115 -0.07913483 -0.09917138  0.49035054  0.58947995
 [79]  0.89430033 -1.11378041  0.38849349  0.68535411  0.83758938 -1.90984385
 [85] -0.43784168 -1.44111320 -1.70513393 -0.49636851 -1.07647354 -1.41262787
 [91]  1.84454718  0.75848149  2.38608309  0.03871760  0.94898450  1.43947874
 [97]  0.21978846 -0.54031503 -1.66197893 -1.12890606
> rowMin(tmp2)
  [1] -0.51616143  0.62296005  1.01808419 -0.19965594 -0.23839729  0.50357398
  [7] -0.22671909  0.72734123  0.19707463 -0.32074749  0.79491546  0.30333871
 [13] -1.28585166 -0.25930651  2.35841360 -0.12901909  1.01737915 -0.14279214
 [19]  0.07554095 -1.17979480 -0.62698252  1.91928712  2.49510332 -0.25349711
 [25] -0.37652605 -0.67853617  0.72005610 -0.06898962  0.46024875 -0.03729540
 [31]  0.26480119  1.26264124  0.44633847 -0.62409851 -1.61850017  0.12584672
 [37] -0.30332972  0.55574296 -1.07346608 -0.69612440 -1.23527009  1.17186564
 [43]  0.75282762 -0.97483969 -1.42201525 -1.01587972  0.31564644  1.51239747
 [49] -0.26217216 -0.30151434  1.57422627  0.34168517 -0.04810525 -0.02616606
 [55]  1.10951200 -0.23729789 -0.28796392  0.62229318  0.14747108 -1.10243776
 [61]  0.04391241  0.58391751 -0.06451687  0.33296662 -0.44376281 -0.08564358
 [67]  0.32237854  0.14436307 -1.59726662 -0.52873257  1.12542095 -0.93970005
 [73]  0.49285355  1.29079115 -0.07913483 -0.09917138  0.49035054  0.58947995
 [79]  0.89430033 -1.11378041  0.38849349  0.68535411  0.83758938 -1.90984385
 [85] -0.43784168 -1.44111320 -1.70513393 -0.49636851 -1.07647354 -1.41262787
 [91]  1.84454718  0.75848149  2.38608309  0.03871760  0.94898450  1.43947874
 [97]  0.21978846 -0.54031503 -1.66197893 -1.12890606
> 
> colMeans(tmp2)
[1] 0.047431
> colSums(tmp2)
[1] 4.7431
> colVars(tmp2)
[1] 0.8903538
> colSd(tmp2)
[1] 0.9435856
> colMax(tmp2)
[1] 2.495103
> colMin(tmp2)
[1] -1.909844
> colMedians(tmp2)
[1] -0.03173073
> colRanges(tmp2)
          [,1]
[1,] -1.909844
[2,]  2.495103
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.1564038  0.8311590 -6.3129694 -0.3420301  0.8356324 -4.9264251
 [7]  0.2331885 -2.7555024  2.1245227  1.9977585
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8522062
[2,] -0.0796064
[3,]  0.3956479
[4,]  0.7478717
[5,]  1.9795109
> 
> rowApply(tmp,sum)
 [1] -3.2685969 -1.8098821  6.3829008  1.8669461 -5.7870088 -0.8193065
 [7] -3.6548898 -0.7541530 -0.4539881  4.1397161
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    9    8   10    9    5    3   10    7    7     3
 [2,]    5    1    9   10    4    1    2   10    9     4
 [3,]    2    2    8    1    2    5    7    6    1     1
 [4,]    3   10    5    8    8    7    6    2    4     8
 [5,]    6    6    7    2    9    8    3    4    5     6
 [6,]    1    5    3    7    1    2    1    9    3     7
 [7,]    4    7    2    4    6   10    4    5    8     5
 [8,]    8    4    6    6   10    4    8    1    2     2
 [9,]    7    3    1    3    3    9    9    8   10     9
[10,]   10    9    4    5    7    6    5    3    6    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.36045821  0.01196255 -0.21907535  1.72769385 -2.76124089 -2.04976725
 [7] -2.94726145  1.96940221 -1.33376405  1.61897790  0.46504355 -0.38619388
[13] -1.72661585 -3.75348945 -2.07083146  3.08704159  0.85901164 -0.08936309
[19]  1.14208325  0.08308081
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.06299620
[2,] -0.52962037
[3,]  0.05180645
[4,]  1.39495352
[5,]  1.50631482
> 
> rowApply(tmp,sum)
[1]  6.2506811 -4.4455544 -4.3378489 -1.9316005 -0.5485245
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18    4   12    6   18
[2,]   17   16    2   18    7
[3,]   11    9    6   15   10
[4,]   20    8    8   12   12
[5,]    5    2   10   17    4
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  1.39495352  1.3837451  0.4083849  2.4972747 -0.4223341 -0.3323106
[2,] -1.06299620  0.5480006 -0.6724870 -0.6741924 -1.4207047 -0.1755199
[3,]  0.05180645 -1.9244932 -0.6650300 -0.5312298 -0.3525683 -0.7241612
[4,] -0.52962037  0.6615078  0.4669086  0.1344607  0.5907410  0.8222111
[5,]  1.50631482 -0.6567977  0.2431482  0.3013808 -1.1563748 -1.6399866
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -1.0872808  0.9527803 -1.1827807  1.0974072  0.7597775  1.2951815
[2,] -1.0893644  0.4103790 -1.7682054  0.9997498 -0.5327378 -0.7844054
[3,] -0.3649983  1.2229685  0.6990913 -1.9600588  1.4020720 -0.0851133
[4,] -1.0212712 -0.4282973  0.5033395 -0.1684103 -1.4281478  0.3141938
[5,]  0.6156532 -0.1884284  0.4147913  1.6502900  0.2640797 -1.1260505
          [,13]      [,14]       [,15]      [,16]       [,17]       [,18]
[1,] -0.5125003 -1.7451452  1.45005673  0.9192351 -0.29225710 -0.37942606
[2,]  0.8049761 -0.2176227 -0.95019771  2.9738169 -0.94240172 -0.08052464
[3,] -0.8730220 -1.5702714  0.06188734 -0.6019501  0.27312247  0.15665638
[4,] -1.5747437 -0.6379738 -0.78080409  1.0653054  0.09524855  0.00628333
[5,]  0.4286741  0.4175237 -1.85177373 -1.2693657  1.72529944  0.20764789
          [,19]      [,20]
[1,]  0.1508963 -0.1049769
[2,] -0.4906752  0.6795586
[3,]  0.6898281  0.7576150
[4,]  0.2545481 -0.2770797
[5,]  0.5374860 -0.9720361
> 
> 
> 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.21-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.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  563  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.21-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.2255763 1.672581 -0.8666452 1.054326 0.6396779 0.3390302 -0.1173927
           col8        col9      col10     col11     col12      col13
row1 -0.8852267 -0.09829611 -0.3305365 0.3288098 -1.265159 -0.4846577
          col14     col15     col16    col17     col18    col19    col20
row1 -0.2262667 0.1441255 0.4903025 1.077588 -2.520721 1.016204 1.696726
> tmp[,"col10"]
          col10
row1 -0.3305365
row2 -0.2867052
row3  0.8987767
row4  1.0964772
row5  0.4150628
> tmp[c("row1","row5"),]
           col1     col2       col3       col4      col5      col6       col7
row1 -0.2255763 1.672581 -0.8666452  1.0543260 0.6396779 0.3390302 -0.1173927
row5 -0.8335904 1.494172  0.6339388 -0.8099942 0.8109203 0.1190785 -2.4708264
           col8        col9      col10     col11     col12      col13
row1 -0.8852267 -0.09829611 -0.3305365 0.3288098 -1.265159 -0.4846577
row5 -0.2027504  1.68425190  0.4150628 0.1281309  1.403730 -0.7432381
          col14     col15     col16     col17     col18      col19    col20
row1 -0.2262667 0.1441255 0.4903025  1.077588 -2.520721  1.0162039 1.696726
row5 -0.1802747 0.4537520 0.1364710 -1.116272  0.193164 -0.8447935 1.548952
> tmp[,c("col6","col20")]
           col6      col20
row1  0.3390302  1.6967257
row2 -1.2063160  1.3722134
row3 -0.5159924 -0.6679458
row4 -1.5480685 -0.8922623
row5  0.1190785  1.5489525
> tmp[c("row1","row5"),c("col6","col20")]
          col6    col20
row1 0.3390302 1.696726
row5 0.1190785 1.548952
> 
> 
> 
> 
> 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 48.62845 49.04249 50.32795 50.57563 49.89185 105.3639 49.20645 50.37131
        col9    col10    col11    col12    col13    col14    col15   col16
row1 48.6888 50.12696 50.80412 49.63629 50.29396 49.15136 51.83658 49.0104
        col17    col18    col19    col20
row1 51.02808 49.95426 51.89053 104.8662
> tmp[,"col10"]
        col10
row1 50.12696
row2 29.46378
row3 30.04609
row4 29.57978
row5 48.81527
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.62845 49.04249 50.32795 50.57563 49.89185 105.3639 49.20645 50.37131
row5 51.01184 49.17072 49.01817 50.90811 51.56979 104.7208 51.01237 51.28375
         col9    col10    col11    col12    col13    col14    col15   col16
row1 48.68880 50.12696 50.80412 49.63629 50.29396 49.15136 51.83658 49.0104
row5 50.54313 48.81527 51.57366 51.28614 52.57822 50.07325 51.34136 48.9670
        col17    col18    col19    col20
row1 51.02808 49.95426 51.89053 104.8662
row5 50.21943 49.54769 49.13079 104.7831
> tmp[,c("col6","col20")]
          col6     col20
row1 105.36391 104.86624
row2  75.72277  75.73536
row3  74.97450  75.23671
row4  76.11068  75.49437
row5 104.72075 104.78307
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.3639 104.8662
row5 104.7208 104.7831
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.3639 104.8662
row5 104.7208 104.7831
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.71861505
[2,] -1.11525329
[3,] -0.90695879
[4,]  1.36017273
[5,]  0.01806446
> tmp[,c("col17","col7")]
          col17       col7
[1,]  2.4426264 -1.5259840
[2,] -1.1004632 -0.2322188
[3,] -1.5139767 -0.2393581
[4,] -0.8074894  1.2275867
[5,] -1.6820418  1.5788085
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6     col20
[1,]  0.39466329 -2.124258
[2,] -0.79178495  1.198582
[3,] -0.34647515  2.245967
[4,] -0.06966022 -1.288483
[5,]  0.50639983 -1.139119
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.3946633
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  0.3946633
[2,] -0.7917849
> 
> 
> 
> 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.4968798 0.2151543 -0.1292896  0.9932173 0.06578206  0.3289637
row1 -0.8107064 0.0979310 -0.6406129 -1.7186213 0.69262882 -0.4518551
            [,7]      [,8]       [,9]       [,10]      [,11]      [,12]
row3 -0.44976695 1.0771681 -1.1758517 -0.80608853 0.02219627 -1.1645304
row1 -0.06420145 0.5272673 -0.4350633 -0.02070133 0.66784979 -0.2375293
          [,13]     [,14]     [,15]        [,16]      [,17]      [,18]
row3 -0.2060465  1.080813 0.4294216  1.539287153 0.71531675 -0.3826454
row1  1.3427002 -1.823606 0.2869508 -0.005192956 0.04479795 -1.2385606
          [,19]     [,20]
row3 0.92771178 0.3122417
row1 0.09611964 0.5493044
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]     [,4]       [,5]      [,6]       [,7]
row2 -2.106044 0.4856173 -1.138689 1.156501 -0.4475401 0.1681508 0.09006467
          [,8]     [,9]      [,10]
row2 -0.633052 1.432483 -0.4538714
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
             [,1]      [,2]      [,3]     [,4]      [,5]      [,6]       [,7]
row5 -0.009837017 0.3498883 0.1874891 1.430926 0.8607418 -1.461454 -0.1229578
           [,8]      [,9]    [,10]    [,11]     [,12]       [,13]     [,14]
row5 -0.6638371 0.0334122 1.363172 1.316915 -1.578662 -0.06252119 0.7570099
        [,15]    [,16]      [,17]     [,18]      [,19]    [,20]
row5 -1.77452 1.669674 -0.1057925 -1.799131 -0.2312113 0.149836
> 
> 
> 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: 0x600000d90060>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44911ab2c040"
 [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44914d6bb771"
 [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44915ad8836c"
 [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44913c9c560c"
 [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44913bd54cea"
 [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM449130acb556"
 [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44911ab53a11"
 [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44916ff73fc9"
 [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM4491517cde8c"
[10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44915cf6e31f"
[11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM449154b937e7"
[12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44914c054a25"
[13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44916f46ea20"
[14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM449118b513f3"
[15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM44911830c331"
> 
> 
> ### 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: 0x600000de8060>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000de8060>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600000de8060>
> rowMedians(tmp)
  [1]  0.359179001 -0.311418495 -0.157275017  0.124413313  0.329400194
  [6] -0.252097343 -0.408125266  0.021153423 -0.317815022  0.625664074
 [11] -0.053237303  0.377320461 -0.411225276 -0.183746988  0.011749650
 [16] -0.438270594 -0.246128843  0.106054131  0.654413501  0.474028956
 [21]  0.498055894 -0.403439784 -0.308519514  0.469066369  0.164592261
 [26] -0.065570539 -0.233847249 -0.221777353  0.578506169 -0.404108118
 [31] -0.498746453 -0.020658357 -0.344456806  0.604261545  0.215723456
 [36]  0.153656207  0.532121066 -0.433192669  0.271283033 -0.002545567
 [41] -0.445039599 -0.213379692 -0.316598852 -0.212602141 -0.332938514
 [46] -0.100272537 -0.062020963  0.104147003 -0.331646039 -0.217945032
 [51] -0.292353117 -0.116092165 -0.205591426  0.536211645 -0.350004137
 [56] -0.187178411  0.274383585  0.029244149  0.306371105  0.188070329
 [61]  0.168958801 -0.638103507 -0.082883384  0.447575050 -0.129056437
 [66] -0.460885908 -0.181178903  0.504696202 -0.190343198 -0.801373817
 [71]  0.624344531 -0.438101551 -0.299544057  0.015220272 -0.225189958
 [76] -0.260612562  0.087827777  0.049814654 -0.039039366  0.034914401
 [81] -0.106643675  0.402940044 -0.033826503  0.388373388 -0.159125534
 [86]  0.280390018  0.034447951 -0.482410604  0.264349212  0.506514017
 [91]  0.127542169 -0.054020788  0.498491395 -0.096557121  0.305680426
 [96] -0.125069939 -0.841041655 -0.190331835  0.037678683 -0.164572216
[101]  0.406686258  0.559527119  0.014075146  0.410166063  0.446795669
[106]  0.186612392  0.550171647 -0.278913341 -0.268505272  0.575902043
[111] -0.216705672  0.690572267 -0.190284908  0.228442518  0.153120525
[116] -0.226557818 -0.628593676  0.239385100 -0.221545560 -0.416641270
[121] -0.223752111  0.104817803 -0.836179250 -0.200905838 -0.231589794
[126] -0.196562088 -0.013511455 -0.088818839 -0.648332578  0.374915664
[131] -0.325819109  0.494470221  0.190263603  0.310655644 -0.584126508
[136]  0.005831124  0.538352214 -0.288071558  0.345615668 -0.101187146
[141]  0.566641673  0.139375969 -0.063720991 -0.254807096 -0.212730176
[146]  0.416862558  0.077519262 -0.314956848 -0.529444344 -0.532057885
[151] -0.612822908 -0.426205571 -0.365287600  0.373896043  0.280955404
[156]  0.373749786  0.456726476  0.107977192 -0.079985328 -0.547850049
[161]  0.025539151 -0.234025060 -0.690462211  0.714019886  0.383730960
[166] -0.057441149  0.115632403  0.498033904  0.276966367  0.508973895
[171] -0.110431577 -0.176518942 -0.086341055  0.011135969 -0.280645626
[176] -0.742566557 -0.708555524 -0.348018403 -0.034777646 -0.010211771
[181] -0.014539194  0.250466071  0.568446079 -0.176029897 -0.660807425
[186] -0.632219231 -0.361360223 -0.397001663 -0.647422442  0.540713109
[191]  0.240933990 -0.138004350 -0.082085834 -0.193038330  0.133880998
[196]  0.333148891  0.748976553 -0.096155803  0.339018096  0.218374715
[201] -0.283132138  0.638384881 -0.662836369 -0.186206890 -0.031517610
[206] -0.167793034  0.142577499 -0.031610889 -0.114112878 -0.408356801
[211] -0.045002569 -0.311172365 -0.316316444 -0.165082227 -0.077105612
[216]  0.346294328 -0.426781662  0.097588787  0.197455615 -0.373373631
[221]  0.549429697  0.188918464 -0.638038850  0.162656897 -0.281535648
[226]  0.013840979  0.236778690 -0.027048250  0.047525054 -0.069008877
> 
> proc.time()
   user  system elapsed 
  2.936  16.704  26.433 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences"
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: 0x600003c241e0>
> .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: 0x600003c241e0>
> .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: 0x600003c241e0>
> .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: 0x600003c241e0>
> 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: 0x600003c280c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c280c0>
> .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: 0x600003c280c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c280c0>
> .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: 0x600003c280c0>
> 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: 0x600003c64000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c64000>
> .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: 0x600003c64000>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003c64000>
> .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: 0x600003c64000>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600003c64000>
> .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: 0x600003c64000>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600003c64000>
> .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: 0x600003c64000>
> 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: 0x600003c68000>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600003c68000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c68000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c68000>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4a914845360d" "BufferedMatrixFile4a9151a38c22"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4a914845360d" "BufferedMatrixFile4a9151a38c22"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c68240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c68240>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003c68240>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003c68240>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003c68240>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003c68240>
> .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: 0x600003c68420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003c68420>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003c68420>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003c68420>
> 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: 0x600003c68600>
> .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: 0x600003c68600>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.486   0.198   0.957 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences"
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.332   0.094   0.419 

Example timings