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

This page was generated on 2025-01-27 12:10 -0500 (Mon, 27 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4746
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4494
merida1macOS 12.7.5 Montereyx86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4517
kjohnson1macOS 13.6.6 Venturaarm644.4.2 (2024-10-31) -- "Pile of Leaves" 4469
taishanLinux (openEuler 24.03 LTS)aarch644.4.2 (2024-10-31) -- "Pile of Leaves" 4395
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-01-23 13:00 -0500 (Thu, 23 Jan 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
merida1macOS 12.7.5 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on 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.70.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.70.0.tar.gz
StartedAt: 2025-01-24 13:09:08 -0500 (Fri, 24 Jan 2025)
EndedAt: 2025-01-24 13:09:43 -0500 (Fri, 24 Jan 2025)
EllapsedTime: 34.7 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

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


* using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.2 (2024-10-31)
* 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.7.1
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.70.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 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.2 (2024-10-31) -- "Pile of Leaves"
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.239   0.086   0.318 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: 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 474168 25.4    1035467 55.3         NA   638597 34.2
Vcells 877630  6.7    8388608 64.0      65536  2072107 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] "Fri Jan 24 13:09:25 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Jan 24 13:09:25 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600002e78180>
> 
> 
> 
> 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] "Fri Jan 24 13:09:27 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Jan 24 13:09:28 2025"
> 
> ColMode(tmp2)
<pointer: 0x600002e78180>
> 
> 
> 
> ### 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.5234557 -0.03391968  1.3565872 -0.2941741
[2,]   0.5102901  0.94044139  0.1769854 -0.4876503
[3,]   0.3485093 -1.04899709 -0.3955687 -0.3386808
[4,]  -0.1962084 -1.53845399 -0.2218492 -0.7642611
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]       [,2]      [,3]      [,4]
[1,] 100.5234557 0.03391968 1.3565872 0.2941741
[2,]   0.5102901 0.94044139 0.1769854 0.4876503
[3,]   0.3485093 1.04899709 0.3955687 0.3386808
[4,]   0.1962084 1.53845399 0.2218492 0.7642611
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0261386 0.1841730 1.1647262 0.5423782
[2,]  0.7143459 0.9697636 0.4206963 0.6983196
[3,]  0.5903468 1.0242056 0.6289425 0.5819629
[4,]  0.4429542 1.2403443 0.4710087 0.8742203
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.78484 26.87565 38.00385 30.71796
[2,]  32.65375 35.63808 29.38395 32.47085
[3,]  31.25198 36.29105 31.68499 31.15831
[4,]  29.62575 38.94190 29.93194 34.50646
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002e781e0>
> exp(tmp5)
<pointer: 0x600002e781e0>
> log(tmp5,2)
<pointer: 0x600002e781e0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.9416
> Min(tmp5)
[1] 53.7958
> mean(tmp5)
[1] 73.31275
> Sum(tmp5)
[1] 14662.55
> Var(tmp5)
[1] 868.6247
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.78895 72.93723 70.40453 73.97076 70.53005 71.36800 68.77761 72.34220
 [9] 71.68287 69.32526
> rowSums(tmp5)
 [1] 1835.779 1458.745 1408.091 1479.415 1410.601 1427.360 1375.552 1446.844
 [9] 1433.657 1386.505
> rowVars(tmp5)
 [1] 7992.77556   65.14337   77.54643   69.95615  108.53945  105.07134
 [7]   55.29165   74.04580   79.51112   46.66962
> rowSd(tmp5)
 [1] 89.402324  8.071144  8.806045  8.363980 10.418227 10.250431  7.435836
 [8]  8.604987  8.916901  6.831517
> rowMax(tmp5)
 [1] 469.94157  84.19279  85.76658  89.44734  92.69463  89.16907  86.39653
 [8]  87.07559  95.85149  82.70810
> rowMin(tmp5)
 [1] 55.93814 58.23829 58.04137 61.66212 54.93933 53.79580 57.65768 57.50967
 [9] 60.47332 54.85549
> 
> colMeans(tmp5)
 [1] 111.92344  68.79367  68.25992  70.50285  70.78542  72.07461  73.26679
 [8]  77.16855  75.68671  72.23063  70.27343  71.06167  67.01730  72.45441
[15]  70.51930  68.80936  69.21801  69.74026  71.99867  74.46993
> colSums(tmp5)
 [1] 1119.2344  687.9367  682.5992  705.0285  707.8542  720.7461  732.6679
 [8]  771.6855  756.8671  722.3063  702.7343  710.6167  670.1730  724.5441
[15]  705.1930  688.0936  692.1801  697.4026  719.9867  744.6993
> colVars(tmp5)
 [1] 15880.99966   107.47974    47.00521    47.72259    57.31074    65.14624
 [7]   128.53953   164.01361    62.28870    67.90392    93.06043   124.24392
[13]    75.76891    37.38912    37.89737    54.61979    57.66471   111.05235
[19]    50.42255    58.41326
> colSd(tmp5)
 [1] 126.019838  10.367243   6.856035   6.908154   7.570386   8.071322
 [7]  11.337527  12.806780   7.892319   8.240384   9.646783  11.146475
[13]   8.704534   6.114665   6.156084   7.390520   7.593728  10.538138
[19]   7.100884   7.642857
> colMax(tmp5)
 [1] 469.94157  82.70810  79.97567  86.39653  84.83727  83.53625  89.44734
 [8]  95.85149  87.69541  84.20521  82.83736  88.94205  84.99376  80.07656
[15]  78.40185  79.24305  82.17707  87.91752  83.11566  83.40197
> colMin(tmp5)
 [1] 61.66212 55.93814 61.15884 63.25724 60.47332 58.84150 58.08567 58.39372
 [9] 63.20810 54.85549 58.04137 57.65925 54.93933 61.37356 59.85585 53.79580
[17] 57.99203 57.66051 61.18323 60.63649
> 
> 
> ### 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] 91.78895 72.93723 70.40453 73.97076 70.53005 71.36800 68.77761 72.34220
 [9]       NA 69.32526
> rowSums(tmp5)
 [1] 1835.779 1458.745 1408.091 1479.415 1410.601 1427.360 1375.552 1446.844
 [9]       NA 1386.505
> rowVars(tmp5)
 [1] 7992.77556   65.14337   77.54643   69.95615  108.53945  105.07134
 [7]   55.29165   74.04580   81.66270   46.66962
> rowSd(tmp5)
 [1] 89.402324  8.071144  8.806045  8.363980 10.418227 10.250431  7.435836
 [8]  8.604987  9.036742  6.831517
> rowMax(tmp5)
 [1] 469.94157  84.19279  85.76658  89.44734  92.69463  89.16907  86.39653
 [8]  87.07559        NA  82.70810
> rowMin(tmp5)
 [1] 55.93814 58.23829 58.04137 61.66212 54.93933 53.79580 57.65768 57.50967
 [9]       NA 54.85549
> 
> colMeans(tmp5)
 [1] 111.92344  68.79367  68.25992  70.50285  70.78542  72.07461  73.26679
 [8]  77.16855  75.68671        NA  70.27343  71.06167  67.01730  72.45441
[15]  70.51930  68.80936  69.21801  69.74026  71.99867  74.46993
> colSums(tmp5)
 [1] 1119.2344  687.9367  682.5992  705.0285  707.8542  720.7461  732.6679
 [8]  771.6855  756.8671        NA  702.7343  710.6167  670.1730  724.5441
[15]  705.1930  688.0936  692.1801  697.4026  719.9867  744.6993
> colVars(tmp5)
 [1] 15880.99966   107.47974    47.00521    47.72259    57.31074    65.14624
 [7]   128.53953   164.01361    62.28870          NA    93.06043   124.24392
[13]    75.76891    37.38912    37.89737    54.61979    57.66471   111.05235
[19]    50.42255    58.41326
> colSd(tmp5)
 [1] 126.019838  10.367243   6.856035   6.908154   7.570386   8.071322
 [7]  11.337527  12.806780   7.892319         NA   9.646783  11.146475
[13]   8.704534   6.114665   6.156084   7.390520   7.593728  10.538138
[19]   7.100884   7.642857
> colMax(tmp5)
 [1] 469.94157  82.70810  79.97567  86.39653  84.83727  83.53625  89.44734
 [8]  95.85149  87.69541        NA  82.83736  88.94205  84.99376  80.07656
[15]  78.40185  79.24305  82.17707  87.91752  83.11566  83.40197
> colMin(tmp5)
 [1] 61.66212 55.93814 61.15884 63.25724 60.47332 58.84150 58.08567 58.39372
 [9] 63.20810       NA 58.04137 57.65925 54.93933 61.37356 59.85585 53.79580
[17] 57.99203 57.66051 61.18323 60.63649
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.9416
> Min(tmp5,na.rm=TRUE)
[1] 53.7958
> mean(tmp5,na.rm=TRUE)
[1] 73.35221
> Sum(tmp5,na.rm=TRUE)
[1] 14597.09
> Var(tmp5,na.rm=TRUE)
[1] 872.6986
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.78895 72.93723 70.40453 73.97076 70.53005 71.36800 68.77761 72.34220
 [9] 72.01048 69.32526
> rowSums(tmp5,na.rm=TRUE)
 [1] 1835.779 1458.745 1408.091 1479.415 1410.601 1427.360 1375.552 1446.844
 [9] 1368.199 1386.505
> rowVars(tmp5,na.rm=TRUE)
 [1] 7992.77556   65.14337   77.54643   69.95615  108.53945  105.07134
 [7]   55.29165   74.04580   81.66270   46.66962
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.402324  8.071144  8.806045  8.363980 10.418227 10.250431  7.435836
 [8]  8.604987  9.036742  6.831517
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.94157  84.19279  85.76658  89.44734  92.69463  89.16907  86.39653
 [8]  87.07559  95.85149  82.70810
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.93814 58.23829 58.04137 61.66212 54.93933 53.79580 57.65768 57.50967
 [9] 60.47332 54.85549
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.92344  68.79367  68.25992  70.50285  70.78542  72.07461  73.26679
 [8]  77.16855  75.68671  72.98310  70.27343  71.06167  67.01730  72.45441
[15]  70.51930  68.80936  69.21801  69.74026  71.99867  74.46993
> colSums(tmp5,na.rm=TRUE)
 [1] 1119.2344  687.9367  682.5992  705.0285  707.8542  720.7461  732.6679
 [8]  771.6855  756.8671  656.8479  702.7343  710.6167  670.1730  724.5441
[15]  705.1930  688.0936  692.1801  697.4026  719.9867  744.6993
> colVars(tmp5,na.rm=TRUE)
 [1] 15880.99966   107.47974    47.00521    47.72259    57.31074    65.14624
 [7]   128.53953   164.01361    62.28870    70.02212    93.06043   124.24392
[13]    75.76891    37.38912    37.89737    54.61979    57.66471   111.05235
[19]    50.42255    58.41326
> colSd(tmp5,na.rm=TRUE)
 [1] 126.019838  10.367243   6.856035   6.908154   7.570386   8.071322
 [7]  11.337527  12.806780   7.892319   8.367922   9.646783  11.146475
[13]   8.704534   6.114665   6.156084   7.390520   7.593728  10.538138
[19]   7.100884   7.642857
> colMax(tmp5,na.rm=TRUE)
 [1] 469.94157  82.70810  79.97567  86.39653  84.83727  83.53625  89.44734
 [8]  95.85149  87.69541  84.20521  82.83736  88.94205  84.99376  80.07656
[15]  78.40185  79.24305  82.17707  87.91752  83.11566  83.40197
> colMin(tmp5,na.rm=TRUE)
 [1] 61.66212 55.93814 61.15884 63.25724 60.47332 58.84150 58.08567 58.39372
 [9] 63.20810 54.85549 58.04137 57.65925 54.93933 61.37356 59.85585 53.79580
[17] 57.99203 57.66051 61.18323 60.63649
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.78895 72.93723 70.40453 73.97076 70.53005 71.36800 68.77761 72.34220
 [9]      NaN 69.32526
> rowSums(tmp5,na.rm=TRUE)
 [1] 1835.779 1458.745 1408.091 1479.415 1410.601 1427.360 1375.552 1446.844
 [9]    0.000 1386.505
> rowVars(tmp5,na.rm=TRUE)
 [1] 7992.77556   65.14337   77.54643   69.95615  108.53945  105.07134
 [7]   55.29165   74.04580         NA   46.66962
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.402324  8.071144  8.806045  8.363980 10.418227 10.250431  7.435836
 [8]  8.604987        NA  6.831517
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.94157  84.19279  85.76658  89.44734  92.69463  89.16907  86.39653
 [8]  87.07559        NA  82.70810
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.93814 58.23829 58.04137 61.66212 54.93933 53.79580 57.65768 57.50967
 [9]       NA 54.85549
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.94995  67.87398  68.86152  69.98396  71.93121  71.28986  72.84492
 [8]  75.09266  76.29123       NaN  71.04558  72.19132  66.39469  73.15035
[15]  71.45596  69.10548  69.34398  68.61774  71.90376  73.56561
> colSums(tmp5,na.rm=TRUE)
 [1] 1043.5495  610.8658  619.7536  629.8557  647.3809  641.6088  655.6043
 [8]  675.8340  686.6210    0.0000  639.4102  649.7219  597.5522  658.3531
[15]  643.1036  621.9493  624.0958  617.5597  647.1339  662.0905
> colVars(tmp5,na.rm=TRUE)
 [1] 17683.73128   111.39905    48.80930    50.65890    49.70520    66.36155
 [7]   142.60478   136.03580    65.96353          NA    97.98562   125.41817
[13]    80.87907    36.61409    32.76458    60.46077    64.69430   110.75846
[19]    56.62404    56.51487
> colSd(tmp5,na.rm=TRUE)
 [1] 132.980191  10.554575   6.986366   7.117507   7.050192   8.146260
 [7]  11.941724  11.663438   8.121793         NA   9.898768  11.199025
[13]   8.993279   6.050958   5.724035   7.775652   8.043277  10.524185
[19]   7.524895   7.517637
> colMax(tmp5,na.rm=TRUE)
 [1] 469.94157  82.70810  79.97567  86.39653  84.83727  83.53625  89.44734
 [8]  92.69463  87.69541      -Inf  82.83736  88.94205  84.99376  80.07656
[15]  78.40185  79.24305  82.17707  87.91752  83.11566  83.40197
> colMin(tmp5,na.rm=TRUE)
 [1] 61.66212 55.93814 61.15884 63.25724 63.34424 58.84150 58.08567 58.39372
 [9] 63.20810      Inf 58.04137 57.65925 54.93933 61.37356 59.85585 53.79580
[17] 57.99203 57.66051 61.18323 60.63649
> 
> 
> 
> 
> 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] 194.84970  91.20252 281.47847 141.60754 207.89482 176.14066 317.63454
 [8] 156.66390 347.91455 278.01623
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 194.84970  91.20252 281.47847 141.60754 207.89482 176.14066 317.63454
 [8] 156.66390 347.91455 278.01623
> 
> 
> 
> 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]  4.973799e-14  0.000000e+00 -2.842171e-14 -2.273737e-13 -5.684342e-14
 [6]  5.684342e-14  1.136868e-13 -1.136868e-13 -1.989520e-13  0.000000e+00
[11] -1.136868e-13  4.263256e-14  8.526513e-14 -1.705303e-13 -5.684342e-14
[16]  4.547474e-13  0.000000e+00  1.136868e-13  5.684342e-14  1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
2   9 
10   17 
5   20 
8   7 
3   18 
3   6 
8   15 
8   12 
8   8 
1   2 
10   12 
5   4 
2   19 
3   15 
6   19 
9   4 
8   6 
9   10 
5   14 
7   10 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 1.768839
> Min(tmp)
[1] -2.000354
> mean(tmp)
[1] 0.1663512
> Sum(tmp)
[1] 16.63512
> Var(tmp)
[1] 0.7066136
> 
> rowMeans(tmp)
[1] 0.1663512
> rowSums(tmp)
[1] 16.63512
> rowVars(tmp)
[1] 0.7066136
> rowSd(tmp)
[1] 0.8406031
> rowMax(tmp)
[1] 1.768839
> rowMin(tmp)
[1] -2.000354
> 
> colMeans(tmp)
  [1] -1.072781709 -0.012492691  1.240927920  0.543669933  0.652459148
  [6]  0.788871914 -0.007631054  1.551959978 -0.153657032  1.131329490
 [11]  1.017545517  0.643296200  0.598073191  1.320612404  0.086696929
 [16]  1.511353597 -0.089927516  1.010879474  1.254798786  0.760256814
 [21] -0.204516050  0.065938917  0.697637072 -0.186136119 -1.211232291
 [26] -0.919320908  1.641384858  1.169176020  1.768838649  0.831427452
 [31]  0.294555855  0.850983894  0.889357391 -1.842052209  0.848488617
 [36] -0.758557912 -0.083689640 -0.157842867  0.515654266  0.811792637
 [41]  1.182568577  1.306831873  1.549314710  0.254405319  1.188126659
 [46] -0.149340845 -0.649335823 -2.000354055 -0.658799187  0.326313806
 [51]  0.556466820 -0.045400969  1.480435117  0.083212070 -0.292180679
 [56] -0.343485802 -0.569889495 -0.883588880  0.933419826 -1.102934853
 [61] -0.238357239 -0.274553077  1.196688488  0.684573213  0.291364472
 [66]  0.156463420 -0.530558780 -0.171622905  0.604445018 -1.601798780
 [71]  0.288869124 -0.553040982 -0.661705836 -1.054847006 -0.940261150
 [76] -0.412081520 -0.044702629  0.252727333 -0.556132825  1.153834467
 [81]  0.239767771  0.683243396  0.440906583 -0.726826729  0.066188842
 [86] -0.578013431 -1.076153695 -0.986037919 -0.604406785  1.159634525
 [91]  0.181518261 -0.342770317  1.094762497 -0.111471455 -0.412480958
 [96]  1.028519390  0.455292885  0.369411079 -0.854031292 -0.945152070
> colSums(tmp)
  [1] -1.072781709 -0.012492691  1.240927920  0.543669933  0.652459148
  [6]  0.788871914 -0.007631054  1.551959978 -0.153657032  1.131329490
 [11]  1.017545517  0.643296200  0.598073191  1.320612404  0.086696929
 [16]  1.511353597 -0.089927516  1.010879474  1.254798786  0.760256814
 [21] -0.204516050  0.065938917  0.697637072 -0.186136119 -1.211232291
 [26] -0.919320908  1.641384858  1.169176020  1.768838649  0.831427452
 [31]  0.294555855  0.850983894  0.889357391 -1.842052209  0.848488617
 [36] -0.758557912 -0.083689640 -0.157842867  0.515654266  0.811792637
 [41]  1.182568577  1.306831873  1.549314710  0.254405319  1.188126659
 [46] -0.149340845 -0.649335823 -2.000354055 -0.658799187  0.326313806
 [51]  0.556466820 -0.045400969  1.480435117  0.083212070 -0.292180679
 [56] -0.343485802 -0.569889495 -0.883588880  0.933419826 -1.102934853
 [61] -0.238357239 -0.274553077  1.196688488  0.684573213  0.291364472
 [66]  0.156463420 -0.530558780 -0.171622905  0.604445018 -1.601798780
 [71]  0.288869124 -0.553040982 -0.661705836 -1.054847006 -0.940261150
 [76] -0.412081520 -0.044702629  0.252727333 -0.556132825  1.153834467
 [81]  0.239767771  0.683243396  0.440906583 -0.726826729  0.066188842
 [86] -0.578013431 -1.076153695 -0.986037919 -0.604406785  1.159634525
 [91]  0.181518261 -0.342770317  1.094762497 -0.111471455 -0.412480958
 [96]  1.028519390  0.455292885  0.369411079 -0.854031292 -0.945152070
> 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] -1.072781709 -0.012492691  1.240927920  0.543669933  0.652459148
  [6]  0.788871914 -0.007631054  1.551959978 -0.153657032  1.131329490
 [11]  1.017545517  0.643296200  0.598073191  1.320612404  0.086696929
 [16]  1.511353597 -0.089927516  1.010879474  1.254798786  0.760256814
 [21] -0.204516050  0.065938917  0.697637072 -0.186136119 -1.211232291
 [26] -0.919320908  1.641384858  1.169176020  1.768838649  0.831427452
 [31]  0.294555855  0.850983894  0.889357391 -1.842052209  0.848488617
 [36] -0.758557912 -0.083689640 -0.157842867  0.515654266  0.811792637
 [41]  1.182568577  1.306831873  1.549314710  0.254405319  1.188126659
 [46] -0.149340845 -0.649335823 -2.000354055 -0.658799187  0.326313806
 [51]  0.556466820 -0.045400969  1.480435117  0.083212070 -0.292180679
 [56] -0.343485802 -0.569889495 -0.883588880  0.933419826 -1.102934853
 [61] -0.238357239 -0.274553077  1.196688488  0.684573213  0.291364472
 [66]  0.156463420 -0.530558780 -0.171622905  0.604445018 -1.601798780
 [71]  0.288869124 -0.553040982 -0.661705836 -1.054847006 -0.940261150
 [76] -0.412081520 -0.044702629  0.252727333 -0.556132825  1.153834467
 [81]  0.239767771  0.683243396  0.440906583 -0.726826729  0.066188842
 [86] -0.578013431 -1.076153695 -0.986037919 -0.604406785  1.159634525
 [91]  0.181518261 -0.342770317  1.094762497 -0.111471455 -0.412480958
 [96]  1.028519390  0.455292885  0.369411079 -0.854031292 -0.945152070
> colMin(tmp)
  [1] -1.072781709 -0.012492691  1.240927920  0.543669933  0.652459148
  [6]  0.788871914 -0.007631054  1.551959978 -0.153657032  1.131329490
 [11]  1.017545517  0.643296200  0.598073191  1.320612404  0.086696929
 [16]  1.511353597 -0.089927516  1.010879474  1.254798786  0.760256814
 [21] -0.204516050  0.065938917  0.697637072 -0.186136119 -1.211232291
 [26] -0.919320908  1.641384858  1.169176020  1.768838649  0.831427452
 [31]  0.294555855  0.850983894  0.889357391 -1.842052209  0.848488617
 [36] -0.758557912 -0.083689640 -0.157842867  0.515654266  0.811792637
 [41]  1.182568577  1.306831873  1.549314710  0.254405319  1.188126659
 [46] -0.149340845 -0.649335823 -2.000354055 -0.658799187  0.326313806
 [51]  0.556466820 -0.045400969  1.480435117  0.083212070 -0.292180679
 [56] -0.343485802 -0.569889495 -0.883588880  0.933419826 -1.102934853
 [61] -0.238357239 -0.274553077  1.196688488  0.684573213  0.291364472
 [66]  0.156463420 -0.530558780 -0.171622905  0.604445018 -1.601798780
 [71]  0.288869124 -0.553040982 -0.661705836 -1.054847006 -0.940261150
 [76] -0.412081520 -0.044702629  0.252727333 -0.556132825  1.153834467
 [81]  0.239767771  0.683243396  0.440906583 -0.726826729  0.066188842
 [86] -0.578013431 -1.076153695 -0.986037919 -0.604406785  1.159634525
 [91]  0.181518261 -0.342770317  1.094762497 -0.111471455 -0.412480958
 [96]  1.028519390  0.455292885  0.369411079 -0.854031292 -0.945152070
> colMedians(tmp)
  [1] -1.072781709 -0.012492691  1.240927920  0.543669933  0.652459148
  [6]  0.788871914 -0.007631054  1.551959978 -0.153657032  1.131329490
 [11]  1.017545517  0.643296200  0.598073191  1.320612404  0.086696929
 [16]  1.511353597 -0.089927516  1.010879474  1.254798786  0.760256814
 [21] -0.204516050  0.065938917  0.697637072 -0.186136119 -1.211232291
 [26] -0.919320908  1.641384858  1.169176020  1.768838649  0.831427452
 [31]  0.294555855  0.850983894  0.889357391 -1.842052209  0.848488617
 [36] -0.758557912 -0.083689640 -0.157842867  0.515654266  0.811792637
 [41]  1.182568577  1.306831873  1.549314710  0.254405319  1.188126659
 [46] -0.149340845 -0.649335823 -2.000354055 -0.658799187  0.326313806
 [51]  0.556466820 -0.045400969  1.480435117  0.083212070 -0.292180679
 [56] -0.343485802 -0.569889495 -0.883588880  0.933419826 -1.102934853
 [61] -0.238357239 -0.274553077  1.196688488  0.684573213  0.291364472
 [66]  0.156463420 -0.530558780 -0.171622905  0.604445018 -1.601798780
 [71]  0.288869124 -0.553040982 -0.661705836 -1.054847006 -0.940261150
 [76] -0.412081520 -0.044702629  0.252727333 -0.556132825  1.153834467
 [81]  0.239767771  0.683243396  0.440906583 -0.726826729  0.066188842
 [86] -0.578013431 -1.076153695 -0.986037919 -0.604406785  1.159634525
 [91]  0.181518261 -0.342770317  1.094762497 -0.111471455 -0.412480958
 [96]  1.028519390  0.455292885  0.369411079 -0.854031292 -0.945152070
> colRanges(tmp)
          [,1]        [,2]     [,3]      [,4]      [,5]      [,6]         [,7]
[1,] -1.072782 -0.01249269 1.240928 0.5436699 0.6524591 0.7888719 -0.007631054
[2,] -1.072782 -0.01249269 1.240928 0.5436699 0.6524591 0.7888719 -0.007631054
        [,8]      [,9]    [,10]    [,11]     [,12]     [,13]    [,14]
[1,] 1.55196 -0.153657 1.131329 1.017546 0.6432962 0.5980732 1.320612
[2,] 1.55196 -0.153657 1.131329 1.017546 0.6432962 0.5980732 1.320612
          [,15]    [,16]       [,17]    [,18]    [,19]     [,20]     [,21]
[1,] 0.08669693 1.511354 -0.08992752 1.010879 1.254799 0.7602568 -0.204516
[2,] 0.08669693 1.511354 -0.08992752 1.010879 1.254799 0.7602568 -0.204516
          [,22]     [,23]      [,24]     [,25]      [,26]    [,27]    [,28]
[1,] 0.06593892 0.6976371 -0.1861361 -1.211232 -0.9193209 1.641385 1.169176
[2,] 0.06593892 0.6976371 -0.1861361 -1.211232 -0.9193209 1.641385 1.169176
        [,29]     [,30]     [,31]     [,32]     [,33]     [,34]     [,35]
[1,] 1.768839 0.8314275 0.2945559 0.8509839 0.8893574 -1.842052 0.8484886
[2,] 1.768839 0.8314275 0.2945559 0.8509839 0.8893574 -1.842052 0.8484886
          [,36]       [,37]      [,38]     [,39]     [,40]    [,41]    [,42]
[1,] -0.7585579 -0.08368964 -0.1578429 0.5156543 0.8117926 1.182569 1.306832
[2,] -0.7585579 -0.08368964 -0.1578429 0.5156543 0.8117926 1.182569 1.306832
        [,43]     [,44]    [,45]      [,46]      [,47]     [,48]      [,49]
[1,] 1.549315 0.2544053 1.188127 -0.1493408 -0.6493358 -2.000354 -0.6587992
[2,] 1.549315 0.2544053 1.188127 -0.1493408 -0.6493358 -2.000354 -0.6587992
         [,50]     [,51]       [,52]    [,53]      [,54]      [,55]      [,56]
[1,] 0.3263138 0.5564668 -0.04540097 1.480435 0.08321207 -0.2921807 -0.3434858
[2,] 0.3263138 0.5564668 -0.04540097 1.480435 0.08321207 -0.2921807 -0.3434858
          [,57]      [,58]     [,59]     [,60]      [,61]      [,62]    [,63]
[1,] -0.5698895 -0.8835889 0.9334198 -1.102935 -0.2383572 -0.2745531 1.196688
[2,] -0.5698895 -0.8835889 0.9334198 -1.102935 -0.2383572 -0.2745531 1.196688
         [,64]     [,65]     [,66]      [,67]      [,68]    [,69]     [,70]
[1,] 0.6845732 0.2913645 0.1564634 -0.5305588 -0.1716229 0.604445 -1.601799
[2,] 0.6845732 0.2913645 0.1564634 -0.5305588 -0.1716229 0.604445 -1.601799
         [,71]     [,72]      [,73]     [,74]      [,75]      [,76]       [,77]
[1,] 0.2888691 -0.553041 -0.6617058 -1.054847 -0.9402611 -0.4120815 -0.04470263
[2,] 0.2888691 -0.553041 -0.6617058 -1.054847 -0.9402611 -0.4120815 -0.04470263
         [,78]      [,79]    [,80]     [,81]     [,82]     [,83]      [,84]
[1,] 0.2527273 -0.5561328 1.153834 0.2397678 0.6832434 0.4409066 -0.7268267
[2,] 0.2527273 -0.5561328 1.153834 0.2397678 0.6832434 0.4409066 -0.7268267
          [,85]      [,86]     [,87]      [,88]      [,89]    [,90]     [,91]
[1,] 0.06618884 -0.5780134 -1.076154 -0.9860379 -0.6044068 1.159635 0.1815183
[2,] 0.06618884 -0.5780134 -1.076154 -0.9860379 -0.6044068 1.159635 0.1815183
          [,92]    [,93]      [,94]     [,95]    [,96]     [,97]     [,98]
[1,] -0.3427703 1.094762 -0.1114715 -0.412481 1.028519 0.4552929 0.3694111
[2,] -0.3427703 1.094762 -0.1114715 -0.412481 1.028519 0.4552929 0.3694111
          [,99]     [,100]
[1,] -0.8540313 -0.9451521
[2,] -0.8540313 -0.9451521
> 
> 
> Max(tmp2)
[1] 2.921632
> Min(tmp2)
[1] -2.617534
> mean(tmp2)
[1] -0.1281769
> Sum(tmp2)
[1] -12.81769
> Var(tmp2)
[1] 1.020045
> 
> rowMeans(tmp2)
  [1] -1.201922442 -1.176519842 -0.653025849 -1.083823359 -0.752476067
  [6] -0.585984979 -2.617534165 -1.668359381 -1.271996008  2.921632441
 [11] -0.339167371 -0.431438821 -0.111573452 -1.169170665  0.572894721
 [16] -1.412480412  0.800858897  1.361219398  0.569135084  0.072109090
 [21] -0.838362512 -0.283128357 -0.004515673  0.414154642  0.452522337
 [26] -0.291358769 -0.334203588  0.472457146  0.904194346 -0.204815847
 [31]  1.070837159  0.548391873  1.110655361 -0.967426100  0.316425407
 [36] -0.740947859 -0.012596841  0.217409596  1.118808450 -1.230937823
 [41] -0.273397344 -0.397028143 -0.703515868 -0.616268331  0.709371117
 [46] -1.397695905 -0.373670728 -1.756143417 -0.229315321  0.844639481
 [51]  1.302773802  0.685994990 -1.144985314 -0.177750589 -0.008663391
 [56] -0.613616602 -0.113513702 -2.091206560 -2.147490459 -0.330323871
 [61] -0.219897379 -0.489877607  0.856414135  1.436099620 -0.149043045
 [66] -0.049604893 -0.670259759 -0.515325785  0.628636301  1.334144795
 [71] -0.246958448 -0.360922141  0.822276121 -1.618192992  0.747467843
 [76]  1.812360953 -2.219704803  0.155080543 -1.076838870  1.278021453
 [81] -1.244230025  0.800154384  0.176139315  1.220107219  0.669717566
 [86] -1.006693900  0.371506822  0.887088907 -2.065801277  0.651942590
 [91]  0.552770615  0.824026406  1.737548974 -0.100447288  0.224346221
 [96] -0.476272580 -0.685340446 -1.738141867  0.796247685 -0.574367042
> rowSums(tmp2)
  [1] -1.201922442 -1.176519842 -0.653025849 -1.083823359 -0.752476067
  [6] -0.585984979 -2.617534165 -1.668359381 -1.271996008  2.921632441
 [11] -0.339167371 -0.431438821 -0.111573452 -1.169170665  0.572894721
 [16] -1.412480412  0.800858897  1.361219398  0.569135084  0.072109090
 [21] -0.838362512 -0.283128357 -0.004515673  0.414154642  0.452522337
 [26] -0.291358769 -0.334203588  0.472457146  0.904194346 -0.204815847
 [31]  1.070837159  0.548391873  1.110655361 -0.967426100  0.316425407
 [36] -0.740947859 -0.012596841  0.217409596  1.118808450 -1.230937823
 [41] -0.273397344 -0.397028143 -0.703515868 -0.616268331  0.709371117
 [46] -1.397695905 -0.373670728 -1.756143417 -0.229315321  0.844639481
 [51]  1.302773802  0.685994990 -1.144985314 -0.177750589 -0.008663391
 [56] -0.613616602 -0.113513702 -2.091206560 -2.147490459 -0.330323871
 [61] -0.219897379 -0.489877607  0.856414135  1.436099620 -0.149043045
 [66] -0.049604893 -0.670259759 -0.515325785  0.628636301  1.334144795
 [71] -0.246958448 -0.360922141  0.822276121 -1.618192992  0.747467843
 [76]  1.812360953 -2.219704803  0.155080543 -1.076838870  1.278021453
 [81] -1.244230025  0.800154384  0.176139315  1.220107219  0.669717566
 [86] -1.006693900  0.371506822  0.887088907 -2.065801277  0.651942590
 [91]  0.552770615  0.824026406  1.737548974 -0.100447288  0.224346221
 [96] -0.476272580 -0.685340446 -1.738141867  0.796247685 -0.574367042
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1] -1.201922442 -1.176519842 -0.653025849 -1.083823359 -0.752476067
  [6] -0.585984979 -2.617534165 -1.668359381 -1.271996008  2.921632441
 [11] -0.339167371 -0.431438821 -0.111573452 -1.169170665  0.572894721
 [16] -1.412480412  0.800858897  1.361219398  0.569135084  0.072109090
 [21] -0.838362512 -0.283128357 -0.004515673  0.414154642  0.452522337
 [26] -0.291358769 -0.334203588  0.472457146  0.904194346 -0.204815847
 [31]  1.070837159  0.548391873  1.110655361 -0.967426100  0.316425407
 [36] -0.740947859 -0.012596841  0.217409596  1.118808450 -1.230937823
 [41] -0.273397344 -0.397028143 -0.703515868 -0.616268331  0.709371117
 [46] -1.397695905 -0.373670728 -1.756143417 -0.229315321  0.844639481
 [51]  1.302773802  0.685994990 -1.144985314 -0.177750589 -0.008663391
 [56] -0.613616602 -0.113513702 -2.091206560 -2.147490459 -0.330323871
 [61] -0.219897379 -0.489877607  0.856414135  1.436099620 -0.149043045
 [66] -0.049604893 -0.670259759 -0.515325785  0.628636301  1.334144795
 [71] -0.246958448 -0.360922141  0.822276121 -1.618192992  0.747467843
 [76]  1.812360953 -2.219704803  0.155080543 -1.076838870  1.278021453
 [81] -1.244230025  0.800154384  0.176139315  1.220107219  0.669717566
 [86] -1.006693900  0.371506822  0.887088907 -2.065801277  0.651942590
 [91]  0.552770615  0.824026406  1.737548974 -0.100447288  0.224346221
 [96] -0.476272580 -0.685340446 -1.738141867  0.796247685 -0.574367042
> rowMin(tmp2)
  [1] -1.201922442 -1.176519842 -0.653025849 -1.083823359 -0.752476067
  [6] -0.585984979 -2.617534165 -1.668359381 -1.271996008  2.921632441
 [11] -0.339167371 -0.431438821 -0.111573452 -1.169170665  0.572894721
 [16] -1.412480412  0.800858897  1.361219398  0.569135084  0.072109090
 [21] -0.838362512 -0.283128357 -0.004515673  0.414154642  0.452522337
 [26] -0.291358769 -0.334203588  0.472457146  0.904194346 -0.204815847
 [31]  1.070837159  0.548391873  1.110655361 -0.967426100  0.316425407
 [36] -0.740947859 -0.012596841  0.217409596  1.118808450 -1.230937823
 [41] -0.273397344 -0.397028143 -0.703515868 -0.616268331  0.709371117
 [46] -1.397695905 -0.373670728 -1.756143417 -0.229315321  0.844639481
 [51]  1.302773802  0.685994990 -1.144985314 -0.177750589 -0.008663391
 [56] -0.613616602 -0.113513702 -2.091206560 -2.147490459 -0.330323871
 [61] -0.219897379 -0.489877607  0.856414135  1.436099620 -0.149043045
 [66] -0.049604893 -0.670259759 -0.515325785  0.628636301  1.334144795
 [71] -0.246958448 -0.360922141  0.822276121 -1.618192992  0.747467843
 [76]  1.812360953 -2.219704803  0.155080543 -1.076838870  1.278021453
 [81] -1.244230025  0.800154384  0.176139315  1.220107219  0.669717566
 [86] -1.006693900  0.371506822  0.887088907 -2.065801277  0.651942590
 [91]  0.552770615  0.824026406  1.737548974 -0.100447288  0.224346221
 [96] -0.476272580 -0.685340446 -1.738141867  0.796247685 -0.574367042
> 
> colMeans(tmp2)
[1] -0.1281769
> colSums(tmp2)
[1] -12.81769
> colVars(tmp2)
[1] 1.020045
> colSd(tmp2)
[1] 1.009973
> colMax(tmp2)
[1] 2.921632
> colMin(tmp2)
[1] -2.617534
> colMedians(tmp2)
[1] -0.1912832
> colRanges(tmp2)
          [,1]
[1,] -2.617534
[2,]  2.921632
> 
> 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]  2.89560063  0.40519871  2.81239450  0.07653402  1.43031384 -5.20933726
 [7] -3.82378298 -0.63228024  7.45983548  2.89084795
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1346722
[2,] -0.4279353
[3,]  0.3210154
[4,]  0.9055580
[5,]  2.1139875
> 
> rowApply(tmp,sum)
 [1]  5.3073511 -1.2543208  4.1806639 -5.3751242 -2.1875373 -3.4311708
 [7]  0.5807133  4.5056378  3.4731565  2.5059551
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    4    8    7    5    3    5    4    7    8    10
 [2,]    8    2    9    6    5    6    6    4    3     5
 [3,]    9    4    2    8    9    3   10    9    5     4
 [4,]    7    6    4    2    2   10    7    5    6     3
 [5,]    6    7    3    4    1    1    2   10   10     7
 [6,]    3    1    1    1    7    4    8    2    4     8
 [7,]    2    3    6    9    4    2    1    8    2     2
 [8,]    1    9    5    7    8    9    9    3    1     6
 [9,]   10   10    8    3   10    8    5    6    9     1
[10,]    5    5   10   10    6    7    3    1    7     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.6211577 -2.1671373 -1.1015272 -2.6564139 -0.6378105 -4.4019030
 [7]  3.2195695 -1.6700015 -1.8753703  0.7570075 -2.7306065  3.6621697
[13] -2.0809217  3.6179019  1.1302051  1.0009189  0.1607063 -1.9130359
[19]  2.4148191  3.3788742
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.96307943
[2,] -0.77638225
[3,]  0.08666535
[4,]  1.20588796
[5,]  2.06806603
> 
> rowApply(tmp,sum)
[1]  0.09531662  3.11464059  1.04352422 -6.38914977  1.86427056
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   20   12    8   18
[2,]    5    3    2    7   20
[3,]   10    4    1   13   15
[4,]   13   18    7    2    4
[5,]    8    8   15   11    8
> 
> 
> as.matrix(tmp)
            [,1]       [,2]        [,3]        [,4]        [,5]       [,6]
[1,] -0.96307943 -0.6129234 -0.11274487  0.04289569 -0.31490441 -0.9511293
[2,]  2.06806603 -1.1808071 -0.52045882  0.93138220 -0.02003426  0.8887256
[3,]  0.08666535 -1.0285843 -1.45964654 -0.46045074  0.35026876 -0.8485972
[4,] -0.77638225 -0.9356755  0.01188311 -1.92292595 -0.23338277 -1.7823984
[5,]  1.20588796  1.5908531  0.97943996 -1.24731510 -0.41975784 -1.7085037
          [,7]        [,8]       [,9]      [,10]       [,11]      [,12]
[1,] 0.6749369  1.41015135  0.0408921 -0.3269597 -0.04757602  1.5861483
[2,] 0.6273586  0.03202834  0.3174650 -0.2140668 -1.22520371 -1.7223650
[3,] 0.1431335 -0.26031800 -0.2856104 -0.6717921 -0.87805813  1.6349771
[4,] 0.4552341 -1.93145299 -0.2928319  1.0191478 -1.02976447  0.9833365
[5,] 1.3189063 -0.92041016 -1.6552851  0.9506784  0.44999579  1.1800728
          [,13]      [,14]      [,15]       [,16]       [,17]      [,18]
[1,] -0.2673881  0.8774706  0.5302031 -0.94671302 -0.36054215 -1.7552076
[2,] -0.3379212  0.9719708  0.9024353  0.01617212  0.68176858  0.6083644
[3,]  0.5466150  1.3301383  0.2971936  1.00240999 -0.53984558 -0.2831591
[4,] -1.5166823 -0.3119383 -1.0083642  0.63598315 -0.01971958  0.9986639
[5,] -0.5055450  0.7502604  0.4087373  0.29306668  0.39904502 -1.4816976
           [,19]      [,20]
[1,]  0.22988497  1.3619017
[2,]  0.48693957 -0.1971791
[3,]  2.52731419 -0.1591295
[4,]  0.05895465  1.2091656
[5,] -0.88827425  1.1641155
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  650  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2       col3       col4     col5      col6     col7
row1 0.1168581 1.534165 -0.4436884 -0.8551882 0.761899 0.2561965 1.375703
           col8      col9      col10     col11    col12      col13    col14
row1 -0.7229257 -1.199653 -0.3604445 0.5050631 1.143332 -0.5335073 1.405059
          col15      col16     col17     col18      col19     col20
row1 -0.6243758 -0.5342599 0.1964512 0.1975296 -0.2818713 0.4013881
> tmp[,"col10"]
          col10
row1 -0.3604445
row2  2.5746819
row3  2.0893137
row4  2.1415729
row5  0.6191741
> tmp[c("row1","row5"),]
             col1       col2       col3       col4       col5      col6
row1 0.1168580824 1.53416468 -0.4436884 -0.8551882  0.7618990 0.2561965
row5 0.0006804365 0.01341857  1.0101328  2.9471303 -0.2482989 1.0303909
         col7       col8       col9      col10     col11       col12      col13
row1 1.375703 -0.7229257 -1.1996530 -0.3604445 0.5050631  1.14333179 -0.5335073
row5 1.287305 -0.7019369 -0.8661621  0.6191741 1.4716842 -0.04806531 -0.1005679
          col14      col15      col16     col17      col18      col19
row1  1.4050594 -0.6243758 -0.5342599 0.1964512  0.1975296 -0.2818713
row5 -0.9902784  0.4579765 -1.5154540 0.3235907 -1.6547154 -0.2507029
          col20
row1  0.4013881
row5 -1.2356256
> tmp[,c("col6","col20")]
           col6      col20
row1  0.2561965  0.4013881
row2  0.9648670  1.5605927
row3  0.4217514 -0.3138880
row4 -0.3633685  1.0160449
row5  1.0303909 -1.2356256
> tmp[c("row1","row5"),c("col6","col20")]
          col6      col20
row1 0.2561965  0.4013881
row5 1.0303909 -1.2356256
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
        col1     col2     col3     col4     col5     col6     col7     col8
row1 50.8164 49.95344 50.99862 48.57236 48.25725 104.7881 51.41038 49.37432
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.14472 49.56847 50.11706 50.28898 51.40333 51.62987 49.39677 51.38787
        col17    col18    col19    col20
row1 50.96849 49.92687 50.28055 104.5472
> tmp[,"col10"]
        col10
row1 49.56847
row2 30.14514
row3 30.47333
row4 29.24514
row5 49.15493
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.81640 49.95344 50.99862 48.57236 48.25725 104.7881 51.41038 49.37432
row5 49.28828 50.82742 49.34042 50.92492 49.33397 104.6066 51.29427 49.12701
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.14472 49.56847 50.11706 50.28898 51.40333 51.62987 49.39677 51.38787
row5 50.70462 49.15493 48.77353 49.79443 49.63932 49.23583 48.94464 48.63634
        col17    col18    col19    col20
row1 50.96849 49.92687 50.28055 104.5472
row5 50.27827 49.61001 48.40138 104.4145
> tmp[,c("col6","col20")]
          col6     col20
row1 104.78814 104.54722
row2  76.18339  73.94346
row3  73.36284  75.25167
row4  74.82751  76.01625
row5 104.60663 104.41446
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.7881 104.5472
row5 104.6066 104.4145
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.7881 104.5472
row5 104.6066 104.4145
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.4369035
[2,]  1.4476557
[3,]  0.5279273
[4,] -1.1109313
[5,] -0.5879859
> tmp[,c("col17","col7")]
          col17        col7
[1,] -0.4310329  1.58558529
[2,] -0.3142935  0.45086275
[3,]  0.3325681  0.06576871
[4,] -0.2962726  0.78074905
[5,]  1.5101874 -1.14214687
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  1.5349800  1.6436890
[2,] -1.5077962 -1.4715394
[3,] -0.4548141  0.5191896
[4,] -1.1822483  1.5472271
[5,]  0.3860064 -0.5251790
> subBufferedMatrix(tmp,1,c("col6"))[,1]
        col1
[1,] 1.53498
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  1.534980
[2,] -1.507796
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
         [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
row3 0.625442 -0.9174870 -0.7505062  0.2055999 -1.3129445  0.05313658
row1 1.233681  0.5197006 -0.5550617 -2.1408476  0.9976377 -0.31405108
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
row3  0.7529534 -1.0703478 -0.35978690 -0.5006007 -0.7956781 -1.4997980
row1 -0.4365777  0.3300418 -0.03166908  1.0568507 -1.0252810  0.4070373
        [,13]      [,14]     [,15]      [,16]      [,17]       [,18]      [,19]
row3 1.321630 -0.8106829 -2.554573  0.9250869 -0.6837359  0.69985361 -0.4624659
row1 2.835762 -1.5532583 -0.420711 -0.4040840 -1.5776011 -0.03947103  0.2761008
           [,20]
row3 -1.20826185
row1 -0.01130237
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]       [,2]     [,3]       [,4]      [,5]      [,6]      [,7]
row2 0.540872 -0.4944898 1.841052 -0.7303397 -1.073393 0.4947813 0.3040073
           [,8]      [,9]     [,10]
row2 -0.6315118 0.5247559 -1.514235
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]       [,3]       [,4]       [,5]       [,6]     [,7]
row5 0.3784749 -0.2000407 -0.4929685 -0.2343863 -0.7200941 -0.3640275 0.897577
          [,8]      [,9]       [,10]     [,11]    [,12]     [,13]       [,14]
row5 0.4264377 -1.695445 -0.03844919 -1.083538 2.171363 -1.595188 -0.06391628
         [,15]     [,16]       [,17]      [,18]     [,19]      [,20]
row5 0.6400225 -1.133952 -0.09329098 -0.5545595 0.9490479 -0.9135591
> 
> 
> 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: 0x600002e703c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a24255cd35"
 [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a2f137499" 
 [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a2464bf08a"
 [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a2239d1814"
 [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a21e97db50"
 [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a23bf70e1" 
 [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a2d8bc5b3" 
 [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a2536071b7"
 [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a260c9d024"
[10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a261801d20"
[11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a221f851e2"
[12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a235c7ddda"
[13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a254b62ecb"
[14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a24ba3ce0" 
[15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM69a25ef2988c"
> 
> 
> ### 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: 0x600002e71020>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002e71020>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x600002e71020>
> rowMedians(tmp)
  [1]  0.026538336 -0.146476355  0.646422065 -0.175083172 -0.241485607
  [6] -0.554325295 -0.223334559 -0.009885494  0.065513422 -0.625697374
 [11] -0.232727470  0.126934677  0.570909454  0.148698201  0.183594945
 [16]  0.071569822 -0.111878771 -0.179904905 -0.514052415 -0.112576776
 [21] -0.240681699 -0.003960349  0.280694987 -0.178578781  0.110625352
 [26]  0.023154168  0.247024809  0.181943265  0.091030092  0.067048536
 [31] -0.194835667 -0.277041978 -0.111031117  0.126943857 -0.343221077
 [36]  0.240342813  0.514804696 -0.555152054  0.540439358  0.181393273
 [41] -0.395258436 -0.107715182 -0.030970796  0.087096352  0.156274652
 [46]  0.264255515 -0.191698121  0.596411126  0.031351100 -0.207433142
 [51] -0.384770889  0.617279285 -0.011851503 -0.043883022  0.352639325
 [56]  0.263594121  0.167955717 -0.301264078  0.064513695  0.079235327
 [61] -0.389132768 -0.221850986  0.225195549  0.087740840  0.308073039
 [66] -0.433439586 -0.415046649 -0.347779412 -0.163267318 -0.338680863
 [71]  0.787955130  0.056764925  0.139270679 -0.076294153  0.343723486
 [76]  0.203895614  0.273713429  0.124283902  0.489585361 -0.157255303
 [81] -0.323618145  0.340146114 -0.145842665  0.164926593  0.015114481
 [86]  0.140399749 -0.028716621 -0.018788251 -0.132565215 -0.283979542
 [91] -0.261326182 -0.013920192  0.169123706  0.108363365 -0.352153458
 [96]  0.186041914 -0.066785054 -0.192052535 -0.254531936 -0.232040132
[101] -0.339457511 -0.094188732 -0.125185916  0.405690524  0.450460241
[106]  0.020402363  0.073397506  0.007511148  0.357723988  0.074157736
[111] -0.826116393 -0.498744325  0.391015422  0.121852261 -0.431902563
[116] -0.190815379  0.624272794  0.194143586 -0.182440378 -0.315722055
[121] -0.478033453 -0.427435558  0.443506021  0.045351664 -0.049624893
[126]  0.043721787 -0.405667192  0.118082391  1.126975588 -0.062302232
[131] -0.380265208 -0.266911096 -0.550244607  0.378872704  0.129998729
[136]  0.348131784 -0.119190876  0.407233185  0.239546590  0.021233960
[141] -0.064716415  0.278975384 -0.092739643 -0.228608108 -0.326571071
[146]  0.624995039 -0.422606976  0.132349527  0.137675905  0.034079744
[151]  0.412937316 -0.195275112  0.068146860 -0.253315217 -0.040977549
[156] -0.565514037 -0.844216023  0.221935712  0.041773170 -0.192722724
[161]  0.484454857 -0.356154577 -0.521999850 -0.353594759 -0.340821321
[166]  0.095372418  0.549251784 -0.169791398 -0.422042532  0.067773311
[171]  0.231169564 -0.210774889  0.521913983  0.396094447  0.385328124
[176]  0.320364205 -0.511729955 -0.108444947  0.090766250 -0.051476824
[181]  0.391487189  0.567742190 -0.227590500  0.010691551  0.811496391
[186] -0.389480459 -0.664701117  0.379752451  0.256661276  0.150578427
[191]  0.248540132  0.185025264 -0.077415436  0.332148124 -0.177394385
[196]  0.370979412  0.280672100 -0.520665516 -0.239288538  0.275248254
[201]  0.413771410 -0.019071015 -0.536220254 -0.217413106 -0.139553175
[206] -0.535785910  0.007300946  0.469391464  0.004176833 -0.022530587
[211] -0.101975568 -0.190660432 -0.046476411 -0.252935613  0.370798117
[216] -0.267528862 -0.185818850 -0.198803094  0.187253611  0.181776661
[221]  0.169930359  0.397429852  0.274220290 -0.557175313 -0.217070726
[226] -0.465028365 -0.325208267  0.154963381 -0.075061128  0.554396821
> 
> proc.time()
   user  system elapsed 
  1.748   7.034   8.961 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: 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: 0x6000028908a0>
> .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: 0x6000028908a0>
> .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: 0x6000028908a0>
> .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: 0x6000028908a0>
> 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: 0x60000288c2a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000288c2a0>
> .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: 0x60000288c2a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000288c2a0>
> .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: 0x60000288c2a0>
> 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: 0x60000288c480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000288c480>
> .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: 0x60000288c480>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000288c480>
> .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: 0x60000288c480>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x60000288c480>
> .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: 0x60000288c480>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x60000288c480>
> .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: 0x60000288c480>
> 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: 0x60000288c660>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60000288c660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000288c660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000288c660>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile69e26e96c496" "BufferedMatrixFile69e2bc9d07d" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile69e26e96c496" "BufferedMatrixFile69e2bc9d07d" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000288c900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000288c900>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000288c900>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60000288c900>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60000288c900>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60000288c900>
> .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: 0x600002890c60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002890c60>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002890c60>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002890c60>
> 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: 0x600002890e40>
> .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: 0x600002890e40>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.350   0.107   0.444 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

Example timings