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

This page was generated on 2023-06-06 11:00:27 -0000 (Tue, 06 Jun 2023).

HostnameOSArch (*)R versionInstalled pkgs
kunpeng2Linux (openEuler 22.03 LTS-SP1)aarch644.3.0 (2023-04-21) -- "Already Tomorrow" 4366
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 kunpeng2


To the developers/maintainers of the BufferedMatrix package:
- Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information.

- Use the following Renviron settings to reproduce errors and warnings.

Note: If "R CMD check" recently failed on the Linux builder over a missing dependency, add the missing dependency to "Suggests" in your DESCRIPTION file. See the Renviron.bioc for details.

raw results

Package 241/2199HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.65.0  (landing page)
Ben Bolstad
Snapshot Date: 2023-06-05 06:35:06 -0000 (Mon, 05 Jun 2023)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 5a16207
git_last_commit_date: 2023-04-25 13:44:48 -0000 (Tue, 25 Apr 2023)
kunpeng2Linux (openEuler 22.03 LTS-SP1) / aarch64  OK    OK    OK  

Summary

Package: BufferedMatrix
Version: 1.65.0
Command: /home/biocbuild/R/R-4.3.0/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R-4.3.0/site-library --timings BufferedMatrix_1.65.0.tar.gz
StartedAt: 2023-06-05 18:40:41 -0000 (Mon, 05 Jun 2023)
EndedAt: 2023-06-05 18:41:10 -0000 (Mon, 05 Jun 2023)
EllapsedTime: 29.0 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory ‘/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.3.0 (2023-04-21)
* using platform: aarch64-unknown-linux-gnu (64-bit)
* R was compiled by
    gcc (GCC) 10.3.1
    GNU Fortran (GCC) 10.3.1
* running under: openEuler 22.03 (LTS-SP1)
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.65.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 (GCC) 10.3.1’
* 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 loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
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.18-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.



Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/R/R-4.3.0/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


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

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
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.320   0.044   0.352 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
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.18-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 457526 24.5     981808 52.5   650817 34.8
Vcells 842770  6.5    8388608 64.0  2061571 15.8
> 
> 
> 
> 
> ##
> ## 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 Jun  5 18:41:01 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 Jun  5 18:41:02 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: 0x170ef770>
> 
> 
> 
> 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 Jun  5 18:41:02 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 Jun  5 18:41:02 2023"
> 
> ColMode(tmp2)
<pointer: 0x170ef770>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 100.3155496 -0.5270337  1.1742369 0.49275890
[2,]   0.5849984 -1.3258040 -0.6484462 1.31064692
[3,]  -1.5082038 -1.8756988 -1.7082707 0.81419418
[4,]   2.5529593  0.1041287  1.5154364 0.09352199
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-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,] 100.3155496 0.5270337 1.1742369 0.49275890
[2,]   0.5849984 1.3258040 0.6484462 1.31064692
[3,]   1.5082038 1.8756988 1.7082707 0.81419418
[4,]   2.5529593 0.1041287 1.5154364 0.09352199
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-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.0157651 0.7259709 1.0836221 0.7019679
[2,]  0.7648519 1.1514356 0.8052616 1.1448349
[3,]  1.2280895 1.3695615 1.3070083 0.9023271
[4,]  1.5977983 0.3226898 1.2310306 0.3058136
> 
> 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.18-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,] 225.47320 32.78674 37.01046 32.51244
[2,]  33.23352 37.84016 33.70106 37.75900
[3,]  38.78910 40.57131 39.77835 34.83747
[4,]  43.53094 28.33103 38.82574 28.15166
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x163cc380>
> exp(tmp5)
<pointer: 0x163cc380>
> log(tmp5,2)
<pointer: 0x163cc380>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.2929
> Min(tmp5)
[1] 52.45497
> mean(tmp5)
[1] 73.12123
> Sum(tmp5)
[1] 14624.25
> Var(tmp5)
[1] 865.8209
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.37630 67.90427 73.12221 69.86892 71.68502 71.37263 70.79806 72.86449
 [9] 73.55346 70.66695
> rowSums(tmp5)
 [1] 1787.526 1358.085 1462.444 1397.378 1433.700 1427.453 1415.961 1457.290
 [9] 1471.069 1413.339
> rowVars(tmp5)
 [1] 8035.62907   57.27718   80.79652   83.65886   69.11297   85.57967
 [7]   74.96087   77.58471   71.49638   96.64399
> rowSd(tmp5)
 [1] 89.641670  7.568169  8.988688  9.146522  8.313421  9.250928  8.657995
 [8]  8.808218  8.455553  9.830767
> rowMax(tmp5)
 [1] 469.29292  78.75934  84.68889  90.60395  86.29349  88.92496  85.21875
 [8]  87.19232  89.74008  93.12952
> rowMin(tmp5)
 [1] 52.45497 53.59228 55.28424 56.38790 55.58273 58.82742 53.87534 53.13138
 [9] 58.63558 57.60934
> 
> colMeans(tmp5)
 [1] 110.01952  73.44414  73.33788  71.79760  68.73292  75.38037  74.62225
 [8]  67.86172  70.92570  69.38137  71.47834  66.43136  71.37040  72.34080
[15]  71.61602  71.50762  71.78473  71.60851  66.51805  72.26530
> colSums(tmp5)
 [1] 1100.1952  734.4414  733.3788  717.9760  687.3292  753.8037  746.2225
 [8]  678.6172  709.2570  693.8137  714.7834  664.3136  713.7040  723.4080
[15]  716.1602  715.0762  717.8473  716.0851  665.1805  722.6530
> colVars(tmp5)
 [1] 16057.44922    93.92457    96.13626    43.91081    58.53987   127.44421
 [7]    84.99041    72.82916    31.39833   114.50040    57.08606    34.94579
[13]    48.72697    76.75390    82.93259    36.93238    96.57059    81.33990
[19]    60.56267    75.20314
> colSd(tmp5)
 [1] 126.717991   9.691469   9.804910   6.626523   7.651135  11.289119
 [7]   9.219024   8.534000   5.603421  10.700486   7.555532   5.911497
[13]   6.980471   8.760930   9.106733   6.077202   9.827034   9.018864
[19]   7.782202   8.671974
> colMax(tmp5)
 [1] 469.29292  89.12400  87.19232  81.25145  78.29301  93.12952  89.96853
 [8]  79.09390  81.00748  83.83299  81.39862  74.77780  81.17246  85.04668
[15]  83.72521  79.19200  88.92496  86.29349  77.44704  81.82858
> colMin(tmp5)
 [1] 53.13138 58.96732 57.60934 58.59399 56.38790 62.84909 61.07238 52.45497
 [9] 64.82770 53.87534 60.34313 55.40136 61.05314 55.58273 58.46130 60.19625
[17] 59.05537 58.82742 53.59228 61.00961
> 
> 
> ### 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] 89.37630 67.90427 73.12221       NA 71.68502 71.37263 70.79806 72.86449
 [9] 73.55346 70.66695
> rowSums(tmp5)
 [1] 1787.526 1358.085 1462.444       NA 1433.700 1427.453 1415.961 1457.290
 [9] 1471.069 1413.339
> rowVars(tmp5)
 [1] 8035.62907   57.27718   80.79652   85.22327   69.11297   85.57967
 [7]   74.96087   77.58471   71.49638   96.64399
> rowSd(tmp5)
 [1] 89.641670  7.568169  8.988688  9.231645  8.313421  9.250928  8.657995
 [8]  8.808218  8.455553  9.830767
> rowMax(tmp5)
 [1] 469.29292  78.75934  84.68889        NA  86.29349  88.92496  85.21875
 [8]  87.19232  89.74008  93.12952
> rowMin(tmp5)
 [1] 52.45497 53.59228 55.28424       NA 55.58273 58.82742 53.87534 53.13138
 [9] 58.63558 57.60934
> 
> colMeans(tmp5)
 [1] 110.01952  73.44414  73.33788  71.79760  68.73292  75.38037  74.62225
 [8]  67.86172  70.92570  69.38137  71.47834  66.43136  71.37040  72.34080
[15]        NA  71.50762  71.78473  71.60851  66.51805  72.26530
> colSums(tmp5)
 [1] 1100.1952  734.4414  733.3788  717.9760  687.3292  753.8037  746.2225
 [8]  678.6172  709.2570  693.8137  714.7834  664.3136  713.7040  723.4080
[15]        NA  715.0762  717.8473  716.0851  665.1805  722.6530
> colVars(tmp5)
 [1] 16057.44922    93.92457    96.13626    43.91081    58.53987   127.44421
 [7]    84.99041    72.82916    31.39833   114.50040    57.08606    34.94579
[13]    48.72697    76.75390          NA    36.93238    96.57059    81.33990
[19]    60.56267    75.20314
> colSd(tmp5)
 [1] 126.717991   9.691469   9.804910   6.626523   7.651135  11.289119
 [7]   9.219024   8.534000   5.603421  10.700486   7.555532   5.911497
[13]   6.980471   8.760930         NA   6.077202   9.827034   9.018864
[19]   7.782202   8.671974
> colMax(tmp5)
 [1] 469.29292  89.12400  87.19232  81.25145  78.29301  93.12952  89.96853
 [8]  79.09390  81.00748  83.83299  81.39862  74.77780  81.17246  85.04668
[15]        NA  79.19200  88.92496  86.29349  77.44704  81.82858
> colMin(tmp5)
 [1] 53.13138 58.96732 57.60934 58.59399 56.38790 62.84909 61.07238 52.45497
 [9] 64.82770 53.87534 60.34313 55.40136 61.05314 55.58273       NA 60.19625
[17] 59.05537 58.82742 53.59228 61.00961
> 
> Max(tmp5,na.rm=TRUE)
[1] 469.2929
> Min(tmp5,na.rm=TRUE)
[1] 52.45497
> mean(tmp5,na.rm=TRUE)
[1] 73.10109
> Sum(tmp5,na.rm=TRUE)
[1] 14547.12
> Var(tmp5,na.rm=TRUE)
[1] 870.1122
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.37630 67.90427 73.12221 69.48676 71.68502 71.37263 70.79806 72.86449
 [9] 73.55346 70.66695
> rowSums(tmp5,na.rm=TRUE)
 [1] 1787.526 1358.085 1462.444 1320.248 1433.700 1427.453 1415.961 1457.290
 [9] 1471.069 1413.339
> rowVars(tmp5,na.rm=TRUE)
 [1] 8035.62907   57.27718   80.79652   85.22327   69.11297   85.57967
 [7]   74.96087   77.58471   71.49638   96.64399
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.641670  7.568169  8.988688  9.231645  8.313421  9.250928  8.657995
 [8]  8.808218  8.455553  9.830767
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.29292  78.75934  84.68889  90.60395  86.29349  88.92496  85.21875
 [8]  87.19232  89.74008  93.12952
> rowMin(tmp5,na.rm=TRUE)
 [1] 52.45497 53.59228 55.28424 56.38790 55.58273 58.82742 53.87534 53.13138
 [9] 58.63558 57.60934
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.01952  73.44414  73.33788  71.79760  68.73292  75.38037  74.62225
 [8]  67.86172  70.92570  69.38137  71.47834  66.43136  71.37040  72.34080
[15]  71.00335  71.50762  71.78473  71.60851  66.51805  72.26530
> colSums(tmp5,na.rm=TRUE)
 [1] 1100.1952  734.4414  733.3788  717.9760  687.3292  753.8037  746.2225
 [8]  678.6172  709.2570  693.8137  714.7834  664.3136  713.7040  723.4080
[15]  639.0301  715.0762  717.8473  716.0851  665.1805  722.6530
> colVars(tmp5,na.rm=TRUE)
 [1] 16057.44922    93.92457    96.13626    43.91081    58.53987   127.44421
 [7]    84.99041    72.82916    31.39833   114.50040    57.08606    34.94579
[13]    48.72697    76.75390    89.07626    36.93238    96.57059    81.33990
[19]    60.56267    75.20314
> colSd(tmp5,na.rm=TRUE)
 [1] 126.717991   9.691469   9.804910   6.626523   7.651135  11.289119
 [7]   9.219024   8.534000   5.603421  10.700486   7.555532   5.911497
[13]   6.980471   8.760930   9.438022   6.077202   9.827034   9.018864
[19]   7.782202   8.671974
> colMax(tmp5,na.rm=TRUE)
 [1] 469.29292  89.12400  87.19232  81.25145  78.29301  93.12952  89.96853
 [8]  79.09390  81.00748  83.83299  81.39862  74.77780  81.17246  85.04668
[15]  83.72521  79.19200  88.92496  86.29349  77.44704  81.82858
> colMin(tmp5,na.rm=TRUE)
 [1] 53.13138 58.96732 57.60934 58.59399 56.38790 62.84909 61.07238 52.45497
 [9] 64.82770 53.87534 60.34313 55.40136 61.05314 55.58273 58.46130 60.19625
[17] 59.05537 58.82742 53.59228 61.00961
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.37630 67.90427 73.12221      NaN 71.68502 71.37263 70.79806 72.86449
 [9] 73.55346 70.66695
> rowSums(tmp5,na.rm=TRUE)
 [1] 1787.526 1358.085 1462.444    0.000 1433.700 1427.453 1415.961 1457.290
 [9] 1471.069 1413.339
> rowVars(tmp5,na.rm=TRUE)
 [1] 8035.62907   57.27718   80.79652         NA   69.11297   85.57967
 [7]   74.96087   77.58471   71.49638   96.64399
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.641670  7.568169  8.988688        NA  8.313421  9.250928  8.657995
 [8]  8.808218  8.455553  9.830767
> rowMax(tmp5,na.rm=TRUE)
 [1] 469.29292  78.75934  84.68889        NA  86.29349  88.92496  85.21875
 [8]  87.19232  89.74008  93.12952
> rowMin(tmp5,na.rm=TRUE)
 [1] 52.45497 53.59228 55.28424       NA 55.58273 58.82742 53.87534 53.13138
 [9] 58.63558 57.60934
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.17681  75.05267  72.50756  73.26467  70.10459  75.77821  74.67563
 [8]  67.20741  69.88235  69.78522  72.39680  66.49416  70.97887  73.08899
[15]       NaN  72.13200  72.50855  72.93185  66.47954  71.20271
> colSums(tmp5,na.rm=TRUE)
 [1] 1009.5913  675.4741  652.5681  659.3820  630.9413  682.0039  672.0806
 [8]  604.8667  628.9411  628.0669  651.5712  598.4474  638.8098  657.8009
[15]    0.0000  649.1880  652.5770  656.3866  598.3159  640.8244
> colVars(tmp5,na.rm=TRUE)
 [1] 18012.27421    76.55705   100.39732    25.18641    44.69073   141.59406
 [7]    95.58216    77.11651    23.07665   126.97820    54.73168    39.26965
[13]    53.09326    80.05052          NA    37.16301   102.74782    71.80627
[19]    68.11632    71.90126
> colSd(tmp5,na.rm=TRUE)
 [1] 134.209814   8.749689  10.019846   5.018606   6.685113  11.899330
 [7]   9.776613   8.781601   4.803816  11.268460   7.398086   6.266550
[13]   7.286512   8.947095         NA   6.096147  10.136460   8.473858
[19]   8.253261   8.479461
> colMax(tmp5,na.rm=TRUE)
 [1] 469.29292  89.12400  87.19232  81.25145  78.29301  93.12952  89.96853
 [8]  79.09390  81.00748  83.83299  81.39862  74.77780  81.17246  85.04668
[15]      -Inf  79.19200  88.92496  86.29349  77.44704  80.59855
> colMin(tmp5,na.rm=TRUE)
 [1] 53.13138 64.99138 57.60934 67.11612 59.12891 62.84909 61.07238 52.45497
 [9] 64.82770 53.87534 60.34313 55.40136 61.05314 55.58273      Inf 60.19625
[17] 59.05537 58.82742 53.59228 61.00961
> 
> 
> 
> 
> 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.8172 235.8110 271.1827 209.6844 212.8067 196.7636 228.6284 163.9169
 [9] 241.2413 197.0718
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 189.8172 235.8110 271.1827 209.6844 212.8067 196.7636 228.6284 163.9169
 [9] 241.2413 197.0718
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.136868e-13  8.526513e-14  1.989520e-13 -5.684342e-14 -1.421085e-14
 [6]  1.136868e-13 -8.526513e-14 -1.136868e-13 -5.684342e-14 -1.136868e-13
[11]  1.705303e-13  2.842171e-14 -5.684342e-14  1.421085e-13  0.000000e+00
[16] -1.705303e-13  1.136868e-13  2.842171e-14  0.000000e+00  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)
+ }
8   4 
6   3 
9   18 
4   5 
2   15 
1   6 
8   12 
7   17 
3   16 
3   16 
2   11 
5   11 
4   2 
1   17 
4   17 
8   10 
6   2 
8   9 
7   19 
1   1 
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.00119
> Min(tmp)
[1] -1.956607
> mean(tmp)
[1] -0.1596849
> Sum(tmp)
[1] -15.96849
> Var(tmp)
[1] 1.038901
> 
> rowMeans(tmp)
[1] -0.1596849
> rowSums(tmp)
[1] -15.96849
> rowVars(tmp)
[1] 1.038901
> rowSd(tmp)
[1] 1.019265
> rowMax(tmp)
[1] 2.00119
> rowMin(tmp)
[1] -1.956607
> 
> colMeans(tmp)
  [1] -0.02506444  0.94963434 -0.69718359  0.48158788 -1.50635732 -0.99458703
  [7] -0.68470896 -0.26998774  1.47837870  0.18231673  0.58388747  0.34238546
 [13] -0.33754507 -0.16202593 -0.80680220 -1.04628923  1.69967121 -1.74025251
 [19]  0.22622234  0.44398976  0.47455980 -1.26003808 -0.87570944 -0.06111066
 [25] -0.89031261  1.17875051  0.10297215 -0.53277115  0.23340794  1.51262894
 [31]  2.00118951 -0.55046222  0.88176132 -0.72561496 -1.28710310  1.24901009
 [37] -1.47314376 -1.33792301 -0.63577622  0.28930512  1.29401375  1.73589093
 [43]  0.34267672  1.18987359 -1.39095316 -1.93492402 -0.86462818 -1.04629085
 [49] -1.95306747  1.15212553  0.09857801  0.86274739 -0.58744754  0.62976108
 [55]  1.19559429  0.18016967 -0.22897548 -0.04324310 -0.85831400 -0.96226332
 [61]  1.75781503 -0.72694690  1.90989975 -0.24191512  0.12439316  0.26134512
 [67]  0.39510898  0.87529576 -0.35572290  1.48321011 -1.44993928 -0.53856756
 [73] -1.81655866 -1.23138997  0.22723513  0.24470385 -1.83922115  0.40748292
 [79] -1.04648316 -1.52825122 -0.15037950 -1.10269577 -1.15883390 -0.67039537
 [85]  0.25254746 -0.97927595 -1.32523358  0.25397417 -0.30041399 -1.95660680
 [91] -0.96232557  0.19549957  0.89327839  0.60350218 -1.71949416  0.51110595
 [97] -1.30838604  0.97854810 -1.13634909  0.97973704
> colSums(tmp)
  [1] -0.02506444  0.94963434 -0.69718359  0.48158788 -1.50635732 -0.99458703
  [7] -0.68470896 -0.26998774  1.47837870  0.18231673  0.58388747  0.34238546
 [13] -0.33754507 -0.16202593 -0.80680220 -1.04628923  1.69967121 -1.74025251
 [19]  0.22622234  0.44398976  0.47455980 -1.26003808 -0.87570944 -0.06111066
 [25] -0.89031261  1.17875051  0.10297215 -0.53277115  0.23340794  1.51262894
 [31]  2.00118951 -0.55046222  0.88176132 -0.72561496 -1.28710310  1.24901009
 [37] -1.47314376 -1.33792301 -0.63577622  0.28930512  1.29401375  1.73589093
 [43]  0.34267672  1.18987359 -1.39095316 -1.93492402 -0.86462818 -1.04629085
 [49] -1.95306747  1.15212553  0.09857801  0.86274739 -0.58744754  0.62976108
 [55]  1.19559429  0.18016967 -0.22897548 -0.04324310 -0.85831400 -0.96226332
 [61]  1.75781503 -0.72694690  1.90989975 -0.24191512  0.12439316  0.26134512
 [67]  0.39510898  0.87529576 -0.35572290  1.48321011 -1.44993928 -0.53856756
 [73] -1.81655866 -1.23138997  0.22723513  0.24470385 -1.83922115  0.40748292
 [79] -1.04648316 -1.52825122 -0.15037950 -1.10269577 -1.15883390 -0.67039537
 [85]  0.25254746 -0.97927595 -1.32523358  0.25397417 -0.30041399 -1.95660680
 [91] -0.96232557  0.19549957  0.89327839  0.60350218 -1.71949416  0.51110595
 [97] -1.30838604  0.97854810 -1.13634909  0.97973704
> 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.02506444  0.94963434 -0.69718359  0.48158788 -1.50635732 -0.99458703
  [7] -0.68470896 -0.26998774  1.47837870  0.18231673  0.58388747  0.34238546
 [13] -0.33754507 -0.16202593 -0.80680220 -1.04628923  1.69967121 -1.74025251
 [19]  0.22622234  0.44398976  0.47455980 -1.26003808 -0.87570944 -0.06111066
 [25] -0.89031261  1.17875051  0.10297215 -0.53277115  0.23340794  1.51262894
 [31]  2.00118951 -0.55046222  0.88176132 -0.72561496 -1.28710310  1.24901009
 [37] -1.47314376 -1.33792301 -0.63577622  0.28930512  1.29401375  1.73589093
 [43]  0.34267672  1.18987359 -1.39095316 -1.93492402 -0.86462818 -1.04629085
 [49] -1.95306747  1.15212553  0.09857801  0.86274739 -0.58744754  0.62976108
 [55]  1.19559429  0.18016967 -0.22897548 -0.04324310 -0.85831400 -0.96226332
 [61]  1.75781503 -0.72694690  1.90989975 -0.24191512  0.12439316  0.26134512
 [67]  0.39510898  0.87529576 -0.35572290  1.48321011 -1.44993928 -0.53856756
 [73] -1.81655866 -1.23138997  0.22723513  0.24470385 -1.83922115  0.40748292
 [79] -1.04648316 -1.52825122 -0.15037950 -1.10269577 -1.15883390 -0.67039537
 [85]  0.25254746 -0.97927595 -1.32523358  0.25397417 -0.30041399 -1.95660680
 [91] -0.96232557  0.19549957  0.89327839  0.60350218 -1.71949416  0.51110595
 [97] -1.30838604  0.97854810 -1.13634909  0.97973704
> colMin(tmp)
  [1] -0.02506444  0.94963434 -0.69718359  0.48158788 -1.50635732 -0.99458703
  [7] -0.68470896 -0.26998774  1.47837870  0.18231673  0.58388747  0.34238546
 [13] -0.33754507 -0.16202593 -0.80680220 -1.04628923  1.69967121 -1.74025251
 [19]  0.22622234  0.44398976  0.47455980 -1.26003808 -0.87570944 -0.06111066
 [25] -0.89031261  1.17875051  0.10297215 -0.53277115  0.23340794  1.51262894
 [31]  2.00118951 -0.55046222  0.88176132 -0.72561496 -1.28710310  1.24901009
 [37] -1.47314376 -1.33792301 -0.63577622  0.28930512  1.29401375  1.73589093
 [43]  0.34267672  1.18987359 -1.39095316 -1.93492402 -0.86462818 -1.04629085
 [49] -1.95306747  1.15212553  0.09857801  0.86274739 -0.58744754  0.62976108
 [55]  1.19559429  0.18016967 -0.22897548 -0.04324310 -0.85831400 -0.96226332
 [61]  1.75781503 -0.72694690  1.90989975 -0.24191512  0.12439316  0.26134512
 [67]  0.39510898  0.87529576 -0.35572290  1.48321011 -1.44993928 -0.53856756
 [73] -1.81655866 -1.23138997  0.22723513  0.24470385 -1.83922115  0.40748292
 [79] -1.04648316 -1.52825122 -0.15037950 -1.10269577 -1.15883390 -0.67039537
 [85]  0.25254746 -0.97927595 -1.32523358  0.25397417 -0.30041399 -1.95660680
 [91] -0.96232557  0.19549957  0.89327839  0.60350218 -1.71949416  0.51110595
 [97] -1.30838604  0.97854810 -1.13634909  0.97973704
> colMedians(tmp)
  [1] -0.02506444  0.94963434 -0.69718359  0.48158788 -1.50635732 -0.99458703
  [7] -0.68470896 -0.26998774  1.47837870  0.18231673  0.58388747  0.34238546
 [13] -0.33754507 -0.16202593 -0.80680220 -1.04628923  1.69967121 -1.74025251
 [19]  0.22622234  0.44398976  0.47455980 -1.26003808 -0.87570944 -0.06111066
 [25] -0.89031261  1.17875051  0.10297215 -0.53277115  0.23340794  1.51262894
 [31]  2.00118951 -0.55046222  0.88176132 -0.72561496 -1.28710310  1.24901009
 [37] -1.47314376 -1.33792301 -0.63577622  0.28930512  1.29401375  1.73589093
 [43]  0.34267672  1.18987359 -1.39095316 -1.93492402 -0.86462818 -1.04629085
 [49] -1.95306747  1.15212553  0.09857801  0.86274739 -0.58744754  0.62976108
 [55]  1.19559429  0.18016967 -0.22897548 -0.04324310 -0.85831400 -0.96226332
 [61]  1.75781503 -0.72694690  1.90989975 -0.24191512  0.12439316  0.26134512
 [67]  0.39510898  0.87529576 -0.35572290  1.48321011 -1.44993928 -0.53856756
 [73] -1.81655866 -1.23138997  0.22723513  0.24470385 -1.83922115  0.40748292
 [79] -1.04648316 -1.52825122 -0.15037950 -1.10269577 -1.15883390 -0.67039537
 [85]  0.25254746 -0.97927595 -1.32523358  0.25397417 -0.30041399 -1.95660680
 [91] -0.96232557  0.19549957  0.89327839  0.60350218 -1.71949416  0.51110595
 [97] -1.30838604  0.97854810 -1.13634909  0.97973704
> colRanges(tmp)
            [,1]      [,2]       [,3]      [,4]      [,5]      [,6]      [,7]
[1,] -0.02506444 0.9496343 -0.6971836 0.4815879 -1.506357 -0.994587 -0.684709
[2,] -0.02506444 0.9496343 -0.6971836 0.4815879 -1.506357 -0.994587 -0.684709
           [,8]     [,9]     [,10]     [,11]     [,12]      [,13]      [,14]
[1,] -0.2699877 1.478379 0.1823167 0.5838875 0.3423855 -0.3375451 -0.1620259
[2,] -0.2699877 1.478379 0.1823167 0.5838875 0.3423855 -0.3375451 -0.1620259
          [,15]     [,16]    [,17]     [,18]     [,19]     [,20]     [,21]
[1,] -0.8068022 -1.046289 1.699671 -1.740253 0.2262223 0.4439898 0.4745598
[2,] -0.8068022 -1.046289 1.699671 -1.740253 0.2262223 0.4439898 0.4745598
         [,22]      [,23]       [,24]      [,25]    [,26]     [,27]      [,28]
[1,] -1.260038 -0.8757094 -0.06111066 -0.8903126 1.178751 0.1029721 -0.5327712
[2,] -1.260038 -0.8757094 -0.06111066 -0.8903126 1.178751 0.1029721 -0.5327712
         [,29]    [,30]   [,31]      [,32]     [,33]     [,34]     [,35]
[1,] 0.2334079 1.512629 2.00119 -0.5504622 0.8817613 -0.725615 -1.287103
[2,] 0.2334079 1.512629 2.00119 -0.5504622 0.8817613 -0.725615 -1.287103
       [,36]     [,37]     [,38]      [,39]     [,40]    [,41]    [,42]
[1,] 1.24901 -1.473144 -1.337923 -0.6357762 0.2893051 1.294014 1.735891
[2,] 1.24901 -1.473144 -1.337923 -0.6357762 0.2893051 1.294014 1.735891
         [,43]    [,44]     [,45]     [,46]      [,47]     [,48]     [,49]
[1,] 0.3426767 1.189874 -1.390953 -1.934924 -0.8646282 -1.046291 -1.953067
[2,] 0.3426767 1.189874 -1.390953 -1.934924 -0.8646282 -1.046291 -1.953067
        [,50]      [,51]     [,52]      [,53]     [,54]    [,55]     [,56]
[1,] 1.152126 0.09857801 0.8627474 -0.5874475 0.6297611 1.195594 0.1801697
[2,] 1.152126 0.09857801 0.8627474 -0.5874475 0.6297611 1.195594 0.1801697
          [,57]      [,58]     [,59]      [,60]    [,61]      [,62]  [,63]
[1,] -0.2289755 -0.0432431 -0.858314 -0.9622633 1.757815 -0.7269469 1.9099
[2,] -0.2289755 -0.0432431 -0.858314 -0.9622633 1.757815 -0.7269469 1.9099
          [,64]     [,65]     [,66]    [,67]     [,68]      [,69]   [,70]
[1,] -0.2419151 0.1243932 0.2613451 0.395109 0.8752958 -0.3557229 1.48321
[2,] -0.2419151 0.1243932 0.2613451 0.395109 0.8752958 -0.3557229 1.48321
         [,71]      [,72]     [,73]    [,74]     [,75]     [,76]     [,77]
[1,] -1.449939 -0.5385676 -1.816559 -1.23139 0.2272351 0.2447038 -1.839221
[2,] -1.449939 -0.5385676 -1.816559 -1.23139 0.2272351 0.2447038 -1.839221
         [,78]     [,79]     [,80]      [,81]     [,82]     [,83]      [,84]
[1,] 0.4074829 -1.046483 -1.528251 -0.1503795 -1.102696 -1.158834 -0.6703954
[2,] 0.4074829 -1.046483 -1.528251 -0.1503795 -1.102696 -1.158834 -0.6703954
         [,85]      [,86]     [,87]     [,88]     [,89]     [,90]      [,91]
[1,] 0.2525475 -0.9792759 -1.325234 0.2539742 -0.300414 -1.956607 -0.9623256
[2,] 0.2525475 -0.9792759 -1.325234 0.2539742 -0.300414 -1.956607 -0.9623256
         [,92]     [,93]     [,94]     [,95]    [,96]     [,97]     [,98]
[1,] 0.1954996 0.8932784 0.6035022 -1.719494 0.511106 -1.308386 0.9785481
[2,] 0.1954996 0.8932784 0.6035022 -1.719494 0.511106 -1.308386 0.9785481
         [,99]   [,100]
[1,] -1.136349 0.979737
[2,] -1.136349 0.979737
> 
> 
> Max(tmp2)
[1] 2.331976
> Min(tmp2)
[1] -2.799075
> mean(tmp2)
[1] 0.1141884
> Sum(tmp2)
[1] 11.41884
> Var(tmp2)
[1] 1.19194
> 
> rowMeans(tmp2)
  [1] -1.47248231  0.54374381  0.07746158  1.08921758  0.47361569  0.09355249
  [7]  0.24040506 -0.42100621 -0.20259890  0.69758163 -0.08572063  2.09319258
 [13]  0.63395435 -0.14050198 -2.07321258 -0.11349227 -1.27802613  0.41625121
 [19]  0.30600615 -0.34258221  0.82593522  0.66723365  2.21908988  1.26036491
 [25]  1.44660665  0.04767367 -0.56395822  1.32961123  0.85192692  0.76052839
 [31]  0.29493392 -2.20214153  1.09915029  0.88335914 -0.80348747  0.54016231
 [37] -1.42717806 -0.03504178  0.21590280 -0.35309490  2.30443923 -0.34775130
 [43]  0.83299178  1.23874548  0.81735615  1.64531412  1.41101298  0.09286307
 [49] -0.50426755  0.20728422  2.00949076 -0.18871982  0.21412225 -0.39542918
 [55]  1.07359856  1.28932983  2.04728897 -0.21274395  0.25452399  0.50528961
 [61] -0.73361359  1.39011250  1.20866928  2.33197582 -0.38043482 -0.81855609
 [67]  1.32861554  1.55917211  1.00967064 -0.71393931 -0.11298474 -1.46365439
 [73]  0.59535896 -0.64780460 -0.86768488 -0.88541571 -0.48484733  0.57111390
 [79] -1.86033549  0.44174319  0.62064292  0.14524832  0.39812147  0.43761605
 [85]  0.13776191 -0.57901215 -0.18401722 -2.58374449 -2.79907532 -0.89797911
 [91] -1.01597131  0.38450464  0.89560076 -2.47992448  0.21071539 -0.88726509
 [97] -0.27022171 -0.25624432 -1.70853004 -1.50422060
> rowSums(tmp2)
  [1] -1.47248231  0.54374381  0.07746158  1.08921758  0.47361569  0.09355249
  [7]  0.24040506 -0.42100621 -0.20259890  0.69758163 -0.08572063  2.09319258
 [13]  0.63395435 -0.14050198 -2.07321258 -0.11349227 -1.27802613  0.41625121
 [19]  0.30600615 -0.34258221  0.82593522  0.66723365  2.21908988  1.26036491
 [25]  1.44660665  0.04767367 -0.56395822  1.32961123  0.85192692  0.76052839
 [31]  0.29493392 -2.20214153  1.09915029  0.88335914 -0.80348747  0.54016231
 [37] -1.42717806 -0.03504178  0.21590280 -0.35309490  2.30443923 -0.34775130
 [43]  0.83299178  1.23874548  0.81735615  1.64531412  1.41101298  0.09286307
 [49] -0.50426755  0.20728422  2.00949076 -0.18871982  0.21412225 -0.39542918
 [55]  1.07359856  1.28932983  2.04728897 -0.21274395  0.25452399  0.50528961
 [61] -0.73361359  1.39011250  1.20866928  2.33197582 -0.38043482 -0.81855609
 [67]  1.32861554  1.55917211  1.00967064 -0.71393931 -0.11298474 -1.46365439
 [73]  0.59535896 -0.64780460 -0.86768488 -0.88541571 -0.48484733  0.57111390
 [79] -1.86033549  0.44174319  0.62064292  0.14524832  0.39812147  0.43761605
 [85]  0.13776191 -0.57901215 -0.18401722 -2.58374449 -2.79907532 -0.89797911
 [91] -1.01597131  0.38450464  0.89560076 -2.47992448  0.21071539 -0.88726509
 [97] -0.27022171 -0.25624432 -1.70853004 -1.50422060
> 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.47248231  0.54374381  0.07746158  1.08921758  0.47361569  0.09355249
  [7]  0.24040506 -0.42100621 -0.20259890  0.69758163 -0.08572063  2.09319258
 [13]  0.63395435 -0.14050198 -2.07321258 -0.11349227 -1.27802613  0.41625121
 [19]  0.30600615 -0.34258221  0.82593522  0.66723365  2.21908988  1.26036491
 [25]  1.44660665  0.04767367 -0.56395822  1.32961123  0.85192692  0.76052839
 [31]  0.29493392 -2.20214153  1.09915029  0.88335914 -0.80348747  0.54016231
 [37] -1.42717806 -0.03504178  0.21590280 -0.35309490  2.30443923 -0.34775130
 [43]  0.83299178  1.23874548  0.81735615  1.64531412  1.41101298  0.09286307
 [49] -0.50426755  0.20728422  2.00949076 -0.18871982  0.21412225 -0.39542918
 [55]  1.07359856  1.28932983  2.04728897 -0.21274395  0.25452399  0.50528961
 [61] -0.73361359  1.39011250  1.20866928  2.33197582 -0.38043482 -0.81855609
 [67]  1.32861554  1.55917211  1.00967064 -0.71393931 -0.11298474 -1.46365439
 [73]  0.59535896 -0.64780460 -0.86768488 -0.88541571 -0.48484733  0.57111390
 [79] -1.86033549  0.44174319  0.62064292  0.14524832  0.39812147  0.43761605
 [85]  0.13776191 -0.57901215 -0.18401722 -2.58374449 -2.79907532 -0.89797911
 [91] -1.01597131  0.38450464  0.89560076 -2.47992448  0.21071539 -0.88726509
 [97] -0.27022171 -0.25624432 -1.70853004 -1.50422060
> rowMin(tmp2)
  [1] -1.47248231  0.54374381  0.07746158  1.08921758  0.47361569  0.09355249
  [7]  0.24040506 -0.42100621 -0.20259890  0.69758163 -0.08572063  2.09319258
 [13]  0.63395435 -0.14050198 -2.07321258 -0.11349227 -1.27802613  0.41625121
 [19]  0.30600615 -0.34258221  0.82593522  0.66723365  2.21908988  1.26036491
 [25]  1.44660665  0.04767367 -0.56395822  1.32961123  0.85192692  0.76052839
 [31]  0.29493392 -2.20214153  1.09915029  0.88335914 -0.80348747  0.54016231
 [37] -1.42717806 -0.03504178  0.21590280 -0.35309490  2.30443923 -0.34775130
 [43]  0.83299178  1.23874548  0.81735615  1.64531412  1.41101298  0.09286307
 [49] -0.50426755  0.20728422  2.00949076 -0.18871982  0.21412225 -0.39542918
 [55]  1.07359856  1.28932983  2.04728897 -0.21274395  0.25452399  0.50528961
 [61] -0.73361359  1.39011250  1.20866928  2.33197582 -0.38043482 -0.81855609
 [67]  1.32861554  1.55917211  1.00967064 -0.71393931 -0.11298474 -1.46365439
 [73]  0.59535896 -0.64780460 -0.86768488 -0.88541571 -0.48484733  0.57111390
 [79] -1.86033549  0.44174319  0.62064292  0.14524832  0.39812147  0.43761605
 [85]  0.13776191 -0.57901215 -0.18401722 -2.58374449 -2.79907532 -0.89797911
 [91] -1.01597131  0.38450464  0.89560076 -2.47992448  0.21071539 -0.88726509
 [97] -0.27022171 -0.25624432 -1.70853004 -1.50422060
> 
> colMeans(tmp2)
[1] 0.1141884
> colSums(tmp2)
[1] 11.41884
> colVars(tmp2)
[1] 1.19194
> colSd(tmp2)
[1] 1.09176
> colMax(tmp2)
[1] 2.331976
> colMin(tmp2)
[1] -2.799075
> colMedians(tmp2)
[1] 0.2089998
> colRanges(tmp2)
          [,1]
[1,] -2.799075
[2,]  2.331976
> 
> 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.2000574  1.3846308  0.8439013 -3.8415904 -0.2686073 -0.8004846
 [7] -2.3071323  2.2315443 -0.9749857 -2.1012508
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.57623445
[2,] -0.59310554
[3,]  0.08462555
[4,]  0.27557636
[5,]  1.02038727
> 
> rowApply(tmp,sum)
 [1] -0.7697665  1.7780731  1.8367404  5.3082415 -8.3878834 -1.1121264
 [7]  0.2586634 -1.5785020 -2.7917926 -1.5756799
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    2    6    1   10    5    6    5    7     1
 [2,]   10    9    2    5    9    3    4    6    1     8
 [3,]    4    8    1    7    2    7   10    9    6     7
 [4,]    2    6    4    2    3    6    8    2    3    10
 [5,]    8    5    5   10    5   10    5    4    5     2
 [6,]    6   10    7    4    1    9    3    3    2     9
 [7,]    5    1   10    3    8    2    9    1    4     4
 [8,]    9    7    3    8    6    4    7    7    8     6
 [9,]    3    4    9    6    4    8    1   10   10     5
[10,]    1    3    8    9    7    1    2    8    9     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.2741597  1.0699503  0.1768138 -2.4093714 -1.0348339  0.1856544
 [7]  0.6234098  0.1505602  0.1380352  3.2225149 -0.7293216 -1.6469323
[13] -2.8297049 -0.8646869  2.8393095  3.4016511  2.1964850  0.7338969
[19] -0.9711976 -1.6901012
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.5540421
[2,] -0.3462768
[3,]  0.4909631
[4,]  1.1957047
[5,]  1.4878107
> 
> rowApply(tmp,sum)
[1]  2.136146 -3.085595  1.307263  2.506176  1.972300
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16   20    9   19    5
[2,]   13    8   15   16    6
[3,]    6    9   14   17    4
[4,]   17    6    6   14    1
[5,]   14   18   10    1    7
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,]  0.4909631  0.2870793 -0.2377977  0.6995438  0.4139828  0.1983508
[2,]  1.4878107 -0.5915567 -0.4496500 -0.7163189  1.4381217 -1.0783466
[3,] -0.3462768  1.1780271  0.5802439 -0.7944047 -0.3216031  0.5107870
[4,]  1.1957047  0.6735329  0.9547823  0.5419945 -2.2508156  0.4161958
[5,] -0.5540421 -0.4771323 -0.6707648 -2.1401861 -0.3145198  0.1386674
            [,7]       [,8]       [,9]      [,10]       [,11]       [,12]
[1,] -0.08994561  1.2004161  0.2447128  1.3176385 -0.32807059 -0.02024724
[2,] -1.55565399 -1.2845684 -0.3874157  1.4675056 -0.27525768 -0.68736960
[3,]  0.44047613 -1.1139659 -1.1947190  0.2056496 -0.72143285 -2.03734235
[4,]  0.32637343  1.1403897 -0.6853740  0.4340877  0.08708229  0.23802456
[5,]  1.50215985  0.2082887  2.1608312 -0.2023665  0.50835723  0.86000230
          [,13]      [,14]      [,15]      [,16]      [,17]      [,18]
[1,] -1.1384860 -1.4665508  0.4442300 -0.5775248  1.1469694 -0.8168069
[2,] -0.9667622 -0.1685287  0.9264869 -0.1130003  1.0636783 -1.7015388
[3,] -0.5378557  1.6334946  1.4332227  1.5150543  1.3351650  1.4784796
[4,] -0.4513799 -0.7365913 -1.5296752  2.0349760  0.2801211  0.2928992
[5,]  0.2647789 -0.1265106  1.5650452  0.5421459 -1.6294489  1.4808638
           [,19]       [,20]
[1,]  0.27678372  0.09090548
[2,]  0.05534126  0.45142847
[3,] -1.02544777 -0.91028831
[4,]  0.59356486 -1.04971702
[5,] -0.87143966 -0.27242985
> 
> 
> 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.18-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.18-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  652  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.18-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.18-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 -1.070549 -0.001744516 -1.011965 -1.00261 -0.07139745 -0.3190884 -1.742216
           col8     col9    col10    col11      col12   col13     col14
row1 -0.3879577 1.289279 1.133516 1.741252 -0.6060227 1.04375 0.4824533
          col15      col16     col17    col18     col19     col20
row1 -0.3813843 -0.1475919 -1.073422 1.009792 0.1310311 0.6173223
> tmp[,"col10"]
          col10
row1  1.1335159
row2 -1.5034486
row3  2.0421357
row4  0.9060089
row5 -0.5358914
> tmp[c("row1","row5"),]
           col1         col2       col3       col4        col5       col6
row1 -1.0705486 -0.001744516 -1.0119645 -1.0026099 -0.07139745 -0.3190884
row5 -0.4199158  0.202109747 -0.4068481 -0.6889913 -0.55059913 -0.1377305
           col7       col8       col9      col10    col11      col12      col13
row1 -1.7422160 -0.3879577  1.2892791  1.1335159 1.741252 -0.6060227 1.04374992
row5 -0.3353284  1.1503948 -0.8459278 -0.5358914 1.744873 -0.8291506 0.08806823
         col14      col15      col16      col17      col18     col19      col20
row1 0.4824533 -0.3813843 -0.1475919 -1.0734225  1.0097922 0.1310311  0.6173223
row5 0.4877779 -1.0988513  0.8395384 -0.5077372 -0.5789798 0.3655817 -1.0879928
> tmp[,c("col6","col20")]
           col6      col20
row1 -0.3190884  0.6173223
row2  0.3151334  0.1569474
row3 -0.3767463  0.9492248
row4 -0.4801691  0.9961869
row5 -0.1377305 -1.0879928
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -0.3190884  0.6173223
row5 -0.1377305 -1.0879928
> 
> 
> 
> 
> 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.19667 50.68284 49.72185 51.82048 50.59795 106.7775 50.90081 50.79292
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.96746 49.66875 50.36557 51.06793 49.74445 48.18455 50.73294 48.04533
        col17    col18   col19    col20
row1 48.56388 49.95836 49.9724 104.2096
> tmp[,"col10"]
        col10
row1 49.66875
row2 28.94884
row3 29.38763
row4 30.59991
row5 49.57687
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.19667 50.68284 49.72185 51.82048 50.59795 106.7775 50.90081 50.79292
row5 50.17273 49.80943 50.82282 50.19560 49.17239 105.7015 50.30561 49.21441
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.96746 49.66875 50.36557 51.06793 49.74445 48.18455 50.73294 48.04533
row5 48.96231 49.57687 49.78355 50.33986 50.35678 50.22023 51.04170 48.82017
        col17    col18    col19    col20
row1 48.56388 49.95836 49.97240 104.2096
row5 48.39936 49.95133 50.03991 105.6890
> tmp[,c("col6","col20")]
          col6     col20
row1 106.77754 104.20956
row2  75.04806  76.73129
row3  75.53551  72.71493
row4  75.81856  75.46814
row5 105.70152 105.68903
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.7775 104.2096
row5 105.7015 105.6890
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.7775 104.2096
row5 105.7015 105.6890
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.5662898
[2,]  1.8211820
[3,] -1.1181934
[4,]  1.4385103
[5,]  1.7414173
> tmp[,c("col17","col7")]
          col17       col7
[1,] -1.3014233 -0.8226466
[2,]  0.4698864 -0.3524602
[3,] -0.6592351  0.9564435
[4,]  1.2410178  1.0686122
[5,] -0.3862738  1.2353092
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,]  1.04482815  0.1985259
[2,] -0.08026407  1.1220228
[3,]  0.11862161 -1.1824077
[4,]  0.29935237  0.3480941
[5,] -0.10239998  1.5258765
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.044828
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,]  1.04482815
[2,] -0.08026407
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]      [,2]        [,3]       [,4]      [,5]        [,6]      [,7]
row3 1.1811200 0.1051599 -1.09438156 -0.3349115 0.7413358 -1.06521589 0.4231199
row1 0.2725814 0.3438161  0.07503619  0.2855907 0.3076991 -0.03312608 1.1233402
           [,8]      [,9]      [,10]      [,11]      [,12]      [,13]     [,14]
row3 -0.4675202 1.9709377  1.5243858 -0.5406043 -0.1088275  0.6297093 1.1615253
row1  1.6979334 0.3809737 -0.1646039 -0.4872537 -0.7286342 -0.9168134 0.2417747
          [,15]       [,16]     [,17]      [,18]    [,19]     [,20]
row3 -0.4844481 -0.31366214 0.5329366 -1.7660728 1.657984 -2.250039
row1 -0.5678997 -0.05659588 1.3798806  0.1983542 1.767531 -1.826391
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
         [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
row2 0.752705 0.8728373 0.9485935 -1.157289 0.6282926 -1.713612 0.6626698
          [,8]       [,9]      [,10]
row2 0.3755696 0.07130981 -0.7502975
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]      [,4]        [,5]      [,6]      [,7]
row5 0.2584419 -0.3144131 -1.690402 0.2070914 0.003161208 -1.712351 -2.110197
            [,8]      [,9]       [,10]    [,11]    [,12]     [,13]     [,14]
row5 0.009017564 0.6965106 -0.04864585 1.693519 1.237253 -1.640129 -1.107968
        [,15]      [,16]    [,17]     [,18]    [,19]      [,20]
row5 1.845448 -0.4165342 1.705961 -1.137981 1.439588 -0.4501109
> 
> 
> 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: 0x169b0860>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM17514678fecc5b"
 [2] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM17514642b645bf"
 [3] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM17514639cb336e"
 [4] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM17514626fa5663"
 [5] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1751467468d36f"
 [6] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1751465f27952f"
 [7] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1751467ed77489"
 [8] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1751464d92d408"
 [9] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM175146743c8324"
[10] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1751461c7751c1"
[11] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM175146542eaf31"
[12] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM17514676ebd950"
[13] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1751466596ded6"
[14] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM17514633a8e90a"
[15] "/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests/BM1751464a228e71"
> 
> 
> ### 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: 0x153a4210>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x153a4210>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.18-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x153a4210>
> rowMedians(tmp)
  [1]  0.1323616543  0.2452645886  0.0527850109  0.0880353383  0.2880357903
  [6]  0.0477623885  0.4357357387 -0.2340440766  0.4224929199  0.2882652325
 [11] -0.2718753003 -0.6049704510  0.1529234875  0.0910349463  0.3289634133
 [16] -0.0473733780 -0.0675411604 -0.0928328395  0.0099216919  0.4745862025
 [21]  0.2511753602  0.3288543768 -0.3701419134 -0.0679311586  0.0883426352
 [26]  0.0071509469  0.2839823879  0.4854816616  0.3657295983  0.1277256515
 [31] -0.4625217128 -0.5402301887  0.0492378059 -0.0458381952 -0.6710045114
 [36] -0.0087936847 -0.0734047030  0.0388184008 -0.1764559528  0.0148413974
 [41] -0.6941622119  0.3925108095 -0.1550223116  0.0562228309  0.0921820136
 [46] -0.1090314004  0.0861758858 -0.2448705736  0.0952058025 -0.2056458502
 [51]  0.4261389667 -0.0213650387 -0.0523550262  0.1882243360  0.0982179480
 [56] -0.3815444549  0.3686798407  0.3974618435  0.7917531034  0.2158222473
 [61]  0.5336282092  0.1488104936 -0.1027987350 -0.0604648352 -0.2894289997
 [66] -0.2068091073 -0.3321812432  0.0164645942 -0.4322677642 -0.0596013245
 [71] -0.1812519066 -0.2768210068  0.2865689320  0.3768943657  0.3672076771
 [76]  0.1902151809  0.2344809166  0.0478313311 -0.1602223815 -0.3335073608
 [81] -0.3716135123 -0.5001536677 -0.1477811472  0.0376238383  0.1448410490
 [86]  0.4253599336 -0.3805045481  0.0198610835 -0.1299151813 -0.2006124292
 [91]  0.1238332029  0.0703938460  0.3083799426  0.7460590152  0.2529575142
 [96]  0.2118769882 -0.0540828651  0.2069949485  0.3612024613  0.3553247234
[101]  0.1506089534 -0.4120253046  0.2891278377 -0.1627734361  0.0484377112
[106] -0.1534814917  0.1214516013  0.1205428957 -0.9684862377  0.3192717535
[111]  0.1994629002 -0.2972137052  0.5206928672  0.0347197297  0.1121278440
[116] -0.0876871282  0.1486196076  0.0176013211  0.7953461279 -0.3331828762
[121]  0.2104335190 -0.3024712416 -0.1737204035  0.4322912320  0.0609909550
[126] -0.2047605288  0.0769345333 -0.1790206080  0.1366103126 -0.5314659693
[131]  0.2589495859 -0.0816179721 -0.0352096681 -0.1124401683 -0.1421147970
[136]  0.6699986177  0.1776833024  0.5228393419  0.0153812310  0.0015797219
[141]  0.0658460544  0.4301902859  0.0636379258  0.1483368231  0.0654009762
[146] -0.0675403975 -0.4525049378  0.1226214094 -0.8495738807 -0.4094300858
[151]  0.1684975961 -0.1901781616 -0.1266533701 -0.3539733223  0.2432575315
[156]  0.1755934500  0.3583125866  0.0386436283  0.0604940039  0.2982916832
[161]  0.0781488220  0.0467486989 -0.0799950698 -0.3795048122 -0.0008060193
[166] -0.2176216275  0.0535991331  0.5515713169 -0.0231520497 -0.0876457522
[171]  0.5922930127 -0.0729254231  0.5547713366  0.2499942765  0.3205023035
[176] -0.4601031628  0.2004822239 -0.3801720396 -0.3240595058  0.1857683667
[181]  0.2080285714  0.8123639594 -0.5965823798 -0.0088978997 -0.2508645985
[186]  0.0167357010  0.1298095211  0.0663901169  0.1420284817  0.0714944988
[191] -0.1239254956  0.3375648011  0.1289960808 -0.2577263434 -0.3791260930
[196]  0.4820362787 -0.2396171851  0.2823803913 -0.2097893887  0.1079919508
[201]  0.0288970953  0.2310030971  0.0383896200 -0.1367456358 -0.2331246433
[206]  0.3432633794 -0.3226944122 -0.2413634987  0.1205112643 -0.4100791488
[211] -0.3640174383 -0.2307772610  0.2758234419 -0.3548411851  0.0750006675
[216]  0.1283237963 -0.1241778014 -0.0308003216  0.2569143199  0.4687364947
[221] -0.0751502192  0.3377410241  0.5204062009 -0.4498541128  0.5792041826
[226] -0.0887573018 -0.0758692534  0.5125311185 -0.3030475645 -0.4026215783
> 
> proc.time()
   user  system elapsed 
  2.058   0.902   2.977 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
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: 0x36463770>
> .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: 0x36463770>
> .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: 0x36463770>
> .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: 0x36463770>
> 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: 0x35b65900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x35b65900>
> .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: 0x35b65900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x35b65900>
> .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: 0x35b65900>
> 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: 0x35c90630>
> .Call("R_bm_AddColumn",P)
<pointer: 0x35c90630>
> .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: 0x35c90630>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x35c90630>
> .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: 0x35c90630>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x35c90630>
> .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: 0x35c90630>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x35c90630>
> .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: 0x35c90630>
> 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: 0x35938360>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x35938360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x35938360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x35938360>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile17516611e8b69b" "BufferedMatrixFile17516644f4985d"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile17516611e8b69b" "BufferedMatrixFile17516644f4985d"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x34780e90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x34780e90>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x34780e90>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x34780e90>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x34780e90>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x34780e90>
> .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: 0x358d8d80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x358d8d80>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x358d8d80>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x358d8d80>
> 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: 0x34a799a0>
> .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: 0x34a799a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.318   0.046   0.351 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
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.335   0.034   0.357 

Example timings