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

This page was generated on 2023-01-29 16:33:38 -0000 (Sun, 29 Jan 2023).

HostnameOSArch (*)R versionInstalled pkgs
kunpeng1Linux (Ubuntu 22.04.1 LTS)aarch64R Under development (unstable) (2023-01-14 r83615) -- "Unsuffered Consequences" 4021
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 227/2162HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.63.0  (landing page)
Ben Bolstad
Snapshot Date: 2023-01-27 13:09:27 -0000 (Fri, 27 Jan 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    WARNINGS  

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-01-28 18:50:58 -0000 (Sat, 28 Jan 2023)
EndedAt: 2023-01-28 18:51:29 -0000 (Sat, 28 Jan 2023)
EllapsedTime: 31.0 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

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 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 ... WARNING
Error in library(BufferedMatrix, lib.loc = "/home/biocbuild/bbs-3.17-bioc/R/library") : 
  there is no package called ‘BufferedMatrix’
Execution halted

It looks like this package has a loading problem when not on .libPaths:
see the messages for details.
* 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 ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... SKIPPED
* 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: 1 WARNING, 1 NOTE
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/site-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/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R Under development (unstable) (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.325   0.044   0.353 

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 456959 24.5     979797 52.4   651600 34.8
Vcells 842287  6.5    8388608 64.0  2049159 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] "Sat Jan 28 18:51:17 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] "Sat Jan 28 18:51:17 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: 0xaaaaed5e0460>
> 
> 
> 
> 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] "Sat Jan 28 18:51:18 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] "Sat Jan 28 18:51:18 2023"
> 
> ColMode(tmp2)
<pointer: 0xaaaaed5e0460>
> 
> 
> 
> ### 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.834065378 -1.19702787  1.2345423  1.2442133
[2,]   0.232695834  0.01776452 -1.4785368  0.9943515
[3,]   0.007774307 -0.23350793  0.4737688 -0.4792685
[4,]  -0.063733183 -1.11649963 -0.3339662 -1.1828581
> 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,] 1.008341e+02 1.19702787 1.2345423 1.2442133
[2,] 2.326958e-01 0.01776452 1.4785368 0.9943515
[3,] 7.774307e-03 0.23350793 0.4737688 0.4792685
[4,] 6.373318e-02 1.11649963 0.3339662 1.1828581
> 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.04161667 1.0940877 1.1110996 1.1154431
[2,]  0.48238557 0.1332836 1.2159510 0.9971718
[3,]  0.08817203 0.4832266 0.6883086 0.6922922
[4,]  0.25245432 1.0566455 0.5778981 1.0875928
> 
> 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.25023 37.13790 37.34554 37.39864
[2,]  30.05655 26.35060 38.63805 35.96607
[3,]  25.88949 30.06577 32.35686 32.40219
[4,]  27.58828 36.68295 31.11295 37.05879
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0xaaaaecc29070>
> exp(tmp5)
<pointer: 0xaaaaecc29070>
> log(tmp5,2)
<pointer: 0xaaaaecc29070>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.9102
> Min(tmp5)
[1] 52.95941
> mean(tmp5)
[1] 72.10947
> Sum(tmp5)
[1] 14421.89
> Var(tmp5)
[1] 877.3105
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.12115 73.40651 65.57220 70.70451 69.91570 68.90494 71.82283 67.47957
 [9] 70.87362 71.29369
> rowSums(tmp5)
 [1] 1822.423 1468.130 1311.444 1414.090 1398.314 1378.099 1436.457 1349.591
 [9] 1417.472 1425.874
> rowVars(tmp5)
 [1] 8028.79133  115.47357   69.09723   47.52121  104.77611   78.69146
 [7]   44.31863   63.25499   99.88673   66.72644
> rowSd(tmp5)
 [1] 89.603523 10.745863  8.312474  6.893563 10.236020  8.870821  6.657224
 [8]  7.953301  9.994335  8.168625
> rowMax(tmp5)
 [1] 470.91022  93.73311  84.81194  81.66107  89.59159  83.45928  80.81822
 [8]  90.51253  86.00594  82.89796
> rowMin(tmp5)
 [1] 60.20270 54.84532 53.88559 57.42138 56.99524 52.95941 58.22765 56.36775
 [9] 52.98968 58.23438
> 
> colMeans(tmp5)
 [1] 107.06697  69.98827  70.45057  72.26239  72.71781  70.64025  70.88572
 [8]  69.33581  72.41215  70.30192  70.77418  69.45698  73.04003  70.77259
[15]  64.35486  64.93509  69.85523  72.53783  72.81972  67.58107
> colSums(tmp5)
 [1] 1070.6697  699.8827  704.5057  722.6239  727.1781  706.4025  708.8572
 [8]  693.3581  724.1215  703.0192  707.7418  694.5698  730.4003  707.7259
[15]  643.5486  649.3509  698.5523  725.3783  728.1972  675.8107
> colVars(tmp5)
 [1] 16395.30284    78.67891   104.41347    47.63985   171.14844    66.20755
 [7]    98.55520    38.02917    47.00763   100.91566    88.71562    50.30126
[13]    68.40097    85.62533    44.04191    20.25676   113.62713    72.33426
[19]    98.37568    60.14006
> colSd(tmp5)
 [1] 128.044144   8.870113  10.218291   6.902163  13.082371   8.136802
 [7]   9.927497   6.166780   6.856211  10.045679   9.418897   7.092338
[13]   8.270488   9.253395   6.636408   4.500752  10.659603   8.504955
[19]   9.918452   7.755002
> colMax(tmp5)
 [1] 470.91022  79.80753  90.51253  81.87512  93.73311  79.58674  87.37663
 [8]  78.96706  83.45928  85.87059  87.34676  81.23348  82.53581  90.03944
[15]  72.68502  73.78073  85.99094  87.66953  89.59159  78.42459
> colMin(tmp5)
 [1] 53.88559 54.84532 52.95941 58.72653 55.12288 58.23438 59.75490 59.47848
 [9] 61.16457 56.99524 60.88636 55.56762 57.65333 57.05061 54.75296 55.76342
[17] 52.98968 61.58973 59.16079 54.53896
> 
> 
> ### 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] 91.12115 73.40651 65.57220 70.70451 69.91570 68.90494 71.82283 67.47957
 [9] 70.87362       NA
> rowSums(tmp5)
 [1] 1822.423 1468.130 1311.444 1414.090 1398.314 1378.099 1436.457 1349.591
 [9] 1417.472       NA
> rowVars(tmp5)
 [1] 8028.79133  115.47357   69.09723   47.52121  104.77611   78.69146
 [7]   44.31863   63.25499   99.88673   65.62602
> rowSd(tmp5)
 [1] 89.603523 10.745863  8.312474  6.893563 10.236020  8.870821  6.657224
 [8]  7.953301  9.994335  8.100989
> rowMax(tmp5)
 [1] 470.91022  93.73311  84.81194  81.66107  89.59159  83.45928  80.81822
 [8]  90.51253  86.00594        NA
> rowMin(tmp5)
 [1] 60.20270 54.84532 53.88559 57.42138 56.99524 52.95941 58.22765 56.36775
 [9] 52.98968       NA
> 
> colMeans(tmp5)
 [1] 107.06697  69.98827  70.45057  72.26239  72.71781  70.64025  70.88572
 [8]  69.33581  72.41215  70.30192  70.77418  69.45698  73.04003        NA
[15]  64.35486  64.93509  69.85523  72.53783  72.81972  67.58107
> colSums(tmp5)
 [1] 1070.6697  699.8827  704.5057  722.6239  727.1781  706.4025  708.8572
 [8]  693.3581  724.1215  703.0192  707.7418  694.5698  730.4003        NA
[15]  643.5486  649.3509  698.5523  725.3783  728.1972  675.8107
> colVars(tmp5)
 [1] 16395.30284    78.67891   104.41347    47.63985   171.14844    66.20755
 [7]    98.55520    38.02917    47.00763   100.91566    88.71562    50.30126
[13]    68.40097          NA    44.04191    20.25676   113.62713    72.33426
[19]    98.37568    60.14006
> colSd(tmp5)
 [1] 128.044144   8.870113  10.218291   6.902163  13.082371   8.136802
 [7]   9.927497   6.166780   6.856211  10.045679   9.418897   7.092338
[13]   8.270488         NA   6.636408   4.500752  10.659603   8.504955
[19]   9.918452   7.755002
> colMax(tmp5)
 [1] 470.91022  79.80753  90.51253  81.87512  93.73311  79.58674  87.37663
 [8]  78.96706  83.45928  85.87059  87.34676  81.23348  82.53581        NA
[15]  72.68502  73.78073  85.99094  87.66953  89.59159  78.42459
> colMin(tmp5)
 [1] 53.88559 54.84532 52.95941 58.72653 55.12288 58.23438 59.75490 59.47848
 [9] 61.16457 56.99524 60.88636 55.56762 57.65333       NA 54.75296 55.76342
[17] 52.98968 61.58973 59.16079 54.53896
> 
> Max(tmp5,na.rm=TRUE)
[1] 470.9102
> Min(tmp5,na.rm=TRUE)
[1] 52.95941
> mean(tmp5,na.rm=TRUE)
[1] 72.15913
> Sum(tmp5,na.rm=TRUE)
[1] 14359.67
> Var(tmp5,na.rm=TRUE)
[1] 881.2456
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.12115 73.40651 65.57220 70.70451 69.91570 68.90494 71.82283 67.47957
 [9] 70.87362 71.77089
> rowSums(tmp5,na.rm=TRUE)
 [1] 1822.423 1468.130 1311.444 1414.090 1398.314 1378.099 1436.457 1349.591
 [9] 1417.472 1363.647
> rowVars(tmp5,na.rm=TRUE)
 [1] 8028.79133  115.47357   69.09723   47.52121  104.77611   78.69146
 [7]   44.31863   63.25499   99.88673   65.62602
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.603523 10.745863  8.312474  6.893563 10.236020  8.870821  6.657224
 [8]  7.953301  9.994335  8.100989
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.91022  93.73311  84.81194  81.66107  89.59159  83.45928  80.81822
 [8]  90.51253  86.00594  82.89796
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.20270 54.84532 53.88559 57.42138 56.99524 52.95941 58.22765 56.36775
 [9] 52.98968 58.23438
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.06697  69.98827  70.45057  72.26239  72.71781  70.64025  70.88572
 [8]  69.33581  72.41215  70.30192  70.77418  69.45698  73.04003  71.72211
[15]  64.35486  64.93509  69.85523  72.53783  72.81972  67.58107
> colSums(tmp5,na.rm=TRUE)
 [1] 1070.6697  699.8827  704.5057  722.6239  727.1781  706.4025  708.8572
 [8]  693.3581  724.1215  703.0192  707.7418  694.5698  730.4003  645.4990
[15]  643.5486  649.3509  698.5523  725.3783  728.1972  675.8107
> colVars(tmp5,na.rm=TRUE)
 [1] 16395.30284    78.67891   104.41347    47.63985   171.14844    66.20755
 [7]    98.55520    38.02917    47.00763   100.91566    88.71562    50.30126
[13]    68.40097    86.18551    44.04191    20.25676   113.62713    72.33426
[19]    98.37568    60.14006
> colSd(tmp5,na.rm=TRUE)
 [1] 128.044144   8.870113  10.218291   6.902163  13.082371   8.136802
 [7]   9.927497   6.166780   6.856211  10.045679   9.418897   7.092338
[13]   8.270488   9.283615   6.636408   4.500752  10.659603   8.504955
[19]   9.918452   7.755002
> colMax(tmp5,na.rm=TRUE)
 [1] 470.91022  79.80753  90.51253  81.87512  93.73311  79.58674  87.37663
 [8]  78.96706  83.45928  85.87059  87.34676  81.23348  82.53581  90.03944
[15]  72.68502  73.78073  85.99094  87.66953  89.59159  78.42459
> colMin(tmp5,na.rm=TRUE)
 [1] 53.88559 54.84532 52.95941 58.72653 55.12288 58.23438 59.75490 59.47848
 [9] 61.16457 56.99524 60.88636 55.56762 57.65333 57.05061 54.75296 55.76342
[17] 52.98968 61.58973 59.16079 54.53896
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.12115 73.40651 65.57220 70.70451 69.91570 68.90494 71.82283 67.47957
 [9] 70.87362      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1822.423 1468.130 1311.444 1414.090 1398.314 1378.099 1436.457 1349.591
 [9] 1417.472    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 8028.79133  115.47357   69.09723   47.52121  104.77611   78.69146
 [7]   44.31863   63.25499   99.88673         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.603523 10.745863  8.312474  6.893563 10.236020  8.870821  6.657224
 [8]  7.953301  9.994335        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 470.91022  93.73311  84.81194  81.66107  89.59159  83.45928  80.81822
 [8]  90.51253  86.00594        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 60.20270 54.84532 53.88559 57.42138 56.99524 52.95941 58.22765 56.36775
 [9] 52.98968       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 111.61656  68.89724  70.58318  71.19431  71.58669  72.01868  69.57744
 [8]  70.43107  72.56736  71.23622  71.32620  68.69148  72.50997       NaN
[15]  63.50183  63.95224  70.65919  72.95759  71.76623  67.20669
> colSums(tmp5,na.rm=TRUE)
 [1] 1004.5491  620.0751  635.2486  640.7488  644.2802  648.1681  626.1970
 [8]  633.8797  653.1062  641.1260  641.9358  618.2233  652.5897    0.0000
[15]  571.5165  575.5701  635.9328  656.6183  645.8961  604.8603
> colVars(tmp5,na.rm=TRUE)
 [1] 18211.85371    75.12239   117.26732    40.76086   178.14821    53.10771
 [7]    91.61925    29.28740    52.61258   103.70976    96.37694    49.99648
[13]    73.79025          NA    41.36108    11.92145   120.55904    79.39378
[19]    98.18706    66.08077
> colSd(tmp5,na.rm=TRUE)
 [1] 134.951301   8.667318  10.829004   6.384423  13.347217   7.287504
 [7]   9.571795   5.411783   7.253453  10.183799   9.817176   7.070819
[13]   8.590125         NA   6.431258   3.452745  10.979938   8.910319
[19]   9.908938   8.129008
> colMax(tmp5,na.rm=TRUE)
 [1] 470.91022  77.29768  90.51253  77.99818  93.73311  79.58674  87.37663
 [8]  78.96706  83.45928  85.87059  87.34676  81.23348  82.53581      -Inf
[15]  72.68502  68.59106  85.99094  87.66953  89.59159  78.42459
> colMin(tmp5,na.rm=TRUE)
 [1] 53.88559 54.84532 52.95941 58.72653 55.12288 59.14705 59.75490 60.20270
 [9] 61.16457 56.99524 60.88636 55.56762 57.65333      Inf 54.75296 55.76342
[17] 52.98968 61.58973 59.16079 54.53896
> 
> 
> 
> 
> 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] 215.4204 204.8113 248.2262 313.2543 168.7596 174.8281 181.5588 305.0436
 [9] 199.3378 197.6805
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 215.4204 204.8113 248.2262 313.2543 168.7596 174.8281 181.5588 305.0436
 [9] 199.3378 197.6805
> 
> 
> 
> 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]  5.684342e-14  0.000000e+00  0.000000e+00 -5.684342e-14  0.000000e+00
 [6]  1.563194e-13  2.273737e-13  0.000000e+00 -1.136868e-13  0.000000e+00
[11]  5.684342e-14  1.136868e-13 -1.421085e-13 -1.989520e-13 -5.684342e-14
[16] -2.842171e-14  5.684342e-14 -1.136868e-13  0.000000e+00  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
4   2 
6   19 
2   19 
7   2 
6   20 
2   15 
2   11 
3   20 
3   13 
3   2 
2   16 
4   18 
2   14 
1   2 
8   1 
9   8 
3   2 
4   2 
1   5 
7   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] 3.125351
> Min(tmp)
[1] -2.99953
> mean(tmp)
[1] 0.005394135
> Sum(tmp)
[1] 0.5394135
> Var(tmp)
[1] 1.311769
> 
> rowMeans(tmp)
[1] 0.005394135
> rowSums(tmp)
[1] 0.5394135
> rowVars(tmp)
[1] 1.311769
> rowSd(tmp)
[1] 1.145325
> rowMax(tmp)
[1] 3.125351
> rowMin(tmp)
[1] -2.99953
> 
> colMeans(tmp)
  [1]  1.2605126381  1.2315983136 -0.4854926658 -1.6464915305 -0.2624161221
  [6] -2.1765222141 -0.3417054705  0.1988193917 -1.6917826087  0.8577321188
 [11]  0.2338299279 -1.2832085272 -1.2925261876  0.6922194577 -0.6309920413
 [16] -0.8587907299 -1.7233481982 -1.1827233749 -0.1681828455 -0.8694776756
 [21]  1.0089541123 -0.6032398324 -1.9914961315 -0.0763790536 -2.9995304980
 [26]  1.4340909761  0.0934684339  0.6630983750  1.6638393813  0.3647611286
 [31] -0.3710970537 -0.0167659499  3.1253510515  0.7051103294 -1.1475645996
 [36] -2.7689666502  0.2606586265  1.5203765297  0.9919797930  0.4288143771
 [41]  1.7542310815  1.1296595017 -0.2305422546 -0.4980751192 -1.0127850406
 [46]  0.4146867727 -1.6888679809  1.7436967031 -0.2499685927  0.2107286288
 [51] -0.1379608118  0.7577877625  0.0007496365 -0.6074168888  0.5900621164
 [56]  0.8097252187 -0.9757314493 -0.5174113292  0.5168888665  0.2331795597
 [61]  0.7361386089 -0.0625718879 -0.8428538180  0.2942797566  2.4356662450
 [66]  1.1382984832  2.0407035731 -1.2891769073 -0.0487682314 -0.1972182924
 [71] -0.5412995609 -1.0888682560  1.2787186339  1.1512179955  0.9099462807
 [76]  0.8647503596 -0.2860699871 -0.2495407934 -0.5431577176 -0.6160725413
 [81] -0.3855983887  1.6343483095 -0.5294571814 -0.3857188418 -0.3037353212
 [86]  0.5232363045  1.9688247216 -0.2517709324 -1.9320692070  0.3767971826
 [91]  0.5944615564 -0.0072096143  0.0724372636  2.0999392503 -1.7383635324
 [96] -1.0003692489 -0.1816067902 -0.6085164724  2.0669880199 -0.9464769212
> colSums(tmp)
  [1]  1.2605126381  1.2315983136 -0.4854926658 -1.6464915305 -0.2624161221
  [6] -2.1765222141 -0.3417054705  0.1988193917 -1.6917826087  0.8577321188
 [11]  0.2338299279 -1.2832085272 -1.2925261876  0.6922194577 -0.6309920413
 [16] -0.8587907299 -1.7233481982 -1.1827233749 -0.1681828455 -0.8694776756
 [21]  1.0089541123 -0.6032398324 -1.9914961315 -0.0763790536 -2.9995304980
 [26]  1.4340909761  0.0934684339  0.6630983750  1.6638393813  0.3647611286
 [31] -0.3710970537 -0.0167659499  3.1253510515  0.7051103294 -1.1475645996
 [36] -2.7689666502  0.2606586265  1.5203765297  0.9919797930  0.4288143771
 [41]  1.7542310815  1.1296595017 -0.2305422546 -0.4980751192 -1.0127850406
 [46]  0.4146867727 -1.6888679809  1.7436967031 -0.2499685927  0.2107286288
 [51] -0.1379608118  0.7577877625  0.0007496365 -0.6074168888  0.5900621164
 [56]  0.8097252187 -0.9757314493 -0.5174113292  0.5168888665  0.2331795597
 [61]  0.7361386089 -0.0625718879 -0.8428538180  0.2942797566  2.4356662450
 [66]  1.1382984832  2.0407035731 -1.2891769073 -0.0487682314 -0.1972182924
 [71] -0.5412995609 -1.0888682560  1.2787186339  1.1512179955  0.9099462807
 [76]  0.8647503596 -0.2860699871 -0.2495407934 -0.5431577176 -0.6160725413
 [81] -0.3855983887  1.6343483095 -0.5294571814 -0.3857188418 -0.3037353212
 [86]  0.5232363045  1.9688247216 -0.2517709324 -1.9320692070  0.3767971826
 [91]  0.5944615564 -0.0072096143  0.0724372636  2.0999392503 -1.7383635324
 [96] -1.0003692489 -0.1816067902 -0.6085164724  2.0669880199 -0.9464769212
> 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]  1.2605126381  1.2315983136 -0.4854926658 -1.6464915305 -0.2624161221
  [6] -2.1765222141 -0.3417054705  0.1988193917 -1.6917826087  0.8577321188
 [11]  0.2338299279 -1.2832085272 -1.2925261876  0.6922194577 -0.6309920413
 [16] -0.8587907299 -1.7233481982 -1.1827233749 -0.1681828455 -0.8694776756
 [21]  1.0089541123 -0.6032398324 -1.9914961315 -0.0763790536 -2.9995304980
 [26]  1.4340909761  0.0934684339  0.6630983750  1.6638393813  0.3647611286
 [31] -0.3710970537 -0.0167659499  3.1253510515  0.7051103294 -1.1475645996
 [36] -2.7689666502  0.2606586265  1.5203765297  0.9919797930  0.4288143771
 [41]  1.7542310815  1.1296595017 -0.2305422546 -0.4980751192 -1.0127850406
 [46]  0.4146867727 -1.6888679809  1.7436967031 -0.2499685927  0.2107286288
 [51] -0.1379608118  0.7577877625  0.0007496365 -0.6074168888  0.5900621164
 [56]  0.8097252187 -0.9757314493 -0.5174113292  0.5168888665  0.2331795597
 [61]  0.7361386089 -0.0625718879 -0.8428538180  0.2942797566  2.4356662450
 [66]  1.1382984832  2.0407035731 -1.2891769073 -0.0487682314 -0.1972182924
 [71] -0.5412995609 -1.0888682560  1.2787186339  1.1512179955  0.9099462807
 [76]  0.8647503596 -0.2860699871 -0.2495407934 -0.5431577176 -0.6160725413
 [81] -0.3855983887  1.6343483095 -0.5294571814 -0.3857188418 -0.3037353212
 [86]  0.5232363045  1.9688247216 -0.2517709324 -1.9320692070  0.3767971826
 [91]  0.5944615564 -0.0072096143  0.0724372636  2.0999392503 -1.7383635324
 [96] -1.0003692489 -0.1816067902 -0.6085164724  2.0669880199 -0.9464769212
> colMin(tmp)
  [1]  1.2605126381  1.2315983136 -0.4854926658 -1.6464915305 -0.2624161221
  [6] -2.1765222141 -0.3417054705  0.1988193917 -1.6917826087  0.8577321188
 [11]  0.2338299279 -1.2832085272 -1.2925261876  0.6922194577 -0.6309920413
 [16] -0.8587907299 -1.7233481982 -1.1827233749 -0.1681828455 -0.8694776756
 [21]  1.0089541123 -0.6032398324 -1.9914961315 -0.0763790536 -2.9995304980
 [26]  1.4340909761  0.0934684339  0.6630983750  1.6638393813  0.3647611286
 [31] -0.3710970537 -0.0167659499  3.1253510515  0.7051103294 -1.1475645996
 [36] -2.7689666502  0.2606586265  1.5203765297  0.9919797930  0.4288143771
 [41]  1.7542310815  1.1296595017 -0.2305422546 -0.4980751192 -1.0127850406
 [46]  0.4146867727 -1.6888679809  1.7436967031 -0.2499685927  0.2107286288
 [51] -0.1379608118  0.7577877625  0.0007496365 -0.6074168888  0.5900621164
 [56]  0.8097252187 -0.9757314493 -0.5174113292  0.5168888665  0.2331795597
 [61]  0.7361386089 -0.0625718879 -0.8428538180  0.2942797566  2.4356662450
 [66]  1.1382984832  2.0407035731 -1.2891769073 -0.0487682314 -0.1972182924
 [71] -0.5412995609 -1.0888682560  1.2787186339  1.1512179955  0.9099462807
 [76]  0.8647503596 -0.2860699871 -0.2495407934 -0.5431577176 -0.6160725413
 [81] -0.3855983887  1.6343483095 -0.5294571814 -0.3857188418 -0.3037353212
 [86]  0.5232363045  1.9688247216 -0.2517709324 -1.9320692070  0.3767971826
 [91]  0.5944615564 -0.0072096143  0.0724372636  2.0999392503 -1.7383635324
 [96] -1.0003692489 -0.1816067902 -0.6085164724  2.0669880199 -0.9464769212
> colMedians(tmp)
  [1]  1.2605126381  1.2315983136 -0.4854926658 -1.6464915305 -0.2624161221
  [6] -2.1765222141 -0.3417054705  0.1988193917 -1.6917826087  0.8577321188
 [11]  0.2338299279 -1.2832085272 -1.2925261876  0.6922194577 -0.6309920413
 [16] -0.8587907299 -1.7233481982 -1.1827233749 -0.1681828455 -0.8694776756
 [21]  1.0089541123 -0.6032398324 -1.9914961315 -0.0763790536 -2.9995304980
 [26]  1.4340909761  0.0934684339  0.6630983750  1.6638393813  0.3647611286
 [31] -0.3710970537 -0.0167659499  3.1253510515  0.7051103294 -1.1475645996
 [36] -2.7689666502  0.2606586265  1.5203765297  0.9919797930  0.4288143771
 [41]  1.7542310815  1.1296595017 -0.2305422546 -0.4980751192 -1.0127850406
 [46]  0.4146867727 -1.6888679809  1.7436967031 -0.2499685927  0.2107286288
 [51] -0.1379608118  0.7577877625  0.0007496365 -0.6074168888  0.5900621164
 [56]  0.8097252187 -0.9757314493 -0.5174113292  0.5168888665  0.2331795597
 [61]  0.7361386089 -0.0625718879 -0.8428538180  0.2942797566  2.4356662450
 [66]  1.1382984832  2.0407035731 -1.2891769073 -0.0487682314 -0.1972182924
 [71] -0.5412995609 -1.0888682560  1.2787186339  1.1512179955  0.9099462807
 [76]  0.8647503596 -0.2860699871 -0.2495407934 -0.5431577176 -0.6160725413
 [81] -0.3855983887  1.6343483095 -0.5294571814 -0.3857188418 -0.3037353212
 [86]  0.5232363045  1.9688247216 -0.2517709324 -1.9320692070  0.3767971826
 [91]  0.5944615564 -0.0072096143  0.0724372636  2.0999392503 -1.7383635324
 [96] -1.0003692489 -0.1816067902 -0.6085164724  2.0669880199 -0.9464769212
> colRanges(tmp)
         [,1]     [,2]       [,3]      [,4]       [,5]      [,6]       [,7]
[1,] 1.260513 1.231598 -0.4854927 -1.646492 -0.2624161 -2.176522 -0.3417055
[2,] 1.260513 1.231598 -0.4854927 -1.646492 -0.2624161 -2.176522 -0.3417055
          [,8]      [,9]     [,10]     [,11]     [,12]     [,13]     [,14]
[1,] 0.1988194 -1.691783 0.8577321 0.2338299 -1.283209 -1.292526 0.6922195
[2,] 0.1988194 -1.691783 0.8577321 0.2338299 -1.283209 -1.292526 0.6922195
         [,15]      [,16]     [,17]     [,18]      [,19]      [,20]    [,21]
[1,] -0.630992 -0.8587907 -1.723348 -1.182723 -0.1681828 -0.8694777 1.008954
[2,] -0.630992 -0.8587907 -1.723348 -1.182723 -0.1681828 -0.8694777 1.008954
          [,22]     [,23]       [,24]    [,25]    [,26]      [,27]     [,28]
[1,] -0.6032398 -1.991496 -0.07637905 -2.99953 1.434091 0.09346843 0.6630984
[2,] -0.6032398 -1.991496 -0.07637905 -2.99953 1.434091 0.09346843 0.6630984
        [,29]     [,30]      [,31]       [,32]    [,33]     [,34]     [,35]
[1,] 1.663839 0.3647611 -0.3710971 -0.01676595 3.125351 0.7051103 -1.147565
[2,] 1.663839 0.3647611 -0.3710971 -0.01676595 3.125351 0.7051103 -1.147565
         [,36]     [,37]    [,38]     [,39]     [,40]    [,41]   [,42]
[1,] -2.768967 0.2606586 1.520377 0.9919798 0.4288144 1.754231 1.12966
[2,] -2.768967 0.2606586 1.520377 0.9919798 0.4288144 1.754231 1.12966
          [,43]      [,44]     [,45]     [,46]     [,47]    [,48]      [,49]
[1,] -0.2305423 -0.4980751 -1.012785 0.4146868 -1.688868 1.743697 -0.2499686
[2,] -0.2305423 -0.4980751 -1.012785 0.4146868 -1.688868 1.743697 -0.2499686
         [,50]      [,51]     [,52]        [,53]      [,54]     [,55]     [,56]
[1,] 0.2107286 -0.1379608 0.7577878 0.0007496365 -0.6074169 0.5900621 0.8097252
[2,] 0.2107286 -0.1379608 0.7577878 0.0007496365 -0.6074169 0.5900621 0.8097252
          [,57]      [,58]     [,59]     [,60]     [,61]       [,62]      [,63]
[1,] -0.9757314 -0.5174113 0.5168889 0.2331796 0.7361386 -0.06257189 -0.8428538
[2,] -0.9757314 -0.5174113 0.5168889 0.2331796 0.7361386 -0.06257189 -0.8428538
         [,64]    [,65]    [,66]    [,67]     [,68]       [,69]      [,70]
[1,] 0.2942798 2.435666 1.138298 2.040704 -1.289177 -0.04876823 -0.1972183
[2,] 0.2942798 2.435666 1.138298 2.040704 -1.289177 -0.04876823 -0.1972183
          [,71]     [,72]    [,73]    [,74]     [,75]     [,76]    [,77]
[1,] -0.5412996 -1.088868 1.278719 1.151218 0.9099463 0.8647504 -0.28607
[2,] -0.5412996 -1.088868 1.278719 1.151218 0.9099463 0.8647504 -0.28607
          [,78]      [,79]      [,80]      [,81]    [,82]      [,83]      [,84]
[1,] -0.2495408 -0.5431577 -0.6160725 -0.3855984 1.634348 -0.5294572 -0.3857188
[2,] -0.2495408 -0.5431577 -0.6160725 -0.3855984 1.634348 -0.5294572 -0.3857188
          [,85]     [,86]    [,87]      [,88]     [,89]     [,90]     [,91]
[1,] -0.3037353 0.5232363 1.968825 -0.2517709 -1.932069 0.3767972 0.5944616
[2,] -0.3037353 0.5232363 1.968825 -0.2517709 -1.932069 0.3767972 0.5944616
            [,92]      [,93]    [,94]     [,95]     [,96]      [,97]      [,98]
[1,] -0.007209614 0.07243726 2.099939 -1.738364 -1.000369 -0.1816068 -0.6085165
[2,] -0.007209614 0.07243726 2.099939 -1.738364 -1.000369 -0.1816068 -0.6085165
        [,99]     [,100]
[1,] 2.066988 -0.9464769
[2,] 2.066988 -0.9464769
> 
> 
> Max(tmp2)
[1] 2.770117
> Min(tmp2)
[1] -2.327912
> mean(tmp2)
[1] -0.004551597
> Sum(tmp2)
[1] -0.4551597
> Var(tmp2)
[1] 0.7331147
> 
> rowMeans(tmp2)
  [1]  0.35942867 -0.14963674 -0.34148521 -0.29658034  1.51753349  0.26936923
  [7] -0.25973295 -0.22334076 -0.16544185 -0.21734079 -0.73786817 -0.35248179
 [13] -0.17439955  1.09745963 -0.63381414  0.96324986  0.63408518  1.09994072
 [19]  1.17001165  1.66569333  0.09105994  0.83419759 -0.78598179  0.26579824
 [25] -0.41834086 -0.91121081  0.56594506  0.37883626 -0.61914395 -0.20361423
 [31] -1.10935341  1.31344554 -0.34741886 -0.30162603 -0.58965206 -0.38380445
 [37] -1.52907084  0.12302959  0.41462734  0.29540706  0.75110454  1.10476725
 [43]  1.13477163 -0.19585037  0.20891968 -1.18611350  0.05781264 -1.07105863
 [49] -0.53832520 -1.24584334  0.31319800 -0.10062504  0.62590049 -0.31196755
 [55]  1.17369754 -0.10748903 -0.27056660 -1.53204963 -0.45539009 -0.15052500
 [61]  0.71879279  0.21442005 -2.29749833 -1.18298745  0.20966935  0.53248941
 [67] -1.26024153  2.77011653 -2.32791180  0.97974023  0.40001905  0.65460559
 [73] -0.23891070  0.18807622  0.09401685  0.41938747 -1.12296735 -0.35022385
 [79]  0.36196238 -0.25509899  1.04125833  0.40672464 -0.65689751 -0.51678355
 [85]  0.80755188  0.46638172 -0.75442117 -0.48435288  1.34483174 -1.40195554
 [91]  1.04034772 -0.57640703  1.22715175 -1.06554611  0.52196723 -0.37171865
 [97]  0.77116389 -0.73476619 -0.51450271 -0.02478983
> rowSums(tmp2)
  [1]  0.35942867 -0.14963674 -0.34148521 -0.29658034  1.51753349  0.26936923
  [7] -0.25973295 -0.22334076 -0.16544185 -0.21734079 -0.73786817 -0.35248179
 [13] -0.17439955  1.09745963 -0.63381414  0.96324986  0.63408518  1.09994072
 [19]  1.17001165  1.66569333  0.09105994  0.83419759 -0.78598179  0.26579824
 [25] -0.41834086 -0.91121081  0.56594506  0.37883626 -0.61914395 -0.20361423
 [31] -1.10935341  1.31344554 -0.34741886 -0.30162603 -0.58965206 -0.38380445
 [37] -1.52907084  0.12302959  0.41462734  0.29540706  0.75110454  1.10476725
 [43]  1.13477163 -0.19585037  0.20891968 -1.18611350  0.05781264 -1.07105863
 [49] -0.53832520 -1.24584334  0.31319800 -0.10062504  0.62590049 -0.31196755
 [55]  1.17369754 -0.10748903 -0.27056660 -1.53204963 -0.45539009 -0.15052500
 [61]  0.71879279  0.21442005 -2.29749833 -1.18298745  0.20966935  0.53248941
 [67] -1.26024153  2.77011653 -2.32791180  0.97974023  0.40001905  0.65460559
 [73] -0.23891070  0.18807622  0.09401685  0.41938747 -1.12296735 -0.35022385
 [79]  0.36196238 -0.25509899  1.04125833  0.40672464 -0.65689751 -0.51678355
 [85]  0.80755188  0.46638172 -0.75442117 -0.48435288  1.34483174 -1.40195554
 [91]  1.04034772 -0.57640703  1.22715175 -1.06554611  0.52196723 -0.37171865
 [97]  0.77116389 -0.73476619 -0.51450271 -0.02478983
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.35942867 -0.14963674 -0.34148521 -0.29658034  1.51753349  0.26936923
  [7] -0.25973295 -0.22334076 -0.16544185 -0.21734079 -0.73786817 -0.35248179
 [13] -0.17439955  1.09745963 -0.63381414  0.96324986  0.63408518  1.09994072
 [19]  1.17001165  1.66569333  0.09105994  0.83419759 -0.78598179  0.26579824
 [25] -0.41834086 -0.91121081  0.56594506  0.37883626 -0.61914395 -0.20361423
 [31] -1.10935341  1.31344554 -0.34741886 -0.30162603 -0.58965206 -0.38380445
 [37] -1.52907084  0.12302959  0.41462734  0.29540706  0.75110454  1.10476725
 [43]  1.13477163 -0.19585037  0.20891968 -1.18611350  0.05781264 -1.07105863
 [49] -0.53832520 -1.24584334  0.31319800 -0.10062504  0.62590049 -0.31196755
 [55]  1.17369754 -0.10748903 -0.27056660 -1.53204963 -0.45539009 -0.15052500
 [61]  0.71879279  0.21442005 -2.29749833 -1.18298745  0.20966935  0.53248941
 [67] -1.26024153  2.77011653 -2.32791180  0.97974023  0.40001905  0.65460559
 [73] -0.23891070  0.18807622  0.09401685  0.41938747 -1.12296735 -0.35022385
 [79]  0.36196238 -0.25509899  1.04125833  0.40672464 -0.65689751 -0.51678355
 [85]  0.80755188  0.46638172 -0.75442117 -0.48435288  1.34483174 -1.40195554
 [91]  1.04034772 -0.57640703  1.22715175 -1.06554611  0.52196723 -0.37171865
 [97]  0.77116389 -0.73476619 -0.51450271 -0.02478983
> rowMin(tmp2)
  [1]  0.35942867 -0.14963674 -0.34148521 -0.29658034  1.51753349  0.26936923
  [7] -0.25973295 -0.22334076 -0.16544185 -0.21734079 -0.73786817 -0.35248179
 [13] -0.17439955  1.09745963 -0.63381414  0.96324986  0.63408518  1.09994072
 [19]  1.17001165  1.66569333  0.09105994  0.83419759 -0.78598179  0.26579824
 [25] -0.41834086 -0.91121081  0.56594506  0.37883626 -0.61914395 -0.20361423
 [31] -1.10935341  1.31344554 -0.34741886 -0.30162603 -0.58965206 -0.38380445
 [37] -1.52907084  0.12302959  0.41462734  0.29540706  0.75110454  1.10476725
 [43]  1.13477163 -0.19585037  0.20891968 -1.18611350  0.05781264 -1.07105863
 [49] -0.53832520 -1.24584334  0.31319800 -0.10062504  0.62590049 -0.31196755
 [55]  1.17369754 -0.10748903 -0.27056660 -1.53204963 -0.45539009 -0.15052500
 [61]  0.71879279  0.21442005 -2.29749833 -1.18298745  0.20966935  0.53248941
 [67] -1.26024153  2.77011653 -2.32791180  0.97974023  0.40001905  0.65460559
 [73] -0.23891070  0.18807622  0.09401685  0.41938747 -1.12296735 -0.35022385
 [79]  0.36196238 -0.25509899  1.04125833  0.40672464 -0.65689751 -0.51678355
 [85]  0.80755188  0.46638172 -0.75442117 -0.48435288  1.34483174 -1.40195554
 [91]  1.04034772 -0.57640703  1.22715175 -1.06554611  0.52196723 -0.37171865
 [97]  0.77116389 -0.73476619 -0.51450271 -0.02478983
> 
> colMeans(tmp2)
[1] -0.004551597
> colSums(tmp2)
[1] -0.4551597
> colVars(tmp2)
[1] 0.7331147
> colSd(tmp2)
[1] 0.8562212
> colMax(tmp2)
[1] 2.770117
> colMin(tmp2)
[1] -2.327912
> colMedians(tmp2)
[1] -0.1285629
> colRanges(tmp2)
          [,1]
[1,] -2.327912
[2,]  2.770117
> 
> 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]  5.5033592 -1.9318929 -4.8927639 -1.3283727  2.5461238 -3.7931654
 [7]  1.3766452 -0.9351328  0.1664069 -1.9076070
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.0540651
[2,]  0.1122436
[3,]  0.3268143
[4,]  0.6051501
[5,]  4.0291500
> 
> rowApply(tmp,sum)
 [1]  0.2902238 -2.1359620 -4.9980319 -1.9114836 -0.5062689  6.0428976
 [7] -2.9631872 -3.4278691  2.9523008  1.4609809
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    6    4    5    6    8   10    9    8    9     5
 [2,]    9    8    2    9    9    2    3    5    3     2
 [3,]    8    1    3    1    5    9    5    3    7     3
 [4,]    2    3    6    3    3    6    8    9   10     6
 [5,]    4    6    7   10    7    5    2   10    6     8
 [6,]    5    5    9    2    6    4    1    4    2     7
 [7,]    1    2    8    7    4    1   10    6    8    10
 [8,]   10   10    1    4    1    7    4    2    1     9
 [9,]    7    7   10    5    2    8    6    7    5     1
[10,]    3    9    4    8   10    3    7    1    4     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1] -0.8456378  2.0195861  3.2615209 -2.7648061  3.1125912  1.0677087
 [7] -3.0082254  4.4164130  2.5150830  1.3064134 -1.8708264 -0.3856370
[13]  0.5118878  0.3393931 -1.6627308 -0.4504070  2.7872642  2.1466933
[19]  2.7022526 -2.1709026
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.5881168
[2,] -0.3983785
[3,] -0.2120399
[4,]  0.2326821
[5,]  1.1202153
> 
> rowApply(tmp,sum)
[1] -0.2182090  4.5201420  2.8603237  5.4980397  0.3673376
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    2   17   10    6    8
[2,]   16   14    4    4   19
[3,]   20   16   13   19    2
[4,]   11    3    3   11    6
[5,]   17   19   14   15    3
> 
> 
> as.matrix(tmp)
           [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -1.5881168  0.9253477  1.6622352  0.1391321  1.1433557 -1.0626251
[2,]  1.1202153  0.7146745  1.0443084 -1.4504131  1.9599620  1.6128429
[3,]  0.2326821 -0.8409743  0.3395658 -0.8997647  0.5272047  0.7790466
[4,] -0.2120399 -0.5131234  1.4602932  0.1597902  0.5840847 -0.8138064
[5,] -0.3983785  1.7336616 -1.2448818 -0.7135506 -1.1020160  0.5522507
            [,7]       [,8]       [,9]      [,10]       [,11]      [,12]
[1,]  0.04760433 -0.2050816  1.1481998  0.3407406 -2.17236730  0.8902651
[2,] -1.90042212  3.1194865  0.2698861 -0.4272436 -0.02063465 -0.5706187
[3,] -0.06464539  0.7814825 -0.5034870  1.5055537 -0.96292592 -0.5535011
[4,] -0.57081761  0.5217458  0.5193986  0.6973953  1.43704988  0.0635819
[5,] -0.51994458  0.1987796  1.0810856 -0.8100327 -0.15194837 -0.2153642
          [,13]      [,14]       [,15]      [,16]        [,17]      [,18]
[1,] -0.4908057 -0.8041799 -0.88402742  0.1753301 -0.111022776  0.4874824
[2,]  0.9032048  0.3151603 -1.46582553 -1.1352771  0.562732857 -0.1527586
[3,]  1.3980483 -1.3457901 -0.29624737 -0.4735987  0.272486480  0.5303317
[4,] -0.2291579 -0.7636669  0.88720623  0.1234730  2.070329688 -0.1809000
[5,] -1.0694017  2.9378697  0.09616329  0.8596656 -0.007262095  1.4625378
         [,19]       [,20]
[1,] 1.3671920 -1.22686753
[2,] 0.4141351 -0.39327330
[3,] 0.2479173  2.18693883
[4,] 0.1661833  0.09101995
[5,] 0.5068249 -2.82872050
> 
> 
> 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 :  565  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.9536858 0.0238902 0.123421 0.5981419 -1.544995 0.3487477 1.584368
        col8        col9    col10     col11      col12      col13     col14
row1 1.32109 -0.05344108 1.327764 0.5767494 -0.2417424 -0.9900912 0.9838363
         col15     col16      col17     col18     col19    col20
row1 0.3135916 -0.404486 -0.2641152 0.9871197 -1.908529 1.411169
> tmp[,"col10"]
          col10
row1  1.3277641
row2 -0.1762196
row3 -0.2139421
row4 -1.0506476
row5  1.1426293
> tmp[c("row1","row5"),]
           col1       col2     col3      col4      col5       col6     col7
row1 -0.9536858  0.0238902 0.123421 0.5981419 -1.544995  0.3487477 1.584368
row5  0.2366101 -0.7832109 1.576635 0.8321049 -2.256566 -1.0406890 1.511734
           col8        col9    col10     col11      col12       col13
row1  1.3210897 -0.05344108 1.327764 0.5767494 -0.2417424 -0.99009121
row5 -0.3028303  1.68461735 1.142629 0.1047262 -0.7624091 -0.05509119
          col14      col15     col16      col17      col18      col19    col20
row1  0.9838363 0.31359159 -0.404486 -0.2641152  0.9871197 -1.9085292 1.411169
row5 -1.2841696 0.07602497  1.465710 -1.7502116 -2.3971334 -0.7168667 1.937374
> tmp[,c("col6","col20")]
           col6      col20
row1  0.3487477  1.4111686
row2  0.2548203  0.9068413
row3 -1.0500270 -1.3505885
row4  0.1502925 -1.0074161
row5 -1.0406890  1.9373736
> tmp[c("row1","row5"),c("col6","col20")]
           col6    col20
row1  0.3487477 1.411169
row5 -1.0406890 1.937374
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1    col2     col3     col4     col5     col6     col7     col8
row1 50.71988 49.6173 50.90334 49.27558 49.38879 104.6138 49.23694 50.29449
         col9    col10    col11    col12    col13    col14    col15   col16
row1 49.99184 50.36618 50.30548 51.02248 48.32623 48.88006 49.74232 50.5339
        col17    col18    col19    col20
row1 48.94918 49.55261 49.30953 104.5877
> tmp[,"col10"]
        col10
row1 50.36618
row2 28.18099
row3 31.42126
row4 29.21088
row5 50.13045
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.71988 49.61730 50.90334 49.27558 49.38879 104.6138 49.23694 50.29449
row5 49.93787 50.63074 49.71811 49.92475 49.89753 106.7987 50.90557 48.37149
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.99184 50.36618 50.30548 51.02248 48.32623 48.88006 49.74232 50.53390
row5 51.67332 50.13045 50.80746 48.62175 50.04061 49.98390 47.99357 49.79534
        col17    col18    col19    col20
row1 48.94918 49.55261 49.30953 104.5877
row5 50.05148 50.20683 50.64163 104.6166
> tmp[,c("col6","col20")]
          col6     col20
row1 104.61380 104.58765
row2  73.80030  75.92863
row3  73.42580  73.80218
row4  74.76739  74.51354
row5 106.79868 104.61659
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 104.6138 104.5877
row5 106.7987 104.6166
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 104.6138 104.5877
row5 106.7987 104.6166
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.01990791
[2,] -0.66863451
[3,] -1.07980171
[4,] -0.41633625
[5,]  0.01089184
> tmp[,c("col17","col7")]
          col17       col7
[1,] 0.62344699  0.5450700
[2,] 1.18063379  1.1341543
[3,] 2.53121795  0.1765248
[4,] 0.09398483 -2.5646066
[5,] 0.09504783  0.5621518
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,]  1.0521455 -1.65724288
[2,] -0.1873390 -0.35364168
[3,] -0.6372261  0.27601471
[4,]  0.1527238  0.01330035
[5,] -0.2041707  0.46429420
> subBufferedMatrix(tmp,1,c("col6"))[,1]
         col1
[1,] 1.052145
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,]  1.052145
[2,] -0.187339
> 
> 
> 
> 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.9928136 -0.0150163 0.003820296 0.20291470  1.1468525 -2.023620 0.9816317
row1 0.0413951 -0.4969490 0.367825881 0.07254466 -0.8148623  1.168647 0.5969427
          [,8]       [,9]      [,10]      [,11]     [,12]      [,13]      [,14]
row3 0.6748637 1.44265174 -0.7476652 -0.5545853 0.3530565  0.2250282 -1.3651018
row1 0.2025854 0.02329938  1.2893097 -0.1271009 0.6132629 -1.9314657 -0.2290285
           [,15]      [,16]     [,17]      [,18]      [,19]     [,20]
row3  0.24033734 -0.2634527 1.9310353 0.08688315 -0.1389346 0.9439099
row1 -0.02705487 -2.1073232 0.4729903 0.38218888 -2.3699700 0.3563362
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]     [,2]      [,3]     [,4]      [,5]       [,6]       [,7]
row2 -0.1293543 1.031859 -0.215424 1.328677 -1.067426 -0.8169535 -0.2888759
         [,8]       [,9]     [,10]
row2 1.004379 -0.9736346 0.2626386
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]       [,2]      [,3]       [,4]      [,5]     [,6]      [,7]
row5 0.5945292 -0.8046378 -1.729373 -0.5072752 0.5930452 1.862048 -1.626965
          [,8]       [,9]     [,10]    [,11]     [,12]   [,13]      [,14]
row5 -1.326236 -0.1177188 0.7471929 1.175545 -1.137516 1.82065 -0.1552259
          [,15]     [,16]     [,17]     [,18]     [,19]      [,20]
row5 -0.3320743 0.4646474 -2.279043 0.1466313 0.6619111 -0.5459419
> 
> 
> 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: 0xaaaaee0ccf90>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead45ae24f2"
 [2] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead191c5819"
 [3] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead66d56352"
 [4] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead45bbe937"
 [5] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead77da26aa"
 [6] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead3f6ac4c8"
 [7] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead3f56f664"
 [8] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead1b26fe01"
 [9] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead15192976"
[10] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead10dc1089"
[11] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead4d24d3a2"
[12] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead232c27d3"
[13] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead7a052e0c"
[14] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead4848dfa0"
[15] "/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests/BM277ead59c34ce3"
> 
> 
> ### 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: 0xaaaaee9bedf0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0xaaaaee9bedf0>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.17-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0xaaaaee9bedf0>
> rowMedians(tmp)
  [1]  0.0484953643 -0.0817644196  0.3758660228  0.0352019605  0.0828020114
  [6] -0.5161593438 -0.2752484977  0.5151313855  0.0094159722  0.0104160413
 [11]  0.0979306542  0.0463873135 -0.3290247550  0.0269285114 -0.2683718022
 [16] -0.4096195405 -0.2545746234 -0.0338801024  0.2457534504  0.5150784898
 [21]  0.3627246076 -0.0432805435  0.7432113841 -0.2007378866  0.3467875530
 [26]  0.1179062680 -0.0735802298  0.1441303441  0.3752681561  0.0113232373
 [31]  0.2330930185 -0.2504512569 -0.1625636845 -0.6456823583 -0.1230045208
 [36] -0.0722809297  0.1845263918 -0.3902395726 -0.0732142403  0.7741549899
 [41]  0.0614286056  0.1766765600  0.7883518297 -0.3044206366 -0.0147189379
 [46] -0.1662577344  0.5251647997  0.4351139752  0.1375564309  0.1408593795
 [51]  0.4009885751  0.0004676534  0.2124033153 -0.0944972444 -0.5304837305
 [56] -0.1992908317  0.0337412526  0.5700575949 -0.2685142360  0.0545594691
 [61] -0.1338100601  0.2532610955  0.4047376184 -0.0021165990  0.2931158740
 [66] -0.0701596352 -0.2678173961  0.0804675706  0.8070225749 -0.4642764352
 [71] -0.2641153192 -0.0442740906  0.0766653664  0.4937584081  0.0580534624
 [76]  0.5170336480 -0.1500020015 -0.2955161157 -0.1346006830  0.0710818436
 [81] -0.0404130805 -0.1155147783 -0.3115267996 -0.2693077360 -0.1075887321
 [86] -0.1518943571  0.2878331267  0.1368023711 -0.3994361842  0.1766137763
 [91] -0.0075256366  0.0128233456 -0.2322721705 -0.3690504395  0.1529667144
 [96]  0.1272677046  0.0536968115  0.4702528217  0.1952760589  0.1190721899
[101] -0.2995620514  0.8645613568  0.0192535559 -0.2363375385 -0.0632237169
[106] -0.3608654835  0.3785910447 -0.2522855866  0.2688059528 -0.0465379530
[111] -0.3568818786 -0.1552667536 -0.0586333205 -0.0417901354 -0.1167106047
[116] -0.0323572431 -0.1196328483 -0.2921380322 -0.6736075924  0.6406988098
[121] -0.2397151857  0.0760679837  0.1911674745 -0.0826856140 -0.1861187915
[126] -0.1526913537  0.2659023826 -0.4243573519  0.2860078905 -0.7262670965
[131] -0.3680023908 -0.4611438458  0.4812293358  0.0015093671 -0.3409401388
[136] -0.1669303096  0.1449430035  0.2499698390 -0.3529295604 -0.2138243044
[141]  0.4929971262 -0.1220809676  0.1428854840  0.0182172122 -0.7254619690
[146] -0.3748206208 -0.0358090497 -0.1918098158 -0.3417844603 -0.3288212380
[151] -0.5297907897  0.2077379323 -0.3696233976  0.4149560506 -0.0052369281
[156]  0.2982467162 -0.2296158350  0.2648075726 -0.1114415219 -0.0704090851
[161] -0.0084209226  0.8371754251  0.1124599413  0.4851862047 -0.0603339512
[166] -0.0134623280 -0.2712911512 -0.0671035369 -0.0156180825  0.1231387011
[171]  0.0741530833  0.1917022354  0.0605950954 -0.1772608435  0.3911694390
[176]  0.1657747363 -0.2560549140  0.0843957701  0.0786420233  0.1879508400
[181] -0.2766256667  0.3024776761  0.1393391945 -0.0036247031  0.1853919612
[186]  0.7554620931  0.1975546033  0.0735097012 -0.3675299587 -0.0254113312
[191] -0.5445701508 -0.2061308703  0.0508427418  0.0028398745 -0.1454024045
[196]  0.6282892079  0.0508206244 -0.1670530986  0.0678536298 -0.7356017955
[201] -0.1954069232  0.2383405288  0.2217572066 -0.2312973804 -0.0633479152
[206] -0.2641526602 -0.5512558396  0.3116559406  0.6419550539  0.2328517259
[211]  0.0928579342  0.1546019615  0.5196659908  0.5645918438 -0.1749733499
[216]  0.3795922673  0.2457157484  0.5610622822 -0.1399262377  0.0962567299
[221]  0.3424004567 -0.0991095312 -0.0219449696  0.0648948085 -0.4377408479
[226] -0.0331661230 -0.1914171106  0.2239550098  0.0163793668 -0.5331649179
> 
> proc.time()
   user  system elapsed 
  2.045   1.202   3.292 

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: 0xaaaab67c5460>
> .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: 0xaaaab67c5460>
> .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: 0xaaaab67c5460>
> .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: 0xaaaab67c5460>
> 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: 0xaaaab67b4dd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaab67b4dd0>
> .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: 0xaaaab67b4dd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaab67b4dd0>
> .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: 0xaaaab67b4dd0>
> 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: 0xaaaab5f3e4f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaab5f3e4f0>
> .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: 0xaaaab5f3e4f0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xaaaab5f3e4f0>
> .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: 0xaaaab5f3e4f0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0xaaaab5f3e4f0>
> .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: 0xaaaab5f3e4f0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0xaaaab5f3e4f0>
> .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: 0xaaaab5f3e4f0>
> 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: 0xaaaab71b2390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0xaaaab71b2390>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaab71b2390>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaab71b2390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile277ebf61572df1" "BufferedMatrixFile277ebf7bb5083d"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile277ebf61572df1" "BufferedMatrixFile277ebf7bb5083d"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaab783dd20>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaab783dd20>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xaaaab783dd20>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0xaaaab783dd20>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0xaaaab783dd20>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0xaaaab783dd20>
> .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: 0xaaaab70d85a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0xaaaab70d85a0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0xaaaab70d85a0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0xaaaab70d85a0>
> 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: 0xaaaab646dc00>
> .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: 0xaaaab646dc00>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.338   0.052   0.374 

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.312   0.048   0.345 

Example timings