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

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

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo1Linux (Ubuntu 22.04.3 LTS)x86_644.4.0 (2024-04-24) -- "Puppy Cup" 4760
palomino3Windows Server 2022 Datacenterx644.4.0 (2024-04-24 ucrt) -- "Puppy Cup" 4494
merida1macOS 12.7.4 Montereyx86_644.4.0 (2024-04-24) -- "Puppy Cup" 4508
kjohnson1macOS 13.6.6 Venturaarm644.4.0 (2024-04-24) -- "Puppy Cup" 4466
palomino7Windows Server 2022 Datacenterx644.4.1 (2024-06-14 ucrt) -- "Race for Your Life" 4362
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

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


CHECK results for BufferedMatrix on palomino3

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

raw results


Summary

Package: BufferedMatrix
Version: 1.68.0
Command: F:\biocbuild\bbs-3.19-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.19-bioc\R\library --no-vignettes --timings BufferedMatrix_1.68.0.tar.gz
StartedAt: 2024-06-26 23:39:26 -0400 (Wed, 26 Jun 2024)
EndedAt: 2024-06-26 23:41:04 -0400 (Wed, 26 Jun 2024)
EllapsedTime: 97.9 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

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


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

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

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

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


Installation output

BufferedMatrix.Rcheck/00install.out

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


* installing to library 'F:/biocbuild/bbs-3.19-bioc/R/library'
* installing *source* package 'BufferedMatrix' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 13.2.0'
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function 'dbm_ReadOnlyMode':
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: 'sort_double' defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc  -I"F:/biocbuild/bbs-3.19-bioc/R/include" -DNDEBUG     -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c init_package.c -o init_package.o
gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.19-bioc/R/bin/x64 -lR
installing to F:/biocbuild/bbs-3.19-bioc/R/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for 'rowMeans' in package 'BufferedMatrix'
Creating a new generic function for 'rowSums' in package 'BufferedMatrix'
Creating a new generic function for 'colMeans' in package 'BufferedMatrix'
Creating a new generic function for 'colSums' in package 'BufferedMatrix'
Creating a generic function for 'ncol' from package 'base' in package 'BufferedMatrix'
Creating a generic function for 'nrow' from package 'base' in package 'BufferedMatrix'
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


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

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
   0.28    0.17    0.65 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


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

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 468464 25.1    1021761 54.6   633414 33.9
Vcells 853870  6.6    8388608 64.0  2003138 15.3
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Wed Jun 26 23:39:58 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] "Wed Jun 26 23:39:58 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: 0x000001d306cfda70>
> 
> 
> 
> 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] "Wed Jun 26 23:40:09 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] "Wed Jun 26 23:40:12 2024"
> 
> ColMode(tmp2)
<pointer: 0x000001d306cfda70>
> 
> 
> 
> ### 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.7622728 1.2793917 1.0496495 -0.6483189
[2,] -0.1095212 0.8021277 0.7596662  1.8893380
[3,]  0.1873436 1.7597839 0.2408761  1.4815866
[4,]  1.0086656 0.3736617 0.4701205  0.6368740
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.7622728 1.2793917 1.0496495 0.6483189
[2,]  0.1095212 0.8021277 0.7596662 1.8893380
[3,]  0.1873436 1.7597839 0.2408761 1.4815866
[4,]  1.0086656 0.3736617 0.4701205 0.6368740
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9881066 1.1311020 1.0245241 0.8051825
[2,] 0.3309398 0.8956158 0.8715883 1.3745319
[3,] 0.4328321 1.3265685 0.4907913 1.2172044
[4,] 1.0043234 0.6112788 0.6856534 0.7980438
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.64334 37.59041 36.29489 33.70014
[2,]  28.41892 34.75829 34.47555 40.63466
[3,]  29.51566 40.02547 30.14879 38.65363
[4,]  36.05190 31.48645 32.32665 33.61731
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x000001d306cfdad0>
> exp(tmp5)
<pointer: 0x000001d306cfdad0>
> log(tmp5,2)
<pointer: 0x000001d306cfdad0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.5657
> Min(tmp5)
[1] 53.02462
> mean(tmp5)
[1] 72.24446
> Sum(tmp5)
[1] 14448.89
> Var(tmp5)
[1] 855.9834
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.44677 69.90239 69.73299 70.94464 70.55756 70.45801 68.19547 69.93804
 [9] 72.57970 68.68901
> rowSums(tmp5)
 [1] 1828.935 1398.048 1394.660 1418.893 1411.151 1409.160 1363.909 1398.761
 [9] 1451.594 1373.780
> rowVars(tmp5)
 [1] 7887.98619   58.67766   87.47355   69.72406   57.42052   81.92032
 [7]   83.79517   68.58403   55.90186   68.85265
> rowSd(tmp5)
 [1] 88.814336  7.660134  9.352729  8.350093  7.577633  9.050984  9.153970
 [8]  8.281548  7.476755  8.297749
> rowMax(tmp5)
 [1] 467.56568  88.73694  92.30858  89.60406  85.34730  85.15058  82.21749
 [8]  81.58454  83.24788  87.89538
> rowMin(tmp5)
 [1] 57.38617 59.15026 53.27021 55.98912 58.23828 53.02462 54.30289 56.32422
 [9] 57.05620 56.32756
> 
> colMeans(tmp5)
 [1] 109.11947  71.50616  69.79455  70.88571  65.12370  70.59601  73.59373
 [8]  68.64865  71.11299  69.78600  68.10343  68.69846  72.40651  69.87817
[15]  70.51680  70.52389  72.24608  70.43260  70.01880  71.89744
> colSums(tmp5)
 [1] 1091.1947  715.0616  697.9455  708.8571  651.2370  705.9601  735.9373
 [8]  686.4865  711.1299  697.8600  681.0343  686.9846  724.0651  698.7817
[15]  705.1680  705.2389  722.4608  704.3260  700.1880  718.9744
> colVars(tmp5)
 [1] 15917.14286    78.89909    32.52788    81.46703    47.72819    55.29288
 [7]    64.41836    99.30827    74.90775    99.19606    56.91248    72.00642
[13]    81.98567    69.52301    76.84670    54.35125    66.47295    88.61340
[19]    42.90383   107.00971
> colSd(tmp5)
 [1] 126.163160   8.882516   5.703322   9.025909   6.908559   7.435919
 [7]   8.026105   9.965353   8.654926   9.959722   7.544036   8.485660
[13]   9.054594   8.338046   8.766225   7.372330   8.153094   9.413469
[19]   6.550101  10.344550
> colMax(tmp5)
 [1] 467.56568  83.30777  76.60757  84.57572  76.01868  78.86156  92.30858
 [8]  85.34730  83.43183  83.56569  83.24788  81.32268  88.73694  87.89538
[15]  82.77274  81.28790  84.89429  85.15058  77.43920  89.60406
> colMin(tmp5)
 [1] 59.15026 56.32756 58.20990 60.22324 54.30289 59.07029 62.04375 53.02462
 [9] 58.30325 55.50059 58.23828 57.38617 56.74749 58.34351 59.16644 57.05620
[17] 59.84411 56.29042 56.32422 53.27021
> 
> 
> ### 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]       NA 69.90239 69.73299 70.94464 70.55756 70.45801 68.19547 69.93804
 [9] 72.57970 68.68901
> rowSums(tmp5)
 [1]       NA 1398.048 1394.660 1418.893 1411.151 1409.160 1363.909 1398.761
 [9] 1451.594 1373.780
> rowVars(tmp5)
 [1] 53.37529 58.67766 87.47355 69.72406 57.42052 81.92032 83.79517 68.58403
 [9] 55.90186 68.85265
> rowSd(tmp5)
 [1] 7.305839 7.660134 9.352729 8.350093 7.577633 9.050984 9.153970 8.281548
 [9] 7.476755 8.297749
> rowMax(tmp5)
 [1]       NA 88.73694 92.30858 89.60406 85.34730 85.15058 82.21749 81.58454
 [9] 83.24788 87.89538
> rowMin(tmp5)
 [1]       NA 59.15026 53.27021 55.98912 58.23828 53.02462 54.30289 56.32422
 [9] 57.05620 56.32756
> 
> colMeans(tmp5)
 [1]       NA 71.50616 69.79455 70.88571 65.12370 70.59601 73.59373 68.64865
 [9] 71.11299 69.78600 68.10343 68.69846 72.40651 69.87817 70.51680 70.52389
[17] 72.24608 70.43260 70.01880 71.89744
> colSums(tmp5)
 [1]       NA 715.0616 697.9455 708.8571 651.2370 705.9601 735.9373 686.4865
 [9] 711.1299 697.8600 681.0343 686.9846 724.0651 698.7817 705.1680 705.2389
[17] 722.4608 704.3260 700.1880 718.9744
> colVars(tmp5)
 [1]        NA  78.89909  32.52788  81.46703  47.72819  55.29288  64.41836
 [8]  99.30827  74.90775  99.19606  56.91248  72.00642  81.98567  69.52301
[15]  76.84670  54.35125  66.47295  88.61340  42.90383 107.00971
> colSd(tmp5)
 [1]        NA  8.882516  5.703322  9.025909  6.908559  7.435919  8.026105
 [8]  9.965353  8.654926  9.959722  7.544036  8.485660  9.054594  8.338046
[15]  8.766225  7.372330  8.153094  9.413469  6.550101 10.344550
> colMax(tmp5)
 [1]       NA 83.30777 76.60757 84.57572 76.01868 78.86156 92.30858 85.34730
 [9] 83.43183 83.56569 83.24788 81.32268 88.73694 87.89538 82.77274 81.28790
[17] 84.89429 85.15058 77.43920 89.60406
> colMin(tmp5)
 [1]       NA 56.32756 58.20990 60.22324 54.30289 59.07029 62.04375 53.02462
 [9] 58.30325 55.50059 58.23828 57.38617 56.74749 58.34351 59.16644 57.05620
[17] 59.84411 56.29042 56.32422 53.27021
> 
> Max(tmp5,na.rm=TRUE)
[1] 92.30858
> Min(tmp5,na.rm=TRUE)
[1] 53.02462
> mean(tmp5,na.rm=TRUE)
[1] 70.25792
> Sum(tmp5,na.rm=TRUE)
[1] 13981.33
> Var(tmp5,na.rm=TRUE)
[1] 67.05306
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 71.65104 69.90239 69.73299 70.94464 70.55756 70.45801 68.19547 69.93804
 [9] 72.57970 68.68901
> rowSums(tmp5,na.rm=TRUE)
 [1] 1361.370 1398.048 1394.660 1418.893 1411.151 1409.160 1363.909 1398.761
 [9] 1451.594 1373.780
> rowVars(tmp5,na.rm=TRUE)
 [1] 53.37529 58.67766 87.47355 69.72406 57.42052 81.92032 83.79517 68.58403
 [9] 55.90186 68.85265
> rowSd(tmp5,na.rm=TRUE)
 [1] 7.305839 7.660134 9.352729 8.350093 7.577633 9.050984 9.153970 8.281548
 [9] 7.476755 8.297749
> rowMax(tmp5,na.rm=TRUE)
 [1] 84.89429 88.73694 92.30858 89.60406 85.34730 85.15058 82.21749 81.58454
 [9] 83.24788 87.89538
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.38617 59.15026 53.27021 55.98912 58.23828 53.02462 54.30289 56.32422
 [9] 57.05620 56.32756
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 69.29212 71.50616 69.79455 70.88571 65.12370 70.59601 73.59373 68.64865
 [9] 71.11299 69.78600 68.10343 68.69846 72.40651 69.87817 70.51680 70.52389
[17] 72.24608 70.43260 70.01880 71.89744
> colSums(tmp5,na.rm=TRUE)
 [1] 623.6290 715.0616 697.9455 708.8571 651.2370 705.9601 735.9373 686.4865
 [9] 711.1299 697.8600 681.0343 686.9846 724.0651 698.7817 705.1680 705.2389
[17] 722.4608 704.3260 700.1880 718.9744
> colVars(tmp5,na.rm=TRUE)
 [1]  61.83000  78.89909  32.52788  81.46703  47.72819  55.29288  64.41836
 [8]  99.30827  74.90775  99.19606  56.91248  72.00642  81.98567  69.52301
[15]  76.84670  54.35125  66.47295  88.61340  42.90383 107.00971
> colSd(tmp5,na.rm=TRUE)
 [1]  7.863205  8.882516  5.703322  9.025909  6.908559  7.435919  8.026105
 [8]  9.965353  8.654926  9.959722  7.544036  8.485660  9.054594  8.338046
[15]  8.766225  7.372330  8.153094  9.413469  6.550101 10.344550
> colMax(tmp5,na.rm=TRUE)
 [1] 82.21749 83.30777 76.60757 84.57572 76.01868 78.86156 92.30858 85.34730
 [9] 83.43183 83.56569 83.24788 81.32268 88.73694 87.89538 82.77274 81.28790
[17] 84.89429 85.15058 77.43920 89.60406
> colMin(tmp5,na.rm=TRUE)
 [1] 59.15026 56.32756 58.20990 60.22324 54.30289 59.07029 62.04375 53.02462
 [9] 58.30325 55.50059 58.23828 57.38617 56.74749 58.34351 59.16644 57.05620
[17] 59.84411 56.29042 56.32422 53.27021
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1]      NaN 69.90239 69.73299 70.94464 70.55756 70.45801 68.19547 69.93804
 [9] 72.57970 68.68901
> rowSums(tmp5,na.rm=TRUE)
 [1]    0.000 1398.048 1394.660 1418.893 1411.151 1409.160 1363.909 1398.761
 [9] 1451.594 1373.780
> rowVars(tmp5,na.rm=TRUE)
 [1]       NA 58.67766 87.47355 69.72406 57.42052 81.92032 83.79517 68.58403
 [9] 55.90186 68.85265
> rowSd(tmp5,na.rm=TRUE)
 [1]       NA 7.660134 9.352729 8.350093 7.577633 9.050984 9.153970 8.281548
 [9] 7.476755 8.297749
> rowMax(tmp5,na.rm=TRUE)
 [1]       NA 88.73694 92.30858 89.60406 85.34730 85.15058 82.21749 81.58454
 [9] 83.24788 87.89538
> rowMin(tmp5,na.rm=TRUE)
 [1]       NA 59.15026 53.27021 55.98912 58.23828 53.02462 54.30289 56.32422
 [9] 57.05620 56.32756
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1]      NaN 70.75801 69.15582 70.96830 64.43491 70.15211 73.79322 68.05909
 [9] 72.53630 69.48981 67.05312 69.95538 72.29848 70.80431 69.26288 70.74323
[17] 70.84073 70.91627 69.28504 72.41824
> colSums(tmp5,na.rm=TRUE)
 [1]   0.0000 636.8221 622.4024 638.7147 579.9142 631.3690 664.1390 612.5318
 [9] 652.8267 625.4083 603.4781 629.5984 650.6864 637.2388 623.3660 636.6891
[17] 637.5665 638.2464 623.5654 651.7641
> colVars(tmp5,na.rm=TRUE)
 [1]        NA  82.46452  32.00423  91.57368  48.35673  59.98779  72.02292
 [8] 107.81146  61.48099 110.60863  51.61602  63.23390  92.10259  68.56376
[15]  68.76420  60.60393  52.56301  97.05837  42.20975 117.33466
> colSd(tmp5,na.rm=TRUE)
 [1]        NA  9.080998  5.657228  9.569414  6.953900  7.745179  8.486632
 [8] 10.383230  7.840982 10.517064  7.184429  7.951975  9.597010  8.280324
[15]  8.292418  7.784853  7.250035  9.851821  6.496903 10.832112
> colMax(tmp5,na.rm=TRUE)
 [1]     -Inf 83.30777 76.60757 84.57572 76.01868 78.86156 92.30858 85.34730
 [9] 83.43183 83.56569 83.24788 81.32268 88.73694 87.89538 82.77274 81.28790
[17] 80.74823 85.15058 77.43920 89.60406
> colMin(tmp5,na.rm=TRUE)
 [1]      Inf 56.32756 58.20990 60.22324 54.30289 59.07029 62.04375 53.02462
 [9] 60.62948 55.50059 58.23828 57.83956 56.74749 58.34351 59.16644 57.05620
[17] 59.84411 56.29042 56.32422 53.27021
> 
> 
> 
> 
> 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] 231.2041 329.6620 126.9070 173.3150 306.4118 224.8073 279.9158 194.1987
 [9] 165.0642 232.1596
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 231.2041 329.6620 126.9070 173.3150 306.4118 224.8073 279.9158 194.1987
 [9] 165.0642 232.1596
> 
> 
> 
> 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.842171e-14 -5.684342e-14 -5.684342e-14 -8.526513e-14  1.989520e-13
 [6] -1.705303e-13 -2.131628e-13  2.842171e-14  1.421085e-13  8.526513e-14
[11] -5.684342e-14 -2.842171e-14 -7.105427e-14 -3.410605e-13  1.421085e-14
[16] -1.705303e-13 -5.684342e-14 -1.136868e-13  0.000000e+00 -2.273737e-13
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
5   7 
9   9 
10   6 
5   5 
4   2 
1   19 
2   8 
5   18 
3   20 
7   7 
10   16 
9   4 
10   5 
9   8 
2   9 
2   5 
10   14 
8   18 
4   18 
10   17 
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.176353
> Min(tmp)
[1] -3.268377
> mean(tmp)
[1] 0.04627426
> Sum(tmp)
[1] 4.627426
> Var(tmp)
[1] 0.9800545
> 
> rowMeans(tmp)
[1] 0.04627426
> rowSums(tmp)
[1] 4.627426
> rowVars(tmp)
[1] 0.9800545
> rowSd(tmp)
[1] 0.989977
> rowMax(tmp)
[1] 2.176353
> rowMin(tmp)
[1] -3.268377
> 
> colMeans(tmp)
  [1] -0.090723337  0.204877538  1.143364250  0.997712857 -0.791250413
  [6]  1.651240683 -0.037137952 -0.884029410 -0.295992945 -0.003852997
 [11] -1.119510840 -0.159578986  0.858113867 -0.332351401  0.902035205
 [16]  1.341531591  0.091949869  0.106649330  1.229844218 -0.988284456
 [21] -1.044085100  0.285258862  0.358206000  2.073543570  0.398453240
 [26] -1.753413424  0.015208426 -0.725126213  0.338238728 -1.027357465
 [31] -1.940644507 -0.118714827  0.492142931 -0.296743191 -0.022179604
 [36] -1.994324764  0.126763224  0.110486745  1.039712222 -0.237050819
 [41] -0.603575407  0.248007227  1.581933161 -0.290669723  0.128701332
 [46] -1.271822881  1.470813043 -0.209099319 -1.761169252  1.360211764
 [51] -0.269204889  0.502557954  1.715591990 -0.938735877  0.827318367
 [56] -1.085047238 -0.261123515 -3.268377297 -0.360517880  0.797091258
 [61]  1.130829307  0.241432589 -1.071402790  2.176352991  0.182644502
 [66]  1.531126908  0.255378460 -0.348982970 -1.763634251 -0.009733883
 [71] -2.004285960  1.013022457 -0.376287893 -0.378265682 -0.114897848
 [76]  0.452567266  1.891512407  0.383800672  0.585047278 -1.084257830
 [81]  1.304211845  0.809796747  0.414345456  0.100111715  0.436706471
 [86]  0.781121990 -0.156370255 -1.296774555 -0.008131533 -0.562229193
 [91]  0.636037301 -0.391002490  0.873157654 -1.223613975 -0.236222426
 [96]  1.210765986  0.560734564  0.437950214 -0.436845851  0.465846744
> colSums(tmp)
  [1] -0.090723337  0.204877538  1.143364250  0.997712857 -0.791250413
  [6]  1.651240683 -0.037137952 -0.884029410 -0.295992945 -0.003852997
 [11] -1.119510840 -0.159578986  0.858113867 -0.332351401  0.902035205
 [16]  1.341531591  0.091949869  0.106649330  1.229844218 -0.988284456
 [21] -1.044085100  0.285258862  0.358206000  2.073543570  0.398453240
 [26] -1.753413424  0.015208426 -0.725126213  0.338238728 -1.027357465
 [31] -1.940644507 -0.118714827  0.492142931 -0.296743191 -0.022179604
 [36] -1.994324764  0.126763224  0.110486745  1.039712222 -0.237050819
 [41] -0.603575407  0.248007227  1.581933161 -0.290669723  0.128701332
 [46] -1.271822881  1.470813043 -0.209099319 -1.761169252  1.360211764
 [51] -0.269204889  0.502557954  1.715591990 -0.938735877  0.827318367
 [56] -1.085047238 -0.261123515 -3.268377297 -0.360517880  0.797091258
 [61]  1.130829307  0.241432589 -1.071402790  2.176352991  0.182644502
 [66]  1.531126908  0.255378460 -0.348982970 -1.763634251 -0.009733883
 [71] -2.004285960  1.013022457 -0.376287893 -0.378265682 -0.114897848
 [76]  0.452567266  1.891512407  0.383800672  0.585047278 -1.084257830
 [81]  1.304211845  0.809796747  0.414345456  0.100111715  0.436706471
 [86]  0.781121990 -0.156370255 -1.296774555 -0.008131533 -0.562229193
 [91]  0.636037301 -0.391002490  0.873157654 -1.223613975 -0.236222426
 [96]  1.210765986  0.560734564  0.437950214 -0.436845851  0.465846744
> 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.090723337  0.204877538  1.143364250  0.997712857 -0.791250413
  [6]  1.651240683 -0.037137952 -0.884029410 -0.295992945 -0.003852997
 [11] -1.119510840 -0.159578986  0.858113867 -0.332351401  0.902035205
 [16]  1.341531591  0.091949869  0.106649330  1.229844218 -0.988284456
 [21] -1.044085100  0.285258862  0.358206000  2.073543570  0.398453240
 [26] -1.753413424  0.015208426 -0.725126213  0.338238728 -1.027357465
 [31] -1.940644507 -0.118714827  0.492142931 -0.296743191 -0.022179604
 [36] -1.994324764  0.126763224  0.110486745  1.039712222 -0.237050819
 [41] -0.603575407  0.248007227  1.581933161 -0.290669723  0.128701332
 [46] -1.271822881  1.470813043 -0.209099319 -1.761169252  1.360211764
 [51] -0.269204889  0.502557954  1.715591990 -0.938735877  0.827318367
 [56] -1.085047238 -0.261123515 -3.268377297 -0.360517880  0.797091258
 [61]  1.130829307  0.241432589 -1.071402790  2.176352991  0.182644502
 [66]  1.531126908  0.255378460 -0.348982970 -1.763634251 -0.009733883
 [71] -2.004285960  1.013022457 -0.376287893 -0.378265682 -0.114897848
 [76]  0.452567266  1.891512407  0.383800672  0.585047278 -1.084257830
 [81]  1.304211845  0.809796747  0.414345456  0.100111715  0.436706471
 [86]  0.781121990 -0.156370255 -1.296774555 -0.008131533 -0.562229193
 [91]  0.636037301 -0.391002490  0.873157654 -1.223613975 -0.236222426
 [96]  1.210765986  0.560734564  0.437950214 -0.436845851  0.465846744
> colMin(tmp)
  [1] -0.090723337  0.204877538  1.143364250  0.997712857 -0.791250413
  [6]  1.651240683 -0.037137952 -0.884029410 -0.295992945 -0.003852997
 [11] -1.119510840 -0.159578986  0.858113867 -0.332351401  0.902035205
 [16]  1.341531591  0.091949869  0.106649330  1.229844218 -0.988284456
 [21] -1.044085100  0.285258862  0.358206000  2.073543570  0.398453240
 [26] -1.753413424  0.015208426 -0.725126213  0.338238728 -1.027357465
 [31] -1.940644507 -0.118714827  0.492142931 -0.296743191 -0.022179604
 [36] -1.994324764  0.126763224  0.110486745  1.039712222 -0.237050819
 [41] -0.603575407  0.248007227  1.581933161 -0.290669723  0.128701332
 [46] -1.271822881  1.470813043 -0.209099319 -1.761169252  1.360211764
 [51] -0.269204889  0.502557954  1.715591990 -0.938735877  0.827318367
 [56] -1.085047238 -0.261123515 -3.268377297 -0.360517880  0.797091258
 [61]  1.130829307  0.241432589 -1.071402790  2.176352991  0.182644502
 [66]  1.531126908  0.255378460 -0.348982970 -1.763634251 -0.009733883
 [71] -2.004285960  1.013022457 -0.376287893 -0.378265682 -0.114897848
 [76]  0.452567266  1.891512407  0.383800672  0.585047278 -1.084257830
 [81]  1.304211845  0.809796747  0.414345456  0.100111715  0.436706471
 [86]  0.781121990 -0.156370255 -1.296774555 -0.008131533 -0.562229193
 [91]  0.636037301 -0.391002490  0.873157654 -1.223613975 -0.236222426
 [96]  1.210765986  0.560734564  0.437950214 -0.436845851  0.465846744
> colMedians(tmp)
  [1] -0.090723337  0.204877538  1.143364250  0.997712857 -0.791250413
  [6]  1.651240683 -0.037137952 -0.884029410 -0.295992945 -0.003852997
 [11] -1.119510840 -0.159578986  0.858113867 -0.332351401  0.902035205
 [16]  1.341531591  0.091949869  0.106649330  1.229844218 -0.988284456
 [21] -1.044085100  0.285258862  0.358206000  2.073543570  0.398453240
 [26] -1.753413424  0.015208426 -0.725126213  0.338238728 -1.027357465
 [31] -1.940644507 -0.118714827  0.492142931 -0.296743191 -0.022179604
 [36] -1.994324764  0.126763224  0.110486745  1.039712222 -0.237050819
 [41] -0.603575407  0.248007227  1.581933161 -0.290669723  0.128701332
 [46] -1.271822881  1.470813043 -0.209099319 -1.761169252  1.360211764
 [51] -0.269204889  0.502557954  1.715591990 -0.938735877  0.827318367
 [56] -1.085047238 -0.261123515 -3.268377297 -0.360517880  0.797091258
 [61]  1.130829307  0.241432589 -1.071402790  2.176352991  0.182644502
 [66]  1.531126908  0.255378460 -0.348982970 -1.763634251 -0.009733883
 [71] -2.004285960  1.013022457 -0.376287893 -0.378265682 -0.114897848
 [76]  0.452567266  1.891512407  0.383800672  0.585047278 -1.084257830
 [81]  1.304211845  0.809796747  0.414345456  0.100111715  0.436706471
 [86]  0.781121990 -0.156370255 -1.296774555 -0.008131533 -0.562229193
 [91]  0.636037301 -0.391002490  0.873157654 -1.223613975 -0.236222426
 [96]  1.210765986  0.560734564  0.437950214 -0.436845851  0.465846744
> colRanges(tmp)
            [,1]      [,2]     [,3]      [,4]       [,5]     [,6]        [,7]
[1,] -0.09072334 0.2048775 1.143364 0.9977129 -0.7912504 1.651241 -0.03713795
[2,] -0.09072334 0.2048775 1.143364 0.9977129 -0.7912504 1.651241 -0.03713795
           [,8]       [,9]        [,10]     [,11]     [,12]     [,13]
[1,] -0.8840294 -0.2959929 -0.003852997 -1.119511 -0.159579 0.8581139
[2,] -0.8840294 -0.2959929 -0.003852997 -1.119511 -0.159579 0.8581139
          [,14]     [,15]    [,16]      [,17]     [,18]    [,19]      [,20]
[1,] -0.3323514 0.9020352 1.341532 0.09194987 0.1066493 1.229844 -0.9882845
[2,] -0.3323514 0.9020352 1.341532 0.09194987 0.1066493 1.229844 -0.9882845
         [,21]     [,22]    [,23]    [,24]     [,25]     [,26]      [,27]
[1,] -1.044085 0.2852589 0.358206 2.073544 0.3984532 -1.753413 0.01520843
[2,] -1.044085 0.2852589 0.358206 2.073544 0.3984532 -1.753413 0.01520843
          [,28]     [,29]     [,30]     [,31]      [,32]     [,33]      [,34]
[1,] -0.7251262 0.3382387 -1.027357 -1.940645 -0.1187148 0.4921429 -0.2967432
[2,] -0.7251262 0.3382387 -1.027357 -1.940645 -0.1187148 0.4921429 -0.2967432
          [,35]     [,36]     [,37]     [,38]    [,39]      [,40]      [,41]
[1,] -0.0221796 -1.994325 0.1267632 0.1104867 1.039712 -0.2370508 -0.6035754
[2,] -0.0221796 -1.994325 0.1267632 0.1104867 1.039712 -0.2370508 -0.6035754
         [,42]    [,43]      [,44]     [,45]     [,46]    [,47]      [,48]
[1,] 0.2480072 1.581933 -0.2906697 0.1287013 -1.271823 1.470813 -0.2090993
[2,] 0.2480072 1.581933 -0.2906697 0.1287013 -1.271823 1.470813 -0.2090993
         [,49]    [,50]      [,51]    [,52]    [,53]      [,54]     [,55]
[1,] -1.761169 1.360212 -0.2692049 0.502558 1.715592 -0.9387359 0.8273184
[2,] -1.761169 1.360212 -0.2692049 0.502558 1.715592 -0.9387359 0.8273184
         [,56]      [,57]     [,58]      [,59]     [,60]    [,61]     [,62]
[1,] -1.085047 -0.2611235 -3.268377 -0.3605179 0.7970913 1.130829 0.2414326
[2,] -1.085047 -0.2611235 -3.268377 -0.3605179 0.7970913 1.130829 0.2414326
         [,63]    [,64]     [,65]    [,66]     [,67]     [,68]     [,69]
[1,] -1.071403 2.176353 0.1826445 1.531127 0.2553785 -0.348983 -1.763634
[2,] -1.071403 2.176353 0.1826445 1.531127 0.2553785 -0.348983 -1.763634
            [,70]     [,71]    [,72]      [,73]      [,74]      [,75]     [,76]
[1,] -0.009733883 -2.004286 1.013022 -0.3762879 -0.3782657 -0.1148978 0.4525673
[2,] -0.009733883 -2.004286 1.013022 -0.3762879 -0.3782657 -0.1148978 0.4525673
        [,77]     [,78]     [,79]     [,80]    [,81]     [,82]     [,83]
[1,] 1.891512 0.3838007 0.5850473 -1.084258 1.304212 0.8097967 0.4143455
[2,] 1.891512 0.3838007 0.5850473 -1.084258 1.304212 0.8097967 0.4143455
         [,84]     [,85]    [,86]      [,87]     [,88]        [,89]      [,90]
[1,] 0.1001117 0.4367065 0.781122 -0.1563703 -1.296775 -0.008131533 -0.5622292
[2,] 0.1001117 0.4367065 0.781122 -0.1563703 -1.296775 -0.008131533 -0.5622292
         [,91]      [,92]     [,93]     [,94]      [,95]    [,96]     [,97]
[1,] 0.6360373 -0.3910025 0.8731577 -1.223614 -0.2362224 1.210766 0.5607346
[2,] 0.6360373 -0.3910025 0.8731577 -1.223614 -0.2362224 1.210766 0.5607346
         [,98]      [,99]    [,100]
[1,] 0.4379502 -0.4368459 0.4658467
[2,] 0.4379502 -0.4368459 0.4658467
> 
> 
> Max(tmp2)
[1] 2.745916
> Min(tmp2)
[1] -2.550784
> mean(tmp2)
[1] -0.128027
> Sum(tmp2)
[1] -12.8027
> Var(tmp2)
[1] 1.094301
> 
> rowMeans(tmp2)
  [1]  2.07902908  0.56174119  2.16004870  0.38865108  0.71710085  0.15747765
  [7]  0.99124326  1.65599851  1.37139379 -1.07703086 -2.55078439 -1.07709026
 [13]  0.25639103  1.42367645 -0.60272912 -0.89281195 -0.51371819 -0.95979526
 [19] -2.47862526  2.30743606 -0.95005211  1.37593337  0.44460191 -1.52102948
 [25] -1.13720014 -0.24854189 -1.04621226 -0.68839903  0.52472168 -1.00338353
 [31] -0.40317453 -1.01172503  0.56348499  0.05080943 -0.50189570 -0.81048565
 [37] -0.55802398 -2.22772196 -1.96244689  1.00864805  0.33439784  0.68315145
 [43] -0.35605206  0.93684282 -0.54189262  0.08047483 -1.09874765 -0.54946980
 [49]  0.93012130 -1.40409131 -0.70744971 -0.32931654 -0.95184734 -0.88102303
 [55]  0.26869024 -0.62921097 -0.57094455  0.44582992  2.74591559 -1.28185672
 [61] -0.59526787 -0.44190537 -0.27219934 -1.88543926 -0.93568572  1.59351609
 [67] -1.93828641  0.85408369 -0.48822218  0.14787633 -0.23288860 -0.53145045
 [73] -0.53721251 -0.16581793 -0.29973006  0.27418627  1.67824042  0.43650659
 [79]  1.01125212 -0.19661155  0.25523438  0.71779101 -0.68223037  0.43789706
 [85]  1.22592371 -0.43091255 -0.38866467  0.15131805 -0.09360314 -1.02829439
 [91] -0.53760760 -0.66268908  0.60778341 -0.86705959  0.23091341 -1.36555774
 [97] -1.25381945  1.09917625  0.65961206  0.70811120
> rowSums(tmp2)
  [1]  2.07902908  0.56174119  2.16004870  0.38865108  0.71710085  0.15747765
  [7]  0.99124326  1.65599851  1.37139379 -1.07703086 -2.55078439 -1.07709026
 [13]  0.25639103  1.42367645 -0.60272912 -0.89281195 -0.51371819 -0.95979526
 [19] -2.47862526  2.30743606 -0.95005211  1.37593337  0.44460191 -1.52102948
 [25] -1.13720014 -0.24854189 -1.04621226 -0.68839903  0.52472168 -1.00338353
 [31] -0.40317453 -1.01172503  0.56348499  0.05080943 -0.50189570 -0.81048565
 [37] -0.55802398 -2.22772196 -1.96244689  1.00864805  0.33439784  0.68315145
 [43] -0.35605206  0.93684282 -0.54189262  0.08047483 -1.09874765 -0.54946980
 [49]  0.93012130 -1.40409131 -0.70744971 -0.32931654 -0.95184734 -0.88102303
 [55]  0.26869024 -0.62921097 -0.57094455  0.44582992  2.74591559 -1.28185672
 [61] -0.59526787 -0.44190537 -0.27219934 -1.88543926 -0.93568572  1.59351609
 [67] -1.93828641  0.85408369 -0.48822218  0.14787633 -0.23288860 -0.53145045
 [73] -0.53721251 -0.16581793 -0.29973006  0.27418627  1.67824042  0.43650659
 [79]  1.01125212 -0.19661155  0.25523438  0.71779101 -0.68223037  0.43789706
 [85]  1.22592371 -0.43091255 -0.38866467  0.15131805 -0.09360314 -1.02829439
 [91] -0.53760760 -0.66268908  0.60778341 -0.86705959  0.23091341 -1.36555774
 [97] -1.25381945  1.09917625  0.65961206  0.70811120
> 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]  2.07902908  0.56174119  2.16004870  0.38865108  0.71710085  0.15747765
  [7]  0.99124326  1.65599851  1.37139379 -1.07703086 -2.55078439 -1.07709026
 [13]  0.25639103  1.42367645 -0.60272912 -0.89281195 -0.51371819 -0.95979526
 [19] -2.47862526  2.30743606 -0.95005211  1.37593337  0.44460191 -1.52102948
 [25] -1.13720014 -0.24854189 -1.04621226 -0.68839903  0.52472168 -1.00338353
 [31] -0.40317453 -1.01172503  0.56348499  0.05080943 -0.50189570 -0.81048565
 [37] -0.55802398 -2.22772196 -1.96244689  1.00864805  0.33439784  0.68315145
 [43] -0.35605206  0.93684282 -0.54189262  0.08047483 -1.09874765 -0.54946980
 [49]  0.93012130 -1.40409131 -0.70744971 -0.32931654 -0.95184734 -0.88102303
 [55]  0.26869024 -0.62921097 -0.57094455  0.44582992  2.74591559 -1.28185672
 [61] -0.59526787 -0.44190537 -0.27219934 -1.88543926 -0.93568572  1.59351609
 [67] -1.93828641  0.85408369 -0.48822218  0.14787633 -0.23288860 -0.53145045
 [73] -0.53721251 -0.16581793 -0.29973006  0.27418627  1.67824042  0.43650659
 [79]  1.01125212 -0.19661155  0.25523438  0.71779101 -0.68223037  0.43789706
 [85]  1.22592371 -0.43091255 -0.38866467  0.15131805 -0.09360314 -1.02829439
 [91] -0.53760760 -0.66268908  0.60778341 -0.86705959  0.23091341 -1.36555774
 [97] -1.25381945  1.09917625  0.65961206  0.70811120
> rowMin(tmp2)
  [1]  2.07902908  0.56174119  2.16004870  0.38865108  0.71710085  0.15747765
  [7]  0.99124326  1.65599851  1.37139379 -1.07703086 -2.55078439 -1.07709026
 [13]  0.25639103  1.42367645 -0.60272912 -0.89281195 -0.51371819 -0.95979526
 [19] -2.47862526  2.30743606 -0.95005211  1.37593337  0.44460191 -1.52102948
 [25] -1.13720014 -0.24854189 -1.04621226 -0.68839903  0.52472168 -1.00338353
 [31] -0.40317453 -1.01172503  0.56348499  0.05080943 -0.50189570 -0.81048565
 [37] -0.55802398 -2.22772196 -1.96244689  1.00864805  0.33439784  0.68315145
 [43] -0.35605206  0.93684282 -0.54189262  0.08047483 -1.09874765 -0.54946980
 [49]  0.93012130 -1.40409131 -0.70744971 -0.32931654 -0.95184734 -0.88102303
 [55]  0.26869024 -0.62921097 -0.57094455  0.44582992  2.74591559 -1.28185672
 [61] -0.59526787 -0.44190537 -0.27219934 -1.88543926 -0.93568572  1.59351609
 [67] -1.93828641  0.85408369 -0.48822218  0.14787633 -0.23288860 -0.53145045
 [73] -0.53721251 -0.16581793 -0.29973006  0.27418627  1.67824042  0.43650659
 [79]  1.01125212 -0.19661155  0.25523438  0.71779101 -0.68223037  0.43789706
 [85]  1.22592371 -0.43091255 -0.38866467  0.15131805 -0.09360314 -1.02829439
 [91] -0.53760760 -0.66268908  0.60778341 -0.86705959  0.23091341 -1.36555774
 [97] -1.25381945  1.09917625  0.65961206  0.70811120
> 
> colMeans(tmp2)
[1] -0.128027
> colSums(tmp2)
[1] -12.8027
> colVars(tmp2)
[1] 1.094301
> colSd(tmp2)
[1] 1.046089
> colMax(tmp2)
[1] 2.745916
> colMin(tmp2)
[1] -2.550784
> colMedians(tmp2)
[1] -0.3145233
> colRanges(tmp2)
          [,1]
[1,] -2.550784
[2,]  2.745916
> 
> 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] -3.3548951  2.9077472 -2.6423437  1.7978963 -0.1347771  0.0268736
 [7]  4.3442711 -1.8002008  3.2119279  1.5046002
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.7515836
[2,] -1.2744420
[3,] -0.2345374
[4,]  0.2952030
[5,]  1.5588559
> 
> rowApply(tmp,sum)
 [1]  3.7908300 -2.0018384  4.9735800  1.3142133 -1.5672813 -0.4253261
 [7] -1.2565787 -0.5359954 -0.3652973  1.9347937
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    8    3    1    3    4    8    1    2     9
 [2,]   10    2    8   10    9    2    2    9    6     2
 [3,]    1    6    4    4    2    6    7    7    4     4
 [4,]    4    9   10    6    4    9    5   10    3     6
 [5,]    7    4    2    2    6    5   10    5    5     7
 [6,]    5    7    5    9    5    1    3    8    1    10
 [7,]    3    5    9    8    7    3    6    6    9     8
 [8,]    6    1    1    7    8    8    4    3    7     1
 [9,]    2    3    6    5   10    7    9    4    8     3
[10,]    9   10    7    3    1   10    1    2   10     5
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.4120318 -1.9266539 -3.0261684 -1.6943031 -0.5520461 -0.4493792
 [7]  1.8339990 -4.5931764  2.3492289  1.3206100  1.3022670 -2.5092850
[13] -0.6084488  0.1604670  2.2234019 -0.2897372 -4.7302321 -0.4043329
[19] -0.3141137  1.7487962
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.7436980
[2,] -0.2590457
[3,]  0.2692601
[4,]  0.5593639
[5,]  0.5861515
> 
> rowApply(tmp,sum)
[1] -11.924341  -1.856646   6.426771  -5.319012   2.926153
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   10   12   11   17   15
[2,]   13   11   15    3    3
[3,]   11    6    3    5    9
[4,]    2    7   20    6    5
[5,]    8   10   12    2   19
> 
> 
> as.matrix(tmp)
           [,1]       [,2]        [,3]       [,4]       [,5]       [,6]
[1,] -0.7436980 -0.2263915 -0.72979955 -1.8436969 -0.9627755 -1.3537984
[2,] -0.2590457 -0.4221988 -0.66632184 -0.6404421 -0.4525203 -0.5070030
[3,]  0.2692601  0.9846897 -0.53476160  2.4476147  0.3627510 -0.3626058
[4,]  0.5593639 -1.1321783 -1.07936451 -1.0705258 -1.6193516  1.8220908
[5,]  0.5861515 -1.1305750 -0.01592088 -0.5872530  2.1198503 -0.0480628
           [,7]       [,8]        [,9]      [,10]      [,11]      [,12]
[1,]  0.9215772 -1.4867368 -0.19477971 -0.3084331  0.7826490  1.1269363
[2,]  0.1441994 -0.5847340 -0.04117836 -1.0933093  1.4373829 -0.1508847
[3,]  0.4822197  0.7135785  1.23895136  1.4286948 -0.2798853 -1.6053906
[4,] -0.1563572 -3.3552868  1.39553976  0.4679424 -0.1698365 -1.1021501
[5,]  0.4423599  0.1200028 -0.04930418  0.8257153 -0.4680430 -0.7777959
           [,13]      [,14]       [,15]      [,16]       [,17]      [,18]
[1,]  0.24173506 -2.4404679  0.52176776 -0.8705581 -1.50019893 -1.8261596
[2,] -1.27335241  2.6262974  1.77015584 -1.3292679  0.02943634  1.5392732
[3,]  0.04922986 -0.5107423 -0.09129066 -0.1205063 -1.76923222  0.1876032
[4,]  0.01908555 -0.2364762  0.03159761 -0.1825115 -0.31583489 -0.5158542
[5,]  0.35485319  0.7218560 -0.00882862  2.2131065 -1.17440243  0.2108046
         [,19]       [,20]
[1,] -1.119984  0.08847155
[2,] -1.216577 -0.76655523
[3,]  2.038762  1.49783064
[4,]  1.149372  0.17172395
[5,] -1.165687  0.75732528
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  624  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  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.19-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.8  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2       col3       col4        col5      col6      col7
row1 -1.461567 1.442306 -0.1844367 -0.6753881 -0.05446495 -1.826612 0.1230951
          col8      col9    col10      col11      col12     col13     col14
row1 -1.647105 -0.756616 -1.30385 -0.8640069 -0.3357482 0.2617637 -1.841947
          col15     col16       col17      col18      col19     col20
row1 -0.7685515 0.1567848 0.000484904 -0.3360629 -0.5546109 0.2335957
> tmp[,"col10"]
          col10
row1 -1.3038501
row2 -0.1086450
row3 -0.6728907
row4  0.5017439
row5 -1.3795073
> tmp[c("row1","row5"),]
          col1     col2       col3       col4        col5       col6      col7
row1 -1.461567 1.442306 -0.1844367 -0.6753881 -0.05446495 -1.8266122 0.1230951
row5  0.421360 1.412225 -1.8541977 -0.4416365  0.22737327  0.2133497 1.1689789
           col8      col9     col10      col11      col12      col13     col14
row1 -1.6471047 -0.756616 -1.303850 -0.8640069 -0.3357482  0.2617637 -1.841947
row5  0.3158185 -0.133859 -1.379507 -1.1779379 -0.9852829 -2.8874185 -2.670699
            col15     col16       col17      col18      col19     col20
row1 -0.768551482 0.1567848 0.000484904 -0.3360629 -0.5546109 0.2335957
row5  0.006858665 0.5033668 0.677140128 -0.5993274  0.4554286 1.1873880
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.8266122  0.23359566
row2  0.9688276 -0.49088081
row3 -0.9297702  1.29073830
row4 -0.2567671 -0.02323868
row5  0.2133497  1.18738804
> tmp[c("row1","row5"),c("col6","col20")]
           col6     col20
row1 -1.8266122 0.2335957
row5  0.2133497 1.1873880
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
         col1     col2     col3    col4     col5     col6     col7     col8
row1 50.04527 48.90174 51.72462 47.9559 49.65989 107.0109 48.87439 49.44602
         col9   col10    col11    col12    col13    col14    col15    col16
row1 50.54169 52.0285 50.90914 51.67146 50.79819 48.96218 50.06577 51.31393
        col17    col18    col19    col20
row1 49.64026 49.54687 49.76956 105.9395
> tmp[,"col10"]
        col10
row1 52.02850
row2 30.60456
row3 30.22374
row4 29.61892
row5 50.02148
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 50.04527 48.90174 51.72462 47.95590 49.65989 107.0109 48.87439 49.44602
row5 49.02776 48.76149 49.24390 49.02281 49.80739 102.7006 49.29621 50.57358
         col9    col10    col11    col12    col13    col14    col15    col16
row1 50.54169 52.02850 50.90914 51.67146 50.79819 48.96218 50.06577 51.31393
row5 49.64234 50.02148 50.27100 49.57961 48.68607 48.84103 48.18389 49.34856
        col17    col18    col19    col20
row1 49.64026 49.54687 49.76956 105.9395
row5 50.58914 49.51427 48.83641 105.9311
> tmp[,c("col6","col20")]
          col6     col20
row1 107.01093 105.93946
row2  74.99596  76.55213
row3  75.53868  73.97589
row4  75.59485  76.58713
row5 102.70060 105.93114
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 107.0109 105.9395
row5 102.7006 105.9311
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 107.0109 105.9395
row5 102.7006 105.9311
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
          col13
[1,]  0.8774821
[2,]  0.4405534
[3,] -0.7859441
[4,]  0.4270749
[5,] -1.7003735
> tmp[,c("col17","col7")]
          col17       col7
[1,] -0.6701610  0.6339371
[2,] -0.1435779  1.0472998
[3,]  2.2428444 -2.1470644
[4,]  1.4821399 -0.9627847
[5,] -0.8015051  1.2126704
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6       col20
[1,] -1.0603159 -0.05258727
[2,]  0.8199094 -1.04961632
[3,] -0.4441452  1.08387398
[4,] -0.1131516 -0.20930448
[5,]  0.9217924  1.10436560
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.060316
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
           col6
[1,] -1.0603159
[2,]  0.8199094
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
          [,1]       [,2]      [,3]      [,4]       [,5]     [,6]       [,7]
row3 0.3798746  0.2471807 -1.188012 -1.111802 -0.3541126 1.096140 -0.4460141
row1 0.5444476 -0.5970879  1.589119 -1.109343 -0.4586308 1.952988  0.1205747
            [,8]         [,9]      [,10]       [,11]     [,12]      [,13]
row3  0.06419481 -0.008859637 -1.0204021 -0.96519427 -1.069629 -2.3308326
row1 -1.42334927 -0.797898128 -0.9443915 -0.08642845  0.997603  0.7186506
           [,14]     [,15]      [,16]      [,17]     [,18]       [,19]
row3 -0.07378381 0.1164671 -0.9584683 0.09039053 1.4098381 1.594847611
row1  0.23246371 1.9563041  0.7505478 0.56997142 0.9497657 0.003491192
         [,20]
row3 0.3905983
row1 1.0139081
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
          [,1]      [,2]      [,3]       [,4]      [,5]      [,6]     [,7]
row2 0.1736785 0.7449902 0.2155801 0.04340018 -1.675289 0.5597072 2.483455
           [,8]    [,9]     [,10]
row2 -0.4376478 1.40628 -2.081108
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]       [,3]       [,4]     [,5]      [,6]       [,7]
row5 -1.157501 0.5818541 -0.7538188 -0.8014265 1.509608 -1.948772 -0.9879128
          [,8]       [,9]     [,10]     [,11]    [,12]     [,13]     [,14]
row5 -1.967571 -0.4499711 0.5233345 -2.964678 1.836942 -1.110311 -1.002638
          [,15]      [,16]      [,17]     [,18]      [,19]     [,20]
row5 -0.9766278 -0.8419015 -0.2858836 0.5249566 -0.6850887 0.7237888
> 
> 
> 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: 0x000001d306cfdcb0>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM53946e6faf0" 
 [2] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM539449344685"
 [3] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM5394be912a8" 
 [4] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM5394cd8796c" 
 [5] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM53944ef53679"
 [6] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM539459c16bde"
 [7] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM539465593e66"
 [8] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM539423f41d9b"
 [9] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM53947c5e5cdf"
[10] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM5394652e2e3d"
[11] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM53944ec954e7"
[12] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM53943a785479"
[13] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM53944f0d4b76"
[14] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM53947ffa5aa2"
[15] "F:/biocbuild/bbs-3.19-bioc/meat/BufferedMatrix.Rcheck/tests\\BM539441bf481c"
> 
> 
> ### 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: 0x000001d3093ff7d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x000001d3093ff7d0>
Warning message:
In dir.create(new.directory) :
  'F:\biocbuild\bbs-3.19-bioc\meat\BufferedMatrix.Rcheck\tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x000001d3093ff7d0>
> rowMedians(tmp)
  [1]  0.229605395  0.103812856  0.336885321  0.498222287 -0.151075953
  [6]  0.261904386  0.062212911 -0.008532495 -0.418463911 -0.558868459
 [11] -0.038943666 -0.625941815 -0.216143571 -0.047448389 -0.204923510
 [16]  0.299810555  0.017195504 -0.604990371 -0.018561216 -0.217400677
 [21]  0.073946618  0.044356953 -0.223036722  0.144731185 -0.114598023
 [26]  0.032343302  0.467985701 -0.277283319  0.264713833 -0.150511812
 [31]  0.406296913 -0.048873895 -0.455418046  0.177812898  0.413247776
 [36]  0.340318688  0.235307563  0.330247805 -0.099863663 -0.246118846
 [41] -0.101866154 -0.340647256  0.278349542  0.058539909 -0.311249868
 [46]  0.482454155 -0.590548490 -0.224387328 -0.427329739  0.031629259
 [51]  0.475284795  0.296562438 -0.570564021  0.265756705 -0.029624982
 [56] -0.118723252 -0.213720835 -0.161201941  0.176201485 -0.005365339
 [61] -0.008853854 -0.224343611  0.087115653 -0.345569104 -0.354633746
 [66]  0.315262929  0.157656190 -0.084049409 -0.313410064 -0.254687779
 [71] -0.114916213 -0.031209068 -0.449236837 -1.154827287 -0.218163549
 [76] -0.585537563 -0.493036462 -0.016336831 -0.085969317 -0.352392381
 [81] -0.102025010 -0.072858817 -0.073196983  0.127933526 -0.003702985
 [86]  0.141179223  0.038163162  0.186469682  0.790561545  0.022540665
 [91] -0.197157528  0.228305590  0.086036962  0.055130202 -0.116662041
 [96]  0.003113986  0.275158053  0.398996654  0.219509277  0.154689173
[101] -0.055193720  0.658043188  0.178105293  0.119680348  0.131396408
[106] -0.045112393  0.617898151 -0.120111707  0.131787249 -0.060685709
[111] -0.469508454  0.027186021 -0.333155645 -0.041290849 -0.712732163
[116]  0.041784957 -0.559294941 -0.132683898 -0.187017270 -0.517842044
[121] -0.576912100  0.038892511 -0.539992384  0.089800049  0.559857419
[126]  0.068007630  0.010543665 -0.237871053  0.237340378 -0.209112706
[131] -0.231609311  0.402835406 -0.307044336  0.482356714  0.335907905
[136]  0.409589854 -0.166995280  0.072284550  0.425590815 -0.498749768
[141] -0.208862678  0.355744820 -0.232683599 -0.076101793  0.207640907
[146]  0.502546978  0.174068874  0.117778685  0.579617348  0.034394753
[151]  0.280216154 -0.022615403  0.147974893 -0.455289764  0.198304583
[156] -0.600797059  0.041154994  0.627290120 -0.060236052  0.417816537
[161] -0.363607569 -0.120620620 -0.099196994  0.033314313  0.043224487
[166]  0.029549498 -0.246341509 -0.105175389 -0.071628221 -0.303446371
[171]  0.107020075  0.160822117 -0.150571341 -0.748226709 -0.223015510
[176]  0.529244684  0.376741130 -0.246475757  0.289842966 -0.240346425
[181]  0.425193893 -0.286648903  0.245376083 -0.134638038  0.275116393
[186] -0.077782246  0.151215453 -0.071449870 -0.005712080 -0.116033268
[191] -0.452950792  0.089252534  0.434783423  0.118528748 -0.494337297
[196]  0.035477465  0.289738555  0.005333214 -0.072114779 -0.146700763
[201] -0.403378239 -0.239149236 -0.171666681  0.388095172  0.073725177
[206]  0.349635087 -0.338715907 -0.305908614 -0.523174747 -0.408987128
[211]  0.521996699  0.379441220 -0.416758310 -0.082954761  0.065892546
[216] -0.481951564 -0.049167389  0.420329555  0.004056013 -0.019517159
[221] -0.052780381  0.092476367  0.505363582  0.404538921 -0.481628728
[226]  0.417139921 -0.011170753  0.260480881 -0.189260599  0.396023506
> 
> proc.time()
   user  system elapsed 
   3.90   21.28   48.70 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


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

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x00000213b38fd830>
> .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: 0x00000213b38fd830>
> .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: 0x00000213b38fd830>
> .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: 0x00000213b38fd830>
> 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: 0x00000213b38fda70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000213b38fda70>
> .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: 0x00000213b38fda70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000213b38fda70>
> .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: 0x00000213b38fda70>
> 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: 0x00000213b38fd170>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000213b38fd170>
> .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: 0x00000213b38fd170>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000213b38fd170>
> .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: 0x00000213b38fd170>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x00000213b38fd170>
> .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: 0x00000213b38fd170>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x00000213b38fd170>
> .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: 0x00000213b38fd170>
> 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: 0x00000213b38fd1d0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x00000213b38fd1d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000213b38fd1d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000213b38fd1d0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec6869d57deb" "BufferedMatrixFilec686ffd4aad"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec6869d57deb" "BufferedMatrixFilec686ffd4aad"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000213b38fd6b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000213b38fd6b0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000213b38fd6b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x00000213b38fd6b0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x00000213b38fd6b0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x00000213b38fd6b0>
> .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: 0x00000213b38fd230>
> .Call("R_bm_AddColumn",P)
<pointer: 0x00000213b38fd230>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x00000213b38fd230>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x00000213b38fd230>
> 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: 0x00000213b38fdad0>
> .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: 0x00000213b38fdad0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
   0.37    0.15    0.90 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


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

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
   0.34    0.10    0.84 

Example timings