Back to Build/check report for BioC 3.17:   simplified   long
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2023-03-01 07:38:36 -0000 (Wed, 01 Mar 2023).

HostnameOSArch (*)R versionInstalled pkgs
kunpeng1Linux (Ubuntu 22.04.1 LTS)aarch64R Under development (unstable) (2023-01-14 r83615) -- "Unsuffered Consequences" 4266
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

CHECK results for BufferedMatrix on kunpeng1


To the developers/maintainers of the BufferedMatrix package:
- Please 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 How and When does the builder pull? When will my changes propagate? for more information.
- Make sure to use the following settings in order to reproduce any error or warning you see on this page.

raw results

Package 228/2171HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.63.0  (landing page)
Ben Bolstad
Snapshot Date: 2023-02-27 07:53:22 -0000 (Mon, 27 Feb 2023)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: master
git_last_commit: e95ad0a
git_last_commit_date: 2022-11-01 14:42:48 -0000 (Tue, 01 Nov 2022)
kunpeng1Linux (Ubuntu 22.04.1 LTS) / aarch64  OK    OK    OK  

Summary

Package: BufferedMatrix
Version: 1.63.0
Command: /home/biocbuild/bbs-3.17-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.17-bioc/R/library --timings BufferedMatrix_1.63.0.tar.gz
StartedAt: 2023-02-27 22:24:33 -0000 (Mon, 27 Feb 2023)
EndedAt: 2023-02-27 22:25:08 -0000 (Mon, 27 Feb 2023)
EllapsedTime: 35.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2023-01-14 r83615)
* using platform: aarch64-unknown-linux-gnu (64-bit)
* R was compiled by
    gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
    GNU Fortran (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
* running under: Ubuntu 22.04.1 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.63.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.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 R 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 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
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 in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
  ‘BufferedMatrix.Rnw’... OK
 OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

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



Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library ‘/home/biocbuild/bbs-3.17-bioc/R/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0’
gcc -I"/home/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -I"/home/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -I"/home/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -I"/home/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fPIC  -g -O2  -Wall -c init_package.c -o init_package.o
gcc -shared -L/home/biocbuild/bbs-3.17-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.17-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.17-bioc/R/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) (2023-01-14 r83615) -- "Unsuffered Consequences"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

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.312   0.060   0.356 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R Under development (unstable) (2023-01-14 r83615) -- "Unsuffered Consequences"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

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.17-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 456993 24.5     979984 52.4   651420 34.8
Vcells 842364  6.5    8388608 64.0  2047783 15.7
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Feb 27 22:24:56 2023"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Feb 27 22:24:56 2023"
> 
> 
> 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: 0xaaaadfcfe910>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Mon Feb 27 22:24:56 2023"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Mon Feb 27 22:24:57 2023"
> 
> ColMode(tmp2)
<pointer: 0xaaaadfcfe910>
> 
> 
> 
> ### 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.0058540  0.3425169 -0.7071951 -0.2439449
[2,]   0.6481443  0.4679637  0.2525855 -0.7956034
[3,]  -0.1036408  1.0612600  0.3865258  0.8723081
[4,]   1.5160232 -0.1815400  2.4171743  0.5772204
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.17-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.0058540 0.3425169 0.7071951 0.2439449
[2,]   0.6481443 0.4679637 0.2525855 0.7956034
[3,]   0.1036408 1.0612600 0.3865258 0.8723081
[4,]   1.5160232 0.1815400 2.4171743 0.5772204
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.17-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.0501669 0.5852494 0.8409489 0.4939078
[2,]  0.8050741 0.6840787 0.5025789 0.8919660
[3,]  0.3219330 1.0301748 0.6217120 0.9339744
[4,]  1.2312689 0.4260751 1.5547265 0.7597502
> 
> 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.17-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.50752 31.19501 34.11668 30.18302
[2,]  33.69889 32.30875 30.27837 34.71526
[3,]  28.32297 36.36301 31.60365 35.21205
[4,]  38.82871 29.44229 42.96444 33.17472
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xaaaadf47d470>
> exp(tmp5)
<pointer: 0xaaaadf47d470>
> log(tmp5,2)
<pointer: 0xaaaadf47d470>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.4457
> Min(tmp5)
[1] 52.32604
> mean(tmp5)
[1] 71.66483
> Sum(tmp5)
[1] 14332.97
> Var(tmp5)
[1] 873.9415
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.27519 67.93856 71.24112 69.18783 71.12019 68.48372 71.27509 70.45295
 [9] 68.89948 68.77411
> rowSums(tmp5)
 [1] 1785.504 1358.771 1424.822 1383.757 1422.404 1369.674 1425.502 1409.059
 [9] 1377.990 1375.482
> rowVars(tmp5)
 [1] 8135.42504   29.29291   87.24806   75.35462   73.62717   70.01289
 [7]   75.30278   66.89166   95.68969   67.31568
> rowSd(tmp5)
 [1] 90.196591  5.412293  9.340667  8.680704  8.580628  8.367371  8.677717
 [8]  8.178732  9.782111  8.204614
> rowMax(tmp5)
 [1] 471.44573  79.70666  89.15138  89.42485  86.23976  84.71521  84.85976
 [8]  83.81819  87.25386  88.12162
> rowMin(tmp5)
 [1] 60.24759 58.03189 57.38319 56.99107 55.97312 54.84357 55.89281 56.00538
 [9] 52.32604 55.26769
> 
> colMeans(tmp5)
 [1] 109.18131  68.37462  69.60122  65.76353  71.69504  73.87278  71.35336
 [8]  69.38622  68.89793  68.97179  67.24146  71.68069  74.66434  72.65759
[15]  69.83977  65.65036  68.24578  70.91509  70.46738  64.83624
> colSums(tmp5)
 [1] 1091.8131  683.7462  696.0122  657.6353  716.9504  738.7278  713.5336
 [8]  693.8622  688.9793  689.7179  672.4146  716.8069  746.6434  726.5759
[15]  698.3977  656.5036  682.4578  709.1509  704.6738  648.3624
> colVars(tmp5)
 [1] 16267.09249   109.89915    94.25452    30.17062    85.25270    49.77112
 [7]    63.11682   112.59284    65.17221    38.51946    48.69157    46.39289
[13]    36.46387   122.53776    79.49633    21.85959    68.44647    63.72149
[19]    33.63100    95.80283
> colSd(tmp5)
 [1] 127.542512  10.483279   9.708477   5.492779   9.233239   7.054865
 [7]   7.944609  10.610977   8.072931   6.206404   6.977934   6.811233
[13]   6.038532  11.069677   8.916071   4.675424   8.273238   7.982574
[19]   5.799224   9.787892
> colMax(tmp5)
 [1] 471.44573  88.12162  89.42485  73.28927  83.81819  83.36582  84.85976
 [8]  89.15138  81.00491  77.64760  80.67186  80.75170  84.56021  87.25386
[15]  84.65388  73.12618  81.61364  82.55299  81.57293  80.68423
> colMin(tmp5)
 [1] 55.89281 52.32604 56.00232 55.97312 61.13262 61.91752 60.66811 56.76752
 [9] 55.26769 60.24759 58.03593 60.90687 67.04953 57.71037 54.84357 57.76653
[17] 58.79411 56.99107 60.23055 54.32206
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1]       NA 67.93856 71.24112 69.18783 71.12019 68.48372 71.27509 70.45295
 [9] 68.89948 68.77411
> rowSums(tmp5)
 [1]       NA 1358.771 1424.822 1383.757 1422.404 1369.674 1425.502 1409.059
 [9] 1377.990 1375.482
> rowVars(tmp5)
 [1] 8557.17005   29.29291   87.24806   75.35462   73.62717   70.01289
 [7]   75.30278   66.89166   95.68969   67.31568
> rowSd(tmp5)
 [1] 92.504973  5.412293  9.340667  8.680704  8.580628  8.367371  8.677717
 [8]  8.178732  9.782111  8.204614
> rowMax(tmp5)
 [1]       NA 79.70666 89.15138 89.42485 86.23976 84.71521 84.85976 83.81819
 [9] 87.25386 88.12162
> rowMin(tmp5)
 [1]       NA 58.03189 57.38319 56.99107 55.97312 54.84357 55.89281 56.00538
 [9] 52.32604 55.26769
> 
> colMeans(tmp5)
 [1] 109.18131  68.37462  69.60122  65.76353  71.69504  73.87278  71.35336
 [8]  69.38622  68.89793  68.97179  67.24146  71.68069  74.66434        NA
[15]  69.83977  65.65036  68.24578  70.91509  70.46738  64.83624
> colSums(tmp5)
 [1] 1091.8131  683.7462  696.0122  657.6353  716.9504  738.7278  713.5336
 [8]  693.8622  688.9793  689.7179  672.4146  716.8069  746.6434        NA
[15]  698.3977  656.5036  682.4578  709.1509  704.6738  648.3624
> colVars(tmp5)
 [1] 16267.09249   109.89915    94.25452    30.17062    85.25270    49.77112
 [7]    63.11682   112.59284    65.17221    38.51946    48.69157    46.39289
[13]    36.46387          NA    79.49633    21.85959    68.44647    63.72149
[19]    33.63100    95.80283
> colSd(tmp5)
 [1] 127.542512  10.483279   9.708477   5.492779   9.233239   7.054865
 [7]   7.944609  10.610977   8.072931   6.206404   6.977934   6.811233
[13]   6.038532         NA   8.916071   4.675424   8.273238   7.982574
[19]   5.799224   9.787892
> colMax(tmp5)
 [1] 471.44573  88.12162  89.42485  73.28927  83.81819  83.36582  84.85976
 [8]  89.15138  81.00491  77.64760  80.67186  80.75170  84.56021        NA
[15]  84.65388  73.12618  81.61364  82.55299  81.57293  80.68423
> colMin(tmp5)
 [1] 55.89281 52.32604 56.00232 55.97312 61.13262 61.91752 60.66811 56.76752
 [9] 55.26769 60.24759 58.03593 60.90687 67.04953       NA 54.84357 57.76653
[17] 58.79411 56.99107 60.23055 54.32206
> 
> Max(tmp5,na.rm=TRUE)
[1] 471.4457
> Min(tmp5,na.rm=TRUE)
[1] 52.32604
> mean(tmp5,na.rm=TRUE)
[1] 71.69057
> Sum(tmp5,na.rm=TRUE)
[1] 14266.42
> Var(tmp5,na.rm=TRUE)
[1] 878.2221
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 90.47170 67.93856 71.24112 69.18783 71.12019 68.48372 71.27509 70.45295
 [9] 68.89948 68.77411
> rowSums(tmp5,na.rm=TRUE)
 [1] 1718.962 1358.771 1424.822 1383.757 1422.404 1369.674 1425.502 1409.059
 [9] 1377.990 1375.482
> rowVars(tmp5,na.rm=TRUE)
 [1] 8557.17005   29.29291   87.24806   75.35462   73.62717   70.01289
 [7]   75.30278   66.89166   95.68969   67.31568
> rowSd(tmp5,na.rm=TRUE)
 [1] 92.504973  5.412293  9.340667  8.680704  8.580628  8.367371  8.677717
 [8]  8.178732  9.782111  8.204614
> rowMax(tmp5,na.rm=TRUE)
 [1] 471.44573  79.70666  89.15138  89.42485  86.23976  84.71521  84.85976
 [8]  83.81819  87.25386  88.12162
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.24759 58.03189 57.38319 56.99107 55.97312 54.84357 55.89281 56.00538
 [9] 52.32604 55.26769
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.18131  68.37462  69.60122  65.76353  71.69504  73.87278  71.35336
 [8]  69.38622  68.89793  68.97179  67.24146  71.68069  74.66434  73.33714
[15]  69.83977  65.65036  68.24578  70.91509  70.46738  64.83624
> colSums(tmp5,na.rm=TRUE)
 [1] 1091.8131  683.7462  696.0122  657.6353  716.9504  738.7278  713.5336
 [8]  693.8622  688.9793  689.7179  672.4146  716.8069  746.6434  660.0343
[15]  698.3977  656.5036  682.4578  709.1509  704.6738  648.3624
> colVars(tmp5,na.rm=TRUE)
 [1] 16267.09249   109.89915    94.25452    30.17062    85.25270    49.77112
 [7]    63.11682   112.59284    65.17221    38.51946    48.69157    46.39289
[13]    36.46387   132.65986    79.49633    21.85959    68.44647    63.72149
[19]    33.63100    95.80283
> colSd(tmp5,na.rm=TRUE)
 [1] 127.542512  10.483279   9.708477   5.492779   9.233239   7.054865
 [7]   7.944609  10.610977   8.072931   6.206404   6.977934   6.811233
[13]   6.038532  11.517806   8.916071   4.675424   8.273238   7.982574
[19]   5.799224   9.787892
> colMax(tmp5,na.rm=TRUE)
 [1] 471.44573  88.12162  89.42485  73.28927  83.81819  83.36582  84.85976
 [8]  89.15138  81.00491  77.64760  80.67186  80.75170  84.56021  87.25386
[15]  84.65388  73.12618  81.61364  82.55299  81.57293  80.68423
> colMin(tmp5,na.rm=TRUE)
 [1] 55.89281 52.32604 56.00232 55.97312 61.13262 61.91752 60.66811 56.76752
 [9] 55.26769 60.24759 58.03593 60.90687 67.04953 57.71037 54.84357 57.76653
[17] 58.79411 56.99107 60.23055 54.32206
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 67.93856 71.24112 69.18783 71.12019 68.48372 71.27509 70.45295
 [9] 68.89948 68.77411
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1358.771 1424.822 1383.757 1422.404 1369.674 1425.502 1409.059
 [9] 1377.990 1375.482
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 29.29291 87.24806 75.35462 73.62717 70.01289 75.30278 66.89166
 [9] 95.68969 67.31568
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 5.412293 9.340667 8.680704 8.580628 8.367371 8.677717 8.178732
 [9] 9.782111 8.204614
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 79.70666 89.15138 89.42485 86.23976 84.71521 84.85976 83.81819
 [9] 87.25386 88.12162
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 58.03189 57.38319 56.99107 55.97312 54.84357 55.89281 56.00538
 [9] 52.32604 55.26769
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 68.92971 68.75754 69.44476 66.09037 71.66675 75.20114 72.41368 68.81042
 [9] 68.30734 69.94115 67.74381 70.78117 73.74483      NaN 69.83033 65.58486
[17] 68.26078 71.93237 69.98107 63.40315
> colSums(tmp5,na.rm=TRUE)
 [1] 620.3674 618.8179 625.0028 594.8133 645.0007 676.8103 651.7231 619.2937
 [9] 614.7660 629.4703 609.6943 637.0305 663.7035   0.0000 628.4730 590.2637
[17] 614.3470 647.3913 629.8296 570.6284
> colVars(tmp5,na.rm=TRUE)
 [1]  73.32470 121.98697 105.76092  32.74020  95.90028  36.14136  58.35827
 [8] 122.93696  69.39478  32.76332  51.93900  43.08925  31.51006        NA
[15]  89.43236  24.54376  76.99975  60.04470  35.17431  84.67359
> colSd(tmp5,na.rm=TRUE)
 [1]  8.562984 11.044771 10.284013  5.721905  9.792869  6.011768  7.639259
 [8] 11.087694  8.330353  5.723925  7.206871  6.564241  5.613382        NA
[15]  9.456869  4.954166  8.774950  7.748851  5.930794  9.201825
> colMax(tmp5,na.rm=TRUE)
 [1] 80.81688 88.12162 89.42485 73.28927 83.81819 83.36582 84.85976 89.15138
 [9] 81.00491 77.64760 80.67186 80.75170 84.56021     -Inf 84.65388 73.12618
[17] 81.61364 82.55299 81.57293 80.68423
> colMin(tmp5,na.rm=TRUE)
 [1] 55.89281 52.32604 56.00232 55.97312 61.13262 63.67544 60.66811 56.76752
 [9] 55.26769 61.72965 58.03593 60.90687 67.04953      Inf 54.84357 57.76653
[17] 58.79411 56.99107 60.23055 54.32206
> 
> 
> 
> 
> 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] 189.1673 274.8387 155.0119 336.0750 148.2390 216.4087 219.4313 183.4329
 [9] 199.7169 285.9391
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 189.1673 274.8387 155.0119 336.0750 148.2390 216.4087 219.4313 183.4329
 [9] 199.7169 285.9391
> 
> 
> 
> 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]  2.842171e-14  1.705303e-13 -1.136868e-13 -4.263256e-14 -1.421085e-13
 [6] -2.842171e-14 -5.684342e-14 -5.684342e-14  1.989520e-13  2.273737e-13
[11] -2.273737e-13  5.684342e-14  1.136868e-13  2.842171e-14 -9.947598e-14
[16]  0.000000e+00  1.421085e-13 -1.136868e-13 -2.842171e-14  0.000000e+00
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## 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)
+ }
10   19 
1   7 
6   9 
5   3 
2   12 
7   15 
5   15 
1   2 
4   16 
6   8 
10   12 
8   18 
10   7 
8   17 
3   6 
1   17 
8   7 
1   6 
2   15 
6   9 
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.448771
> Min(tmp)
[1] -3.006815
> mean(tmp)
[1] 0.005668239
> Sum(tmp)
[1] 0.5668239
> Var(tmp)
[1] 1.074549
> 
> rowMeans(tmp)
[1] 0.005668239
> rowSums(tmp)
[1] 0.5668239
> rowVars(tmp)
[1] 1.074549
> rowSd(tmp)
[1] 1.036605
> rowMax(tmp)
[1] 2.448771
> rowMin(tmp)
[1] -3.006815
> 
> colMeans(tmp)
  [1]  0.78030718  1.33624082 -3.00681525  0.62505538  0.06432584  0.54150564
  [7]  0.34756151  1.49732080 -0.82922830  2.34094691 -0.49578338 -0.79155558
 [13]  0.44978819 -0.29468920 -2.31695888  0.55629279 -0.30958436  0.55690342
 [19]  0.42100938 -1.21186156  0.15239859  1.16750357 -0.52649031 -0.97667345
 [25]  0.16432259  0.10138056  0.62621134 -0.67810933  0.16528874 -0.28141101
 [31] -1.04345528  1.45366604  0.16790660 -1.56045587  1.03932390 -1.50679066
 [37] -0.41296078  1.36003509  1.41672904 -0.05158097  0.67791343 -0.53780649
 [43]  0.13050935  2.36696333  0.48892716 -1.46734638  0.05025867  0.35704154
 [49]  0.44279194  0.01151796  0.55500610  0.54503452  0.30158921  0.06571920
 [55]  2.44877107  0.27106999  0.02225208 -2.07458958  1.32832828 -0.18596553
 [61]  1.13463729  1.19835366  1.49413134  0.07208254 -0.30053620 -0.71928433
 [67] -0.68802039  0.24161123 -0.59088197 -1.15356739 -1.71202889  0.29496952
 [73] -0.81743895 -1.09390503  0.42303082 -1.57066977  0.82728984 -1.05504324
 [79]  0.90455690 -0.48917707  0.43882943 -0.30931377  0.15401483 -0.26446092
 [85]  0.24196197 -0.70758356 -0.04339213 -0.15096078  1.11870459 -1.41458625
 [91] -0.13274409  0.67358116  0.36064705 -0.85748947  0.60473672  1.76115409
 [97] -2.77454731 -0.01856559  0.42654423 -1.77542180
> colSums(tmp)
  [1]  0.78030718  1.33624082 -3.00681525  0.62505538  0.06432584  0.54150564
  [7]  0.34756151  1.49732080 -0.82922830  2.34094691 -0.49578338 -0.79155558
 [13]  0.44978819 -0.29468920 -2.31695888  0.55629279 -0.30958436  0.55690342
 [19]  0.42100938 -1.21186156  0.15239859  1.16750357 -0.52649031 -0.97667345
 [25]  0.16432259  0.10138056  0.62621134 -0.67810933  0.16528874 -0.28141101
 [31] -1.04345528  1.45366604  0.16790660 -1.56045587  1.03932390 -1.50679066
 [37] -0.41296078  1.36003509  1.41672904 -0.05158097  0.67791343 -0.53780649
 [43]  0.13050935  2.36696333  0.48892716 -1.46734638  0.05025867  0.35704154
 [49]  0.44279194  0.01151796  0.55500610  0.54503452  0.30158921  0.06571920
 [55]  2.44877107  0.27106999  0.02225208 -2.07458958  1.32832828 -0.18596553
 [61]  1.13463729  1.19835366  1.49413134  0.07208254 -0.30053620 -0.71928433
 [67] -0.68802039  0.24161123 -0.59088197 -1.15356739 -1.71202889  0.29496952
 [73] -0.81743895 -1.09390503  0.42303082 -1.57066977  0.82728984 -1.05504324
 [79]  0.90455690 -0.48917707  0.43882943 -0.30931377  0.15401483 -0.26446092
 [85]  0.24196197 -0.70758356 -0.04339213 -0.15096078  1.11870459 -1.41458625
 [91] -0.13274409  0.67358116  0.36064705 -0.85748947  0.60473672  1.76115409
 [97] -2.77454731 -0.01856559  0.42654423 -1.77542180
> 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.78030718  1.33624082 -3.00681525  0.62505538  0.06432584  0.54150564
  [7]  0.34756151  1.49732080 -0.82922830  2.34094691 -0.49578338 -0.79155558
 [13]  0.44978819 -0.29468920 -2.31695888  0.55629279 -0.30958436  0.55690342
 [19]  0.42100938 -1.21186156  0.15239859  1.16750357 -0.52649031 -0.97667345
 [25]  0.16432259  0.10138056  0.62621134 -0.67810933  0.16528874 -0.28141101
 [31] -1.04345528  1.45366604  0.16790660 -1.56045587  1.03932390 -1.50679066
 [37] -0.41296078  1.36003509  1.41672904 -0.05158097  0.67791343 -0.53780649
 [43]  0.13050935  2.36696333  0.48892716 -1.46734638  0.05025867  0.35704154
 [49]  0.44279194  0.01151796  0.55500610  0.54503452  0.30158921  0.06571920
 [55]  2.44877107  0.27106999  0.02225208 -2.07458958  1.32832828 -0.18596553
 [61]  1.13463729  1.19835366  1.49413134  0.07208254 -0.30053620 -0.71928433
 [67] -0.68802039  0.24161123 -0.59088197 -1.15356739 -1.71202889  0.29496952
 [73] -0.81743895 -1.09390503  0.42303082 -1.57066977  0.82728984 -1.05504324
 [79]  0.90455690 -0.48917707  0.43882943 -0.30931377  0.15401483 -0.26446092
 [85]  0.24196197 -0.70758356 -0.04339213 -0.15096078  1.11870459 -1.41458625
 [91] -0.13274409  0.67358116  0.36064705 -0.85748947  0.60473672  1.76115409
 [97] -2.77454731 -0.01856559  0.42654423 -1.77542180
> colMin(tmp)
  [1]  0.78030718  1.33624082 -3.00681525  0.62505538  0.06432584  0.54150564
  [7]  0.34756151  1.49732080 -0.82922830  2.34094691 -0.49578338 -0.79155558
 [13]  0.44978819 -0.29468920 -2.31695888  0.55629279 -0.30958436  0.55690342
 [19]  0.42100938 -1.21186156  0.15239859  1.16750357 -0.52649031 -0.97667345
 [25]  0.16432259  0.10138056  0.62621134 -0.67810933  0.16528874 -0.28141101
 [31] -1.04345528  1.45366604  0.16790660 -1.56045587  1.03932390 -1.50679066
 [37] -0.41296078  1.36003509  1.41672904 -0.05158097  0.67791343 -0.53780649
 [43]  0.13050935  2.36696333  0.48892716 -1.46734638  0.05025867  0.35704154
 [49]  0.44279194  0.01151796  0.55500610  0.54503452  0.30158921  0.06571920
 [55]  2.44877107  0.27106999  0.02225208 -2.07458958  1.32832828 -0.18596553
 [61]  1.13463729  1.19835366  1.49413134  0.07208254 -0.30053620 -0.71928433
 [67] -0.68802039  0.24161123 -0.59088197 -1.15356739 -1.71202889  0.29496952
 [73] -0.81743895 -1.09390503  0.42303082 -1.57066977  0.82728984 -1.05504324
 [79]  0.90455690 -0.48917707  0.43882943 -0.30931377  0.15401483 -0.26446092
 [85]  0.24196197 -0.70758356 -0.04339213 -0.15096078  1.11870459 -1.41458625
 [91] -0.13274409  0.67358116  0.36064705 -0.85748947  0.60473672  1.76115409
 [97] -2.77454731 -0.01856559  0.42654423 -1.77542180
> colMedians(tmp)
  [1]  0.78030718  1.33624082 -3.00681525  0.62505538  0.06432584  0.54150564
  [7]  0.34756151  1.49732080 -0.82922830  2.34094691 -0.49578338 -0.79155558
 [13]  0.44978819 -0.29468920 -2.31695888  0.55629279 -0.30958436  0.55690342
 [19]  0.42100938 -1.21186156  0.15239859  1.16750357 -0.52649031 -0.97667345
 [25]  0.16432259  0.10138056  0.62621134 -0.67810933  0.16528874 -0.28141101
 [31] -1.04345528  1.45366604  0.16790660 -1.56045587  1.03932390 -1.50679066
 [37] -0.41296078  1.36003509  1.41672904 -0.05158097  0.67791343 -0.53780649
 [43]  0.13050935  2.36696333  0.48892716 -1.46734638  0.05025867  0.35704154
 [49]  0.44279194  0.01151796  0.55500610  0.54503452  0.30158921  0.06571920
 [55]  2.44877107  0.27106999  0.02225208 -2.07458958  1.32832828 -0.18596553
 [61]  1.13463729  1.19835366  1.49413134  0.07208254 -0.30053620 -0.71928433
 [67] -0.68802039  0.24161123 -0.59088197 -1.15356739 -1.71202889  0.29496952
 [73] -0.81743895 -1.09390503  0.42303082 -1.57066977  0.82728984 -1.05504324
 [79]  0.90455690 -0.48917707  0.43882943 -0.30931377  0.15401483 -0.26446092
 [85]  0.24196197 -0.70758356 -0.04339213 -0.15096078  1.11870459 -1.41458625
 [91] -0.13274409  0.67358116  0.36064705 -0.85748947  0.60473672  1.76115409
 [97] -2.77454731 -0.01856559  0.42654423 -1.77542180
> colRanges(tmp)
          [,1]     [,2]      [,3]      [,4]       [,5]      [,6]      [,7]
[1,] 0.7803072 1.336241 -3.006815 0.6250554 0.06432584 0.5415056 0.3475615
[2,] 0.7803072 1.336241 -3.006815 0.6250554 0.06432584 0.5415056 0.3475615
         [,8]       [,9]    [,10]      [,11]      [,12]     [,13]      [,14]
[1,] 1.497321 -0.8292283 2.340947 -0.4957834 -0.7915556 0.4497882 -0.2946892
[2,] 1.497321 -0.8292283 2.340947 -0.4957834 -0.7915556 0.4497882 -0.2946892
         [,15]     [,16]      [,17]     [,18]     [,19]     [,20]     [,21]
[1,] -2.316959 0.5562928 -0.3095844 0.5569034 0.4210094 -1.211862 0.1523986
[2,] -2.316959 0.5562928 -0.3095844 0.5569034 0.4210094 -1.211862 0.1523986
        [,22]      [,23]      [,24]     [,25]     [,26]     [,27]      [,28]
[1,] 1.167504 -0.5264903 -0.9766735 0.1643226 0.1013806 0.6262113 -0.6781093
[2,] 1.167504 -0.5264903 -0.9766735 0.1643226 0.1013806 0.6262113 -0.6781093
         [,29]     [,30]     [,31]    [,32]     [,33]     [,34]    [,35]
[1,] 0.1652887 -0.281411 -1.043455 1.453666 0.1679066 -1.560456 1.039324
[2,] 0.1652887 -0.281411 -1.043455 1.453666 0.1679066 -1.560456 1.039324
         [,36]      [,37]    [,38]    [,39]       [,40]     [,41]      [,42]
[1,] -1.506791 -0.4129608 1.360035 1.416729 -0.05158097 0.6779134 -0.5378065
[2,] -1.506791 -0.4129608 1.360035 1.416729 -0.05158097 0.6779134 -0.5378065
         [,43]    [,44]     [,45]     [,46]      [,47]     [,48]     [,49]
[1,] 0.1305094 2.366963 0.4889272 -1.467346 0.05025867 0.3570415 0.4427919
[2,] 0.1305094 2.366963 0.4889272 -1.467346 0.05025867 0.3570415 0.4427919
          [,50]     [,51]     [,52]     [,53]     [,54]    [,55]   [,56]
[1,] 0.01151796 0.5550061 0.5450345 0.3015892 0.0657192 2.448771 0.27107
[2,] 0.01151796 0.5550061 0.5450345 0.3015892 0.0657192 2.448771 0.27107
          [,57]    [,58]    [,59]      [,60]    [,61]    [,62]    [,63]
[1,] 0.02225208 -2.07459 1.328328 -0.1859655 1.134637 1.198354 1.494131
[2,] 0.02225208 -2.07459 1.328328 -0.1859655 1.134637 1.198354 1.494131
          [,64]      [,65]      [,66]      [,67]     [,68]     [,69]     [,70]
[1,] 0.07208254 -0.3005362 -0.7192843 -0.6880204 0.2416112 -0.590882 -1.153567
[2,] 0.07208254 -0.3005362 -0.7192843 -0.6880204 0.2416112 -0.590882 -1.153567
         [,71]     [,72]      [,73]     [,74]     [,75]    [,76]     [,77]
[1,] -1.712029 0.2949695 -0.8174389 -1.093905 0.4230308 -1.57067 0.8272898
[2,] -1.712029 0.2949695 -0.8174389 -1.093905 0.4230308 -1.57067 0.8272898
         [,78]     [,79]      [,80]     [,81]      [,82]     [,83]      [,84]
[1,] -1.055043 0.9045569 -0.4891771 0.4388294 -0.3093138 0.1540148 -0.2644609
[2,] -1.055043 0.9045569 -0.4891771 0.4388294 -0.3093138 0.1540148 -0.2644609
        [,85]      [,86]       [,87]      [,88]    [,89]     [,90]      [,91]
[1,] 0.241962 -0.7075836 -0.04339213 -0.1509608 1.118705 -1.414586 -0.1327441
[2,] 0.241962 -0.7075836 -0.04339213 -0.1509608 1.118705 -1.414586 -0.1327441
         [,92]     [,93]      [,94]     [,95]    [,96]     [,97]       [,98]
[1,] 0.6735812 0.3606471 -0.8574895 0.6047367 1.761154 -2.774547 -0.01856559
[2,] 0.6735812 0.3606471 -0.8574895 0.6047367 1.761154 -2.774547 -0.01856559
         [,99]    [,100]
[1,] 0.4265442 -1.775422
[2,] 0.4265442 -1.775422
> 
> 
> Max(tmp2)
[1] 2.120442
> Min(tmp2)
[1] -2.264134
> mean(tmp2)
[1] -0.07750044
> Sum(tmp2)
[1] -7.750044
> Var(tmp2)
[1] 0.8060876
> 
> rowMeans(tmp2)
  [1]  1.268656816 -1.390924920 -0.095787611 -0.299043983  0.029618136
  [6] -0.127087322 -0.074288563 -1.612409717 -0.462238369 -0.712800230
 [11]  0.626164353  2.120442285  0.585654750  0.827579860 -1.304491394
 [16]  0.884779691 -0.761047932 -0.444865622  0.227676281  0.007179428
 [21] -0.509941644 -0.263039050  1.862931760  0.008842624  0.321902244
 [26]  0.008534058  0.587884538  1.121518054 -1.809589241  0.351236167
 [31]  1.246945355  0.946463709  0.205562918 -1.004508958  0.300687120
 [36]  0.217996390  0.349889166  0.035803698  1.142626755 -0.658011835
 [41] -0.241704010 -0.770561660 -0.852601828  0.469394916  0.834106828
 [46]  0.342531117  0.874527093 -0.315187279  0.359189619 -0.145479408
 [51]  1.434143401  1.021796070 -0.183935589  0.666162656 -1.265614016
 [56] -1.116453030  0.522454997 -0.114228579 -2.264133608 -1.471310938
 [61]  0.440491919 -0.728896925 -0.096097470 -1.014934164 -0.912799097
 [66]  0.177770958 -2.179146720  0.094866431  0.248342640 -1.166252501
 [71]  0.098756960  0.546022812  1.718025514  0.199593254 -0.387365371
 [76] -0.727912583  0.264770469 -1.024829837  2.086007621 -0.970853230
 [81] -0.294379037  0.589846201 -0.861696359 -0.723448277 -1.754459647
 [86] -0.960392345  1.139827255 -1.191296216  0.400363951 -0.467328446
 [91]  0.383458494 -0.333637914 -1.387669655  0.568515295  0.613229947
 [96] -0.521050783 -0.852254981 -0.185576363 -0.520125443  0.402873071
> rowSums(tmp2)
  [1]  1.268656816 -1.390924920 -0.095787611 -0.299043983  0.029618136
  [6] -0.127087322 -0.074288563 -1.612409717 -0.462238369 -0.712800230
 [11]  0.626164353  2.120442285  0.585654750  0.827579860 -1.304491394
 [16]  0.884779691 -0.761047932 -0.444865622  0.227676281  0.007179428
 [21] -0.509941644 -0.263039050  1.862931760  0.008842624  0.321902244
 [26]  0.008534058  0.587884538  1.121518054 -1.809589241  0.351236167
 [31]  1.246945355  0.946463709  0.205562918 -1.004508958  0.300687120
 [36]  0.217996390  0.349889166  0.035803698  1.142626755 -0.658011835
 [41] -0.241704010 -0.770561660 -0.852601828  0.469394916  0.834106828
 [46]  0.342531117  0.874527093 -0.315187279  0.359189619 -0.145479408
 [51]  1.434143401  1.021796070 -0.183935589  0.666162656 -1.265614016
 [56] -1.116453030  0.522454997 -0.114228579 -2.264133608 -1.471310938
 [61]  0.440491919 -0.728896925 -0.096097470 -1.014934164 -0.912799097
 [66]  0.177770958 -2.179146720  0.094866431  0.248342640 -1.166252501
 [71]  0.098756960  0.546022812  1.718025514  0.199593254 -0.387365371
 [76] -0.727912583  0.264770469 -1.024829837  2.086007621 -0.970853230
 [81] -0.294379037  0.589846201 -0.861696359 -0.723448277 -1.754459647
 [86] -0.960392345  1.139827255 -1.191296216  0.400363951 -0.467328446
 [91]  0.383458494 -0.333637914 -1.387669655  0.568515295  0.613229947
 [96] -0.521050783 -0.852254981 -0.185576363 -0.520125443  0.402873071
> 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.268656816 -1.390924920 -0.095787611 -0.299043983  0.029618136
  [6] -0.127087322 -0.074288563 -1.612409717 -0.462238369 -0.712800230
 [11]  0.626164353  2.120442285  0.585654750  0.827579860 -1.304491394
 [16]  0.884779691 -0.761047932 -0.444865622  0.227676281  0.007179428
 [21] -0.509941644 -0.263039050  1.862931760  0.008842624  0.321902244
 [26]  0.008534058  0.587884538  1.121518054 -1.809589241  0.351236167
 [31]  1.246945355  0.946463709  0.205562918 -1.004508958  0.300687120
 [36]  0.217996390  0.349889166  0.035803698  1.142626755 -0.658011835
 [41] -0.241704010 -0.770561660 -0.852601828  0.469394916  0.834106828
 [46]  0.342531117  0.874527093 -0.315187279  0.359189619 -0.145479408
 [51]  1.434143401  1.021796070 -0.183935589  0.666162656 -1.265614016
 [56] -1.116453030  0.522454997 -0.114228579 -2.264133608 -1.471310938
 [61]  0.440491919 -0.728896925 -0.096097470 -1.014934164 -0.912799097
 [66]  0.177770958 -2.179146720  0.094866431  0.248342640 -1.166252501
 [71]  0.098756960  0.546022812  1.718025514  0.199593254 -0.387365371
 [76] -0.727912583  0.264770469 -1.024829837  2.086007621 -0.970853230
 [81] -0.294379037  0.589846201 -0.861696359 -0.723448277 -1.754459647
 [86] -0.960392345  1.139827255 -1.191296216  0.400363951 -0.467328446
 [91]  0.383458494 -0.333637914 -1.387669655  0.568515295  0.613229947
 [96] -0.521050783 -0.852254981 -0.185576363 -0.520125443  0.402873071
> rowMin(tmp2)
  [1]  1.268656816 -1.390924920 -0.095787611 -0.299043983  0.029618136
  [6] -0.127087322 -0.074288563 -1.612409717 -0.462238369 -0.712800230
 [11]  0.626164353  2.120442285  0.585654750  0.827579860 -1.304491394
 [16]  0.884779691 -0.761047932 -0.444865622  0.227676281  0.007179428
 [21] -0.509941644 -0.263039050  1.862931760  0.008842624  0.321902244
 [26]  0.008534058  0.587884538  1.121518054 -1.809589241  0.351236167
 [31]  1.246945355  0.946463709  0.205562918 -1.004508958  0.300687120
 [36]  0.217996390  0.349889166  0.035803698  1.142626755 -0.658011835
 [41] -0.241704010 -0.770561660 -0.852601828  0.469394916  0.834106828
 [46]  0.342531117  0.874527093 -0.315187279  0.359189619 -0.145479408
 [51]  1.434143401  1.021796070 -0.183935589  0.666162656 -1.265614016
 [56] -1.116453030  0.522454997 -0.114228579 -2.264133608 -1.471310938
 [61]  0.440491919 -0.728896925 -0.096097470 -1.014934164 -0.912799097
 [66]  0.177770958 -2.179146720  0.094866431  0.248342640 -1.166252501
 [71]  0.098756960  0.546022812  1.718025514  0.199593254 -0.387365371
 [76] -0.727912583  0.264770469 -1.024829837  2.086007621 -0.970853230
 [81] -0.294379037  0.589846201 -0.861696359 -0.723448277 -1.754459647
 [86] -0.960392345  1.139827255 -1.191296216  0.400363951 -0.467328446
 [91]  0.383458494 -0.333637914 -1.387669655  0.568515295  0.613229947
 [96] -0.521050783 -0.852254981 -0.185576363 -0.520125443  0.402873071
> 
> colMeans(tmp2)
[1] -0.07750044
> colSums(tmp2)
[1] -7.750044
> colVars(tmp2)
[1] 0.8060876
> colSd(tmp2)
[1] 0.8978238
> colMax(tmp2)
[1] 2.120442
> colMin(tmp2)
[1] -2.264134
> colMedians(tmp2)
[1] -0.03355457
> colRanges(tmp2)
          [,1]
[1,] -2.264134
[2,]  2.120442
> 
> 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.6456674 -3.4446176 -1.7368212 -0.4723140  0.3845706 -2.3143429
 [7] -0.1816999 -4.2390209 -1.1280353 -1.4688029
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0520708
[2,] -0.6454733
[3,] -0.2529771
[4,]  0.1076333
[5,]  1.1063707
> 
> rowApply(tmp,sum)
 [1]  7.649334 -3.183626 -3.742161 -3.913134 -1.184989  2.831605  3.202332
 [8] -2.169501 -6.892276 -8.844335
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    2    4   10    2    3    6    4    5    7     5
 [2,]    5    2    9    4    2    5    9   10    4     1
 [3,]    8   10    4    6    8    3    2    4    2     6
 [4,]    4    3    8    7    9    4    7    1    8     7
 [5,]    1    7    5    5    4    9    6    9   10     3
 [6,]   10    8    1   10    5    2    5    8    1     4
 [7,]    7    9    3    9    1    7    3    7    6    10
 [8,]    9    5    6    1    6   10    1    2    5     2
 [9,]    6    6    2    8    7    1   10    6    3     9
[10,]    3    1    7    3   10    8    8    3    9     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -3.6271936 -1.6183987 -1.5436156 -1.1066252 -1.9760401  4.2589812
 [7]  0.5475327  1.6514194 -1.2309337  2.3752275 -3.2228599 -2.7917491
[13]  0.5575329  2.3537466  0.5781374 -2.3680252 -0.5306779 -4.9074513
[19]  2.3296889  1.7570264
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.4957398
[2,] -0.6271352
[3,] -0.4966870
[4,] -0.1808885
[5,]  0.1732569
> 
> rowApply(tmp,sum)
[1] -0.8246598 -6.6763798  4.4638112 -1.3954921 -4.0815569
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    7    1   12    8   10
[2,]   10    3    7   20    4
[3,]    5   17    5    6   13
[4,]    2    2   17   13   18
[5,]   15    6    1   14   12
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]        [,5]       [,6]
[1,] -0.6271352 -0.2501577 -0.67863374 -1.3019025  0.01093465  1.3128664
[2,] -2.4957398 -1.4468215  0.34947646 -2.1050024 -0.74942605 -0.3349452
[3,]  0.1732569 -0.3123746 -0.45872877  1.1038115 -1.61687627  2.4883229
[4,] -0.1808885  1.3582901 -0.72484550  0.2984810  0.53094596  0.6798873
[5,] -0.4966870 -0.9673350 -0.03088404  0.8979872 -0.15161843  0.1128499
           [,7]       [,8]         [,9]      [,10]      [,11]      [,12]
[1,] -0.2379070 -0.5018303 -0.197288266 -0.1057811 -1.2113348 -0.4797814
[2,] -0.1063682  0.1877496  0.033814506  1.3085590  0.5423861 -0.1716227
[3,]  1.4108020  0.6814001 -0.007733528 -0.5467122 -0.8003587 -1.2249058
[4,]  0.0641603  0.7914579  0.093439985  0.7002933 -0.7445336  0.2892767
[5,] -0.5831544  0.4926422 -1.153166408  1.0188684 -1.0090189 -1.2047158
          [,13]      [,14]       [,15]      [,16]      [,17]       [,18]
[1,]  1.9376952  0.6043372 -0.84281021 -0.2189583 -0.6424224 -1.55562062
[2,] -0.2739715  0.7939149 -0.01133684 -0.4175748 -0.9197784 -1.01710689
[3,] -0.2978233  1.0676300  0.62868079  0.5560627 -0.3255402 -0.09905117
[4,] -0.3030590 -1.0924497  1.14207907 -1.6146379  1.1756400 -1.28646235
[5,] -0.5053084  0.9803142 -0.33847542 -0.6729169  0.1814231 -0.94921025
            [,19]       [,20]
[1,]  0.868160370  3.29290996
[2,]  0.008540196  0.14887383
[3,]  1.978194343  0.06575471
[4,]  0.008030879 -2.58059804
[5,] -0.533236887  0.83008592
> 
> 
> 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.17-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.17-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.17-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.17-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.609963 -0.4388923 -0.7750819 0.3856342 0.04678866 -1.640141 1.63575
            col8     col9    col10    col11      col12    col13     col14
row1 0.005836417 1.298982 -1.33843 1.295751 -0.1707335 1.092055 -1.363098
         col15      col16     col17      col18     col19  col20
row1 0.9268093 -0.3132005 0.3409242 -0.4688913 -1.171238 1.4239
> tmp[,"col10"]
          col10
row1 -1.3384302
row2 -0.7366876
row3 -1.3062448
row4 -0.4613174
row5  0.1736010
> tmp[c("row1","row5"),]
         col1       col2       col3       col4       col5       col6      col7
row1 0.609963 -0.4388923 -0.7750819  0.3856342 0.04678866 -1.6401408 1.6357502
row5 1.052255 -0.7220679  0.1477517 -0.8422070 0.46067436  0.3236469 0.3444297
            col8     col9     col10    col11      col12     col13     col14
row1 0.005836417 1.298982 -1.338430 1.295751 -0.1707335 1.0920550 -1.363098
row5 0.009633161 1.226547  0.173601 0.459570 -0.4245461 0.1140752 -1.246382
          col15      col16     col17      col18     col19       col20
row1  0.9268093 -0.3132005 0.3409242 -0.4688913 -1.171238  1.42390029
row5 -0.2924145  1.5001940 1.0113470 -0.8587642  1.631911 -0.09825657
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.6401408  1.42390029
row2  0.9157547  0.33757703
row3 -2.0558971 -0.17328685
row4 -1.9838960 -0.19492817
row5  0.3236469 -0.09825657
> tmp[c("row1","row5"),c("col6","col20")]
           col6       col20
row1 -1.6401408  1.42390029
row5  0.3236469 -0.09825657
> 
> 
> 
> 
> 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 49.29271 50.49018 50.38666 49.64038 49.14515 104.6431 49.44578 50.06264
         col9    col10   col11    col12    col13    col14    col15    col16
row1 47.13647 48.11571 51.1861 48.68042 50.97096 50.54216 48.87737 49.88208
        col17    col18    col19    col20
row1 50.74789 49.35403 48.61159 105.0315
> tmp[,"col10"]
        col10
row1 48.11571
row2 29.40554
row3 28.56009
row4 28.53449
row5 49.04299
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.29271 50.49018 50.38666 49.64038 49.14515 104.6431 49.44578 50.06264
row5 48.86698 50.02211 48.55588 48.39798 50.55233 104.9853 49.83172 51.37121
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.13647 48.11571 51.18610 48.68042 50.97096 50.54216 48.87737 49.88208
row5 49.32713 49.04299 49.05945 49.63591 50.56970 50.23605 49.72538 52.16110
        col17    col18    col19    col20
row1 50.74789 49.35403 48.61159 105.0315
row5 50.99531 47.76930 50.44848 104.1235
> tmp[,c("col6","col20")]
          col6     col20
row1 104.64309 105.03153
row2  74.20050  75.41714
row3  74.36119  74.61710
row4  75.87356  74.07451
row5 104.98529 104.12346
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.6431 105.0315
row5 104.9853 104.1235
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.6431 105.0315
row5 104.9853 104.1235
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,] -0.9828532
[2,]  0.4194113
[3,] -1.8437878
[4,]  0.4528811
[5,]  0.1797943
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.0379311  0.7989470
[2,]  0.5825871  0.6993458
[3,] -0.1726010 -0.8217381
[4,] -0.7249292  0.1063538
[5,] -1.3868063  0.1531594
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  0.62797361  1.0131070
[2,]  0.64871852 -1.1380189
[3,] -0.09427447  2.1515134
[4,]  0.72650794 -0.7195736
[5,]  0.11862215  0.7338416
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.6279736
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.6279736
[2,] 0.6487185
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]       [,2]         [,3]      [,4]       [,5]       [,6]
row3 -2.1204816 -0.7061544 -0.004360764 0.7624703 -0.5605193  0.8655715
row1  0.7749622  2.6927213 -0.836643149 0.3134319 -1.5231550 -0.6435410
           [,7]      [,8]        [,9]       [,10]      [,11]     [,12]
row3 -0.8096515 0.6546369  0.08925178  1.11295312 -0.3211285 -2.061164
row1 -0.4671704 0.7652350 -0.72139368 -0.07663114 -0.2060075 -1.346471
          [,13]     [,14]      [,15]      [,16]    [,17]      [,18]     [,19]
row3  0.1661993 0.9914731 -1.1587538 -0.7713248 0.522802 -0.2846216  1.564979
row1 -1.0072763 0.4419884  0.5733011 -1.2899423 1.166526  0.2915814 -1.163148
         [,20]
row3 0.5756144
row1 1.6869665
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]     [,2]      [,3]      [,4]       [,5]       [,6]      [,7]
row2 1.199533 0.164269 0.1834371 -0.196082 -0.1883747 -0.5118729 0.9898146
          [,8]      [,9]     [,10]
row2 0.7704773 0.7980719 0.3114465
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]     [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
row5 0.1728081 -2.66557 0.6354741 0.3009243 0.5692742 0.6891881 0.4885372
         [,8]      [,9]    [,10]       [,11]     [,12]      [,13]      [,14]
row5 1.920071 0.9418263 1.029774 -0.08488234 -1.563823 -0.1759639 -0.5537607
         [,15]      [,16]      [,17]      [,18]    [,19]      [,20]
row5 -0.563136 -0.5008974 -0.9558889 -0.2228845 1.851054 -0.5331445
> 
> 
> 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: 0xaaaae1d550d0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee68e653d2"
 [2] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee4b6cb9d" 
 [3] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee3de4cc7c"
 [4] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee68fa555d"
 [5] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee4cc249fc"
 [6] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee7ae80da9"
 [7] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee67fc178a"
 [8] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee109de0de"
 [9] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee5ef4865d"
[10] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee1bafc133"
[11] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee7a40de2e"
[12] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee3e479ea7"
[13] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee55097bde"
[14] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee4bffdea4"
[15] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM2814ee4338dfba"
> 
> 
> ### 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: 0xaaaae2f5fde0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xaaaae2f5fde0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0xaaaae2f5fde0>
> rowMedians(tmp)
  [1] -0.126630363  0.077495606  0.088357017  0.229853170  0.279349408
  [6] -0.235238669  0.303521068  0.037173031  0.018665716  0.411129785
 [11]  0.101464775  0.778102007 -0.795153113 -0.160354159 -0.620874663
 [16] -0.205135694 -0.041982390 -0.129326635  0.022410920  0.824771616
 [21]  0.197336307 -0.597275363 -0.343191317  0.285395227  0.113352795
 [26] -0.229249983  0.404258946 -0.405508146  0.144323260  0.079158690
 [31]  0.655037682  0.457633387  0.207859128 -0.061954042 -0.191615426
 [36]  0.032982851 -0.091298449  0.041282864 -0.637170270  0.782884075
 [41]  0.124239804  1.070122500  0.347949682  0.223927114  0.159428847
 [46] -0.151023490  0.017158023  0.226065376  0.572783286 -0.018222573
 [51] -0.186971969  0.140106937  0.022222388  0.008819806 -0.293726366
 [56]  0.031277105 -0.038585493  0.173701904 -0.557198365  0.218845387
 [61]  0.485377829  0.121466834 -0.441806540  0.022411332 -0.710801500
 [66] -0.302327464  0.058767128  0.135456855 -0.311104010 -0.261449379
 [71] -0.544866645 -0.227345556  0.092378123  0.353848267 -0.181588996
 [76]  0.342629758 -0.115462437  0.386886756 -0.114003908 -0.446105555
 [81] -0.239984029 -0.097558318  0.174778200  0.189620832 -0.078067396
 [86]  0.317379903  0.127397812 -0.004854447 -0.328368331 -0.111934025
 [91] -0.366609598 -0.216340706 -0.393177930  0.124021515 -0.153200884
 [96] -0.471345671  0.332795379 -0.418713227  0.915468079  0.133867366
[101] -0.518164406  0.102208752 -0.557012553  0.464382594  0.154441754
[106] -0.915464953 -0.317857154 -0.108618202 -0.498855160 -0.009407520
[111]  0.029211124 -0.093238163 -0.111559464  0.123068696 -0.450808711
[116] -0.475482623 -0.239170837  0.171674873 -0.351233964 -0.485505034
[121]  0.366932618  0.659284444 -0.057256616  0.134383390 -0.293687704
[126] -0.133606321 -0.306309712 -0.240906331 -0.035127580  0.270784381
[131]  0.574479863 -0.148533134  0.294987332 -0.660122844 -0.332664206
[136] -0.618439572 -0.276581478 -0.064784518 -0.223132557 -0.261974965
[141] -0.287240426 -0.173875556 -0.241137839  0.083515125 -0.314301944
[146] -0.264930451  0.359110860  0.422528209 -0.420785435 -0.026277323
[151] -0.004511701  0.418301056  0.440090505  0.047786217 -0.711541498
[156] -0.187988312  0.064724826 -0.202383884 -0.041823335  0.162968999
[161]  0.044306377 -0.268209681 -0.203025350  0.646543200  0.157567970
[166] -0.594316270 -0.017497293  0.065779469 -0.082068519  0.279954996
[171] -0.443355360  0.022689113  0.467394000 -0.554582725  0.020741412
[176] -0.217373232  0.268392435 -0.723870610 -0.376833359  0.158511739
[181] -0.002612272 -0.266285294  0.349227549 -0.074786755 -0.270852696
[186] -0.293978870  0.074994234 -0.191132638  0.082341848 -0.075972408
[191]  0.046231707  0.013549083 -0.849586020 -0.138425213  0.413057183
[196] -0.448842458 -0.108985669 -0.035829641  0.386983264 -0.443758309
[201] -0.109913187  0.176254487 -0.012546354  0.159122785 -0.114608729
[206] -0.566446365  0.330780494 -0.251006696 -0.311476485 -0.191226084
[211]  0.206057572 -0.095860690  0.208312007 -0.208622474 -0.560313541
[216]  0.687831819 -0.047499240  0.597128886 -0.272252672  0.019421718
[221]  0.065052431  0.014847734  0.126769578 -0.441415192 -0.473793650
[226] -0.018417157 -0.302704211  0.060459203 -0.408322791  0.386762582
> 
> proc.time()
   user  system elapsed 
  1.905   1.409   3.336 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R Under development (unstable) (2023-01-14 r83615) -- "Unsuffered Consequences"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

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: 0xaaaae7763910>
> .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: 0xaaaae7763910>
> .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: 0xaaaae7763910>
> .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: 0xaaaae7763910>
> 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: 0xaaaae7f242a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaae7f242a0>
> .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: 0xaaaae7f242a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaae7f242a0>
> .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: 0xaaaae7f242a0>
> 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: 0xaaaae7711df0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaae7711df0>
> .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: 0xaaaae7711df0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xaaaae7711df0>
> .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: 0xaaaae7711df0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0xaaaae7711df0>
> .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: 0xaaaae7711df0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0xaaaae7711df0>
> .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: 0xaaaae7711df0>
> 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: 0xaaaae7f8f3a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xaaaae7f8f3a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaae7f8f3a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaae7f8f3a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile28155c2549715e" "BufferedMatrixFile28155c54073ffb"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile28155c2549715e" "BufferedMatrixFile28155c54073ffb"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaae98c89b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaae98c89b0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xaaaae98c89b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xaaaae98c89b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xaaaae98c89b0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xaaaae98c89b0>
> .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: 0xaaaae939f010>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaae939f010>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xaaaae939f010>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xaaaae939f010>
> 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: 0xaaaae98d4530>
> .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: 0xaaaae98d4530>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.324   0.055   0.363 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R Under development (unstable) (2023-01-14 r83615) -- "Unsuffered Consequences"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

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.334   0.049   0.368 

Example timings