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

This page was generated on 2024-06-11 15:42 -0400 (Tue, 11 Jun 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 RC (2024-04-16 r86468) -- "Puppy Cup" 4679
palomino4Windows Server 2022 Datacenterx644.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" 4414
merida1macOS 12.7.4 Montereyx86_644.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" 4441
kjohnson1macOS 13.6.6 Venturaarm644.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" 4394
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 245/2239HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-06-09 14:00 -0400 (Sun, 09 Jun 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: d422a05
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo2Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino4Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.4 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on kjohnson1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.69.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz
StartedAt: 2024-06-10 13:39:09 -0400 (Mon, 10 Jun 2024)
EndedAt: 2024-06-10 13:39:47 -0400 (Mon, 10 Jun 2024)
EllapsedTime: 38.2 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

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

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

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

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

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

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

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

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

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

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.360   0.108   0.453 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 474155 25.4    1035432 55.3         NA   638591 34.2
Vcells 877595  6.7    8388608 64.0      65536  2072089 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Jun 10 13:39:28 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Jun 10 13:39:28 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x6000017c0000>
> 
> 
> 
> 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] "Mon Jun 10 13:39:30 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Jun 10 13:39:31 2024"
> 
> ColMode(tmp2)
<pointer: 0x6000017c0000>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.9281717 -1.4336718 -0.7031740  0.4290184
[2,]  -0.4475094 -0.2298727  0.5108909 -0.7269646
[3,]   1.0080085  0.6285377  3.3889046 -0.6904979
[4,]   0.6245586  0.3476215 -0.8568128  0.8422756
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.9281717 1.4336718 0.7031740 0.4290184
[2,]   0.4475094 0.2298727 0.5108909 0.7269646
[3,]   1.0080085 0.6285377 3.3889046 0.6904979
[4,]   0.6245586 0.3476215 0.8568128 0.8422756
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0463014 1.1973604 0.8385547 0.6549950
[2,]  0.6689615 0.4794504 0.7147664 0.8526222
[3,]  1.0039962 0.7928037 1.8408978 0.8309620
[4,]  0.7902902 0.5895944 0.9256418 0.9177557
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.39119 38.40728 34.08872 31.97897
[2,]  32.13712 30.02438 32.65855 34.25319
[3,]  36.04797 33.55657 46.79788 34.00012
[4,]  33.52746 31.24357 35.11323 35.01983
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000017c81e0>
> exp(tmp5)
<pointer: 0x6000017c81e0>
> log(tmp5,2)
<pointer: 0x6000017c81e0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.2036
> Min(tmp5)
[1] 52.96717
> mean(tmp5)
[1] 72.72674
> Sum(tmp5)
[1] 14545.35
> Var(tmp5)
[1] 870.6166
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.33360 69.94285 71.26886 73.65681 72.68186 70.08995 70.20192 71.93232
 [9] 67.74953 68.40972
> rowSums(tmp5)
 [1] 1826.672 1398.857 1425.377 1473.136 1453.637 1401.799 1404.038 1438.646
 [9] 1354.991 1368.194
> rowVars(tmp5)
 [1] 8063.84863   48.94341   97.06426   54.05406  108.96405   48.51297
 [7]   24.74274   57.67971   97.38463   81.23715
> rowSd(tmp5)
 [1] 89.798934  6.995957  9.852120  7.352146 10.438585  6.965125  4.974208
 [8]  7.594716  9.868365  9.013165
> rowMax(tmp5)
 [1] 471.20359  82.38296  97.40366  87.16822  89.69399  82.93927  78.43736
 [8]  85.29049  82.82868  87.95263
> rowMin(tmp5)
 [1] 57.30904 57.98651 55.50377 58.59602 55.74648 53.86765 60.55442 61.76061
 [9] 52.96717 56.58373
> 
> colMeans(tmp5)
 [1] 114.79181  67.18074  72.98091  69.39802  69.98480  71.32940  71.51893
 [8]  74.38675  70.30609  67.93943  72.93004  69.96076  73.32608  72.14852
[15]  69.50740  71.31295  68.40394  67.21915  69.12604  70.78308
> colSums(tmp5)
 [1] 1147.9181  671.8074  729.8091  693.9802  699.8480  713.2940  715.1893
 [8]  743.8675  703.0609  679.3943  729.3004  699.6076  733.2608  721.4852
[15]  695.0740  713.1295  684.0394  672.1915  691.2604  707.8308
> colVars(tmp5)
 [1] 15740.57388    57.90525    91.36418    24.29977    79.13499    83.13981
 [7]   108.34483    51.63536    37.11488    54.06516   101.87352    30.41295
[13]   118.90081    70.91102   101.63938    60.95682    78.77515    79.63475
[19]    57.59380    66.08298
> colSd(tmp5)
 [1] 125.461444   7.609550   9.558461   4.929480   8.895785   9.118103
 [7]  10.408882   7.185775   6.092198   7.352902  10.093242   5.514794
[13]  10.904165   8.420868  10.081636   7.807485   8.875537   8.923830
[19]   7.589058   8.129144
> colMax(tmp5)
 [1] 471.20359  79.93971  97.40366  77.42823  85.53596  86.14130  83.39943
 [8]  85.29049  80.62684  78.43736  87.95263  83.73510  87.16822  85.59601
[15]  89.69399  86.27525  82.88256  76.87678  82.82868  82.54772
> colMin(tmp5)
 [1] 66.88921 53.85970 61.76061 58.49029 57.59736 55.50377 55.74648 63.99304
 [9] 59.33896 59.10009 57.30904 64.85719 58.02332 57.98651 52.96717 62.44532
[17] 55.65044 53.86765 56.58373 57.97552
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1]       NA 69.94285 71.26886 73.65681 72.68186 70.08995 70.20192 71.93232
 [9] 67.74953 68.40972
> rowSums(tmp5)
 [1]       NA 1398.857 1425.377 1473.136 1453.637 1401.799 1404.038 1438.646
 [9] 1354.991 1368.194
> rowVars(tmp5)
 [1] 8470.41547   48.94341   97.06426   54.05406  108.96405   48.51297
 [7]   24.74274   57.67971   97.38463   81.23715
> rowSd(tmp5)
 [1] 92.034860  6.995957  9.852120  7.352146 10.438585  6.965125  4.974208
 [8]  7.594716  9.868365  9.013165
> rowMax(tmp5)
 [1]       NA 82.38296 97.40366 87.16822 89.69399 82.93927 78.43736 85.29049
 [9] 82.82868 87.95263
> rowMin(tmp5)
 [1]       NA 57.98651 55.50377 58.59602 55.74648 53.86765 60.55442 61.76061
 [9] 52.96717 56.58373
> 
> colMeans(tmp5)
 [1] 114.79181  67.18074  72.98091  69.39802  69.98480  71.32940  71.51893
 [8]  74.38675  70.30609  67.93943  72.93004  69.96076  73.32608  72.14852
[15]  69.50740        NA  68.40394  67.21915  69.12604  70.78308
> colSums(tmp5)
 [1] 1147.9181  671.8074  729.8091  693.9802  699.8480  713.2940  715.1893
 [8]  743.8675  703.0609  679.3943  729.3004  699.6076  733.2608  721.4852
[15]  695.0740        NA  684.0394  672.1915  691.2604  707.8308
> colVars(tmp5)
 [1] 15740.57388    57.90525    91.36418    24.29977    79.13499    83.13981
 [7]   108.34483    51.63536    37.11488    54.06516   101.87352    30.41295
[13]   118.90081    70.91102   101.63938          NA    78.77515    79.63475
[19]    57.59380    66.08298
> colSd(tmp5)
 [1] 125.461444   7.609550   9.558461   4.929480   8.895785   9.118103
 [7]  10.408882   7.185775   6.092198   7.352902  10.093242   5.514794
[13]  10.904165   8.420868  10.081636         NA   8.875537   8.923830
[19]   7.589058   8.129144
> colMax(tmp5)
 [1] 471.20359  79.93971  97.40366  77.42823  85.53596  86.14130  83.39943
 [8]  85.29049  80.62684  78.43736  87.95263  83.73510  87.16822  85.59601
[15]  89.69399        NA  82.88256  76.87678  82.82868  82.54772
> colMin(tmp5)
 [1] 66.88921 53.85970 61.76061 58.49029 57.59736 55.50377 55.74648 63.99304
 [9] 59.33896 59.10009 57.30904 64.85719 58.02332 57.98651 52.96717       NA
[17] 55.65044 53.86765 56.58373 57.97552
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.2036
> Min(tmp5,na.rm=TRUE)
[1] 52.96717
> mean(tmp5,na.rm=TRUE)
[1] 72.76699
> Sum(tmp5,na.rm=TRUE)
[1] 14480.63
> Var(tmp5,na.rm=TRUE)
[1] 874.6882
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.73440 69.94285 71.26886 73.65681 72.68186 70.08995 70.20192 71.93232
 [9] 67.74953 68.40972
> rowSums(tmp5,na.rm=TRUE)
 [1] 1761.954 1398.857 1425.377 1473.136 1453.637 1401.799 1404.038 1438.646
 [9] 1354.991 1368.194
> rowVars(tmp5,na.rm=TRUE)
 [1] 8470.41547   48.94341   97.06426   54.05406  108.96405   48.51297
 [7]   24.74274   57.67971   97.38463   81.23715
> rowSd(tmp5,na.rm=TRUE)
 [1] 92.034860  6.995957  9.852120  7.352146 10.438585  6.965125  4.974208
 [8]  7.594716  9.868365  9.013165
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.20359  82.38296  97.40366  87.16822  89.69399  82.93927  78.43736
 [8]  85.29049  82.82868  87.95263
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.30904 57.98651 55.50377 58.59602 55.74648 53.86765 60.55442 61.76061
 [9] 52.96717 56.58373
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 114.79181  67.18074  72.98091  69.39802  69.98480  71.32940  71.51893
 [8]  74.38675  70.30609  67.93943  72.93004  69.96076  73.32608  72.14852
[15]  69.50740  72.04567  68.40394  67.21915  69.12604  70.78308
> colSums(tmp5,na.rm=TRUE)
 [1] 1147.9181  671.8074  729.8091  693.9802  699.8480  713.2940  715.1893
 [8]  743.8675  703.0609  679.3943  729.3004  699.6076  733.2608  721.4852
[15]  695.0740  648.4110  684.0394  672.1915  691.2604  707.8308
> colVars(tmp5,na.rm=TRUE)
 [1] 15740.57388    57.90525    91.36418    24.29977    79.13499    83.13981
 [7]   108.34483    51.63536    37.11488    54.06516   101.87352    30.41295
[13]   118.90081    70.91102   101.63938    62.53659    78.77515    79.63475
[19]    57.59380    66.08298
> colSd(tmp5,na.rm=TRUE)
 [1] 125.461444   7.609550   9.558461   4.929480   8.895785   9.118103
 [7]  10.408882   7.185775   6.092198   7.352902  10.093242   5.514794
[13]  10.904165   8.420868  10.081636   7.908008   8.875537   8.923830
[19]   7.589058   8.129144
> colMax(tmp5,na.rm=TRUE)
 [1] 471.20359  79.93971  97.40366  77.42823  85.53596  86.14130  83.39943
 [8]  85.29049  80.62684  78.43736  87.95263  83.73510  87.16822  85.59601
[15]  89.69399  86.27525  82.88256  76.87678  82.82868  82.54772
> colMin(tmp5,na.rm=TRUE)
 [1] 66.88921 53.85970 61.76061 58.49029 57.59736 55.50377 55.74648 63.99304
 [9] 59.33896 59.10009 57.30904 64.85719 58.02332 57.98651 52.96717 62.44532
[17] 55.65044 53.86765 56.58373 57.97552
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 69.94285 71.26886 73.65681 72.68186 70.08995 70.20192 71.93232
 [9] 67.74953 68.40972
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1398.857 1425.377 1473.136 1453.637 1401.799 1404.038 1438.646
 [9] 1354.991 1368.194
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  48.94341  97.06426  54.05406 108.96405  48.51297  24.74274
 [8]  57.67971  97.38463  81.23715
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  6.995957  9.852120  7.352146 10.438585  6.965125  4.974208
 [8]  7.594716  9.868365  9.013165
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 82.38296 97.40366 87.16822 89.69399 82.93927 78.43736 85.29049
 [9] 82.82868 87.95263
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 57.98651 55.50377 58.59602 55.74648 53.86765 60.55442 61.76061
 [9] 52.96717 56.58373
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 75.19050 65.76307 73.20644 69.71335 71.36119 71.22695 70.70161 74.54334
 [9] 71.52467 68.92158 74.66570 68.43028 73.54505 71.29183 68.41069      NaN
[17] 68.32724 66.14607 68.57403 69.59704
> colSums(tmp5,na.rm=TRUE)
 [1] 676.7145 591.8677 658.8579 627.4201 642.2507 641.0425 636.3145 670.8901
 [9] 643.7220 620.2942 671.9913 615.8725 661.9054 641.6265 615.6962   0.0000
[17] 614.9451 595.3147 617.1663 626.3733
> colVars(tmp5,na.rm=TRUE)
 [1]  65.17929  42.53349 102.21252  26.21861  67.71453  93.41419 114.37275
 [8]  57.81393  25.04896  49.97137  80.71667   7.86285 133.22399  71.51822
[15] 100.81312        NA  88.55584  76.63493  61.36502  58.51790
> colSd(tmp5,na.rm=TRUE)
 [1]  8.073369  6.521771 10.110021  5.120411  8.228884  9.665102 10.694520
 [8]  7.603547  5.004894  7.069043  8.984246  2.804077 11.542270  8.456845
[15] 10.040574        NA  9.410411  8.754138  7.833583  7.649700
> colMax(tmp5,na.rm=TRUE)
 [1] 88.46814 74.58418 97.40366 77.42823 85.53596 86.14130 83.39943 85.29049
 [9] 80.62684 78.43736 87.95263 73.98953 87.16822 85.59601 89.69399     -Inf
[17] 82.88256 75.83571 82.82868 82.54772
> colMin(tmp5,na.rm=TRUE)
 [1] 66.88921 53.85970 61.76061 58.49029 59.14124 55.50377 55.74648 63.99304
 [9] 64.67697 62.16300 58.85637 64.85719 58.02332 57.98651 52.96717      Inf
[17] 55.65044 53.86765 56.58373 57.97552
> 
> 
> 
> 
> 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] 187.9594 210.5986 228.3530 346.8650 215.2424 237.6190 118.4976 208.6655
 [9] 233.1144 270.0433
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 187.9594 210.5986 228.3530 346.8650 215.2424 237.6190 118.4976 208.6655
 [9] 233.1144 270.0433
> 
> 
> 
> 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  0.000000e+00  5.684342e-14  1.989520e-13 -1.421085e-13
 [6] -8.526513e-14 -2.842171e-14  2.842171e-14  1.705303e-13  0.000000e+00
[11]  5.684342e-14  7.105427e-14  0.000000e+00  1.705303e-13  0.000000e+00
[16]  5.684342e-14  1.136868e-13  5.684342e-14 -3.979039e-13  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
1   7 
8   13 
2   4 
7   13 
7   8 
1   13 
10   17 
3   20 
3   13 
8   11 
3   5 
2   8 
8   17 
2   7 
2   11 
1   14 
7   1 
5   9 
9   16 
1   19 
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.151908
> Min(tmp)
[1] -1.754398
> mean(tmp)
[1] 0.1649764
> Sum(tmp)
[1] 16.49764
> Var(tmp)
[1] 0.6255368
> 
> rowMeans(tmp)
[1] 0.1649764
> rowSums(tmp)
[1] 16.49764
> rowVars(tmp)
[1] 0.6255368
> rowSd(tmp)
[1] 0.7909088
> rowMax(tmp)
[1] 2.151908
> rowMin(tmp)
[1] -1.754398
> 
> colMeans(tmp)
  [1] -0.65334785 -0.08316170 -0.18470911  1.36546339 -0.06978303  0.63587212
  [7]  1.53681608  0.27516413 -0.30467471 -0.35859201 -0.47145719 -0.41450284
 [13] -0.09755148  0.72381179 -0.01201085 -0.05628744  0.18941915  0.25621866
 [19]  0.04106911 -0.05503954 -0.23494769  0.10845604  0.47367313  1.54871461
 [25]  1.31354337  0.16299332 -0.67858299  0.22641617  1.53130477  1.22662427
 [31] -0.58164284 -0.24467104  0.08667236  0.41792979 -0.29872487 -0.61862659
 [37]  0.54078337 -0.91849313 -0.69872090 -0.47641687  0.22477419 -1.06923168
 [43] -1.16057928  0.94100189  0.48698944  0.28274049 -0.11672031  0.42686452
 [49] -0.94491644  0.01566600  0.75357878  0.18742993 -0.90619726  0.82025362
 [55]  0.91486348 -0.37369313 -0.42016974 -0.36483784  1.82288960 -0.84905711
 [61]  1.09603187  0.45487797 -0.18566292  0.22836956 -0.56098788 -0.01036481
 [67] -0.43041930  0.37557325  1.14095774  0.06140091  0.39871450  0.58274685
 [73] -0.02740646 -1.55443945 -0.14714270  1.55195974  0.05003337  0.42678531
 [79]  1.25897398 -0.13580337  0.16445401 -0.06340975  0.58102204  0.02840782
 [85]  1.82170356  0.50851585  0.37827262 -0.29078851  1.50029134 -1.75439820
 [91]  1.81556904  1.44085821  0.06512903 -0.55065129 -0.75835824 -1.55579586
 [97]  0.70459224  2.15190776 -0.46748019  0.38294778
> colSums(tmp)
  [1] -0.65334785 -0.08316170 -0.18470911  1.36546339 -0.06978303  0.63587212
  [7]  1.53681608  0.27516413 -0.30467471 -0.35859201 -0.47145719 -0.41450284
 [13] -0.09755148  0.72381179 -0.01201085 -0.05628744  0.18941915  0.25621866
 [19]  0.04106911 -0.05503954 -0.23494769  0.10845604  0.47367313  1.54871461
 [25]  1.31354337  0.16299332 -0.67858299  0.22641617  1.53130477  1.22662427
 [31] -0.58164284 -0.24467104  0.08667236  0.41792979 -0.29872487 -0.61862659
 [37]  0.54078337 -0.91849313 -0.69872090 -0.47641687  0.22477419 -1.06923168
 [43] -1.16057928  0.94100189  0.48698944  0.28274049 -0.11672031  0.42686452
 [49] -0.94491644  0.01566600  0.75357878  0.18742993 -0.90619726  0.82025362
 [55]  0.91486348 -0.37369313 -0.42016974 -0.36483784  1.82288960 -0.84905711
 [61]  1.09603187  0.45487797 -0.18566292  0.22836956 -0.56098788 -0.01036481
 [67] -0.43041930  0.37557325  1.14095774  0.06140091  0.39871450  0.58274685
 [73] -0.02740646 -1.55443945 -0.14714270  1.55195974  0.05003337  0.42678531
 [79]  1.25897398 -0.13580337  0.16445401 -0.06340975  0.58102204  0.02840782
 [85]  1.82170356  0.50851585  0.37827262 -0.29078851  1.50029134 -1.75439820
 [91]  1.81556904  1.44085821  0.06512903 -0.55065129 -0.75835824 -1.55579586
 [97]  0.70459224  2.15190776 -0.46748019  0.38294778
> 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.65334785 -0.08316170 -0.18470911  1.36546339 -0.06978303  0.63587212
  [7]  1.53681608  0.27516413 -0.30467471 -0.35859201 -0.47145719 -0.41450284
 [13] -0.09755148  0.72381179 -0.01201085 -0.05628744  0.18941915  0.25621866
 [19]  0.04106911 -0.05503954 -0.23494769  0.10845604  0.47367313  1.54871461
 [25]  1.31354337  0.16299332 -0.67858299  0.22641617  1.53130477  1.22662427
 [31] -0.58164284 -0.24467104  0.08667236  0.41792979 -0.29872487 -0.61862659
 [37]  0.54078337 -0.91849313 -0.69872090 -0.47641687  0.22477419 -1.06923168
 [43] -1.16057928  0.94100189  0.48698944  0.28274049 -0.11672031  0.42686452
 [49] -0.94491644  0.01566600  0.75357878  0.18742993 -0.90619726  0.82025362
 [55]  0.91486348 -0.37369313 -0.42016974 -0.36483784  1.82288960 -0.84905711
 [61]  1.09603187  0.45487797 -0.18566292  0.22836956 -0.56098788 -0.01036481
 [67] -0.43041930  0.37557325  1.14095774  0.06140091  0.39871450  0.58274685
 [73] -0.02740646 -1.55443945 -0.14714270  1.55195974  0.05003337  0.42678531
 [79]  1.25897398 -0.13580337  0.16445401 -0.06340975  0.58102204  0.02840782
 [85]  1.82170356  0.50851585  0.37827262 -0.29078851  1.50029134 -1.75439820
 [91]  1.81556904  1.44085821  0.06512903 -0.55065129 -0.75835824 -1.55579586
 [97]  0.70459224  2.15190776 -0.46748019  0.38294778
> colMin(tmp)
  [1] -0.65334785 -0.08316170 -0.18470911  1.36546339 -0.06978303  0.63587212
  [7]  1.53681608  0.27516413 -0.30467471 -0.35859201 -0.47145719 -0.41450284
 [13] -0.09755148  0.72381179 -0.01201085 -0.05628744  0.18941915  0.25621866
 [19]  0.04106911 -0.05503954 -0.23494769  0.10845604  0.47367313  1.54871461
 [25]  1.31354337  0.16299332 -0.67858299  0.22641617  1.53130477  1.22662427
 [31] -0.58164284 -0.24467104  0.08667236  0.41792979 -0.29872487 -0.61862659
 [37]  0.54078337 -0.91849313 -0.69872090 -0.47641687  0.22477419 -1.06923168
 [43] -1.16057928  0.94100189  0.48698944  0.28274049 -0.11672031  0.42686452
 [49] -0.94491644  0.01566600  0.75357878  0.18742993 -0.90619726  0.82025362
 [55]  0.91486348 -0.37369313 -0.42016974 -0.36483784  1.82288960 -0.84905711
 [61]  1.09603187  0.45487797 -0.18566292  0.22836956 -0.56098788 -0.01036481
 [67] -0.43041930  0.37557325  1.14095774  0.06140091  0.39871450  0.58274685
 [73] -0.02740646 -1.55443945 -0.14714270  1.55195974  0.05003337  0.42678531
 [79]  1.25897398 -0.13580337  0.16445401 -0.06340975  0.58102204  0.02840782
 [85]  1.82170356  0.50851585  0.37827262 -0.29078851  1.50029134 -1.75439820
 [91]  1.81556904  1.44085821  0.06512903 -0.55065129 -0.75835824 -1.55579586
 [97]  0.70459224  2.15190776 -0.46748019  0.38294778
> colMedians(tmp)
  [1] -0.65334785 -0.08316170 -0.18470911  1.36546339 -0.06978303  0.63587212
  [7]  1.53681608  0.27516413 -0.30467471 -0.35859201 -0.47145719 -0.41450284
 [13] -0.09755148  0.72381179 -0.01201085 -0.05628744  0.18941915  0.25621866
 [19]  0.04106911 -0.05503954 -0.23494769  0.10845604  0.47367313  1.54871461
 [25]  1.31354337  0.16299332 -0.67858299  0.22641617  1.53130477  1.22662427
 [31] -0.58164284 -0.24467104  0.08667236  0.41792979 -0.29872487 -0.61862659
 [37]  0.54078337 -0.91849313 -0.69872090 -0.47641687  0.22477419 -1.06923168
 [43] -1.16057928  0.94100189  0.48698944  0.28274049 -0.11672031  0.42686452
 [49] -0.94491644  0.01566600  0.75357878  0.18742993 -0.90619726  0.82025362
 [55]  0.91486348 -0.37369313 -0.42016974 -0.36483784  1.82288960 -0.84905711
 [61]  1.09603187  0.45487797 -0.18566292  0.22836956 -0.56098788 -0.01036481
 [67] -0.43041930  0.37557325  1.14095774  0.06140091  0.39871450  0.58274685
 [73] -0.02740646 -1.55443945 -0.14714270  1.55195974  0.05003337  0.42678531
 [79]  1.25897398 -0.13580337  0.16445401 -0.06340975  0.58102204  0.02840782
 [85]  1.82170356  0.50851585  0.37827262 -0.29078851  1.50029134 -1.75439820
 [91]  1.81556904  1.44085821  0.06512903 -0.55065129 -0.75835824 -1.55579586
 [97]  0.70459224  2.15190776 -0.46748019  0.38294778
> colRanges(tmp)
           [,1]       [,2]       [,3]     [,4]        [,5]      [,6]     [,7]
[1,] -0.6533478 -0.0831617 -0.1847091 1.365463 -0.06978303 0.6358721 1.536816
[2,] -0.6533478 -0.0831617 -0.1847091 1.365463 -0.06978303 0.6358721 1.536816
          [,8]       [,9]     [,10]      [,11]      [,12]       [,13]     [,14]
[1,] 0.2751641 -0.3046747 -0.358592 -0.4714572 -0.4145028 -0.09755148 0.7238118
[2,] 0.2751641 -0.3046747 -0.358592 -0.4714572 -0.4145028 -0.09755148 0.7238118
           [,15]       [,16]     [,17]     [,18]      [,19]       [,20]
[1,] -0.01201085 -0.05628744 0.1894191 0.2562187 0.04106911 -0.05503954
[2,] -0.01201085 -0.05628744 0.1894191 0.2562187 0.04106911 -0.05503954
          [,21]    [,22]     [,23]    [,24]    [,25]     [,26]     [,27]
[1,] -0.2349477 0.108456 0.4736731 1.548715 1.313543 0.1629933 -0.678583
[2,] -0.2349477 0.108456 0.4736731 1.548715 1.313543 0.1629933 -0.678583
         [,28]    [,29]    [,30]      [,31]     [,32]      [,33]     [,34]
[1,] 0.2264162 1.531305 1.226624 -0.5816428 -0.244671 0.08667236 0.4179298
[2,] 0.2264162 1.531305 1.226624 -0.5816428 -0.244671 0.08667236 0.4179298
          [,35]      [,36]     [,37]      [,38]      [,39]      [,40]     [,41]
[1,] -0.2987249 -0.6186266 0.5407834 -0.9184931 -0.6987209 -0.4764169 0.2247742
[2,] -0.2987249 -0.6186266 0.5407834 -0.9184931 -0.6987209 -0.4764169 0.2247742
         [,42]     [,43]     [,44]     [,45]     [,46]      [,47]     [,48]
[1,] -1.069232 -1.160579 0.9410019 0.4869894 0.2827405 -0.1167203 0.4268645
[2,] -1.069232 -1.160579 0.9410019 0.4869894 0.2827405 -0.1167203 0.4268645
          [,49]    [,50]     [,51]     [,52]      [,53]     [,54]     [,55]
[1,] -0.9449164 0.015666 0.7535788 0.1874299 -0.9061973 0.8202536 0.9148635
[2,] -0.9449164 0.015666 0.7535788 0.1874299 -0.9061973 0.8202536 0.9148635
          [,56]      [,57]      [,58]   [,59]      [,60]    [,61]    [,62]
[1,] -0.3736931 -0.4201697 -0.3648378 1.82289 -0.8490571 1.096032 0.454878
[2,] -0.3736931 -0.4201697 -0.3648378 1.82289 -0.8490571 1.096032 0.454878
          [,63]     [,64]      [,65]       [,66]      [,67]     [,68]    [,69]
[1,] -0.1856629 0.2283696 -0.5609879 -0.01036481 -0.4304193 0.3755733 1.140958
[2,] -0.1856629 0.2283696 -0.5609879 -0.01036481 -0.4304193 0.3755733 1.140958
          [,70]     [,71]     [,72]       [,73]     [,74]      [,75]   [,76]
[1,] 0.06140091 0.3987145 0.5827469 -0.02740646 -1.554439 -0.1471427 1.55196
[2,] 0.06140091 0.3987145 0.5827469 -0.02740646 -1.554439 -0.1471427 1.55196
          [,77]     [,78]    [,79]      [,80]    [,81]       [,82]    [,83]
[1,] 0.05003337 0.4267853 1.258974 -0.1358034 0.164454 -0.06340975 0.581022
[2,] 0.05003337 0.4267853 1.258974 -0.1358034 0.164454 -0.06340975 0.581022
          [,84]    [,85]     [,86]     [,87]      [,88]    [,89]     [,90]
[1,] 0.02840782 1.821704 0.5085159 0.3782726 -0.2907885 1.500291 -1.754398
[2,] 0.02840782 1.821704 0.5085159 0.3782726 -0.2907885 1.500291 -1.754398
        [,91]    [,92]      [,93]      [,94]      [,95]     [,96]     [,97]
[1,] 1.815569 1.440858 0.06512903 -0.5506513 -0.7583582 -1.555796 0.7045922
[2,] 1.815569 1.440858 0.06512903 -0.5506513 -0.7583582 -1.555796 0.7045922
        [,98]      [,99]    [,100]
[1,] 2.151908 -0.4674802 0.3829478
[2,] 2.151908 -0.4674802 0.3829478
> 
> 
> Max(tmp2)
[1] 2.318794
> Min(tmp2)
[1] -2.047052
> mean(tmp2)
[1] -0.01209662
> Sum(tmp2)
[1] -1.209662
> Var(tmp2)
[1] 0.8806227
> 
> rowMeans(tmp2)
  [1] -0.45588214  0.61396360  0.59856907  0.83671546  0.75209380 -1.81836797
  [7] -0.96502766 -0.07787725 -0.38136195 -0.61533919 -0.67006001 -0.39464000
 [13] -0.15076950 -0.90692881  1.30891552 -1.14401569 -1.15481407  0.19344077
 [19]  0.53409785  1.32548487  0.67690838 -1.07199507 -0.88889986 -1.01113869
 [25] -0.43744685 -1.27502114 -0.21563579 -0.76135018  0.93550472 -0.47055265
 [31] -0.33900216 -0.80524595 -0.56656861 -0.99679640  0.48108710 -1.18452576
 [37] -0.12870958  0.32530657 -1.38531933 -0.17341845 -0.04127873 -1.26198122
 [43]  1.51785903 -0.98475503 -0.47944516  0.55921915 -0.81746175 -1.77300027
 [49]  1.10779150  0.41176998  1.45599791  1.18495574 -0.16289449  0.85505398
 [55]  0.85544025  1.23143162  1.19945963 -0.62041916  0.28490119  0.77187214
 [61]  0.94737695  0.26739091  0.89557367  2.31879446 -0.69026378  1.28104246
 [67]  0.15714850 -0.59544229  0.89657477  0.03459471 -0.87281001 -0.18310347
 [73] -1.09741213  0.07490991 -1.27133046 -0.04485575  1.17078573  0.99898636
 [79] -0.63649675 -1.13355674 -0.09028662  1.62546746  1.73592008  1.12507754
 [85] -0.01961378 -0.36559814  1.42282180  0.82177588 -0.93983634  0.05883269
 [91] -0.04115922 -2.04705168  0.17800560 -0.25281426 -1.85876158  0.97384352
 [97]  0.10076402  1.40274167 -0.45905209 -0.52853845
> rowSums(tmp2)
  [1] -0.45588214  0.61396360  0.59856907  0.83671546  0.75209380 -1.81836797
  [7] -0.96502766 -0.07787725 -0.38136195 -0.61533919 -0.67006001 -0.39464000
 [13] -0.15076950 -0.90692881  1.30891552 -1.14401569 -1.15481407  0.19344077
 [19]  0.53409785  1.32548487  0.67690838 -1.07199507 -0.88889986 -1.01113869
 [25] -0.43744685 -1.27502114 -0.21563579 -0.76135018  0.93550472 -0.47055265
 [31] -0.33900216 -0.80524595 -0.56656861 -0.99679640  0.48108710 -1.18452576
 [37] -0.12870958  0.32530657 -1.38531933 -0.17341845 -0.04127873 -1.26198122
 [43]  1.51785903 -0.98475503 -0.47944516  0.55921915 -0.81746175 -1.77300027
 [49]  1.10779150  0.41176998  1.45599791  1.18495574 -0.16289449  0.85505398
 [55]  0.85544025  1.23143162  1.19945963 -0.62041916  0.28490119  0.77187214
 [61]  0.94737695  0.26739091  0.89557367  2.31879446 -0.69026378  1.28104246
 [67]  0.15714850 -0.59544229  0.89657477  0.03459471 -0.87281001 -0.18310347
 [73] -1.09741213  0.07490991 -1.27133046 -0.04485575  1.17078573  0.99898636
 [79] -0.63649675 -1.13355674 -0.09028662  1.62546746  1.73592008  1.12507754
 [85] -0.01961378 -0.36559814  1.42282180  0.82177588 -0.93983634  0.05883269
 [91] -0.04115922 -2.04705168  0.17800560 -0.25281426 -1.85876158  0.97384352
 [97]  0.10076402  1.40274167 -0.45905209 -0.52853845
> 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.45588214  0.61396360  0.59856907  0.83671546  0.75209380 -1.81836797
  [7] -0.96502766 -0.07787725 -0.38136195 -0.61533919 -0.67006001 -0.39464000
 [13] -0.15076950 -0.90692881  1.30891552 -1.14401569 -1.15481407  0.19344077
 [19]  0.53409785  1.32548487  0.67690838 -1.07199507 -0.88889986 -1.01113869
 [25] -0.43744685 -1.27502114 -0.21563579 -0.76135018  0.93550472 -0.47055265
 [31] -0.33900216 -0.80524595 -0.56656861 -0.99679640  0.48108710 -1.18452576
 [37] -0.12870958  0.32530657 -1.38531933 -0.17341845 -0.04127873 -1.26198122
 [43]  1.51785903 -0.98475503 -0.47944516  0.55921915 -0.81746175 -1.77300027
 [49]  1.10779150  0.41176998  1.45599791  1.18495574 -0.16289449  0.85505398
 [55]  0.85544025  1.23143162  1.19945963 -0.62041916  0.28490119  0.77187214
 [61]  0.94737695  0.26739091  0.89557367  2.31879446 -0.69026378  1.28104246
 [67]  0.15714850 -0.59544229  0.89657477  0.03459471 -0.87281001 -0.18310347
 [73] -1.09741213  0.07490991 -1.27133046 -0.04485575  1.17078573  0.99898636
 [79] -0.63649675 -1.13355674 -0.09028662  1.62546746  1.73592008  1.12507754
 [85] -0.01961378 -0.36559814  1.42282180  0.82177588 -0.93983634  0.05883269
 [91] -0.04115922 -2.04705168  0.17800560 -0.25281426 -1.85876158  0.97384352
 [97]  0.10076402  1.40274167 -0.45905209 -0.52853845
> rowMin(tmp2)
  [1] -0.45588214  0.61396360  0.59856907  0.83671546  0.75209380 -1.81836797
  [7] -0.96502766 -0.07787725 -0.38136195 -0.61533919 -0.67006001 -0.39464000
 [13] -0.15076950 -0.90692881  1.30891552 -1.14401569 -1.15481407  0.19344077
 [19]  0.53409785  1.32548487  0.67690838 -1.07199507 -0.88889986 -1.01113869
 [25] -0.43744685 -1.27502114 -0.21563579 -0.76135018  0.93550472 -0.47055265
 [31] -0.33900216 -0.80524595 -0.56656861 -0.99679640  0.48108710 -1.18452576
 [37] -0.12870958  0.32530657 -1.38531933 -0.17341845 -0.04127873 -1.26198122
 [43]  1.51785903 -0.98475503 -0.47944516  0.55921915 -0.81746175 -1.77300027
 [49]  1.10779150  0.41176998  1.45599791  1.18495574 -0.16289449  0.85505398
 [55]  0.85544025  1.23143162  1.19945963 -0.62041916  0.28490119  0.77187214
 [61]  0.94737695  0.26739091  0.89557367  2.31879446 -0.69026378  1.28104246
 [67]  0.15714850 -0.59544229  0.89657477  0.03459471 -0.87281001 -0.18310347
 [73] -1.09741213  0.07490991 -1.27133046 -0.04485575  1.17078573  0.99898636
 [79] -0.63649675 -1.13355674 -0.09028662  1.62546746  1.73592008  1.12507754
 [85] -0.01961378 -0.36559814  1.42282180  0.82177588 -0.93983634  0.05883269
 [91] -0.04115922 -2.04705168  0.17800560 -0.25281426 -1.85876158  0.97384352
 [97]  0.10076402  1.40274167 -0.45905209 -0.52853845
> 
> colMeans(tmp2)
[1] -0.01209662
> colSums(tmp2)
[1] -1.209662
> colVars(tmp2)
[1] 0.8806227
> colSd(tmp2)
[1] 0.938415
> colMax(tmp2)
[1] 2.318794
> colMin(tmp2)
[1] -2.047052
> colMedians(tmp2)
[1] -0.08408193
> colRanges(tmp2)
          [,1]
[1,] -2.047052
[2,]  2.318794
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -1.7321637 -5.1893727 -1.5396772 -0.3270164  0.2808195  1.3205782
 [7]  3.0947024  0.8244909  2.3715154  1.7456839
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9950391
[2,] -0.5438738
[3,] -0.2124595
[4,]  0.1034241
[5,]  0.8589680
> 
> rowApply(tmp,sum)
 [1] -0.8294798 -4.8031309 -4.2396929  7.4073324  0.7309883 -0.6069422
 [7]  0.5883155  3.1643104  1.4929700 -2.0551106
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    5    9    1    5    4    7    5    3     8
 [2,]    1    9    1    4    3    8    2    2    5     6
 [3,]   10    1    4    2    9    2    3    7    7     2
 [4,]    4   10    7   10    4    1    1    4    2     9
 [5,]    7    6    3    8    1   10    9    3    9     1
 [6,]    2    4   10    6    2    3    8    9    8     3
 [7,]    6    2    6    9   10    7    4    6   10     4
 [8,]    5    7    5    3    8    9    5   10    1     7
 [9,]    9    8    8    5    6    6    6    1    6    10
[10,]    8    3    2    7    7    5   10    8    4     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  3.2142945 -1.0029195  0.3254314  1.2742018  2.3382441 -0.7141094
 [7] -1.0670086  3.1555425 -0.5994773 -1.5296273 -0.2868230 -1.3808801
[13]  2.7789311  1.8895163  2.1428850  2.2157591  0.1835684 -0.3398984
[19]  1.2416324 -1.0257085
> colApply(tmp,quantile)[,1]
           [,1]
[1,] 0.09176426
[2,] 0.39642350
[3,] 0.52825094
[4,] 0.96157058
[5,] 1.23628524
> 
> rowApply(tmp,sum)
[1]  6.998857 11.980671 -1.998171 -4.821954  0.654150
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   13   15   12   17   18
[2,]    5    1   20    2    4
[3,]    4   17    8    7   14
[4,]   16    4   14   11   10
[5,]    3   19   18    4   19
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]         [,4]       [,5]        [,6]
[1,] 0.52825094 -0.1067839 -0.2060002  0.824922601 -0.6000073 -0.04975866
[2,] 0.96157058 -0.6791350  1.1141171 -0.004518028  1.5640145 -0.39318878
[3,] 0.09176426  1.8488690 -0.3589936  0.418911290  1.2163564 -0.45651653
[4,] 0.39642350 -1.5555901 -0.6638108  0.014422560 -1.1039544  0.46236024
[5,] 1.23628524 -0.5102795  0.4401190  0.020463418  1.2618348 -0.27700569
            [,7]       [,8]        [,9]      [,10]       [,11]      [,12]
[1,]  0.33452175 0.73152542  0.05981781  1.4006772  1.62360272 -1.2822218
[2,]  0.05186548 0.86570141  0.90267110 -0.4467370  0.85577682  1.3758651
[3,]  1.05512826 0.45347658  0.07234348 -1.8789119 -2.42912015 -0.2078450
[4,] -0.81209818 0.07899515 -0.52204786 -0.3311339  0.05274361 -1.5119562
[5,] -1.69642591 1.02584389 -1.11226186 -0.2735216 -0.38982601  0.2452777
          [,13]     [,14]      [,15]       [,16]      [,17]      [,18]
[1,]  2.0272102 0.5040768  0.7326463  0.04906949  0.4675551 -1.4380502
[2,]  1.0459454 0.2184739  0.2835731  0.45895266  2.4421084  0.5779716
[3,] -1.1718399 0.4004173 -0.7628321 -0.55182394 -0.3398957  1.4638775
[4,]  1.2122376 0.2211286 -0.3038026  2.24471989  0.2718995 -1.0781364
[5,] -0.3346222 0.5454197  2.1933002  0.01484097 -2.6580988  0.1344391
          [,19]      [,20]
[1,] 0.40939740  0.9884059
[2,] 0.02696606  0.7586769
[3,] 0.50645440 -1.3679904
[4,] 0.22224418 -2.1165979
[5,] 0.07657037  0.7117971
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1        col2      col3      col4      col5        col6      col7
row1 -0.7341533 -0.07256032 0.1918689 0.7628883 -1.099243 -0.03478558 -1.076104
         col8      col9     col10     col11     col12     col13       col14
row1 0.969736 0.2106718 -0.878668 0.5865651 0.4217166 -1.058527 -0.05348667
        col15     col16     col17      col18    col19    col20
row1 1.133259 0.3711717 -1.482785 -0.5234423 1.138474 1.527559
> tmp[,"col10"]
          col10
row1 -0.8786680
row2 -0.3397641
row3  1.8273690
row4 -0.7145421
row5  1.4630323
> tmp[c("row1","row5"),]
           col1        col2       col3      col4       col5        col6
row1 -0.7341533 -0.07256032  0.1918689 0.7628883 -1.0992426 -0.03478558
row5  0.5666702 -1.25104663 -0.0480539 0.3612306 -0.2198469  0.40651314
            col7      col8       col9     col10     col11      col12     col13
row1 -1.07610363 0.9697360  0.2106718 -0.878668 0.5865651  0.4217166 -1.058527
row5 -0.09649551 0.9415224 -0.7907173  1.463032 2.2622305 -0.6663641  1.128855
           col14    col15      col16     col17      col18    col19     col20
row1 -0.05348667 1.133259  0.3711717 -1.482785 -0.5234423 1.138474  1.527559
row5 -1.36266402 1.004225 -0.6161237  1.618689 -0.3984148 1.806051 -1.511667
> tmp[,c("col6","col20")]
            col6      col20
row1 -0.03478558  1.5275585
row2  1.16853886 -0.8944563
row3  0.90057226  0.7897045
row4 -0.57014173 -0.3362400
row5  0.40651314 -1.5116673
> tmp[c("row1","row5"),c("col6","col20")]
            col6     col20
row1 -0.03478558  1.527559
row5  0.40651314 -1.511667
> 
> 
> 
> 
> 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.3801 50.33325 50.24632 49.10133 50.51529 106.6041 50.23676 49.40341
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.73638 50.86792 49.83226 49.83059 49.51137 49.14694 49.67748 50.42676
        col17    col18    col19    col20
row1 49.59522 49.83001 50.17513 105.4051
> tmp[,"col10"]
        col10
row1 50.86792
row2 29.57455
row3 29.85673
row4 29.08692
row5 52.63998
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.38010 50.33325 50.24632 49.10133 50.51529 106.6041 50.23676 49.40341
row5 52.88863 48.61795 50.40533 48.60688 49.57069 105.6909 48.70962 51.24200
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.73638 50.86792 49.83226 49.83059 49.51137 49.14694 49.67748 50.42676
row5 50.58645 52.63998 51.40264 47.90223 50.67185 51.57741 48.87313 49.40687
        col17    col18    col19    col20
row1 49.59522 49.83001 50.17513 105.4051
row5 50.16143 50.10706 49.69561 105.0177
> tmp[,c("col6","col20")]
          col6     col20
row1 106.60408 105.40514
row2  74.43343  75.88574
row3  75.39995  74.47815
row4  75.88805  74.44874
row5 105.69093 105.01772
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.6041 105.4051
row5 105.6909 105.0177
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.6041 105.4051
row5 105.6909 105.0177
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.3730927
[2,] -0.3504112
[3,]  0.2236120
[4,] -2.4299193
[5,]  1.7628022
> tmp[,c("col17","col7")]
          col17      col7
[1,] -0.2695441  1.179087
[2,] -0.2439515 -1.069078
[3,]  0.1490119  2.051483
[4,]  0.1294783  1.463591
[5,] -1.1261058  1.569953
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -1.20248545  0.89209419
[2,]  0.57510685  0.09541211
[3,] -1.81529066  1.69541038
[4,] -1.15646150 -1.18387213
[5,]  0.09498518 -1.52932993
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.202485
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.2024855
[2,]  0.5751068
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]      [,3]      [,4]        [,5]      [,6]      [,7]
row3 -1.0463038 -1.6529103  2.138667 0.3186581 -0.01186829 0.3557278 0.8318121
row1  0.2809419 -0.4294261 -1.261360 0.5752168 -1.60589913 1.7114232 2.1825639
           [,8]      [,9]      [,10]     [,11]       [,12]      [,13]
row3 -1.2789610 -2.032424 -0.6654304 0.2673333 -0.58605924 -0.8045788
row1 -0.1760772 -1.221894 -0.4361736 0.8401069 -0.07928626 -0.3702096
          [,14]       [,15]       [,16]    [,17]      [,18]      [,19]
row3  0.5843203  1.54335088  0.05418989 0.349527 -0.6478500 -0.9821894
row1 -2.7911369 -0.04643385 -0.37053773 0.559298 -0.9016693  0.9128510
          [,20]
row3 -1.8115585
row1  0.4681358
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]       [,2]       [,3]      [,4]       [,5]     [,6]      [,7]
row2 -0.8612707 -0.1814688 0.06931986 -0.158759 -0.2218857 1.131735 0.1908652
           [,8]      [,9]      [,10]
row2 -0.1582589 -1.563304 -0.4447653
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]     [,2]      [,3]       [,4]      [,5]      [,6]     [,7]
row5 -0.6938719 1.851345 -1.647598 0.07634349 -1.244108 0.3433949 1.243464
          [,8]     [,9]     [,10]     [,11]      [,12]      [,13]     [,14]
row5 -1.629354 -0.41386 0.4802507 -2.065872 -0.4127954 -0.8607028 0.1767225
         [,15]      [,16]       [,17]     [,18]      [,19]      [,20]
row5 0.8066816 -0.2209001 -0.07185821 -1.309204 -0.9921826 -0.9541709
> 
> 
> 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: 0x6000017c87e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f311f45f818"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f312aa2ffb2"
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f31334114fc"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f3175c8c6ad"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f31506bc444"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f315322759b"
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f317b573dc0"
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f311c974783"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f31fd7f81f" 
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f312be2c359"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f3134871e91"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f3112e7dc88"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f31343f6e6a"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f31306a0bf2"
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM14f3123655b3" 
> 
> 
> ### 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: 0x6000017c93e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000017c93e0>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x6000017c93e0>
> rowMedians(tmp)
  [1] -0.1979199282 -0.3946858001 -0.1659242270 -0.7056063314  0.0950210325
  [6]  0.1665910043 -0.0793674832 -0.3914579590 -0.0876993399  0.1372015562
 [11] -0.0362797164 -0.0387925004  0.5449602914  0.1795146157 -0.0950318445
 [16] -0.7354787399  0.5061656992 -0.4564405895 -0.0003101371  0.0911597687
 [21] -0.1591309258 -0.1586543732 -0.0282036948 -0.1850509270 -0.1777178266
 [26] -0.1774828704  0.6192429356  0.5106149268 -0.5516180308  0.4129166516
 [31] -0.0515626619  0.4728203489  0.1750227954  0.0646731086 -0.2280305788
 [36]  0.3556353750  0.7077951156 -0.3777228380 -0.2539346893  0.3755256232
 [41]  0.3798398319  0.0474280410 -0.2134174678 -0.1945346596 -0.0168246672
 [46]  0.1270978807  0.0190387176 -0.4214558809  0.2137435386  0.1021690093
 [51] -0.1635992731  0.0549079020 -0.1046701141 -0.5758376005 -0.2776190882
 [56]  0.0193223237 -0.3102533918  0.0073214605 -0.6730552153 -0.1058637754
 [61] -0.4421196728  0.4761006577 -0.0190425418 -0.5964131943 -0.3196966606
 [66] -0.8235556012  0.5906798887  0.1869807799 -0.0688377239 -0.0234690605
 [71]  0.0654175921 -0.2405797515 -0.0777807820  0.0827406931  0.0341833958
 [76]  0.0904696321  0.6032390646  0.0438628746  0.0542354544 -0.2485787181
 [81] -0.2259845014  0.2120295535 -0.0938086045  0.2314399349  0.2506000772
 [86] -0.3096511260  0.1384983215 -0.4757622477 -0.2270230713  0.0106459449
 [91]  0.2393281132  0.0838611539 -0.4846702587  0.0783653509 -0.2342661465
 [96]  0.0232645318 -0.4369179834  0.2142563536 -0.2414133151  0.3588121778
[101] -0.0654455622 -0.1968866661  0.2604449437  0.3571000795  0.3461238388
[106]  0.0052954083 -0.4423607544  0.0394643468  0.1830279271 -0.2980698643
[111] -0.2525812587 -0.5114904249 -0.3686203400  0.5291930785 -0.1260244485
[116] -0.0639333054 -0.2164482146 -0.1789293121 -0.0076545545 -0.0679328234
[121]  0.0308966565  0.1244269611  0.0642243797  0.0627972145  0.0585036368
[126]  0.5239020955 -0.3517736457 -0.1585519783  0.4808537404 -0.0763695691
[131] -0.2896999498 -0.0084939603  0.1372871006 -0.3480373643 -0.7633688933
[136]  0.1692926987  0.2252022193 -0.2792763326 -0.1160208905 -0.1281297248
[141]  0.3350748987 -0.3502034326  0.3806185282  0.0184951234 -0.2419267697
[146]  0.4023707430  0.1439128152  0.0735070854 -0.4097075736 -0.2670538456
[151] -0.0460761340  0.1341436894 -0.1695659193  0.5695983887 -0.1960107734
[156]  0.0235834586  0.2532393087 -0.2029721345 -0.0842670915  0.2384321399
[161]  0.4612555695 -0.0700183316  0.6566161479  0.3470988759  0.1018110407
[166]  0.3500555045  0.6165678976 -0.1872498986 -0.1587479492 -0.6686328282
[171]  0.6717577223 -0.3757374832 -0.5190386803  0.2779542355  0.1732607183
[176] -0.1479794637 -0.5933613573 -0.6811608148  0.1186058042 -0.3880764838
[181]  0.2205409891 -0.6386084375 -0.0478218530 -0.5167481073  0.0916448265
[186] -0.0514383306 -0.5564245550  0.0151279589  0.4747191439  0.0779391921
[191]  0.2539756689 -0.5836713420  0.7184651773 -0.3162030475  0.3295053271
[196]  0.5333194371  0.3628700802 -0.0708238451  0.0632693797 -0.2077931710
[201] -0.0726811028 -0.0419971293  0.4444761293  0.5582020110  0.1718496649
[206] -0.0405154021  0.0975324150 -0.0519503393  0.3076898134  0.1781230988
[211]  0.3850264306 -0.0880549071 -0.1277536045  0.4034490655  0.2580279900
[216] -0.1792044056  0.1801352156  0.1044716974  0.3456705893 -0.7206568646
[221]  0.0956803297  0.0145630745 -0.0662852682  0.3501187447  0.0844960358
[226]  0.5514006311 -0.0564533544 -0.0750292345 -0.1627554020 -0.0040741581
> 
> proc.time()
   user  system elapsed 
  2.002   8.265  10.439 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

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

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

<pointer: 0x6000017104e0>
> .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: 0x6000017104e0>
> .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: 0x6000017104e0>
> .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: 0x6000017104e0>
> 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: 0x60000170c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000170c000>
> .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: 0x60000170c000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000170c000>
> .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: 0x60000170c000>
> 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: 0x60000170c180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000170c180>
> .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: 0x60000170c180>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000170c180>
> .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: 0x60000170c180>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60000170c180>
> .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: 0x60000170c180>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60000170c180>
> .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: 0x60000170c180>
> 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: 0x60000170c360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60000170c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000170c360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000170c360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile14f5f16323c2"  "BufferedMatrixFile14f5f34c53de7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile14f5f16323c2"  "BufferedMatrixFile14f5f34c53de7"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000170c600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000170c600>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000170c600>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000170c600>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60000170c600>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60000170c600>
> .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: 0x60000170c7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000170c7e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000170c7e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60000170c7e0>
> 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: 0x60000170c9c0>
> .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: 0x60000170c9c0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.358   0.110   0.452 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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

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

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

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

Attaching package: 'BufferedMatrix'

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

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.340   0.072   0.398 

Example timings