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

This page was generated on 2024-11-20 12:02 -0500 (Wed, 20 Nov 2024).

HostnameOSArch (*)R versionInstalled pkgs
teran2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4481
nebbiolo2Linux (Ubuntu 24.04.1 LTS)x86_644.4.2 (2024-10-31) -- "Pile of Leaves" 4479
palomino8Windows Server 2022 Datacenterx644.4.2 (2024-10-31 ucrt) -- "Pile of Leaves" 4359
lconwaymacOS 12.7.1 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4539
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.4.1 (2024-06-14) -- "Race for Your Life" 4493
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 251/2289HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.70.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-11-19 13:40 -0500 (Tue, 19 Nov 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_20
git_last_commit: 32b6f6a
git_last_commit_date: 2024-10-29 09:27:20 -0500 (Tue, 29 Oct 2024)
teran2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
nebbiolo2Linux (Ubuntu 24.04.1 LTS) / x86_64  OK    OK    OK  
palomino8Windows 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
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on teran2

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

raw results


Summary

Package: BufferedMatrix
Version: 1.70.0
Command: /home/biocbuild/bbs-3.20-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.20-bioc/R/site-library --timings BufferedMatrix_1.70.0.tar.gz
StartedAt: 2024-11-19 23:44:21 -0500 (Tue, 19 Nov 2024)
EndedAt: 2024-11-19 23:44:39 -0500 (Tue, 19 Nov 2024)
EllapsedTime: 18.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.2 (2024-10-31)
* 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.70.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.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
  ‘/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0’
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -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.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -I"/home/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c init_package.c -o init_package.o
gcc -shared -L/home/biocbuild/bbs-3.20-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.20-bioc/R/lib -lR
installing to /media/volume/teran2_disk/biocbuild/bbs-3.20-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 version 4.4.2 (2024-10-31) -- "Pile of Leaves"
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.167   0.052   0.207 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: 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] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 471794 25.2    1026277 54.9   643411 34.4
Vcells 872044  6.7    8388608 64.0  2046755 15.7
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Nov 19 23:44:32 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Nov 19 23:44:32 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x56214bfdb9c0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Tue Nov 19 23:44:32 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Tue Nov 19 23:44:32 2024"
> 
> ColMode(tmp2)
<pointer: 0x56214bfdb9c0>
> 
> 
> 
> ### 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.2459842 -0.3673162 -0.26722308  1.0656978
[2,]  -0.3524030  0.7764393 -0.09256013  0.5514738
[3,]   0.2973729  0.8840347 -1.58242918 -0.9698104
[4,]  -1.2907039 -0.1141884 -1.96651026 -0.4333827
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.4  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]       [,3]      [,4]
[1,] 100.2459842 0.3673162 0.26722308 1.0656978
[2,]   0.3524030 0.7764393 0.09256013 0.5514738
[3,]   0.2973729 0.8840347 1.58242918 0.9698104
[4,]   1.2907039 0.1141884 1.96651026 0.4333827
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.4  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0122917 0.6060662 0.5169362 1.0323264
[2,]  0.5936354 0.8811579 0.3042370 0.7426128
[3,]  0.5453190 0.9402312 1.2579464 0.9847895
[4,]  1.1360915 0.3379178 1.4023232 0.6583181
> 
> 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:    /media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.4  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 225.36890 31.42798 30.43659 36.38896
[2,]  31.28876 34.58802 28.13493 32.97760
[3,]  30.75056 35.28635 39.16189 35.81771
[4,]  37.65162 28.49337 40.98974 32.01656
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x56214c94fc40>
> exp(tmp5)
<pointer: 0x56214c94fc40>
> log(tmp5,2)
<pointer: 0x56214c94fc40>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.0758
> Min(tmp5)
[1] 53.99836
> mean(tmp5)
[1] 72.95219
> Sum(tmp5)
[1] 14590.44
> Var(tmp5)
[1] 864.9089
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 92.90853 69.55095 71.91241 70.39102 67.61695 71.14090 70.92621 71.06236
 [9] 75.58906 68.42352
> rowSums(tmp5)
 [1] 1858.171 1391.019 1438.248 1407.820 1352.339 1422.818 1418.524 1421.247
 [9] 1511.781 1368.470
> rowVars(tmp5)
 [1] 7906.82753   67.37782   76.82311   82.80564   53.34681   79.63625
 [7]   55.01366   84.47258   75.00337   67.63582
> rowSd(tmp5)
 [1] 88.920344  8.208400  8.764879  9.099761  7.303890  8.923914  7.417119
 [8]  9.190897  8.660448  8.224100
> rowMax(tmp5)
 [1] 469.07584  86.24741  99.16061  89.10566  79.93588  88.17867  86.71181
 [8]  89.59413  94.09979  85.09453
> rowMin(tmp5)
 [1] 58.03133 56.13374 59.84952 57.16271 56.33836 53.99836 54.41597 60.14079
 [9] 58.97140 56.06006
> 
> colMeans(tmp5)
 [1] 111.72306  72.67982  72.89520  71.42505  71.73078  68.98125  68.29677
 [8]  70.17748  71.75900  69.56312  76.02538  71.79239  71.30964  68.73336
[15]  71.38793  76.81034  68.14909  66.64357  67.31662  71.64398
> colSums(tmp5)
 [1] 1117.2306  726.7982  728.9520  714.2505  717.3078  689.8125  682.9677
 [8]  701.7748  717.5900  695.6312  760.2538  717.9239  713.0964  687.3336
[15]  713.8793  768.1034  681.4909  666.4357  673.1662  716.4398
> colVars(tmp5)
 [1] 15825.11789    71.23792    71.66364    41.07160    65.09886    45.05872
 [7]    73.21741   117.98905    56.33412    47.19654   133.43586    98.16547
[13]    50.74346    27.36108    54.03589    83.77709   127.74708    73.17978
[19]    64.97388    96.59263
> colSd(tmp5)
 [1] 125.797925   8.440256   8.465438   6.408713   8.068386   6.712579
 [7]   8.556717  10.862277   7.505606   6.869974  11.551444   9.907849
[13]   7.123444   5.230782   7.350911   9.152982  11.302525   8.554518
[19]   8.060638   9.828155
> colMax(tmp5)
 [1] 469.07584  88.77807  85.31478  83.91713  87.23283  77.76278  84.16022
 [8]  89.59413  87.02143  79.96402  99.16061  88.17867  85.09453  77.46529
[15]  84.19086  94.09979  86.24741  80.28025  81.58027  89.10566
> colMin(tmp5)
 [1] 64.00327 59.30521 58.55917 65.44432 60.28983 59.40040 56.33836 56.71030
 [9] 63.73420 57.16271 62.19158 59.37617 62.13939 61.17403 58.62997 63.54492
[17] 53.99836 56.13374 56.06006 58.63405
> 
> 
> ### 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.90853 69.55095 71.91241 70.39102 67.61695       NA 70.92621 71.06236
 [9] 75.58906 68.42352
> rowSums(tmp5)
 [1] 1858.171 1391.019 1438.248 1407.820 1352.339       NA 1418.524 1421.247
 [9] 1511.781 1368.470
> rowVars(tmp5)
 [1] 7906.82753   67.37782   76.82311   82.80564   53.34681   73.05466
 [7]   55.01366   84.47258   75.00337   67.63582
> rowSd(tmp5)
 [1] 88.920344  8.208400  8.764879  9.099761  7.303890  8.547202  7.417119
 [8]  9.190897  8.660448  8.224100
> rowMax(tmp5)
 [1] 469.07584  86.24741  99.16061  89.10566  79.93588        NA  86.71181
 [8]  89.59413  94.09979  85.09453
> rowMin(tmp5)
 [1] 58.03133 56.13374 59.84952 57.16271 56.33836       NA 54.41597 60.14079
 [9] 58.97140 56.06006
> 
> colMeans(tmp5)
 [1] 111.72306  72.67982  72.89520  71.42505  71.73078  68.98125  68.29677
 [8]  70.17748  71.75900  69.56312  76.02538  71.79239  71.30964  68.73336
[15]  71.38793        NA  68.14909  66.64357  67.31662  71.64398
> colSums(tmp5)
 [1] 1117.2306  726.7982  728.9520  714.2505  717.3078  689.8125  682.9677
 [8]  701.7748  717.5900  695.6312  760.2538  717.9239  713.0964  687.3336
[15]  713.8793        NA  681.4909  666.4357  673.1662  716.4398
> colVars(tmp5)
 [1] 15825.11789    71.23792    71.66364    41.07160    65.09886    45.05872
 [7]    73.21741   117.98905    56.33412    47.19654   133.43586    98.16547
[13]    50.74346    27.36108    54.03589          NA   127.74708    73.17978
[19]    64.97388    96.59263
> colSd(tmp5)
 [1] 125.797925   8.440256   8.465438   6.408713   8.068386   6.712579
 [7]   8.556717  10.862277   7.505606   6.869974  11.551444   9.907849
[13]   7.123444   5.230782   7.350911         NA  11.302525   8.554518
[19]   8.060638   9.828155
> colMax(tmp5)
 [1] 469.07584  88.77807  85.31478  83.91713  87.23283  77.76278  84.16022
 [8]  89.59413  87.02143  79.96402  99.16061  88.17867  85.09453  77.46529
[15]  84.19086        NA  86.24741  80.28025  81.58027  89.10566
> colMin(tmp5)
 [1] 64.00327 59.30521 58.55917 65.44432 60.28983 59.40040 56.33836 56.71030
 [9] 63.73420 57.16271 62.19158 59.37617 62.13939 61.17403 58.62997       NA
[17] 53.99836 56.13374 56.06006 58.63405
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.0758
> Min(tmp5,na.rm=TRUE)
[1] 53.99836
> mean(tmp5,na.rm=TRUE)
[1] 72.89236
> Sum(tmp5,na.rm=TRUE)
[1] 14505.58
> Var(tmp5,na.rm=TRUE)
[1] 868.5575
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.90853 69.55095 71.91241 70.39102 67.61695 70.41887 70.92621 71.06236
 [9] 75.58906 68.42352
> rowSums(tmp5,na.rm=TRUE)
 [1] 1858.171 1391.019 1438.248 1407.820 1352.339 1337.958 1418.524 1421.247
 [9] 1511.781 1368.470
> rowVars(tmp5,na.rm=TRUE)
 [1] 7906.82753   67.37782   76.82311   82.80564   53.34681   73.05466
 [7]   55.01366   84.47258   75.00337   67.63582
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.920344  8.208400  8.764879  9.099761  7.303890  8.547202  7.417119
 [8]  9.190897  8.660448  8.224100
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.07584  86.24741  99.16061  89.10566  79.93588  88.17867  86.71181
 [8]  89.59413  94.09979  85.09453
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.03133 56.13374 59.84952 57.16271 56.33836 53.99836 54.41597 60.14079
 [9] 58.97140 56.06006
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.72306  72.67982  72.89520  71.42505  71.73078  68.98125  68.29677
 [8]  70.17748  71.75900  69.56312  76.02538  71.79239  71.30964  68.73336
[15]  71.38793  75.91599  68.14909  66.64357  67.31662  71.64398
> colSums(tmp5,na.rm=TRUE)
 [1] 1117.2306  726.7982  728.9520  714.2505  717.3078  689.8125  682.9677
 [8]  701.7748  717.5900  695.6312  760.2538  717.9239  713.0964  687.3336
[15]  713.8793  683.2439  681.4909  666.4357  673.1662  716.4398
> colVars(tmp5,na.rm=TRUE)
 [1] 15825.11789    71.23792    71.66364    41.07160    65.09886    45.05872
 [7]    73.21741   117.98905    56.33412    47.19654   133.43586    98.16547
[13]    50.74346    27.36108    54.03589    85.25079   127.74708    73.17978
[19]    64.97388    96.59263
> colSd(tmp5,na.rm=TRUE)
 [1] 125.797925   8.440256   8.465438   6.408713   8.068386   6.712579
 [7]   8.556717  10.862277   7.505606   6.869974  11.551444   9.907849
[13]   7.123444   5.230782   7.350911   9.233135  11.302525   8.554518
[19]   8.060638   9.828155
> colMax(tmp5,na.rm=TRUE)
 [1] 469.07584  88.77807  85.31478  83.91713  87.23283  77.76278  84.16022
 [8]  89.59413  87.02143  79.96402  99.16061  88.17867  85.09453  77.46529
[15]  84.19086  94.09979  86.24741  80.28025  81.58027  89.10566
> colMin(tmp5,na.rm=TRUE)
 [1] 64.00327 59.30521 58.55917 65.44432 60.28983 59.40040 56.33836 56.71030
 [9] 63.73420 57.16271 62.19158 59.37617 62.13939 61.17403 58.62997 63.54492
[17] 53.99836 56.13374 56.06006 58.63405
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 92.90853 69.55095 71.91241 70.39102 67.61695      NaN 70.92621 71.06236
 [9] 75.58906 68.42352
> rowSums(tmp5,na.rm=TRUE)
 [1] 1858.171 1391.019 1438.248 1407.820 1352.339    0.000 1418.524 1421.247
 [9] 1511.781 1368.470
> rowVars(tmp5,na.rm=TRUE)
 [1] 7906.82753   67.37782   76.82311   82.80564   53.34681         NA
 [7]   55.01366   84.47258   75.00337   67.63582
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.920344  8.208400  8.764879  9.099761  7.303890        NA  7.417119
 [8]  9.190897  8.660448  8.224100
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.07584  86.24741  99.16061  89.10566  79.93588        NA  86.71181
 [8]  89.59413  94.09979  85.09453
> rowMin(tmp5,na.rm=TRUE)
 [1] 58.03133 56.13374 59.84952 57.16271 56.33836       NA 54.41597 60.14079
 [9] 58.97140 56.06006
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.07807  71.70836  73.16238  72.08957  71.85340  68.05461  68.70837
 [8]  71.18806  71.09958  69.92199  76.31387  69.97169  71.15715  68.44638
[15]  71.55048       NaN  69.72139  67.71403  67.06051  72.35305
> colSums(tmp5,na.rm=TRUE)
 [1] 1035.7026  645.3752  658.4614  648.8061  646.6806  612.4915  618.3753
 [8]  640.6926  639.8962  629.2979  686.8249  629.7452  640.4144  616.0174
[15]  643.9543    0.0000  627.4925  609.4262  603.5446  651.1774
> colVars(tmp5,na.rm=TRUE)
 [1] 17676.62666    69.52568    79.81851    41.23763    73.06707    41.03103
 [7]    80.46373   121.24841    58.48401    51.64721   149.17903    73.14305
[13]    56.82479    29.85468    60.49310          NA   115.90392    69.43625
[19]    72.35769   103.01050
> colSd(tmp5,na.rm=TRUE)
 [1] 132.953476   8.338206   8.934121   6.421653   8.547928   6.405547
 [7]   8.970158  11.011285   7.647484   7.186599  12.213887   8.552371
[13]   7.538222   5.463943   7.777731         NA  10.765868   8.332842
[19]   8.506332  10.149409
> colMax(tmp5,na.rm=TRUE)
 [1] 469.07584  88.77807  85.31478  83.91713  87.23283  77.76278  84.16022
 [8]  89.59413  87.02143  79.96402  99.16061  82.79015  85.09453  77.46529
[15]  84.19086      -Inf  86.24741  80.28025  81.58027  89.10566
> colMin(tmp5,na.rm=TRUE)
 [1] 64.00327 59.30521 58.55917 66.09683 60.28983 59.40040 56.33836 56.71030
 [9] 63.73420 57.16271 62.19158 59.37617 62.13939 61.17403 58.62997      Inf
[17] 54.41597 56.13374 56.06006 58.63405
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 152.4947 142.5703 280.7803 144.4988 323.7384 177.2953 260.4538 275.7240
 [9] 379.0861 243.5124
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 152.4947 142.5703 280.7803 144.4988 323.7384 177.2953 260.4538 275.7240
 [9] 379.0861 243.5124
> 
> 
> 
> 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] -8.526513e-14  3.126388e-13  2.842171e-13 -2.842171e-13  1.136868e-13
 [6]  1.421085e-13  2.273737e-13 -1.136868e-13  5.684342e-14  0.000000e+00
[11] -1.421085e-14 -2.842171e-14  5.684342e-14 -5.684342e-14 -1.989520e-13
[16]  0.000000e+00  1.136868e-13  0.000000e+00 -5.684342e-14  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   14 
9   13 
7   19 
9   16 
10   6 
6   1 
3   2 
10   12 
7   15 
3   15 
7   7 
8   16 
7   5 
7   15 
4   20 
8   12 
10   12 
10   20 
1   7 
1   6 
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.914911
> Min(tmp)
[1] -2.220296
> mean(tmp)
[1] -0.2189673
> Sum(tmp)
[1] -21.89673
> Var(tmp)
[1] 0.9227484
> 
> rowMeans(tmp)
[1] -0.2189673
> rowSums(tmp)
[1] -21.89673
> rowVars(tmp)
[1] 0.9227484
> rowSd(tmp)
[1] 0.9605979
> rowMax(tmp)
[1] 1.914911
> rowMin(tmp)
[1] -2.220296
> 
> colMeans(tmp)
  [1] -1.08959606  0.64255579  0.46071892  0.33019068 -1.48103262  0.39750257
  [7]  1.48882315 -0.69496351 -0.31113423 -0.80671604 -0.52246741  1.06242887
 [13]  1.46103426  0.47089901 -0.68664576  0.74304704  0.10486435 -0.82703931
 [19]  0.39478840 -0.55099481 -0.53124562  0.37189600  0.63124295 -0.33317541
 [25] -2.13848207 -0.99235709  0.67415459  1.73471909  0.22701731 -0.20583774
 [31] -0.12791228 -0.49165054  0.50637128  1.15510364 -0.38261247 -1.51637490
 [37]  0.43117447 -1.10539146  1.06654596 -2.16401384 -2.22029575 -0.35155016
 [43] -1.31133337  0.69555330  0.60027101 -0.27054988  0.71601795  1.06221949
 [49]  1.19227665  0.23354485 -0.56956048  0.33198350 -0.64295290  1.91491136
 [55]  0.52770269  1.47194203 -0.51340345 -1.76977108 -0.61250278 -0.82031363
 [61]  0.19884596 -1.23182116 -0.83372906 -1.65795752 -0.59279897 -1.01218183
 [67] -0.20379430 -0.67515501 -0.99797351  0.67537624  0.81508596 -1.64484310
 [73] -0.08322436  0.52537075  0.30614579 -0.46599868  0.88354414 -1.26999983
 [79] -0.53270005 -1.48916981  1.38271328 -1.44428795 -0.70150786  0.90628633
 [85] -0.19624296 -0.70261677  0.28456469  0.51898197 -0.45437851 -0.34461323
 [91] -0.97647670 -0.07271440 -1.22499649 -1.65659459 -1.86883485 -0.37802960
 [97] -1.24970991 -2.07397348  0.55140676  0.03164937
> colSums(tmp)
  [1] -1.08959606  0.64255579  0.46071892  0.33019068 -1.48103262  0.39750257
  [7]  1.48882315 -0.69496351 -0.31113423 -0.80671604 -0.52246741  1.06242887
 [13]  1.46103426  0.47089901 -0.68664576  0.74304704  0.10486435 -0.82703931
 [19]  0.39478840 -0.55099481 -0.53124562  0.37189600  0.63124295 -0.33317541
 [25] -2.13848207 -0.99235709  0.67415459  1.73471909  0.22701731 -0.20583774
 [31] -0.12791228 -0.49165054  0.50637128  1.15510364 -0.38261247 -1.51637490
 [37]  0.43117447 -1.10539146  1.06654596 -2.16401384 -2.22029575 -0.35155016
 [43] -1.31133337  0.69555330  0.60027101 -0.27054988  0.71601795  1.06221949
 [49]  1.19227665  0.23354485 -0.56956048  0.33198350 -0.64295290  1.91491136
 [55]  0.52770269  1.47194203 -0.51340345 -1.76977108 -0.61250278 -0.82031363
 [61]  0.19884596 -1.23182116 -0.83372906 -1.65795752 -0.59279897 -1.01218183
 [67] -0.20379430 -0.67515501 -0.99797351  0.67537624  0.81508596 -1.64484310
 [73] -0.08322436  0.52537075  0.30614579 -0.46599868  0.88354414 -1.26999983
 [79] -0.53270005 -1.48916981  1.38271328 -1.44428795 -0.70150786  0.90628633
 [85] -0.19624296 -0.70261677  0.28456469  0.51898197 -0.45437851 -0.34461323
 [91] -0.97647670 -0.07271440 -1.22499649 -1.65659459 -1.86883485 -0.37802960
 [97] -1.24970991 -2.07397348  0.55140676  0.03164937
> 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.08959606  0.64255579  0.46071892  0.33019068 -1.48103262  0.39750257
  [7]  1.48882315 -0.69496351 -0.31113423 -0.80671604 -0.52246741  1.06242887
 [13]  1.46103426  0.47089901 -0.68664576  0.74304704  0.10486435 -0.82703931
 [19]  0.39478840 -0.55099481 -0.53124562  0.37189600  0.63124295 -0.33317541
 [25] -2.13848207 -0.99235709  0.67415459  1.73471909  0.22701731 -0.20583774
 [31] -0.12791228 -0.49165054  0.50637128  1.15510364 -0.38261247 -1.51637490
 [37]  0.43117447 -1.10539146  1.06654596 -2.16401384 -2.22029575 -0.35155016
 [43] -1.31133337  0.69555330  0.60027101 -0.27054988  0.71601795  1.06221949
 [49]  1.19227665  0.23354485 -0.56956048  0.33198350 -0.64295290  1.91491136
 [55]  0.52770269  1.47194203 -0.51340345 -1.76977108 -0.61250278 -0.82031363
 [61]  0.19884596 -1.23182116 -0.83372906 -1.65795752 -0.59279897 -1.01218183
 [67] -0.20379430 -0.67515501 -0.99797351  0.67537624  0.81508596 -1.64484310
 [73] -0.08322436  0.52537075  0.30614579 -0.46599868  0.88354414 -1.26999983
 [79] -0.53270005 -1.48916981  1.38271328 -1.44428795 -0.70150786  0.90628633
 [85] -0.19624296 -0.70261677  0.28456469  0.51898197 -0.45437851 -0.34461323
 [91] -0.97647670 -0.07271440 -1.22499649 -1.65659459 -1.86883485 -0.37802960
 [97] -1.24970991 -2.07397348  0.55140676  0.03164937
> colMin(tmp)
  [1] -1.08959606  0.64255579  0.46071892  0.33019068 -1.48103262  0.39750257
  [7]  1.48882315 -0.69496351 -0.31113423 -0.80671604 -0.52246741  1.06242887
 [13]  1.46103426  0.47089901 -0.68664576  0.74304704  0.10486435 -0.82703931
 [19]  0.39478840 -0.55099481 -0.53124562  0.37189600  0.63124295 -0.33317541
 [25] -2.13848207 -0.99235709  0.67415459  1.73471909  0.22701731 -0.20583774
 [31] -0.12791228 -0.49165054  0.50637128  1.15510364 -0.38261247 -1.51637490
 [37]  0.43117447 -1.10539146  1.06654596 -2.16401384 -2.22029575 -0.35155016
 [43] -1.31133337  0.69555330  0.60027101 -0.27054988  0.71601795  1.06221949
 [49]  1.19227665  0.23354485 -0.56956048  0.33198350 -0.64295290  1.91491136
 [55]  0.52770269  1.47194203 -0.51340345 -1.76977108 -0.61250278 -0.82031363
 [61]  0.19884596 -1.23182116 -0.83372906 -1.65795752 -0.59279897 -1.01218183
 [67] -0.20379430 -0.67515501 -0.99797351  0.67537624  0.81508596 -1.64484310
 [73] -0.08322436  0.52537075  0.30614579 -0.46599868  0.88354414 -1.26999983
 [79] -0.53270005 -1.48916981  1.38271328 -1.44428795 -0.70150786  0.90628633
 [85] -0.19624296 -0.70261677  0.28456469  0.51898197 -0.45437851 -0.34461323
 [91] -0.97647670 -0.07271440 -1.22499649 -1.65659459 -1.86883485 -0.37802960
 [97] -1.24970991 -2.07397348  0.55140676  0.03164937
> colMedians(tmp)
  [1] -1.08959606  0.64255579  0.46071892  0.33019068 -1.48103262  0.39750257
  [7]  1.48882315 -0.69496351 -0.31113423 -0.80671604 -0.52246741  1.06242887
 [13]  1.46103426  0.47089901 -0.68664576  0.74304704  0.10486435 -0.82703931
 [19]  0.39478840 -0.55099481 -0.53124562  0.37189600  0.63124295 -0.33317541
 [25] -2.13848207 -0.99235709  0.67415459  1.73471909  0.22701731 -0.20583774
 [31] -0.12791228 -0.49165054  0.50637128  1.15510364 -0.38261247 -1.51637490
 [37]  0.43117447 -1.10539146  1.06654596 -2.16401384 -2.22029575 -0.35155016
 [43] -1.31133337  0.69555330  0.60027101 -0.27054988  0.71601795  1.06221949
 [49]  1.19227665  0.23354485 -0.56956048  0.33198350 -0.64295290  1.91491136
 [55]  0.52770269  1.47194203 -0.51340345 -1.76977108 -0.61250278 -0.82031363
 [61]  0.19884596 -1.23182116 -0.83372906 -1.65795752 -0.59279897 -1.01218183
 [67] -0.20379430 -0.67515501 -0.99797351  0.67537624  0.81508596 -1.64484310
 [73] -0.08322436  0.52537075  0.30614579 -0.46599868  0.88354414 -1.26999983
 [79] -0.53270005 -1.48916981  1.38271328 -1.44428795 -0.70150786  0.90628633
 [85] -0.19624296 -0.70261677  0.28456469  0.51898197 -0.45437851 -0.34461323
 [91] -0.97647670 -0.07271440 -1.22499649 -1.65659459 -1.86883485 -0.37802960
 [97] -1.24970991 -2.07397348  0.55140676  0.03164937
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]      [,5]      [,6]     [,7]
[1,] -1.089596 0.6425558 0.4607189 0.3301907 -1.481033 0.3975026 1.488823
[2,] -1.089596 0.6425558 0.4607189 0.3301907 -1.481033 0.3975026 1.488823
           [,8]       [,9]     [,10]      [,11]    [,12]    [,13]    [,14]
[1,] -0.6949635 -0.3111342 -0.806716 -0.5224674 1.062429 1.461034 0.470899
[2,] -0.6949635 -0.3111342 -0.806716 -0.5224674 1.062429 1.461034 0.470899
          [,15]    [,16]     [,17]      [,18]     [,19]      [,20]      [,21]
[1,] -0.6866458 0.743047 0.1048644 -0.8270393 0.3947884 -0.5509948 -0.5312456
[2,] -0.6866458 0.743047 0.1048644 -0.8270393 0.3947884 -0.5509948 -0.5312456
        [,22]     [,23]      [,24]     [,25]      [,26]     [,27]    [,28]
[1,] 0.371896 0.6312429 -0.3331754 -2.138482 -0.9923571 0.6741546 1.734719
[2,] 0.371896 0.6312429 -0.3331754 -2.138482 -0.9923571 0.6741546 1.734719
         [,29]      [,30]      [,31]      [,32]     [,33]    [,34]      [,35]
[1,] 0.2270173 -0.2058377 -0.1279123 -0.4916505 0.5063713 1.155104 -0.3826125
[2,] 0.2270173 -0.2058377 -0.1279123 -0.4916505 0.5063713 1.155104 -0.3826125
         [,36]     [,37]     [,38]    [,39]     [,40]     [,41]      [,42]
[1,] -1.516375 0.4311745 -1.105391 1.066546 -2.164014 -2.220296 -0.3515502
[2,] -1.516375 0.4311745 -1.105391 1.066546 -2.164014 -2.220296 -0.3515502
         [,43]     [,44]    [,45]      [,46]    [,47]    [,48]    [,49]
[1,] -1.311333 0.6955533 0.600271 -0.2705499 0.716018 1.062219 1.192277
[2,] -1.311333 0.6955533 0.600271 -0.2705499 0.716018 1.062219 1.192277
         [,50]      [,51]     [,52]      [,53]    [,54]     [,55]    [,56]
[1,] 0.2335448 -0.5695605 0.3319835 -0.6429529 1.914911 0.5277027 1.471942
[2,] 0.2335448 -0.5695605 0.3319835 -0.6429529 1.914911 0.5277027 1.471942
          [,57]     [,58]      [,59]      [,60]    [,61]     [,62]      [,63]
[1,] -0.5134035 -1.769771 -0.6125028 -0.8203136 0.198846 -1.231821 -0.8337291
[2,] -0.5134035 -1.769771 -0.6125028 -0.8203136 0.198846 -1.231821 -0.8337291
         [,64]     [,65]     [,66]      [,67]     [,68]      [,69]     [,70]
[1,] -1.657958 -0.592799 -1.012182 -0.2037943 -0.675155 -0.9979735 0.6753762
[2,] -1.657958 -0.592799 -1.012182 -0.2037943 -0.675155 -0.9979735 0.6753762
        [,71]     [,72]       [,73]     [,74]     [,75]      [,76]     [,77]
[1,] 0.815086 -1.644843 -0.08322436 0.5253708 0.3061458 -0.4659987 0.8835441
[2,] 0.815086 -1.644843 -0.08322436 0.5253708 0.3061458 -0.4659987 0.8835441
     [,78]   [,79]    [,80]    [,81]     [,82]      [,83]     [,84]     [,85]
[1,] -1.27 -0.5327 -1.48917 1.382713 -1.444288 -0.7015079 0.9062863 -0.196243
[2,] -1.27 -0.5327 -1.48917 1.382713 -1.444288 -0.7015079 0.9062863 -0.196243
          [,86]     [,87]    [,88]      [,89]      [,90]      [,91]      [,92]
[1,] -0.7026168 0.2845647 0.518982 -0.4543785 -0.3446132 -0.9764767 -0.0727144
[2,] -0.7026168 0.2845647 0.518982 -0.4543785 -0.3446132 -0.9764767 -0.0727144
         [,93]     [,94]     [,95]      [,96]    [,97]     [,98]     [,99]
[1,] -1.224996 -1.656595 -1.868835 -0.3780296 -1.24971 -2.073973 0.5514068
[2,] -1.224996 -1.656595 -1.868835 -0.3780296 -1.24971 -2.073973 0.5514068
         [,100]
[1,] 0.03164937
[2,] 0.03164937
> 
> 
> Max(tmp2)
[1] 2.481841
> Min(tmp2)
[1] -2.467708
> mean(tmp2)
[1] -0.07930363
> Sum(tmp2)
[1] -7.930363
> Var(tmp2)
[1] 0.9383519
> 
> rowMeans(tmp2)
  [1]  0.791767411  0.415510809  0.004979237 -0.674000965 -0.126415825
  [6] -0.157225341  0.943260373  0.879620523  1.465888641  1.314396848
 [11] -1.747285085  0.413802348  1.161416215 -1.663434344  0.595439639
 [16] -0.228676288 -1.573547211 -1.210488483  0.203275668 -0.184892919
 [21]  0.614752989 -1.222838364 -0.021567343  0.248210057 -1.277513523
 [26]  0.173086166  0.385250233  0.106463474  1.540394378  0.681215981
 [31] -1.026044290  0.222420989  0.646955491 -1.170285276 -1.824539131
 [36]  0.718560389  0.013945655  0.430512306 -1.347302943 -1.458243039
 [41]  0.810557472 -1.536446746  0.281243401 -0.048983110  0.458685650
 [46] -0.294471530  0.604499512 -2.180551856  0.281095499  0.211009862
 [51] -1.454780441  0.484773152  1.507251264 -2.467707693 -0.442439729
 [56] -0.134587503  0.517289172 -1.483688371 -0.984672130 -0.202608417
 [61] -0.801995404  2.481840877 -0.702501344 -0.046835582 -0.307103536
 [66]  1.203620909 -0.755281784  0.336866428 -1.224282062  0.395928105
 [71]  1.146092392 -1.703732558 -0.688501066  0.777931117 -0.202883102
 [76]  0.750909147  0.759873362 -0.360130129 -0.621551336 -0.573332358
 [81] -0.190851219  1.781793971 -0.397460071 -0.456493822 -1.157031765
 [86]  0.946335104 -1.037902998 -1.205159924 -0.462031803  1.154337021
 [91]  0.195723406  0.582612512 -1.169628312 -0.267006317  1.310455430
 [96]  0.053607317 -0.157124035  0.570238593 -0.304914600  1.432913994
> rowSums(tmp2)
  [1]  0.791767411  0.415510809  0.004979237 -0.674000965 -0.126415825
  [6] -0.157225341  0.943260373  0.879620523  1.465888641  1.314396848
 [11] -1.747285085  0.413802348  1.161416215 -1.663434344  0.595439639
 [16] -0.228676288 -1.573547211 -1.210488483  0.203275668 -0.184892919
 [21]  0.614752989 -1.222838364 -0.021567343  0.248210057 -1.277513523
 [26]  0.173086166  0.385250233  0.106463474  1.540394378  0.681215981
 [31] -1.026044290  0.222420989  0.646955491 -1.170285276 -1.824539131
 [36]  0.718560389  0.013945655  0.430512306 -1.347302943 -1.458243039
 [41]  0.810557472 -1.536446746  0.281243401 -0.048983110  0.458685650
 [46] -0.294471530  0.604499512 -2.180551856  0.281095499  0.211009862
 [51] -1.454780441  0.484773152  1.507251264 -2.467707693 -0.442439729
 [56] -0.134587503  0.517289172 -1.483688371 -0.984672130 -0.202608417
 [61] -0.801995404  2.481840877 -0.702501344 -0.046835582 -0.307103536
 [66]  1.203620909 -0.755281784  0.336866428 -1.224282062  0.395928105
 [71]  1.146092392 -1.703732558 -0.688501066  0.777931117 -0.202883102
 [76]  0.750909147  0.759873362 -0.360130129 -0.621551336 -0.573332358
 [81] -0.190851219  1.781793971 -0.397460071 -0.456493822 -1.157031765
 [86]  0.946335104 -1.037902998 -1.205159924 -0.462031803  1.154337021
 [91]  0.195723406  0.582612512 -1.169628312 -0.267006317  1.310455430
 [96]  0.053607317 -0.157124035  0.570238593 -0.304914600  1.432913994
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.791767411  0.415510809  0.004979237 -0.674000965 -0.126415825
  [6] -0.157225341  0.943260373  0.879620523  1.465888641  1.314396848
 [11] -1.747285085  0.413802348  1.161416215 -1.663434344  0.595439639
 [16] -0.228676288 -1.573547211 -1.210488483  0.203275668 -0.184892919
 [21]  0.614752989 -1.222838364 -0.021567343  0.248210057 -1.277513523
 [26]  0.173086166  0.385250233  0.106463474  1.540394378  0.681215981
 [31] -1.026044290  0.222420989  0.646955491 -1.170285276 -1.824539131
 [36]  0.718560389  0.013945655  0.430512306 -1.347302943 -1.458243039
 [41]  0.810557472 -1.536446746  0.281243401 -0.048983110  0.458685650
 [46] -0.294471530  0.604499512 -2.180551856  0.281095499  0.211009862
 [51] -1.454780441  0.484773152  1.507251264 -2.467707693 -0.442439729
 [56] -0.134587503  0.517289172 -1.483688371 -0.984672130 -0.202608417
 [61] -0.801995404  2.481840877 -0.702501344 -0.046835582 -0.307103536
 [66]  1.203620909 -0.755281784  0.336866428 -1.224282062  0.395928105
 [71]  1.146092392 -1.703732558 -0.688501066  0.777931117 -0.202883102
 [76]  0.750909147  0.759873362 -0.360130129 -0.621551336 -0.573332358
 [81] -0.190851219  1.781793971 -0.397460071 -0.456493822 -1.157031765
 [86]  0.946335104 -1.037902998 -1.205159924 -0.462031803  1.154337021
 [91]  0.195723406  0.582612512 -1.169628312 -0.267006317  1.310455430
 [96]  0.053607317 -0.157124035  0.570238593 -0.304914600  1.432913994
> rowMin(tmp2)
  [1]  0.791767411  0.415510809  0.004979237 -0.674000965 -0.126415825
  [6] -0.157225341  0.943260373  0.879620523  1.465888641  1.314396848
 [11] -1.747285085  0.413802348  1.161416215 -1.663434344  0.595439639
 [16] -0.228676288 -1.573547211 -1.210488483  0.203275668 -0.184892919
 [21]  0.614752989 -1.222838364 -0.021567343  0.248210057 -1.277513523
 [26]  0.173086166  0.385250233  0.106463474  1.540394378  0.681215981
 [31] -1.026044290  0.222420989  0.646955491 -1.170285276 -1.824539131
 [36]  0.718560389  0.013945655  0.430512306 -1.347302943 -1.458243039
 [41]  0.810557472 -1.536446746  0.281243401 -0.048983110  0.458685650
 [46] -0.294471530  0.604499512 -2.180551856  0.281095499  0.211009862
 [51] -1.454780441  0.484773152  1.507251264 -2.467707693 -0.442439729
 [56] -0.134587503  0.517289172 -1.483688371 -0.984672130 -0.202608417
 [61] -0.801995404  2.481840877 -0.702501344 -0.046835582 -0.307103536
 [66]  1.203620909 -0.755281784  0.336866428 -1.224282062  0.395928105
 [71]  1.146092392 -1.703732558 -0.688501066  0.777931117 -0.202883102
 [76]  0.750909147  0.759873362 -0.360130129 -0.621551336 -0.573332358
 [81] -0.190851219  1.781793971 -0.397460071 -0.456493822 -1.157031765
 [86]  0.946335104 -1.037902998 -1.205159924 -0.462031803  1.154337021
 [91]  0.195723406  0.582612512 -1.169628312 -0.267006317  1.310455430
 [96]  0.053607317 -0.157124035  0.570238593 -0.304914600  1.432913994
> 
> colMeans(tmp2)
[1] -0.07930363
> colSums(tmp2)
[1] -7.930363
> colVars(tmp2)
[1] 0.9383519
> colSd(tmp2)
[1] 0.9686857
> colMax(tmp2)
[1] 2.481841
> colMin(tmp2)
[1] -2.467708
> colMedians(tmp2)
[1] -0.03420146
> colRanges(tmp2)
          [,1]
[1,] -2.467708
[2,]  2.481841
> 
> 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] -3.2126587 -0.9589422  4.3169527  4.3412068 -6.1967326  0.6837596
 [7] -2.3128351 -0.9879024  2.1668545  0.5218219
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7511657
[2,] -1.0463050
[3,] -0.1876271
[4,]  0.2099284
[5,]  1.2400970
> 
> rowApply(tmp,sum)
 [1]  4.753201 -1.062192 -3.400807  3.428611  1.280141 -3.918058  2.905477
 [8] -1.961399 -1.106766 -2.556682
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    9    2    9    2    8    4    7    1     2
 [2,]    5    4    3   10    7    2    1   10    8     3
 [3,]    9   10    7    1    8    9    7    3    9     7
 [4,]    7    6   10    8   10    5    9    1    7     8
 [5,]    4    2    9    2    1    6    3    2    5     4
 [6,]    3    3    4    5    9   10    5    4    4     5
 [7,]    6    7    1    3    6    1    2    6   10     6
 [8,]    2    8    5    4    5    7   10    8    3     1
 [9,]    8    5    8    7    3    4    8    5    6     9
[10,]   10    1    6    6    4    3    6    9    2    10
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.702579279 -5.003790544  1.529611276  0.474992929  0.785234765
 [6] -1.998694367 -1.003995388  2.623672066 -1.878672402 -4.738919059
[11] -1.486143240  0.437354621 -0.740674526  1.845738885  0.883256848
[16]  0.002932543  2.180911906  3.716313157  1.560749283 -2.424898539
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.17296053
[2,]  0.01859144
[3,]  0.09140289
[4,]  0.37028862
[5,]  0.39525686
> 
> rowApply(tmp,sum)
[1]  5.3668150 -1.5750006 -5.4978437  0.8142677 -1.6406790
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   11   13   16   10   11
[2,]   12    3    4    1   14
[3,]    1   16    7   12   20
[4,]   13    8    5   20    5
[5,]    6   12   11   11   17
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.01859144  0.1720029 -1.3516506  0.4118272 -0.4053870  1.8497478
[2,]  0.39525686 -0.9959314  0.5360855 -0.1401211  0.3814515 -2.4921044
[3,]  0.37028862 -0.9988486 -0.7217580 -0.9242742 -0.4091099  0.6298524
[4,]  0.09140289 -3.4032413  0.2969523  1.8519743  0.1472078  0.4525344
[5,] -0.17296053  0.2222278  2.7699822 -0.7244132  1.0710723 -2.4387246
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,] -1.1850174  2.5126819  0.92085836 -0.1716844 -0.7829422  1.1816639
[2,] -0.5513930  1.0230480 -2.18276178 -0.6486348  1.2978631 -0.6999453
[3,]  0.6185463 -0.4621760  0.14179418 -1.1810327  0.4245553 -0.4393585
[4,]  1.0061912 -0.1235293 -0.78734479 -2.3537615  0.4638335  0.9708804
[5,] -0.8923225 -0.3263525  0.02878162 -0.3838057 -2.8894530 -0.5758859
           [,13]       [,14]       [,15]       [,16]       [,17]      [,18]
[1,]  1.08037390 -0.03351926 -1.10172208  1.71714322 -0.06075429  1.2591567
[2,] -0.02335324  0.90964208 -0.09216251 -0.22378499  0.43575888  0.7280414
[3,] -0.47675554  1.10321006  0.36028399 -1.14319251 -0.11323869 -0.3453178
[4,] -0.63035269 -0.25342264  0.42271472  0.01505455  0.06119248  1.0853657
[5,] -0.69058695  0.11982864  1.29414273 -0.36228773  1.85795353  0.9890671
          [,19]      [,20]
[1,] -0.5052836 -0.1592716
[2,]  0.5305320  0.2375127
[3,] -1.1692691 -0.7620429
[4,]  1.7431373 -0.2425217
[5,]  0.9616327 -1.4985750
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.3  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  774  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  666  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.3  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.2522884 0.8446543 0.0008347522 0.4641465 -0.1394888 1.610468 0.4132181
           col8      col9    col10    col11    col12     col13     col14
row1 -0.3112515 0.5103282 1.529053 0.756957 0.984467 0.2830704 0.3823393
         col15    col16   col17     col18      col19     col20
row1 -1.364106 1.336867 1.47724 -1.657921 -0.3300514 0.6336558
> tmp[,"col10"]
          col10
row1  1.5290535
row2  1.1778927
row3  0.2352783
row4 -0.8685967
row5  0.3374869
> tmp[c("row1","row5"),]
           col1      col2          col3       col4       col5       col6
row1  0.2522884 0.8446543  0.0008347522  0.4641465 -0.1394888  1.6104679
row5 -0.4008375 0.9033891 -1.0070492757 -2.4892269  0.8186881 -0.9635527
           col7       col8      col9     col10     col11     col12     col13
row1  0.4132181 -0.3112515 0.5103282 1.5290535 0.7569570  0.984467 0.2830704
row5 -0.8605457 -2.3930572 0.8219430 0.3374869 0.6731485 -1.247322 0.4677604
         col14      col15      col16    col17     col18      col19      col20
row1 0.3823393 -1.3641056  1.3368670 1.477240 -1.657921 -0.3300514  0.6336558
row5 1.9976864  0.7635486 -0.6968345 1.275888 -1.109085 -0.1059338 -1.9400296
> tmp[,c("col6","col20")]
           col6      col20
row1  1.6104679  0.6336558
row2 -1.1897192 -0.5992532
row3 -0.3337769 -0.9831886
row4 -2.6119895 -1.0734735
row5 -0.9635527 -1.9400296
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  1.6104679  0.6336558
row5 -0.9635527 -1.9400296
> 
> 
> 
> 
> 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.62772 50.92404 50.44785 48.61287 49.46001 105.3974 48.41615 51.77128
         col9    col10    col11    col12    col13   col14    col15    col16
row1 48.52357 47.23063 48.20117 47.53166 51.39022 50.9656 49.14213 50.57082
        col17    col18    col19    col20
row1 49.17474 47.70564 50.03204 105.2586
> tmp[,"col10"]
        col10
row1 47.23063
row2 29.63216
row3 30.68465
row4 31.13225
row5 50.68639
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.62772 50.92404 50.44785 48.61287 49.46001 105.3974 48.41615 51.77128
row5 50.64119 51.30923 48.95491 47.68950 50.10793 104.4566 49.19783 50.25986
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.52357 47.23063 48.20117 47.53166 51.39022 50.96560 49.14213 50.57082
row5 49.56261 50.68639 49.09931 50.15054 50.64402 49.42592 50.05525 52.04934
        col17    col18    col19    col20
row1 49.17474 47.70564 50.03204 105.2586
row5 50.30129 51.21770 49.04153 103.9068
> tmp[,c("col6","col20")]
          col6     col20
row1 105.39742 105.25859
row2  75.71140  73.89600
row3  74.05281  74.44639
row4  75.84387  74.57973
row5 104.45662 103.90677
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.3974 105.2586
row5 104.4566 103.9068
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.3974 105.2586
row5 104.4566 103.9068
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.08240551
[2,]  0.73003346
[3,] -0.40747728
[4,] -0.13812649
[5,] -1.52486061
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.4059098  1.0848671
[2,] -0.5903134  0.5731545
[3,] -1.5368647 -1.2267190
[4,] -1.2186613 -0.7544868
[5,] -0.4288373  1.8859725
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  2.9661078 -0.5021463
[2,] -0.8144848 -0.2124292
[3,]  1.6446026 -1.1947241
[4,]  0.6461049 -1.1911963
[5,]  1.0949362 -1.6839229
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 2.966108
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,]  2.9661078
[2,] -0.8144848
> 
> 
> 
> 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.4997356 -0.06708062 0.1154244 -1.9591044  1.521322 -1.025476 0.1973418
row1 -0.5883052  0.35124541 1.2148214  0.7201455 -0.928605  1.907133 0.3247046
           [,8]       [,9]     [,10]     [,11]     [,12]      [,13]      [,14]
row3 -0.2689557 -0.3984337 0.2207480 0.8501550  1.223605  0.4655398 -0.8404385
row1  0.3111724  0.3346310 0.8422587 0.9430312 -1.531353 -0.5958156 -0.4355489
          [,15]      [,16]     [,17]     [,18]      [,19]      [,20]
row3 -0.5337587  0.8397693 0.3271178 0.4733167 -0.1854371  0.2509273
row1  0.4817215 -0.7235817 0.8737510 1.0468505  0.7856614 -0.4234381
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]     [,4]      [,5]       [,6]      [,7]
row2 0.8274223 0.5681421 -1.550427 1.036412 0.4146437 -0.2757507 0.6498067
           [,8]       [,9]      [,10]
row2 -0.8344673 -0.1450935 -0.7048005
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]       [,4]       [,5]        [,6]     [,7]
row5 0.7617554 0.1645677 -0.7029063 -0.5198146 -0.5507431 -0.01179033 -1.23649
         [,8]     [,9]     [,10]      [,11]      [,12]     [,13]      [,14]
row5 1.816098 1.484419 0.4273392 -0.8537617 -0.4704599 -1.748838 -0.5298951
         [,15]      [,16]     [,17]     [,18]    [,19]      [,20]
row5 0.3370446 -0.5991337 0.9099634 0.6833982 1.423795 -0.4102066
> 
> 
> 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: 0x56214ce865d0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2275496cc14787"
 [2] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2275494ba385ae"
 [3] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2275495e7a3dc" 
 [4] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM22754963cfd5c9"
 [5] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2275496abe98ac"
 [6] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2275496aa37e2a"
 [7] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM22754911b7365b"
 [8] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM22754979320cbc"
 [9] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM22754967128e0b"
[10] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM22754984affaf" 
[11] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM227549660c92ae"
[12] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2275496a015b6c"
[13] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2275492969a3d9"
[14] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM2275497de01a75"
[15] "/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM22754938326b75"
> 
> 
> ### 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: 0x56214c4a02d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x56214c4a02d0>
Warning message:
In dir.create(new.directory) :
  '/media/volume/teran2_disk/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x56214c4a02d0>
> rowMedians(tmp)
  [1] -0.6179525996 -0.3301841277  0.0061934540 -0.0066350433  0.4851402076
  [6] -0.8740802746  0.2771108903 -0.0239734193  0.4555791323  0.5600751880
 [11] -0.1331860824  0.4773218896  0.2846184932  0.4008541652 -0.0028499855
 [16]  0.1456920543  0.1636451540 -0.2764414882 -0.1758232006  0.0692683449
 [21] -0.1762753875 -0.0490202257  0.3361695387  0.2350537842  0.0203434279
 [26] -0.3164485157 -0.2084560819 -0.4593909361 -0.5412110969 -0.5457096580
 [31] -0.3896402339  0.0969925247  0.1217786182  0.2701580178 -0.5213860401
 [36]  0.1889046995 -0.5664824160  0.1039321265  0.3698040812 -0.3672479042
 [41]  0.0156314940 -0.0911535128  0.1698550152 -0.1078916613 -0.5529476840
 [46] -0.0484870583  0.7682037892 -0.0978976040 -0.1427795286  0.2748991162
 [51]  0.1707261766  1.3663536630  0.2437675779  0.2919827307  0.2150988159
 [56] -0.0391301722 -0.0649378346 -0.3546222249 -0.4704486355 -0.0571719396
 [61]  0.2652625656  0.6298983116 -0.4613538422  0.1165764411  0.1333542911
 [66]  0.0240053464  0.1454254746 -0.1507944677 -0.0405820932  0.2981471345
 [71]  0.4743621807 -0.0315639090 -0.2021632959 -0.1688184389 -0.4492486168
 [76]  0.0379443288 -0.3336559024  0.0952756827 -0.3684354197 -0.0376715870
 [81]  0.1052017409  0.2124996637  0.1624942308  0.0691009317  0.2157913842
 [86]  0.2362833965  0.4773184570  0.2412663336  0.3568939893  0.0288361547
 [91]  0.2753655023  0.2655103351 -0.0216871131 -0.4809736042  0.2289584125
 [96]  0.4039583425  0.7246554888 -0.0364949033 -0.0105409330 -0.1098726475
[101] -0.0446204867  0.2415300381  0.3447413759  0.0542519481 -0.0015123269
[106]  0.3125628963 -0.0821508882  0.1313394226  0.3196883179  0.2501460470
[111] -0.3145415251  0.2207504842 -0.5317735621  0.4285520940 -0.0867896924
[116]  0.4348427781  0.2420891897 -0.0696993253  0.1360664851  0.5102352726
[121] -0.0386529281 -0.0687762317 -0.1617523250 -0.3263989391  0.5627605133
[126] -0.0975393922  0.3027276923 -0.2011381005  0.0390864128  0.0630660680
[131]  0.0221842273 -0.4284749044  0.0403268433  0.5701268389 -0.1674251686
[136]  0.0536565362 -0.0983006695 -0.2187680619  0.1656676143  0.1532034488
[141] -0.0059168801 -0.1732639845 -0.2114311359 -0.1612441552 -0.7095567216
[146]  0.4658222085 -0.2043704730 -0.2717875676  0.4390667443 -0.0779763235
[151]  0.2330018946  0.3492597866  0.5605042498 -0.4263070327 -0.6135012651
[156]  0.1643393338 -0.4490731181 -0.1767467065  0.5346786743  0.4281226045
[161]  0.5592829893 -0.1408901027 -0.0551158303 -0.3531538785 -0.1810315676
[166] -0.2493585126  0.1998051286  0.1622034133 -0.3416018631  0.0636889151
[171]  0.0003100947  0.1380646031  0.0448237716 -0.3087811857 -0.1568361808
[176]  0.3197195082  0.1343071496  0.2430392270 -0.2039099499 -0.0355223663
[181] -0.5834724116 -0.3101137881 -0.8408320723  0.0501582814  0.2877061191
[186] -0.3550320581  0.3757228696  0.2214562669  0.2098470580 -0.6338697068
[191] -0.0694854060 -0.0905633435  0.1860693862 -0.2495013307  0.1314547065
[196] -0.2491821674 -0.5588533012 -0.2498452020 -0.6160616142  0.4678994938
[201] -0.0858729977 -0.4732473647 -0.6632131626  0.0941075169  0.0344231024
[206]  0.0692232963 -0.0098549805  0.2045234735 -0.1139005191 -0.5772042432
[211] -0.0947578364 -0.1219144069  0.1519771587 -0.1019458972 -0.2844872404
[216]  0.2851188719  0.4172308090 -0.3876764567  0.3158900450 -0.2144889117
[221] -0.2649305950 -0.2728004930 -0.4488942128 -0.1509656043 -0.5809019421
[226] -0.1631812946 -0.2728820438 -0.3280602443 -0.3273471659 -0.7425423094
> 
> proc.time()
   user  system elapsed 
  0.957   1.289   2.242 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: 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: 0x5b532f6c49c0>
> .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: 0x5b532f6c49c0>
> .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: 0x5b532f6c49c0>
> .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: 0x5b532f6c49c0>
> 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: 0x5b53317222f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b53317222f0>
> .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: 0x5b53317222f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b53317222f0>
> .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: 0x5b53317222f0>
> 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: 0x5b5331724ad0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b5331724ad0>
> .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: 0x5b5331724ad0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b5331724ad0>
> .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: 0x5b5331724ad0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5b5331724ad0>
> .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: 0x5b5331724ad0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5b5331724ad0>
> .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: 0x5b5331724ad0>
> 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: 0x5b5331e91930>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5b5331e91930>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b5331e91930>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b5331e91930>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2275db19c2a40f" "BufferedMatrixFile2275db4de45e4d"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2275db19c2a40f" "BufferedMatrixFile2275db4de45e4d"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b5330aa5c20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b5330aa5c20>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b5330aa5c20>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b5330aa5c20>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5b5330aa5c20>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5b5330aa5c20>
> .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: 0x5b53307bd1d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b53307bd1d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b53307bd1d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5b53307bd1d0>
> 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: 0x5b5330bd1510>
> .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: 0x5b5330bd1510>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.172   0.065   0.223 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

Example timings