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

This page was generated on 2024-10-18 20:38 -0400 (Fri, 18 Oct 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4763
palomino7Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4500
merida1macOS 12.7.5 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4530
kjohnson1macOS 13.6.6 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4480
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 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-10-16 14:00 -0400 (Wed, 16 Oct 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino7Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
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


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

Package: BufferedMatrix
Version: 1.68.0
Command: /home/biocbuild/bbs-3.19-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.19-bioc/R/site-library --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-10-16 22:20:28 -0400 (Wed, 16 Oct 2024)
EndedAt: 2024-10-16 22:20:53 -0400 (Wed, 16 Oct 2024)
EllapsedTime: 25.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
    GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
* running under: Ubuntu 22.04.5 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.68.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 11.4.0-1ubuntu1~22.04) 11.4.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.19-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.19-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
gcc -I"/home/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.19-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){
      |       ^~~~~~~~~~~~~~~~~~~
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.19-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.19-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.19-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.19-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.19-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.1 (2024-06-14) -- "Race for Your Life"
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.26    0.04    0.29 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
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.19-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 471777 25.2    1026220 54.9   643428 34.4
Vcells 871900  6.7    8388608 64.0  2046605 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] "Wed Oct 16 22:20:44 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Oct 16 22:20:44 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5652dcf85cf0>
> 
> 
> 
> 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] "Wed Oct 16 22:20:45 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Wed Oct 16 22:20:45 2024"
> 
> ColMode(tmp2)
<pointer: 0x5652dcf85cf0>
> 
> 
> 
> ### 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,] 98.754843150 -0.004131181 -0.1284168 -0.6250934
[2,]  0.766854610  0.896309467 -1.0662713  1.0029597
[3,]  2.971546370 -0.806087007 -0.6708548  0.5392746
[4,]  0.006536991 -0.071377521 -1.4272806 -0.3504208
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-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,] 98.754843150 0.004131181 0.1284168 0.6250934
[2,]  0.766854610 0.896309467 1.0662713 1.0029597
[3,]  2.971546370 0.806087007 0.6708548 0.5392746
[4,]  0.006536991 0.071377521 1.4272806 0.3504208
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-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,] 9.93754714 0.06427426 0.3583528 0.7906285
[2,] 0.87570235 0.94673622 1.0326042 1.0014788
[3,] 1.72381738 0.89782348 0.8190573 0.7343532
[4,] 0.08085166 0.26716572 1.1946885 0.5919635
> 
> 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.19-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,] 223.13031 25.64687 28.71195 33.53138
[2,]  34.52388 35.36367 36.39231 36.01775
[3,]  45.20972 34.78432 33.86143 32.88281
[4,]  25.81505 27.74303 38.37417 31.27006
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5652ddaf96b0>
> exp(tmp5)
<pointer: 0x5652ddaf96b0>
> log(tmp5,2)
<pointer: 0x5652ddaf96b0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.4165
> Min(tmp5)
[1] 52.92613
> mean(tmp5)
[1] 72.34008
> Sum(tmp5)
[1] 14468.02
> Var(tmp5)
[1] 850.934
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.96652 71.56855 72.63304 69.86684 70.30198 68.12556 69.69544 70.81716
 [9] 71.27259 69.15311
> rowSums(tmp5)
 [1] 1799.330 1431.371 1452.661 1397.337 1406.040 1362.511 1393.909 1416.343
 [9] 1425.452 1383.062
> rowVars(tmp5)
 [1] 7851.27386   50.84147   84.65633  103.18521   82.34008   67.39545
 [7]   78.11126   80.10712   62.49532   73.04471
> rowSd(tmp5)
 [1] 88.607414  7.130321  9.200887 10.158012  9.074143  8.209473  8.838057
 [8]  8.950258  7.905398  8.546620
> rowMax(tmp5)
 [1] 464.41652  88.03581  94.09811  85.79966  91.10992  93.74589  82.13813
 [8]  85.40878  86.83178  84.36115
> rowMin(tmp5)
 [1] 53.38061 59.81065 58.36527 53.73065 55.08304 55.79687 53.38350 53.85365
 [9] 59.15484 52.92613
> 
> colMeans(tmp5)
 [1] 108.17224  67.84096  72.12534  68.79589  66.32393  64.50497  68.62618
 [8]  73.83265  73.13322  71.92781  64.44139  73.48782  71.02012  77.58740
[15]  70.56023  73.11756  72.06033  69.45706  68.47187  71.31461
> colSums(tmp5)
 [1] 1081.7224  678.4096  721.2534  687.9589  663.2393  645.0497  686.2618
 [8]  738.3265  731.3322  719.2781  644.4139  734.8782  710.2012  775.8740
[15]  705.6023  731.1756  720.6033  694.5706  684.7187  713.1461
> colVars(tmp5)
 [1] 15805.54467    58.43755    78.79338    30.64499   105.85948    61.98488
 [7]    67.86991    59.28139    54.38109    47.58794    55.92814    91.25252
[13]    89.61484    84.54622    74.76204    70.00027    60.98527    40.18765
[19]    90.92668    61.66688
> colSd(tmp5)
 [1] 125.720104   7.644446   8.876564   5.535792  10.288804   7.873048
 [7]   8.238319   7.699441   7.374353   6.898401   7.478512   9.552619
[13]   9.466512   9.194902   8.646505   8.366616   7.809307   6.339373
[19]   9.535548   7.852826
> colMax(tmp5)
 [1] 464.41652  78.74507  86.83178  79.39682  85.40878  81.60699  79.53155
 [8]  82.95994  91.10992  85.79966  80.86467  92.86918  84.09716  93.74589
[15]  83.30950  88.03581  84.36115  76.64812  83.17025  82.13813
> colMin(tmp5)
 [1] 53.73065 53.38061 59.76015 60.26642 52.92613 55.08304 58.39271 64.22114
 [9] 65.39334 61.79032 53.85365 61.86195 53.94517 63.22983 59.15484 59.90709
[17] 60.64067 56.71365 55.79687 59.81065
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1]       NA 71.56855 72.63304 69.86684 70.30198 68.12556 69.69544 70.81716
 [9] 71.27259 69.15311
> rowSums(tmp5)
 [1]       NA 1431.371 1452.661 1397.337 1406.040 1362.511 1393.909 1416.343
 [9] 1425.452 1383.062
> rowVars(tmp5)
 [1] 8252.43899   50.84147   84.65633  103.18521   82.34008   67.39545
 [7]   78.11126   80.10712   62.49532   73.04471
> rowSd(tmp5)
 [1] 90.842936  7.130321  9.200887 10.158012  9.074143  8.209473  8.838057
 [8]  8.950258  7.905398  8.546620
> rowMax(tmp5)
 [1]       NA 88.03581 94.09811 85.79966 91.10992 93.74589 82.13813 85.40878
 [9] 86.83178 84.36115
> rowMin(tmp5)
 [1]       NA 59.81065 58.36527 53.73065 55.08304 55.79687 53.38350 53.85365
 [9] 59.15484 52.92613
> 
> colMeans(tmp5)
 [1] 108.17224  67.84096  72.12534  68.79589  66.32393        NA  68.62618
 [8]  73.83265  73.13322  71.92781  64.44139  73.48782  71.02012  77.58740
[15]  70.56023  73.11756  72.06033  69.45706  68.47187  71.31461
> colSums(tmp5)
 [1] 1081.7224  678.4096  721.2534  687.9589  663.2393        NA  686.2618
 [8]  738.3265  731.3322  719.2781  644.4139  734.8782  710.2012  775.8740
[15]  705.6023  731.1756  720.6033  694.5706  684.7187  713.1461
> colVars(tmp5)
 [1] 15805.54467    58.43755    78.79338    30.64499   105.85948          NA
 [7]    67.86991    59.28139    54.38109    47.58794    55.92814    91.25252
[13]    89.61484    84.54622    74.76204    70.00027    60.98527    40.18765
[19]    90.92668    61.66688
> colSd(tmp5)
 [1] 125.720104   7.644446   8.876564   5.535792  10.288804         NA
 [7]   8.238319   7.699441   7.374353   6.898401   7.478512   9.552619
[13]   9.466512   9.194902   8.646505   8.366616   7.809307   6.339373
[19]   9.535548   7.852826
> colMax(tmp5)
 [1] 464.41652  78.74507  86.83178  79.39682  85.40878        NA  79.53155
 [8]  82.95994  91.10992  85.79966  80.86467  92.86918  84.09716  93.74589
[15]  83.30950  88.03581  84.36115  76.64812  83.17025  82.13813
> colMin(tmp5)
 [1] 53.73065 53.38061 59.76015 60.26642 52.92613       NA 58.39271 64.22114
 [9] 65.39334 61.79032 53.85365 61.86195 53.94517 63.22983 59.15484 59.90709
[17] 60.64067 56.71365 55.79687 59.81065
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.4165
> Min(tmp5,na.rm=TRUE)
[1] 52.92613
> mean(tmp5,na.rm=TRUE)
[1] 72.37447
> Sum(tmp5,na.rm=TRUE)
[1] 14402.52
> Var(tmp5,na.rm=TRUE)
[1] 854.9939
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.25442 71.56855 72.63304 69.86684 70.30198 68.12556 69.69544 70.81716
 [9] 71.27259 69.15311
> rowSums(tmp5,na.rm=TRUE)
 [1] 1733.834 1431.371 1452.661 1397.337 1406.040 1362.511 1393.909 1416.343
 [9] 1425.452 1383.062
> rowVars(tmp5,na.rm=TRUE)
 [1] 8252.43899   50.84147   84.65633  103.18521   82.34008   67.39545
 [7]   78.11126   80.10712   62.49532   73.04471
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.842936  7.130321  9.200887 10.158012  9.074143  8.209473  8.838057
 [8]  8.950258  7.905398  8.546620
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.41652  88.03581  94.09811  85.79966  91.10992  93.74589  82.13813
 [8]  85.40878  86.83178  84.36115
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.38061 59.81065 58.36527 53.73065 55.08304 55.79687 53.38350 53.85365
 [9] 59.15484 52.92613
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.17224  67.84096  72.12534  68.79589  66.32393  64.39481  68.62618
 [8]  73.83265  73.13322  71.92781  64.44139  73.48782  71.02012  77.58740
[15]  70.56023  73.11756  72.06033  69.45706  68.47187  71.31461
> colSums(tmp5,na.rm=TRUE)
 [1] 1081.7224  678.4096  721.2534  687.9589  663.2393  579.5533  686.2618
 [8]  738.3265  731.3322  719.2781  644.4139  734.8782  710.2012  775.8740
[15]  705.6023  731.1756  720.6033  694.5706  684.7187  713.1461
> colVars(tmp5,na.rm=TRUE)
 [1] 15805.54467    58.43755    78.79338    30.64499   105.85948    69.59647
 [7]    67.86991    59.28139    54.38109    47.58794    55.92814    91.25252
[13]    89.61484    84.54622    74.76204    70.00027    60.98527    40.18765
[19]    90.92668    61.66688
> colSd(tmp5,na.rm=TRUE)
 [1] 125.720104   7.644446   8.876564   5.535792  10.288804   8.342450
 [7]   8.238319   7.699441   7.374353   6.898401   7.478512   9.552619
[13]   9.466512   9.194902   8.646505   8.366616   7.809307   6.339373
[19]   9.535548   7.852826
> colMax(tmp5,na.rm=TRUE)
 [1] 464.41652  78.74507  86.83178  79.39682  85.40878  81.60699  79.53155
 [8]  82.95994  91.10992  85.79966  80.86467  92.86918  84.09716  93.74589
[15]  83.30950  88.03581  84.36115  76.64812  83.17025  82.13813
> colMin(tmp5,na.rm=TRUE)
 [1] 53.73065 53.38061 59.76015 60.26642 52.92613 55.08304 58.39271 64.22114
 [9] 65.39334 61.79032 53.85365 61.86195 53.94517 63.22983 59.15484 59.90709
[17] 60.64067 56.71365 55.79687 59.81065
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 71.56855 72.63304 69.86684 70.30198 68.12556 69.69544 70.81716
 [9] 71.27259 69.15311
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1431.371 1452.661 1397.337 1406.040 1362.511 1393.909 1416.343
 [9] 1425.452 1383.062
> rowVars(tmp5,na.rm=TRUE)
 [1]        NA  50.84147  84.65633 103.18521  82.34008  67.39545  78.11126
 [8]  80.10712  62.49532  73.04471
> rowSd(tmp5,na.rm=TRUE)
 [1]        NA  7.130321  9.200887 10.158012  9.074143  8.209473  8.838057
 [8]  8.950258  7.905398  8.546620
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 88.03581 94.09811 85.79966 91.10992 93.74589 82.13813 85.40878
 [9] 86.83178 84.36115
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 59.81065 58.36527 53.73065 55.08304 55.79687 53.38350 53.85365
 [9] 59.15484 52.92613
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 68.58954 69.44766 73.49925 68.68530 66.60979      NaN 67.60267 73.17011
 [9] 73.10989 72.55484 62.61658 71.33433 71.68864 79.18268 71.30913 73.42283
[17] 72.14485 68.98480 69.13240 70.15160
> colSums(tmp5,na.rm=TRUE)
 [1] 617.3059 625.0290 661.4932 618.1677 599.4881   0.0000 608.4241 658.5310
 [9] 657.9890 652.9936 563.5492 642.0090 645.1977 712.6441 641.7822 660.8054
[17] 649.3037 620.8632 622.1916 631.3644
> colVars(tmp5,na.rm=TRUE)
 [1] 154.85098  36.70033  67.40674  34.33803 118.17260        NA  64.56842
 [8]  61.75326  61.17260  49.11329  25.45747  50.48725  95.78890  66.48397
[15]  77.79772  77.70193  68.52807  42.70202  97.38413  54.15878
> colSd(tmp5,na.rm=TRUE)
 [1] 12.443913  6.058080  8.210161  5.859866 10.870722        NA  8.035448
 [8]  7.858324  7.821291  7.008087  5.045540  7.105438  9.787181  8.153770
[15]  8.820302  8.814870  8.278168  6.534678  9.868340  7.359265
> colMax(tmp5,na.rm=TRUE)
 [1] 94.09811 78.74507 86.83178 79.39682 85.40878     -Inf 79.53155 82.95994
 [9] 91.10992 85.79966 69.56284 80.49050 84.09716 93.74589 83.30950 88.03581
[17] 84.36115 76.64812 83.17025 82.13813
> colMin(tmp5,na.rm=TRUE)
 [1] 53.73065 57.74349 61.57854 60.26642 52.92613      Inf 58.39271 64.22114
 [9] 65.39334 61.79032 53.85365 61.86195 53.94517 68.77121 59.15484 59.90709
[17] 60.64067 56.71365 55.79687 59.81065
> 
> 
> 
> 
> 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] 140.28672 131.60137  98.30434 193.32450 286.75342 145.21457 235.56647
 [8] 175.64144 205.12564 296.22873
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 140.28672 131.60137  98.30434 193.32450 286.75342 145.21457 235.56647
 [8] 175.64144 205.12564 296.22873
> 
> 
> 
> 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] -7.105427e-14 -1.705303e-13  1.705303e-13 -9.947598e-14  1.421085e-14
 [6]  2.842171e-14 -5.684342e-14  5.684342e-14  1.278977e-13 -2.842171e-14
[11] -5.684342e-14 -5.684342e-14  2.842171e-13  1.705303e-13  8.526513e-14
[16] -4.263256e-14  2.842171e-13  5.684342e-14 -1.421085e-13  8.526513e-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 
9   2 
2   10 
7   14 
2   7 
7   17 
6   1 
6   1 
3   3 
4   13 
9   4 
9   14 
6   11 
1   12 
5   13 
4   10 
3   2 
2   1 
3   13 
1   2 
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.507631
> Min(tmp)
[1] -2.408682
> mean(tmp)
[1] -0.1080915
> Sum(tmp)
[1] -10.80915
> Var(tmp)
[1] 0.7972646
> 
> rowMeans(tmp)
[1] -0.1080915
> rowSums(tmp)
[1] -10.80915
> rowVars(tmp)
[1] 0.7972646
> rowSd(tmp)
[1] 0.8928968
> rowMax(tmp)
[1] 2.507631
> rowMin(tmp)
[1] -2.408682
> 
> colMeans(tmp)
  [1]  0.12995907 -0.67916838  0.66968703 -0.33846554 -0.48410472 -0.32334708
  [7] -0.02317957  1.08145994 -0.97322064 -1.51396548  0.97978487  1.14690495
 [13] -1.31813753  0.07978224 -0.16886183 -1.11168893 -0.32618353 -0.45026464
 [19] -0.32531797  0.48464221 -0.27881775 -0.72030113 -0.67542440 -2.24786373
 [25] -0.69137850  0.03753405 -1.16435919 -0.90522815 -1.08024333 -0.04432012
 [31] -0.50004548 -0.56305731  0.04327686 -0.34858467 -0.53770716 -0.77518975
 [37]  2.04683022 -1.39694367 -1.15425023  0.46154725  0.27603814  0.03576238
 [43]  0.78326785 -0.23206599  0.95383093 -0.33490080 -1.80307191 -0.70421739
 [49]  0.42282285  2.50763071 -1.49404873  0.80721604 -0.29999736 -0.04384469
 [55]  0.19364501 -0.49555162 -0.29139581  0.06644511  0.27012162 -0.14525448
 [61]  0.51175676 -1.14241350 -0.14926765 -0.68988057  0.01410715  1.58818879
 [67] -0.22986226  0.12909042  1.14226222 -0.57841171 -2.40868219 -0.01363911
 [73] -0.19399593  0.57211478  1.52899358  0.98129821  1.46609096 -0.82412760
 [79]  0.40366057 -0.37183479 -0.85586864  0.24547951 -0.51524360  0.29375345
 [85]  0.42019864  0.20788839  1.20401509  0.23908471  0.12428160 -0.51366089
 [91]  0.87053874  1.43802490 -0.87366048  0.41196899 -1.37341750 -0.31997666
 [97] -1.13730927  0.91185762  1.46466303 -1.30143659
> colSums(tmp)
  [1]  0.12995907 -0.67916838  0.66968703 -0.33846554 -0.48410472 -0.32334708
  [7] -0.02317957  1.08145994 -0.97322064 -1.51396548  0.97978487  1.14690495
 [13] -1.31813753  0.07978224 -0.16886183 -1.11168893 -0.32618353 -0.45026464
 [19] -0.32531797  0.48464221 -0.27881775 -0.72030113 -0.67542440 -2.24786373
 [25] -0.69137850  0.03753405 -1.16435919 -0.90522815 -1.08024333 -0.04432012
 [31] -0.50004548 -0.56305731  0.04327686 -0.34858467 -0.53770716 -0.77518975
 [37]  2.04683022 -1.39694367 -1.15425023  0.46154725  0.27603814  0.03576238
 [43]  0.78326785 -0.23206599  0.95383093 -0.33490080 -1.80307191 -0.70421739
 [49]  0.42282285  2.50763071 -1.49404873  0.80721604 -0.29999736 -0.04384469
 [55]  0.19364501 -0.49555162 -0.29139581  0.06644511  0.27012162 -0.14525448
 [61]  0.51175676 -1.14241350 -0.14926765 -0.68988057  0.01410715  1.58818879
 [67] -0.22986226  0.12909042  1.14226222 -0.57841171 -2.40868219 -0.01363911
 [73] -0.19399593  0.57211478  1.52899358  0.98129821  1.46609096 -0.82412760
 [79]  0.40366057 -0.37183479 -0.85586864  0.24547951 -0.51524360  0.29375345
 [85]  0.42019864  0.20788839  1.20401509  0.23908471  0.12428160 -0.51366089
 [91]  0.87053874  1.43802490 -0.87366048  0.41196899 -1.37341750 -0.31997666
 [97] -1.13730927  0.91185762  1.46466303 -1.30143659
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.12995907 -0.67916838  0.66968703 -0.33846554 -0.48410472 -0.32334708
  [7] -0.02317957  1.08145994 -0.97322064 -1.51396548  0.97978487  1.14690495
 [13] -1.31813753  0.07978224 -0.16886183 -1.11168893 -0.32618353 -0.45026464
 [19] -0.32531797  0.48464221 -0.27881775 -0.72030113 -0.67542440 -2.24786373
 [25] -0.69137850  0.03753405 -1.16435919 -0.90522815 -1.08024333 -0.04432012
 [31] -0.50004548 -0.56305731  0.04327686 -0.34858467 -0.53770716 -0.77518975
 [37]  2.04683022 -1.39694367 -1.15425023  0.46154725  0.27603814  0.03576238
 [43]  0.78326785 -0.23206599  0.95383093 -0.33490080 -1.80307191 -0.70421739
 [49]  0.42282285  2.50763071 -1.49404873  0.80721604 -0.29999736 -0.04384469
 [55]  0.19364501 -0.49555162 -0.29139581  0.06644511  0.27012162 -0.14525448
 [61]  0.51175676 -1.14241350 -0.14926765 -0.68988057  0.01410715  1.58818879
 [67] -0.22986226  0.12909042  1.14226222 -0.57841171 -2.40868219 -0.01363911
 [73] -0.19399593  0.57211478  1.52899358  0.98129821  1.46609096 -0.82412760
 [79]  0.40366057 -0.37183479 -0.85586864  0.24547951 -0.51524360  0.29375345
 [85]  0.42019864  0.20788839  1.20401509  0.23908471  0.12428160 -0.51366089
 [91]  0.87053874  1.43802490 -0.87366048  0.41196899 -1.37341750 -0.31997666
 [97] -1.13730927  0.91185762  1.46466303 -1.30143659
> colMin(tmp)
  [1]  0.12995907 -0.67916838  0.66968703 -0.33846554 -0.48410472 -0.32334708
  [7] -0.02317957  1.08145994 -0.97322064 -1.51396548  0.97978487  1.14690495
 [13] -1.31813753  0.07978224 -0.16886183 -1.11168893 -0.32618353 -0.45026464
 [19] -0.32531797  0.48464221 -0.27881775 -0.72030113 -0.67542440 -2.24786373
 [25] -0.69137850  0.03753405 -1.16435919 -0.90522815 -1.08024333 -0.04432012
 [31] -0.50004548 -0.56305731  0.04327686 -0.34858467 -0.53770716 -0.77518975
 [37]  2.04683022 -1.39694367 -1.15425023  0.46154725  0.27603814  0.03576238
 [43]  0.78326785 -0.23206599  0.95383093 -0.33490080 -1.80307191 -0.70421739
 [49]  0.42282285  2.50763071 -1.49404873  0.80721604 -0.29999736 -0.04384469
 [55]  0.19364501 -0.49555162 -0.29139581  0.06644511  0.27012162 -0.14525448
 [61]  0.51175676 -1.14241350 -0.14926765 -0.68988057  0.01410715  1.58818879
 [67] -0.22986226  0.12909042  1.14226222 -0.57841171 -2.40868219 -0.01363911
 [73] -0.19399593  0.57211478  1.52899358  0.98129821  1.46609096 -0.82412760
 [79]  0.40366057 -0.37183479 -0.85586864  0.24547951 -0.51524360  0.29375345
 [85]  0.42019864  0.20788839  1.20401509  0.23908471  0.12428160 -0.51366089
 [91]  0.87053874  1.43802490 -0.87366048  0.41196899 -1.37341750 -0.31997666
 [97] -1.13730927  0.91185762  1.46466303 -1.30143659
> colMedians(tmp)
  [1]  0.12995907 -0.67916838  0.66968703 -0.33846554 -0.48410472 -0.32334708
  [7] -0.02317957  1.08145994 -0.97322064 -1.51396548  0.97978487  1.14690495
 [13] -1.31813753  0.07978224 -0.16886183 -1.11168893 -0.32618353 -0.45026464
 [19] -0.32531797  0.48464221 -0.27881775 -0.72030113 -0.67542440 -2.24786373
 [25] -0.69137850  0.03753405 -1.16435919 -0.90522815 -1.08024333 -0.04432012
 [31] -0.50004548 -0.56305731  0.04327686 -0.34858467 -0.53770716 -0.77518975
 [37]  2.04683022 -1.39694367 -1.15425023  0.46154725  0.27603814  0.03576238
 [43]  0.78326785 -0.23206599  0.95383093 -0.33490080 -1.80307191 -0.70421739
 [49]  0.42282285  2.50763071 -1.49404873  0.80721604 -0.29999736 -0.04384469
 [55]  0.19364501 -0.49555162 -0.29139581  0.06644511  0.27012162 -0.14525448
 [61]  0.51175676 -1.14241350 -0.14926765 -0.68988057  0.01410715  1.58818879
 [67] -0.22986226  0.12909042  1.14226222 -0.57841171 -2.40868219 -0.01363911
 [73] -0.19399593  0.57211478  1.52899358  0.98129821  1.46609096 -0.82412760
 [79]  0.40366057 -0.37183479 -0.85586864  0.24547951 -0.51524360  0.29375345
 [85]  0.42019864  0.20788839  1.20401509  0.23908471  0.12428160 -0.51366089
 [91]  0.87053874  1.43802490 -0.87366048  0.41196899 -1.37341750 -0.31997666
 [97] -1.13730927  0.91185762  1.46466303 -1.30143659
> colRanges(tmp)
          [,1]       [,2]     [,3]       [,4]       [,5]       [,6]        [,7]
[1,] 0.1299591 -0.6791684 0.669687 -0.3384655 -0.4841047 -0.3233471 -0.02317957
[2,] 0.1299591 -0.6791684 0.669687 -0.3384655 -0.4841047 -0.3233471 -0.02317957
        [,8]       [,9]     [,10]     [,11]    [,12]     [,13]      [,14]
[1,] 1.08146 -0.9732206 -1.513965 0.9797849 1.146905 -1.318138 0.07978224
[2,] 1.08146 -0.9732206 -1.513965 0.9797849 1.146905 -1.318138 0.07978224
          [,15]     [,16]      [,17]      [,18]     [,19]     [,20]      [,21]
[1,] -0.1688618 -1.111689 -0.3261835 -0.4502646 -0.325318 0.4846422 -0.2788178
[2,] -0.1688618 -1.111689 -0.3261835 -0.4502646 -0.325318 0.4846422 -0.2788178
          [,22]      [,23]     [,24]      [,25]      [,26]     [,27]      [,28]
[1,] -0.7203011 -0.6754244 -2.247864 -0.6913785 0.03753405 -1.164359 -0.9052282
[2,] -0.7203011 -0.6754244 -2.247864 -0.6913785 0.03753405 -1.164359 -0.9052282
         [,29]       [,30]      [,31]      [,32]      [,33]      [,34]
[1,] -1.080243 -0.04432012 -0.5000455 -0.5630573 0.04327686 -0.3485847
[2,] -1.080243 -0.04432012 -0.5000455 -0.5630573 0.04327686 -0.3485847
          [,35]      [,36]   [,37]     [,38]    [,39]     [,40]     [,41]
[1,] -0.5377072 -0.7751898 2.04683 -1.396944 -1.15425 0.4615472 0.2760381
[2,] -0.5377072 -0.7751898 2.04683 -1.396944 -1.15425 0.4615472 0.2760381
          [,42]     [,43]     [,44]     [,45]      [,46]     [,47]      [,48]
[1,] 0.03576238 0.7832678 -0.232066 0.9538309 -0.3349008 -1.803072 -0.7042174
[2,] 0.03576238 0.7832678 -0.232066 0.9538309 -0.3349008 -1.803072 -0.7042174
         [,49]    [,50]     [,51]    [,52]      [,53]       [,54]    [,55]
[1,] 0.4228229 2.507631 -1.494049 0.807216 -0.2999974 -0.04384469 0.193645
[2,] 0.4228229 2.507631 -1.494049 0.807216 -0.2999974 -0.04384469 0.193645
          [,56]      [,57]      [,58]     [,59]      [,60]     [,61]     [,62]
[1,] -0.4955516 -0.2913958 0.06644511 0.2701216 -0.1452545 0.5117568 -1.142413
[2,] -0.4955516 -0.2913958 0.06644511 0.2701216 -0.1452545 0.5117568 -1.142413
          [,63]      [,64]      [,65]    [,66]      [,67]     [,68]    [,69]
[1,] -0.1492677 -0.6898806 0.01410715 1.588189 -0.2298623 0.1290904 1.142262
[2,] -0.1492677 -0.6898806 0.01410715 1.588189 -0.2298623 0.1290904 1.142262
          [,70]     [,71]       [,72]      [,73]     [,74]    [,75]     [,76]
[1,] -0.5784117 -2.408682 -0.01363911 -0.1939959 0.5721148 1.528994 0.9812982
[2,] -0.5784117 -2.408682 -0.01363911 -0.1939959 0.5721148 1.528994 0.9812982
        [,77]      [,78]     [,79]      [,80]      [,81]     [,82]      [,83]
[1,] 1.466091 -0.8241276 0.4036606 -0.3718348 -0.8558686 0.2454795 -0.5152436
[2,] 1.466091 -0.8241276 0.4036606 -0.3718348 -0.8558686 0.2454795 -0.5152436
         [,84]     [,85]     [,86]    [,87]     [,88]     [,89]      [,90]
[1,] 0.2937534 0.4201986 0.2078884 1.204015 0.2390847 0.1242816 -0.5136609
[2,] 0.2937534 0.4201986 0.2078884 1.204015 0.2390847 0.1242816 -0.5136609
         [,91]    [,92]      [,93]    [,94]     [,95]      [,96]     [,97]
[1,] 0.8705387 1.438025 -0.8736605 0.411969 -1.373417 -0.3199767 -1.137309
[2,] 0.8705387 1.438025 -0.8736605 0.411969 -1.373417 -0.3199767 -1.137309
         [,98]    [,99]    [,100]
[1,] 0.9118576 1.464663 -1.301437
[2,] 0.9118576 1.464663 -1.301437
> 
> 
> Max(tmp2)
[1] 2.828261
> Min(tmp2)
[1] -2.432596
> mean(tmp2)
[1] 0.1595556
> Sum(tmp2)
[1] 15.95556
> Var(tmp2)
[1] 1.12946
> 
> rowMeans(tmp2)
  [1]  0.1700349220  0.6797219060 -1.0949994686  0.5600294658 -0.6739747343
  [6] -0.2065979617 -0.9966688727  0.0657644406  1.3331836535  0.9578170558
 [11] -0.7937018084  0.5419185069  1.7144108097  0.4715056046  0.4252111352
 [16]  1.4126680734  1.1272849008  2.8282607993  0.3852682623 -0.3252659586
 [21]  0.3034225092  0.0731612267 -0.8930439034 -1.2616634225  1.1888209764
 [26] -2.4325960158  1.4437432901  1.3900111291 -0.7887250358 -0.1675721912
 [31] -0.5673192579  0.7054368235 -1.7537013736  0.8804560594 -0.7950824837
 [36]  1.0272176902  2.7810746260  0.4549169168  1.0001777048 -0.1561923851
 [41]  1.1085821979 -0.1686196637  0.4274144440  0.0076171447 -2.0547081340
 [46]  0.1343255385 -0.0870011419  0.4599849332  0.3291138226 -0.0004626236
 [51] -0.3766178023 -0.2439303209 -0.7708521337  0.5857208626 -0.1099632350
 [56] -0.9876278188 -0.7198025556  1.1861414225 -0.7164450520  0.4504266865
 [61]  1.7596657540 -0.9318390836 -0.2893603522  1.7622673020  2.6722386908
 [66] -0.7692949663 -1.9674470797 -1.3034415738  0.9547609646  0.6498810471
 [71]  2.1504930172 -1.9496199133  0.0679832543 -0.8398873106 -0.0929416323
 [76]  0.8110313508 -0.7830007922  0.0121084768 -0.5789882289  1.5508349627
 [81] -0.3846093631  0.6151938877  1.2156294325  0.0429969902  2.3493390811
 [86] -1.3709595018 -1.6099531821  0.3890707077  0.3724178558  0.7025023115
 [91]  0.9813046081  0.0890936403  0.2560189799 -0.7486144349 -0.4647771866
 [96]  0.5287190326  0.1655724176  1.2639759344 -0.2460169667 -0.5444988522
> rowSums(tmp2)
  [1]  0.1700349220  0.6797219060 -1.0949994686  0.5600294658 -0.6739747343
  [6] -0.2065979617 -0.9966688727  0.0657644406  1.3331836535  0.9578170558
 [11] -0.7937018084  0.5419185069  1.7144108097  0.4715056046  0.4252111352
 [16]  1.4126680734  1.1272849008  2.8282607993  0.3852682623 -0.3252659586
 [21]  0.3034225092  0.0731612267 -0.8930439034 -1.2616634225  1.1888209764
 [26] -2.4325960158  1.4437432901  1.3900111291 -0.7887250358 -0.1675721912
 [31] -0.5673192579  0.7054368235 -1.7537013736  0.8804560594 -0.7950824837
 [36]  1.0272176902  2.7810746260  0.4549169168  1.0001777048 -0.1561923851
 [41]  1.1085821979 -0.1686196637  0.4274144440  0.0076171447 -2.0547081340
 [46]  0.1343255385 -0.0870011419  0.4599849332  0.3291138226 -0.0004626236
 [51] -0.3766178023 -0.2439303209 -0.7708521337  0.5857208626 -0.1099632350
 [56] -0.9876278188 -0.7198025556  1.1861414225 -0.7164450520  0.4504266865
 [61]  1.7596657540 -0.9318390836 -0.2893603522  1.7622673020  2.6722386908
 [66] -0.7692949663 -1.9674470797 -1.3034415738  0.9547609646  0.6498810471
 [71]  2.1504930172 -1.9496199133  0.0679832543 -0.8398873106 -0.0929416323
 [76]  0.8110313508 -0.7830007922  0.0121084768 -0.5789882289  1.5508349627
 [81] -0.3846093631  0.6151938877  1.2156294325  0.0429969902  2.3493390811
 [86] -1.3709595018 -1.6099531821  0.3890707077  0.3724178558  0.7025023115
 [91]  0.9813046081  0.0890936403  0.2560189799 -0.7486144349 -0.4647771866
 [96]  0.5287190326  0.1655724176  1.2639759344 -0.2460169667 -0.5444988522
> 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.1700349220  0.6797219060 -1.0949994686  0.5600294658 -0.6739747343
  [6] -0.2065979617 -0.9966688727  0.0657644406  1.3331836535  0.9578170558
 [11] -0.7937018084  0.5419185069  1.7144108097  0.4715056046  0.4252111352
 [16]  1.4126680734  1.1272849008  2.8282607993  0.3852682623 -0.3252659586
 [21]  0.3034225092  0.0731612267 -0.8930439034 -1.2616634225  1.1888209764
 [26] -2.4325960158  1.4437432901  1.3900111291 -0.7887250358 -0.1675721912
 [31] -0.5673192579  0.7054368235 -1.7537013736  0.8804560594 -0.7950824837
 [36]  1.0272176902  2.7810746260  0.4549169168  1.0001777048 -0.1561923851
 [41]  1.1085821979 -0.1686196637  0.4274144440  0.0076171447 -2.0547081340
 [46]  0.1343255385 -0.0870011419  0.4599849332  0.3291138226 -0.0004626236
 [51] -0.3766178023 -0.2439303209 -0.7708521337  0.5857208626 -0.1099632350
 [56] -0.9876278188 -0.7198025556  1.1861414225 -0.7164450520  0.4504266865
 [61]  1.7596657540 -0.9318390836 -0.2893603522  1.7622673020  2.6722386908
 [66] -0.7692949663 -1.9674470797 -1.3034415738  0.9547609646  0.6498810471
 [71]  2.1504930172 -1.9496199133  0.0679832543 -0.8398873106 -0.0929416323
 [76]  0.8110313508 -0.7830007922  0.0121084768 -0.5789882289  1.5508349627
 [81] -0.3846093631  0.6151938877  1.2156294325  0.0429969902  2.3493390811
 [86] -1.3709595018 -1.6099531821  0.3890707077  0.3724178558  0.7025023115
 [91]  0.9813046081  0.0890936403  0.2560189799 -0.7486144349 -0.4647771866
 [96]  0.5287190326  0.1655724176  1.2639759344 -0.2460169667 -0.5444988522
> rowMin(tmp2)
  [1]  0.1700349220  0.6797219060 -1.0949994686  0.5600294658 -0.6739747343
  [6] -0.2065979617 -0.9966688727  0.0657644406  1.3331836535  0.9578170558
 [11] -0.7937018084  0.5419185069  1.7144108097  0.4715056046  0.4252111352
 [16]  1.4126680734  1.1272849008  2.8282607993  0.3852682623 -0.3252659586
 [21]  0.3034225092  0.0731612267 -0.8930439034 -1.2616634225  1.1888209764
 [26] -2.4325960158  1.4437432901  1.3900111291 -0.7887250358 -0.1675721912
 [31] -0.5673192579  0.7054368235 -1.7537013736  0.8804560594 -0.7950824837
 [36]  1.0272176902  2.7810746260  0.4549169168  1.0001777048 -0.1561923851
 [41]  1.1085821979 -0.1686196637  0.4274144440  0.0076171447 -2.0547081340
 [46]  0.1343255385 -0.0870011419  0.4599849332  0.3291138226 -0.0004626236
 [51] -0.3766178023 -0.2439303209 -0.7708521337  0.5857208626 -0.1099632350
 [56] -0.9876278188 -0.7198025556  1.1861414225 -0.7164450520  0.4504266865
 [61]  1.7596657540 -0.9318390836 -0.2893603522  1.7622673020  2.6722386908
 [66] -0.7692949663 -1.9674470797 -1.3034415738  0.9547609646  0.6498810471
 [71]  2.1504930172 -1.9496199133  0.0679832543 -0.8398873106 -0.0929416323
 [76]  0.8110313508 -0.7830007922  0.0121084768 -0.5789882289  1.5508349627
 [81] -0.3846093631  0.6151938877  1.2156294325  0.0429969902  2.3493390811
 [86] -1.3709595018 -1.6099531821  0.3890707077  0.3724178558  0.7025023115
 [91]  0.9813046081  0.0890936403  0.2560189799 -0.7486144349 -0.4647771866
 [96]  0.5287190326  0.1655724176  1.2639759344 -0.2460169667 -0.5444988522
> 
> colMeans(tmp2)
[1] 0.1595556
> colSums(tmp2)
[1] 15.95556
> colVars(tmp2)
[1] 1.12946
> colSd(tmp2)
[1] 1.06276
> colMax(tmp2)
[1] 2.828261
> colMin(tmp2)
[1] -2.432596
> colMedians(tmp2)
[1] 0.1117096
> colRanges(tmp2)
          [,1]
[1,] -2.432596
[2,]  2.828261
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -2.0004692 -5.3560177 -3.5314805  1.3778538  0.5455067  0.9580513
 [7]  4.7842100 -0.1797488 -0.1447351 -1.0225345
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.8761928
[2,] -1.3253743
[3,] -0.1641571
[4,]  0.8916318
[5,]  2.0133997
> 
> rowApply(tmp,sum)
 [1] -0.03619541  0.58782032 -2.20332988 -0.84998921  0.29692578 -2.28742530
 [7]  0.92084070 -0.12341715  2.48658289 -3.36117667
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    6    2   10    1    9    5    8     7
 [2,]    2    1    4    6    3    2    6    8    9     2
 [3,]    7    8    1    5    4    5    2    1    6     8
 [4,]   10    7    3    7    8    3    4    9    3     5
 [5,]    6    5    9    3    2   10    1   10    7     3
 [6,]    5   10    5    8    5    7   10    2    2     4
 [7,]    8    6   10    4    9    8    7    4    4    10
 [8,]    4    4    8   10    6    9    3    3   10     1
 [9,]    9    3    7    9    1    4    8    7    1     6
[10,]    3    9    2    1    7    6    5    6    5     9
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  4.0023108 -2.5731694 -2.0627593 -0.8428720 -2.4033609  0.3093464
 [7] -0.2351272  0.6602134  3.1703607 -0.8629511  0.2173176 -1.2810145
[13] -3.4207629  0.8733247 -0.3885954  0.4970883 -2.6389832 -3.9382325
[19] -4.1562584 -2.7071815
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.88300963
[2,]  0.07380217
[3,]  1.40623499
[4,]  1.44438285
[5,]  1.96090047
> 
> rowApply(tmp,sum)
[1]  -0.4739093  -3.4634299  -1.0503343 -14.2543386   1.4607058
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   19   19   18    7   11
[2,]    1   14    5    6   15
[3,]   18   15   15    3    1
[4,]   20    1    3   14   10
[5,]    2    3    7   19    9
> 
> 
> as.matrix(tmp)
            [,1]        [,2]       [,3]        [,4]       [,5]        [,6]
[1,]  1.96090047 -1.33814066  1.1773514  1.98469825 -1.1003368 -0.34008093
[2,]  1.44438285  0.08271178  0.2524829 -1.18563367 -1.1302553  0.03500289
[3,]  1.40623499 -0.82453300  0.4733922 -1.05046745 -0.3944083  0.08008849
[4,] -0.88300963 -1.00246245 -1.8101123 -0.56164989  0.3919899  0.08794582
[5,]  0.07380217  0.50925498 -2.1558735 -0.02981928 -0.1703505  0.44639018
            [,7]        [,8]       [,9]      [,10]      [,11]       [,12]
[1,] -0.95036801 -0.54059133  1.1678729 -1.0590412  0.1413488  0.90716326
[2,]  0.77097344  0.89944925  1.5787339 -0.9810441  1.2863098 -0.73957935
[3,] -0.09483415  0.75453237 -0.2158967 -0.1229473 -1.7182188 -0.06960514
[4,] -0.78877033  0.09502363  0.8407826 -0.5821237 -0.6278037 -1.05315244
[5,]  0.82787185 -0.54820051 -0.2011319  1.8822052  1.1356814 -0.32584082
          [,13]      [,14]       [,15]      [,16]      [,17]      [,18]
[1,] -0.1477701 -0.4677065 -0.01476138  0.3596520 -0.5126622 -0.3872867
[2,] -1.1564610 -1.0704148  0.04776771 -0.1596011 -0.9377171 -1.1155559
[3,] -1.4272392  1.7638969  1.43520697 -0.5393412  0.6679144 -0.8554400
[4,] -0.8791238 -0.6792511 -0.74237677 -0.3303713 -2.2377761 -1.2042465
[5,]  0.1898311  1.3268002 -1.11443193  1.1667499  0.3812578 -0.3757034
          [,19]       [,20]
[1,] -0.4154018 -0.89874881
[2,] -0.6792036 -0.70577847
[3,] -0.3820340  0.06336456
[4,] -1.9511124 -0.33673808
[5,] -0.7285065 -0.82928070
> 
> 
> 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.19-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.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  653  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.19-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.19-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.7933462 -1.160147 1.376962 0.08661224 0.09485184 0.09536935 0.1119436
          col8        col9     col10     col11       col12     col13
row1 0.3560853 -0.03186981 -1.232879 -1.379584 -0.08938812 0.3287724
           col14     col15     col16      col17     col18      col19      col20
row1 -0.05968532 -1.570688 0.1339185 -0.4166372 -1.828259 -0.2939716 -0.5250622
> tmp[,"col10"]
           col10
row1 -1.23287932
row2  1.15209155
row3 -0.31836432
row4  0.05835846
row5 -0.72787004
> tmp[c("row1","row5"),]
           col1       col2       col3       col4        col5       col6
row1 -0.7933462 -1.1601474  1.3769622 0.08661224  0.09485184 0.09536935
row5  0.3706359  0.4699922 -0.6769299 0.44999690 -0.42774356 1.42487827
           col7      col8        col9     col10     col11       col12
row1  0.1119436 0.3560853 -0.03186981 -1.232879 -1.379584 -0.08938812
row5 -1.0103812 0.3601890 -0.30141937 -0.727870 -1.925472 -0.94953002
          col13       col14      col15     col16      col17       col18
row1  0.3287724 -0.05968532 -1.5706883 0.1339185 -0.4166372 -1.82825932
row5 -0.7394413 -0.57958571  0.2674258 0.1961408 -0.6341131  0.09230714
          col19       col20
row1 -0.2939716 -0.52506220
row5 -0.7907981  0.03960612
> tmp[,c("col6","col20")]
            col6       col20
row1  0.09536935 -0.52506220
row2 -1.22129003  0.63785054
row3 -0.70915656 -0.29173348
row4 -1.72065601 -0.55030924
row5  1.42487827  0.03960612
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 0.09536935 -0.52506220
row5 1.42487827  0.03960612
> 
> 
> 
> 
> 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.21431 50.57282 49.68405 48.74238 49.35988 104.6118 49.17585 50.93406
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.52928 50.96787 50.20845 48.64611 50.10321 49.53237 50.08738 49.96261
        col17   col18    col19    col20
row1 49.43375 49.3544 50.27169 105.6224
> tmp[,"col10"]
        col10
row1 50.96787
row2 31.26059
row3 30.35724
row4 29.71934
row5 51.09524
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.21431 50.57282 49.68405 48.74238 49.35988 104.6118 49.17585 50.93406
row5 49.43351 49.23085 50.44764 50.50431 47.77362 104.5019 49.53203 50.38405
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.52928 50.96787 50.20845 48.64611 50.10321 49.53237 50.08738 49.96261
row5 48.45097 51.09524 49.66677 49.49868 52.18649 51.53729 49.58456 50.87310
        col17    col18    col19    col20
row1 49.43375 49.35440 50.27169 105.6224
row5 48.93733 50.73972 52.21699 104.0029
> tmp[,c("col6","col20")]
          col6     col20
row1 104.61178 105.62241
row2  75.44911  75.77429
row3  73.17448  75.17952
row4  76.41944  74.33323
row5 104.50189 104.00292
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.6118 105.6224
row5 104.5019 104.0029
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.6118 105.6224
row5 104.5019 104.0029
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.02974676
[2,] -0.63061516
[3,]  0.53998154
[4,] -2.06379655
[5,] -0.77942784
> tmp[,c("col17","col7")]
          col17        col7
[1,]  1.1967871  0.27028781
[2,]  0.8879811  0.47450854
[3,]  1.2506085 -0.08124487
[4,]  1.7618275  0.21689917
[5,] -0.6046136 -0.14221095
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.7170574  1.35994844
[2,] -1.7150700 -0.03452054
[3,]  1.2165463  0.23057768
[4,]  0.1513032  0.98944498
[5,] -0.9853831  0.73775871
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.7170574
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.7170574
[2,] -1.7150700
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]         [,2]     [,3]       [,4]       [,5]       [,6]
row3 -1.16234365  0.229149280 0.040932 -0.3580857  0.3902886  1.2710014
row1 -0.04823673 -0.005090696 1.244706 -0.7152081 -0.7621566 -0.4787983
           [,7]       [,8]         [,9]      [,10]      [,11]      [,12]
row3 -0.3955556  0.3830004  1.415159751  0.8101845 -0.4332915 -0.4985282
row1 -0.3924950 -0.3726731 -0.009061709 -0.3235513 -1.6008033  1.1963555
          [,13]     [,14]      [,15]     [,16]     [,17]      [,18]       [,19]
row3 -0.9259803 1.4857537 -0.2837887 0.5696379 2.5011682 -1.5258512 -0.08806507
row1  1.2665258 0.1617868 -0.8403796 0.6147062 0.4937702  0.4176482 -0.64489531
         [,20]
row3 0.7123177
row1 2.7867420
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]      [,4]      [,5]       [,6]      [,7]
row2 0.5332893 -0.575057 0.8014793 0.3740107 -1.905966 -0.5568741 0.7860431
         [,8]      [,9]     [,10]
row2 0.490838 0.5511697 0.3855568
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]      [,3]      [,4]     [,5]      [,6]      [,7]
row5 -0.9313837 0.7523543 -1.428357 0.7066759 1.434311 0.4009558 0.2363123
          [,8]       [,9]     [,10]      [,11]      [,12]      [,13]     [,14]
row5 -1.408126 -0.3711474 0.2274043 -0.6008721 0.09666331 -0.5555333 -1.245055
         [,15]      [,16]       [,17]      [,18]      [,19]   [,20]
row5 0.6555165 -0.4350096 -0.07219527 -0.2741097 -0.9259217 1.00769
> 
> 
> 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: 0x5652dcae0de0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a710b843a"
 [2] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7ac033ac4" 
 [3] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7ac39e82"  
 [4] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a2ce8ae61"
 [5] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a543c67bb"
 [6] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a492e0994"
 [7] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a172ec0b1"
 [8] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a53f43f1f"
 [9] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a63d20cb9"
[10] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a2eb06fed"
[11] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a66e5350f"
[12] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a3445a34f"
[13] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a7c844d41"
[14] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a6ee453c2"
[15] "/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests/BM1edc7a3744cf70"
> 
> 
> ### 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: 0x5652de7b1920>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5652de7b1920>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5652de7b1920>
> rowMedians(tmp)
  [1]  0.612697783  0.289056864 -0.230789023  0.215073107  0.630618765
  [6]  0.110987449  0.184644017  0.335489160 -0.243337023 -0.003949911
 [11] -0.335502130  0.051073461 -0.265658003  0.018266299  0.175925799
 [16]  0.384080545  0.327927639  0.078004674 -0.384942836  0.104122581
 [21] -0.283560016  0.723567327 -0.217347335  0.142022083 -0.631540616
 [26] -0.044784231 -0.254698434  0.183695301  0.324392783  0.527055776
 [31]  0.579684967 -0.010009610  0.145801791  0.188858633 -0.160346746
 [36]  0.384536871 -0.170069715 -0.006192938 -0.763734851  0.559279776
 [41]  0.050715586 -0.387395690  0.188951913  0.047484155 -0.229369478
 [46] -0.056832237 -0.115123894  0.009764451 -0.223531093 -0.115978652
 [51] -0.480339384 -0.313303507  0.395547958 -0.116399818 -0.260347976
 [56] -0.134588375  0.471058280  0.094045438  0.027513957  0.253169087
 [61]  0.063756204 -0.184407509 -0.191945403 -0.326544253  0.008639577
 [66] -0.050673376  0.022700683  0.367560231 -0.002470200 -0.369807150
 [71] -0.058306360 -0.011049817  0.456485619  0.030072205 -0.270487083
 [76]  0.272879004  0.325452439 -0.160200470  0.208471801 -0.110750645
 [81] -0.078711245  0.160578514 -0.228227637  0.156345518 -0.532065109
 [86] -0.516822619 -0.275585920  0.521092917 -0.045782860  0.062899567
 [91]  0.034292549  0.063786496 -0.374046735  0.330064772  0.558509196
 [96]  0.136180328  0.669301501 -0.123769131  0.109402463 -0.200192242
[101]  0.623175158  0.326874136 -0.010369822 -0.404381033  0.739080753
[106] -0.332778732  0.067557583  0.195992977  0.435204826 -0.480909844
[111] -0.610706376  0.317743163 -0.522007626 -0.679358846  0.008437299
[116]  0.145179263 -0.536601749  0.744682531 -0.011088652  0.165151681
[121] -0.333465760 -0.045240256  0.144469227 -0.195232412 -0.411772013
[126] -0.098280797 -0.446039588 -0.290470299 -0.095490366 -0.568767540
[131] -0.058257601 -0.234042014 -0.025095340 -0.350705417  0.152164788
[136]  0.061627287  0.464012451 -0.263687894  0.069249489 -0.187886992
[141] -0.166802277 -0.034217029 -0.057559447 -0.338205696  0.305897921
[146]  0.127222730 -0.458345501  0.518637941 -0.362652829  0.231530189
[151]  0.291141058 -0.243134068  0.714407834  0.137159281 -0.072271093
[156]  0.149841272 -0.211622283  0.633556678  0.563451179  0.054324685
[161]  0.662715783 -0.253411830  0.482934890 -0.344193241 -0.048563584
[166]  0.248118768 -0.108855440  0.390031791 -0.139627889  0.206124844
[171]  0.437002372  0.068465234 -0.951216951  0.222246213 -0.079009852
[176]  0.460486757  0.690865768 -0.097774267 -0.304692244 -0.014278545
[181]  0.327237649 -0.017882686 -0.235864591 -0.288941078  0.556534623
[186] -1.070515917 -0.122783950  0.049617078  0.034346421 -0.070227091
[191]  0.208281353  0.171355841 -0.264674420  0.047790632 -0.198935366
[196]  0.488812367 -0.053510212 -0.215917569 -0.377117214 -0.761068167
[201]  0.366160210 -0.573481615  0.147961054  0.057332907 -0.123638320
[206] -0.296306184  0.388745731  0.030675077  0.005921264 -0.253329260
[211]  0.022066288  0.237174036 -0.530420306  0.251509937  0.804538295
[216] -0.113599144  0.052159102  0.131077649 -0.124912784 -0.545229783
[221]  0.395569323 -0.034904834  0.827187455 -0.255920170  0.076921925
[226]  0.449689650  0.474800572 -0.155678621 -0.186867087  0.141551407
> 
> proc.time()
   user  system elapsed 
  1.543   1.783   3.324 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
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: 0x55a6e553af20>
> .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: 0x55a6e553af20>
> .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: 0x55a6e553af20>
> .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: 0x55a6e553af20>
> 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: 0x55a6e69c01f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55a6e69c01f0>
> .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: 0x55a6e69c01f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55a6e69c01f0>
> .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: 0x55a6e69c01f0>
> 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: 0x55a6e6a0b5a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55a6e6a0b5a0>
> .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: 0x55a6e6a0b5a0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55a6e6a0b5a0>
> .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: 0x55a6e6a0b5a0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x55a6e6a0b5a0>
> .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: 0x55a6e6a0b5a0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x55a6e6a0b5a0>
> .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: 0x55a6e6a0b5a0>
> 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: 0x55a6e63aab60>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x55a6e63aab60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55a6e63aab60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55a6e63aab60>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1eecf1179c1080" "BufferedMatrixFile1eecf12c79033c"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1eecf1179c1080" "BufferedMatrixFile1eecf12c79033c"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x55a6e6255440>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55a6e6255440>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55a6e6255440>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55a6e6255440>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x55a6e6255440>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x55a6e6255440>
> .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: 0x55a6e55d57e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55a6e55d57e0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55a6e55d57e0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x55a6e55d57e0>
> 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: 0x55a6e5639fc0>
> .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: 0x55a6e5639fc0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.273   0.041   0.303 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.1 (2024-06-14) -- "Race for Your Life"
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.272   0.024   0.285 

Example timings