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

This page was generated on 2024-06-14 14:38 -0400 (Fri, 14 Jun 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 (2024-04-24) -- "Puppy Cup" 4757
palomino3Windows Server 2022 Datacenterx644.4.0 (2024-04-24 ucrt) -- "Puppy Cup" 4491
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 249/2300HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.68.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-06-12 14:00 -0400 (Wed, 12 Jun 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: RELEASE_3_19
git_last_commit: af6c73d
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo1Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino3Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on palomino3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.68.0
Command: F:\biocbuild\bbs-3.19-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.19-bioc\R\library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-06-13 01:15:56 -0400 (Thu, 13 Jun 2024)
EndedAt: 2024-06-13 01:17:45 -0400 (Thu, 13 Jun 2024)
EllapsedTime: 108.7 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   F:\biocbuild\bbs-3.19-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.19-bioc\R\library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck'
* using R version 4.4.0 (2024-04-24 ucrt)
* using platform: x86_64-w64-mingw32
* R was compiled by
    gcc.exe (GCC) 13.2.0
    GNU Fortran (GCC) 13.2.0
* running under: Windows Server 2022 x64 (build 20348)
* using session charset: UTF-8
* using option '--no-vignettes'
* checking for file 'BufferedMatrix/DESCRIPTION' ... OK
* this is package 'BufferedMatrix' version '1.68.0'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'BufferedMatrix' can be installed ... OK
* used C compiler: 'gcc.exe (GCC) 13.2.0'
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files for x64 is not available
File 'F:/biocbuild/bbs-3.19-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll':
  Found '_exit', possibly from '_exit' (C)
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs nor [v]sprintf. The detected symbols are linked into
the code but might come from libraries and not actually be called.

See 'Writing portable packages' in the 'Writing R Extensions' manual.
* checking sizes of PDF files under 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ... NONE
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
  Running 'Rcodetesting.R'
  Running 'c_code_level_tests.R'
  Running 'objectTesting.R'
  Running 'rawCalltesting.R'
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  'F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   F:\biocbuild\bbs-3.19-bioc\R\bin\R.exe CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library 'F:/biocbuild/bbs-3.19-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 13.2.0'
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -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){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: 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"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c init_package.c -o init_package.o
gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.19-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.19-bioc/R/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs/x64
** 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
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.0 (2024-04-24 ucrt) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.32    0.43    0.84 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 (2024-04-24 ucrt) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 468464 25.1    1021761 54.6   633414 33.9
Vcells 853870  6.6    8388608 64.0  2003138 15.3
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Jun 13 01:16:45 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Jun 13 01:16:46 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x00000219ad6fd710>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Thu Jun 13 01:16:59 2024"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Thu Jun 13 01:17:04 2024"
> 
> ColMode(tmp2)
<pointer: 0x00000219ad6fd710>
> 
> 
> 
> ### 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,] 99.3509970  0.03093119 -1.1237977  0.5051234
[2,] -0.6645362 -1.39568446  0.5945722  0.2286706
[3,]  0.8986746  1.99739617  0.5186071 -0.9656813
[4,]  0.9255701  1.62283033  0.7673844  1.4168229
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]       [,2]      [,3]      [,4]
[1,] 99.3509970 0.03093119 1.1237977 0.5051234
[2,]  0.6645362 1.39568446 0.5945722 0.2286706
[3,]  0.8986746 1.99739617 0.5186071 0.9656813
[4,]  0.9255701 1.62283033 0.7673844 1.4168229
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9674970 0.1758727 1.0600932 0.7107203
[2,] 0.8151909 1.1813909 0.7710851 0.4781951
[3,] 0.9479845 1.4132927 0.7201438 0.9826908
[4,] 0.9620656 1.2739036 0.8760048 1.1903037
> 
> 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:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.02597 26.78966 36.72473 32.61233
[2,]  33.81645 38.20959 33.30542 30.01062
[3,]  35.37852 41.13032 32.72004 35.79259
[4,]  35.54623 39.36187 34.52743 38.31986
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x00000219ad6fd4d0>
> exp(tmp5)
<pointer: 0x00000219ad6fd4d0>
> log(tmp5,2)
<pointer: 0x00000219ad6fd4d0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.2807
> Min(tmp5)
[1] 53.11157
> mean(tmp5)
[1] 73.20432
> Sum(tmp5)
[1] 14640.86
> Var(tmp5)
[1] 847.9557
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.20107 67.96238 71.24649 72.90410 68.91901 67.57161 71.24157 72.60623
 [9] 74.84769 73.54300
> rowSums(tmp5)
 [1] 1824.021 1359.248 1424.930 1458.082 1378.380 1351.432 1424.831 1452.125
 [9] 1496.954 1470.860
> rowVars(tmp5)
 [1] 7858.64494   53.65885   68.39621   81.92552   57.41289   96.76989
 [7]   44.26563   61.48772   71.95395   52.59818
> rowSd(tmp5)
 [1] 88.648999  7.325220  8.270200  9.051271  7.577129  9.837169  6.653242
 [8]  7.841410  8.482567  7.252460
> rowMax(tmp5)
 [1] 466.28070  84.65788  89.33258  97.82650  85.28138  84.09438  88.05812
 [8]  92.05820  96.21633  86.42349
> rowMin(tmp5)
 [1] 55.75916 55.70498 57.17196 59.39828 54.86847 53.11157 59.47110 61.84584
 [9] 53.16539 59.03815
> 
> colMeans(tmp5)
 [1] 107.57974  75.28410  70.85327  72.17103  66.47882  68.72034  74.45140
 [8]  71.73387  73.57459  71.26880  75.97946  73.09139  70.94344  76.82881
[15]  70.51424  70.08389  70.70623  69.00633  69.55049  65.26607
> colSums(tmp5)
 [1] 1075.7974  752.8410  708.5327  721.7103  664.7882  687.2034  744.5140
 [8]  717.3387  735.7459  712.6880  759.7946  730.9139  709.4344  768.2881
[15]  705.1424  700.8389  707.0623  690.0633  695.5049  652.6607
> colVars(tmp5)
 [1] 15939.96447   130.10189    50.44449    48.95406    10.34476    44.11173
 [7]    50.04319   146.40838    72.31608    47.77361    13.19946    94.25953
[13]    30.65543   179.83485    35.12032    61.06352    47.00894    51.79402
[19]    62.69391    67.93280
> colSd(tmp5)
 [1] 126.253572  11.406221   7.102429   6.996718   3.216327   6.641666
 [7]   7.074121  12.099933   8.503886   6.911846   3.633106   9.708735
[13]   5.536734  13.410252   5.926240   7.814315   6.856307   7.196807
[19]   7.917948   8.242136
> colMax(tmp5)
 [1] 466.28070  86.42349  83.32945  80.65890  70.94651  83.69494  84.56156
 [8]  97.82650  88.05812  80.77332  80.10300  89.33258  81.18739  96.21633
[15]  79.97084  83.29679  79.24591  80.92486  84.30097  77.32056
> colMin(tmp5)
 [1] 53.16539 55.75916 58.25102 59.07976 60.11686 59.75561 66.83684 56.42893
 [9] 62.81036 59.39828 69.36467 54.86847 62.81937 55.58539 64.01858 56.71903
[17] 57.17196 58.64600 59.77668 53.11157
> 
> 
> ### 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.20107 67.96238 71.24649 72.90410 68.91901 67.57161 71.24157 72.60623
 [9] 74.84769       NA
> rowSums(tmp5)
 [1] 1824.021 1359.248 1424.930 1458.082 1378.380 1351.432 1424.831 1452.125
 [9] 1496.954       NA
> rowVars(tmp5)
 [1] 7858.64494   53.65885   68.39621   81.92552   57.41289   96.76989
 [7]   44.26563   61.48772   71.95395   54.23770
> rowSd(tmp5)
 [1] 88.648999  7.325220  8.270200  9.051271  7.577129  9.837169  6.653242
 [8]  7.841410  8.482567  7.364625
> rowMax(tmp5)
 [1] 466.28070  84.65788  89.33258  97.82650  85.28138  84.09438  88.05812
 [8]  92.05820  96.21633        NA
> rowMin(tmp5)
 [1] 55.75916 55.70498 57.17196 59.39828 54.86847 53.11157 59.47110 61.84584
 [9] 53.16539       NA
> 
> colMeans(tmp5)
 [1] 107.57974  75.28410  70.85327  72.17103  66.47882  68.72034  74.45140
 [8]  71.73387        NA  71.26880  75.97946  73.09139  70.94344  76.82881
[15]  70.51424  70.08389  70.70623  69.00633  69.55049  65.26607
> colSums(tmp5)
 [1] 1075.7974  752.8410  708.5327  721.7103  664.7882  687.2034  744.5140
 [8]  717.3387        NA  712.6880  759.7946  730.9139  709.4344  768.2881
[15]  705.1424  700.8389  707.0623  690.0633  695.5049  652.6607
> colVars(tmp5)
 [1] 15939.96447   130.10189    50.44449    48.95406    10.34476    44.11173
 [7]    50.04319   146.40838          NA    47.77361    13.19946    94.25953
[13]    30.65543   179.83485    35.12032    61.06352    47.00894    51.79402
[19]    62.69391    67.93280
> colSd(tmp5)
 [1] 126.253572  11.406221   7.102429   6.996718   3.216327   6.641666
 [7]   7.074121  12.099933         NA   6.911846   3.633106   9.708735
[13]   5.536734  13.410252   5.926240   7.814315   6.856307   7.196807
[19]   7.917948   8.242136
> colMax(tmp5)
 [1] 466.28070  86.42349  83.32945  80.65890  70.94651  83.69494  84.56156
 [8]  97.82650        NA  80.77332  80.10300  89.33258  81.18739  96.21633
[15]  79.97084  83.29679  79.24591  80.92486  84.30097  77.32056
> colMin(tmp5)
 [1] 53.16539 55.75916 58.25102 59.07976 60.11686 59.75561 66.83684 56.42893
 [9]       NA 59.39828 69.36467 54.86847 62.81937 55.58539 64.01858 56.71903
[17] 57.17196 58.64600 59.77668 53.11157
> 
> Max(tmp5,na.rm=TRUE)
[1] 466.2807
> Min(tmp5,na.rm=TRUE)
[1] 53.11157
> mean(tmp5,na.rm=TRUE)
[1] 73.22615
> Sum(tmp5,na.rm=TRUE)
[1] 14572
> Var(tmp5,na.rm=TRUE)
[1] 852.1425
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.20107 67.96238 71.24649 72.90410 68.91901 67.57161 71.24157 72.60623
 [9] 74.84769 73.78948
> rowSums(tmp5,na.rm=TRUE)
 [1] 1824.021 1359.248 1424.930 1458.082 1378.380 1351.432 1424.831 1452.125
 [9] 1496.954 1402.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7858.64494   53.65885   68.39621   81.92552   57.41289   96.76989
 [7]   44.26563   61.48772   71.95395   54.23770
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.648999  7.325220  8.270200  9.051271  7.577129  9.837169  6.653242
 [8]  7.841410  8.482567  7.364625
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.28070  84.65788  89.33258  97.82650  85.28138  84.09438  88.05812
 [8]  92.05820  96.21633  86.42349
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.75916 55.70498 57.17196 59.39828 54.86847 53.11157 59.47110 61.84584
 [9] 53.16539 59.03815
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 107.57974  75.28410  70.85327  72.17103  66.47882  68.72034  74.45140
 [8]  71.73387  74.09845  71.26880  75.97946  73.09139  70.94344  76.82881
[15]  70.51424  70.08389  70.70623  69.00633  69.55049  65.26607
> colSums(tmp5,na.rm=TRUE)
 [1] 1075.7974  752.8410  708.5327  721.7103  664.7882  687.2034  744.5140
 [8]  717.3387  666.8861  712.6880  759.7946  730.9139  709.4344  768.2881
[15]  705.1424  700.8389  707.0623  690.0633  695.5049  652.6607
> colVars(tmp5,na.rm=TRUE)
 [1] 15939.96447   130.10189    50.44449    48.95406    10.34476    44.11173
 [7]    50.04319   146.40838    78.26819    47.77361    13.19946    94.25953
[13]    30.65543   179.83485    35.12032    61.06352    47.00894    51.79402
[19]    62.69391    67.93280
> colSd(tmp5,na.rm=TRUE)
 [1] 126.253572  11.406221   7.102429   6.996718   3.216327   6.641666
 [7]   7.074121  12.099933   8.846931   6.911846   3.633106   9.708735
[13]   5.536734  13.410252   5.926240   7.814315   6.856307   7.196807
[19]   7.917948   8.242136
> colMax(tmp5,na.rm=TRUE)
 [1] 466.28070  86.42349  83.32945  80.65890  70.94651  83.69494  84.56156
 [8]  97.82650  88.05812  80.77332  80.10300  89.33258  81.18739  96.21633
[15]  79.97084  83.29679  79.24591  80.92486  84.30097  77.32056
> colMin(tmp5,na.rm=TRUE)
 [1] 53.16539 55.75916 58.25102 59.07976 60.11686 59.75561 66.83684 56.42893
 [9] 62.81036 59.39828 69.36467 54.86847 62.81937 55.58539 64.01858 56.71903
[17] 57.17196 58.64600 59.77668 53.11157
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.20107 67.96238 71.24649 72.90410 68.91901 67.57161 71.24157 72.60623
 [9] 74.84769      NaN
> rowSums(tmp5,na.rm=TRUE)
 [1] 1824.021 1359.248 1424.930 1458.082 1378.380 1351.432 1424.831 1452.125
 [9] 1496.954    0.000
> rowVars(tmp5,na.rm=TRUE)
 [1] 7858.64494   53.65885   68.39621   81.92552   57.41289   96.76989
 [7]   44.26563   61.48772   71.95395         NA
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.648999  7.325220  8.270200  9.051271  7.577129  9.837169  6.653242
 [8]  7.841410  8.482567        NA
> rowMax(tmp5,na.rm=TRUE)
 [1] 466.28070  84.65788  89.33258  97.82650  85.28138  84.09438  88.05812
 [8]  92.05820  96.21633        NA
> rowMin(tmp5,na.rm=TRUE)
 [1] 55.75916 55.70498 57.17196 59.39828 54.86847 53.11157 59.47110 61.84584
 [9] 53.16539       NA
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.15310  74.04639  69.46703  71.90153  66.61174  68.41395  73.60916
 [8]  71.37653       NaN  72.43539  76.58085  72.61786  70.98971  78.80555
[15]  70.28403  69.37671  69.75737  67.68205  69.19960  63.92669
> colSums(tmp5,na.rm=TRUE)
 [1] 1009.3779  666.4175  625.2032  647.1138  599.5057  615.7256  662.4824
 [8]  642.3887    0.0000  651.9185  689.2276  653.5608  638.9074  709.2500
[15]  632.5562  624.3904  627.8164  609.1384  622.7964  575.3402
> colVars(tmp5,na.rm=TRUE)
 [1] 17697.15927   129.13045    35.13130    54.25624    11.43909    48.56965
 [7]    48.31809   163.27285          NA    38.43496    10.78067   103.51942
[13]    34.46327   158.35483    38.91413    63.07030    42.75641    38.53893
[19]    69.14552    56.24237
> colSd(tmp5,na.rm=TRUE)
 [1] 133.030670  11.363558   5.927166   7.365884   3.382172   6.969193
 [7]   6.951121  12.777827         NA   6.199594   3.283393  10.174450
[13]   5.870543  12.583911   6.238119   7.941681   6.538839   6.207973
[19]   8.315378   7.499491
> colMax(tmp5,na.rm=TRUE)
 [1] 466.28070  85.60738  78.76395  80.65890  70.94651  83.69494  84.56156
 [8]  97.82650      -Inf  80.77332  80.10300  89.33258  81.18739  96.21633
[15]  79.97084  83.29679  77.18187  78.32691  84.30097  75.96630
> colMin(tmp5,na.rm=TRUE)
 [1] 53.16539 55.75916 58.25102 59.07976 60.11686 59.75561 66.83684 56.42893
 [9]      Inf 59.39828 69.36467 54.86847 62.81937 55.58539 64.01858 56.71903
[17] 57.17196 58.64600 59.77668 53.11157
> 
> 
> 
> 
> 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] 209.1671 336.1965 118.2807 194.1559 137.7625 123.7310 338.8438 209.3832
 [9] 288.1347 207.1727
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 209.1671 336.1965 118.2807 194.1559 137.7625 123.7310 338.8438 209.3832
 [9] 288.1347 207.1727
> 
> 
> 
> 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 -1.705303e-13 -2.842171e-14 -1.136868e-13  8.526513e-14
 [6] -1.421085e-14  0.000000e+00  5.684342e-14 -1.705303e-13  8.526513e-14
[11]  5.684342e-14 -2.842171e-14 -9.947598e-14  1.136868e-13 -1.136868e-13
[16]  1.705303e-13  1.136868e-13  0.000000e+00  5.684342e-14 -9.947598e-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)
+ }
8   8 
3   14 
5   14 
10   13 
7   1 
5   15 
6   10 
6   13 
1   9 
8   9 
9   19 
9   19 
2   13 
9   1 
6   14 
1   7 
3   13 
3   19 
3   1 
8   1 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.592283
> Min(tmp)
[1] -2.282909
> mean(tmp)
[1] 0.04815527
> Sum(tmp)
[1] 4.815527
> Var(tmp)
[1] 1.175592
> 
> rowMeans(tmp)
[1] 0.04815527
> rowSums(tmp)
[1] 4.815527
> rowVars(tmp)
[1] 1.175592
> rowSd(tmp)
[1] 1.084247
> rowMax(tmp)
[1] 2.592283
> rowMin(tmp)
[1] -2.282909
> 
> colMeans(tmp)
  [1]  0.34251656 -0.10205659  0.88454304 -1.27403297 -1.52575455  0.50573430
  [7]  1.27569570  0.29932304 -1.47083150 -1.24029316 -1.61388471 -0.28424422
 [13]  0.02421493  0.63691306 -1.12403151  0.69412874  0.73768871  2.25969236
 [19] -1.39815922  1.29326785 -0.18758362 -1.42799564 -0.02664567  0.80742096
 [25]  0.92799475 -0.94769289 -0.40552946  1.28084917 -0.98498315  1.74626100
 [31] -0.43903022 -2.14772750  1.19158917  1.29034582 -1.09104721  0.43107109
 [37] -0.14562244  0.71132011  0.45528915  1.37196787 -0.34802820  1.11144422
 [43] -0.58496488 -1.09892946 -1.41447721  1.18142571  0.25576754 -0.60682726
 [49]  1.01829469  1.01813520  0.67486734 -0.28894919  1.17441664  0.09961287
 [55]  2.59228302  0.21319074 -0.57827865 -0.09595475 -0.21027559 -0.39803033
 [61]  1.48873710 -1.23118784  0.30310385 -2.28290868 -0.25804876  0.39244488
 [67]  0.81183873  0.53183651 -1.86648612 -0.74426179 -0.39235851 -0.37500852
 [73] -0.94388057 -0.89559859  2.29452801 -0.53685714  0.95975940  0.75227445
 [79]  1.24791733  1.02870029 -0.62950779  0.23861418 -0.43747322 -0.41721213
 [85] -1.52149859 -1.18278997 -1.73960746  1.05075374  0.01796102 -0.66770916
 [91]  0.08269321  0.46345613  1.72275211 -1.68203662  2.24847903  1.58938264
 [97] -1.32862163  0.07167677  0.61352682  0.99274070
> colSums(tmp)
  [1]  0.34251656 -0.10205659  0.88454304 -1.27403297 -1.52575455  0.50573430
  [7]  1.27569570  0.29932304 -1.47083150 -1.24029316 -1.61388471 -0.28424422
 [13]  0.02421493  0.63691306 -1.12403151  0.69412874  0.73768871  2.25969236
 [19] -1.39815922  1.29326785 -0.18758362 -1.42799564 -0.02664567  0.80742096
 [25]  0.92799475 -0.94769289 -0.40552946  1.28084917 -0.98498315  1.74626100
 [31] -0.43903022 -2.14772750  1.19158917  1.29034582 -1.09104721  0.43107109
 [37] -0.14562244  0.71132011  0.45528915  1.37196787 -0.34802820  1.11144422
 [43] -0.58496488 -1.09892946 -1.41447721  1.18142571  0.25576754 -0.60682726
 [49]  1.01829469  1.01813520  0.67486734 -0.28894919  1.17441664  0.09961287
 [55]  2.59228302  0.21319074 -0.57827865 -0.09595475 -0.21027559 -0.39803033
 [61]  1.48873710 -1.23118784  0.30310385 -2.28290868 -0.25804876  0.39244488
 [67]  0.81183873  0.53183651 -1.86648612 -0.74426179 -0.39235851 -0.37500852
 [73] -0.94388057 -0.89559859  2.29452801 -0.53685714  0.95975940  0.75227445
 [79]  1.24791733  1.02870029 -0.62950779  0.23861418 -0.43747322 -0.41721213
 [85] -1.52149859 -1.18278997 -1.73960746  1.05075374  0.01796102 -0.66770916
 [91]  0.08269321  0.46345613  1.72275211 -1.68203662  2.24847903  1.58938264
 [97] -1.32862163  0.07167677  0.61352682  0.99274070
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  0.34251656 -0.10205659  0.88454304 -1.27403297 -1.52575455  0.50573430
  [7]  1.27569570  0.29932304 -1.47083150 -1.24029316 -1.61388471 -0.28424422
 [13]  0.02421493  0.63691306 -1.12403151  0.69412874  0.73768871  2.25969236
 [19] -1.39815922  1.29326785 -0.18758362 -1.42799564 -0.02664567  0.80742096
 [25]  0.92799475 -0.94769289 -0.40552946  1.28084917 -0.98498315  1.74626100
 [31] -0.43903022 -2.14772750  1.19158917  1.29034582 -1.09104721  0.43107109
 [37] -0.14562244  0.71132011  0.45528915  1.37196787 -0.34802820  1.11144422
 [43] -0.58496488 -1.09892946 -1.41447721  1.18142571  0.25576754 -0.60682726
 [49]  1.01829469  1.01813520  0.67486734 -0.28894919  1.17441664  0.09961287
 [55]  2.59228302  0.21319074 -0.57827865 -0.09595475 -0.21027559 -0.39803033
 [61]  1.48873710 -1.23118784  0.30310385 -2.28290868 -0.25804876  0.39244488
 [67]  0.81183873  0.53183651 -1.86648612 -0.74426179 -0.39235851 -0.37500852
 [73] -0.94388057 -0.89559859  2.29452801 -0.53685714  0.95975940  0.75227445
 [79]  1.24791733  1.02870029 -0.62950779  0.23861418 -0.43747322 -0.41721213
 [85] -1.52149859 -1.18278997 -1.73960746  1.05075374  0.01796102 -0.66770916
 [91]  0.08269321  0.46345613  1.72275211 -1.68203662  2.24847903  1.58938264
 [97] -1.32862163  0.07167677  0.61352682  0.99274070
> colMin(tmp)
  [1]  0.34251656 -0.10205659  0.88454304 -1.27403297 -1.52575455  0.50573430
  [7]  1.27569570  0.29932304 -1.47083150 -1.24029316 -1.61388471 -0.28424422
 [13]  0.02421493  0.63691306 -1.12403151  0.69412874  0.73768871  2.25969236
 [19] -1.39815922  1.29326785 -0.18758362 -1.42799564 -0.02664567  0.80742096
 [25]  0.92799475 -0.94769289 -0.40552946  1.28084917 -0.98498315  1.74626100
 [31] -0.43903022 -2.14772750  1.19158917  1.29034582 -1.09104721  0.43107109
 [37] -0.14562244  0.71132011  0.45528915  1.37196787 -0.34802820  1.11144422
 [43] -0.58496488 -1.09892946 -1.41447721  1.18142571  0.25576754 -0.60682726
 [49]  1.01829469  1.01813520  0.67486734 -0.28894919  1.17441664  0.09961287
 [55]  2.59228302  0.21319074 -0.57827865 -0.09595475 -0.21027559 -0.39803033
 [61]  1.48873710 -1.23118784  0.30310385 -2.28290868 -0.25804876  0.39244488
 [67]  0.81183873  0.53183651 -1.86648612 -0.74426179 -0.39235851 -0.37500852
 [73] -0.94388057 -0.89559859  2.29452801 -0.53685714  0.95975940  0.75227445
 [79]  1.24791733  1.02870029 -0.62950779  0.23861418 -0.43747322 -0.41721213
 [85] -1.52149859 -1.18278997 -1.73960746  1.05075374  0.01796102 -0.66770916
 [91]  0.08269321  0.46345613  1.72275211 -1.68203662  2.24847903  1.58938264
 [97] -1.32862163  0.07167677  0.61352682  0.99274070
> colMedians(tmp)
  [1]  0.34251656 -0.10205659  0.88454304 -1.27403297 -1.52575455  0.50573430
  [7]  1.27569570  0.29932304 -1.47083150 -1.24029316 -1.61388471 -0.28424422
 [13]  0.02421493  0.63691306 -1.12403151  0.69412874  0.73768871  2.25969236
 [19] -1.39815922  1.29326785 -0.18758362 -1.42799564 -0.02664567  0.80742096
 [25]  0.92799475 -0.94769289 -0.40552946  1.28084917 -0.98498315  1.74626100
 [31] -0.43903022 -2.14772750  1.19158917  1.29034582 -1.09104721  0.43107109
 [37] -0.14562244  0.71132011  0.45528915  1.37196787 -0.34802820  1.11144422
 [43] -0.58496488 -1.09892946 -1.41447721  1.18142571  0.25576754 -0.60682726
 [49]  1.01829469  1.01813520  0.67486734 -0.28894919  1.17441664  0.09961287
 [55]  2.59228302  0.21319074 -0.57827865 -0.09595475 -0.21027559 -0.39803033
 [61]  1.48873710 -1.23118784  0.30310385 -2.28290868 -0.25804876  0.39244488
 [67]  0.81183873  0.53183651 -1.86648612 -0.74426179 -0.39235851 -0.37500852
 [73] -0.94388057 -0.89559859  2.29452801 -0.53685714  0.95975940  0.75227445
 [79]  1.24791733  1.02870029 -0.62950779  0.23861418 -0.43747322 -0.41721213
 [85] -1.52149859 -1.18278997 -1.73960746  1.05075374  0.01796102 -0.66770916
 [91]  0.08269321  0.46345613  1.72275211 -1.68203662  2.24847903  1.58938264
 [97] -1.32862163  0.07167677  0.61352682  0.99274070
> colRanges(tmp)
          [,1]       [,2]     [,3]      [,4]      [,5]      [,6]     [,7]
[1,] 0.3425166 -0.1020566 0.884543 -1.274033 -1.525755 0.5057343 1.275696
[2,] 0.3425166 -0.1020566 0.884543 -1.274033 -1.525755 0.5057343 1.275696
         [,8]      [,9]     [,10]     [,11]      [,12]      [,13]     [,14]
[1,] 0.299323 -1.470832 -1.240293 -1.613885 -0.2842442 0.02421493 0.6369131
[2,] 0.299323 -1.470832 -1.240293 -1.613885 -0.2842442 0.02421493 0.6369131
         [,15]     [,16]     [,17]    [,18]     [,19]    [,20]      [,21]
[1,] -1.124032 0.6941287 0.7376887 2.259692 -1.398159 1.293268 -0.1875836
[2,] -1.124032 0.6941287 0.7376887 2.259692 -1.398159 1.293268 -0.1875836
         [,22]       [,23]    [,24]     [,25]      [,26]      [,27]    [,28]
[1,] -1.427996 -0.02664567 0.807421 0.9279947 -0.9476929 -0.4055295 1.280849
[2,] -1.427996 -0.02664567 0.807421 0.9279947 -0.9476929 -0.4055295 1.280849
          [,29]    [,30]      [,31]     [,32]    [,33]    [,34]     [,35]
[1,] -0.9849832 1.746261 -0.4390302 -2.147728 1.191589 1.290346 -1.091047
[2,] -0.9849832 1.746261 -0.4390302 -2.147728 1.191589 1.290346 -1.091047
         [,36]      [,37]     [,38]     [,39]    [,40]      [,41]    [,42]
[1,] 0.4310711 -0.1456224 0.7113201 0.4552892 1.371968 -0.3480282 1.111444
[2,] 0.4310711 -0.1456224 0.7113201 0.4552892 1.371968 -0.3480282 1.111444
          [,43]     [,44]     [,45]    [,46]     [,47]      [,48]    [,49]
[1,] -0.5849649 -1.098929 -1.414477 1.181426 0.2557675 -0.6068273 1.018295
[2,] -0.5849649 -1.098929 -1.414477 1.181426 0.2557675 -0.6068273 1.018295
        [,50]     [,51]      [,52]    [,53]      [,54]    [,55]     [,56]
[1,] 1.018135 0.6748673 -0.2889492 1.174417 0.09961287 2.592283 0.2131907
[2,] 1.018135 0.6748673 -0.2889492 1.174417 0.09961287 2.592283 0.2131907
          [,57]       [,58]      [,59]      [,60]    [,61]     [,62]     [,63]
[1,] -0.5782787 -0.09595475 -0.2102756 -0.3980303 1.488737 -1.231188 0.3031038
[2,] -0.5782787 -0.09595475 -0.2102756 -0.3980303 1.488737 -1.231188 0.3031038
         [,64]      [,65]     [,66]     [,67]     [,68]     [,69]      [,70]
[1,] -2.282909 -0.2580488 0.3924449 0.8118387 0.5318365 -1.866486 -0.7442618
[2,] -2.282909 -0.2580488 0.3924449 0.8118387 0.5318365 -1.866486 -0.7442618
          [,71]      [,72]      [,73]      [,74]    [,75]      [,76]     [,77]
[1,] -0.3923585 -0.3750085 -0.9438806 -0.8955986 2.294528 -0.5368571 0.9597594
[2,] -0.3923585 -0.3750085 -0.9438806 -0.8955986 2.294528 -0.5368571 0.9597594
         [,78]    [,79]  [,80]      [,81]     [,82]      [,83]      [,84]
[1,] 0.7522744 1.247917 1.0287 -0.6295078 0.2386142 -0.4374732 -0.4172121
[2,] 0.7522744 1.247917 1.0287 -0.6295078 0.2386142 -0.4374732 -0.4172121
         [,85]    [,86]     [,87]    [,88]      [,89]      [,90]      [,91]
[1,] -1.521499 -1.18279 -1.739607 1.050754 0.01796102 -0.6677092 0.08269321
[2,] -1.521499 -1.18279 -1.739607 1.050754 0.01796102 -0.6677092 0.08269321
         [,92]    [,93]     [,94]    [,95]    [,96]     [,97]      [,98]
[1,] 0.4634561 1.722752 -1.682037 2.248479 1.589383 -1.328622 0.07167677
[2,] 0.4634561 1.722752 -1.682037 2.248479 1.589383 -1.328622 0.07167677
         [,99]    [,100]
[1,] 0.6135268 0.9927407
[2,] 0.6135268 0.9927407
> 
> 
> Max(tmp2)
[1] 2.035312
> Min(tmp2)
[1] -2.505414
> mean(tmp2)
[1] -0.003030317
> Sum(tmp2)
[1] -0.3030317
> Var(tmp2)
[1] 0.7528404
> 
> rowMeans(tmp2)
  [1]  0.4697822469 -0.0007427333 -1.0156307092 -1.3764643312 -1.1906193982
  [6]  0.0292988862 -1.3421098153  1.0556162248  0.0587714431 -0.6908100001
 [11] -2.5054136471  0.5945478434  0.3199018448  0.0488676268 -0.6351994020
 [16] -0.8131468730 -0.8818824237  0.7734023500 -0.5611547313  1.0521719010
 [21] -0.9122579226 -0.2913389638  0.4737036988  0.3906356515  0.6655277734
 [26] -1.4611849807 -0.4333191544  0.1480422709 -0.6818942786  1.5692272677
 [31]  1.6447078474 -1.5163462262  0.4661301342 -0.2118250742 -0.6903583430
 [36] -0.9044587062  0.5157980742  1.3154714248 -0.2546819919  1.0943287697
 [41] -0.2773381322  0.3507857483 -0.0838797069 -0.8947924284  1.3716578425
 [46]  0.2572994262 -1.1778955976  0.5893262415 -0.0797412169  1.8047348478
 [51] -0.4596599082  1.2401775934 -0.1444713431  0.0683925232 -0.1334600775
 [56] -1.3826081489 -0.2615631691 -0.0268118840  0.9562365351 -0.1516203012
 [61] -0.0854973003  0.2795469794  0.1860628095 -0.8078788095 -1.0294135665
 [66]  0.0227933396 -0.7467210188  1.1074416273 -0.5061086086 -1.6797315256
 [71]  1.1112485087 -1.2108405756  0.7022691380  0.0896853891  0.6414813937
 [76]  0.2096030160  0.0541600331  0.7435948543 -0.5245754065 -0.5397502911
 [81]  0.1702524134  0.8132496085  0.2332410318  0.0068242313  0.7983243145
 [86] -0.5681551849  0.7954108577 -0.7609507905 -0.0376713011  0.1200851669
 [91]  1.0111028581 -1.3457188160  1.0542633692 -0.0436082839  0.0737325053
 [96]  2.0353124481  0.3272627766 -0.1092293322  1.8593666100 -0.6333585582
> rowSums(tmp2)
  [1]  0.4697822469 -0.0007427333 -1.0156307092 -1.3764643312 -1.1906193982
  [6]  0.0292988862 -1.3421098153  1.0556162248  0.0587714431 -0.6908100001
 [11] -2.5054136471  0.5945478434  0.3199018448  0.0488676268 -0.6351994020
 [16] -0.8131468730 -0.8818824237  0.7734023500 -0.5611547313  1.0521719010
 [21] -0.9122579226 -0.2913389638  0.4737036988  0.3906356515  0.6655277734
 [26] -1.4611849807 -0.4333191544  0.1480422709 -0.6818942786  1.5692272677
 [31]  1.6447078474 -1.5163462262  0.4661301342 -0.2118250742 -0.6903583430
 [36] -0.9044587062  0.5157980742  1.3154714248 -0.2546819919  1.0943287697
 [41] -0.2773381322  0.3507857483 -0.0838797069 -0.8947924284  1.3716578425
 [46]  0.2572994262 -1.1778955976  0.5893262415 -0.0797412169  1.8047348478
 [51] -0.4596599082  1.2401775934 -0.1444713431  0.0683925232 -0.1334600775
 [56] -1.3826081489 -0.2615631691 -0.0268118840  0.9562365351 -0.1516203012
 [61] -0.0854973003  0.2795469794  0.1860628095 -0.8078788095 -1.0294135665
 [66]  0.0227933396 -0.7467210188  1.1074416273 -0.5061086086 -1.6797315256
 [71]  1.1112485087 -1.2108405756  0.7022691380  0.0896853891  0.6414813937
 [76]  0.2096030160  0.0541600331  0.7435948543 -0.5245754065 -0.5397502911
 [81]  0.1702524134  0.8132496085  0.2332410318  0.0068242313  0.7983243145
 [86] -0.5681551849  0.7954108577 -0.7609507905 -0.0376713011  0.1200851669
 [91]  1.0111028581 -1.3457188160  1.0542633692 -0.0436082839  0.0737325053
 [96]  2.0353124481  0.3272627766 -0.1092293322  1.8593666100 -0.6333585582
> 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.4697822469 -0.0007427333 -1.0156307092 -1.3764643312 -1.1906193982
  [6]  0.0292988862 -1.3421098153  1.0556162248  0.0587714431 -0.6908100001
 [11] -2.5054136471  0.5945478434  0.3199018448  0.0488676268 -0.6351994020
 [16] -0.8131468730 -0.8818824237  0.7734023500 -0.5611547313  1.0521719010
 [21] -0.9122579226 -0.2913389638  0.4737036988  0.3906356515  0.6655277734
 [26] -1.4611849807 -0.4333191544  0.1480422709 -0.6818942786  1.5692272677
 [31]  1.6447078474 -1.5163462262  0.4661301342 -0.2118250742 -0.6903583430
 [36] -0.9044587062  0.5157980742  1.3154714248 -0.2546819919  1.0943287697
 [41] -0.2773381322  0.3507857483 -0.0838797069 -0.8947924284  1.3716578425
 [46]  0.2572994262 -1.1778955976  0.5893262415 -0.0797412169  1.8047348478
 [51] -0.4596599082  1.2401775934 -0.1444713431  0.0683925232 -0.1334600775
 [56] -1.3826081489 -0.2615631691 -0.0268118840  0.9562365351 -0.1516203012
 [61] -0.0854973003  0.2795469794  0.1860628095 -0.8078788095 -1.0294135665
 [66]  0.0227933396 -0.7467210188  1.1074416273 -0.5061086086 -1.6797315256
 [71]  1.1112485087 -1.2108405756  0.7022691380  0.0896853891  0.6414813937
 [76]  0.2096030160  0.0541600331  0.7435948543 -0.5245754065 -0.5397502911
 [81]  0.1702524134  0.8132496085  0.2332410318  0.0068242313  0.7983243145
 [86] -0.5681551849  0.7954108577 -0.7609507905 -0.0376713011  0.1200851669
 [91]  1.0111028581 -1.3457188160  1.0542633692 -0.0436082839  0.0737325053
 [96]  2.0353124481  0.3272627766 -0.1092293322  1.8593666100 -0.6333585582
> rowMin(tmp2)
  [1]  0.4697822469 -0.0007427333 -1.0156307092 -1.3764643312 -1.1906193982
  [6]  0.0292988862 -1.3421098153  1.0556162248  0.0587714431 -0.6908100001
 [11] -2.5054136471  0.5945478434  0.3199018448  0.0488676268 -0.6351994020
 [16] -0.8131468730 -0.8818824237  0.7734023500 -0.5611547313  1.0521719010
 [21] -0.9122579226 -0.2913389638  0.4737036988  0.3906356515  0.6655277734
 [26] -1.4611849807 -0.4333191544  0.1480422709 -0.6818942786  1.5692272677
 [31]  1.6447078474 -1.5163462262  0.4661301342 -0.2118250742 -0.6903583430
 [36] -0.9044587062  0.5157980742  1.3154714248 -0.2546819919  1.0943287697
 [41] -0.2773381322  0.3507857483 -0.0838797069 -0.8947924284  1.3716578425
 [46]  0.2572994262 -1.1778955976  0.5893262415 -0.0797412169  1.8047348478
 [51] -0.4596599082  1.2401775934 -0.1444713431  0.0683925232 -0.1334600775
 [56] -1.3826081489 -0.2615631691 -0.0268118840  0.9562365351 -0.1516203012
 [61] -0.0854973003  0.2795469794  0.1860628095 -0.8078788095 -1.0294135665
 [66]  0.0227933396 -0.7467210188  1.1074416273 -0.5061086086 -1.6797315256
 [71]  1.1112485087 -1.2108405756  0.7022691380  0.0896853891  0.6414813937
 [76]  0.2096030160  0.0541600331  0.7435948543 -0.5245754065 -0.5397502911
 [81]  0.1702524134  0.8132496085  0.2332410318  0.0068242313  0.7983243145
 [86] -0.5681551849  0.7954108577 -0.7609507905 -0.0376713011  0.1200851669
 [91]  1.0111028581 -1.3457188160  1.0542633692 -0.0436082839  0.0737325053
 [96]  2.0353124481  0.3272627766 -0.1092293322  1.8593666100 -0.6333585582
> 
> colMeans(tmp2)
[1] -0.003030317
> colSums(tmp2)
[1] -0.3030317
> colVars(tmp2)
[1] 0.7528404
> colSd(tmp2)
[1] 0.8676637
> colMax(tmp2)
[1] 2.035312
> colMin(tmp2)
[1] -2.505414
> colMedians(tmp2)
[1] 0.01480879
> colRanges(tmp2)
          [,1]
[1,] -2.505414
[2,]  2.035312
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.4252480  0.3050712  0.3898821 -3.8040239 -2.0465378  1.0805109
 [7]  1.1801861  0.3027953  4.2923564  0.2531720
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.2694998
[2,] -0.2325993
[3,] -0.2136992
[4,]  0.5589491
[5,]  1.0535624
> 
> rowApply(tmp,sum)
 [1]  4.27552834 -2.25055230  1.12693207 -5.16697079 -1.12172683  0.07688355
 [7] -2.91324529  4.74485829  0.85435374  3.75259951
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1   10    4    8    6    4    4    7    4     8
 [2,]    9    8    2    5    5    2    7    4    2    10
 [3,]    4    4    9    9    1   10    8    1    5     7
 [4,]    6    1    1    4    3    5    6    5    3     9
 [5,]    3    6    6    2    4    1   10    2    7     3
 [6,]    5    5    5    6   10    7    1    3   10     6
 [7,]    2    2   10    3    8    9    5    9    6     5
 [8,]    8    9    7    1    2    8    3    6    8     4
 [9,]   10    3    8    7    9    3    9   10    9     1
[10,]    7    7    3   10    7    6    2    8    1     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.7269373 -0.5682598  1.5380108 -3.0634002 -2.2632327  1.3425402
 [7]  0.5951135  0.3261558 -2.3460278  0.2403552 -2.5787864  3.8528082
[13]  1.4999665 -0.8192711 -1.7782823  0.5961130 -1.8493470  0.9143453
[19]  1.2639330  0.5637979
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.2801114
[2,] -0.9964013
[3,] -0.1833252
[4,]  0.8743857
[5,]  2.3123894
> 
> rowApply(tmp,sum)
[1]  4.4262912  1.6241298 -8.1309355 -0.8166934  1.0906773
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    3   16    4    9   20
[2,]    6    3   18   20   11
[3,]    2   20   17    7    8
[4,]   18    2    5   11    1
[5,]   14   10    6    8    3
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]        [,4]       [,5]       [,6]
[1,] -0.9964013 -0.65628115 -1.0284317  1.26240849  0.8768467  0.9316306
[2,]  0.8743857 -1.29537208  2.8179235 -1.36950328 -0.1009105  0.9338548
[3,] -1.2801114  0.43953004  0.4274567 -1.27992691 -1.2345032 -0.1569899
[4,] -0.1833252  1.00042465 -0.3474063 -0.06600475 -0.3094109 -1.0208705
[5,]  2.3123894 -0.05656123 -0.3315314 -1.61037379 -1.4952548  0.6549152
           [,7]       [,8]       [,9]       [,10]       [,11]     [,12]
[1,]  1.2328702  0.4277046 -0.2791000 -0.28591745  0.36850577 0.7631403
[2,] -0.1008952 -0.5639914 -0.3461944  1.00110940 -1.68247883 0.6806658
[3,] -1.3200653 -0.2180560 -1.4266809  0.55607915 -1.15535027 0.8026926
[4,]  0.1873116 -0.4098020  0.3489045 -0.08154934  0.01684819 0.9088046
[5,]  0.5958922  1.0903006 -0.6429570 -0.94936652 -0.12631125 0.6975049
           [,13]       [,14]      [,15]      [,16]      [,17]      [,18]
[1,]  1.39734042  0.25842137 -0.7622795 -1.0642599 -0.2866290  2.0341386
[2,]  0.02142474 -0.79030656 -0.3809152 -0.4019393  0.3523074  1.5210610
[3,]  0.15624696  0.34619513  0.4156810 -0.7172295 -1.0079237 -1.6987310
[4,] -0.72253407 -0.56904534 -1.9018010  0.9012035  0.6563766  0.2839379
[5,]  0.64748850 -0.06453573  0.8510324  1.8783382 -1.5634783 -1.2260613
           [,19]      [,20]
[1,]  1.10088449 -0.8683004
[2,] -0.22720592  0.6811101
[3,] -0.09636279  0.3171137
[4,] -0.37944959  0.8706940
[5,]  0.86606677 -0.4368196
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  623  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  540  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  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.5562349 0.7907424 0.8228547 0.7556521 0.1462959 -1.528111 -0.9483595
           col8       col9      col10     col11     col12      col13      col14
row1 -0.4084457 -0.2649849 -0.8646501 -0.452581 0.2947061 -0.2703825 -0.6777086
          col15     col16     col17      col18     col19     col20
row1 -0.1220097 -0.793263 -1.261195 -0.3560737 0.2564252 0.6256788
> tmp[,"col10"]
          col10
row1 -0.8646501
row2  2.2179612
row3 -0.7658430
row4  0.8414791
row5  1.5236249
> tmp[c("row1","row5"),]
          col1       col2       col3      col4      col5       col6       col7
row1 0.5562349  0.7907424  0.8228547 0.7556521 0.1462959 -1.5281113 -0.9483595
row5 0.2814927 -0.3734021 -0.6036313 2.7228747 0.2398998 -0.1866122 -0.4174925
           col8       col9      col10      col11      col12      col13
row1 -0.4084457 -0.2649849 -0.8646501 -0.4525810  0.2947061 -0.2703825
row5  0.1059544  0.6395093  1.5236249 -0.7000941 -0.1268709  1.2391606
          col14      col15      col16      col17      col18     col19
row1 -0.6777086 -0.1220097 -0.7932630 -1.2611946 -0.3560737 0.2564252
row5 -0.2814809 -0.6354934 -0.7781916  0.2237976  1.2224043 1.0904080
          col20
row1  0.6256788
row5 -1.2512219
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.5281113  0.6256788
row2  0.7299017  0.5082162
row3 -1.2692525  0.3481710
row4 -0.1434953 -0.5170580
row5 -0.1866122 -1.2512219
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 -1.5281113  0.6256788
row5 -0.1866122 -1.2512219
> 
> 
> 
> 
> 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 48.65734 50.01418 49.3706 49.03092 51.4072 107.1275 52.05452 49.20369
         col9    col10    col11    col12   col13    col14    col15    col16
row1 50.45773 51.25571 50.32223 49.86256 50.3348 50.39308 49.71759 51.18192
        col17    col18    col19    col20
row1 50.66753 49.59609 49.08908 103.9522
> tmp[,"col10"]
        col10
row1 51.25571
row2 29.82439
row3 30.72811
row4 32.16953
row5 49.18758
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.65734 50.01418 49.37060 49.03092 51.40720 107.1275 52.05452 49.20369
row5 50.42414 50.20582 49.65205 48.57728 49.88773 104.1574 49.32346 49.80878
         col9    col10    col11    col12   col13    col14    col15    col16
row1 50.45773 51.25571 50.32223 49.86256 50.3348 50.39308 49.71759 51.18192
row5 49.01247 49.18758 50.85093 49.02856 49.1798 48.33891 49.53060 49.95786
        col17    col18    col19    col20
row1 50.66753 49.59609 49.08908 103.9522
row5 48.80673 49.85114 50.19663 103.5847
> tmp[,c("col6","col20")]
          col6     col20
row1 107.12748 103.95222
row2  75.88070  75.53831
row3  76.44345  75.99190
row4  76.56685  75.58757
row5 104.15741 103.58467
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 107.1275 103.9522
row5 104.1574 103.5847
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 107.1275 103.9522
row5 104.1574 103.5847
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  1.5212975
[2,]  0.3998496
[3,] -0.8247034
[4,]  0.4281949
[5,]  1.3680450
> tmp[,c("col17","col7")]
          col17       col7
[1,]  1.2454762  2.4865797
[2,]  2.0416898 -1.3804722
[3,] -0.3255489  1.2536320
[4,] -1.3708615  0.3318123
[5,]  1.5479976 -0.9696624
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.93899764 -0.2953457
[2,] -0.79119538 -2.8733194
[3,]  0.05582488  2.3829291
[4,]  0.93565126 -0.3612743
[5,]  0.09067922  1.3397127
> subBufferedMatrix(tmp,1,c("col6"))[,1]
           col1
[1,] -0.9389976
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -0.9389976
[2,] -0.7911954
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]     [,2]      [,3]       [,4]      [,5]       [,6]      [,7]
row3 -0.3709199 1.617301 0.1166773 -0.3414299 -1.920277 -0.7948145 0.4114677
row1  1.4640562 0.296865 1.8822349  1.3270461 -1.058671 -0.8548100 0.2332579
           [,8]       [,9]      [,10]      [,11]     [,12]      [,13]     [,14]
row3 -0.5693124 -0.7579491 -0.1532578 -0.9925775  1.449480 -0.9894537 -1.479632
row1  0.9772502 -0.2540554 -0.3748669  0.8000012 -0.389082 -1.1055645  1.368650
         [,15]     [,16]     [,17]       [,18]     [,19]      [,20]
row3 0.2210707 -1.904859 -1.084506 -0.67017917 1.8441402 -0.4120927
row1 0.3916726  1.257836  0.235277 -0.07259264 0.6791003 -0.9422944
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]       [,3]       [,4]       [,5]        [,6]
row2 -0.1912353 0.9289296 -0.3218446 -0.2776386 -0.3957482 -0.07790884
           [,7]     [,8]       [,9]     [,10]
row2 -0.1504614 1.296758 -0.1415186 -1.764781
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
row5 -0.889394 -0.08069537 -0.2084904 -0.4272757 -0.9599344 -0.9218063
          [,7]        [,8]       [,9]     [,10]     [,11]    [,12]    [,13]
row5 0.5373273 0.001437829 -0.7079454 -1.293633 -2.143793 1.117118 1.217697
         [,14]    [,15]    [,16]     [,17]    [,18]        [,19]     [,20]
row5 -1.239669 1.403313 1.457514 0.2401834 1.635541 -0.008813837 -1.029858
> 
> 
> 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: 0x00000219ad6fde30>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f54115e288f"
 [2] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f54126b647d"
 [3] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f54258a4a05"
 [4] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f543d5f39e3"
 [5] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f5415cd4e1f"
 [6] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f543faa5f78"
 [7] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f5416eef56" 
 [8] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f545f724217"
 [9] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f54647214ee"
[10] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f54197d73bc"
[11] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f546f6e5679"
[12] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f5466a32b30"
[13] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f546f99589e"
[14] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f54758366e9"
[15] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM4f54aa5718"  
> 
> 
> ### 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: 0x00000219afbff170>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x00000219afbff170>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.19-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x00000219afbff170>
> rowMedians(tmp)
  [1]  0.7143575109  0.3626861867 -0.0850798611 -0.0659838297 -0.6508143831
  [6]  0.0567908410 -0.2855665813 -0.0170307725  0.0026912315  0.3945830546
 [11]  0.4363885367 -0.3052676738  0.0718592364  0.0141692999 -0.3342534918
 [16]  0.0821097244  0.1958441543  0.4659644572 -0.4386928794 -0.5935187216
 [21] -0.2789076897  0.1508471108  0.0108528428 -0.7554148549 -0.5570172542
 [26]  0.0134064295 -0.0103383609 -0.4979936373  0.0645859934 -0.0292092949
 [31] -0.1628799588 -0.4977853523 -0.0654746208 -0.0295497084  0.1528315524
 [36] -0.0318008461  0.3600589920 -0.1926636482 -0.1242354668  0.5633016037
 [41] -0.1943647195  0.1651889560  0.1136182026 -0.3108685954  0.0011428114
 [46] -0.6248154444 -0.1148889047  0.0418197007 -0.3690479462  0.5133417720
 [51]  0.1991860398  0.4571201071 -0.3512343070  0.3809683009 -0.2902702869
 [56]  0.0308384244  0.7624899079  0.1294545214 -0.0826413491 -0.2744963994
 [61] -0.5098746325 -0.0933161002 -0.2062993457 -0.2613786764  0.0167996892
 [66]  0.1489076715  0.0894291072 -0.5455049797  0.1830543245 -0.1535127793
 [71] -0.0802625510  0.0993151563  0.2736479768 -0.1626247706 -0.2221528033
 [76]  0.1660932969  0.2500884642  0.2702061009  0.1526240249 -0.0804883454
 [81] -0.0434416428  0.3248497050 -0.4979840632  0.2140449769  0.0260952869
 [86]  0.2396327032 -0.2857549088  0.8157797434 -0.4652375224 -0.0987610443
 [91]  0.2497458515 -0.1498050504  0.4485078597  0.8160370733 -0.2520491622
 [96] -0.3716944726 -0.1921223125 -0.3647139086  0.4471572981  0.2633425932
[101]  0.1196388811  0.1402005794 -0.0776574935  0.0141814987  0.1412999050
[106] -0.4382815817 -0.5787836535  0.2258553320 -0.4500350671  0.3950874234
[111]  0.2343316081 -0.1029500824 -0.1039897428 -0.1647784617  0.2222248368
[116] -0.0387492880 -0.6496313553 -0.3426450345  0.4710373956 -0.2240644938
[121] -0.1249135933 -0.3413295499 -0.2952643243  0.2404647325 -0.1640750518
[126] -0.1229415841 -0.1095384766  0.6837892014 -0.1655808174  0.0711028123
[131] -0.1095627981 -0.3995491736 -0.1625458397  0.2844181387  0.0297266768
[136] -0.5329056319 -0.1261860361  0.4282112928  0.1458906205  0.4177898569
[141]  0.5822700838 -0.0315748177  0.2203285309  0.1007789027 -0.3240469500
[146]  0.0318293215  0.0351171682  0.3948831329 -0.2828138595  0.2400357410
[151]  0.0750395895  0.2414083276  0.4883857558  0.1923970270  0.0165971529
[156]  0.1852242091  0.1814057119 -0.4315524711 -0.2428280634 -0.2084986130
[161]  0.0103396865  0.4417701676 -0.0773283391 -0.7722205892 -0.4509736334
[166]  0.2198575420  0.5100670787 -0.2334667306 -0.0092765151 -0.1437935702
[171]  0.1938725877 -0.0236413649 -0.2470149949  0.1674587794 -0.2458017157
[176] -0.1351220508  0.1812998539 -0.6614195758  0.5841785050 -0.6145368733
[181]  0.2581611903 -0.1801237062 -0.3951006805  0.2580440529  0.1671772708
[186]  0.1444621631 -0.7362874112 -0.1750229841  0.1908996669 -0.5242286099
[191]  0.1557487959 -0.2764173990 -0.2510876548 -0.0349417764 -0.3383622255
[196] -0.4583176450  0.1749567000 -0.0455108995  0.0007814213 -0.3308753686
[201]  0.1395904588 -0.2602375366 -0.1460255023  0.2243052443 -0.1757023313
[206]  0.5150825430 -0.1112041536  0.0340359084  0.1940089202  0.4194775760
[211]  0.2746226593 -0.0177725759  0.2482322193 -0.0218330674  0.4353544140
[216]  0.1301802866  0.0072966659  0.1806737984 -0.1248384079  0.2021669347
[221]  0.4057026956  0.0850981922 -0.0633805616  0.4558045757  0.4121740461
[226] -0.1806254263 -0.3906175362  0.0036452061  0.1615548857 -0.0250359839
> 
> proc.time()
   user  system elapsed 
   4.82   27.35   51.53 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 (2024-04-24 ucrt) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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: 0x000001d59cefdb90>
> .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: 0x000001d59cefdb90>
> .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: 0x000001d59cefdb90>
> .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: 0x000001d59cefdb90>
> 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: 0x000001d59cefd050>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d59cefd050>
> .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: 0x000001d59cefd050>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d59cefd050>
> .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: 0x000001d59cefd050>
> 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: 0x000001d59cefd830>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d59cefd830>
> .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: 0x000001d59cefd830>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001d59cefd830>
> .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: 0x000001d59cefd830>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000001d59cefd830>
> .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: 0x000001d59cefd830>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000001d59cefd830>
> .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: 0x000001d59cefd830>
> 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: 0x000001d59cefd170>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000001d59cefd170>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d59cefd170>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d59cefd170>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2f204ee71d62" "BufferedMatrixFile2f20552c6631"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2f204ee71d62" "BufferedMatrixFile2f20552c6631"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d59cefd9b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d59cefd9b0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001d59cefd9b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000001d59cefd9b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000001d59cefd9b0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000001d59cefd9b0>
> .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: 0x000001d59cefd290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000001d59cefd290>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000001d59cefd290>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000001d59cefd290>
> 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: 0x000001d59cefd2f0>
> .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: 0x000001d59cefd2f0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.31    0.37    0.71 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 (2024-04-24 ucrt) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

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.35    0.29    0.54 

Example timings