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

This page was generated on 2025-01-21 11:39 -0500 (Tue, 21 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_64R Under development (unstable) (2024-10-21 r87258) -- "Unsuffered Consequences" 4777
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2024-10-26 r87273 ucrt) -- "Unsuffered Consequences" 4502
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" 4467
kjohnson3macOS 13.7.1 Venturaarm64R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" 4422
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch64R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" 4406
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 246/2286HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.71.1  (landing page)
Ben Bolstad
Snapshot Date: 2025-01-20 13:40 -0500 (Mon, 20 Jan 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 824836d
git_last_commit_date: 2024-12-14 17:47:34 -0500 (Sat, 14 Dec 2024)
nebbiolo1Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.1 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.71.1
Command: /home/biocbuild/bbs-3.21-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.21-bioc/R/site-library --timings BufferedMatrix_1.71.1.tar.gz
StartedAt: 2025-01-20 20:23:45 -0500 (Mon, 20 Jan 2025)
EndedAt: 2025-01-20 20:24:10 -0500 (Mon, 20 Jan 2025)
EllapsedTime: 25.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.21-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.21-bioc/R/site-library --timings BufferedMatrix_1.71.1.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2024-10-21 r87258)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
    GNU Fortran (Ubuntu 13.2.0-23ubuntu4) 13.2.0
* running under: Ubuntu 24.04.1 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.71.1’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* 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 loading without being on the library search path ... 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 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 re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.21-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.21-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -I"/home/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG   -I/usr/local/include  -DSTRICT_R_HEADERS=1  -fpic  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG   -I/usr/local/include  -DSTRICT_R_HEADERS=1  -fpic  -g -O2  -Wall -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -I"/home/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG   -I/usr/local/include  -DSTRICT_R_HEADERS=1  -fpic  -g -O2  -Wall -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -I"/home/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG   -I/usr/local/include  -DSTRICT_R_HEADERS=1  -fpic  -g -O2  -Wall -c init_package.c -o init_package.o
gcc -shared -L/home/biocbuild/bbs-3.21-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.21-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.21-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2024-10-21 r87258) -- "Unsuffered Consequences"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.236   0.056   0.279 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2024-10-21 r87258) -- "Unsuffered Consequences"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478210 25.6    1046370 55.9   639888 34.2
Vcells 884339  6.8    8388608 64.0  2080978 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Jan 20 20:24:00 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] "Mon Jan 20 20:24:00 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: 0x576e20b919c0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Jan 20 20:24:00 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] "Mon Jan 20 20:24:01 2025"
> 
> ColMode(tmp2)
<pointer: 0x576e20b919c0>
> 
> 
> 
> ### 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.1238109 0.7449397 -0.3666194 -0.4624012
[2,]   0.3023793 0.2710464  0.5523029  0.1780288
[3,]  -1.2451704 1.5228380 -1.8009533  1.4087322
[4,]   1.0522399 1.4118618 -1.6783820  0.1950529
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 100.1238109 0.7449397 0.3666194 0.4624012
[2,]   0.3023793 0.2710464 0.5523029 0.1780288
[3,]   1.2451704 1.5228380 1.8009533 1.4087322
[4,]   1.0522399 1.4118618 1.6783820 0.1950529
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0061886 0.8630989 0.6054910 0.6800009
[2,]  0.5498903 0.5206211 0.7431708 0.4219346
[3,]  1.1158721 1.2340332 1.3419960 1.1869003
[4,]  1.0257874 1.1882179 1.2955238 0.4416479
> 
> 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:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.18570 34.37593 31.42153 32.26241
[2,]  30.80128 30.47726 32.98401 29.39737
[3,]  37.40389 38.86317 40.22091 38.27773
[4,]  36.31011 38.29404 39.63362 29.61153
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x576e22b20e40>
> exp(tmp5)
<pointer: 0x576e22b20e40>
> log(tmp5,2)
<pointer: 0x576e22b20e40>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.6945
> Min(tmp5)
[1] 55.1179
> mean(tmp5)
[1] 74.06855
> Sum(tmp5)
[1] 14813.71
> Var(tmp5)
[1] 858.5224
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.76251 72.22281 73.21759 69.93505 73.95225 72.14993 70.04858 75.18907
 [9] 68.67127 72.53639
> rowSums(tmp5)
 [1] 1855.250 1444.456 1464.352 1398.701 1479.045 1442.999 1400.972 1503.781
 [9] 1373.425 1450.728
> rowVars(tmp5)
 [1] 7898.73218  107.12247   84.88526   65.13267   74.25714   66.56361
 [7]   55.28160   78.87186   66.59853   48.90025
> rowSd(tmp5)
 [1] 88.874812 10.349998  9.213320  8.070481  8.617258  8.158653  7.435159
 [8]  8.880983  8.160793  6.992872
> rowMax(tmp5)
 [1] 468.69453  92.58083  85.30024  85.21234  87.33477  91.21627  82.73061
 [8]  92.81741  81.69914  87.24253
> rowMin(tmp5)
 [1] 59.47684 55.11790 55.27765 55.11989 58.76348 57.45552 57.11224 56.87671
 [9] 55.15672 60.64187
> 
> colMeans(tmp5)
 [1] 109.92020  74.30353  74.40210  69.30233  72.22605  71.00831  70.97366
 [8]  74.92273  67.48442  70.10366  73.57296  69.76465  74.05839  68.28870
[15]  74.07108  73.63095  72.87358  71.13179  76.96351  72.36831
> colSums(tmp5)
 [1] 1099.2020  743.0353  744.0210  693.0233  722.2605  710.0831  709.7366
 [8]  749.2273  674.8442  701.0366  735.7296  697.6465  740.5839  682.8870
[15]  740.7108  736.3095  728.7358  711.3179  769.6351  723.6831
> colVars(tmp5)
 [1] 15950.20823    46.17671    68.91798    71.69276    77.23276    24.00263
 [7]    98.99889   103.60929    46.91475   103.65449    43.61332   130.68827
[13]    41.65618    69.92723   104.63391   106.10289    57.08522    87.90682
[19]    71.97907    51.15544
> colSd(tmp5)
 [1] 126.294134   6.795345   8.301686   8.467158   8.788217   4.899248
 [7]   9.949819  10.178865   6.849434  10.181085   6.604038  11.431897
[13]   6.454160   8.362250  10.229072  10.300626   7.555476   9.375864
[19]   8.484048   7.152303
> colMax(tmp5)
 [1] 468.69453  81.39409  85.27023  81.69914  85.60537  76.68790  87.24253
 [8]  92.81741  78.32326  85.30024  85.10121  90.51586  85.02740  82.79887
[15]  92.58083  85.21234  87.33477  83.50738  91.21627  83.34273
> colMin(tmp5)
 [1] 57.62254 63.43442 63.22028 57.11224 55.15672 59.52155 55.11790 60.77152
 [9] 57.45552 55.11989 63.06893 55.27765 65.24533 55.52618 61.88555 56.87671
[17] 64.42323 58.76348 60.27944 61.25582
> 
> 
> ### 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] 92.76251       NA 73.21759 69.93505 73.95225 72.14993 70.04858 75.18907
 [9] 68.67127 72.53639
> rowSums(tmp5)
 [1] 1855.250       NA 1464.352 1398.701 1479.045 1442.999 1400.972 1503.781
 [9] 1373.425 1450.728
> rowVars(tmp5)
 [1] 7898.73218  105.62684   84.88526   65.13267   74.25714   66.56361
 [7]   55.28160   78.87186   66.59853   48.90025
> rowSd(tmp5)
 [1] 88.874812 10.277492  9.213320  8.070481  8.617258  8.158653  7.435159
 [8]  8.880983  8.160793  6.992872
> rowMax(tmp5)
 [1] 468.69453        NA  85.30024  85.21234  87.33477  91.21627  82.73061
 [8]  92.81741  81.69914  87.24253
> rowMin(tmp5)
 [1] 59.47684       NA 55.27765 55.11989 58.76348 57.45552 57.11224 56.87671
 [9] 55.15672 60.64187
> 
> colMeans(tmp5)
 [1] 109.92020  74.30353  74.40210  69.30233  72.22605  71.00831  70.97366
 [8]  74.92273  67.48442  70.10366  73.57296  69.76465  74.05839  68.28870
[15]  74.07108  73.63095  72.87358        NA  76.96351  72.36831
> colSums(tmp5)
 [1] 1099.2020  743.0353  744.0210  693.0233  722.2605  710.0831  709.7366
 [8]  749.2273  674.8442  701.0366  735.7296  697.6465  740.5839  682.8870
[15]  740.7108  736.3095  728.7358        NA  769.6351  723.6831
> colVars(tmp5)
 [1] 15950.20823    46.17671    68.91798    71.69276    77.23276    24.00263
 [7]    98.99889   103.60929    46.91475   103.65449    43.61332   130.68827
[13]    41.65618    69.92723   104.63391   106.10289    57.08522          NA
[19]    71.97907    51.15544
> colSd(tmp5)
 [1] 126.294134   6.795345   8.301686   8.467158   8.788217   4.899248
 [7]   9.949819  10.178865   6.849434  10.181085   6.604038  11.431897
[13]   6.454160   8.362250  10.229072  10.300626   7.555476         NA
[19]   8.484048   7.152303
> colMax(tmp5)
 [1] 468.69453  81.39409  85.27023  81.69914  85.60537  76.68790  87.24253
 [8]  92.81741  78.32326  85.30024  85.10121  90.51586  85.02740  82.79887
[15]  92.58083  85.21234  87.33477        NA  91.21627  83.34273
> colMin(tmp5)
 [1] 57.62254 63.43442 63.22028 57.11224 55.15672 59.52155 55.11790 60.77152
 [9] 57.45552 55.11989 63.06893 55.27765 65.24533 55.52618 61.88555 56.87671
[17] 64.42323       NA 60.27944 61.25582
> 
> Max(tmp5,na.rm=TRUE)
[1] 468.6945
> Min(tmp5,na.rm=TRUE)
[1] 55.1179
> mean(tmp5,na.rm=TRUE)
[1] 74.02111
> Sum(tmp5,na.rm=TRUE)
[1] 14730.2
> Var(tmp5,na.rm=TRUE)
[1] 862.4061
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.76251 71.62888 73.21759 69.93505 73.95225 72.14993 70.04858 75.18907
 [9] 68.67127 72.53639
> rowSums(tmp5,na.rm=TRUE)
 [1] 1855.250 1360.949 1464.352 1398.701 1479.045 1442.999 1400.972 1503.781
 [9] 1373.425 1450.728
> rowVars(tmp5,na.rm=TRUE)
 [1] 7898.73218  105.62684   84.88526   65.13267   74.25714   66.56361
 [7]   55.28160   78.87186   66.59853   48.90025
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.874812 10.277492  9.213320  8.070481  8.617258  8.158653  7.435159
 [8]  8.880983  8.160793  6.992872
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.69453  92.58083  85.30024  85.21234  87.33477  91.21627  82.73061
 [8]  92.81741  81.69914  87.24253
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.47684 55.11790 55.27765 55.11989 58.76348 57.45552 57.11224 56.87671
 [9] 55.15672 60.64187
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.92020  74.30353  74.40210  69.30233  72.22605  71.00831  70.97366
 [8]  74.92273  67.48442  70.10366  73.57296  69.76465  74.05839  68.28870
[15]  74.07108  73.63095  72.87358  69.75673  76.96351  72.36831
> colSums(tmp5,na.rm=TRUE)
 [1] 1099.2020  743.0353  744.0210  693.0233  722.2605  710.0831  709.7366
 [8]  749.2273  674.8442  701.0366  735.7296  697.6465  740.5839  682.8870
[15]  740.7108  736.3095  728.7358  627.8105  769.6351  723.6831
> colVars(tmp5,na.rm=TRUE)
 [1] 15950.20823    46.17671    68.91798    71.69276    77.23276    24.00263
 [7]    98.99889   103.60929    46.91475   103.65449    43.61332   130.68827
[13]    41.65618    69.92723   104.63391   106.10289    57.08522    77.62363
[19]    71.97907    51.15544
> colSd(tmp5,na.rm=TRUE)
 [1] 126.294134   6.795345   8.301686   8.467158   8.788217   4.899248
 [7]   9.949819  10.178865   6.849434  10.181085   6.604038  11.431897
[13]   6.454160   8.362250  10.229072  10.300626   7.555476   8.810428
[19]   8.484048   7.152303
> colMax(tmp5,na.rm=TRUE)
 [1] 468.69453  81.39409  85.27023  81.69914  85.60537  76.68790  87.24253
 [8]  92.81741  78.32326  85.30024  85.10121  90.51586  85.02740  82.79887
[15]  92.58083  85.21234  87.33477  82.35558  91.21627  83.34273
> colMin(tmp5,na.rm=TRUE)
 [1] 57.62254 63.43442 63.22028 57.11224 55.15672 59.52155 55.11790 60.77152
 [9] 57.45552 55.11989 63.06893 55.27765 65.24533 55.52618 61.88555 56.87671
[17] 64.42323 58.76348 60.27944 61.25582
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.76251      NaN 73.21759 69.93505 73.95225 72.14993 70.04858 75.18907
 [9] 68.67127 72.53639
> rowSums(tmp5,na.rm=TRUE)
 [1] 1855.250    0.000 1464.352 1398.701 1479.045 1442.999 1400.972 1503.781
 [9] 1373.425 1450.728
> rowVars(tmp5,na.rm=TRUE)
 [1] 7898.73218         NA   84.88526   65.13267   74.25714   66.56361
 [7]   55.28160   78.87186   66.59853   48.90025
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.874812        NA  9.213320  8.070481  8.617258  8.158653  7.435159
 [8]  8.880983  8.160793  6.992872
> rowMax(tmp5,na.rm=TRUE)
 [1] 468.69453        NA  85.30024  85.21234  87.33477  91.21627  82.73061
 [8]  92.81741  81.69914  87.24253
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.47684       NA 55.27765 55.11989 58.76348 57.45552 57.11224 56.87671
 [9] 55.15672 60.64187
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.01035  75.51121  75.04101  70.20406  71.66217  70.93110  72.73541
 [8]  74.80924  67.26476  71.20422  73.03304  67.45896  74.99918  69.13930
[15]  72.01444  72.75469  72.75953       NaN  76.48164  72.70150
> colSums(tmp5,na.rm=TRUE)
 [1] 1035.0931  679.6009  675.3691  631.8365  644.9595  638.3799  654.6187
 [8]  673.2832  605.3828  640.8380  657.2974  607.1307  674.9927  622.2537
[15]  648.1299  654.7923  654.8357    0.0000  688.3348  654.3135
> colVars(tmp5,na.rm=TRUE)
 [1] 17652.50078    35.54079    72.94040    71.50684    83.30984    26.93589
 [7]    76.45638   116.41557    52.23626   102.98491    45.78546    87.21701
[13]    36.90591    70.52855    70.12831   110.72778    64.07455          NA
[19]    78.36421    56.30090
> colSd(tmp5,na.rm=TRUE)
 [1] 132.862714   5.961609   8.540515   8.456172   9.127423   5.189980
 [7]   8.743934  10.789605   7.227466  10.148148   6.766496   9.339005
[13]   6.075023   8.398128   8.374265  10.522727   8.004658         NA
[19]   8.852356   7.503392
> colMax(tmp5,na.rm=TRUE)
 [1] 468.69453  81.39409  85.27023  81.69914  85.60537  76.68790  87.24253
 [8]  92.81741  78.32326  85.30024  85.10121  80.81698  85.02740  82.79887
[15]  86.01829  85.21234  87.33477      -Inf  91.21627  83.34273
> colMin(tmp5,na.rm=TRUE)
 [1] 57.62254 66.03719 63.22028 57.11224 55.15672 59.52155 58.75818 60.77152
 [9] 57.45552 55.11989 63.06893 55.27765 65.24533 55.52618 61.88555 56.87671
[17] 64.42323      Inf 60.27944 61.25582
> 
> 
> 
> 
> 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] 343.8732 205.2078 125.1372 191.8160 150.2533 314.7581 196.6828 163.4423
 [9] 139.8913 178.2918
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 343.8732 205.2078 125.1372 191.8160 150.2533 314.7581 196.6828 163.4423
 [9] 139.8913 178.2918
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.421085e-14  0.000000e+00  1.136868e-13 -5.684342e-14  2.842171e-14
 [6]  0.000000e+00  1.136868e-13  5.684342e-14 -2.842171e-14 -7.105427e-15
[11]  2.842171e-14  1.421085e-13 -2.842171e-14 -2.842171e-14 -8.526513e-14
[16] -5.684342e-14  2.842171e-13 -2.842171e-14 -1.421085e-13  3.410605e-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)
+ }
9   7 
6   2 
2   10 
10   20 
8   11 
5   8 
8   11 
3   14 
4   4 
8   16 
4   3 
3   10 
5   11 
2   14 
10   2 
6   19 
1   8 
3   14 
6   14 
2   20 
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.965989
> Min(tmp)
[1] -2.601982
> mean(tmp)
[1] -0.1223228
> Sum(tmp)
[1] -12.23228
> Var(tmp)
[1] 0.9235908
> 
> rowMeans(tmp)
[1] -0.1223228
> rowSums(tmp)
[1] -12.23228
> rowVars(tmp)
[1] 0.9235908
> rowSd(tmp)
[1] 0.9610363
> rowMax(tmp)
[1] 1.965989
> rowMin(tmp)
[1] -2.601982
> 
> colMeans(tmp)
  [1] -1.48855866 -1.74340754 -0.97413513 -0.85109089 -0.07572477  0.95985355
  [7]  1.73058515 -1.06904540  1.22790973  0.61856210 -0.35240450 -1.40512582
 [13] -0.95296620 -0.22163231 -0.21263079  0.42840776 -0.28098041  0.31321363
 [19] -0.65537599  0.54655428 -0.22142185  0.67333086  0.06072068  0.13698561
 [25] -0.30459991  0.93797818 -0.08463491 -0.09324042 -0.93146932 -0.26704374
 [31] -0.68706660 -0.46476626  0.46169251  1.91590010 -0.46019707  1.02785640
 [37] -0.29225798  0.17664732 -1.27919118 -1.15186001  0.06298135  0.74581667
 [43]  0.42254093 -0.49528370 -0.19594831 -1.61048046  1.75101623 -0.67037355
 [49] -0.72196513 -0.54462700  1.23222668  0.33706234 -0.24161605 -1.59864626
 [55] -0.11248605  1.07536536  0.16364007  1.15245951 -0.56104681  0.45438181
 [61] -1.09637592 -1.14661139  1.96598866  0.33074008  0.99998235 -1.01573137
 [67] -0.46054689  0.46080843 -1.53099691  0.30422370 -0.15782894 -0.27460291
 [73]  1.16230502 -0.43084664  1.43690185  0.11255976 -2.54804918 -0.07527335
 [79]  0.13175439 -1.01047285 -0.18229400 -2.60198167 -1.17540608 -1.15732595
 [85]  1.35410287 -1.31763025 -0.53755616  0.79130686  0.21850753  1.30608914
 [91] -0.68122887  0.21538074  1.11519790  0.09641807  0.03373307 -1.84393236
 [97] -0.36513473 -1.28209758  1.66201276 -0.37875778
> colSums(tmp)
  [1] -1.48855866 -1.74340754 -0.97413513 -0.85109089 -0.07572477  0.95985355
  [7]  1.73058515 -1.06904540  1.22790973  0.61856210 -0.35240450 -1.40512582
 [13] -0.95296620 -0.22163231 -0.21263079  0.42840776 -0.28098041  0.31321363
 [19] -0.65537599  0.54655428 -0.22142185  0.67333086  0.06072068  0.13698561
 [25] -0.30459991  0.93797818 -0.08463491 -0.09324042 -0.93146932 -0.26704374
 [31] -0.68706660 -0.46476626  0.46169251  1.91590010 -0.46019707  1.02785640
 [37] -0.29225798  0.17664732 -1.27919118 -1.15186001  0.06298135  0.74581667
 [43]  0.42254093 -0.49528370 -0.19594831 -1.61048046  1.75101623 -0.67037355
 [49] -0.72196513 -0.54462700  1.23222668  0.33706234 -0.24161605 -1.59864626
 [55] -0.11248605  1.07536536  0.16364007  1.15245951 -0.56104681  0.45438181
 [61] -1.09637592 -1.14661139  1.96598866  0.33074008  0.99998235 -1.01573137
 [67] -0.46054689  0.46080843 -1.53099691  0.30422370 -0.15782894 -0.27460291
 [73]  1.16230502 -0.43084664  1.43690185  0.11255976 -2.54804918 -0.07527335
 [79]  0.13175439 -1.01047285 -0.18229400 -2.60198167 -1.17540608 -1.15732595
 [85]  1.35410287 -1.31763025 -0.53755616  0.79130686  0.21850753  1.30608914
 [91] -0.68122887  0.21538074  1.11519790  0.09641807  0.03373307 -1.84393236
 [97] -0.36513473 -1.28209758  1.66201276 -0.37875778
> 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.48855866 -1.74340754 -0.97413513 -0.85109089 -0.07572477  0.95985355
  [7]  1.73058515 -1.06904540  1.22790973  0.61856210 -0.35240450 -1.40512582
 [13] -0.95296620 -0.22163231 -0.21263079  0.42840776 -0.28098041  0.31321363
 [19] -0.65537599  0.54655428 -0.22142185  0.67333086  0.06072068  0.13698561
 [25] -0.30459991  0.93797818 -0.08463491 -0.09324042 -0.93146932 -0.26704374
 [31] -0.68706660 -0.46476626  0.46169251  1.91590010 -0.46019707  1.02785640
 [37] -0.29225798  0.17664732 -1.27919118 -1.15186001  0.06298135  0.74581667
 [43]  0.42254093 -0.49528370 -0.19594831 -1.61048046  1.75101623 -0.67037355
 [49] -0.72196513 -0.54462700  1.23222668  0.33706234 -0.24161605 -1.59864626
 [55] -0.11248605  1.07536536  0.16364007  1.15245951 -0.56104681  0.45438181
 [61] -1.09637592 -1.14661139  1.96598866  0.33074008  0.99998235 -1.01573137
 [67] -0.46054689  0.46080843 -1.53099691  0.30422370 -0.15782894 -0.27460291
 [73]  1.16230502 -0.43084664  1.43690185  0.11255976 -2.54804918 -0.07527335
 [79]  0.13175439 -1.01047285 -0.18229400 -2.60198167 -1.17540608 -1.15732595
 [85]  1.35410287 -1.31763025 -0.53755616  0.79130686  0.21850753  1.30608914
 [91] -0.68122887  0.21538074  1.11519790  0.09641807  0.03373307 -1.84393236
 [97] -0.36513473 -1.28209758  1.66201276 -0.37875778
> colMin(tmp)
  [1] -1.48855866 -1.74340754 -0.97413513 -0.85109089 -0.07572477  0.95985355
  [7]  1.73058515 -1.06904540  1.22790973  0.61856210 -0.35240450 -1.40512582
 [13] -0.95296620 -0.22163231 -0.21263079  0.42840776 -0.28098041  0.31321363
 [19] -0.65537599  0.54655428 -0.22142185  0.67333086  0.06072068  0.13698561
 [25] -0.30459991  0.93797818 -0.08463491 -0.09324042 -0.93146932 -0.26704374
 [31] -0.68706660 -0.46476626  0.46169251  1.91590010 -0.46019707  1.02785640
 [37] -0.29225798  0.17664732 -1.27919118 -1.15186001  0.06298135  0.74581667
 [43]  0.42254093 -0.49528370 -0.19594831 -1.61048046  1.75101623 -0.67037355
 [49] -0.72196513 -0.54462700  1.23222668  0.33706234 -0.24161605 -1.59864626
 [55] -0.11248605  1.07536536  0.16364007  1.15245951 -0.56104681  0.45438181
 [61] -1.09637592 -1.14661139  1.96598866  0.33074008  0.99998235 -1.01573137
 [67] -0.46054689  0.46080843 -1.53099691  0.30422370 -0.15782894 -0.27460291
 [73]  1.16230502 -0.43084664  1.43690185  0.11255976 -2.54804918 -0.07527335
 [79]  0.13175439 -1.01047285 -0.18229400 -2.60198167 -1.17540608 -1.15732595
 [85]  1.35410287 -1.31763025 -0.53755616  0.79130686  0.21850753  1.30608914
 [91] -0.68122887  0.21538074  1.11519790  0.09641807  0.03373307 -1.84393236
 [97] -0.36513473 -1.28209758  1.66201276 -0.37875778
> colMedians(tmp)
  [1] -1.48855866 -1.74340754 -0.97413513 -0.85109089 -0.07572477  0.95985355
  [7]  1.73058515 -1.06904540  1.22790973  0.61856210 -0.35240450 -1.40512582
 [13] -0.95296620 -0.22163231 -0.21263079  0.42840776 -0.28098041  0.31321363
 [19] -0.65537599  0.54655428 -0.22142185  0.67333086  0.06072068  0.13698561
 [25] -0.30459991  0.93797818 -0.08463491 -0.09324042 -0.93146932 -0.26704374
 [31] -0.68706660 -0.46476626  0.46169251  1.91590010 -0.46019707  1.02785640
 [37] -0.29225798  0.17664732 -1.27919118 -1.15186001  0.06298135  0.74581667
 [43]  0.42254093 -0.49528370 -0.19594831 -1.61048046  1.75101623 -0.67037355
 [49] -0.72196513 -0.54462700  1.23222668  0.33706234 -0.24161605 -1.59864626
 [55] -0.11248605  1.07536536  0.16364007  1.15245951 -0.56104681  0.45438181
 [61] -1.09637592 -1.14661139  1.96598866  0.33074008  0.99998235 -1.01573137
 [67] -0.46054689  0.46080843 -1.53099691  0.30422370 -0.15782894 -0.27460291
 [73]  1.16230502 -0.43084664  1.43690185  0.11255976 -2.54804918 -0.07527335
 [79]  0.13175439 -1.01047285 -0.18229400 -2.60198167 -1.17540608 -1.15732595
 [85]  1.35410287 -1.31763025 -0.53755616  0.79130686  0.21850753  1.30608914
 [91] -0.68122887  0.21538074  1.11519790  0.09641807  0.03373307 -1.84393236
 [97] -0.36513473 -1.28209758  1.66201276 -0.37875778
> colRanges(tmp)
          [,1]      [,2]       [,3]       [,4]        [,5]      [,6]     [,7]
[1,] -1.488559 -1.743408 -0.9741351 -0.8510909 -0.07572477 0.9598536 1.730585
[2,] -1.488559 -1.743408 -0.9741351 -0.8510909 -0.07572477 0.9598536 1.730585
          [,8]    [,9]     [,10]      [,11]     [,12]      [,13]      [,14]
[1,] -1.069045 1.22791 0.6185621 -0.3524045 -1.405126 -0.9529662 -0.2216323
[2,] -1.069045 1.22791 0.6185621 -0.3524045 -1.405126 -0.9529662 -0.2216323
          [,15]     [,16]      [,17]     [,18]     [,19]     [,20]      [,21]
[1,] -0.2126308 0.4284078 -0.2809804 0.3132136 -0.655376 0.5465543 -0.2214219
[2,] -0.2126308 0.4284078 -0.2809804 0.3132136 -0.655376 0.5465543 -0.2214219
         [,22]      [,23]     [,24]      [,25]     [,26]       [,27]
[1,] 0.6733309 0.06072068 0.1369856 -0.3045999 0.9379782 -0.08463491
[2,] 0.6733309 0.06072068 0.1369856 -0.3045999 0.9379782 -0.08463491
           [,28]      [,29]      [,30]      [,31]      [,32]     [,33]  [,34]
[1,] -0.09324042 -0.9314693 -0.2670437 -0.6870666 -0.4647663 0.4616925 1.9159
[2,] -0.09324042 -0.9314693 -0.2670437 -0.6870666 -0.4647663 0.4616925 1.9159
          [,35]    [,36]     [,37]     [,38]     [,39]    [,40]      [,41]
[1,] -0.4601971 1.027856 -0.292258 0.1766473 -1.279191 -1.15186 0.06298135
[2,] -0.4601971 1.027856 -0.292258 0.1766473 -1.279191 -1.15186 0.06298135
         [,42]     [,43]      [,44]      [,45]    [,46]    [,47]      [,48]
[1,] 0.7458167 0.4225409 -0.4952837 -0.1959483 -1.61048 1.751016 -0.6703736
[2,] 0.7458167 0.4225409 -0.4952837 -0.1959483 -1.61048 1.751016 -0.6703736
          [,49]     [,50]    [,51]     [,52]     [,53]     [,54]      [,55]
[1,] -0.7219651 -0.544627 1.232227 0.3370623 -0.241616 -1.598646 -0.1124861
[2,] -0.7219651 -0.544627 1.232227 0.3370623 -0.241616 -1.598646 -0.1124861
        [,56]     [,57]   [,58]      [,59]     [,60]     [,61]     [,62]
[1,] 1.075365 0.1636401 1.15246 -0.5610468 0.4543818 -1.096376 -1.146611
[2,] 1.075365 0.1636401 1.15246 -0.5610468 0.4543818 -1.096376 -1.146611
        [,63]     [,64]     [,65]     [,66]      [,67]     [,68]     [,69]
[1,] 1.965989 0.3307401 0.9999824 -1.015731 -0.4605469 0.4608084 -1.530997
[2,] 1.965989 0.3307401 0.9999824 -1.015731 -0.4605469 0.4608084 -1.530997
         [,70]      [,71]      [,72]    [,73]      [,74]    [,75]     [,76]
[1,] 0.3042237 -0.1578289 -0.2746029 1.162305 -0.4308466 1.436902 0.1125598
[2,] 0.3042237 -0.1578289 -0.2746029 1.162305 -0.4308466 1.436902 0.1125598
         [,77]       [,78]     [,79]     [,80]     [,81]     [,82]     [,83]
[1,] -2.548049 -0.07527335 0.1317544 -1.010473 -0.182294 -2.601982 -1.175406
[2,] -2.548049 -0.07527335 0.1317544 -1.010473 -0.182294 -2.601982 -1.175406
         [,84]    [,85]    [,86]      [,87]     [,88]     [,89]    [,90]
[1,] -1.157326 1.354103 -1.31763 -0.5375562 0.7913069 0.2185075 1.306089
[2,] -1.157326 1.354103 -1.31763 -0.5375562 0.7913069 0.2185075 1.306089
          [,91]     [,92]    [,93]      [,94]      [,95]     [,96]      [,97]
[1,] -0.6812289 0.2153807 1.115198 0.09641807 0.03373307 -1.843932 -0.3651347
[2,] -0.6812289 0.2153807 1.115198 0.09641807 0.03373307 -1.843932 -0.3651347
         [,98]    [,99]     [,100]
[1,] -1.282098 1.662013 -0.3787578
[2,] -1.282098 1.662013 -0.3787578
> 
> 
> Max(tmp2)
[1] 2.260568
> Min(tmp2)
[1] -2.492203
> mean(tmp2)
[1] 0.06492825
> Sum(tmp2)
[1] 6.492825
> Var(tmp2)
[1] 0.9257211
> 
> rowMeans(tmp2)
  [1]  1.8650173759 -0.6718334600  1.2211200142  1.1782043494  0.6587339727
  [6] -0.1983036971  0.6950269463  0.6645530382  1.7302964723 -1.6273781545
 [11]  0.3635603254 -0.8664788368  1.5021773713  0.1280537910 -0.1303705752
 [16] -1.2078803396 -0.1126312320  0.1436827619  1.6768699512  0.8088291668
 [21] -1.4273267685  0.3973654041 -1.3344410406 -0.5242018195 -0.1965277392
 [26]  1.0966407866 -0.4277867918 -0.0211510539  0.8747588645 -0.1944083410
 [31]  0.8031267763  0.0004546179  0.9019171102 -0.5359291061 -0.1089318301
 [36] -1.2856461585  1.0094635633 -0.3479919594 -0.1047075214 -0.1353064231
 [41]  0.5007839341  0.5455712275  1.1787861179 -0.2673352313 -0.4611410291
 [46]  0.4717290281  0.8110773053  1.2801043180  0.5354676530 -0.4150350671
 [51]  0.4467390285 -0.8916779376 -0.0788100716 -0.9413306580 -0.3624751991
 [56] -1.1460240961 -0.1144093427  1.4963634502 -2.4922034097  0.4597094032
 [61]  0.4361793314 -1.7144936468  0.6063100285 -1.5961116676 -0.0644742416
 [66] -1.0046951527  0.4464828591  1.6300017224  1.0559439306 -1.7557719880
 [71]  0.7283915918 -1.2147550314  1.7403054991 -2.3753381702 -0.1642900116
 [76] -0.1017891594 -0.9457977403  0.0164044673  0.4288937089  1.3599618513
 [81]  0.0057440146  1.0137554981  0.1446147534  2.2605676019  0.0432199654
 [86] -0.4006302884 -0.1200965958 -1.0924846058  0.2577974486  0.4963889261
 [91] -0.8427686337  0.7400336230  0.1254137773  0.6815355829  0.0615837644
 [96] -0.4902271203  0.2983574487 -1.6465856807  1.1035130548 -0.4747752047
> rowSums(tmp2)
  [1]  1.8650173759 -0.6718334600  1.2211200142  1.1782043494  0.6587339727
  [6] -0.1983036971  0.6950269463  0.6645530382  1.7302964723 -1.6273781545
 [11]  0.3635603254 -0.8664788368  1.5021773713  0.1280537910 -0.1303705752
 [16] -1.2078803396 -0.1126312320  0.1436827619  1.6768699512  0.8088291668
 [21] -1.4273267685  0.3973654041 -1.3344410406 -0.5242018195 -0.1965277392
 [26]  1.0966407866 -0.4277867918 -0.0211510539  0.8747588645 -0.1944083410
 [31]  0.8031267763  0.0004546179  0.9019171102 -0.5359291061 -0.1089318301
 [36] -1.2856461585  1.0094635633 -0.3479919594 -0.1047075214 -0.1353064231
 [41]  0.5007839341  0.5455712275  1.1787861179 -0.2673352313 -0.4611410291
 [46]  0.4717290281  0.8110773053  1.2801043180  0.5354676530 -0.4150350671
 [51]  0.4467390285 -0.8916779376 -0.0788100716 -0.9413306580 -0.3624751991
 [56] -1.1460240961 -0.1144093427  1.4963634502 -2.4922034097  0.4597094032
 [61]  0.4361793314 -1.7144936468  0.6063100285 -1.5961116676 -0.0644742416
 [66] -1.0046951527  0.4464828591  1.6300017224  1.0559439306 -1.7557719880
 [71]  0.7283915918 -1.2147550314  1.7403054991 -2.3753381702 -0.1642900116
 [76] -0.1017891594 -0.9457977403  0.0164044673  0.4288937089  1.3599618513
 [81]  0.0057440146  1.0137554981  0.1446147534  2.2605676019  0.0432199654
 [86] -0.4006302884 -0.1200965958 -1.0924846058  0.2577974486  0.4963889261
 [91] -0.8427686337  0.7400336230  0.1254137773  0.6815355829  0.0615837644
 [96] -0.4902271203  0.2983574487 -1.6465856807  1.1035130548 -0.4747752047
> 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.8650173759 -0.6718334600  1.2211200142  1.1782043494  0.6587339727
  [6] -0.1983036971  0.6950269463  0.6645530382  1.7302964723 -1.6273781545
 [11]  0.3635603254 -0.8664788368  1.5021773713  0.1280537910 -0.1303705752
 [16] -1.2078803396 -0.1126312320  0.1436827619  1.6768699512  0.8088291668
 [21] -1.4273267685  0.3973654041 -1.3344410406 -0.5242018195 -0.1965277392
 [26]  1.0966407866 -0.4277867918 -0.0211510539  0.8747588645 -0.1944083410
 [31]  0.8031267763  0.0004546179  0.9019171102 -0.5359291061 -0.1089318301
 [36] -1.2856461585  1.0094635633 -0.3479919594 -0.1047075214 -0.1353064231
 [41]  0.5007839341  0.5455712275  1.1787861179 -0.2673352313 -0.4611410291
 [46]  0.4717290281  0.8110773053  1.2801043180  0.5354676530 -0.4150350671
 [51]  0.4467390285 -0.8916779376 -0.0788100716 -0.9413306580 -0.3624751991
 [56] -1.1460240961 -0.1144093427  1.4963634502 -2.4922034097  0.4597094032
 [61]  0.4361793314 -1.7144936468  0.6063100285 -1.5961116676 -0.0644742416
 [66] -1.0046951527  0.4464828591  1.6300017224  1.0559439306 -1.7557719880
 [71]  0.7283915918 -1.2147550314  1.7403054991 -2.3753381702 -0.1642900116
 [76] -0.1017891594 -0.9457977403  0.0164044673  0.4288937089  1.3599618513
 [81]  0.0057440146  1.0137554981  0.1446147534  2.2605676019  0.0432199654
 [86] -0.4006302884 -0.1200965958 -1.0924846058  0.2577974486  0.4963889261
 [91] -0.8427686337  0.7400336230  0.1254137773  0.6815355829  0.0615837644
 [96] -0.4902271203  0.2983574487 -1.6465856807  1.1035130548 -0.4747752047
> rowMin(tmp2)
  [1]  1.8650173759 -0.6718334600  1.2211200142  1.1782043494  0.6587339727
  [6] -0.1983036971  0.6950269463  0.6645530382  1.7302964723 -1.6273781545
 [11]  0.3635603254 -0.8664788368  1.5021773713  0.1280537910 -0.1303705752
 [16] -1.2078803396 -0.1126312320  0.1436827619  1.6768699512  0.8088291668
 [21] -1.4273267685  0.3973654041 -1.3344410406 -0.5242018195 -0.1965277392
 [26]  1.0966407866 -0.4277867918 -0.0211510539  0.8747588645 -0.1944083410
 [31]  0.8031267763  0.0004546179  0.9019171102 -0.5359291061 -0.1089318301
 [36] -1.2856461585  1.0094635633 -0.3479919594 -0.1047075214 -0.1353064231
 [41]  0.5007839341  0.5455712275  1.1787861179 -0.2673352313 -0.4611410291
 [46]  0.4717290281  0.8110773053  1.2801043180  0.5354676530 -0.4150350671
 [51]  0.4467390285 -0.8916779376 -0.0788100716 -0.9413306580 -0.3624751991
 [56] -1.1460240961 -0.1144093427  1.4963634502 -2.4922034097  0.4597094032
 [61]  0.4361793314 -1.7144936468  0.6063100285 -1.5961116676 -0.0644742416
 [66] -1.0046951527  0.4464828591  1.6300017224  1.0559439306 -1.7557719880
 [71]  0.7283915918 -1.2147550314  1.7403054991 -2.3753381702 -0.1642900116
 [76] -0.1017891594 -0.9457977403  0.0164044673  0.4288937089  1.3599618513
 [81]  0.0057440146  1.0137554981  0.1446147534  2.2605676019  0.0432199654
 [86] -0.4006302884 -0.1200965958 -1.0924846058  0.2577974486  0.4963889261
 [91] -0.8427686337  0.7400336230  0.1254137773  0.6815355829  0.0615837644
 [96] -0.4902271203  0.2983574487 -1.6465856807  1.1035130548 -0.4747752047
> 
> colMeans(tmp2)
[1] 0.06492825
> colSums(tmp2)
[1] 6.492825
> colVars(tmp2)
[1] 0.9257211
> colSd(tmp2)
[1] 0.962144
> colMax(tmp2)
[1] 2.260568
> colMin(tmp2)
[1] -2.492203
> colMedians(tmp2)
[1] 0.02981222
> colRanges(tmp2)
          [,1]
[1,] -2.492203
[2,]  2.260568
> 
> 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] -0.8116975  0.1419012 -0.4291599  0.0124734 -1.0472524 -2.2353120
 [7] -1.8704863 -0.1843432 -0.5861046  2.1824358
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.9013996
[2,] -0.8950579
[3,]  0.2849506
[4,]  0.8016856
[5,]  1.5436519
> 
> rowApply(tmp,sum)
 [1]  2.8160038  0.7789491  0.2147260  0.1377071 -2.2477337  0.6275769
 [7] -1.3581895 -1.3802552 -1.0226844 -3.3936456
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    5    6    9   10    2    1    9    1     8
 [2,]    8    2    8    7    5    3    7    5    4     9
 [3,]    9    6    3   10    1    4    4    4    7     4
 [4,]    2    7    5    6    3    5    8    1    5    10
 [5,]    1    4    1    4    8    8    9    6    9     7
 [6,]    3   10    7    1    2    6    6    7    2     6
 [7,]    7    8    2    3    4    9    3    8    3     2
 [8,]    5    3    4    2    6    7   10   10    8     3
 [9,]    6    9   10    8    7    1    2    2    6     5
[10,]    4    1    9    5    9   10    5    3   10     1
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.1676522  0.2906305 -3.0499720 -1.0873795 -1.1775787 -0.4565185
 [7] -0.5341806 -0.6593740  6.0050995  0.5487958  2.7442495 -3.0786715
[13] -1.7286023 -4.4377322 -0.2516079 -3.9618876  3.5843937  3.9375568
[19]  0.8900035 -0.7956709
> colApply(tmp,quantile)[,1]
          [,1]
[1,] 0.3803804
[2,] 0.4180690
[3,] 0.4592163
[4,] 0.8493836
[5,] 2.0606028
> 
> rowApply(tmp,sum)
[1]  7.648575  1.738394 -1.426571 -2.871456 -4.139736
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   19   15   16   11   18
[2,]    4    6   17   17    8
[3,]    6    8   11    5    2
[4,]   11   10    2    7   11
[5,]   13   16    1    8    4
> 
> 
> as.matrix(tmp)
          [,1]       [,2]       [,3]        [,4]       [,5]       [,6]
[1,] 2.0606028 -0.5558641 -0.3685846  0.71325637  0.7998529 -1.6199840
[2,] 0.8493836 -0.3899127 -0.2020887  0.21369280  1.2746323  0.3329475
[3,] 0.4592163  0.5249139  0.2296532 -1.42444561 -1.7114344  0.8599818
[4,] 0.3803804  1.0642897 -1.2675873 -0.49906522 -0.2910919  0.2850290
[5,] 0.4180690 -0.3527963 -1.4413646 -0.09081781 -1.2495377 -0.3144928
            [,7]       [,8]      [,9]      [,10]      [,11]       [,12]
[1,] -0.41881774 -1.5114508 1.2057266  0.8503654  2.1377567  1.18104728
[2,] -0.70557136 -0.1725372 1.3217340  0.7758651  1.5260707 -1.29216875
[3,]  2.33521196 -0.4116666 0.9866430  0.3360100 -1.3618268  0.02024894
[4,] -1.70098901  1.1031489 0.8176656 -0.7167223  0.1168517 -2.46837119
[5,] -0.04401446  0.3331318 1.6733303 -0.6967224  0.3253972 -0.51942774
          [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
[1,] -0.1434279  0.9379243  0.5058968  0.6374405  1.12032019  0.6333229
[2,] -1.9838641 -2.6041544 -0.2850601  0.4351367  1.90604867  1.5680447
[3,]  0.2610968  0.3001761 -0.7618449 -0.6517156 -0.20513380 -0.1075095
[4,]  0.6717734 -3.2853322  1.8511656 -2.9767227  0.74086489  0.8098326
[5,] -0.5341806  0.2136540 -1.5617653 -1.4060266  0.02229374  1.0338660
          [,19]      [,20]
[1,]  0.7617971 -1.2786057
[2,] -1.1406387  0.3108336
[3,]  0.3160717 -1.4202177
[4,]  0.7512389  1.7421853
[5,]  0.2015345 -0.1498664
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1      col2       col3       col4     col5      col6     col7
row1 -0.3541789 0.3102047 -0.4369096 -0.1848577 1.826496 0.2664231 1.089181
          col8      col9  col10      col11    col12     col13    col14
row1 -1.984934 0.4263655 -1.301 -0.2620171 1.118457 -1.480853 1.138914
         col15       col16      col17       col18     col19     col20
row1 0.5971984 -0.01299097 -0.9456853 -0.09970701 -1.397863 0.7726101
> tmp[,"col10"]
          col10
row1 -1.3009999
row2 -0.3715327
row3 -0.5945811
row4 -1.4507938
row5 -0.1889091
> tmp[c("row1","row5"),]
           col1       col2        col3        col4     col5       col6
row1 -0.3541789  0.3102047 -0.43690964 -0.18485769 1.826496  0.2664231
row5  0.6003857 -0.4303789  0.09094107 -0.09631763 1.997117 -2.0649708
          col7      col8      col9      col10      col11    col12     col13
row1  1.089181 -1.984934 0.4263655 -1.3009999 -0.2620171 1.118457 -1.480853
row5 -1.427280 -1.429314 0.8156098 -0.1889091 -1.7352877 0.401667 -0.102412
         col14     col15       col16      col17       col18      col19
row1 1.1389144 0.5971984 -0.01299097 -0.9456853 -0.09970701 -1.3978628
row5 0.8381234 2.5337930 -0.14242789 -0.2095471  0.02405770 -0.1303987
         col20
row1 0.7726101
row5 0.1213598
> tmp[,c("col6","col20")]
           col6       col20
row1  0.2664231  0.77261010
row2 -0.7506052 -0.01810709
row3  1.3157390 -0.85011760
row4  0.2378782  1.10713642
row5 -2.0649708  0.12135985
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  0.2664231 0.7726101
row5 -2.0649708 0.1213598
> 
> 
> 
> 
> 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.10503 48.64503 51.30814 51.59495 47.49809 104.5768 49.11146 48.27
         col9    col10    col11    col12    col13   col14    col15    col16
row1 50.47848 50.68839 49.55624 48.44932 49.68608 49.2015 50.59032 49.83024
        col17    col18    col19    col20
row1 49.68789 50.36627 49.14352 105.8201
> tmp[,"col10"]
        col10
row1 50.68839
row2 30.01026
row3 29.15320
row4 29.77852
row5 50.31049
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.10503 48.64503 51.30814 51.59495 47.49809 104.5768 49.11146 48.27000
row5 49.85952 47.71083 50.13765 48.23559 49.52445 106.6144 49.32432 49.64803
         col9    col10    col11    col12    col13   col14    col15    col16
row1 50.47848 50.68839 49.55624 48.44932 49.68608 49.2015 50.59032 49.83024
row5 50.87291 50.31049 50.68878 51.00540 49.28899 49.5277 48.55692 48.73209
        col17    col18    col19    col20
row1 49.68789 50.36627 49.14352 105.8201
row5 50.63483 49.96708 51.82976 103.2859
> tmp[,c("col6","col20")]
          col6     col20
row1 104.57677 105.82013
row2  75.13045  75.12719
row3  74.30393  77.23533
row4  77.71894  76.60990
row5 106.61436 103.28592
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.5768 105.8201
row5 106.6144 103.2859
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.5768 105.8201
row5 106.6144 103.2859
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.0399740
[2,] -1.1412596
[3,] -0.1907587
[4,] -1.2297951
[5,] -0.4433775
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.1118645 -0.6813123
[2,] -0.4410643  0.3433267
[3,]  0.4297392 -0.3168000
[4,] -2.6484296 -1.1373757
[5,] -0.8583916  1.8715013
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.38384330  0.1290165
[2,]  0.01970382 -0.1528699
[3,] -0.72807710 -0.2188892
[4,]  0.16939440 -0.7413483
[5,] -0.19656312  0.9004028
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.3838433
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.38384330
[2,]  0.01970382
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]       [,3]      [,4]      [,5]       [,6]       [,7]
row3 -0.3433378 -0.6439003 -1.2388644 -0.193104 -1.827918 -1.2442830 -0.5038804
row1 -0.2115552  1.3792029 -0.4582003  0.645531  1.607091  0.9044417 -1.6335497
          [,8]       [,9]      [,10]      [,11]      [,12]      [,13]
row3 -1.138844 -0.2774855 -0.1980851  0.3805171 -0.5794292  1.2509870
row1 -1.011090 -0.2768126  0.6040313 -0.6864926  0.4936337 -0.9351325
          [,14]      [,15]     [,16]       [,17]      [,18]     [,19]
row3  0.2035391  0.4863182 -1.181231  0.23509889 0.78384765 1.3078699
row1 -1.0093024 -0.3139753  1.721627 -0.06750181 0.04213711 0.4592152
          [,20]
row3  0.4489014
row1 -0.2845447
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]       [,3]     [,4]       [,5]      [,6]      [,7]
row2 -0.7516623 0.4061871 -0.7548508 -1.44474 0.05808915 -1.002579 0.2005615
           [,8]       [,9]      [,10]
row2 -0.9917175 -0.1568448 0.08804197
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]       [,4]       [,5]      [,6]    [,7]
row5 0.3419656 -0.1124943 0.5017767 -0.2293334 -0.2746854 0.7540696 2.40211
           [,8]      [,9]      [,10]     [,11]    [,12]      [,13]      [,14]
row5 -0.8492568 -1.130877 -0.1024641 0.2585926 0.607435 -0.8787025 -0.2458879
         [,15]       [,16]      [,17]     [,18]      [,19]     [,20]
row5 -2.198598 -0.00725326 -0.5818959 0.7709009 0.05085004 0.8356463
> 
> 
> 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: 0x576e217cdd60>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de1a9e416" 
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de6620c37b"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de4a3186c" 
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de20a09229"
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de4d9363be"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de48321729"
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de7bde409b"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de5975a425"
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de13a87a51"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de6907625a"
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de2d7ab7db"
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de19003ffb"
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de5f649a1a"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de1f981687"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM3a69de110b2a8d"
> 
> 
> ### 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: 0x576e21e64260>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x576e21e64260>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x576e21e64260>
> rowMedians(tmp)
  [1] -0.113189913  0.375827302 -0.282900091  0.444466184 -0.395740191
  [6]  0.097120068 -0.356870409  0.415050874 -0.022152950 -0.118864422
 [11]  0.113977440 -0.114370220 -0.197986699  0.312535735  0.104835189
 [16] -0.524286088 -0.020778611  0.150193387  0.036954164 -0.066125556
 [21] -0.259843803 -0.427384852 -0.169437269 -0.398477631  0.214468897
 [26]  0.682774367 -0.236249675  0.088488201  0.082972266  0.721869329
 [31] -0.031411438 -0.075101140  0.057290064  0.592983325 -0.141359637
 [36] -0.388833852  0.008790535  0.258353516  0.332678997 -0.009477803
 [41] -0.242282519  0.330653481  0.472955036 -0.369071247  0.148447615
 [46]  0.311392526  0.072236162 -0.057423358  0.342762105 -0.434116081
 [51]  0.079708325 -0.109993373  0.371527712  0.021843981 -0.154849139
 [56] -0.131993466 -0.241249339 -0.491601216  0.409636629  0.269033274
 [61]  0.046767281  0.177060372  0.127658995  0.006961478 -0.451435439
 [66] -0.121732956 -0.151189957  0.273096829  0.400646035 -0.364846063
 [71]  0.217293680 -0.068117400  0.666435179  0.122725576 -0.056478078
 [76]  0.586767546  0.069760639 -0.058497920  0.065699115  0.068381480
 [81]  0.043680204  0.386968586 -0.225148925  0.216399498  0.053962970
 [86] -0.153624396 -0.501718899  0.166461342  0.310040843 -0.107059799
 [91]  0.001627675 -0.259020990 -0.061506808 -0.301748237 -0.234854683
 [96]  0.294549376 -0.280443789  0.303754564  0.291318961  0.129000180
[101] -0.002578635  0.329116601 -0.207823143 -0.048658467 -0.203747696
[106]  0.089218517 -0.179861852  0.104334539  0.039233139 -0.221401645
[111] -0.416876915  0.432761658 -0.518359905  0.155912995 -0.399144471
[116]  0.226570137  0.085970669 -0.224498024  0.277688906  0.100985329
[121] -0.739016067 -0.006227101  0.091066724 -0.511968330  0.557529272
[126]  0.175260919 -0.343906474 -0.200646958 -0.422903030  0.899613044
[131] -0.080101237 -0.334084960 -0.465471006 -0.195318004  0.577165163
[136] -0.864825693 -0.357928532  0.597463732  0.034359899 -0.139362655
[141] -0.396595583  0.012163164  0.476402242  0.042121186  0.355984802
[146] -0.129952556  0.105427248 -0.284425730 -0.030656865  0.141087804
[151]  0.087034630 -0.395789371 -0.097497189 -0.352740673  0.307963883
[156]  0.302785098  0.283737204  0.455520285  0.035291604 -0.143260977
[161]  0.248762344  0.116333343 -0.152873451 -0.466158095 -0.070555683
[166]  0.025469764  0.557507992 -0.081336033  0.376382142  0.181477045
[171]  0.093631363  0.212338052 -0.030599969 -0.387190789  0.254521792
[176]  0.125946899 -0.256550669 -0.253656319  0.196934173 -0.585252269
[181] -0.041660054 -0.210976643  0.049620747  0.317249394  0.352715101
[186] -0.325262399 -0.052183733  0.131945246  0.270088704 -0.077030133
[191]  0.292930783 -0.041475431  0.428005328 -0.462100085 -0.140454569
[196]  0.077963500 -0.142073548  0.424590284  0.099590996  0.093782615
[201]  0.249085246  0.229746992 -0.527516268 -0.382223567  0.210940684
[206] -0.178495352  0.497171057  0.890557579  0.126710025 -0.303448936
[211]  0.079930663  0.037093661  0.609750513  0.391859254  0.141294508
[216] -0.432236534  0.028067500  0.328953741  0.231848725 -0.036763055
[221]  0.120433557  0.073911695 -0.226381254 -0.745641969 -0.114223665
[226] -0.116245738 -0.910120697  0.025750938  0.139159387 -0.060217242
> 
> proc.time()
   user  system elapsed 
  1.398   1.432   2.819 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2024-10-21 r87258) -- "Unsuffered Consequences"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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: 0x5d434d61eb90>
> .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: 0x5d434d61eb90>
> .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: 0x5d434d61eb90>
> .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: 0x5d434d61eb90>
> 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: 0x5d434c4ad820>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d434c4ad820>
> .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: 0x5d434c4ad820>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d434c4ad820>
> .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: 0x5d434c4ad820>
> 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: 0x5d434c5369c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d434c5369c0>
> .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: 0x5d434c5369c0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5d434c5369c0>
> .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: 0x5d434c5369c0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5d434c5369c0>
> .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: 0x5d434c5369c0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5d434c5369c0>
> .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: 0x5d434c5369c0>
> 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: 0x5d434c7d2230>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5d434c7d2230>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d434c7d2230>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d434c7d2230>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3a6c6d180c1bbf" "BufferedMatrixFile3a6c6db0e6322" 
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3a6c6d180c1bbf" "BufferedMatrixFile3a6c6db0e6322" 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d434d004330>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d434d004330>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5d434d004330>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5d434d004330>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5d434d004330>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5d434d004330>
> .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: 0x5d434e5f6c60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d434e5f6c60>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5d434e5f6c60>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5d434e5f6c60>
> 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: 0x5d434e709140>
> .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: 0x5d434e709140>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.251   0.059   0.300 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2024-10-21 r87258) -- "Unsuffered Consequences"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

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.044   0.271 

Example timings