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

This page was generated on 2025-02-06 12:04 -0500 (Thu, 06 Feb 2025).

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

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


CHECK results for BufferedMatrix on nebbiolo2

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: 2025-02-03 20:37:17 -0500 (Mon, 03 Feb 2025)
EndedAt: 2025-02-03 20:37:40 -0500 (Mon, 03 Feb 2025)
EllapsedTime: 23.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 ‘/home/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.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.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 ‘/home/biocbuild/bbs-3.20-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -I"/home/biocbuild/bbs-3.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 /home/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.233   0.044   0.265 

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] "/home/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 471792 25.2    1026261 54.9   643431 34.4
Vcells 871947  6.7    8388608 64.0  2046621 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] "Mon Feb  3 20:37:31 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Feb  3 20:37:31 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5c503a2dfac0>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Feb  3 20:37:31 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Feb  3 20:37:31 2025"
> 
> ColMode(tmp2)
<pointer: 0x5c503a2dfac0>
> 
> 
> 
> ### 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,] 101.2573963 -1.2444858 -0.8171322 -0.8847452
[2,]   0.8611474  1.1085564  1.1606416  1.5245063
[3,]   0.9567339 -0.8812928  0.4999629 -1.1949297
[4,]  -0.2779604 -1.6806918 -1.5004461  0.1133573
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]      [,2]      [,3]      [,4]
[1,] 101.2573963 1.2444858 0.8171322 0.8847452
[2,]   0.8611474 1.1085564 1.1606416 1.5245063
[3,]   0.9567339 0.8812928 0.4999629 1.1949297
[4,]   0.2779604 1.6806918 1.5004461 0.1133573
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 10.0626734 1.1155652 0.9039536 0.9406090
[2,]  0.9279803 1.0528800 1.0773308 1.2347090
[3,]  0.9781278 0.9387719 0.7070805 1.0931284
[4,]  0.5272195 1.2964150 1.2249270 0.3366858
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.88413 37.40014 34.85667 35.29083
[2,]  35.14095 36.63736 36.93395 38.87160
[3,]  35.73801 35.26901 32.57077 37.12621
[4,]  30.55016 39.64484 38.74972 28.48022
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5c503828e470>
> exp(tmp5)
<pointer: 0x5c503828e470>
> log(tmp5,2)
<pointer: 0x5c503828e470>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.2296
> Min(tmp5)
[1] 53.48598
> mean(tmp5)
[1] 73.90612
> Sum(tmp5)
[1] 14781.22
> Var(tmp5)
[1] 870.5284
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 93.60076 74.59909 71.58946 70.31510 72.79987 71.66863 71.17137 70.54170
 [9] 72.26987 70.50533
> rowSums(tmp5)
 [1] 1872.015 1491.982 1431.789 1406.302 1455.997 1433.373 1423.427 1410.834
 [9] 1445.397 1410.107
> rowVars(tmp5)
 [1] 8010.99627   65.68625   77.60675   78.89056   83.88050   73.15061
 [7]   81.18062   81.96797   52.34054   42.57841
> rowSd(tmp5)
 [1] 89.504169  8.104705  8.809469  8.882036  9.158630  8.552813  9.010029
 [8]  9.053616  7.234676  6.525214
> rowMax(tmp5)
 [1] 472.22959  85.44743  85.12403  87.82696  90.15151  83.17632  88.58881
 [8]  93.14137  81.91179  85.43944
> rowMin(tmp5)
 [1] 59.86102 55.55338 53.48598 56.09379 56.44612 53.98804 58.87639 55.94310
 [9] 53.95402 60.81550
> 
> colMeans(tmp5)
 [1] 110.45318  76.98227  74.33567  70.56943  75.56427  68.59085  71.75363
 [8]  76.11913  75.79701  73.06142  67.90028  67.92542  69.59221  67.28707
[15]  73.12840  70.38690  74.03167  70.87868  71.92945  71.83539
> colSums(tmp5)
 [1] 1104.5318  769.8227  743.3567  705.6943  755.6427  685.9085  717.5363
 [8]  761.1913  757.9701  730.6142  679.0028  679.2542  695.9221  672.8707
[15]  731.2840  703.8690  740.3167  708.7868  719.2945  718.3539
> colVars(tmp5)
 [1] 16185.20452    33.03270    95.47527    92.14052   149.80849    63.30910
 [7]    99.76798    23.33580    48.21277   106.15747    81.87699    36.05257
[13]    66.40967    42.48993    28.14369    85.72405    78.07005    51.02751
[19]    43.18336    99.02025
> colSd(tmp5)
 [1] 127.221085   5.747408   9.771145   9.598985  12.239628   7.956702
 [7]   9.988392   4.830714   6.943542  10.303275   9.048590   6.004379
[13]   8.149213   6.518430   5.305062   9.258728   8.835726   7.143354
[19]   6.571405   9.950892
> colMax(tmp5)
 [1] 472.22959  87.68569  86.78490  89.12974  93.14137  86.97432  85.44743
 [8]  83.08507  84.75945  90.15151  85.43944  76.46026  81.59444  78.43370
[15]  80.46825  82.29852  85.13410  79.68947  81.56347  87.82696
> colMin(tmp5)
 [1] 60.81550 68.48521 53.95402 59.27784 55.55338 60.55462 56.44612 69.15220
 [9] 62.57786 56.77597 57.81033 53.98804 53.48598 58.87639 65.81011 55.54697
[17] 58.89876 58.80074 61.28779 58.28410
> 
> 
> ### 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] 93.60076 74.59909 71.58946 70.31510 72.79987 71.66863 71.17137 70.54170
 [9] 72.26987       NA
> rowSums(tmp5)
 [1] 1872.015 1491.982 1431.789 1406.302 1455.997 1433.373 1423.427 1410.834
 [9] 1445.397       NA
> rowVars(tmp5)
 [1] 8010.99627   65.68625   77.60675   78.89056   83.88050   73.15061
 [7]   81.18062   81.96797   52.34054   43.68398
> rowSd(tmp5)
 [1] 89.504169  8.104705  8.809469  8.882036  9.158630  8.552813  9.010029
 [8]  9.053616  7.234676  6.609386
> rowMax(tmp5)
 [1] 472.22959  85.44743  85.12403  87.82696  90.15151  83.17632  88.58881
 [8]  93.14137  81.91179        NA
> rowMin(tmp5)
 [1] 59.86102 55.55338 53.48598 56.09379 56.44612 53.98804 58.87639 55.94310
 [9] 53.95402       NA
> 
> colMeans(tmp5)
 [1] 110.45318  76.98227  74.33567  70.56943  75.56427  68.59085  71.75363
 [8]  76.11913  75.79701  73.06142  67.90028  67.92542        NA  67.28707
[15]  73.12840  70.38690  74.03167  70.87868  71.92945  71.83539
> colSums(tmp5)
 [1] 1104.5318  769.8227  743.3567  705.6943  755.6427  685.9085  717.5363
 [8]  761.1913  757.9701  730.6142  679.0028  679.2542        NA  672.8707
[15]  731.2840  703.8690  740.3167  708.7868  719.2945  718.3539
> colVars(tmp5)
 [1] 16185.20452    33.03270    95.47527    92.14052   149.80849    63.30910
 [7]    99.76798    23.33580    48.21277   106.15747    81.87699    36.05257
[13]          NA    42.48993    28.14369    85.72405    78.07005    51.02751
[19]    43.18336    99.02025
> colSd(tmp5)
 [1] 127.221085   5.747408   9.771145   9.598985  12.239628   7.956702
 [7]   9.988392   4.830714   6.943542  10.303275   9.048590   6.004379
[13]         NA   6.518430   5.305062   9.258728   8.835726   7.143354
[19]   6.571405   9.950892
> colMax(tmp5)
 [1] 472.22959  87.68569  86.78490  89.12974  93.14137  86.97432  85.44743
 [8]  83.08507  84.75945  90.15151  85.43944  76.46026        NA  78.43370
[15]  80.46825  82.29852  85.13410  79.68947  81.56347  87.82696
> colMin(tmp5)
 [1] 60.81550 68.48521 53.95402 59.27784 55.55338 60.55462 56.44612 69.15220
 [9] 62.57786 56.77597 57.81033 53.98804       NA 58.87639 65.81011 55.54697
[17] 58.89876 58.80074 61.28779 58.28410
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.2296
> Min(tmp5,na.rm=TRUE)
[1] 53.48598
> mean(tmp5,na.rm=TRUE)
[1] 73.89988
> Sum(tmp5,na.rm=TRUE)
[1] 14706.08
> Var(tmp5,na.rm=TRUE)
[1] 874.9171
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.60076 74.59909 71.58946 70.31510 72.79987 71.66863 71.17137 70.54170
 [9] 72.26987 70.26104
> rowSums(tmp5,na.rm=TRUE)
 [1] 1872.015 1491.982 1431.789 1406.302 1455.997 1433.373 1423.427 1410.834
 [9] 1445.397 1334.960
> rowVars(tmp5,na.rm=TRUE)
 [1] 8010.99627   65.68625   77.60675   78.89056   83.88050   73.15061
 [7]   81.18062   81.96797   52.34054   43.68398
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.504169  8.104705  8.809469  8.882036  9.158630  8.552813  9.010029
 [8]  9.053616  7.234676  6.609386
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.22959  85.44743  85.12403  87.82696  90.15151  83.17632  88.58881
 [8]  93.14137  81.91179  85.43944
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.86102 55.55338 53.48598 56.09379 56.44612 53.98804 58.87639 55.94310
 [9] 53.95402 60.81550
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.45318  76.98227  74.33567  70.56943  75.56427  68.59085  71.75363
 [8]  76.11913  75.79701  73.06142  67.90028  67.92542  68.97502  67.28707
[15]  73.12840  70.38690  74.03167  70.87868  71.92945  71.83539
> colSums(tmp5,na.rm=TRUE)
 [1] 1104.5318  769.8227  743.3567  705.6943  755.6427  685.9085  717.5363
 [8]  761.1913  757.9701  730.6142  679.0028  679.2542  620.7752  672.8707
[15]  731.2840  703.8690  740.3167  708.7868  719.2945  718.3539
> colVars(tmp5,na.rm=TRUE)
 [1] 16185.20452    33.03270    95.47527    92.14052   149.80849    63.30910
 [7]    99.76798    23.33580    48.21277   106.15747    81.87699    36.05257
[13]    70.42550    42.48993    28.14369    85.72405    78.07005    51.02751
[19]    43.18336    99.02025
> colSd(tmp5,na.rm=TRUE)
 [1] 127.221085   5.747408   9.771145   9.598985  12.239628   7.956702
 [7]   9.988392   4.830714   6.943542  10.303275   9.048590   6.004379
[13]   8.391990   6.518430   5.305062   9.258728   8.835726   7.143354
[19]   6.571405   9.950892
> colMax(tmp5,na.rm=TRUE)
 [1] 472.22959  87.68569  86.78490  89.12974  93.14137  86.97432  85.44743
 [8]  83.08507  84.75945  90.15151  85.43944  76.46026  81.59444  78.43370
[15]  80.46825  82.29852  85.13410  79.68947  81.56347  87.82696
> colMin(tmp5,na.rm=TRUE)
 [1] 60.81550 68.48521 53.95402 59.27784 55.55338 60.55462 56.44612 69.15220
 [9] 62.57786 56.77597 57.81033 53.98804 53.48598 58.87639 65.81011 55.54697
[17] 58.89876 58.80074 61.28779 58.28410
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 93.60076 74.59909 71.58946 70.31510 72.79987 71.66863 71.17137 70.54170
 [9] 72.26987      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1872.015 1491.982 1431.789 1406.302 1455.997 1433.373 1423.427 1410.834
 [9] 1445.397    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8010.99627   65.68625   77.60675   78.89056   83.88050   73.15061
 [7]   81.18062   81.96797   52.34054         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.504169  8.104705  8.809469  8.882036  9.158630  8.552813  9.010029
 [8]  9.053616  7.234676        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.22959  85.44743  85.12403  87.82696  90.15151  83.17632  88.58881
 [8]  93.14137  81.91179        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 59.86102 55.55338 53.48598 56.09379 56.44612 53.98804 58.87639 55.94310
 [9] 53.95402       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.96848  77.63207  74.96323  71.26235  75.17877  69.23517  70.73520
 [8]  76.78034  76.39079  74.01608  65.95149  68.03637       NaN  67.30978
[15]  73.50082  70.58797  73.42453  70.72869  72.70613  72.29640
> colSums(tmp5,na.rm=TRUE)
 [1] 1043.7163  698.6886  674.6691  641.3611  676.6089  623.1165  636.6168
 [8]  691.0231  687.5171  666.1447  593.5634  612.3274    0.0000  605.7880
[15]  661.5073  635.2917  660.8208  636.5582  654.3551  650.6676
> colVars(tmp5,na.rm=TRUE)
 [1] 17866.14692    32.41165   102.97898    98.25661   166.86262    66.55239
 [7]   100.57030    21.33426    50.27296   109.17408    49.38635    40.42065
[13]          NA    47.79537    30.10137    95.98475    83.68187    57.15285
[19]    41.79499   109.00687
> colSd(tmp5,na.rm=TRUE)
 [1] 133.664307   5.693123  10.147856   9.912447  12.917531   8.157965
 [7]  10.028474   4.618902   7.090342  10.448640   7.027542   6.357724
[13]         NA   6.913420   5.486471   9.797181   9.147779   7.559951
[19]   6.464904  10.440636
> colMax(tmp5,na.rm=TRUE)
 [1] 472.22959  87.68569  86.78490  89.12974  93.14137  86.97432  85.44743
 [8]  83.08507  84.75945  90.15151  75.95176  76.46026      -Inf  78.43370
[15]  80.46825  82.29852  85.13410  79.68947  81.56347  87.82696
> colMin(tmp5,na.rm=TRUE)
 [1] 63.58615 68.48521 53.95402 59.27784 55.55338 60.55462 56.44612 69.15220
 [9] 62.57786 56.77597 57.81033 53.98804      Inf 58.87639 65.81011 55.54697
[17] 58.89876 58.80074 61.28779 58.28410
> 
> 
> 
> 
> 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] 176.95881 131.69987 108.32057 219.77090 222.46513 199.45982 153.98121
 [8] 240.55789  91.44944 267.63586
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 176.95881 131.69987 108.32057 219.77090 222.46513 199.45982 153.98121
 [8] 240.55789  91.44944 267.63586
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  1.705303e-13  5.684342e-14  8.526513e-14  0.000000e+00 -5.684342e-14
 [6] -7.105427e-14 -5.684342e-14 -1.136868e-13  7.105427e-14  1.776357e-14
[11] -2.273737e-13 -5.684342e-14 -1.421085e-14 -4.263256e-14  5.684342e-14
[16]  8.526513e-14  5.684342e-14  7.105427e-14 -1.421085e-14  4.263256e-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)
+ }
7   12 
10   3 
5   12 
7   7 
2   14 
5   4 
10   20 
9   9 
7   6 
3   1 
3   20 
8   7 
7   8 
9   11 
10   13 
2   1 
10   15 
2   2 
8   18 
4   5 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.887543
> Min(tmp)
[1] -2.622048
> mean(tmp)
[1] 0.1079844
> Sum(tmp)
[1] 10.79844
> Var(tmp)
[1] 1.021497
> 
> rowMeans(tmp)
[1] 0.1079844
> rowSums(tmp)
[1] 10.79844
> rowVars(tmp)
[1] 1.021497
> rowSd(tmp)
[1] 1.010691
> rowMax(tmp)
[1] 2.887543
> rowMin(tmp)
[1] -2.622048
> 
> colMeans(tmp)
  [1] -2.622048112  0.554491564  0.553810466  1.186235287  0.474198848
  [6] -1.245023110  0.089376240  0.638947699 -0.738272604  0.291104403
 [11]  2.615164946  0.675066696  2.505141705  0.114780340  0.400637369
 [16]  0.346881046 -0.974803317  0.042415038  0.163502024 -0.199454312
 [21]  0.624071452  0.578108317 -0.209560407 -0.626800164  0.831977854
 [26]  0.966874134  1.448558125  1.758225793  0.602315010 -0.991788670
 [31]  2.887543129 -1.201166304 -0.782924989 -0.478546476  2.047614775
 [36]  0.613030850  1.112658286  1.058063974 -1.171677724 -1.388606147
 [41] -0.660813363 -2.285072553 -1.030166347 -0.657421678 -1.349119864
 [46] -1.170148388 -0.149752862 -0.234982315  0.077411774 -1.168068829
 [51]  0.144609142  1.539105391  1.151608641 -0.268510788  0.715416152
 [56]  0.581409391  1.061868744 -0.648043658 -0.307413324 -0.718284659
 [61] -1.253744824 -1.531295883  0.350018799  0.104205881 -1.286829282
 [66]  0.119322630  0.689532177 -1.091956071 -0.154779405  0.220810689
 [71] -1.198457700  0.904583729 -0.194116331 -1.523748617 -0.067652434
 [76] -0.555917500  1.199404332  0.937442447 -0.002425137 -0.185154600
 [81]  0.443950488  0.503673922  0.883096790  0.491315283  1.296848653
 [86]  0.845217263  0.868849961 -0.125713859  1.358555238 -0.244671941
 [91]  1.287723511  0.605251635  0.723387988  0.110368254  0.398744960
 [96] -0.702199719 -1.032372133  0.457589917 -0.774694532  0.750522955
> colSums(tmp)
  [1] -2.622048112  0.554491564  0.553810466  1.186235287  0.474198848
  [6] -1.245023110  0.089376240  0.638947699 -0.738272604  0.291104403
 [11]  2.615164946  0.675066696  2.505141705  0.114780340  0.400637369
 [16]  0.346881046 -0.974803317  0.042415038  0.163502024 -0.199454312
 [21]  0.624071452  0.578108317 -0.209560407 -0.626800164  0.831977854
 [26]  0.966874134  1.448558125  1.758225793  0.602315010 -0.991788670
 [31]  2.887543129 -1.201166304 -0.782924989 -0.478546476  2.047614775
 [36]  0.613030850  1.112658286  1.058063974 -1.171677724 -1.388606147
 [41] -0.660813363 -2.285072553 -1.030166347 -0.657421678 -1.349119864
 [46] -1.170148388 -0.149752862 -0.234982315  0.077411774 -1.168068829
 [51]  0.144609142  1.539105391  1.151608641 -0.268510788  0.715416152
 [56]  0.581409391  1.061868744 -0.648043658 -0.307413324 -0.718284659
 [61] -1.253744824 -1.531295883  0.350018799  0.104205881 -1.286829282
 [66]  0.119322630  0.689532177 -1.091956071 -0.154779405  0.220810689
 [71] -1.198457700  0.904583729 -0.194116331 -1.523748617 -0.067652434
 [76] -0.555917500  1.199404332  0.937442447 -0.002425137 -0.185154600
 [81]  0.443950488  0.503673922  0.883096790  0.491315283  1.296848653
 [86]  0.845217263  0.868849961 -0.125713859  1.358555238 -0.244671941
 [91]  1.287723511  0.605251635  0.723387988  0.110368254  0.398744960
 [96] -0.702199719 -1.032372133  0.457589917 -0.774694532  0.750522955
> 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] -2.622048112  0.554491564  0.553810466  1.186235287  0.474198848
  [6] -1.245023110  0.089376240  0.638947699 -0.738272604  0.291104403
 [11]  2.615164946  0.675066696  2.505141705  0.114780340  0.400637369
 [16]  0.346881046 -0.974803317  0.042415038  0.163502024 -0.199454312
 [21]  0.624071452  0.578108317 -0.209560407 -0.626800164  0.831977854
 [26]  0.966874134  1.448558125  1.758225793  0.602315010 -0.991788670
 [31]  2.887543129 -1.201166304 -0.782924989 -0.478546476  2.047614775
 [36]  0.613030850  1.112658286  1.058063974 -1.171677724 -1.388606147
 [41] -0.660813363 -2.285072553 -1.030166347 -0.657421678 -1.349119864
 [46] -1.170148388 -0.149752862 -0.234982315  0.077411774 -1.168068829
 [51]  0.144609142  1.539105391  1.151608641 -0.268510788  0.715416152
 [56]  0.581409391  1.061868744 -0.648043658 -0.307413324 -0.718284659
 [61] -1.253744824 -1.531295883  0.350018799  0.104205881 -1.286829282
 [66]  0.119322630  0.689532177 -1.091956071 -0.154779405  0.220810689
 [71] -1.198457700  0.904583729 -0.194116331 -1.523748617 -0.067652434
 [76] -0.555917500  1.199404332  0.937442447 -0.002425137 -0.185154600
 [81]  0.443950488  0.503673922  0.883096790  0.491315283  1.296848653
 [86]  0.845217263  0.868849961 -0.125713859  1.358555238 -0.244671941
 [91]  1.287723511  0.605251635  0.723387988  0.110368254  0.398744960
 [96] -0.702199719 -1.032372133  0.457589917 -0.774694532  0.750522955
> colMin(tmp)
  [1] -2.622048112  0.554491564  0.553810466  1.186235287  0.474198848
  [6] -1.245023110  0.089376240  0.638947699 -0.738272604  0.291104403
 [11]  2.615164946  0.675066696  2.505141705  0.114780340  0.400637369
 [16]  0.346881046 -0.974803317  0.042415038  0.163502024 -0.199454312
 [21]  0.624071452  0.578108317 -0.209560407 -0.626800164  0.831977854
 [26]  0.966874134  1.448558125  1.758225793  0.602315010 -0.991788670
 [31]  2.887543129 -1.201166304 -0.782924989 -0.478546476  2.047614775
 [36]  0.613030850  1.112658286  1.058063974 -1.171677724 -1.388606147
 [41] -0.660813363 -2.285072553 -1.030166347 -0.657421678 -1.349119864
 [46] -1.170148388 -0.149752862 -0.234982315  0.077411774 -1.168068829
 [51]  0.144609142  1.539105391  1.151608641 -0.268510788  0.715416152
 [56]  0.581409391  1.061868744 -0.648043658 -0.307413324 -0.718284659
 [61] -1.253744824 -1.531295883  0.350018799  0.104205881 -1.286829282
 [66]  0.119322630  0.689532177 -1.091956071 -0.154779405  0.220810689
 [71] -1.198457700  0.904583729 -0.194116331 -1.523748617 -0.067652434
 [76] -0.555917500  1.199404332  0.937442447 -0.002425137 -0.185154600
 [81]  0.443950488  0.503673922  0.883096790  0.491315283  1.296848653
 [86]  0.845217263  0.868849961 -0.125713859  1.358555238 -0.244671941
 [91]  1.287723511  0.605251635  0.723387988  0.110368254  0.398744960
 [96] -0.702199719 -1.032372133  0.457589917 -0.774694532  0.750522955
> colMedians(tmp)
  [1] -2.622048112  0.554491564  0.553810466  1.186235287  0.474198848
  [6] -1.245023110  0.089376240  0.638947699 -0.738272604  0.291104403
 [11]  2.615164946  0.675066696  2.505141705  0.114780340  0.400637369
 [16]  0.346881046 -0.974803317  0.042415038  0.163502024 -0.199454312
 [21]  0.624071452  0.578108317 -0.209560407 -0.626800164  0.831977854
 [26]  0.966874134  1.448558125  1.758225793  0.602315010 -0.991788670
 [31]  2.887543129 -1.201166304 -0.782924989 -0.478546476  2.047614775
 [36]  0.613030850  1.112658286  1.058063974 -1.171677724 -1.388606147
 [41] -0.660813363 -2.285072553 -1.030166347 -0.657421678 -1.349119864
 [46] -1.170148388 -0.149752862 -0.234982315  0.077411774 -1.168068829
 [51]  0.144609142  1.539105391  1.151608641 -0.268510788  0.715416152
 [56]  0.581409391  1.061868744 -0.648043658 -0.307413324 -0.718284659
 [61] -1.253744824 -1.531295883  0.350018799  0.104205881 -1.286829282
 [66]  0.119322630  0.689532177 -1.091956071 -0.154779405  0.220810689
 [71] -1.198457700  0.904583729 -0.194116331 -1.523748617 -0.067652434
 [76] -0.555917500  1.199404332  0.937442447 -0.002425137 -0.185154600
 [81]  0.443950488  0.503673922  0.883096790  0.491315283  1.296848653
 [86]  0.845217263  0.868849961 -0.125713859  1.358555238 -0.244671941
 [91]  1.287723511  0.605251635  0.723387988  0.110368254  0.398744960
 [96] -0.702199719 -1.032372133  0.457589917 -0.774694532  0.750522955
> colRanges(tmp)
          [,1]      [,2]      [,3]     [,4]      [,5]      [,6]       [,7]
[1,] -2.622048 0.5544916 0.5538105 1.186235 0.4741988 -1.245023 0.08937624
[2,] -2.622048 0.5544916 0.5538105 1.186235 0.4741988 -1.245023 0.08937624
          [,8]       [,9]     [,10]    [,11]     [,12]    [,13]     [,14]
[1,] 0.6389477 -0.7382726 0.2911044 2.615165 0.6750667 2.505142 0.1147803
[2,] 0.6389477 -0.7382726 0.2911044 2.615165 0.6750667 2.505142 0.1147803
         [,15]    [,16]      [,17]      [,18]    [,19]      [,20]     [,21]
[1,] 0.4006374 0.346881 -0.9748033 0.04241504 0.163502 -0.1994543 0.6240715
[2,] 0.4006374 0.346881 -0.9748033 0.04241504 0.163502 -0.1994543 0.6240715
         [,22]      [,23]      [,24]     [,25]     [,26]    [,27]    [,28]
[1,] 0.5781083 -0.2095604 -0.6268002 0.8319779 0.9668741 1.448558 1.758226
[2,] 0.5781083 -0.2095604 -0.6268002 0.8319779 0.9668741 1.448558 1.758226
        [,29]      [,30]    [,31]     [,32]     [,33]      [,34]    [,35]
[1,] 0.602315 -0.9917887 2.887543 -1.201166 -0.782925 -0.4785465 2.047615
[2,] 0.602315 -0.9917887 2.887543 -1.201166 -0.782925 -0.4785465 2.047615
         [,36]    [,37]    [,38]     [,39]     [,40]      [,41]     [,42]
[1,] 0.6130309 1.112658 1.058064 -1.171678 -1.388606 -0.6608134 -2.285073
[2,] 0.6130309 1.112658 1.058064 -1.171678 -1.388606 -0.6608134 -2.285073
         [,43]      [,44]    [,45]     [,46]      [,47]      [,48]      [,49]
[1,] -1.030166 -0.6574217 -1.34912 -1.170148 -0.1497529 -0.2349823 0.07741177
[2,] -1.030166 -0.6574217 -1.34912 -1.170148 -0.1497529 -0.2349823 0.07741177
         [,50]     [,51]    [,52]    [,53]      [,54]     [,55]     [,56]
[1,] -1.168069 0.1446091 1.539105 1.151609 -0.2685108 0.7154162 0.5814094
[2,] -1.168069 0.1446091 1.539105 1.151609 -0.2685108 0.7154162 0.5814094
        [,57]      [,58]      [,59]      [,60]     [,61]     [,62]     [,63]
[1,] 1.061869 -0.6480437 -0.3074133 -0.7182847 -1.253745 -1.531296 0.3500188
[2,] 1.061869 -0.6480437 -0.3074133 -0.7182847 -1.253745 -1.531296 0.3500188
         [,64]     [,65]     [,66]     [,67]     [,68]      [,69]     [,70]
[1,] 0.1042059 -1.286829 0.1193226 0.6895322 -1.091956 -0.1547794 0.2208107
[2,] 0.1042059 -1.286829 0.1193226 0.6895322 -1.091956 -0.1547794 0.2208107
         [,71]     [,72]      [,73]     [,74]       [,75]      [,76]    [,77]
[1,] -1.198458 0.9045837 -0.1941163 -1.523749 -0.06765243 -0.5559175 1.199404
[2,] -1.198458 0.9045837 -0.1941163 -1.523749 -0.06765243 -0.5559175 1.199404
         [,78]        [,79]      [,80]     [,81]     [,82]     [,83]     [,84]
[1,] 0.9374424 -0.002425137 -0.1851546 0.4439505 0.5036739 0.8830968 0.4913153
[2,] 0.9374424 -0.002425137 -0.1851546 0.4439505 0.5036739 0.8830968 0.4913153
        [,85]     [,86]   [,87]      [,88]    [,89]      [,90]    [,91]
[1,] 1.296849 0.8452173 0.86885 -0.1257139 1.358555 -0.2446719 1.287724
[2,] 1.296849 0.8452173 0.86885 -0.1257139 1.358555 -0.2446719 1.287724
         [,92]    [,93]     [,94]    [,95]      [,96]     [,97]     [,98]
[1,] 0.6052516 0.723388 0.1103683 0.398745 -0.7021997 -1.032372 0.4575899
[2,] 0.6052516 0.723388 0.1103683 0.398745 -0.7021997 -1.032372 0.4575899
          [,99]   [,100]
[1,] -0.7746945 0.750523
[2,] -0.7746945 0.750523
> 
> 
> Max(tmp2)
[1] 2.061708
> Min(tmp2)
[1] -2.133412
> mean(tmp2)
[1] 0.1186413
> Sum(tmp2)
[1] 11.86413
> Var(tmp2)
[1] 0.7002096
> 
> rowMeans(tmp2)
  [1] -0.605379661  1.531790476 -1.065998412 -0.618913125 -0.690966203
  [6] -0.010985123  0.641965864  1.596894674  1.567884306  0.275857922
 [11]  1.149523017  0.008332727 -0.310157781 -2.133411628 -0.320447151
 [16]  1.373971928 -0.013304162  0.408860129  0.629978946 -0.229712881
 [21]  1.055897504  0.745750894  0.406057725  1.227202723 -0.329962956
 [26]  1.207992289 -0.550242089  0.378006414  0.437507706  0.603126810
 [31]  2.061707790  0.304953806 -0.222740973  1.027408021  0.685771393
 [36]  0.393146557 -0.472758354 -0.062191082  1.864923852 -1.225432982
 [41] -1.025422484  1.277201782 -0.340200222 -0.511398681 -0.182879855
 [46]  1.079783711 -0.192877268  0.153356878  0.860704434  0.742508186
 [51]  0.170571948 -1.439949158  0.200194305 -0.037948602 -0.050073408
 [56] -0.495462819  0.702490625  1.027227222 -1.423489526 -0.795312614
 [61]  0.818598251  0.432189052 -0.087461861  0.751833370  0.657135234
 [66]  0.860464837  1.116784279 -0.846491782 -0.328129509 -0.410107190
 [71]  0.617955923  2.001889987 -0.001576154  0.566555802 -0.879198151
 [76] -0.193561258 -0.077824694  0.212707809  0.226952778 -0.202282392
 [81] -0.804984877  0.476117893 -0.200731851  0.970510598 -0.791750930
 [86] -1.338912807 -0.031396503 -1.060186914 -0.443398380 -0.631185680
 [91] -0.934662233  0.354846005 -0.180769326  0.762506305 -0.639314655
 [96] -1.180391551 -1.301516802 -0.073573582  0.334052469  0.901508039
> rowSums(tmp2)
  [1] -0.605379661  1.531790476 -1.065998412 -0.618913125 -0.690966203
  [6] -0.010985123  0.641965864  1.596894674  1.567884306  0.275857922
 [11]  1.149523017  0.008332727 -0.310157781 -2.133411628 -0.320447151
 [16]  1.373971928 -0.013304162  0.408860129  0.629978946 -0.229712881
 [21]  1.055897504  0.745750894  0.406057725  1.227202723 -0.329962956
 [26]  1.207992289 -0.550242089  0.378006414  0.437507706  0.603126810
 [31]  2.061707790  0.304953806 -0.222740973  1.027408021  0.685771393
 [36]  0.393146557 -0.472758354 -0.062191082  1.864923852 -1.225432982
 [41] -1.025422484  1.277201782 -0.340200222 -0.511398681 -0.182879855
 [46]  1.079783711 -0.192877268  0.153356878  0.860704434  0.742508186
 [51]  0.170571948 -1.439949158  0.200194305 -0.037948602 -0.050073408
 [56] -0.495462819  0.702490625  1.027227222 -1.423489526 -0.795312614
 [61]  0.818598251  0.432189052 -0.087461861  0.751833370  0.657135234
 [66]  0.860464837  1.116784279 -0.846491782 -0.328129509 -0.410107190
 [71]  0.617955923  2.001889987 -0.001576154  0.566555802 -0.879198151
 [76] -0.193561258 -0.077824694  0.212707809  0.226952778 -0.202282392
 [81] -0.804984877  0.476117893 -0.200731851  0.970510598 -0.791750930
 [86] -1.338912807 -0.031396503 -1.060186914 -0.443398380 -0.631185680
 [91] -0.934662233  0.354846005 -0.180769326  0.762506305 -0.639314655
 [96] -1.180391551 -1.301516802 -0.073573582  0.334052469  0.901508039
> 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.605379661  1.531790476 -1.065998412 -0.618913125 -0.690966203
  [6] -0.010985123  0.641965864  1.596894674  1.567884306  0.275857922
 [11]  1.149523017  0.008332727 -0.310157781 -2.133411628 -0.320447151
 [16]  1.373971928 -0.013304162  0.408860129  0.629978946 -0.229712881
 [21]  1.055897504  0.745750894  0.406057725  1.227202723 -0.329962956
 [26]  1.207992289 -0.550242089  0.378006414  0.437507706  0.603126810
 [31]  2.061707790  0.304953806 -0.222740973  1.027408021  0.685771393
 [36]  0.393146557 -0.472758354 -0.062191082  1.864923852 -1.225432982
 [41] -1.025422484  1.277201782 -0.340200222 -0.511398681 -0.182879855
 [46]  1.079783711 -0.192877268  0.153356878  0.860704434  0.742508186
 [51]  0.170571948 -1.439949158  0.200194305 -0.037948602 -0.050073408
 [56] -0.495462819  0.702490625  1.027227222 -1.423489526 -0.795312614
 [61]  0.818598251  0.432189052 -0.087461861  0.751833370  0.657135234
 [66]  0.860464837  1.116784279 -0.846491782 -0.328129509 -0.410107190
 [71]  0.617955923  2.001889987 -0.001576154  0.566555802 -0.879198151
 [76] -0.193561258 -0.077824694  0.212707809  0.226952778 -0.202282392
 [81] -0.804984877  0.476117893 -0.200731851  0.970510598 -0.791750930
 [86] -1.338912807 -0.031396503 -1.060186914 -0.443398380 -0.631185680
 [91] -0.934662233  0.354846005 -0.180769326  0.762506305 -0.639314655
 [96] -1.180391551 -1.301516802 -0.073573582  0.334052469  0.901508039
> rowMin(tmp2)
  [1] -0.605379661  1.531790476 -1.065998412 -0.618913125 -0.690966203
  [6] -0.010985123  0.641965864  1.596894674  1.567884306  0.275857922
 [11]  1.149523017  0.008332727 -0.310157781 -2.133411628 -0.320447151
 [16]  1.373971928 -0.013304162  0.408860129  0.629978946 -0.229712881
 [21]  1.055897504  0.745750894  0.406057725  1.227202723 -0.329962956
 [26]  1.207992289 -0.550242089  0.378006414  0.437507706  0.603126810
 [31]  2.061707790  0.304953806 -0.222740973  1.027408021  0.685771393
 [36]  0.393146557 -0.472758354 -0.062191082  1.864923852 -1.225432982
 [41] -1.025422484  1.277201782 -0.340200222 -0.511398681 -0.182879855
 [46]  1.079783711 -0.192877268  0.153356878  0.860704434  0.742508186
 [51]  0.170571948 -1.439949158  0.200194305 -0.037948602 -0.050073408
 [56] -0.495462819  0.702490625  1.027227222 -1.423489526 -0.795312614
 [61]  0.818598251  0.432189052 -0.087461861  0.751833370  0.657135234
 [66]  0.860464837  1.116784279 -0.846491782 -0.328129509 -0.410107190
 [71]  0.617955923  2.001889987 -0.001576154  0.566555802 -0.879198151
 [76] -0.193561258 -0.077824694  0.212707809  0.226952778 -0.202282392
 [81] -0.804984877  0.476117893 -0.200731851  0.970510598 -0.791750930
 [86] -1.338912807 -0.031396503 -1.060186914 -0.443398380 -0.631185680
 [91] -0.934662233  0.354846005 -0.180769326  0.762506305 -0.639314655
 [96] -1.180391551 -1.301516802 -0.073573582  0.334052469  0.901508039
> 
> colMeans(tmp2)
[1] 0.1186413
> colSums(tmp2)
[1] 11.86413
> colVars(tmp2)
[1] 0.7002096
> colSd(tmp2)
[1] 0.8367853
> colMax(tmp2)
[1] 2.061708
> colMin(tmp2)
[1] -2.133412
> colMedians(tmp2)
[1] 0.003378286
> colRanges(tmp2)
          [,1]
[1,] -2.133412
[2,]  2.061708
> 
> 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]  7.2307017  3.0807664  0.5253806  0.4106639  0.6308787 -0.7791799
 [7] -1.1069119  3.0875435 -4.1376771 -2.2572177
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5827802
[2,] -0.1133872
[3,]  0.5929798
[4,]  1.5366609
[5,]  2.3055448
> 
> rowApply(tmp,sum)
 [1] -2.7588435  1.2588117 -1.4720886 -0.9360767  1.6154836  0.2317657
 [7]  4.2164043  4.1941493 -2.2059805  2.5413229
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    9    4    7    3   10    6   10    5     8
 [2,]    9    5    3    5    2    9    2    9   10     6
 [3,]    2   10    2    9    7    1    9    6    4     1
 [4,]    7    4    1    8    1    4    8    2    9     3
 [5,]    1    8    9   10    4    5    5    4    6     4
 [6,]    4    6    7    6   10    2    3    5    8     5
 [7,]    5    2    5    4    8    3   10    1    7     7
 [8,]    8    7   10    3    6    6    7    3    2    10
 [9,]    6    1    8    1    5    8    1    7    3     2
[10,]    3    3    6    2    9    7    4    8    1     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.2633094 -0.3012067  0.5508365  0.7720495  3.4174177 -2.9845468
 [7] -4.3445365  1.4427816 -2.7378124  1.4263597 -3.1508865 -7.1083621
[13] -0.5280676  0.7106564  1.3765935  1.0834805 -0.2509902  1.2537584
[19] -2.0807218  3.4696051
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.9355377
[2,] -0.1695661
[3,]  1.0613373
[4,]  1.0928154
[5,]  1.2142605
> 
> rowApply(tmp,sum)
[1] -5.7286513 -5.0850063  4.0163916  0.4607873 -0.3838035
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   20   18    5   19    2
[2,]   12    9   15   14    4
[3,]   14    3   18   17   11
[4,]    4   19   13   10   10
[5,]   15   11   20   12   17
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]        [,4]      [,5]       [,6]
[1,]  1.2142605 -0.09220211  0.1609905 -1.44487593 0.2414451 -0.2828047
[2,]  1.0928154 -0.40001727 -2.0116801  1.46675931 0.3742038 -2.8201823
[3,] -0.1695661  0.87456692  1.4145054  0.65595573 1.4643398  0.1497394
[4,]  1.0613373  0.35042534  0.7635086 -0.04298621 0.2258345  0.3747983
[5,] -1.9355377 -1.03397958  0.2235120  0.13719663 1.1115945 -0.4060974
           [,7]       [,8]       [,9]       [,10]      [,11]      [,12]
[1,] -1.7269148  0.5911341 -1.5184293 -0.68305821 -0.4040700 -1.7240553
[2,] -3.2789180 -0.5662343  0.9552475  0.88556691 -0.6624272 -1.8192286
[3,] -0.4986562  1.0752729 -3.2458274 -0.08566694  0.3749995  0.1977111
[4,] -0.3317040 -0.1311845 -0.1243794  2.58454540 -1.4352278 -1.3813066
[5,]  1.4916565  0.4737934  1.1955762 -1.27502741 -1.0241609 -2.3814827
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.0886108 -0.7322663  0.7530428 -0.3369404  0.4887897 -0.4035919
[2,] -0.7802281 -0.2495761  1.5797414  0.5101667 -1.4489263  0.6156890
[3,] -1.0215499  0.4025271  0.6833945  0.1553142  0.2714313  1.0405538
[4,]  0.2765838  0.4636992 -1.2478004 -0.3629191  0.8892752 -0.4437714
[5,]  1.0857373  0.8262725 -0.3917848  1.1178592 -0.4515600  0.4448789
           [,19]     [,20]
[1,] -0.30315264 0.5626584
[2,]  0.56502832 0.9071936
[3,] -1.16011117 1.4374577
[4,] -1.19871703 0.1707762
[5,]  0.01623071 0.3915192
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1      col2     col3     col4     col5      col6     col7
row1 0.8503656 -1.787638 0.940756 2.186234 -1.26966 0.7745708 1.329328
          col8     col9      col10      col11     col12     col13      col14
row1 0.4238545 1.580338 -0.9747466 -0.4516687 -1.377427 0.6268011 -0.7003601
        col15     col16      col17     col18      col19     col20
row1 1.636702 -1.038976 -0.7928074 0.7545784 -0.2348011 -1.313894
> tmp[,"col10"]
             col10
row1 -0.9747466276
row2  1.1768536530
row3 -1.6823864231
row4  0.4057081522
row5 -0.0008126538
> tmp[c("row1","row5"),]
           col1      col2      col3       col4       col5       col6
row1  0.8503656 -1.787638 0.9407560  2.1862336 -1.2696600  0.7745708
row5 -0.6933485  1.071072 0.9352095 -0.6451465 -0.2130844 -0.6701839
             col7      col8      col9         col10      col11      col12
row1  1.329328114 0.4238545 1.5803376 -0.9747466276 -0.4516687 -1.3774272
row5 -0.001675233 1.5704435 0.2755013 -0.0008126538 -0.4601658  0.3083077
         col13      col14      col15      col16      col17      col18
row1 0.6268011 -0.7003601  1.6367024 -1.0389757 -0.7928074  0.7545784
row5 0.4842319 -0.8994918 -0.7898023  0.2062669 -1.6831287 -2.2970426
          col19     col20
row1 -0.2348011 -1.313894
row5  0.8840135 -0.369560
> tmp[,c("col6","col20")]
           col6      col20
row1  0.7745708 -1.3138937
row2  1.3867736 -1.1751959
row3  0.3890033  0.0245813
row4  0.3870297 -0.4540795
row5 -0.6701839 -0.3695600
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1  0.7745708 -1.313894
row5 -0.6701839 -0.369560
> 
> 
> 
> 
> 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.40622 49.03584 51.20676 51.63985 49.1199 106.1931 50.70948 49.12844
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.76734 49.21596 50.13806 49.70726 51.38096 48.08093 49.08826 48.01451
        col17    col18   col19    col20
row1 51.67946 51.41372 50.7262 104.0004
> tmp[,"col10"]
        col10
row1 49.21596
row2 29.91228
row3 30.37618
row4 30.12032
row5 50.59811
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.40622 49.03584 51.20676 51.63985 49.11990 106.1931 50.70948 49.12844
row5 48.95367 51.21245 50.98417 47.97335 51.00655 105.6546 48.33789 51.48843
         col9    col10    col11    col12    col13    col14    col15    col16
row1 51.76734 49.21596 50.13806 49.70726 51.38096 48.08093 49.08826 48.01451
row5 49.84572 50.59811 50.38167 49.21888 49.57702 48.50145 50.48224 52.05815
        col17    col18    col19    col20
row1 51.67946 51.41372 50.72620 104.0004
row5 50.29719 49.70840 49.45121 105.8984
> tmp[,c("col6","col20")]
          col6     col20
row1 106.19306 104.00037
row2  74.13486  75.15710
row3  73.47964  75.52248
row4  76.16459  75.21023
row5 105.65456 105.89843
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.1931 104.0004
row5 105.6546 105.8984
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.1931 104.0004
row5 105.6546 105.8984
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.18602013
[2,] -1.91496721
[3,] -0.12206840
[4,] -0.82558970
[5,] -0.08567774
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.47027653  1.0050633
[2,]  0.15538172  1.3327516
[3,]  0.34073915 -0.3722245
[4,] -0.02660086  0.1686633
[5,] -0.77345595  0.5665408
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  1.0339654 -0.13036944
[2,] -2.3962841  1.14875643
[3,] -0.2025788 -2.48000312
[4,] -0.1552965 -0.00996902
[5,]  0.7182685 -1.35935662
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.033965
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  1.033965
[2,] -2.396284
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]      [,3]      [,4]        [,5]      [,6]       [,7]
row3 -1.065587  0.9982733 -1.524015 -1.558117 -0.02249198 0.4766977 -0.8035386
row1 -1.363569 -0.1544663  3.391661 -1.192833  1.65699402 2.1196755  0.2554167
           [,8]        [,9]      [,10]      [,11]      [,12]      [,13]
row3 -0.4390252 -0.33984633 -0.5857292 -0.1011810  1.3363336  0.5070140
row1 -0.2530786  0.08925593 -2.4447546  0.2646574 -0.9319915 -0.5455165
           [,14]      [,15]      [,16]      [,17]      [,18]      [,19]
row3 -0.04948217 0.07405512 -0.3694576  0.7692787 -1.4742816 -0.7321573
row1 -0.50943813 1.53559962 -1.5377590 -0.4427053 -0.9687827 -1.3140749
          [,20]
row3 -0.3835946
row1  0.5154656
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
row2 0.3578411 -0.9544651 0.9544915 -1.164507 -1.075623 -1.310243 -1.037037
          [,8]     [,9]      [,10]
row2 0.6275664 -0.91839 -0.8520303
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]       [,2]       [,3]      [,4]      [,5]      [,6]       [,7]
row5 -0.1622139 -0.7591248 -0.4187867 0.4294059 0.1057996 0.6013375 -0.2994925
           [,8]      [,9]     [,10]     [,11]      [,12]      [,13]     [,14]
row5 -0.6068181 0.5462259 0.3240565 -2.771292 -0.3308855 -0.1703817 0.8124224
         [,15]      [,16]     [,17]     [,18]      [,19]      [,20]
row5 0.1778124 -0.2812867 0.9151213 0.6191916 -0.5679633 -0.5325774
> 
> 
> 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: 0x5c503901fd00>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf4bd19533"
 [2] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf15a7c8f3"
 [3] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf7c040da0"
 [4] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf53e45418"
 [5] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf7857fea6"
 [6] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbfcc08f2f" 
 [7] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf13972824"
 [8] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf2d2818fb"
 [9] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbfb36c0d9" 
[10] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf18f37095"
[11] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf176fe856"
[12] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf7a917064"
[13] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf3aeb20cc"
[14] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf29a3b089"
[15] "/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM3e4dbf3c647b1" 
> 
> 
> ### 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: 0x5c503ac2f590>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5c503ac2f590>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5c503ac2f590>
> rowMedians(tmp)
  [1] -4.010938e-01  8.551505e-02 -2.905283e-01 -5.463203e-02 -2.327237e-05
  [6]  4.241552e-01  1.694057e-01  3.384005e-01  2.558867e-01 -5.960455e-02
 [11] -8.150417e-01 -2.832887e-01 -1.172762e-01 -9.001785e-02  2.085079e-01
 [16]  1.008477e-01  2.801890e-03 -1.608720e-01  2.844474e-01  3.587008e-01
 [21] -8.317003e-02  1.320591e-01  1.010310e-01  2.503078e-01 -3.323978e-01
 [26]  7.611929e-01  5.428992e-01  1.895317e-01  3.280698e-01 -2.386377e-02
 [31]  3.775758e-01 -6.806250e-02  1.515677e-01 -9.911303e-02  1.899370e-01
 [36]  1.819786e-01  3.148271e-01  1.996219e-01  3.969295e-01  4.724296e-01
 [41] -7.221478e-02  1.969170e-01 -1.024307e-01 -2.912803e-02 -1.038516e-01
 [46] -4.585851e-01 -1.488757e-02  2.349692e-01 -3.464195e-01 -2.646989e-01
 [51]  4.220980e-02  1.698630e-01 -3.322866e-01 -4.912664e-02 -3.360612e-02
 [56] -1.697819e-01  5.695489e-01 -3.199639e-01 -4.124194e-01 -2.155456e-01
 [61]  6.403701e-01 -2.826663e-01 -1.669265e-02 -3.223320e-01 -1.663576e-01
 [66]  7.709717e-02 -5.849957e-02  7.346021e-01  2.450080e-01  5.204609e-01
 [71]  2.869129e-01  5.455059e-01  5.053877e-01  2.434890e-02 -2.239655e-01
 [76]  1.411729e-02  2.252136e-01  2.757241e-01 -1.237382e-01 -6.945315e-01
 [81] -1.073511e-01 -2.678453e-01  2.261477e-01 -6.814845e-02  2.693793e-01
 [86]  1.264965e-01 -1.032554e-01  1.766258e-01 -5.895937e-01  9.979072e-02
 [91] -2.598949e-01  1.843678e-01 -5.975202e-02 -2.895220e-01  3.502584e-01
 [96]  1.325646e-01  5.269453e-01 -3.259724e-02  2.821467e-02 -4.266106e-02
[101] -2.972306e-02  2.651578e-01  2.207353e-01  4.785252e-02  4.027994e-02
[106]  2.053455e-01  1.888693e-01  3.698790e-02 -8.362602e-01  9.188662e-02
[111] -1.657834e-01 -2.264967e-02  1.025962e-01  6.856258e-04 -2.435947e-01
[116]  1.059579e-01  1.336473e-01  3.114273e-01 -5.363717e-01 -4.614945e-01
[121]  1.009254e-01  1.204509e-01 -8.818174e-02 -4.723045e-01  2.514461e-01
[126] -1.434495e-01 -4.753293e-01 -5.916437e-02  1.067383e-02  3.974910e-01
[131]  1.295305e-01 -2.385305e-01 -4.177788e-01  3.406265e-02  3.660318e-02
[136] -4.842477e-02 -4.155593e-01 -1.989939e-02  2.569405e-01 -3.130523e-01
[141]  9.323408e-02  2.084527e-01 -1.600961e-01  7.656064e-02  1.153657e-01
[146]  3.785566e-01  7.264393e-02 -2.406474e-01  7.540045e-02 -7.494578e-01
[151] -5.892214e-02  6.177350e-01 -1.377880e-01 -6.083680e-01 -8.325561e-01
[156]  1.804643e-01  2.406505e-01  7.581869e-02  5.094488e-02 -2.921009e-02
[161] -1.342052e-01 -1.073307e-01  7.844601e-01 -1.399277e-01  2.352758e-02
[166] -4.960915e-01  3.520659e-01  2.535274e-01 -3.933660e-01 -1.273133e-01
[171] -9.470026e-02 -4.383564e-01 -7.693840e-02 -5.213159e-01  7.021200e-01
[176]  9.280741e-02 -1.362078e-01  6.104906e-02  2.160743e-01 -1.117221e-01
[181] -7.731032e-02  6.922255e-01 -7.160785e-01 -3.240346e-01  2.056605e-01
[186]  5.692878e-01 -2.763958e-01  3.692559e-02 -1.456260e-01 -1.315742e-01
[191] -8.466832e-03  1.663017e-01  6.004229e-01  2.636883e-01 -3.024246e-01
[196] -8.079969e-02  3.147986e-01  4.769968e-01 -8.658511e-03 -1.985938e-01
[201] -1.058648e+00 -1.571185e-01 -2.377304e-01  1.346189e-01  2.707888e-01
[206] -1.893968e-01  2.572818e-01 -1.519056e-01  1.626036e-01  1.196811e-01
[211] -3.525008e-01  2.469563e-01 -2.131038e-01 -9.853459e-02  2.652209e-01
[216] -1.638029e-01  2.095755e-01 -1.795591e-01 -1.755161e-01 -2.433528e-01
[221]  3.107393e-01 -3.393739e-01 -2.720777e-01  5.731336e-01 -3.052328e-01
[226] -1.652557e-01 -1.065246e-02  4.646363e-01  5.011253e-02  1.848324e-01
> 
> proc.time()
   user  system elapsed 
  1.238   0.670   1.894 

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: 0x63dfbed1eac0>
> .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: 0x63dfbed1eac0>
> .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: 0x63dfbed1eac0>
> .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: 0x63dfbed1eac0>
> 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: 0x63dfbed212a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63dfbed212a0>
> .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: 0x63dfbed212a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63dfbed212a0>
> .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: 0x63dfbed212a0>
> 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: 0x63dfbe398920>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63dfbe398920>
> .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: 0x63dfbe398920>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x63dfbe398920>
> .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: 0x63dfbe398920>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x63dfbe398920>
> .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: 0x63dfbe398920>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x63dfbe398920>
> .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: 0x63dfbe398920>
> 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: 0x63dfbed26d80>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x63dfbed26d80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63dfbed26d80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63dfbed26d80>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3e4ea02b52af94" "BufferedMatrixFile3e4ea02b9ffd06"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3e4ea02b52af94" "BufferedMatrixFile3e4ea02b9ffd06"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x63dfbf4e3040>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63dfbf4e3040>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x63dfbf4e3040>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x63dfbf4e3040>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x63dfbf4e3040>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x63dfbf4e3040>
> .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: 0x63dfbee821d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63dfbee821d0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x63dfbee821d0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x63dfbee821d0>
> 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: 0x63dfbda9fba0>
> .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: 0x63dfbda9fba0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.247   0.045   0.279 

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.234   0.041   0.264 

Example timings