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

This page was generated on 2025-01-24 11:38 -0500 (Fri, 24 Jan 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 24.04.1 LTS)x86_64R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" 4609
palomino7Windows Server 2022 Datacenterx64R Under development (unstable) (2025-01-21 r87610 ucrt) -- "Unsuffered Consequences" 4393
lconwaymacOS 12.7.1 Montereyx86_64R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" 3839
kjohnson3macOS 13.7.1 Venturaarm64R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" 3835
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch64R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" 4408
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

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


CHECK results for BufferedMatrix on nebbiolo1

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

raw results


Summary

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

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-01-20 r87609)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.1 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.71.1’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.21-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.71.1’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -I"/home/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -I"/home/biocbuild/bbs-3.21-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -c init_package.c -o init_package.o
gcc -shared -L/home/biocbuild/bbs-3.21-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.21-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.21-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences"
Copyright (C) 2025 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.250   0.048   0.286 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 477782 25.6    1045192 55.9   639797 34.2
Vcells 884184  6.8    8388608 64.0  2080672 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Jan 23 20:26:59 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Jan 23 20:26:59 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x62d356b84280>
> 
> 
> 
> 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] "Thu Jan 23 20:26:59 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Jan 23 20:26:59 2025"
> 
> ColMode(tmp2)
<pointer: 0x62d356b84280>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]         [,2]       [,3]        [,4]
[1,] 101.1706505 -0.001170347 -2.0431785 -0.65862078
[2,]   0.8445786 -0.063629845 -0.2563640 -0.29327945
[3,]  -2.2947118  0.183580202 -0.2181165 -0.07431373
[4,]   0.1993860 -0.399687672  0.4362038  0.62015909
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
            [,1]        [,2]      [,3]       [,4]
[1,] 101.1706505 0.001170347 2.0431785 0.65862078
[2,]   0.8445786 0.063629845 0.2563640 0.29327945
[3,]   2.2947118 0.183580202 0.2181165 0.07431373
[4,]   0.1993860 0.399687672 0.4362038 0.62015909
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]      [,4]
[1,] 10.0583622 0.03421034 1.4293979 0.8115545
[2,]  0.9190096 0.25224957 0.5063240 0.5415528
[3,]  1.5148306 0.42846260 0.4670295 0.2726054
[4,]  0.4465266 0.63220857 0.6604573 0.7875018
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 226.75427 25.34327 41.33716 33.77417
[2,]  35.03467 27.58613 30.31960 30.70881
[3,]  42.44302 29.46821 29.88841 27.80037
[4,]  29.66465 31.72177 32.04078 33.49518
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x62d358f95fb0>
> exp(tmp5)
<pointer: 0x62d358f95fb0>
> log(tmp5,2)
<pointer: 0x62d358f95fb0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.9593
> Min(tmp5)
[1] 52.7487
> mean(tmp5)
[1] 72.59
> Sum(tmp5)
[1] 14518
> Var(tmp5)
[1] 880.5874
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 90.81295 71.83784 68.24603 68.74024 71.91654 69.54272 72.96641 69.37362
 [9] 74.12509 68.33851
> rowSums(tmp5)
 [1] 1816.259 1436.757 1364.921 1374.805 1438.331 1390.854 1459.328 1387.472
 [9] 1482.502 1366.770
> rowVars(tmp5)
 [1] 8121.25158  106.34455   71.60970   92.95915   70.96070   57.42180
 [7]   84.19532   68.92393   69.55649   51.36054
> rowSd(tmp5)
 [1] 90.117987 10.312349  8.462252  9.641533  8.423818  7.577717  9.175801
 [8]  8.302044  8.340053  7.166627
> rowMax(tmp5)
 [1] 471.95931 100.62083  88.33958  93.35890  89.13110  89.91149  92.25763
 [8]  81.97779  88.90148  79.79442
> rowMin(tmp5)
 [1] 52.74870 56.24880 56.47228 52.78851 58.77093 59.40291 58.41723 57.27684
 [9] 54.00555 55.90261
> 
> colMeans(tmp5)
 [1] 110.89705  64.32449  68.92547  69.70453  67.46374  71.36802  68.91360
 [8]  67.09545  72.19708  71.68248  72.09096  73.21898  73.68474  72.25743
[15]  72.88624  67.83319  71.95399  70.57795  72.04770  72.67680
> colSums(tmp5)
 [1] 1108.9705  643.2449  689.2547  697.0453  674.6374  713.6802  689.1360
 [8]  670.9545  721.9708  716.8248  720.9096  732.1898  736.8474  722.5743
[15]  728.8624  678.3319  719.5399  705.7795  720.4770  726.7680
> colVars(tmp5)
 [1] 16177.76621    58.64112    72.28885    59.35228    41.45678    17.69744
 [7]    66.97689    44.82826    40.73786    96.67316    96.62267   142.67094
[13]   127.79674    74.72084   172.45906    50.45006   113.25837    56.28041
[19]    81.37085    34.95884
> colSd(tmp5)
 [1] 127.191848   7.657749   8.502285   7.704043   6.438694   4.206833
 [7]   8.183941   6.695391   6.382621   9.832251   9.829683  11.944494
[13]  11.304722   8.644122  13.132367   7.102820  10.642292   7.502027
[19]   9.020579   5.912600
> colMax(tmp5)
 [1] 471.95931  77.12011  86.03788  79.79998  79.48980  76.48049  83.97997
 [8]  79.81357  81.46937  89.13110  89.91149  92.25763  90.18241  88.90148
[15] 100.62083  78.18837  93.35890  83.39654  85.01698  79.79442
> colMin(tmp5)
 [1] 59.40291 52.74870 59.83310 57.86282 56.24880 64.67058 58.25396 59.80714
 [9] 63.10979 54.00555 52.78851 57.84031 58.77093 61.49419 56.79805 55.90261
[17] 59.41333 57.27684 56.47228 60.69642
> 
> 
> ### 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] 90.81295 71.83784 68.24603       NA 71.91654 69.54272 72.96641 69.37362
 [9] 74.12509 68.33851
> rowSums(tmp5)
 [1] 1816.259 1436.757 1364.921       NA 1438.331 1390.854 1459.328 1387.472
 [9] 1482.502 1366.770
> rowVars(tmp5)
 [1] 8121.25158  106.34455   71.60970   93.45687   70.96070   57.42180
 [7]   84.19532   68.92393   69.55649   51.36054
> rowSd(tmp5)
 [1] 90.117987 10.312349  8.462252  9.667309  8.423818  7.577717  9.175801
 [8]  8.302044  8.340053  7.166627
> rowMax(tmp5)
 [1] 471.95931 100.62083  88.33958        NA  89.13110  89.91149  92.25763
 [8]  81.97779  88.90148  79.79442
> rowMin(tmp5)
 [1] 52.74870 56.24880 56.47228       NA 58.77093 59.40291 58.41723 57.27684
 [9] 54.00555 55.90261
> 
> colMeans(tmp5)
 [1] 110.89705  64.32449  68.92547  69.70453  67.46374  71.36802  68.91360
 [8]        NA  72.19708  71.68248  72.09096  73.21898  73.68474  72.25743
[15]  72.88624  67.83319  71.95399  70.57795  72.04770  72.67680
> colSums(tmp5)
 [1] 1108.9705  643.2449  689.2547  697.0453  674.6374  713.6802  689.1360
 [8]        NA  721.9708  716.8248  720.9096  732.1898  736.8474  722.5743
[15]  728.8624  678.3319  719.5399  705.7795  720.4770  726.7680
> colVars(tmp5)
 [1] 16177.76621    58.64112    72.28885    59.35228    41.45678    17.69744
 [7]    66.97689          NA    40.73786    96.67316    96.62267   142.67094
[13]   127.79674    74.72084   172.45906    50.45006   113.25837    56.28041
[19]    81.37085    34.95884
> colSd(tmp5)
 [1] 127.191848   7.657749   8.502285   7.704043   6.438694   4.206833
 [7]   8.183941         NA   6.382621   9.832251   9.829683  11.944494
[13]  11.304722   8.644122  13.132367   7.102820  10.642292   7.502027
[19]   9.020579   5.912600
> colMax(tmp5)
 [1] 471.95931  77.12011  86.03788  79.79998  79.48980  76.48049  83.97997
 [8]        NA  81.46937  89.13110  89.91149  92.25763  90.18241  88.90148
[15] 100.62083  78.18837  93.35890  83.39654  85.01698  79.79442
> colMin(tmp5)
 [1] 59.40291 52.74870 59.83310 57.86282 56.24880 64.67058 58.25396       NA
 [9] 63.10979 54.00555 52.78851 57.84031 58.77093 61.49419 56.79805 55.90261
[17] 59.41333 57.27684 56.47228 60.69642
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.9593
> Min(tmp5,na.rm=TRUE)
[1] 52.7487
> mean(tmp5,na.rm=TRUE)
[1] 72.65423
> Sum(tmp5,na.rm=TRUE)
[1] 14458.19
> Var(tmp5,na.rm=TRUE)
[1] 884.2054
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.81295 71.83784 68.24603 69.21040 71.91654 69.54272 72.96641 69.37362
 [9] 74.12509 68.33851
> rowSums(tmp5,na.rm=TRUE)
 [1] 1816.259 1436.757 1364.921 1314.998 1438.331 1390.854 1459.328 1387.472
 [9] 1482.502 1366.770
> rowVars(tmp5,na.rm=TRUE)
 [1] 8121.25158  106.34455   71.60970   93.45687   70.96070   57.42180
 [7]   84.19532   68.92393   69.55649   51.36054
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.117987 10.312349  8.462252  9.667309  8.423818  7.577717  9.175801
 [8]  8.302044  8.340053  7.166627
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.95931 100.62083  88.33958  93.35890  89.13110  89.91149  92.25763
 [8]  81.97779  88.90148  79.79442
> rowMin(tmp5,na.rm=TRUE)
 [1] 52.74870 56.24880 56.47228 52.78851 58.77093 59.40291 58.41723 57.27684
 [9] 54.00555 55.90261
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.89705  64.32449  68.92547  69.70453  67.46374  71.36802  68.91360
 [8]  67.90527  72.19708  71.68248  72.09096  73.21898  73.68474  72.25743
[15]  72.88624  67.83319  71.95399  70.57795  72.04770  72.67680
> colSums(tmp5,na.rm=TRUE)
 [1] 1108.9705  643.2449  689.2547  697.0453  674.6374  713.6802  689.1360
 [8]  611.1474  721.9708  716.8248  720.9096  732.1898  736.8474  722.5743
[15]  728.8624  678.3319  719.5399  705.7795  720.4770  726.7680
> colVars(tmp5,na.rm=TRUE)
 [1] 16177.76621    58.64112    72.28885    59.35228    41.45678    17.69744
 [7]    66.97689    43.05409    40.73786    96.67316    96.62267   142.67094
[13]   127.79674    74.72084   172.45906    50.45006   113.25837    56.28041
[19]    81.37085    34.95884
> colSd(tmp5,na.rm=TRUE)
 [1] 127.191848   7.657749   8.502285   7.704043   6.438694   4.206833
 [7]   8.183941   6.561562   6.382621   9.832251   9.829683  11.944494
[13]  11.304722   8.644122  13.132367   7.102820  10.642292   7.502027
[19]   9.020579   5.912600
> colMax(tmp5,na.rm=TRUE)
 [1] 471.95931  77.12011  86.03788  79.79998  79.48980  76.48049  83.97997
 [8]  79.81357  81.46937  89.13110  89.91149  92.25763  90.18241  88.90148
[15] 100.62083  78.18837  93.35890  83.39654  85.01698  79.79442
> colMin(tmp5,na.rm=TRUE)
 [1] 59.40291 52.74870 59.83310 57.86282 56.24880 64.67058 58.25396 60.68380
 [9] 63.10979 54.00555 52.78851 57.84031 58.77093 61.49419 56.79805 55.90261
[17] 59.41333 57.27684 56.47228 60.69642
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.81295 71.83784 68.24603      NaN 71.91654 69.54272 72.96641 69.37362
 [9] 74.12509 68.33851
> rowSums(tmp5,na.rm=TRUE)
 [1] 1816.259 1436.757 1364.921    0.000 1438.331 1390.854 1459.328 1387.472
 [9] 1482.502 1366.770
> rowVars(tmp5,na.rm=TRUE)
 [1] 8121.25158  106.34455   71.60970         NA   70.96070   57.42180
 [7]   84.19532   68.92393   69.55649   51.36054
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.117987 10.312349  8.462252        NA  8.423818  7.577717  9.175801
 [8]  8.302044  8.340053  7.166627
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.95931 100.62083  88.33958        NA  89.13110  89.91149  92.25763
 [8]  81.97779  88.90148  79.79442
> rowMin(tmp5,na.rm=TRUE)
 [1] 52.74870 56.24880 56.47228       NA 58.77093 59.40291 58.41723 57.27684
 [9] 54.00555 55.90261
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 116.35861  64.13558  69.17400  69.70327  66.85690  70.79997  69.82236
 [8]       NaN  71.23498  71.81171  74.23568  74.92772  74.98829  72.20565
[15]  74.45079  68.05551  69.57567  70.67662  71.16546  72.27086
> colSums(tmp5,na.rm=TRUE)
 [1] 1047.2275  577.2202  622.5660  627.3294  601.7121  637.1997  628.4012
 [8]    0.0000  641.1149  646.3054  668.1211  674.3495  674.8946  649.8509
[15]  670.0571  612.4996  626.1810  636.0896  640.4891  650.4378
> colVars(tmp5,na.rm=TRUE)
 [1] 17864.41579    65.56976    80.63007    66.77130    42.49608    16.27944
 [7]    66.05831          NA    35.41670   108.56941    56.95263   127.65710
[13]   124.65473    84.03078   166.47846    56.20025    63.78095    63.20594
[19]    82.78573    37.47490
> colSd(tmp5,na.rm=TRUE)
 [1] 133.657831   8.097516   8.979425   8.171370   6.518902   4.034779
 [7]   8.127626         NA   5.951193  10.419665   7.546697  11.298544
[13]  11.164888   9.166830  12.902653   7.496683   7.986298   7.950216
[19]   9.098666   6.121675
> colMax(tmp5,na.rm=TRUE)
 [1] 471.95931  77.12011  86.03788  79.79998  79.48980  75.78423  83.97997
 [8]      -Inf  81.46937  89.13110  89.91149  92.25763  90.18241  88.90148
[15] 100.62083  78.18837  81.10030  83.39654  85.01698  79.79442
> colMin(tmp5,na.rm=TRUE)
 [1] 59.40291 52.74870 59.83310 57.86282 56.24880 64.67058 58.25396      Inf
 [9] 63.10979 54.00555 65.31412 59.87870 58.77093 61.49419 56.79805 55.90261
[17] 59.41333 57.27684 56.47228 60.69642
> 
> 
> 
> 
> 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] 277.2339 239.0815 155.9300 190.9698 426.4538 314.6257 115.7641 199.5384
 [9] 255.4348 256.1271
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 277.2339 239.0815 155.9300 190.9698 426.4538 314.6257 115.7641 199.5384
 [9] 255.4348 256.1271
> 
> 
> 
> 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]  0.000000e+00  8.526513e-14  0.000000e+00  1.136868e-13  2.842171e-14
 [6] -2.273737e-13  0.000000e+00  8.526513e-14  5.684342e-14  1.136868e-13
[11] -2.842171e-14  1.421085e-13 -2.842171e-14 -8.526513e-14  0.000000e+00
[16]  2.842171e-14  5.684342e-14  2.842171e-14  5.684342e-14  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   1 
1   5 
1   12 
6   12 
3   15 
1   17 
7   9 
1   5 
3   1 
2   6 
5   8 
1   16 
8   6 
10   18 
10   18 
5   13 
2   15 
10   4 
6   7 
9   5 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.477459
> Min(tmp)
[1] -2.716868
> mean(tmp)
[1] -0.1039642
> Sum(tmp)
[1] -10.39642
> Var(tmp)
[1] 1.033899
> 
> rowMeans(tmp)
[1] -0.1039642
> rowSums(tmp)
[1] -10.39642
> rowVars(tmp)
[1] 1.033899
> rowSd(tmp)
[1] 1.016808
> rowMax(tmp)
[1] 2.477459
> rowMin(tmp)
[1] -2.716868
> 
> colMeans(tmp)
  [1] -0.42929840 -1.32876959  0.79794072 -0.74538089  1.06119582  0.68952079
  [7]  0.47014033 -0.92136740 -0.25670435  0.81240860 -0.09500020  1.46896741
 [13]  0.15474195 -0.82223085  0.35163170 -0.69005844  0.89219876  0.27414066
 [19]  0.41623273 -0.87031268  0.20286840 -0.79296371  0.29893869 -2.57720592
 [25] -1.42137262 -1.35454728 -1.35608777  0.07875756 -1.28323885 -0.01704405
 [31]  0.65231349 -0.10389885  0.67252197  0.97622768 -2.71686806  0.36003753
 [37] -0.53880033  0.50159569 -0.23934881  0.72415913  0.47149626  0.90688908
 [43]  1.08694588 -1.84445603 -1.18498595  1.13680331  1.04765537 -0.38108295
 [49] -0.11895181 -0.47120814  0.58923510 -1.08771476 -0.07724167  0.28528120
 [55]  0.16373968 -0.45646398  0.71214038 -1.01189325 -0.84972385  0.20602574
 [61] -0.82787088 -0.23184450  0.86867920 -0.17494234 -0.39635326  2.47745933
 [67]  1.22584454  0.77469274 -1.85235795  0.86240450 -1.13594985  0.57438753
 [73]  0.01210241  0.70980849 -0.15507567 -0.72473193 -1.21199248 -1.36068845
 [79]  0.09418795  2.26952852 -0.85838811 -0.26046734 -1.83831882 -0.09765756
 [85]  0.20270533 -0.01464311  0.75308845  0.25805287 -1.93515445 -0.49308155
 [91]  0.76165122 -1.72434063 -1.98707631 -0.28984540  1.91058548  0.54592770
 [97]  0.58681380 -1.69483687 -0.30771170  1.87045525
> colSums(tmp)
  [1] -0.42929840 -1.32876959  0.79794072 -0.74538089  1.06119582  0.68952079
  [7]  0.47014033 -0.92136740 -0.25670435  0.81240860 -0.09500020  1.46896741
 [13]  0.15474195 -0.82223085  0.35163170 -0.69005844  0.89219876  0.27414066
 [19]  0.41623273 -0.87031268  0.20286840 -0.79296371  0.29893869 -2.57720592
 [25] -1.42137262 -1.35454728 -1.35608777  0.07875756 -1.28323885 -0.01704405
 [31]  0.65231349 -0.10389885  0.67252197  0.97622768 -2.71686806  0.36003753
 [37] -0.53880033  0.50159569 -0.23934881  0.72415913  0.47149626  0.90688908
 [43]  1.08694588 -1.84445603 -1.18498595  1.13680331  1.04765537 -0.38108295
 [49] -0.11895181 -0.47120814  0.58923510 -1.08771476 -0.07724167  0.28528120
 [55]  0.16373968 -0.45646398  0.71214038 -1.01189325 -0.84972385  0.20602574
 [61] -0.82787088 -0.23184450  0.86867920 -0.17494234 -0.39635326  2.47745933
 [67]  1.22584454  0.77469274 -1.85235795  0.86240450 -1.13594985  0.57438753
 [73]  0.01210241  0.70980849 -0.15507567 -0.72473193 -1.21199248 -1.36068845
 [79]  0.09418795  2.26952852 -0.85838811 -0.26046734 -1.83831882 -0.09765756
 [85]  0.20270533 -0.01464311  0.75308845  0.25805287 -1.93515445 -0.49308155
 [91]  0.76165122 -1.72434063 -1.98707631 -0.28984540  1.91058548  0.54592770
 [97]  0.58681380 -1.69483687 -0.30771170  1.87045525
> 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.42929840 -1.32876959  0.79794072 -0.74538089  1.06119582  0.68952079
  [7]  0.47014033 -0.92136740 -0.25670435  0.81240860 -0.09500020  1.46896741
 [13]  0.15474195 -0.82223085  0.35163170 -0.69005844  0.89219876  0.27414066
 [19]  0.41623273 -0.87031268  0.20286840 -0.79296371  0.29893869 -2.57720592
 [25] -1.42137262 -1.35454728 -1.35608777  0.07875756 -1.28323885 -0.01704405
 [31]  0.65231349 -0.10389885  0.67252197  0.97622768 -2.71686806  0.36003753
 [37] -0.53880033  0.50159569 -0.23934881  0.72415913  0.47149626  0.90688908
 [43]  1.08694588 -1.84445603 -1.18498595  1.13680331  1.04765537 -0.38108295
 [49] -0.11895181 -0.47120814  0.58923510 -1.08771476 -0.07724167  0.28528120
 [55]  0.16373968 -0.45646398  0.71214038 -1.01189325 -0.84972385  0.20602574
 [61] -0.82787088 -0.23184450  0.86867920 -0.17494234 -0.39635326  2.47745933
 [67]  1.22584454  0.77469274 -1.85235795  0.86240450 -1.13594985  0.57438753
 [73]  0.01210241  0.70980849 -0.15507567 -0.72473193 -1.21199248 -1.36068845
 [79]  0.09418795  2.26952852 -0.85838811 -0.26046734 -1.83831882 -0.09765756
 [85]  0.20270533 -0.01464311  0.75308845  0.25805287 -1.93515445 -0.49308155
 [91]  0.76165122 -1.72434063 -1.98707631 -0.28984540  1.91058548  0.54592770
 [97]  0.58681380 -1.69483687 -0.30771170  1.87045525
> colMin(tmp)
  [1] -0.42929840 -1.32876959  0.79794072 -0.74538089  1.06119582  0.68952079
  [7]  0.47014033 -0.92136740 -0.25670435  0.81240860 -0.09500020  1.46896741
 [13]  0.15474195 -0.82223085  0.35163170 -0.69005844  0.89219876  0.27414066
 [19]  0.41623273 -0.87031268  0.20286840 -0.79296371  0.29893869 -2.57720592
 [25] -1.42137262 -1.35454728 -1.35608777  0.07875756 -1.28323885 -0.01704405
 [31]  0.65231349 -0.10389885  0.67252197  0.97622768 -2.71686806  0.36003753
 [37] -0.53880033  0.50159569 -0.23934881  0.72415913  0.47149626  0.90688908
 [43]  1.08694588 -1.84445603 -1.18498595  1.13680331  1.04765537 -0.38108295
 [49] -0.11895181 -0.47120814  0.58923510 -1.08771476 -0.07724167  0.28528120
 [55]  0.16373968 -0.45646398  0.71214038 -1.01189325 -0.84972385  0.20602574
 [61] -0.82787088 -0.23184450  0.86867920 -0.17494234 -0.39635326  2.47745933
 [67]  1.22584454  0.77469274 -1.85235795  0.86240450 -1.13594985  0.57438753
 [73]  0.01210241  0.70980849 -0.15507567 -0.72473193 -1.21199248 -1.36068845
 [79]  0.09418795  2.26952852 -0.85838811 -0.26046734 -1.83831882 -0.09765756
 [85]  0.20270533 -0.01464311  0.75308845  0.25805287 -1.93515445 -0.49308155
 [91]  0.76165122 -1.72434063 -1.98707631 -0.28984540  1.91058548  0.54592770
 [97]  0.58681380 -1.69483687 -0.30771170  1.87045525
> colMedians(tmp)
  [1] -0.42929840 -1.32876959  0.79794072 -0.74538089  1.06119582  0.68952079
  [7]  0.47014033 -0.92136740 -0.25670435  0.81240860 -0.09500020  1.46896741
 [13]  0.15474195 -0.82223085  0.35163170 -0.69005844  0.89219876  0.27414066
 [19]  0.41623273 -0.87031268  0.20286840 -0.79296371  0.29893869 -2.57720592
 [25] -1.42137262 -1.35454728 -1.35608777  0.07875756 -1.28323885 -0.01704405
 [31]  0.65231349 -0.10389885  0.67252197  0.97622768 -2.71686806  0.36003753
 [37] -0.53880033  0.50159569 -0.23934881  0.72415913  0.47149626  0.90688908
 [43]  1.08694588 -1.84445603 -1.18498595  1.13680331  1.04765537 -0.38108295
 [49] -0.11895181 -0.47120814  0.58923510 -1.08771476 -0.07724167  0.28528120
 [55]  0.16373968 -0.45646398  0.71214038 -1.01189325 -0.84972385  0.20602574
 [61] -0.82787088 -0.23184450  0.86867920 -0.17494234 -0.39635326  2.47745933
 [67]  1.22584454  0.77469274 -1.85235795  0.86240450 -1.13594985  0.57438753
 [73]  0.01210241  0.70980849 -0.15507567 -0.72473193 -1.21199248 -1.36068845
 [79]  0.09418795  2.26952852 -0.85838811 -0.26046734 -1.83831882 -0.09765756
 [85]  0.20270533 -0.01464311  0.75308845  0.25805287 -1.93515445 -0.49308155
 [91]  0.76165122 -1.72434063 -1.98707631 -0.28984540  1.91058548  0.54592770
 [97]  0.58681380 -1.69483687 -0.30771170  1.87045525
> colRanges(tmp)
           [,1]     [,2]      [,3]       [,4]     [,5]      [,6]      [,7]
[1,] -0.4292984 -1.32877 0.7979407 -0.7453809 1.061196 0.6895208 0.4701403
[2,] -0.4292984 -1.32877 0.7979407 -0.7453809 1.061196 0.6895208 0.4701403
           [,8]       [,9]     [,10]      [,11]    [,12]    [,13]      [,14]
[1,] -0.9213674 -0.2567044 0.8124086 -0.0950002 1.468967 0.154742 -0.8222308
[2,] -0.9213674 -0.2567044 0.8124086 -0.0950002 1.468967 0.154742 -0.8222308
         [,15]      [,16]     [,17]     [,18]     [,19]      [,20]     [,21]
[1,] 0.3516317 -0.6900584 0.8921988 0.2741407 0.4162327 -0.8703127 0.2028684
[2,] 0.3516317 -0.6900584 0.8921988 0.2741407 0.4162327 -0.8703127 0.2028684
          [,22]     [,23]     [,24]     [,25]     [,26]     [,27]      [,28]
[1,] -0.7929637 0.2989387 -2.577206 -1.421373 -1.354547 -1.356088 0.07875756
[2,] -0.7929637 0.2989387 -2.577206 -1.421373 -1.354547 -1.356088 0.07875756
         [,29]       [,30]     [,31]      [,32]    [,33]     [,34]     [,35]
[1,] -1.283239 -0.01704405 0.6523135 -0.1038989 0.672522 0.9762277 -2.716868
[2,] -1.283239 -0.01704405 0.6523135 -0.1038989 0.672522 0.9762277 -2.716868
         [,36]      [,37]     [,38]      [,39]     [,40]     [,41]     [,42]
[1,] 0.3600375 -0.5388003 0.5015957 -0.2393488 0.7241591 0.4714963 0.9068891
[2,] 0.3600375 -0.5388003 0.5015957 -0.2393488 0.7241591 0.4714963 0.9068891
        [,43]     [,44]     [,45]    [,46]    [,47]      [,48]      [,49]
[1,] 1.086946 -1.844456 -1.184986 1.136803 1.047655 -0.3810829 -0.1189518
[2,] 1.086946 -1.844456 -1.184986 1.136803 1.047655 -0.3810829 -0.1189518
          [,50]     [,51]     [,52]       [,53]     [,54]     [,55]     [,56]
[1,] -0.4712081 0.5892351 -1.087715 -0.07724167 0.2852812 0.1637397 -0.456464
[2,] -0.4712081 0.5892351 -1.087715 -0.07724167 0.2852812 0.1637397 -0.456464
         [,57]     [,58]      [,59]     [,60]      [,61]      [,62]     [,63]
[1,] 0.7121404 -1.011893 -0.8497238 0.2060257 -0.8278709 -0.2318445 0.8686792
[2,] 0.7121404 -1.011893 -0.8497238 0.2060257 -0.8278709 -0.2318445 0.8686792
          [,64]      [,65]    [,66]    [,67]     [,68]     [,69]     [,70]
[1,] -0.1749423 -0.3963533 2.477459 1.225845 0.7746927 -1.852358 0.8624045
[2,] -0.1749423 -0.3963533 2.477459 1.225845 0.7746927 -1.852358 0.8624045
        [,71]     [,72]      [,73]     [,74]      [,75]      [,76]     [,77]
[1,] -1.13595 0.5743875 0.01210241 0.7098085 -0.1550757 -0.7247319 -1.211992
[2,] -1.13595 0.5743875 0.01210241 0.7098085 -0.1550757 -0.7247319 -1.211992
         [,78]      [,79]    [,80]      [,81]      [,82]     [,83]       [,84]
[1,] -1.360688 0.09418795 2.269529 -0.8583881 -0.2604673 -1.838319 -0.09765756
[2,] -1.360688 0.09418795 2.269529 -0.8583881 -0.2604673 -1.838319 -0.09765756
         [,85]       [,86]     [,87]     [,88]     [,89]      [,90]     [,91]
[1,] 0.2027053 -0.01464311 0.7530885 0.2580529 -1.935154 -0.4930816 0.7616512
[2,] 0.2027053 -0.01464311 0.7530885 0.2580529 -1.935154 -0.4930816 0.7616512
         [,92]     [,93]      [,94]    [,95]     [,96]     [,97]     [,98]
[1,] -1.724341 -1.987076 -0.2898454 1.910585 0.5459277 0.5868138 -1.694837
[2,] -1.724341 -1.987076 -0.2898454 1.910585 0.5459277 0.5868138 -1.694837
          [,99]   [,100]
[1,] -0.3077117 1.870455
[2,] -0.3077117 1.870455
> 
> 
> Max(tmp2)
[1] 1.975245
> Min(tmp2)
[1] -2.267979
> mean(tmp2)
[1] 0.08935099
> Sum(tmp2)
[1] 8.935099
> Var(tmp2)
[1] 1.042289
> 
> rowMeans(tmp2)
  [1]  1.403046082  0.178441267  1.707778301 -0.967506004  1.355715940
  [6]  0.409321184  1.322220596 -0.332339757  0.743848333  1.639937910
 [11] -0.377571717  0.239189124  0.709952335  0.132746773 -0.493132312
 [16] -0.099626725  0.218827107 -0.269608514 -0.218182025  1.718713833
 [21]  0.800205461  0.819620376 -0.486160908  0.550710094 -1.991507092
 [26] -0.639299897 -1.587605241 -0.726509596  0.431077326 -1.278714756
 [31] -0.251328661  1.197644299  0.505337174 -1.179572864 -0.664518868
 [36]  0.335052514  1.784656954  1.485657342 -0.124508032 -1.682808511
 [41]  1.305740654  0.941206301  0.459109749  0.600744330  0.944716301
 [46] -1.579805600 -1.087065449 -0.474149682 -0.968877270 -0.123700882
 [51] -0.376733977  1.159109735  0.825621570 -0.381196423 -1.389983414
 [56]  0.925887776  1.165466161  0.727081846 -1.727144399  1.975244626
 [61]  1.928346181  0.575582238  0.042070980 -0.266080565 -0.084132321
 [66] -0.389639431 -0.955733325  0.402549406  1.378417100 -0.476321876
 [71]  1.178302265 -1.913647182 -2.267979133  0.986990311 -0.747147975
 [76]  0.171588079  0.652269148  1.642528850 -0.001225337 -0.986457466
 [81] -0.264090984 -1.384393741 -1.852622561 -0.422824213 -0.492036762
 [86] -0.035232913 -0.346437574 -0.489586036 -1.579411513  1.590829303
 [91]  1.445719501  0.448532449 -0.802427529  1.363288591  0.107999126
 [96] -0.448698524  0.516756337  0.834429927 -0.116986500  0.751541777
> rowSums(tmp2)
  [1]  1.403046082  0.178441267  1.707778301 -0.967506004  1.355715940
  [6]  0.409321184  1.322220596 -0.332339757  0.743848333  1.639937910
 [11] -0.377571717  0.239189124  0.709952335  0.132746773 -0.493132312
 [16] -0.099626725  0.218827107 -0.269608514 -0.218182025  1.718713833
 [21]  0.800205461  0.819620376 -0.486160908  0.550710094 -1.991507092
 [26] -0.639299897 -1.587605241 -0.726509596  0.431077326 -1.278714756
 [31] -0.251328661  1.197644299  0.505337174 -1.179572864 -0.664518868
 [36]  0.335052514  1.784656954  1.485657342 -0.124508032 -1.682808511
 [41]  1.305740654  0.941206301  0.459109749  0.600744330  0.944716301
 [46] -1.579805600 -1.087065449 -0.474149682 -0.968877270 -0.123700882
 [51] -0.376733977  1.159109735  0.825621570 -0.381196423 -1.389983414
 [56]  0.925887776  1.165466161  0.727081846 -1.727144399  1.975244626
 [61]  1.928346181  0.575582238  0.042070980 -0.266080565 -0.084132321
 [66] -0.389639431 -0.955733325  0.402549406  1.378417100 -0.476321876
 [71]  1.178302265 -1.913647182 -2.267979133  0.986990311 -0.747147975
 [76]  0.171588079  0.652269148  1.642528850 -0.001225337 -0.986457466
 [81] -0.264090984 -1.384393741 -1.852622561 -0.422824213 -0.492036762
 [86] -0.035232913 -0.346437574 -0.489586036 -1.579411513  1.590829303
 [91]  1.445719501  0.448532449 -0.802427529  1.363288591  0.107999126
 [96] -0.448698524  0.516756337  0.834429927 -0.116986500  0.751541777
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  1.403046082  0.178441267  1.707778301 -0.967506004  1.355715940
  [6]  0.409321184  1.322220596 -0.332339757  0.743848333  1.639937910
 [11] -0.377571717  0.239189124  0.709952335  0.132746773 -0.493132312
 [16] -0.099626725  0.218827107 -0.269608514 -0.218182025  1.718713833
 [21]  0.800205461  0.819620376 -0.486160908  0.550710094 -1.991507092
 [26] -0.639299897 -1.587605241 -0.726509596  0.431077326 -1.278714756
 [31] -0.251328661  1.197644299  0.505337174 -1.179572864 -0.664518868
 [36]  0.335052514  1.784656954  1.485657342 -0.124508032 -1.682808511
 [41]  1.305740654  0.941206301  0.459109749  0.600744330  0.944716301
 [46] -1.579805600 -1.087065449 -0.474149682 -0.968877270 -0.123700882
 [51] -0.376733977  1.159109735  0.825621570 -0.381196423 -1.389983414
 [56]  0.925887776  1.165466161  0.727081846 -1.727144399  1.975244626
 [61]  1.928346181  0.575582238  0.042070980 -0.266080565 -0.084132321
 [66] -0.389639431 -0.955733325  0.402549406  1.378417100 -0.476321876
 [71]  1.178302265 -1.913647182 -2.267979133  0.986990311 -0.747147975
 [76]  0.171588079  0.652269148  1.642528850 -0.001225337 -0.986457466
 [81] -0.264090984 -1.384393741 -1.852622561 -0.422824213 -0.492036762
 [86] -0.035232913 -0.346437574 -0.489586036 -1.579411513  1.590829303
 [91]  1.445719501  0.448532449 -0.802427529  1.363288591  0.107999126
 [96] -0.448698524  0.516756337  0.834429927 -0.116986500  0.751541777
> rowMin(tmp2)
  [1]  1.403046082  0.178441267  1.707778301 -0.967506004  1.355715940
  [6]  0.409321184  1.322220596 -0.332339757  0.743848333  1.639937910
 [11] -0.377571717  0.239189124  0.709952335  0.132746773 -0.493132312
 [16] -0.099626725  0.218827107 -0.269608514 -0.218182025  1.718713833
 [21]  0.800205461  0.819620376 -0.486160908  0.550710094 -1.991507092
 [26] -0.639299897 -1.587605241 -0.726509596  0.431077326 -1.278714756
 [31] -0.251328661  1.197644299  0.505337174 -1.179572864 -0.664518868
 [36]  0.335052514  1.784656954  1.485657342 -0.124508032 -1.682808511
 [41]  1.305740654  0.941206301  0.459109749  0.600744330  0.944716301
 [46] -1.579805600 -1.087065449 -0.474149682 -0.968877270 -0.123700882
 [51] -0.376733977  1.159109735  0.825621570 -0.381196423 -1.389983414
 [56]  0.925887776  1.165466161  0.727081846 -1.727144399  1.975244626
 [61]  1.928346181  0.575582238  0.042070980 -0.266080565 -0.084132321
 [66] -0.389639431 -0.955733325  0.402549406  1.378417100 -0.476321876
 [71]  1.178302265 -1.913647182 -2.267979133  0.986990311 -0.747147975
 [76]  0.171588079  0.652269148  1.642528850 -0.001225337 -0.986457466
 [81] -0.264090984 -1.384393741 -1.852622561 -0.422824213 -0.492036762
 [86] -0.035232913 -0.346437574 -0.489586036 -1.579411513  1.590829303
 [91]  1.445719501  0.448532449 -0.802427529  1.363288591  0.107999126
 [96] -0.448698524  0.516756337  0.834429927 -0.116986500  0.751541777
> 
> colMeans(tmp2)
[1] 0.08935099
> colSums(tmp2)
[1] 8.935099
> colVars(tmp2)
[1] 1.042289
> colSd(tmp2)
[1] 1.020925
> colMax(tmp2)
[1] 1.975245
> colMin(tmp2)
[1] -2.267979
> colMedians(tmp2)
[1] 0.07503505
> colRanges(tmp2)
          [,1]
[1,] -2.267979
[2,]  1.975245
> 
> 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] -1.8857709 -0.3722336  3.9068614 -3.8567580 -2.0221038  2.6174029
 [7] -2.7369846  3.0262356  3.3226960 -2.8113538
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5617816
[2,] -0.6935025
[3,] -0.3214966
[4,]  0.5374416
[5,]  0.8104190
> 
> rowApply(tmp,sum)
 [1]  0.9435663  0.6087289  0.3185011  1.0274466 -0.3421251 -3.1344311
 [7]  3.0391175 -0.5762061 -0.3372987 -2.3593081
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    7    3    1    3    5    7    4    1     8
 [2,]    3    6   10    3    8    3    5    7    2     7
 [3,]    9    8    2    8    4    9    8    6    8     4
 [4,]    2    4    4    2    9    1    6    9    4     2
 [5,]    5    2    5    4    6    7   10    1    6     6
 [6,]    8    3    9    5    7    8    2    8    9     5
 [7,]    1    1    6   10    1    2    4   10    3    10
 [8,]   10    5    1    9   10    4    9    3    5     9
 [9,]    6    9    8    7    2   10    3    5   10     1
[10,]    4   10    7    6    5    6    1    2    7     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.7127004  0.1226704  1.4832618 -4.0568084 -3.1870005 -1.6410598
 [7] -1.4141026  1.4346452 -0.5192740  1.0558836  3.9934477  1.3702382
[13] -1.5294799 -3.1057251 -1.0976769 -5.2517504  4.0444847 -3.1939857
[19] -0.8297909  1.6064101
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.1591508
[2,]  0.0957332
[3,]  0.3379022
[4,]  0.9124296
[5,]  1.5257862
> 
> rowApply(tmp,sum)
[1] -1.0220888 -0.9673229 -8.5198113  3.1806743 -0.6743635
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10   16   14   18   13
[2,]   15   13    4   20    5
[3,]   13    5   10    8   20
[4,]    1   12    6   15    2
[5,]    8    2    2   14    4
> 
> 
> as.matrix(tmp)
           [,1]        [,2]         [,3]      [,4]       [,5]        [,6]
[1,] -0.1591508  0.71637358  0.388040057 -2.239349 -0.3501826  1.40682979
[2,]  0.9124296 -0.02007457 -0.650987923 -0.201856 -0.7544112 -0.47872884
[3,]  0.0957332 -1.43677541 -0.535900284 -1.173689 -1.8748625  0.09618493
[4,]  1.5257862  2.03028693  0.002742509  1.139657  1.0738679 -0.48505295
[5,]  0.3379022 -1.16714014  2.279367452 -1.581571 -1.2814121 -2.18029273
            [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,] -0.93368012  0.8330759 -2.0174011  1.6490191  0.7871042 -0.6684364
[2,] -0.73364062  0.2234849 -0.5567428  0.9409731 -0.4824542  1.1181876
[3,] -0.40235938 -0.1564645 -0.1399630  0.4985736  1.0975486  0.4297797
[4,]  0.03129941  0.2602790  1.5274594 -0.8827799  1.1483487  0.3203438
[5,]  0.62427814  0.2742699  0.6673735 -1.1499022  1.4429004  0.1703636
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -0.4256524 -0.1087373 -0.2934360 -0.7392440 0.11547333 -0.6573537
[2,]  0.3577126  1.1974123 -0.5443402 -1.7139007 1.65246025 -0.6952638
[3,] -1.3908167 -2.1004283  1.5677891 -0.8741259 1.60485899 -1.6155327
[4,] -0.2392431 -1.4170106 -2.0410499 -0.8337202 0.03572612  1.1948443
[5,]  0.1685198 -0.6769612  0.2133602 -1.0907596 0.63596601 -1.4206798
          [,19]       [,20]
[1,]  0.6719956  1.00262300
[2,] -0.2331967 -0.30438554
[3,] -1.1735688 -1.03579276
[4,] -1.2425639  0.03145359
[5,]  1.1475428  1.91251177
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  654  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  566  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1       col2      col3       col4     col5      col6     col7
row1 -0.2334869 -0.8599856 -0.587991 -0.7561798 1.453613 0.1090329 1.334931
         col8        col9     col10     col11    col12    col13     col14
row1 1.900159 -0.08655009 0.7445889 0.2792647 1.290611 0.754313 -1.341285
        col15    col16    col17      col18     col19     col20
row1 1.246885 1.470716 0.988699 -0.6457016 0.8904415 0.1149943
> tmp[,"col10"]
           col10
row1  0.74458893
row2  0.03864389
row3 -0.41646989
row4 -0.34922999
row5  0.08777797
> tmp[c("row1","row5"),]
           col1       col2      col3       col4      col5       col6      col7
row1 -0.2334869 -0.8599856 -0.587991 -0.7561798  1.453613  0.1090329 1.3349314
row5 -0.7356376  0.5031284  1.379147  0.1232691 -1.547863 -1.1604048 0.8376108
          col8        col9      col10     col11     col12     col13     col14
row1 1.9001589 -0.08655009 0.74458893 0.2792647  1.290611 0.7543130 -1.341285
row5 0.3281351  0.05491974 0.08777797 0.3877019 -1.104466 0.1381691  1.310869
         col15     col16     col17      col18     col19      col20
row1 1.2468854  1.470716  0.988699 -0.6457016 0.8904415  0.1149943
row5 0.4224672 -1.541517 -1.166196  0.8698054 1.1254409 -0.8637299
> tmp[,c("col6","col20")]
           col6      col20
row1  0.1090329  0.1149943
row2  1.6874147 -0.7826550
row3 -0.1141939  1.2875865
row4  0.2876597 -0.7493450
row5 -1.1604048 -0.8637299
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1  0.1090329  0.1149943
row5 -1.1604048 -0.8637299
> 
> 
> 
> 
> 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.13504 50.98209 48.61225 51.14797 49.9596 105.1603 48.487 50.186
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.16697 48.77683 49.12483 48.34756 50.91561 49.19627 49.10987 49.83564
        col17    col18    col19    col20
row1 50.78768 50.64603 50.31029 105.0571
> tmp[,"col10"]
        col10
row1 48.77683
row2 31.36956
row3 31.02919
row4 32.11931
row5 50.72791
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7    col8
row1 50.13504 50.98209 48.61225 51.14797 49.95960 105.1603 48.48700 50.1860
row5 50.99557 51.04788 49.53854 48.65162 50.36557 103.5824 49.42529 51.0084
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.16697 48.77683 49.12483 48.34756 50.91561 49.19627 49.10987 49.83564
row5 50.88302 50.72791 48.99012 49.48134 47.86310 51.09562 50.37021 49.98483
        col17    col18    col19    col20
row1 50.78768 50.64603 50.31029 105.0571
row5 51.31400 50.13308 49.51394 104.9753
> tmp[,c("col6","col20")]
          col6     col20
row1 105.16027 105.05708
row2  73.95848  74.23288
row3  76.45812  74.32072
row4  74.06574  74.22484
row5 103.58237 104.97532
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.1603 105.0571
row5 103.5824 104.9753
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.1603 105.0571
row5 103.5824 104.9753
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8463690
[2,] -1.3632495
[3,] -0.5579107
[4,] -0.5016597
[5,]  2.4004019
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.7301176  0.3787054
[2,]  0.9343317 -1.3714312
[3,] -0.7927776 -1.1693096
[4,]  0.3875338 -1.8855307
[5,] -1.1238375 -2.0089958
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -0.9950836 -1.54919248
[2,] -0.4033476 -1.52046657
[3,] -0.5350570 -0.70459063
[4,] -1.4624794 -0.08117247
[5,]  0.3388617 -1.08021248
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9950836
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9950836
[2,] -0.4033476
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]        [,2]       [,3]       [,4]      [,5]      [,6]      [,7]
row3  0.3207011 -0.05178379 -0.1673461 -2.4059815 -1.808880 0.7074831 0.1966987
row1 -0.4336011  0.06960574 -0.1655998  0.1826182  1.646333 0.7485485 1.6054745
           [,8]      [,9]     [,10]     [,11]      [,12]      [,13]     [,14]
row3 -0.5116517 0.5830032 0.1402148 -1.031728 -0.8985303 -0.7522393 0.8014604
row1  2.4722655 1.9024077 0.5638982 -1.493849 -0.6820986  1.5583969 0.4060076
          [,15]      [,16]     [,17]     [,18]      [,19]    [,20]
row3 -0.8969508 -0.2468823 -1.067299 0.6974858  1.6448837 1.491528
row1 -1.2534905  0.3508560  1.443674 1.5252534 -0.3547548 1.908800
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]       [,4]     [,5]     [,6]        [,7]
row2 0.5497051 0.9474017 -0.245782 -0.1010681 -1.34092 -1.98062 -0.01036289
          [,8]       [,9]     [,10]
row2 0.4299841 -0.9563938 -2.222325
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]       [,3]       [,4]      [,5]       [,6]     [,7]
row5 0.2401538 1.377813 -0.2640998 -0.6209687 0.8781445 0.07750027 1.326805
          [,8]       [,9]     [,10]     [,11]      [,12]    [,13]     [,14]
row5 -1.904318 -0.5286777 0.5042167 0.3090946 -0.3699216 1.577691 -0.862091
         [,15]     [,16]      [,17]   [,18]     [,19]     [,20]
row5 -1.222173 -1.913858 -0.1186782 1.05202 -1.139518 -1.485542
> 
> 
> 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: 0x62d358f95500>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e7478186b"
 [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e777cd836"
 [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e2b73c0e0"
 [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e6c435195"
 [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e44790c20"
 [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e80d33de" 
 [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e307ba01b"
 [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e79b2b9c8"
 [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e186022aa"
[10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e1cbc3755"
[11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e16965dac"
[12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e1b9f688" 
[13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e5327f61f"
[14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e4c6ca421"
[15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM108a6e5dba266e"
> 
> 
> ### 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: 0x62d35792d810>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x62d35792d810>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x62d35792d810>
> rowMedians(tmp)
  [1]  0.131611198 -0.598770661  0.144083483  0.048488707 -0.414761414
  [6]  0.321176901  0.192338931 -0.670029102 -0.108916355  0.276260722
 [11] -0.730670851 -0.395412523  0.337891083 -0.552365346 -0.629729242
 [16]  0.048215862 -0.347430812 -0.164111157 -0.335187078  0.112640371
 [21] -0.232341520  0.239829739 -0.305835441  0.160375647 -0.293060003
 [26] -0.473637232  0.250230925  0.597876937  0.171268607 -0.173813823
 [31] -0.411531197 -0.512844719  0.181571279 -0.684641953  0.189230826
 [36] -0.264933736 -0.012870477 -0.201162167 -0.186716431  0.228966381
 [41] -0.477270050 -0.474139061 -0.464132960 -0.616035973  0.343853593
 [46] -0.374667160  0.141137440  0.070868522  0.340163963  0.385510044
 [51] -0.409212550  0.214319464 -0.260691908  0.492060718  0.025529507
 [56]  0.213804022  0.236381701  0.745670570 -0.048991761  0.013838257
 [61] -0.447873593 -0.432406770 -0.156425725  0.246748604 -0.039022203
 [66]  0.688198265  0.171011323  0.054770883  0.115952843 -0.391352834
 [71]  0.310643995 -0.125677517 -0.079466164 -0.412138869 -0.136578376
 [76] -0.205389281 -0.757880499  0.140639840 -0.152588952 -0.016817405
 [81] -0.196307873 -0.020312671 -0.275384217 -0.279247191  0.163319747
 [86]  0.084892853 -0.090007225 -0.527056110 -0.286909386 -0.283068729
 [91]  0.169221921  0.318015422  0.149465658 -0.141969361  0.024481473
 [96] -0.310495611  0.027335397 -0.201725470 -0.067244945  0.237836498
[101]  0.574012993 -0.399667019  0.095298924 -0.206382389  0.064519337
[106] -0.032821166 -0.397920745  0.210794187 -0.348847740  0.217076000
[111] -0.200096684  0.005860402 -0.108266959  0.263025521 -0.236916198
[116]  0.365361508  0.272191629 -0.227790784 -0.127644107  0.160643067
[121]  0.198304835  0.263648273 -0.318545146 -0.288329900 -0.178776735
[126] -0.178629130 -0.043513155 -0.052595662  0.385716457  0.422630118
[131]  0.570933819 -0.181089871 -0.106298875  0.042573565  0.160379422
[136] -0.340644630 -0.792414600 -0.587257001  0.114534776  0.049983421
[141]  0.297373969  0.262864042 -0.234294794 -0.093228259  0.120634854
[146] -0.190085657 -0.353410131 -0.400284724 -0.910041039  0.005753620
[151]  0.500305074 -0.318968805 -0.107826495  0.012667449  0.069378375
[156] -0.391209639  0.117732599 -0.397241021 -0.296282026  0.015486026
[161]  0.214337352  0.212755611  0.453369781  0.447259852  0.355505262
[166]  0.439583507  0.084569710  0.231939349  0.200254577 -0.121050056
[171] -0.193983875 -0.278569274  0.239581304  0.028785967 -0.115160188
[176]  0.324635399 -0.130957026 -0.183126694 -0.229110382  0.049220784
[181] -0.093142253  0.743357587 -0.270295539 -0.335685270 -0.063536926
[186]  0.085965828  0.202011855  0.133778677  0.658753478  0.232750534
[191]  0.120574574 -0.262817038 -0.608791439  0.010824217  0.317774628
[196] -0.238902155  0.409437535  0.279487593  0.007667462 -0.594724215
[201] -0.341564990 -0.253563203 -0.038164209 -0.378792147 -0.084937630
[206]  0.217988140  0.218969768 -0.205735014  0.298694420  0.070557873
[211] -0.248575001  0.517780805  0.169706070  0.339353168  0.395508520
[216]  0.141084499 -0.325056411 -0.100219466  0.362834912  0.452852111
[221]  0.077128577  0.403155187 -0.403214153 -0.345671669 -0.259887221
[226]  0.622216165  0.877420669 -0.043695377 -0.028105683  0.172339105
> 
> proc.time()
   user  system elapsed 
  1.382   1.502   2.863 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences"
Copyright (C) 2025 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: 0x5cea042893e0>
> .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: 0x5cea042893e0>
> .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: 0x5cea042893e0>
> .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: 0x5cea042893e0>
> 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: 0x5cea03f9f280>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cea03f9f280>
> .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: 0x5cea03f9f280>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cea03f9f280>
> .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: 0x5cea03f9f280>
> 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: 0x5cea04ba1b90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cea04ba1b90>
> .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: 0x5cea04ba1b90>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5cea04ba1b90>
> .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: 0x5cea04ba1b90>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x5cea04ba1b90>
> .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: 0x5cea04ba1b90>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x5cea04ba1b90>
> .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: 0x5cea04ba1b90>
> 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: 0x5cea03bb72d0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5cea03bb72d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cea03bb72d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cea03bb72d0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile108b6e2f4866c8" "BufferedMatrixFile108b6e5c359549"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile108b6e2f4866c8" "BufferedMatrixFile108b6e5c359549"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cea05255cc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cea05255cc0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5cea05255cc0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5cea05255cc0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5cea05255cc0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5cea05255cc0>
> .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: 0x5cea05f5bab0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cea05f5bab0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5cea05f5bab0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5cea05f5bab0>
> 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: 0x5cea069210c0>
> .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: 0x5cea069210c0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.247   0.062   0.296 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences"
Copyright (C) 2025 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.260   0.037   0.285 

Example timings