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

This page was generated on 2024-07-24 11:39 -0400 (Wed, 24 Jul 2024).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 22.04.3 LTS)x86_644.4.1 (2024-06-14) -- "Race for Your Life" 4688
palomino8Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4284
lconwaymacOS 12.7.1 Montereyx86_644.4.1 (2024-06-14) -- "Race for Your Life" 4455
kjohnson3macOS 13.6.5 Venturaarm644.4.1 (2024-06-14) -- "Race for Your Life" 4404
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/2248HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-07-23 14:00 -0400 (Tue, 23 Jul 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: d422a05
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
nebbiolo2Linux (Ubuntu 22.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
palomino8Windows Server 2022 Datacenter / x64  OK    OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.6.5 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published


CHECK results for BufferedMatrix on palomino8

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.69.0
Command: F:\biocbuild\bbs-3.20-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.20-bioc\R\library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz
StartedAt: 2024-07-23 22:35:09 -0400 (Tue, 23 Jul 2024)
EndedAt: 2024-07-23 22:37:43 -0400 (Tue, 23 Jul 2024)
EllapsedTime: 154.4 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


* using log directory 'F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck'
* using R version 4.4.1 (2024-06-14 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.69.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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/00check.log'
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'F:/biocbuild/bbs-3.20-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.20-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.20-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.20-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.20-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.20-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.20-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.1 (2024-06-14 ucrt) -- "Race for Your Life"
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.23    0.20    1.00 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life"
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.20-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 468463 25.1    1021760 54.6   633411 33.9
Vcells 853879  6.6    8388608 64.0  2003053 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] "Tue Jul 23 22:35:39 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] "Tue Jul 23 22:35:42 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: 0x000001a7606ff2f0>
> 
> 
> 
> 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] "Tue Jul 23 22:36:07 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] "Tue Jul 23 22:36:16 2024"
> 
> ColMode(tmp2)
<pointer: 0x000001a7606ff2f0>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]         [,2]       [,3]       [,4]
[1,] 99.7136650 -2.459588094 -0.4084730 -1.4316115
[2,] -0.3136963 -0.003272146 -0.1880919  0.0547613
[3,]  0.6232098 -1.049043693  0.4957434 -1.2765429
[4,]  0.9529704 -0.080470828 -0.4125626 -2.7781983
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]        [,2]      [,3]      [,4]
[1,] 99.7136650 2.459588094 0.4084730 1.4316115
[2,]  0.3136963 0.003272146 0.1880919 0.0547613
[3,]  0.6232098 1.049043693 0.4957434 1.2765429
[4,]  0.9529704 0.080470828 0.4125626 2.7781983
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]       [,2]      [,3]      [,4]
[1,] 9.9856730 1.56830740 0.6391189 1.1964997
[2,] 0.5600860 0.05720267 0.4336956 0.2340113
[3,] 0.7894364 1.02422834 0.7040905 1.1298420
[4,] 0.9762020 0.28367380 0.6423104 1.6667928
> 
> 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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.57039 43.14266 31.79966 38.39661
[2,]  30.91456 25.57530 29.52505 27.39487
[3,]  33.51757 36.29133 32.53665 37.57496
[4,]  35.71499 27.91721 31.83567 44.44613
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001a7606ff830>
> exp(tmp5)
<pointer: 0x000001a7606ff830>
> log(tmp5,2)
<pointer: 0x000001a7606ff830>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.4139
> Min(tmp5)
[1] 53.21259
> mean(tmp5)
[1] 72.94877
> Sum(tmp5)
[1] 14589.75
> Var(tmp5)
[1] 871.2038
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.37489 66.88286 70.74339 69.31789 75.05987 71.57389 70.61991 70.76807
 [9] 72.56894 70.57795
> rowSums(tmp5)
 [1] 1827.498 1337.657 1414.868 1386.358 1501.197 1431.478 1412.398 1415.361
 [9] 1451.379 1411.559
> rowVars(tmp5)
 [1] 7959.92026   79.35170   77.97176   68.29678  116.13390   49.82193
 [7]   85.15119   64.22496   76.14358  109.11298
> rowSd(tmp5)
 [1] 89.218385  8.907957  8.830162  8.264187 10.776544  7.058465  9.227740
 [8]  8.014047  8.726029 10.445716
> rowMax(tmp5)
 [1] 467.41385  84.97475  91.50465  92.50879  94.67726  83.27381  85.35461
 [8]  84.08468  87.67488  89.01180
> rowMin(tmp5)
 [1] 56.11684 53.23163 56.73931 58.10601 53.21259 59.14291 57.71813 56.56741
 [9] 54.78142 54.85374
> 
> colMeans(tmp5)
 [1] 110.26011  71.61922  69.92508  74.87689  68.93468  73.57567  67.84347
 [8]  74.09425  72.54283  73.47490  73.76967  67.04530  68.10979  68.96433
[15]  75.70627  75.00139  67.48230  70.67156  67.95095  67.12667
> colSums(tmp5)
 [1] 1102.6011  716.1922  699.2508  748.7689  689.3468  735.7567  678.4347
 [8]  740.9425  725.4283  734.7490  737.6967  670.4530  681.0979  689.6433
[15]  757.0627  750.0139  674.8230  706.7156  679.5095  671.2667
> colVars(tmp5)
 [1] 15791.80962   128.35450    69.51457   101.32563    95.27259   129.60576
 [7]    61.70909    40.19900    63.50716    24.93359   116.20327    66.46043
[13]    84.94710    55.59353   125.50853    70.44164   124.51185    75.84042
[19]    92.95392   131.63139
> colSd(tmp5)
 [1] 125.665467  11.329365   8.337540  10.066063   9.760768  11.384453
 [7]   7.855513   6.340268   7.969138   4.993354  10.779762   8.152327
[13]   9.216675   7.456107  11.203059   8.392952  11.158488   8.708640
[19]   9.641262  11.473072
> colMax(tmp5)
 [1] 467.41385  89.79580  85.29871  92.50879  85.35461  91.50465  78.61689
 [8]  82.76007  82.48044  83.04653  91.09238  78.99579  83.27381  81.64449
[15]  94.18616  89.01180  87.67488  87.33700  84.57421  94.67726
> colMin(tmp5)
 [1] 60.47642 53.23163 60.67143 57.01884 54.78142 59.96096 57.71813 65.72333
 [9] 56.11684 66.41709 60.96445 56.73931 57.33560 59.14291 54.75524 65.64470
[17] 53.21259 58.90668 56.56741 54.85374
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.37489       NA 70.74339 69.31789 75.05987 71.57389 70.61991 70.76807
 [9] 72.56894 70.57795
> rowSums(tmp5)
 [1] 1827.498       NA 1414.868 1386.358 1501.197 1431.478 1412.398 1415.361
 [9] 1451.379 1411.559
> rowVars(tmp5)
 [1] 7959.92026   69.53297   77.97176   68.29678  116.13390   49.82193
 [7]   85.15119   64.22496   76.14358  109.11298
> rowSd(tmp5)
 [1] 89.218385  8.338643  8.830162  8.264187 10.776544  7.058465  9.227740
 [8]  8.014047  8.726029 10.445716
> rowMax(tmp5)
 [1] 467.41385        NA  91.50465  92.50879  94.67726  83.27381  85.35461
 [8]  84.08468  87.67488  89.01180
> rowMin(tmp5)
 [1] 56.11684       NA 56.73931 58.10601 53.21259 59.14291 57.71813 56.56741
 [9] 54.78142 54.85374
> 
> colMeans(tmp5)
 [1] 110.26011  71.61922  69.92508  74.87689  68.93468  73.57567  67.84347
 [8]  74.09425        NA  73.47490  73.76967  67.04530  68.10979  68.96433
[15]  75.70627  75.00139  67.48230  70.67156  67.95095  67.12667
> colSums(tmp5)
 [1] 1102.6011  716.1922  699.2508  748.7689  689.3468  735.7567  678.4347
 [8]  740.9425        NA  734.7490  737.6967  670.4530  681.0979  689.6433
[15]  757.0627  750.0139  674.8230  706.7156  679.5095  671.2667
> colVars(tmp5)
 [1] 15791.80962   128.35450    69.51457   101.32563    95.27259   129.60576
 [7]    61.70909    40.19900          NA    24.93359   116.20327    66.46043
[13]    84.94710    55.59353   125.50853    70.44164   124.51185    75.84042
[19]    92.95392   131.63139
> colSd(tmp5)
 [1] 125.665467  11.329365   8.337540  10.066063   9.760768  11.384453
 [7]   7.855513   6.340268         NA   4.993354  10.779762   8.152327
[13]   9.216675   7.456107  11.203059   8.392952  11.158488   8.708640
[19]   9.641262  11.473072
> colMax(tmp5)
 [1] 467.41385  89.79580  85.29871  92.50879  85.35461  91.50465  78.61689
 [8]  82.76007        NA  83.04653  91.09238  78.99579  83.27381  81.64449
[15]  94.18616  89.01180  87.67488  87.33700  84.57421  94.67726
> colMin(tmp5)
 [1] 60.47642 53.23163 60.67143 57.01884 54.78142 59.96096 57.71813 65.72333
 [9]       NA 66.41709 60.96445 56.73931 57.33560 59.14291 54.75524 65.64470
[17] 53.21259 58.90668 56.56741 54.85374
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.4139
> Min(tmp5,na.rm=TRUE)
[1] 53.21259
> mean(tmp5,na.rm=TRUE)
[1] 72.90087
> Sum(tmp5,na.rm=TRUE)
[1] 14507.27
> Var(tmp5,na.rm=TRUE)
[1] 875.1427
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.37489 66.06194 70.74339 69.31789 75.05987 71.57389 70.61991 70.76807
 [9] 72.56894 70.57795
> rowSums(tmp5,na.rm=TRUE)
 [1] 1827.498 1255.177 1414.868 1386.358 1501.197 1431.478 1412.398 1415.361
 [9] 1451.379 1411.559
> rowVars(tmp5,na.rm=TRUE)
 [1] 7959.92026   69.53297   77.97176   68.29678  116.13390   49.82193
 [7]   85.15119   64.22496   76.14358  109.11298
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.218385  8.338643  8.830162  8.264187 10.776544  7.058465  9.227740
 [8]  8.014047  8.726029 10.445716
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.41385  84.97475  91.50465  92.50879  94.67726  83.27381  85.35461
 [8]  84.08468  87.67488  89.01180
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.11684 53.23163 56.73931 58.10601 53.21259 59.14291 57.71813 56.56741
 [9] 54.78142 54.85374
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.26011  71.61922  69.92508  74.87689  68.93468  73.57567  67.84347
 [8]  74.09425  71.43866  73.47490  73.76967  67.04530  68.10979  68.96433
[15]  75.70627  75.00139  67.48230  70.67156  67.95095  67.12667
> colSums(tmp5,na.rm=TRUE)
 [1] 1102.6011  716.1922  699.2508  748.7689  689.3468  735.7567  678.4347
 [8]  740.9425  642.9479  734.7490  737.6967  670.4530  681.0979  689.6433
[15]  757.0627  750.0139  674.8230  706.7156  679.5095  671.2667
> colVars(tmp5,na.rm=TRUE)
 [1] 15791.80962   128.35450    69.51457   101.32563    95.27259   129.60576
 [7]    61.70909    40.19900    57.72944    24.93359   116.20327    66.46043
[13]    84.94710    55.59353   125.50853    70.44164   124.51185    75.84042
[19]    92.95392   131.63139
> colSd(tmp5,na.rm=TRUE)
 [1] 125.665467  11.329365   8.337540  10.066063   9.760768  11.384453
 [7]   7.855513   6.340268   7.597989   4.993354  10.779762   8.152327
[13]   9.216675   7.456107  11.203059   8.392952  11.158488   8.708640
[19]   9.641262  11.473072
> colMax(tmp5,na.rm=TRUE)
 [1] 467.41385  89.79580  85.29871  92.50879  85.35461  91.50465  78.61689
 [8]  82.76007  81.73165  83.04653  91.09238  78.99579  83.27381  81.64449
[15]  94.18616  89.01180  87.67488  87.33700  84.57421  94.67726
> colMin(tmp5,na.rm=TRUE)
 [1] 60.47642 53.23163 60.67143 57.01884 54.78142 59.96096 57.71813 65.72333
 [9] 56.11684 66.41709 60.96445 56.73931 57.33560 59.14291 54.75524 65.64470
[17] 53.21259 58.90668 56.56741 54.85374
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.37489      NaN 70.74339 69.31789 75.05987 71.57389 70.61991 70.76807
 [9] 72.56894 70.57795
> rowSums(tmp5,na.rm=TRUE)
 [1] 1827.498    0.000 1414.868 1386.358 1501.197 1431.478 1412.398 1415.361
 [9] 1451.379 1411.559
> rowVars(tmp5,na.rm=TRUE)
 [1] 7959.92026         NA   77.97176   68.29678  116.13390   49.82193
 [7]   85.15119   64.22496   76.14358  109.11298
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.218385        NA  8.830162  8.264187 10.776544  7.058465  9.227740
 [8]  8.014047  8.726029 10.445716
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.41385        NA  91.50465  92.50879  94.67726  83.27381  85.35461
 [8]  84.08468  87.67488  89.01180
> rowMin(tmp5,na.rm=TRUE)
 [1] 56.11684       NA 56.73931 58.10601 53.21259 59.14291 57.71813 56.56741
 [9] 54.78142 54.85374
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.36183  73.66228  70.86647  76.86112  68.51038  72.30911  67.44242
 [8]  75.02436       NaN  73.65539  73.17029  67.94990  68.68314  69.86679
[15]  78.03416  75.52797  68.04676  70.54260  67.58276  67.91872
> colSums(tmp5,na.rm=TRUE)
 [1] 1038.2565  662.9605  637.7982  691.7501  616.5934  650.7820  606.9818
 [8]  675.2192    0.0000  662.8985  658.5326  611.5491  618.1483  628.8011
[15]  702.3074  679.7517  612.4208  634.8834  608.2448  611.2685
> colVars(tmp5,na.rm=TRUE)
 [1] 17472.97551    97.44003    68.23386    69.69828   105.15632   127.75940
 [7]    67.61323    35.49160          NA    27.68383   126.68712    65.56192
[13]    91.86721    53.38031    80.23242    76.12746   136.49144    85.13340
[19]   103.04805   141.02757
> colSd(tmp5,na.rm=TRUE)
 [1] 132.185383   9.871172   8.260379   8.348549  10.254575  11.303070
 [7]   8.222726   5.957483         NA   5.261542  11.255537   8.097032
[13]   9.584738   7.306183   8.957255   8.725105  11.682955   9.226776
[19]  10.151259  11.875503
> colMax(tmp5,na.rm=TRUE)
 [1] 467.41385  89.79580  85.29871  92.50879  85.35461  91.50465  78.61689
 [8]  82.76007      -Inf  83.04653  91.09238  78.99579  83.27381  81.64449
[15]  94.18616  89.01180  87.67488  87.33700  84.57421  94.67726
> colMin(tmp5,na.rm=TRUE)
 [1] 60.47642 58.10601 60.67143 65.15171 54.78142 59.96096 57.71813 66.26472
 [9]      Inf 66.41709 60.96445 56.73931 57.33560 59.14291 67.46482 65.64470
[17] 53.21259 58.90668 56.56741 54.85374
> 
> 
> 
> 
> 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] 172.2487 218.0550 273.3735 249.3815 244.3478 279.0826 279.6787 281.3080
 [9] 175.6708 101.8249
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 172.2487 218.0550 273.3735 249.3815 244.3478 279.0826 279.6787 281.3080
 [9] 175.6708 101.8249
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1]  2.273737e-13  5.684342e-14  1.421085e-14  2.273737e-13  2.842171e-14
 [6] -1.421085e-13  0.000000e+00  1.136868e-13 -8.526513e-14  8.526513e-14
[11] -1.136868e-13  2.842171e-14  2.842171e-14  1.136868e-13  2.842171e-14
[16] -1.136868e-13  2.842171e-14  8.526513e-14 -3.410605e-13 -2.842171e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
8   14 
5   2 
5   14 
5   16 
1   18 
3   13 
3   7 
2   18 
7   8 
10   2 
7   6 
7   1 
3   5 
4   12 
1   9 
2   16 
10   15 
3   14 
2   11 
10   11 
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.699508
> Min(tmp)
[1] -1.902487
> mean(tmp)
[1] 0.02048503
> Sum(tmp)
[1] 2.048503
> Var(tmp)
[1] 0.9037545
> 
> rowMeans(tmp)
[1] 0.02048503
> rowSums(tmp)
[1] 2.048503
> rowVars(tmp)
[1] 0.9037545
> rowSd(tmp)
[1] 0.95066
> rowMax(tmp)
[1] 2.699508
> rowMin(tmp)
[1] -1.902487
> 
> colMeans(tmp)
  [1] -0.237316516  0.756487152 -0.578853895  0.390036579  0.133304421
  [6]  1.340552127  0.591475082  0.269922869 -1.175516819  0.943941458
 [11]  1.048194286  1.713299892  0.443499224 -0.458454816  1.123569952
 [16]  2.028443096 -1.162289910  0.932820772 -0.005761627  1.015560477
 [21] -0.711401098  2.699507651 -0.608660729  0.108959992  1.161527045
 [26] -0.639637387  0.257909796  0.747557766  1.331720274  0.583540711
 [31]  0.450997373  1.552104153 -1.202801107  0.518985355 -1.301334868
 [36]  0.104001811 -1.187320034  0.177820079 -1.669612146  0.547593846
 [41]  0.187188739 -0.739616419 -0.435105580 -0.844819548  0.745564244
 [46]  1.542482970 -0.009204073 -0.335161250 -1.101481985 -0.554198623
 [51]  0.501400298 -0.907442990 -1.090340304 -1.104136453 -1.902486528
 [56] -0.363007536  2.182495105  0.142110705 -0.336638187  0.191128874
 [61] -0.320655225  1.431061371 -1.114772539 -1.081180008 -0.727087220
 [66]  0.661752193 -0.468667834 -1.010102664  1.257335140  1.102219490
 [71]  0.850505028 -0.598815636 -0.284376296 -0.247575385 -0.927186286
 [76] -0.277511966  0.111232601 -0.041212616  0.527401887  0.953535816
 [81]  0.110388273 -1.418982959  0.196826992 -0.010964375 -0.986798017
 [86] -1.789934109  0.173344027  0.347497821 -0.385668609  0.222928012
 [91] -1.011807674 -1.782928588  0.279679826  0.069695966  0.411384203
 [96] -0.393380356 -0.982200196 -1.012993707  1.613122126  0.800291192
> colSums(tmp)
  [1] -0.237316516  0.756487152 -0.578853895  0.390036579  0.133304421
  [6]  1.340552127  0.591475082  0.269922869 -1.175516819  0.943941458
 [11]  1.048194286  1.713299892  0.443499224 -0.458454816  1.123569952
 [16]  2.028443096 -1.162289910  0.932820772 -0.005761627  1.015560477
 [21] -0.711401098  2.699507651 -0.608660729  0.108959992  1.161527045
 [26] -0.639637387  0.257909796  0.747557766  1.331720274  0.583540711
 [31]  0.450997373  1.552104153 -1.202801107  0.518985355 -1.301334868
 [36]  0.104001811 -1.187320034  0.177820079 -1.669612146  0.547593846
 [41]  0.187188739 -0.739616419 -0.435105580 -0.844819548  0.745564244
 [46]  1.542482970 -0.009204073 -0.335161250 -1.101481985 -0.554198623
 [51]  0.501400298 -0.907442990 -1.090340304 -1.104136453 -1.902486528
 [56] -0.363007536  2.182495105  0.142110705 -0.336638187  0.191128874
 [61] -0.320655225  1.431061371 -1.114772539 -1.081180008 -0.727087220
 [66]  0.661752193 -0.468667834 -1.010102664  1.257335140  1.102219490
 [71]  0.850505028 -0.598815636 -0.284376296 -0.247575385 -0.927186286
 [76] -0.277511966  0.111232601 -0.041212616  0.527401887  0.953535816
 [81]  0.110388273 -1.418982959  0.196826992 -0.010964375 -0.986798017
 [86] -1.789934109  0.173344027  0.347497821 -0.385668609  0.222928012
 [91] -1.011807674 -1.782928588  0.279679826  0.069695966  0.411384203
 [96] -0.393380356 -0.982200196 -1.012993707  1.613122126  0.800291192
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -0.237316516  0.756487152 -0.578853895  0.390036579  0.133304421
  [6]  1.340552127  0.591475082  0.269922869 -1.175516819  0.943941458
 [11]  1.048194286  1.713299892  0.443499224 -0.458454816  1.123569952
 [16]  2.028443096 -1.162289910  0.932820772 -0.005761627  1.015560477
 [21] -0.711401098  2.699507651 -0.608660729  0.108959992  1.161527045
 [26] -0.639637387  0.257909796  0.747557766  1.331720274  0.583540711
 [31]  0.450997373  1.552104153 -1.202801107  0.518985355 -1.301334868
 [36]  0.104001811 -1.187320034  0.177820079 -1.669612146  0.547593846
 [41]  0.187188739 -0.739616419 -0.435105580 -0.844819548  0.745564244
 [46]  1.542482970 -0.009204073 -0.335161250 -1.101481985 -0.554198623
 [51]  0.501400298 -0.907442990 -1.090340304 -1.104136453 -1.902486528
 [56] -0.363007536  2.182495105  0.142110705 -0.336638187  0.191128874
 [61] -0.320655225  1.431061371 -1.114772539 -1.081180008 -0.727087220
 [66]  0.661752193 -0.468667834 -1.010102664  1.257335140  1.102219490
 [71]  0.850505028 -0.598815636 -0.284376296 -0.247575385 -0.927186286
 [76] -0.277511966  0.111232601 -0.041212616  0.527401887  0.953535816
 [81]  0.110388273 -1.418982959  0.196826992 -0.010964375 -0.986798017
 [86] -1.789934109  0.173344027  0.347497821 -0.385668609  0.222928012
 [91] -1.011807674 -1.782928588  0.279679826  0.069695966  0.411384203
 [96] -0.393380356 -0.982200196 -1.012993707  1.613122126  0.800291192
> colMin(tmp)
  [1] -0.237316516  0.756487152 -0.578853895  0.390036579  0.133304421
  [6]  1.340552127  0.591475082  0.269922869 -1.175516819  0.943941458
 [11]  1.048194286  1.713299892  0.443499224 -0.458454816  1.123569952
 [16]  2.028443096 -1.162289910  0.932820772 -0.005761627  1.015560477
 [21] -0.711401098  2.699507651 -0.608660729  0.108959992  1.161527045
 [26] -0.639637387  0.257909796  0.747557766  1.331720274  0.583540711
 [31]  0.450997373  1.552104153 -1.202801107  0.518985355 -1.301334868
 [36]  0.104001811 -1.187320034  0.177820079 -1.669612146  0.547593846
 [41]  0.187188739 -0.739616419 -0.435105580 -0.844819548  0.745564244
 [46]  1.542482970 -0.009204073 -0.335161250 -1.101481985 -0.554198623
 [51]  0.501400298 -0.907442990 -1.090340304 -1.104136453 -1.902486528
 [56] -0.363007536  2.182495105  0.142110705 -0.336638187  0.191128874
 [61] -0.320655225  1.431061371 -1.114772539 -1.081180008 -0.727087220
 [66]  0.661752193 -0.468667834 -1.010102664  1.257335140  1.102219490
 [71]  0.850505028 -0.598815636 -0.284376296 -0.247575385 -0.927186286
 [76] -0.277511966  0.111232601 -0.041212616  0.527401887  0.953535816
 [81]  0.110388273 -1.418982959  0.196826992 -0.010964375 -0.986798017
 [86] -1.789934109  0.173344027  0.347497821 -0.385668609  0.222928012
 [91] -1.011807674 -1.782928588  0.279679826  0.069695966  0.411384203
 [96] -0.393380356 -0.982200196 -1.012993707  1.613122126  0.800291192
> colMedians(tmp)
  [1] -0.237316516  0.756487152 -0.578853895  0.390036579  0.133304421
  [6]  1.340552127  0.591475082  0.269922869 -1.175516819  0.943941458
 [11]  1.048194286  1.713299892  0.443499224 -0.458454816  1.123569952
 [16]  2.028443096 -1.162289910  0.932820772 -0.005761627  1.015560477
 [21] -0.711401098  2.699507651 -0.608660729  0.108959992  1.161527045
 [26] -0.639637387  0.257909796  0.747557766  1.331720274  0.583540711
 [31]  0.450997373  1.552104153 -1.202801107  0.518985355 -1.301334868
 [36]  0.104001811 -1.187320034  0.177820079 -1.669612146  0.547593846
 [41]  0.187188739 -0.739616419 -0.435105580 -0.844819548  0.745564244
 [46]  1.542482970 -0.009204073 -0.335161250 -1.101481985 -0.554198623
 [51]  0.501400298 -0.907442990 -1.090340304 -1.104136453 -1.902486528
 [56] -0.363007536  2.182495105  0.142110705 -0.336638187  0.191128874
 [61] -0.320655225  1.431061371 -1.114772539 -1.081180008 -0.727087220
 [66]  0.661752193 -0.468667834 -1.010102664  1.257335140  1.102219490
 [71]  0.850505028 -0.598815636 -0.284376296 -0.247575385 -0.927186286
 [76] -0.277511966  0.111232601 -0.041212616  0.527401887  0.953535816
 [81]  0.110388273 -1.418982959  0.196826992 -0.010964375 -0.986798017
 [86] -1.789934109  0.173344027  0.347497821 -0.385668609  0.222928012
 [91] -1.011807674 -1.782928588  0.279679826  0.069695966  0.411384203
 [96] -0.393380356 -0.982200196 -1.012993707  1.613122126  0.800291192
> colRanges(tmp)
           [,1]      [,2]       [,3]      [,4]      [,5]     [,6]      [,7]
[1,] -0.2373165 0.7564872 -0.5788539 0.3900366 0.1333044 1.340552 0.5914751
[2,] -0.2373165 0.7564872 -0.5788539 0.3900366 0.1333044 1.340552 0.5914751
          [,8]      [,9]     [,10]    [,11]  [,12]     [,13]      [,14]   [,15]
[1,] 0.2699229 -1.175517 0.9439415 1.048194 1.7133 0.4434992 -0.4584548 1.12357
[2,] 0.2699229 -1.175517 0.9439415 1.048194 1.7133 0.4434992 -0.4584548 1.12357
        [,16]    [,17]     [,18]        [,19]   [,20]      [,21]    [,22]
[1,] 2.028443 -1.16229 0.9328208 -0.005761627 1.01556 -0.7114011 2.699508
[2,] 2.028443 -1.16229 0.9328208 -0.005761627 1.01556 -0.7114011 2.699508
          [,23]   [,24]    [,25]      [,26]     [,27]     [,28]   [,29]
[1,] -0.6086607 0.10896 1.161527 -0.6396374 0.2579098 0.7475578 1.33172
[2,] -0.6086607 0.10896 1.161527 -0.6396374 0.2579098 0.7475578 1.33172
         [,30]     [,31]    [,32]     [,33]     [,34]     [,35]     [,36]
[1,] 0.5835407 0.4509974 1.552104 -1.202801 0.5189854 -1.301335 0.1040018
[2,] 0.5835407 0.4509974 1.552104 -1.202801 0.5189854 -1.301335 0.1040018
        [,37]     [,38]     [,39]     [,40]     [,41]      [,42]      [,43]
[1,] -1.18732 0.1778201 -1.669612 0.5475938 0.1871887 -0.7396164 -0.4351056
[2,] -1.18732 0.1778201 -1.669612 0.5475938 0.1871887 -0.7396164 -0.4351056
          [,44]     [,45]    [,46]        [,47]      [,48]     [,49]      [,50]
[1,] -0.8448195 0.7455642 1.542483 -0.009204073 -0.3351612 -1.101482 -0.5541986
[2,] -0.8448195 0.7455642 1.542483 -0.009204073 -0.3351612 -1.101482 -0.5541986
         [,51]     [,52]    [,53]     [,54]     [,55]      [,56]    [,57]
[1,] 0.5014003 -0.907443 -1.09034 -1.104136 -1.902487 -0.3630075 2.182495
[2,] 0.5014003 -0.907443 -1.09034 -1.104136 -1.902487 -0.3630075 2.182495
         [,58]      [,59]     [,60]      [,61]    [,62]     [,63]    [,64]
[1,] 0.1421107 -0.3366382 0.1911289 -0.3206552 1.431061 -1.114773 -1.08118
[2,] 0.1421107 -0.3366382 0.1911289 -0.3206552 1.431061 -1.114773 -1.08118
          [,65]     [,66]      [,67]     [,68]    [,69]    [,70]    [,71]
[1,] -0.7270872 0.6617522 -0.4686678 -1.010103 1.257335 1.102219 0.850505
[2,] -0.7270872 0.6617522 -0.4686678 -1.010103 1.257335 1.102219 0.850505
          [,72]      [,73]      [,74]      [,75]     [,76]     [,77]
[1,] -0.5988156 -0.2843763 -0.2475754 -0.9271863 -0.277512 0.1112326
[2,] -0.5988156 -0.2843763 -0.2475754 -0.9271863 -0.277512 0.1112326
           [,78]     [,79]     [,80]     [,81]     [,82]    [,83]       [,84]
[1,] -0.04121262 0.5274019 0.9535358 0.1103883 -1.418983 0.196827 -0.01096438
[2,] -0.04121262 0.5274019 0.9535358 0.1103883 -1.418983 0.196827 -0.01096438
         [,85]     [,86]    [,87]     [,88]      [,89]    [,90]     [,91]
[1,] -0.986798 -1.789934 0.173344 0.3474978 -0.3856686 0.222928 -1.011808
[2,] -0.986798 -1.789934 0.173344 0.3474978 -0.3856686 0.222928 -1.011808
         [,92]     [,93]      [,94]     [,95]      [,96]      [,97]     [,98]
[1,] -1.782929 0.2796798 0.06969597 0.4113842 -0.3933804 -0.9822002 -1.012994
[2,] -1.782929 0.2796798 0.06969597 0.4113842 -0.3933804 -0.9822002 -1.012994
        [,99]    [,100]
[1,] 1.613122 0.8002912
[2,] 1.613122 0.8002912
> 
> 
> Max(tmp2)
[1] 2.276056
> Min(tmp2)
[1] -3.612607
> mean(tmp2)
[1] -0.1429673
> Sum(tmp2)
[1] -14.29673
> Var(tmp2)
[1] 1.248658
> 
> rowMeans(tmp2)
  [1] -0.15649640 -1.19076517  2.17392520 -1.01958142  0.57118454 -0.12336702
  [7]  0.74437363 -0.23810371 -0.35249386 -0.28250934  1.26303220 -0.18697037
 [13] -1.05317354  0.98962913 -1.92018227 -2.63408670  0.30253757  1.03469626
 [19] -1.79189548 -1.59408498  0.50048853  2.19452909  0.31454015  0.12538015
 [25]  1.20375627 -0.80255784 -0.91210302  0.05935709 -2.30387763 -0.05824447
 [31] -0.55081057 -0.18210292  1.71598698 -1.64390346 -1.54544570  0.10050673
 [37] -0.92983942 -0.77147560 -0.52780909 -2.35155527  1.86598371  0.41833003
 [43]  0.01315788  2.27605615  0.84383366  0.14482328 -1.17935531  0.31077585
 [49]  0.75367246 -1.93592651 -0.57541450  0.12051856  0.51745263 -0.32622346
 [55]  1.52031094 -0.99365061 -0.74427134  1.08347323 -1.06395722 -0.77804397
 [61] -1.63644957  0.82843760 -0.47211063 -0.49345912 -0.90159602  1.35900283
 [67] -0.86361546 -0.55622885  2.19302517  1.01725768  0.12619349 -0.64773598
 [73] -0.67506254 -0.36570240 -0.49389416 -0.13118133  0.83080802 -0.99087826
 [79] -0.78542909 -0.99759682 -0.19358225  0.17917680 -0.23351231  0.18968751
 [85]  0.59283355 -0.44105679  2.20364680  0.10401851  1.01875054 -0.11184593
 [91]  1.11371409 -3.61260657 -0.87349222 -0.11117134 -0.08084815  0.66171286
 [97] -0.62306145  0.61243651  0.30074770 -1.77809326
> rowSums(tmp2)
  [1] -0.15649640 -1.19076517  2.17392520 -1.01958142  0.57118454 -0.12336702
  [7]  0.74437363 -0.23810371 -0.35249386 -0.28250934  1.26303220 -0.18697037
 [13] -1.05317354  0.98962913 -1.92018227 -2.63408670  0.30253757  1.03469626
 [19] -1.79189548 -1.59408498  0.50048853  2.19452909  0.31454015  0.12538015
 [25]  1.20375627 -0.80255784 -0.91210302  0.05935709 -2.30387763 -0.05824447
 [31] -0.55081057 -0.18210292  1.71598698 -1.64390346 -1.54544570  0.10050673
 [37] -0.92983942 -0.77147560 -0.52780909 -2.35155527  1.86598371  0.41833003
 [43]  0.01315788  2.27605615  0.84383366  0.14482328 -1.17935531  0.31077585
 [49]  0.75367246 -1.93592651 -0.57541450  0.12051856  0.51745263 -0.32622346
 [55]  1.52031094 -0.99365061 -0.74427134  1.08347323 -1.06395722 -0.77804397
 [61] -1.63644957  0.82843760 -0.47211063 -0.49345912 -0.90159602  1.35900283
 [67] -0.86361546 -0.55622885  2.19302517  1.01725768  0.12619349 -0.64773598
 [73] -0.67506254 -0.36570240 -0.49389416 -0.13118133  0.83080802 -0.99087826
 [79] -0.78542909 -0.99759682 -0.19358225  0.17917680 -0.23351231  0.18968751
 [85]  0.59283355 -0.44105679  2.20364680  0.10401851  1.01875054 -0.11184593
 [91]  1.11371409 -3.61260657 -0.87349222 -0.11117134 -0.08084815  0.66171286
 [97] -0.62306145  0.61243651  0.30074770 -1.77809326
> 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.15649640 -1.19076517  2.17392520 -1.01958142  0.57118454 -0.12336702
  [7]  0.74437363 -0.23810371 -0.35249386 -0.28250934  1.26303220 -0.18697037
 [13] -1.05317354  0.98962913 -1.92018227 -2.63408670  0.30253757  1.03469626
 [19] -1.79189548 -1.59408498  0.50048853  2.19452909  0.31454015  0.12538015
 [25]  1.20375627 -0.80255784 -0.91210302  0.05935709 -2.30387763 -0.05824447
 [31] -0.55081057 -0.18210292  1.71598698 -1.64390346 -1.54544570  0.10050673
 [37] -0.92983942 -0.77147560 -0.52780909 -2.35155527  1.86598371  0.41833003
 [43]  0.01315788  2.27605615  0.84383366  0.14482328 -1.17935531  0.31077585
 [49]  0.75367246 -1.93592651 -0.57541450  0.12051856  0.51745263 -0.32622346
 [55]  1.52031094 -0.99365061 -0.74427134  1.08347323 -1.06395722 -0.77804397
 [61] -1.63644957  0.82843760 -0.47211063 -0.49345912 -0.90159602  1.35900283
 [67] -0.86361546 -0.55622885  2.19302517  1.01725768  0.12619349 -0.64773598
 [73] -0.67506254 -0.36570240 -0.49389416 -0.13118133  0.83080802 -0.99087826
 [79] -0.78542909 -0.99759682 -0.19358225  0.17917680 -0.23351231  0.18968751
 [85]  0.59283355 -0.44105679  2.20364680  0.10401851  1.01875054 -0.11184593
 [91]  1.11371409 -3.61260657 -0.87349222 -0.11117134 -0.08084815  0.66171286
 [97] -0.62306145  0.61243651  0.30074770 -1.77809326
> rowMin(tmp2)
  [1] -0.15649640 -1.19076517  2.17392520 -1.01958142  0.57118454 -0.12336702
  [7]  0.74437363 -0.23810371 -0.35249386 -0.28250934  1.26303220 -0.18697037
 [13] -1.05317354  0.98962913 -1.92018227 -2.63408670  0.30253757  1.03469626
 [19] -1.79189548 -1.59408498  0.50048853  2.19452909  0.31454015  0.12538015
 [25]  1.20375627 -0.80255784 -0.91210302  0.05935709 -2.30387763 -0.05824447
 [31] -0.55081057 -0.18210292  1.71598698 -1.64390346 -1.54544570  0.10050673
 [37] -0.92983942 -0.77147560 -0.52780909 -2.35155527  1.86598371  0.41833003
 [43]  0.01315788  2.27605615  0.84383366  0.14482328 -1.17935531  0.31077585
 [49]  0.75367246 -1.93592651 -0.57541450  0.12051856  0.51745263 -0.32622346
 [55]  1.52031094 -0.99365061 -0.74427134  1.08347323 -1.06395722 -0.77804397
 [61] -1.63644957  0.82843760 -0.47211063 -0.49345912 -0.90159602  1.35900283
 [67] -0.86361546 -0.55622885  2.19302517  1.01725768  0.12619349 -0.64773598
 [73] -0.67506254 -0.36570240 -0.49389416 -0.13118133  0.83080802 -0.99087826
 [79] -0.78542909 -0.99759682 -0.19358225  0.17917680 -0.23351231  0.18968751
 [85]  0.59283355 -0.44105679  2.20364680  0.10401851  1.01875054 -0.11184593
 [91]  1.11371409 -3.61260657 -0.87349222 -0.11117134 -0.08084815  0.66171286
 [97] -0.62306145  0.61243651  0.30074770 -1.77809326
> 
> colMeans(tmp2)
[1] -0.1429673
> colSums(tmp2)
[1] -14.29673
> colVars(tmp2)
[1] 1.248658
> colSd(tmp2)
[1] 1.117434
> colMax(tmp2)
[1] 2.276056
> colMin(tmp2)
[1] -3.612607
> colMedians(tmp2)
[1] -0.1692997
> colRanges(tmp2)
          [,1]
[1,] -3.612607
[2,]  2.276056
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.8552854  0.2324811 -1.0976222 -1.0921930  0.1069016  3.4303478
 [7]  2.3245960  2.9160768  6.8206568  0.6652462
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -1.10955620
[2,] -0.02116798
[3,]  0.31707686
[4,]  0.48562763
[5,]  0.97712233
> 
> rowApply(tmp,sum)
 [1]  3.6943655 -0.4910858  2.1167447  2.7563274  4.5329809  1.0835855
 [7] -0.7658835  1.7052609  1.7708779 -0.2413971
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    7    7    2    3    6    9    6    8    5     4
 [2,]    3    2    3    5    8    8    4    9    1     9
 [3,]   10    6    4    1    5    5    2    6   10     1
 [4,]    2    4    7    7    4    1    1    4    3     6
 [5,]    1   10    8   10    1    7    3    3    2     2
 [6,]    8    8    6    8    2   10    7    1    4     8
 [7,]    5    1    9    6    3    3    5    7    6    10
 [8,]    4    5    5    2   10    2    9   10    8     7
 [9,]    9    9   10    4    9    4    8    2    9     5
[10,]    6    3    1    9    7    6   10    5    7     3
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  1.60794674 -0.55404787 -2.75945052 -2.75823058  0.03925612 -1.20375399
 [7] -1.76308047 -1.34308928  2.97282290  0.43169740 -2.79918811  0.51168853
[13] -0.10242410 -0.12672667  0.49543479  0.54466680 -0.48831176  0.23392504
[19]  0.58126515 -1.22913225
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.71740745
[2,]  0.04851476
[3,]  0.36600433
[4,]  0.64925876
[5,]  1.26157634
> 
> rowApply(tmp,sum)
[1] -4.5850891  8.8441517 -9.1718147 -0.6518019 -2.1441782
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    8   17   17   10   13
[2,]   10   13    3   19    6
[3,]    9    1    1   14   19
[4,]    1   12   15    6    3
[5,]    4   20   11    9    5
> 
> 
> as.matrix(tmp)
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.71740745 -0.3470173 -0.5527498 -1.9414674 -1.0470910  0.7142023
[2,]  1.26157634  0.7585896 -1.2441639  0.6503488  2.6092526  1.2884631
[3,]  0.64925876 -1.4595830 -2.5467833  0.4313625 -0.5382360 -0.8031151
[4,]  0.04851476  1.1722705  0.5489018 -0.7350623 -0.1423530 -1.5152595
[5,]  0.36600433 -0.6783078  1.0353447 -1.1634122 -0.8423164 -0.8880448
            [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.03865109 -1.7059695  2.0115037 -1.0442342 -0.1656698  0.6476455
[2,] -1.04661820  0.2947683  0.4619631  0.7924858 -0.6448782  0.5665662
[3,] -1.36137914 -1.2063600  0.5306603  0.3681416 -2.1942252 -0.5543630
[4,]  0.65920349  0.8668206 -0.6513368  0.8214941 -0.9240284  0.1264441
[5,] -0.05293771  0.4076513  0.6200327 -0.5061899  1.1296134 -0.2746043
           [,13]       [,14]       [,15]       [,16]        [,17]      [,18]
[1,] -0.02997449  0.03193654  0.04596638 -1.06453188 -1.013231780  1.5391713
[2,] -0.69157200  0.83006497 -0.03199515 -0.05119974  0.005947193  1.7301013
[3,]  1.53821950  1.34485447 -1.23587287  0.75104612 -1.222083027 -0.2868247
[4,] -0.65640043 -1.08616621  2.07751777  0.15096505  1.010912959 -1.0700339
[5,] -0.26269669 -1.24741643 -0.36018134  0.75838725  0.730142898 -1.6784889
            [,19]      [,20]
[1,] -0.721655937  0.7368346
[2,]  0.782487741  0.5219639
[3,] -0.004018672 -1.3725139
[4,]  0.522880126 -1.8770865
[5,]  0.001571893  0.7616697
> 
> 
> 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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  631  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  543  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.20-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 1.335633 0.283695 1.025389 0.4627117 0.8155893 -1.262374 0.6588332
         col8      col9      col10     col11      col12     col13      col14
row1 1.394031 -3.038603 -0.4964582 -1.882741 -0.8581568 0.5608016 -0.3389617
         col15      col16     col17    col18     col19    col20
row1 0.8771792 -0.8427552 0.2443815 1.485544 0.4818963 -0.60207
> tmp[,"col10"]
          col10
row1 -0.4964582
row2 -1.4605421
row3  0.1850158
row4  0.9718559
row5 -1.0920336
> tmp[c("row1","row5"),]
           col1       col2      col3      col4      col5       col6       col7
row1  1.3356326  0.2836950 1.0253886 0.4627117 0.8155893 -1.2623736  0.6588332
row5 -0.3467699 -0.8267825 0.2721228 0.5220366 0.5233992  0.2266246 -1.1852765
          col8      col9      col10     col11      col12      col13      col14
row1 1.3940311 -3.038603 -0.4964582 -1.882741 -0.8581568  0.5608016 -0.3389617
row5 0.6056213 -1.214606 -1.0920336  1.549636 -0.6431711 -1.2337191  1.2600049
         col15      col16     col17    col18     col19     col20
row1 0.8771792 -0.8427552 0.2443815 1.485544 0.4818963 -0.602070
row5 0.7967598 -0.8975552 1.1681380 1.697015 1.3693694 -2.158605
> tmp[,c("col6","col20")]
           col6      col20
row1 -1.2623736 -0.6020700
row2  0.5634085  1.0776832
row3 -0.4745183 -0.1257047
row4 -0.8469694  0.4774756
row5  0.2266246 -2.1586055
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -1.2623736 -0.602070
row5  0.2266246 -2.158605
> 
> 
> 
> 
> 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 52.07871 50.2422 49.92772 49.35689 51.1301 105.5945 49.86616 50.99773
        col9   col10    col11    col12    col13    col14   col15    col16
row1 48.0198 50.5845 50.82146 50.53653 50.06404 51.12146 51.1198 48.59282
        col17    col18    col19    col20
row1 50.19995 50.21292 50.83061 102.8604
> tmp[,"col10"]
        col10
row1 50.58450
row2 30.11520
row3 30.33980
row4 27.21958
row5 49.97528
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 52.07871 50.24220 49.92772 49.35689 51.13010 105.5945 49.86616 50.99773
row5 50.59841 51.25451 51.44063 49.00823 50.17702 104.9897 50.27749 48.61102
         col9    col10    col11    col12    col13    col14    col15    col16
row1 48.01980 50.58450 50.82146 50.53653 50.06404 51.12146 51.11980 48.59282
row5 50.84853 49.97528 51.37990 51.22229 50.75663 51.22587 50.13072 49.98986
        col17    col18    col19    col20
row1 50.19995 50.21292 50.83061 102.8604
row5 48.77629 50.41379 49.57923 104.8029
> tmp[,c("col6","col20")]
          col6     col20
row1 105.59446 102.86039
row2  75.92651  74.93285
row3  74.16575  75.12283
row4  74.93828  74.52246
row5 104.98969 104.80291
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.5945 102.8604
row5 104.9897 104.8029
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.5945 102.8604
row5 104.9897 104.8029
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  0.24371177
[2,] -0.79327940
[3,] -1.31179300
[4,] -1.53856187
[5,] -0.01259777
> tmp[,c("col17","col7")]
           col17        col7
[1,]  1.14518328 -2.53964476
[2,] -0.93041032  0.33415800
[3,]  0.99987802 -1.32591131
[4,]  1.22129792  0.11165806
[5,] -0.06300081 -0.04995291
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6      col20
[1,] -0.04663984 -0.7195815
[2,] -0.58432565  0.4154939
[3,]  0.01924370 -0.6583731
[4,] -1.00691817 -1.1892459
[5,] -1.02113104  0.3324005
> subBufferedMatrix(tmp,1,c("col6"))[,1]
            col1
[1,] -0.04663984
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
            col6
[1,] -0.04663984
[2,] -0.58432565
> 
> 
> 
> 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  1.4520914 -2.2948860 -0.01092824 0.09836194  0.6365028 -0.7390750
row1 -0.9082684  0.6091533  1.03419654 0.50673461 -0.2823089 -0.4189507
          [,7]        [,8]       [,9]      [,10]     [,11]      [,12]
row3  1.163326 -0.29253241 -0.7719049  0.4432124 1.2815023 -0.1312828
row1 -1.302848  0.02537992 -0.1155067 -2.4677074 0.6135201 -0.2798424
          [,13]      [,14]      [,15]      [,16]      [,17]        [,18]
row3 -0.8959776  0.5405798  0.6397908 -0.4680180  0.5718591 -0.639111049
row1 -1.0616927 -0.5589013 -0.7034370  0.8589092 -0.9533357  0.008986276
          [,19]      [,20]
row3 -0.9545212 -1.3290183
row1 -0.7511114  0.2618587
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]      [,3]       [,4]      [,5]       [,6]     [,7]
row2 -0.7565766 -1.114743 0.8303536 -0.1204095 0.2639552 -0.5681038 -1.46633
           [,8]       [,9]       [,10]
row2 -0.4771076 -0.1581652 -0.07674378
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
           [,1]      [,2]     [,3]       [,4]      [,5]      [,6]      [,7]
row5 -0.1118608 -1.153622 0.541419 -0.3503934 0.4271899 0.2316941 0.6330384
           [,8]       [,9]     [,10]    [,11]     [,12]      [,13]      [,14]
row5 -0.8646508 -0.4559199 0.7136559 1.656988 0.3030107 -0.2098769 -0.2503136
        [,15]    [,16]      [,17]    [,18]    [,19]      [,20]
row5 1.426114 1.297437 -0.8844593 1.962301 1.367027 -0.2004142
> 
> 
> 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: 0x000001a7606ff770>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c1bfc1463"
 [2] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c5975271c"
 [3] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c307f227f"
 [4] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c32755f66"
 [5] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c56067dfe"
 [6] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c160343d9"
 [7] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c27947e0" 
 [8] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5caf0295"  
 [9] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c13164d76"
[10] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c241a728f"
[11] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c24fe3576"
[12] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c49334942"
[13] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c372f34b" 
[14] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c7cc458a2"
[15] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM20d5c71924ae" 
> 
> 
> ### 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: 0x000001a7632ff110>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001a7632ff110>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.20-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001a7632ff110>
> rowMedians(tmp)
  [1] -0.383496839  0.364187005  0.019638573 -0.044776192 -0.134013293
  [6] -0.111402414 -0.031317453  0.426093315  0.087340510 -0.277701012
 [11]  0.132401104  0.307976310 -0.013954078  0.808055313  0.118589313
 [16]  0.061658989 -0.395636078 -0.048287151  0.066100118  0.235762642
 [21]  0.064554007 -0.343079728  0.254666284  0.446555940  0.392374607
 [26] -0.209912830  0.515047426  0.478026980 -0.438747926 -0.218582657
 [31] -0.202897479 -0.002071485 -0.211806823  0.296783308 -0.089750039
 [36] -0.273954283  0.287690918 -0.434879427 -0.196032109  0.079660475
 [41]  0.345839544  0.100597573 -0.572908288  0.120033308 -0.230733590
 [46] -0.162143105  0.458228400  0.096459233  0.195822387  0.187016062
 [51]  0.618344327  0.227969572  0.349506085  0.077792527  0.096676728
 [56] -0.162465230  0.318223060  0.359825271  0.448577969  0.173749764
 [61] -0.539767193 -0.833608977  0.109774974 -0.147800596  0.200925627
 [66]  0.409965870 -0.480515946  0.388062163 -0.341356856  0.109875478
 [71] -0.583730542  0.110576038 -0.250014984 -0.233176361 -0.286576507
 [76] -0.289482465 -0.155281152  0.124182423 -0.357240336  0.253740360
 [81] -0.423345058  0.103482426 -0.243992982 -0.459067311  0.009843509
 [86] -0.374741630 -0.730534298  0.063942360 -0.285742100 -0.176628484
 [91]  0.241300371 -0.411045293  0.311572094  0.466477901  0.343521043
 [96] -0.065110553 -0.071812761 -0.336811497  0.016657701 -0.115907064
[101] -0.495036590 -0.210088211  0.009889550 -0.367442001 -0.153158069
[106] -0.055608764  0.165695556 -0.355842524 -0.331493140 -0.112190919
[111]  0.423003212 -0.583722052  0.094688362  0.070555103  0.136838418
[116]  0.015966094 -0.127837831 -0.162500930 -0.724085918 -0.110871634
[121]  0.542066795 -0.418103273 -0.340915169  0.007355288  0.244055942
[126]  0.249786576  0.044606818 -0.123068555 -0.297460237 -0.659900881
[131] -0.077153984 -0.391022374  0.299940740 -0.608656889 -0.273985728
[136] -0.060020280 -0.134067564  0.089917054 -0.110753169  0.091869131
[141] -0.173591881  0.155847866  0.310961897 -0.613072746  0.158016071
[146]  0.253995491  0.140206089 -0.533070001 -0.109898921 -0.186191966
[151] -0.001931790  0.511651315 -0.002742843  0.016097896  0.024587639
[156]  0.197451683 -0.339630049 -0.132855492  0.055176436  0.370407936
[161]  0.200454697 -0.021972742  0.263815613  0.480057640 -0.060306242
[166]  0.073739041 -0.025894697  0.118170347 -0.546762670  0.463889997
[171]  0.078690626 -0.794595390 -0.633313106  0.043207560  0.333595165
[176]  0.140653959 -0.237843469  0.072236077 -0.038131898 -0.363076698
[181]  0.044586373 -0.088495145 -0.375223408  0.310512883 -0.023466559
[186]  0.092793204  0.333029839  0.248526436 -0.317466993  0.428686421
[191] -0.074880144 -0.052583494 -0.128971321 -0.107971571  0.351460335
[196] -0.209650399 -0.544857253  0.248278312 -0.007795779  0.328861848
[201] -0.168527757  0.037912174 -0.059609382 -0.781588189  0.237127254
[206]  0.202217193  0.451159126 -0.112893193 -0.032063142  0.162685898
[211] -0.576788543 -0.645835793  0.345005858  0.174518556 -0.126172340
[216]  0.550187627 -0.328485595  0.050657355 -0.146041804 -0.134924970
[221] -0.061331623 -0.036317003  0.265610592  0.100013123 -0.535083077
[226] -0.101242942 -0.011301384 -0.092204759 -0.207551306 -0.045105883
> 
> proc.time()
   user  system elapsed 
   3.70   20.07  119.03 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life"
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: 0x00000253dc0ffb30>
> .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: 0x00000253dc0ffb30>
> .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: 0x00000253dc0ffb30>
> .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: 0x00000253dc0ffb30>
> 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: 0x00000253dc0ff470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000253dc0ff470>
> .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: 0x00000253dc0ff470>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000253dc0ff470>
> .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: 0x00000253dc0ff470>
> 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: 0x00000253dc0ff6b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000253dc0ff6b0>
> .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: 0x00000253dc0ff6b0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000253dc0ff6b0>
> .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: 0x00000253dc0ff6b0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x00000253dc0ff6b0>
> .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: 0x00000253dc0ff6b0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x00000253dc0ff6b0>
> .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: 0x00000253dc0ff6b0>
> 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: 0x00000253dc0ffdd0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x00000253dc0ffdd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000253dc0ffdd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000253dc0ffdd0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1263c5ca356eb" "BufferedMatrixFile1263c6759142e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1263c5ca356eb" "BufferedMatrixFile1263c6759142e"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000253dc5676b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000253dc5676b0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000253dc5676b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000253dc5676b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x00000253dc5676b0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x00000253dc5676b0>
> .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: 0x00000253dc567410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000253dc567410>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000253dc567410>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x00000253dc567410>
> 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: 0x00000253dc5677d0>
> .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: 0x00000253dc5677d0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.25    0.14    0.57 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life"
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.32    0.09    0.37 

Example timings