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

This page was generated on 2024-06-21 17:39 -0400 (Fri, 21 Jun 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 (2024-04-24) -- "Puppy Cup" 4758
palomino3Windows Server 2022 Datacenterx644.4.0 (2024-04-24 ucrt) -- "Puppy Cup" 4492
merida1macOS 12.7.4 Montereyx86_644.4.0 (2024-04-24) -- "Puppy Cup" 4506
kjohnson1macOS 13.6.6 Venturaarm644.4.0 (2024-04-24) -- "Puppy Cup" 4464
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-19 14:00 -0400 (Wed, 19 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
merida1macOS 12.7.4 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    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-20 01:29:03 -0400 (Thu, 20 Jun 2024)
EndedAt: 2024-06-20 01:30:56 -0400 (Thu, 20 Jun 2024)
EllapsedTime: 113.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.29    0.39    0.73 

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 20 01:29:57 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 20 01:29:57 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: 0x000002d91c2fd230>
> 
> 
> 
> 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 20 01:30:08 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 20 01:30:13 2024"
> 
> ColMode(tmp2)
<pointer: 0x000002d91c2fd230>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
            [,1]       [,2]       [,3]       [,4]
[1,] 101.3529310 -1.2330891  0.5390382 -0.3760693
[2,]   0.1754802  1.0164021 -0.1434228 -1.6307909
[3,]   1.4264916  2.1631910 -1.6519948 -0.3356334
[4,]   1.4339012  0.9549621 -0.3945945 -0.1609345
> 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,] 101.3529310 1.2330891 0.5390382 0.3760693
[2,]   0.1754802 1.0164021 0.1434228 1.6307909
[3,]   1.4264916 2.1631910 1.6519948 0.3356334
[4,]   1.4339012 0.9549621 0.3945945 0.1609345
> 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,] 10.0674193 1.1104454 0.7341922 0.6132449
[2,]  0.4189036 1.0081677 0.3787121 1.2770242
[3,]  1.1943582 1.4707791 1.2852995 0.5793388
[4,]  1.1974561 0.9772216 0.6281676 0.4011665
> 
> 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,] 227.02712 37.33754 32.88096 31.50852
[2,]  29.36452 36.09808 28.93054 39.40103
[3,]  38.37007 41.87098 39.50499 31.12902
[4,]  38.40846 35.72718 31.67627 29.17260
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000002d91c2fd350>
> exp(tmp5)
<pointer: 0x000002d91c2fd350>
> log(tmp5,2)
<pointer: 0x000002d91c2fd350>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.5272
> Min(tmp5)
[1] 53.06667
> mean(tmp5)
[1] 72.26248
> Sum(tmp5)
[1] 14452.5
> Var(tmp5)
[1] 881.9766
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 89.68299 69.24915 71.27949 68.47066 70.95306 69.67996 73.35374 70.67368
 [9] 69.70412 69.57791
> rowSums(tmp5)
 [1] 1793.660 1384.983 1425.590 1369.413 1419.061 1393.599 1467.075 1413.474
 [9] 1394.082 1391.558
> rowVars(tmp5)
 [1] 8174.91018   69.11322   67.08148   79.66743  105.96378   54.88462
 [7]   80.43689  106.89863   46.81474   79.40584
> rowSd(tmp5)
 [1] 90.415210  8.313436  8.190328  8.925661 10.293871  7.408416  8.968661
 [8] 10.339179  6.842130  8.910995
> rowMax(tmp5)
 [1] 472.52721  87.01858  87.14896  87.84758  87.69240  84.44410 100.58818
 [8]  84.82506  82.44884  88.23462
> rowMin(tmp5)
 [1] 53.06667 60.21514 56.74526 55.20625 57.54076 54.48079 58.59653 53.66437
 [9] 60.93095 53.21772
> 
> colMeans(tmp5)
 [1] 109.54006  76.07640  73.32685  68.44024  70.44691  66.90195  72.60243
 [8]  77.99375  72.53624  68.40786  69.50137  62.37191  70.32056  66.26220
[15]  65.70924  67.91478  72.27615  68.94637  73.92030  71.75395
> colSums(tmp5)
 [1] 1095.4006  760.7640  733.2685  684.4024  704.4691  669.0195  726.0243
 [8]  779.9375  725.3624  684.0786  695.0137  623.7191  703.2056  662.6220
[15]  657.0924  679.1478  722.7615  689.4637  739.2030  717.5395
> colVars(tmp5)
 [1] 16323.89880    39.95796    55.16291    66.87098    83.34650    48.38291
 [7]    82.61542    76.40256    94.20354    63.41650   120.55585    99.78423
[13]    67.89109    62.22172    25.97622    58.72194    66.45307    69.95413
[19]    51.40735    32.14112
> colSd(tmp5)
 [1] 127.765014   6.321231   7.427174   8.177468   9.129430   6.955783
 [7]   9.089303   8.740856   9.705851   7.963448  10.979793   9.989206
[13]   8.239605   7.888075   5.096687   7.663024   8.151875   8.363859
[19]   7.169892   5.669314
> colMax(tmp5)
 [1] 472.52721  87.14896  82.22446  84.44410  84.67497  76.45186  87.84758
 [8] 100.58818  88.23462  78.95273  85.56167  85.89120  88.46437  80.45249
[15]  75.00189  78.60752  82.70066  87.69240  86.84191  78.62564
> colMin(tmp5)
 [1] 59.66969 63.64264 60.21514 60.52639 58.20603 58.75236 57.54076 69.88918
 [9] 58.38209 59.50610 54.18637 53.21772 59.52330 53.06667 58.79058 56.93753
[17] 54.48079 61.02828 63.37966 61.76874
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 89.68299 69.24915 71.27949 68.47066 70.95306       NA 73.35374 70.67368
 [9] 69.70412 69.57791
> rowSums(tmp5)
 [1] 1793.660 1384.983 1425.590 1369.413 1419.061       NA 1467.075 1413.474
 [9] 1394.082 1391.558
> rowVars(tmp5)
 [1] 8174.91018   69.11322   67.08148   79.66743  105.96378   51.88070
 [7]   80.43689  106.89863   46.81474   79.40584
> rowSd(tmp5)
 [1] 90.415210  8.313436  8.190328  8.925661 10.293871  7.202826  8.968661
 [8] 10.339179  6.842130  8.910995
> rowMax(tmp5)
 [1] 472.52721  87.01858  87.14896  87.84758  87.69240        NA 100.58818
 [8]  84.82506  82.44884  88.23462
> rowMin(tmp5)
 [1] 53.06667 60.21514 56.74526 55.20625 57.54076       NA 58.59653 53.66437
 [9] 60.93095 53.21772
> 
> colMeans(tmp5)
 [1] 109.54006  76.07640  73.32685  68.44024  70.44691  66.90195  72.60243
 [8]  77.99375  72.53624        NA  69.50137  62.37191  70.32056  66.26220
[15]  65.70924  67.91478  72.27615  68.94637  73.92030  71.75395
> colSums(tmp5)
 [1] 1095.4006  760.7640  733.2685  684.4024  704.4691  669.0195  726.0243
 [8]  779.9375  725.3624        NA  695.0137  623.7191  703.2056  662.6220
[15]  657.0924  679.1478  722.7615  689.4637  739.2030  717.5395
> colVars(tmp5)
 [1] 16323.89880    39.95796    55.16291    66.87098    83.34650    48.38291
 [7]    82.61542    76.40256    94.20354          NA   120.55585    99.78423
[13]    67.89109    62.22172    25.97622    58.72194    66.45307    69.95413
[19]    51.40735    32.14112
> colSd(tmp5)
 [1] 127.765014   6.321231   7.427174   8.177468   9.129430   6.955783
 [7]   9.089303   8.740856   9.705851         NA  10.979793   9.989206
[13]   8.239605   7.888075   5.096687   7.663024   8.151875   8.363859
[19]   7.169892   5.669314
> colMax(tmp5)
 [1] 472.52721  87.14896  82.22446  84.44410  84.67497  76.45186  87.84758
 [8] 100.58818  88.23462        NA  85.56167  85.89120  88.46437  80.45249
[15]  75.00189  78.60752  82.70066  87.69240  86.84191  78.62564
> colMin(tmp5)
 [1] 59.66969 63.64264 60.21514 60.52639 58.20603 58.75236 57.54076 69.88918
 [9] 58.38209       NA 54.18637 53.21772 59.52330 53.06667 58.79058 56.93753
[17] 54.48079 61.02828 63.37966 61.76874
> 
> Max(tmp5,na.rm=TRUE)
[1] 472.5272
> Min(tmp5,na.rm=TRUE)
[1] 53.06667
> mean(tmp5,na.rm=TRUE)
[1] 72.32658
> Sum(tmp5,na.rm=TRUE)
[1] 14392.99
> Var(tmp5,na.rm=TRUE)
[1] 885.6051
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.68299 69.24915 71.27949 68.47066 70.95306 70.21543 73.35374 70.67368
 [9] 69.70412 69.57791
> rowSums(tmp5,na.rm=TRUE)
 [1] 1793.660 1384.983 1425.590 1369.413 1419.061 1334.093 1467.075 1413.474
 [9] 1394.082 1391.558
> rowVars(tmp5,na.rm=TRUE)
 [1] 8174.91018   69.11322   67.08148   79.66743  105.96378   51.88070
 [7]   80.43689  106.89863   46.81474   79.40584
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.415210  8.313436  8.190328  8.925661 10.293871  7.202826  8.968661
 [8] 10.339179  6.842130  8.910995
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.52721  87.01858  87.14896  87.84758  87.69240  84.44410 100.58818
 [8]  84.82506  82.44884  88.23462
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.06667 60.21514 56.74526 55.20625 57.54076 54.48079 58.59653 53.66437
 [9] 60.93095 53.21772
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 109.54006  76.07640  73.32685  68.44024  70.44691  66.90195  72.60243
 [8]  77.99375  72.53624  69.39695  69.50137  62.37191  70.32056  66.26220
[15]  65.70924  67.91478  72.27615  68.94637  73.92030  71.75395
> colSums(tmp5,na.rm=TRUE)
 [1] 1095.4006  760.7640  733.2685  684.4024  704.4691  669.0195  726.0243
 [8]  779.9375  725.3624  624.5725  695.0137  623.7191  703.2056  662.6220
[15]  657.0924  679.1478  722.7615  689.4637  739.2030  717.5395
> colVars(tmp5,na.rm=TRUE)
 [1] 16323.89880    39.95796    55.16291    66.87098    83.34650    48.38291
 [7]    82.61542    76.40256    94.20354    60.33782   120.55585    99.78423
[13]    67.89109    62.22172    25.97622    58.72194    66.45307    69.95413
[19]    51.40735    32.14112
> colSd(tmp5,na.rm=TRUE)
 [1] 127.765014   6.321231   7.427174   8.177468   9.129430   6.955783
 [7]   9.089303   8.740856   9.705851   7.767742  10.979793   9.989206
[13]   8.239605   7.888075   5.096687   7.663024   8.151875   8.363859
[19]   7.169892   5.669314
> colMax(tmp5,na.rm=TRUE)
 [1] 472.52721  87.14896  82.22446  84.44410  84.67497  76.45186  87.84758
 [8] 100.58818  88.23462  78.95273  85.56167  85.89120  88.46437  80.45249
[15]  75.00189  78.60752  82.70066  87.69240  86.84191  78.62564
> colMin(tmp5,na.rm=TRUE)
 [1] 59.66969 63.64264 60.21514 60.52639 58.20603 58.75236 57.54076 69.88918
 [9] 58.38209 59.97713 54.18637 53.21772 59.52330 53.06667 58.79058 56.93753
[17] 54.48079 61.02828 63.37966 61.76874
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 89.68299 69.24915 71.27949 68.47066 70.95306      NaN 73.35374 70.67368
 [9] 69.70412 69.57791
> rowSums(tmp5,na.rm=TRUE)
 [1] 1793.660 1384.983 1425.590 1369.413 1419.061    0.000 1467.075 1413.474
 [9] 1394.082 1391.558
> rowVars(tmp5,na.rm=TRUE)
 [1] 8174.91018   69.11322   67.08148   79.66743  105.96378         NA
 [7]   80.43689  106.89863   46.81474   79.40584
> rowSd(tmp5,na.rm=TRUE)
 [1] 90.415210  8.313436  8.190328  8.925661 10.293871        NA  8.968661
 [8] 10.339179  6.842130  8.910995
> rowMax(tmp5,na.rm=TRUE)
 [1] 472.52721  87.01858  87.14896  87.84758  87.69240        NA 100.58818
 [8]  84.82506  82.44884  88.23462
> rowMin(tmp5,na.rm=TRUE)
 [1] 53.06667 60.21514 56.74526 55.20625 57.54076       NA 58.59653 53.66437
 [9] 60.93095 53.21772
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.08121  76.24097  72.81655  66.66204  70.90899  65.84085  72.76617
 [8]  78.65003  72.71268       NaN  68.90541  61.49952  70.72526  65.70771
[15]  66.10895  68.05760  74.25341  69.56042  74.10329  70.99043
> colSums(tmp5,na.rm=TRUE)
 [1] 1035.7309  686.1687  655.3489  599.9583  638.1809  592.5677  654.8955
 [8]  707.8503  654.4142    0.0000  620.1487  553.4957  636.5273  591.3694
[15]  594.9806  612.5184  668.2807  626.0437  666.9296  638.9139
> colVars(tmp5,na.rm=TRUE)
 [1] 18018.96203    44.64804    59.12873    39.65715    91.36281    41.76402
 [7]    92.64074    81.10745   105.62873          NA   131.62974   103.69524
[13]    74.53494    66.54052    27.42584    65.83269    30.77710    74.45656
[19]    57.45652    29.60043
> colSd(tmp5,na.rm=TRUE)
 [1] 134.234727   6.681919   7.689521   6.297393   9.558389   6.462509
 [7]   9.625006   9.005968  10.277584         NA  11.473001  10.183086
[13]   8.633362   8.157237   5.236969   8.113734   5.547712   8.628822
[19]   7.580008   5.440627
> colMax(tmp5,na.rm=TRUE)
 [1] 472.52721  87.14896  82.22446  82.00809  84.67497  74.35010  87.84758
 [8] 100.58818  88.23462      -Inf  85.56167  85.89120  88.46437  80.45249
[15]  75.00189  78.60752  82.70066  87.69240  86.84191  78.22219
> colMin(tmp5,na.rm=TRUE)
 [1] 61.11839 63.64264 60.21514 60.52639 58.20603 58.75236 57.54076 69.88918
 [9] 58.38209      Inf 54.18637 53.21772 59.52330 53.06667 58.79058 56.93753
[17] 66.04294 61.02828 63.37966 61.76874
> 
> 
> 
> 
> 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] 192.0478 246.3944 139.4801 232.4306 446.5859 242.2725 161.6401 314.8169
 [9] 375.6115 130.6400
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 192.0478 246.3944 139.4801 232.4306 446.5859 242.2725 161.6401 314.8169
 [9] 375.6115 130.6400
> 
> 
> 
> 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]  7.105427e-14 -2.842171e-14  8.526513e-14  5.684342e-14 -1.705303e-13
 [6] -1.421085e-13  5.684342e-14  2.842171e-14  2.842171e-14 -8.526513e-14
[11]  2.842171e-14 -8.526513e-14 -1.136868e-13  0.000000e+00  2.557954e-13
[16]  1.136868e-13  0.000000e+00  0.000000e+00  8.526513e-14 -1.136868e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   17 
6   2 
1   4 
2   3 
1   2 
2   9 
4   9 
9   5 
8   19 
5   15 
5   11 
2   10 
7   1 
1   20 
8   5 
10   20 
3   14 
1   19 
6   17 
1   4 
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.167977
> Min(tmp)
[1] -2.033462
> mean(tmp)
[1] 0.1474155
> Sum(tmp)
[1] 14.74155
> Var(tmp)
[1] 1.006613
> 
> rowMeans(tmp)
[1] 0.1474155
> rowSums(tmp)
[1] 14.74155
> rowVars(tmp)
[1] 1.006613
> rowSd(tmp)
[1] 1.003301
> rowMax(tmp)
[1] 2.167977
> rowMin(tmp)
[1] -2.033462
> 
> colMeans(tmp)
  [1]  1.8783159519 -0.5074961794  0.2386622997  0.4478058974 -0.1744822465
  [6] -0.1841427794  0.9412338241 -0.4139534598  1.4142356605  1.3207353809
 [11] -0.2691670301  0.7230914780 -1.9382422936 -0.0757135152 -1.2544319195
 [16] -0.6356012104 -1.1005186983  0.5672036342 -1.5909531483  0.9911389344
 [21]  1.6388282906 -1.2668534372  0.4159047923 -1.2160068729 -1.2417005556
 [26]  0.5730657014  1.3959668570  2.1679768156 -0.6013274730  0.6269584890
 [31] -0.4639605242  0.2372160992 -0.8583546398  2.0649016589  0.1566649621
 [36] -0.6432327533  1.4132464428 -0.7597598148  1.2351126006 -0.4979566439
 [41] -0.0008145178 -1.0999159975  2.0304174732  0.7313341257  0.3128540083
 [46]  0.4173731732 -0.9266621322  0.5976741409  0.1860764909  0.6596943041
 [51]  1.8062170615  0.2578136293  1.9417194969 -0.6818246454  0.0677300631
 [56] -0.3169946436  1.9421690496 -0.2355701224  0.8868605813 -0.0725029444
 [61]  0.0274465452  0.4601903519  1.4290196334  0.3481147114  0.1365209664
 [66]  0.6462682019 -1.9559503076  0.1931557635 -0.1843771836 -2.0334624552
 [71]  1.2630853170 -0.9231698172  0.5496774700 -0.6281727303  0.0428197383
 [76] -0.8081422418 -0.7928159633 -0.3833800013 -0.4270463762  0.4567710005
 [81] -0.2792860951  1.1788428358  1.1408411507  0.4028735894  1.2048997540
 [86] -0.1292429117  0.2676340345 -1.0738078066 -0.4616657109  2.0363687284
 [91]  0.6314809379 -0.2507834458  1.9053039652 -1.0849091356 -1.1975887964
 [96] -0.8141349070  1.1340032341  0.8471158679 -0.7889360407 -0.6020682252
> colSums(tmp)
  [1]  1.8783159519 -0.5074961794  0.2386622997  0.4478058974 -0.1744822465
  [6] -0.1841427794  0.9412338241 -0.4139534598  1.4142356605  1.3207353809
 [11] -0.2691670301  0.7230914780 -1.9382422936 -0.0757135152 -1.2544319195
 [16] -0.6356012104 -1.1005186983  0.5672036342 -1.5909531483  0.9911389344
 [21]  1.6388282906 -1.2668534372  0.4159047923 -1.2160068729 -1.2417005556
 [26]  0.5730657014  1.3959668570  2.1679768156 -0.6013274730  0.6269584890
 [31] -0.4639605242  0.2372160992 -0.8583546398  2.0649016589  0.1566649621
 [36] -0.6432327533  1.4132464428 -0.7597598148  1.2351126006 -0.4979566439
 [41] -0.0008145178 -1.0999159975  2.0304174732  0.7313341257  0.3128540083
 [46]  0.4173731732 -0.9266621322  0.5976741409  0.1860764909  0.6596943041
 [51]  1.8062170615  0.2578136293  1.9417194969 -0.6818246454  0.0677300631
 [56] -0.3169946436  1.9421690496 -0.2355701224  0.8868605813 -0.0725029444
 [61]  0.0274465452  0.4601903519  1.4290196334  0.3481147114  0.1365209664
 [66]  0.6462682019 -1.9559503076  0.1931557635 -0.1843771836 -2.0334624552
 [71]  1.2630853170 -0.9231698172  0.5496774700 -0.6281727303  0.0428197383
 [76] -0.8081422418 -0.7928159633 -0.3833800013 -0.4270463762  0.4567710005
 [81] -0.2792860951  1.1788428358  1.1408411507  0.4028735894  1.2048997540
 [86] -0.1292429117  0.2676340345 -1.0738078066 -0.4616657109  2.0363687284
 [91]  0.6314809379 -0.2507834458  1.9053039652 -1.0849091356 -1.1975887964
 [96] -0.8141349070  1.1340032341  0.8471158679 -0.7889360407 -0.6020682252
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1]  1.8783159519 -0.5074961794  0.2386622997  0.4478058974 -0.1744822465
  [6] -0.1841427794  0.9412338241 -0.4139534598  1.4142356605  1.3207353809
 [11] -0.2691670301  0.7230914780 -1.9382422936 -0.0757135152 -1.2544319195
 [16] -0.6356012104 -1.1005186983  0.5672036342 -1.5909531483  0.9911389344
 [21]  1.6388282906 -1.2668534372  0.4159047923 -1.2160068729 -1.2417005556
 [26]  0.5730657014  1.3959668570  2.1679768156 -0.6013274730  0.6269584890
 [31] -0.4639605242  0.2372160992 -0.8583546398  2.0649016589  0.1566649621
 [36] -0.6432327533  1.4132464428 -0.7597598148  1.2351126006 -0.4979566439
 [41] -0.0008145178 -1.0999159975  2.0304174732  0.7313341257  0.3128540083
 [46]  0.4173731732 -0.9266621322  0.5976741409  0.1860764909  0.6596943041
 [51]  1.8062170615  0.2578136293  1.9417194969 -0.6818246454  0.0677300631
 [56] -0.3169946436  1.9421690496 -0.2355701224  0.8868605813 -0.0725029444
 [61]  0.0274465452  0.4601903519  1.4290196334  0.3481147114  0.1365209664
 [66]  0.6462682019 -1.9559503076  0.1931557635 -0.1843771836 -2.0334624552
 [71]  1.2630853170 -0.9231698172  0.5496774700 -0.6281727303  0.0428197383
 [76] -0.8081422418 -0.7928159633 -0.3833800013 -0.4270463762  0.4567710005
 [81] -0.2792860951  1.1788428358  1.1408411507  0.4028735894  1.2048997540
 [86] -0.1292429117  0.2676340345 -1.0738078066 -0.4616657109  2.0363687284
 [91]  0.6314809379 -0.2507834458  1.9053039652 -1.0849091356 -1.1975887964
 [96] -0.8141349070  1.1340032341  0.8471158679 -0.7889360407 -0.6020682252
> colMin(tmp)
  [1]  1.8783159519 -0.5074961794  0.2386622997  0.4478058974 -0.1744822465
  [6] -0.1841427794  0.9412338241 -0.4139534598  1.4142356605  1.3207353809
 [11] -0.2691670301  0.7230914780 -1.9382422936 -0.0757135152 -1.2544319195
 [16] -0.6356012104 -1.1005186983  0.5672036342 -1.5909531483  0.9911389344
 [21]  1.6388282906 -1.2668534372  0.4159047923 -1.2160068729 -1.2417005556
 [26]  0.5730657014  1.3959668570  2.1679768156 -0.6013274730  0.6269584890
 [31] -0.4639605242  0.2372160992 -0.8583546398  2.0649016589  0.1566649621
 [36] -0.6432327533  1.4132464428 -0.7597598148  1.2351126006 -0.4979566439
 [41] -0.0008145178 -1.0999159975  2.0304174732  0.7313341257  0.3128540083
 [46]  0.4173731732 -0.9266621322  0.5976741409  0.1860764909  0.6596943041
 [51]  1.8062170615  0.2578136293  1.9417194969 -0.6818246454  0.0677300631
 [56] -0.3169946436  1.9421690496 -0.2355701224  0.8868605813 -0.0725029444
 [61]  0.0274465452  0.4601903519  1.4290196334  0.3481147114  0.1365209664
 [66]  0.6462682019 -1.9559503076  0.1931557635 -0.1843771836 -2.0334624552
 [71]  1.2630853170 -0.9231698172  0.5496774700 -0.6281727303  0.0428197383
 [76] -0.8081422418 -0.7928159633 -0.3833800013 -0.4270463762  0.4567710005
 [81] -0.2792860951  1.1788428358  1.1408411507  0.4028735894  1.2048997540
 [86] -0.1292429117  0.2676340345 -1.0738078066 -0.4616657109  2.0363687284
 [91]  0.6314809379 -0.2507834458  1.9053039652 -1.0849091356 -1.1975887964
 [96] -0.8141349070  1.1340032341  0.8471158679 -0.7889360407 -0.6020682252
> colMedians(tmp)
  [1]  1.8783159519 -0.5074961794  0.2386622997  0.4478058974 -0.1744822465
  [6] -0.1841427794  0.9412338241 -0.4139534598  1.4142356605  1.3207353809
 [11] -0.2691670301  0.7230914780 -1.9382422936 -0.0757135152 -1.2544319195
 [16] -0.6356012104 -1.1005186983  0.5672036342 -1.5909531483  0.9911389344
 [21]  1.6388282906 -1.2668534372  0.4159047923 -1.2160068729 -1.2417005556
 [26]  0.5730657014  1.3959668570  2.1679768156 -0.6013274730  0.6269584890
 [31] -0.4639605242  0.2372160992 -0.8583546398  2.0649016589  0.1566649621
 [36] -0.6432327533  1.4132464428 -0.7597598148  1.2351126006 -0.4979566439
 [41] -0.0008145178 -1.0999159975  2.0304174732  0.7313341257  0.3128540083
 [46]  0.4173731732 -0.9266621322  0.5976741409  0.1860764909  0.6596943041
 [51]  1.8062170615  0.2578136293  1.9417194969 -0.6818246454  0.0677300631
 [56] -0.3169946436  1.9421690496 -0.2355701224  0.8868605813 -0.0725029444
 [61]  0.0274465452  0.4601903519  1.4290196334  0.3481147114  0.1365209664
 [66]  0.6462682019 -1.9559503076  0.1931557635 -0.1843771836 -2.0334624552
 [71]  1.2630853170 -0.9231698172  0.5496774700 -0.6281727303  0.0428197383
 [76] -0.8081422418 -0.7928159633 -0.3833800013 -0.4270463762  0.4567710005
 [81] -0.2792860951  1.1788428358  1.1408411507  0.4028735894  1.2048997540
 [86] -0.1292429117  0.2676340345 -1.0738078066 -0.4616657109  2.0363687284
 [91]  0.6314809379 -0.2507834458  1.9053039652 -1.0849091356 -1.1975887964
 [96] -0.8141349070  1.1340032341  0.8471158679 -0.7889360407 -0.6020682252
> colRanges(tmp)
         [,1]       [,2]      [,3]      [,4]       [,5]       [,6]      [,7]
[1,] 1.878316 -0.5074962 0.2386623 0.4478059 -0.1744822 -0.1841428 0.9412338
[2,] 1.878316 -0.5074962 0.2386623 0.4478059 -0.1744822 -0.1841428 0.9412338
           [,8]     [,9]    [,10]     [,11]     [,12]     [,13]       [,14]
[1,] -0.4139535 1.414236 1.320735 -0.269167 0.7230915 -1.938242 -0.07571352
[2,] -0.4139535 1.414236 1.320735 -0.269167 0.7230915 -1.938242 -0.07571352
         [,15]      [,16]     [,17]     [,18]     [,19]     [,20]    [,21]
[1,] -1.254432 -0.6356012 -1.100519 0.5672036 -1.590953 0.9911389 1.638828
[2,] -1.254432 -0.6356012 -1.100519 0.5672036 -1.590953 0.9911389 1.638828
         [,22]     [,23]     [,24]     [,25]     [,26]    [,27]    [,28]
[1,] -1.266853 0.4159048 -1.216007 -1.241701 0.5730657 1.395967 2.167977
[2,] -1.266853 0.4159048 -1.216007 -1.241701 0.5730657 1.395967 2.167977
          [,29]     [,30]      [,31]     [,32]      [,33]    [,34]    [,35]
[1,] -0.6013275 0.6269585 -0.4639605 0.2372161 -0.8583546 2.064902 0.156665
[2,] -0.6013275 0.6269585 -0.4639605 0.2372161 -0.8583546 2.064902 0.156665
          [,36]    [,37]      [,38]    [,39]      [,40]         [,41]     [,42]
[1,] -0.6432328 1.413246 -0.7597598 1.235113 -0.4979566 -0.0008145178 -1.099916
[2,] -0.6432328 1.413246 -0.7597598 1.235113 -0.4979566 -0.0008145178 -1.099916
        [,43]     [,44]    [,45]     [,46]      [,47]     [,48]     [,49]
[1,] 2.030417 0.7313341 0.312854 0.4173732 -0.9266621 0.5976741 0.1860765
[2,] 2.030417 0.7313341 0.312854 0.4173732 -0.9266621 0.5976741 0.1860765
         [,50]    [,51]     [,52]    [,53]      [,54]      [,55]      [,56]
[1,] 0.6596943 1.806217 0.2578136 1.941719 -0.6818246 0.06773006 -0.3169946
[2,] 0.6596943 1.806217 0.2578136 1.941719 -0.6818246 0.06773006 -0.3169946
        [,57]      [,58]     [,59]       [,60]      [,61]     [,62]   [,63]
[1,] 1.942169 -0.2355701 0.8868606 -0.07250294 0.02744655 0.4601904 1.42902
[2,] 1.942169 -0.2355701 0.8868606 -0.07250294 0.02744655 0.4601904 1.42902
         [,64]    [,65]     [,66]    [,67]     [,68]      [,69]     [,70]
[1,] 0.3481147 0.136521 0.6462682 -1.95595 0.1931558 -0.1843772 -2.033462
[2,] 0.3481147 0.136521 0.6462682 -1.95595 0.1931558 -0.1843772 -2.033462
        [,71]      [,72]     [,73]      [,74]      [,75]      [,76]     [,77]
[1,] 1.263085 -0.9231698 0.5496775 -0.6281727 0.04281974 -0.8081422 -0.792816
[2,] 1.263085 -0.9231698 0.5496775 -0.6281727 0.04281974 -0.8081422 -0.792816
        [,78]      [,79]    [,80]      [,81]    [,82]    [,83]     [,84]  [,85]
[1,] -0.38338 -0.4270464 0.456771 -0.2792861 1.178843 1.140841 0.4028736 1.2049
[2,] -0.38338 -0.4270464 0.456771 -0.2792861 1.178843 1.140841 0.4028736 1.2049
          [,86]    [,87]     [,88]      [,89]    [,90]     [,91]      [,92]
[1,] -0.1292429 0.267634 -1.073808 -0.4616657 2.036369 0.6314809 -0.2507834
[2,] -0.1292429 0.267634 -1.073808 -0.4616657 2.036369 0.6314809 -0.2507834
        [,93]     [,94]     [,95]      [,96]    [,97]     [,98]     [,99]
[1,] 1.905304 -1.084909 -1.197589 -0.8141349 1.134003 0.8471159 -0.788936
[2,] 1.905304 -1.084909 -1.197589 -0.8141349 1.134003 0.8471159 -0.788936
         [,100]
[1,] -0.6020682
[2,] -0.6020682
> 
> 
> Max(tmp2)
[1] 2.450212
> Min(tmp2)
[1] -2.696747
> mean(tmp2)
[1] -0.007274685
> Sum(tmp2)
[1] -0.7274685
> Var(tmp2)
[1] 1.079872
> 
> rowMeans(tmp2)
  [1]  0.44619817 -2.69674735 -2.54827801  0.02710769  1.03929777 -0.28489279
  [7]  0.47874785 -0.00261356  0.69660191  1.05250928 -0.64487983 -0.58770249
 [13] -0.59285000 -0.50115668  0.53339907  1.04054716 -0.55967556  0.61458723
 [19] -0.40491293  0.25013399 -1.86066645 -0.29192573  0.71305781 -0.15948221
 [25] -0.17571963 -2.53461693  0.42510599 -0.08422494 -0.58164270  0.71543763
 [31] -1.66217489  0.44707485  0.69888003  0.01420275 -0.97566387 -1.05252449
 [37] -1.03133378 -0.67259946 -0.07824630  0.64673467 -0.26373978  0.24214257
 [43] -1.03895669 -0.82829818  2.11859802 -0.73433047 -1.21846144 -0.54153409
 [49]  1.61859404  1.02904892 -0.69855302 -1.14611521 -1.29375166  1.53597629
 [55]  1.06160557 -0.74736676 -0.49102234  0.99633395  0.24792487 -0.13472794
 [61] -2.13199149 -0.69511258  0.62028829  0.37100966  0.53650195  0.68713924
 [67] -0.37989963  0.47716800 -1.11598589  0.23072731  1.43194400  1.75485402
 [73] -0.42566940  0.59424659  0.11614468 -1.06161830  1.60401696  0.31480149
 [79]  0.79496536 -0.25600171 -1.38544224 -0.44874649  0.08724375  0.27356041
 [85] -1.80992278 -0.45224908 -1.12859838  1.51834444  0.53232699  2.13865204
 [91]  0.20418461  1.51893826  0.94438108  0.09401025  0.01360457  1.04939809
 [97]  0.94501450  2.45021226 -1.27356929  0.96520009
> rowSums(tmp2)
  [1]  0.44619817 -2.69674735 -2.54827801  0.02710769  1.03929777 -0.28489279
  [7]  0.47874785 -0.00261356  0.69660191  1.05250928 -0.64487983 -0.58770249
 [13] -0.59285000 -0.50115668  0.53339907  1.04054716 -0.55967556  0.61458723
 [19] -0.40491293  0.25013399 -1.86066645 -0.29192573  0.71305781 -0.15948221
 [25] -0.17571963 -2.53461693  0.42510599 -0.08422494 -0.58164270  0.71543763
 [31] -1.66217489  0.44707485  0.69888003  0.01420275 -0.97566387 -1.05252449
 [37] -1.03133378 -0.67259946 -0.07824630  0.64673467 -0.26373978  0.24214257
 [43] -1.03895669 -0.82829818  2.11859802 -0.73433047 -1.21846144 -0.54153409
 [49]  1.61859404  1.02904892 -0.69855302 -1.14611521 -1.29375166  1.53597629
 [55]  1.06160557 -0.74736676 -0.49102234  0.99633395  0.24792487 -0.13472794
 [61] -2.13199149 -0.69511258  0.62028829  0.37100966  0.53650195  0.68713924
 [67] -0.37989963  0.47716800 -1.11598589  0.23072731  1.43194400  1.75485402
 [73] -0.42566940  0.59424659  0.11614468 -1.06161830  1.60401696  0.31480149
 [79]  0.79496536 -0.25600171 -1.38544224 -0.44874649  0.08724375  0.27356041
 [85] -1.80992278 -0.45224908 -1.12859838  1.51834444  0.53232699  2.13865204
 [91]  0.20418461  1.51893826  0.94438108  0.09401025  0.01360457  1.04939809
 [97]  0.94501450  2.45021226 -1.27356929  0.96520009
> 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.44619817 -2.69674735 -2.54827801  0.02710769  1.03929777 -0.28489279
  [7]  0.47874785 -0.00261356  0.69660191  1.05250928 -0.64487983 -0.58770249
 [13] -0.59285000 -0.50115668  0.53339907  1.04054716 -0.55967556  0.61458723
 [19] -0.40491293  0.25013399 -1.86066645 -0.29192573  0.71305781 -0.15948221
 [25] -0.17571963 -2.53461693  0.42510599 -0.08422494 -0.58164270  0.71543763
 [31] -1.66217489  0.44707485  0.69888003  0.01420275 -0.97566387 -1.05252449
 [37] -1.03133378 -0.67259946 -0.07824630  0.64673467 -0.26373978  0.24214257
 [43] -1.03895669 -0.82829818  2.11859802 -0.73433047 -1.21846144 -0.54153409
 [49]  1.61859404  1.02904892 -0.69855302 -1.14611521 -1.29375166  1.53597629
 [55]  1.06160557 -0.74736676 -0.49102234  0.99633395  0.24792487 -0.13472794
 [61] -2.13199149 -0.69511258  0.62028829  0.37100966  0.53650195  0.68713924
 [67] -0.37989963  0.47716800 -1.11598589  0.23072731  1.43194400  1.75485402
 [73] -0.42566940  0.59424659  0.11614468 -1.06161830  1.60401696  0.31480149
 [79]  0.79496536 -0.25600171 -1.38544224 -0.44874649  0.08724375  0.27356041
 [85] -1.80992278 -0.45224908 -1.12859838  1.51834444  0.53232699  2.13865204
 [91]  0.20418461  1.51893826  0.94438108  0.09401025  0.01360457  1.04939809
 [97]  0.94501450  2.45021226 -1.27356929  0.96520009
> rowMin(tmp2)
  [1]  0.44619817 -2.69674735 -2.54827801  0.02710769  1.03929777 -0.28489279
  [7]  0.47874785 -0.00261356  0.69660191  1.05250928 -0.64487983 -0.58770249
 [13] -0.59285000 -0.50115668  0.53339907  1.04054716 -0.55967556  0.61458723
 [19] -0.40491293  0.25013399 -1.86066645 -0.29192573  0.71305781 -0.15948221
 [25] -0.17571963 -2.53461693  0.42510599 -0.08422494 -0.58164270  0.71543763
 [31] -1.66217489  0.44707485  0.69888003  0.01420275 -0.97566387 -1.05252449
 [37] -1.03133378 -0.67259946 -0.07824630  0.64673467 -0.26373978  0.24214257
 [43] -1.03895669 -0.82829818  2.11859802 -0.73433047 -1.21846144 -0.54153409
 [49]  1.61859404  1.02904892 -0.69855302 -1.14611521 -1.29375166  1.53597629
 [55]  1.06160557 -0.74736676 -0.49102234  0.99633395  0.24792487 -0.13472794
 [61] -2.13199149 -0.69511258  0.62028829  0.37100966  0.53650195  0.68713924
 [67] -0.37989963  0.47716800 -1.11598589  0.23072731  1.43194400  1.75485402
 [73] -0.42566940  0.59424659  0.11614468 -1.06161830  1.60401696  0.31480149
 [79]  0.79496536 -0.25600171 -1.38544224 -0.44874649  0.08724375  0.27356041
 [85] -1.80992278 -0.45224908 -1.12859838  1.51834444  0.53232699  2.13865204
 [91]  0.20418461  1.51893826  0.94438108  0.09401025  0.01360457  1.04939809
 [97]  0.94501450  2.45021226 -1.27356929  0.96520009
> 
> colMeans(tmp2)
[1] -0.007274685
> colSums(tmp2)
[1] -0.7274685
> colVars(tmp2)
[1] 1.079872
> colSd(tmp2)
[1] 1.039169
> colMax(tmp2)
[1] 2.450212
> colMin(tmp2)
[1] -2.696747
> colMedians(tmp2)
[1] 0.02065522
> colRanges(tmp2)
          [,1]
[1,] -2.696747
[2,]  2.450212
> 
> 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]  2.9799382 -0.9358392 -2.0663281  0.9645017  2.7938893  0.6823538
 [7] -0.7495848  1.4484002  0.9912082  0.6188463
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1263151
[2,] -0.1984732
[3,]  0.4624121
[4,]  0.9341659
[5,]  1.2646295
> 
> rowApply(tmp,sum)
 [1]  0.002038113  5.397933185  2.008580404 -3.797299960 -1.936085458
 [6] -1.526703782  0.124030397  0.538868773  3.412415175  2.503608687
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]   10    7    4    2   10    4    6    6    9     9
 [2,]    7    9    1    3    2    7    5    4    7     2
 [3,]    1    5    5    8    4    6    3    8    8     1
 [4,]    3    3    7    6    7   10    7    2    1     5
 [5,]    8    2    6   10    3    9    8    5    3     6
 [6,]    6    8    3    4    6    5    2    1   10     7
 [7,]    5    6    9    7    1    3    1   10    5    10
 [8,]    2   10   10    1    5    8    4    3    4     3
 [9,]    9    1    2    9    9    2   10    9    6     8
[10,]    4    4    8    5    8    1    9    7    2     4
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.3387050  1.7304359  0.8295501 -4.1207087  1.8338572  2.9030513
 [7] -1.0242949  3.0747514  0.1114801 -2.0044347  3.0580357 -1.6025426
[13]  0.9150035  0.9460978  1.5191961 -1.8356322 -0.6832828 -3.5182316
[19] -0.7936348  0.9633454
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.8196148
[2,]  0.3512830
[3,]  0.5892247
[4,]  0.9554446
[5,]  1.2623676
> 
> rowApply(tmp,sum)
[1] -1.160545 -1.144222 -1.693480  3.435704  5.203289
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   18   14   19   13    4
[2,]   20    7   11   11    7
[3,]   19    5   12    9    8
[4,]    5    4    1    6   14
[5,]   17   17   13    4   16
> 
> 
> as.matrix(tmp)
           [,1]        [,2]        [,3]       [,4]        [,5]       [,6]
[1,]  1.2623676  1.51667607  1.27742838 -0.8672384  1.20669680  0.8454731
[2,]  0.3512830 -0.27957939 -0.62489232 -0.9447699  0.50991082 -0.3568305
[3,]  0.9554446 -0.08832473 -0.04992313 -2.3822690 -0.02985058 -0.4875564
[4,]  0.5892247  0.48541451  0.10854800 -0.7349270 -0.86878753  1.4343345
[5,] -0.8196148  0.09624945  0.11838920  0.8084956  1.01588770  1.4676306
            [,7]       [,8]       [,9]      [,10]     [,11]      [,12]
[1,] -2.71369555  0.8525813 -0.1905871  0.4262299 0.3036175 -0.6460301
[2,] -1.32158179  0.7520224  0.8393232 -1.1655854 0.4490080 -0.1479379
[3,]  2.69661305 -0.2478569 -0.7832846 -0.7525865 0.4456895 -0.1266361
[4,] -0.08582636  2.0601229 -1.1942716  0.6061840 0.6036229 -1.6122757
[5,]  0.40019574 -0.3421184  1.4403002 -1.1186766 1.2560978  0.9303373
          [,13]       [,14]       [,15]      [,16]      [,17]       [,18]
[1,] -1.8329416 -0.08477852 -0.39540889 -1.3049351 -1.2671912  0.09981127
[2,]  0.1562378  0.25218838  1.16684927  0.3547773 -0.2650339  0.26397894
[3,]  0.2228454  0.51535606  0.43942796 -0.2992866 -0.1675877 -1.52058301
[4,]  0.8716410  0.12003247 -0.09848647  0.4937531  0.8506555 -0.80802561
[5,]  1.4972209  0.14329946  0.40681420 -1.0799408  0.1658744 -1.55341317
           [,19]       [,20]
[1,] -0.58769109  0.93907108
[2,] -0.06440737 -1.06918271
[3,]  0.59298266 -0.62609349
[4,] -1.04933078  1.66410190
[5,]  0.31481177  0.05544864
> 
> 
> 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 :  625  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 :  541  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.790873 -0.7959054 0.08810366 1.102795 -0.6947408 1.261981 -1.353476
           col8      col9     col10      col11     col12    col13      col14
row1 -0.7956444 0.9278589 0.9220273 -0.3695107 0.5427902 1.524152 -0.4608363
          col15     col16      col17      col18    col19      col20
row1 -0.9880311 0.5325544 -0.2909901 -0.9799375 1.527189 -0.5115265
> tmp[,"col10"]
          col10
row1  0.9220273
row2 -0.8850359
row3  0.7526338
row4  0.4942241
row5 -0.2143856
> tmp[c("row1","row5"),]
          col1       col2       col3      col4       col5     col6      col7
row1 0.7908730 -0.7959054 0.08810366  1.102795 -0.6947408 1.261981 -1.353476
row5 0.9406319  0.8520891 0.76561343 -2.296115 -0.6804371 1.249239 -1.472748
           col8       col9      col10       col11     col12      col13
row1 -0.7956444  0.9278589  0.9220273 -0.36951072 0.5427902  1.5241524
row5 -1.6536066 -0.2536745 -0.2143856 -0.02223577 1.2665574 -0.3456855
          col14      col15      col16      col17       col18       col19
row1 -0.4608363 -0.9880311  0.5325544 -0.2909901 -0.97993752  1.52718871
row5  1.3256844 -1.0582653 -0.5911403 -1.5924526 -0.06542965 -0.01991762
          col20
row1 -0.5115265
row5 -0.9279698
> tmp[,c("col6","col20")]
           col6      col20
row1  1.2619814 -0.5115265
row2  0.3510384  0.5928422
row3 -0.8393408 -0.3731376
row4 -0.6564381 -0.8073244
row5  1.2492390 -0.9279698
> tmp[c("row1","row5"),c("col6","col20")]
         col6      col20
row1 1.261981 -0.5115265
row5 1.249239 -0.9279698
> 
> 
> 
> 
> 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.22203 51.33723 49.81949 50.08979 50.79857 106.4343 48.65028 50.46656
         col9    col10    col11    col12    col13    col14    col15   col16
row1 47.66104 50.61223 49.61326 50.47756 52.11195 50.71869 50.48799 50.0045
        col17    col18    col19    col20
row1 49.22734 50.94795 50.47006 105.2348
> tmp[,"col10"]
        col10
row1 50.61223
row2 29.59607
row3 31.22099
row4 30.06955
row5 49.88448
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 48.22203 51.33723 49.81949 50.08979 50.79857 106.4343 48.65028 50.46656
row5 49.91112 51.05087 50.10439 50.14619 50.32901 105.7403 50.34067 50.61468
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.66104 50.61223 49.61326 50.47756 52.11195 50.71869 50.48799 50.00450
row5 48.94316 49.88448 50.82804 49.95192 50.19950 48.47808 50.33029 48.72807
        col17    col18    col19    col20
row1 49.22734 50.94795 50.47006 105.2348
row5 48.88704 47.73946 49.81803 102.9288
> tmp[,c("col6","col20")]
          col6     col20
row1 106.43427 105.23480
row2  76.77717  74.77716
row3  73.02005  74.81947
row4  74.66958  75.67155
row5 105.74035 102.92882
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 106.4343 105.2348
row5 105.7403 102.9288
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 106.4343 105.2348
row5 105.7403 102.9288
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.2646132
[2,] -1.4610927
[3,] -0.9604105
[4,]  0.7657780
[5,]  0.5762015
> tmp[,c("col17","col7")]
           col17        col7
[1,] -0.46251247  0.56841056
[2,] -0.31369603  0.12001558
[3,]  0.02301346  0.01430673
[4,]  0.81146730  0.19235078
[5,]  0.36621830 -0.58621531
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.8964919  0.5963301
[2,]  1.2436194 -0.9468856
[3,] -0.1874116 -1.0920246
[4,]  1.0889991 -1.0752562
[5,] -0.2011969  0.3773615
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.8964919
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.8964919
[2,] 1.2436194
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
           [,1]      [,2]       [,3]       [,4]       [,5]        [,6]
row3 -2.2335195 0.7655676 -1.7509482 -0.4747357 0.04156397  0.05185082
row1 -0.7924118 1.3811180  0.4211017  0.3260389 0.20692036 -0.33546278
           [,7]       [,8]       [,9]      [,10]      [,11]       [,12]
row3 -1.3841222 1.18116881 -1.1733089 -0.3407964  0.7021700 -0.40520415
row1 -0.9026298 0.08344796 -0.7893756  1.6596364 -0.5756123 -0.07939845
          [,13]      [,14]      [,15]     [,16]       [,17]     [,18]     [,19]
row3 -0.2738651 -1.0799147  0.8736614 0.7317158 1.261547072  1.626981 0.8612177
row1  0.9347156 -0.7551526 -1.5686734 0.8343795 0.004936602 -1.207047 1.7210926
          [,20]
row3  0.4352899
row1 -1.8012397
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]       [,2]      [,3]     [,4]       [,5]      [,6]      [,7]
row2 0.2889704 -0.3289234 0.4589842 1.226455 -0.1780194 -1.488142 0.1329241
          [,8]    [,9]      [,10]
row2 0.1476405 -1.0135 -0.5076827
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]    [,4]        [,5]       [,6]       [,7]
row5 0.1566354 -1.294917 -1.276203 1.02179 -0.08760141 -0.4270388 -0.5977864
         [,8]      [,9]    [,10]   [,11]    [,12]      [,13]      [,14]
row5 1.730269 -2.461778 1.034978 0.60976 1.836322 -0.9475719 -0.6128903
         [,15]    [,16]     [,17]     [,18]      [,19]      [,20]
row5 0.5662026 1.085602 -1.969061 0.3436913 -0.6128122 -0.5457754
> 
> 
> 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: 0x000002d91c2fdcb0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM105841a444eb"
 [2] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM105856262df6"
 [3] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10582df059f2"
 [4] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10584b8b698d"
 [5] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10587c137012"
 [6] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10587dd21206"
 [7] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10586d02657b"
 [8] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10582f37a39" 
 [9] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10581b835fea"
[10] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10584c5332ec"
[11] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM105831923c7c"
[12] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10586c9d794b"
[13] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM1058d0331c4" 
[14] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM10583c302992"
[15] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM1058176a581b"
> 
> 
> ### 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: 0x000002d91ebff2f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000002d91ebff2f0>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.19-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000002d91ebff2f0>
> rowMedians(tmp)
  [1] -0.0733279935 -0.4473909186  0.2141666824 -0.0671918076  0.2722089775
  [6] -0.2795591328  0.0390804199 -0.0405702094 -0.5553287959 -0.0509503594
 [11] -0.5219167924 -0.4715705720  0.4244816590 -0.1186481053  0.0764370511
 [16] -0.4298968527 -0.1373452326 -0.2922223387 -0.0542469471  0.5113906312
 [21] -0.3720906999 -0.5773406823  0.0687254141  0.1487225788 -0.4139764478
 [26]  0.1455273817 -0.1696494372  0.3247936023 -0.0603879705  0.1776153407
 [31] -0.0739292028  0.0814197082  0.4975961667 -0.1035975479  0.1486948113
 [36] -0.1596434609 -0.2786943619 -0.5366543512 -0.2191363161 -0.3767966003
 [41]  0.1099522360  0.5272138094  0.0086120765 -0.1970607625 -0.0509348263
 [46] -0.1490129922 -0.4979260856 -0.3683034629 -0.4217084583 -0.3166029721
 [51]  0.1070946292 -0.0504549022  0.3755962082 -0.1088926694  0.3674096652
 [56] -0.2479959335  0.1317658038 -0.4030652508  0.3279276138  0.2821887348
 [61] -0.3505087814  0.2257449230 -0.2247911917  0.0888354893 -0.0052049539
 [66] -0.0169860891 -0.2830102910  0.0623508495 -0.8600587702  0.5403744251
 [71] -0.0788578803 -0.1046103388 -0.2432480144 -0.4538039013 -0.0339139920
 [76] -0.0499085326  0.1873779981  0.0503342671  0.5958061712  0.0755502661
 [81] -0.3854619852  0.0268655833 -0.4608947849 -0.2565712480  0.1010969246
 [86] -0.0823678685  0.0960134254  0.5240255830 -0.0964644682  0.2349797820
 [91] -0.3246407477  0.1417065676  0.2783497200  0.0212245802  0.0871779734
 [96]  0.1360808533  0.4926233315  0.0291902574  0.3522143178  0.4024117441
[101] -0.3247010234 -0.2210729308 -0.1090719397 -0.2233734597 -0.0111731510
[106]  0.1658716399 -0.0208869546 -0.1332975256 -0.1580636466 -0.0008349674
[111] -0.0563221441  0.4664257911  0.1895774776  0.0206439497 -0.0050059809
[116]  0.0393882825 -0.3250386665  0.2407934639 -0.1124221181 -0.1880427595
[121]  0.0849002958  0.3960185389  0.0438134850 -0.3103504353  0.0167701232
[126] -0.2509791852 -0.0982316503 -0.3685385424 -0.0066170611  0.0009577008
[131]  0.0882975793  0.3368747037 -0.1865968474 -0.3139111834  0.0927119270
[136]  0.0950909476 -0.7330134661  0.1721971055  0.0842858233 -0.3272134097
[141]  0.2831340712  0.4335859638  0.2970149048  0.1471047788 -0.0686024758
[146] -0.4678639089  0.0997966121  0.2319932392 -0.3172378763 -0.2482364306
[151] -0.2603495245 -0.0177309580  0.2139355643  0.5639248911  0.2616041551
[156] -0.2103674502  0.0115889485  0.0034722858 -0.3020340996  0.1281990341
[161]  0.0787780856 -0.5808532656 -0.3375642500  0.4325588415  0.9004452242
[166] -0.0777935955  0.2633563581 -0.2577183504  0.0844479358 -0.0869585770
[171] -0.0181678615  0.0050541171 -0.2083727860 -0.2417317316  0.2020798469
[176]  0.1126104527 -0.4356935835 -0.7450979688 -0.2837866102  0.1267364756
[181]  0.0697589659  0.4917918493 -0.5144616288  0.1269156594 -0.3793258838
[186] -0.2612835947 -0.2248386056  0.0007419047 -0.1286493562  0.7264283403
[191] -0.0854685909  0.7326669287  0.2965341524 -0.6471149761 -0.0858096526
[196] -0.2191683440  0.1718090232 -0.4250992095 -0.1649687668 -0.1534432919
[201]  0.2731471084 -0.0332970918 -0.2226159073  0.5037454726  0.2787113832
[206] -0.0296907732  0.0977639353  0.2456510640  0.1958884639 -0.1516526135
[211] -0.4400952443  0.2054188330 -0.0614140650  0.0477291062  0.3262716678
[216]  0.0491995225 -0.0722968960 -0.0760166726 -0.4766967664  0.3159313452
[221]  0.0090657884 -0.2009050604 -0.1903530131  0.2627318377 -0.2469652432
[226]  0.1104243734 -0.2645863122 -0.0431134221  0.6644120694 -0.0271003022
> 
> proc.time()
   user  system elapsed 
   4.50   27.68   49.15 

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: 0x000002a12a4f86b0>
> .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: 0x000002a12a4f86b0>
> .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: 0x000002a12a4f86b0>
> .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: 0x000002a12a4f86b0>
> 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: 0x000002a12a4f8b30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002a12a4f8b30>
> .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: 0x000002a12a4f8b30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002a12a4f8b30>
> .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: 0x000002a12a4f8b30>
> 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: 0x000002a12a4f8710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002a12a4f8710>
> .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: 0x000002a12a4f8710>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002a12a4f8710>
> .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: 0x000002a12a4f8710>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x000002a12a4f8710>
> .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: 0x000002a12a4f8710>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x000002a12a4f8710>
> .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: 0x000002a12a4f8710>
> 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: 0x000002a12a4f8890>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x000002a12a4f8890>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002a12a4f8890>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002a12a4f8890>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4d45a8d2016" "BufferedMatrixFile4d460ea3547"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile4d45a8d2016" "BufferedMatrixFile4d460ea3547"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002a12a4f8350>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002a12a4f8350>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002a12a4f8350>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x000002a12a4f8350>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x000002a12a4f8350>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x000002a12a4f8350>
> .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: 0x000002a12a4f8ad0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x000002a12a4f8ad0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x000002a12a4f8ad0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x000002a12a4f8ad0>
> 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: 0x000002a12a4f8b90>
> .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: 0x000002a12a4f8b90>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.42    0.31    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.26    0.29    0.43 

Example timings