Back to Mac ARM64 build report for BioC 3.20
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2024-05-13 11:32:01 -0400 (Mon, 13 May 2024).

HostnameOSArch (*)R versionInstalled pkgs
kjohnson1macOS 13.6.6 Venturaarm644.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" 4378
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 244/2230HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.69.0  (landing page)
Ben Bolstad
Snapshot Date: 2024-05-11 09:00:03 -0400 (Sat, 11 May 2024)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: d422a05
git_last_commit_date: 2024-04-30 10:16:21 -0400 (Tue, 30 Apr 2024)
kjohnson1macOS 13.6.6 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published

CHECK results for BufferedMatrix on kjohnson1


To the developers/maintainers of the BufferedMatrix package:
- Use the following Renviron settings to reproduce errors and warnings.
- If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information.

raw results


Summary

Package: BufferedMatrix
Version: 1.69.0
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz
StartedAt: 2024-05-12 07:19:20 -0400 (Sun, 12 May 2024)
EndedAt: 2024-05-12 07:20:01 -0400 (Sun, 12 May 2024)
EllapsedTime: 41.1 seconds
RetCode: 0
Status:   WARNINGS  
CheckDir: BufferedMatrix.Rcheck
Warnings: 1

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck’
* using R version 4.4.0 Patched (2024-04-24 r86482)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Ventura 13.6.6
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.69.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... WARNING
Found the following significant warnings:
  doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
* used SDK: ‘MacOSX11.3.sdk’
* 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 is not available
* 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: 1 WARNING, 2 NOTEs
See
  ‘/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
using SDK: ‘MacOSX11.3.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
  if (!(Matrix->readonly) & setting){
      ^                   ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
  if (!(Matrix->readonly) & setting){
      ^
       (                           )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
  if (!(Matrix->readonly) & setting){
      ^
      (                  )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
           ^
2 warnings generated.
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init_package.c -o init_package.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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.341   0.113   0.439 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/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) limit (Mb) max used (Mb)
Ncells 474155 25.4    1035431 55.3         NA   638594 34.2
Vcells 877595  6.7    8388608 64.0      65536  2072093 15.9
> 
> 
> 
> 
> ##
> ## 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] "Sun May 12 07:19:41 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] "Sun May 12 07:19:42 2024"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x600000924de0>
> 
> 
> 
> 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] "Sun May 12 07:19:44 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] "Sun May 12 07:19:45 2024"
> 
> ColMode(tmp2)
<pointer: 0x600000924de0>
> 
> 
> 
> ### 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.7638653  0.2322128 -0.6683061  0.7087083
[2,] -0.2850386 -1.5763104 -1.2433750 -0.5564015
[3,]  0.3524517 -0.7220167 -0.2886663 -0.3412316
[4,]  0.5423588 -0.2217446 -1.2243379 -0.3443694
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 99.7638653 0.2322128 0.6683061 0.7087083
[2,]  0.2850386 1.5763104 1.2433750 0.5564015
[3,]  0.3524517 0.7220167 0.2886663 0.3412316
[4,]  0.5423588 0.2217446 1.2243379 0.3443694
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]      [,3]      [,4]
[1,] 9.9881863 0.4818846 0.8174999 0.8418481
[2,] 0.5338901 1.2555120 1.1150672 0.7459232
[3,] 0.5936765 0.8497156 0.5372768 0.5841503
[4,] 0.7364501 0.4708976 1.1064980 0.5868300
> 
> 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:    /Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 224.64573 30.05106 33.84330 34.12719
[2,]  30.62394 39.13143 37.39405 33.01563
[3,]  31.28922 34.21917 30.66143 31.18273
[4,]  32.90686 29.93072 37.28932 31.21267
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000920300>
> exp(tmp5)
<pointer: 0x600000920300>
> log(tmp5,2)
<pointer: 0x600000920300>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.5707
> Min(tmp5)
[1] 53.53179
> mean(tmp5)
[1] 72.55531
> Sum(tmp5)
[1] 14511.06
> Var(tmp5)
[1] 855.0762
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 88.40894 71.63433 67.19086 71.37072 68.42241 71.31171 70.98499 69.47739
 [9] 74.18422 72.56757
> rowSums(tmp5)
 [1] 1768.179 1432.687 1343.817 1427.414 1368.448 1426.234 1419.700 1389.548
 [9] 1483.684 1451.351
> rowVars(tmp5)
 [1] 8034.51921   67.10586   85.08150   60.25418   72.41790   51.01589
 [7]   47.61123   60.82011   80.78291   63.99326
> rowSd(tmp5)
 [1] 89.635480  8.191816  9.223963  7.762357  8.509871  7.142541  6.900089
 [8]  7.798725  8.987931  7.999578
> rowMax(tmp5)
 [1] 467.57065  82.83071  83.25876  84.69741  83.71307  80.57102  82.91133
 [8]  81.78271  97.52831  87.86672
> rowMin(tmp5)
 [1] 57.76671 55.61954 53.53179 55.13362 55.62775 55.17357 60.28841 53.83625
 [9] 59.28661 56.44761
> 
> colMeans(tmp5)
 [1] 108.66067  69.29462  72.68968  69.91772  70.54663  67.18249  71.29359
 [8]  71.38099  69.95386  66.29194  73.07098  69.88401  68.99978  68.20355
[15]  68.89237  73.42061  74.75432  70.98456  72.99933  72.68460
> colSums(tmp5)
 [1] 1086.6067  692.9462  726.8968  699.1772  705.4663  671.8249  712.9359
 [8]  713.8099  699.5386  662.9194  730.7098  698.8401  689.9978  682.0355
[15]  688.9237  734.2061  747.5432  709.8456  729.9933  726.8460
> colVars(tmp5)
 [1] 15954.08002    64.83610    54.88486    21.72031    79.73307    91.23174
 [7]    62.46943    52.22303    71.54814    94.95494   104.41967    40.58651
[13]    53.39065    70.55667    56.75991    87.42264   154.26094    76.65369
[19]    28.28331    60.29460
> colSd(tmp5)
 [1] 126.309461   8.052087   7.408431   4.660505   8.929338   9.551531
 [7]   7.903761   7.226550   8.458613   9.744483  10.218594   6.370754
[13]   7.306890   8.399802   7.533917   9.350008  12.420183   8.755209
[19]   5.318205   7.764960
> colMax(tmp5)
 [1] 467.57065  81.44695  87.86672  78.58688  82.91133  83.25876  82.83071
 [8]  81.28834  80.57102  80.12242  88.70271  77.30901  80.50335  81.89004
[15]  83.71307  86.45137  97.52831  81.07871  80.27076  81.24549
> colMin(tmp5)
 [1] 59.03543 53.83625 63.81776 64.90278 57.84205 55.13362 57.76671 58.21532
 [9] 57.46436 55.35693 61.74853 57.31316 59.74253 55.07389 56.44761 54.99593
[17] 57.22623 55.17357 63.14727 53.53179
> 
> 
> ### 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] 88.40894 71.63433 67.19086 71.37072 68.42241 71.31171 70.98499 69.47739
 [9]       NA 72.56757
> rowSums(tmp5)
 [1] 1768.179 1432.687 1343.817 1427.414 1368.448 1426.234 1419.700 1389.548
 [9]       NA 1451.351
> rowVars(tmp5)
 [1] 8034.51921   67.10586   85.08150   60.25418   72.41790   51.01589
 [7]   47.61123   60.82011   84.54638   63.99326
> rowSd(tmp5)
 [1] 89.635480  8.191816  9.223963  7.762357  8.509871  7.142541  6.900089
 [8]  7.798725  9.194910  7.999578
> rowMax(tmp5)
 [1] 467.57065  82.83071  83.25876  84.69741  83.71307  80.57102  82.91133
 [8]  81.78271        NA  87.86672
> rowMin(tmp5)
 [1] 57.76671 55.61954 53.53179 55.13362 55.62775 55.17357 60.28841 53.83625
 [9]       NA 56.44761
> 
> colMeans(tmp5)
 [1] 108.66067  69.29462  72.68968  69.91772  70.54663  67.18249  71.29359
 [8]  71.38099  69.95386  66.29194  73.07098        NA  68.99978  68.20355
[15]  68.89237  73.42061  74.75432  70.98456  72.99933  72.68460
> colSums(tmp5)
 [1] 1086.6067  692.9462  726.8968  699.1772  705.4663  671.8249  712.9359
 [8]  713.8099  699.5386  662.9194  730.7098        NA  689.9978  682.0355
[15]  688.9237  734.2061  747.5432  709.8456  729.9933  726.8460
> colVars(tmp5)
 [1] 15954.08002    64.83610    54.88486    21.72031    79.73307    91.23174
 [7]    62.46943    52.22303    71.54814    94.95494   104.41967          NA
[13]    53.39065    70.55667    56.75991    87.42264   154.26094    76.65369
[19]    28.28331    60.29460
> colSd(tmp5)
 [1] 126.309461   8.052087   7.408431   4.660505   8.929338   9.551531
 [7]   7.903761   7.226550   8.458613   9.744483  10.218594         NA
[13]   7.306890   8.399802   7.533917   9.350008  12.420183   8.755209
[19]   5.318205   7.764960
> colMax(tmp5)
 [1] 467.57065  81.44695  87.86672  78.58688  82.91133  83.25876  82.83071
 [8]  81.28834  80.57102  80.12242  88.70271        NA  80.50335  81.89004
[15]  83.71307  86.45137  97.52831  81.07871  80.27076  81.24549
> colMin(tmp5)
 [1] 59.03543 53.83625 63.81776 64.90278 57.84205 55.13362 57.76671 58.21532
 [9] 57.46436 55.35693 61.74853       NA 59.74253 55.07389 56.44761 54.99593
[17] 57.22623 55.17357 63.14727 53.53179
> 
> Max(tmp5,na.rm=TRUE)
[1] 467.5707
> Min(tmp5,na.rm=TRUE)
[1] 53.53179
> mean(tmp5,na.rm=TRUE)
[1] 72.56482
> Sum(tmp5,na.rm=TRUE)
[1] 14440.4
> Var(tmp5,na.rm=TRUE)
[1] 859.3767
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.40894 71.63433 67.19086 71.37072 68.42241 71.31171 70.98499 69.47739
 [9] 74.36947 72.56757
> rowSums(tmp5,na.rm=TRUE)
 [1] 1768.179 1432.687 1343.817 1427.414 1368.448 1426.234 1419.700 1389.548
 [9] 1413.020 1451.351
> rowVars(tmp5,na.rm=TRUE)
 [1] 8034.51921   67.10586   85.08150   60.25418   72.41790   51.01589
 [7]   47.61123   60.82011   84.54638   63.99326
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.635480  8.191816  9.223963  7.762357  8.509871  7.142541  6.900089
 [8]  7.798725  9.194910  7.999578
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.57065  82.83071  83.25876  84.69741  83.71307  80.57102  82.91133
 [8]  81.78271  97.52831  87.86672
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.76671 55.61954 53.53179 55.13362 55.62775 55.17357 60.28841 53.83625
 [9] 59.28661 56.44761
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 108.66067  69.29462  72.68968  69.91772  70.54663  67.18249  71.29359
 [8]  71.38099  69.95386  66.29194  73.07098  69.79729  68.99978  68.20355
[15]  68.89237  73.42061  74.75432  70.98456  72.99933  72.68460
> colSums(tmp5,na.rm=TRUE)
 [1] 1086.6067  692.9462  726.8968  699.1772  705.4663  671.8249  712.9359
 [8]  713.8099  699.5386  662.9194  730.7098  628.1756  689.9978  682.0355
[15]  688.9237  734.2061  747.5432  709.8456  729.9933  726.8460
> colVars(tmp5,na.rm=TRUE)
 [1] 15954.08002    64.83610    54.88486    21.72031    79.73307    91.23174
 [7]    62.46943    52.22303    71.54814    94.95494   104.41967    45.57522
[13]    53.39065    70.55667    56.75991    87.42264   154.26094    76.65369
[19]    28.28331    60.29460
> colSd(tmp5,na.rm=TRUE)
 [1] 126.309461   8.052087   7.408431   4.660505   8.929338   9.551531
 [7]   7.903761   7.226550   8.458613   9.744483  10.218594   6.750942
[13]   7.306890   8.399802   7.533917   9.350008  12.420183   8.755209
[19]   5.318205   7.764960
> colMax(tmp5,na.rm=TRUE)
 [1] 467.57065  81.44695  87.86672  78.58688  82.91133  83.25876  82.83071
 [8]  81.28834  80.57102  80.12242  88.70271  77.30901  80.50335  81.89004
[15]  83.71307  86.45137  97.52831  81.07871  80.27076  81.24549
> colMin(tmp5,na.rm=TRUE)
 [1] 59.03543 53.83625 63.81776 64.90278 57.84205 55.13362 57.76671 58.21532
 [9] 57.46436 55.35693 61.74853 57.31316 59.74253 55.07389 56.44761 54.99593
[17] 57.22623 55.17357 63.14727 53.53179
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 88.40894 71.63433 67.19086 71.37072 68.42241 71.31171 70.98499 69.47739
 [9]      NaN 72.56757
> rowSums(tmp5,na.rm=TRUE)
 [1] 1768.179 1432.687 1343.817 1427.414 1368.448 1426.234 1419.700 1389.548
 [9]    0.000 1451.351
> rowVars(tmp5,na.rm=TRUE)
 [1] 8034.51921   67.10586   85.08150   60.25418   72.41790   51.01589
 [7]   47.61123   60.82011         NA   63.99326
> rowSd(tmp5,na.rm=TRUE)
 [1] 89.635480  8.191816  9.223963  7.762357  8.509871  7.142541  6.900089
 [8]  7.798725        NA  7.999578
> rowMax(tmp5,na.rm=TRUE)
 [1] 467.57065  82.83071  83.25876  84.69741  83.71307  80.57102  82.91133
 [8]  81.78271        NA  87.86672
> rowMin(tmp5,na.rm=TRUE)
 [1] 57.76671 55.61954 53.53179 55.13362 55.62775 55.17357 60.28841 53.83625
 [9]       NA 56.44761
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 112.86639  68.40130  72.72852  70.21046  70.40141  65.96813  71.64249
 [8]  70.67875  70.60095  67.07031  71.33412       NaN  69.94222  66.68283
[15]  68.14091  73.81649  72.22388  70.21483  72.73781  72.02742
> colSums(tmp5,na.rm=TRUE)
 [1] 1015.7975  615.6117  654.5567  631.8941  633.6127  593.7132  644.7824
 [8]  636.1088  635.4086  603.6328  642.0071    0.0000  629.4800  600.1455
[15]  613.2682  664.3484  650.0149  631.9335  654.6403  648.2468
> colVars(tmp5,na.rm=TRUE)
 [1] 17749.34849    63.96292    61.72849    23.47130    89.46246    86.04561
 [7]    68.90860    53.20312    75.78091   100.00838    83.53449          NA
[13]    50.07234    53.35958    57.50202    96.58733   101.50818    79.56989
[19]    31.04930    62.97270
> colSd(tmp5,na.rm=TRUE)
 [1] 133.226681   7.997682   7.856748   4.844719   9.458460   9.276077
 [7]   8.301120   7.294047   8.705223  10.000419   9.139720         NA
[13]   7.076181   7.304764   7.583009   9.827885  10.075127   8.920196
[19]   5.572190   7.935534
> colMax(tmp5,na.rm=TRUE)
 [1] 467.57065  81.44695  87.86672  78.58688  82.91133  83.25876  82.83071
 [8]  81.28834  80.57102  80.12242  85.51994      -Inf  80.50335  76.96240
[15]  83.71307  86.45137  84.69741  81.07871  80.27076  81.24549
> colMin(tmp5,na.rm=TRUE)
 [1] 59.03543 53.83625 63.81776 64.90278 57.84205 55.13362 57.76671 58.21532
 [9] 57.46436 55.35693 61.74853      Inf 59.74253 55.07389 56.44761 54.99593
[17] 57.22623 55.17357 63.14727 53.53179
> 
> 
> 
> 
> 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] 249.8154 348.1567 292.7165 236.7767 163.5545 259.6255 225.3899 200.2870
 [9] 273.7990 219.0467
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 249.8154 348.1567 292.7165 236.7767 163.5545 259.6255 225.3899 200.2870
 [9] 273.7990 219.0467
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -5.684342e-14  2.842171e-14 -2.273737e-13 -2.273737e-13 -8.526513e-14
 [6]  0.000000e+00 -2.273737e-13  1.421085e-13 -1.421085e-14 -8.526513e-14
[11]  0.000000e+00  5.684342e-14 -5.684342e-14 -2.842171e-14 -2.273737e-13
[16]  0.000000e+00  0.000000e+00  7.105427e-14  0.000000e+00  5.684342e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
10   2 
5   9 
9   11 
3   19 
3   14 
2   15 
4   10 
1   18 
9   12 
3   8 
3   1 
6   12 
2   15 
6   6 
4   11 
6   6 
4   6 
3   5 
10   8 
3   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.807802
> Min(tmp)
[1] -2.556584
> mean(tmp)
[1] -0.03283804
> Sum(tmp)
[1] -3.283804
> Var(tmp)
[1] 0.9904742
> 
> rowMeans(tmp)
[1] -0.03283804
> rowSums(tmp)
[1] -3.283804
> rowVars(tmp)
[1] 0.9904742
> rowSd(tmp)
[1] 0.9952257
> rowMax(tmp)
[1] 2.807802
> rowMin(tmp)
[1] -2.556584
> 
> colMeans(tmp)
  [1]  0.034209836 -0.026947381 -1.674826783  0.782501137 -1.012765763
  [6]  1.139400240  1.748005666 -0.298918678 -0.682935312  0.707682478
 [11]  0.636792825 -1.169740323 -0.881330320 -0.154920406 -0.075581804
 [16] -1.605471700  1.480898130 -1.210604267  0.449220000  0.696027570
 [21] -0.694824586 -0.513590008 -0.170011797  2.807801987 -0.831235819
 [26]  0.718420475 -1.032201065  0.340100030  0.287824626 -1.123872091
 [31] -0.834021804  0.231094953  1.533131962  0.620095164  0.482682516
 [36]  1.306266306  1.419670684 -0.859495287  0.513178766 -0.313460805
 [41]  0.473443279  0.311442594 -0.949503327  0.421015936  0.913440647
 [46] -0.469407936 -0.461046034  0.312890026 -0.658316623  0.008941458
 [51] -0.806778602 -0.318705867  0.671732535  1.312480845 -1.387111149
 [56]  0.990427057  0.923540008 -0.147057185  0.911851962  0.196367766
 [61]  0.558894552  0.028925825 -0.073426149  1.100871092  0.968678955
 [66]  0.593355754 -0.020767563  1.080245973  1.165984060 -0.675650817
 [71] -1.857680224  0.134581902 -2.048055574  0.929615791  0.141771827
 [76] -1.112535305  0.707581684  0.641189189 -0.797502322 -1.139520014
 [81] -1.508948525  1.030736749  0.901351771 -0.081110494  0.954460151
 [86]  0.238744584 -0.847182904 -0.283584323 -0.367298997 -0.015540629
 [91] -2.527668709 -1.810129486 -1.067554766 -1.101391198  0.933573373
 [96]  0.861409867 -2.556583624 -1.471268313  0.410384194 -0.320658585
> colSums(tmp)
  [1]  0.034209836 -0.026947381 -1.674826783  0.782501137 -1.012765763
  [6]  1.139400240  1.748005666 -0.298918678 -0.682935312  0.707682478
 [11]  0.636792825 -1.169740323 -0.881330320 -0.154920406 -0.075581804
 [16] -1.605471700  1.480898130 -1.210604267  0.449220000  0.696027570
 [21] -0.694824586 -0.513590008 -0.170011797  2.807801987 -0.831235819
 [26]  0.718420475 -1.032201065  0.340100030  0.287824626 -1.123872091
 [31] -0.834021804  0.231094953  1.533131962  0.620095164  0.482682516
 [36]  1.306266306  1.419670684 -0.859495287  0.513178766 -0.313460805
 [41]  0.473443279  0.311442594 -0.949503327  0.421015936  0.913440647
 [46] -0.469407936 -0.461046034  0.312890026 -0.658316623  0.008941458
 [51] -0.806778602 -0.318705867  0.671732535  1.312480845 -1.387111149
 [56]  0.990427057  0.923540008 -0.147057185  0.911851962  0.196367766
 [61]  0.558894552  0.028925825 -0.073426149  1.100871092  0.968678955
 [66]  0.593355754 -0.020767563  1.080245973  1.165984060 -0.675650817
 [71] -1.857680224  0.134581902 -2.048055574  0.929615791  0.141771827
 [76] -1.112535305  0.707581684  0.641189189 -0.797502322 -1.139520014
 [81] -1.508948525  1.030736749  0.901351771 -0.081110494  0.954460151
 [86]  0.238744584 -0.847182904 -0.283584323 -0.367298997 -0.015540629
 [91] -2.527668709 -1.810129486 -1.067554766 -1.101391198  0.933573373
 [96]  0.861409867 -2.556583624 -1.471268313  0.410384194 -0.320658585
> 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.034209836 -0.026947381 -1.674826783  0.782501137 -1.012765763
  [6]  1.139400240  1.748005666 -0.298918678 -0.682935312  0.707682478
 [11]  0.636792825 -1.169740323 -0.881330320 -0.154920406 -0.075581804
 [16] -1.605471700  1.480898130 -1.210604267  0.449220000  0.696027570
 [21] -0.694824586 -0.513590008 -0.170011797  2.807801987 -0.831235819
 [26]  0.718420475 -1.032201065  0.340100030  0.287824626 -1.123872091
 [31] -0.834021804  0.231094953  1.533131962  0.620095164  0.482682516
 [36]  1.306266306  1.419670684 -0.859495287  0.513178766 -0.313460805
 [41]  0.473443279  0.311442594 -0.949503327  0.421015936  0.913440647
 [46] -0.469407936 -0.461046034  0.312890026 -0.658316623  0.008941458
 [51] -0.806778602 -0.318705867  0.671732535  1.312480845 -1.387111149
 [56]  0.990427057  0.923540008 -0.147057185  0.911851962  0.196367766
 [61]  0.558894552  0.028925825 -0.073426149  1.100871092  0.968678955
 [66]  0.593355754 -0.020767563  1.080245973  1.165984060 -0.675650817
 [71] -1.857680224  0.134581902 -2.048055574  0.929615791  0.141771827
 [76] -1.112535305  0.707581684  0.641189189 -0.797502322 -1.139520014
 [81] -1.508948525  1.030736749  0.901351771 -0.081110494  0.954460151
 [86]  0.238744584 -0.847182904 -0.283584323 -0.367298997 -0.015540629
 [91] -2.527668709 -1.810129486 -1.067554766 -1.101391198  0.933573373
 [96]  0.861409867 -2.556583624 -1.471268313  0.410384194 -0.320658585
> colMin(tmp)
  [1]  0.034209836 -0.026947381 -1.674826783  0.782501137 -1.012765763
  [6]  1.139400240  1.748005666 -0.298918678 -0.682935312  0.707682478
 [11]  0.636792825 -1.169740323 -0.881330320 -0.154920406 -0.075581804
 [16] -1.605471700  1.480898130 -1.210604267  0.449220000  0.696027570
 [21] -0.694824586 -0.513590008 -0.170011797  2.807801987 -0.831235819
 [26]  0.718420475 -1.032201065  0.340100030  0.287824626 -1.123872091
 [31] -0.834021804  0.231094953  1.533131962  0.620095164  0.482682516
 [36]  1.306266306  1.419670684 -0.859495287  0.513178766 -0.313460805
 [41]  0.473443279  0.311442594 -0.949503327  0.421015936  0.913440647
 [46] -0.469407936 -0.461046034  0.312890026 -0.658316623  0.008941458
 [51] -0.806778602 -0.318705867  0.671732535  1.312480845 -1.387111149
 [56]  0.990427057  0.923540008 -0.147057185  0.911851962  0.196367766
 [61]  0.558894552  0.028925825 -0.073426149  1.100871092  0.968678955
 [66]  0.593355754 -0.020767563  1.080245973  1.165984060 -0.675650817
 [71] -1.857680224  0.134581902 -2.048055574  0.929615791  0.141771827
 [76] -1.112535305  0.707581684  0.641189189 -0.797502322 -1.139520014
 [81] -1.508948525  1.030736749  0.901351771 -0.081110494  0.954460151
 [86]  0.238744584 -0.847182904 -0.283584323 -0.367298997 -0.015540629
 [91] -2.527668709 -1.810129486 -1.067554766 -1.101391198  0.933573373
 [96]  0.861409867 -2.556583624 -1.471268313  0.410384194 -0.320658585
> colMedians(tmp)
  [1]  0.034209836 -0.026947381 -1.674826783  0.782501137 -1.012765763
  [6]  1.139400240  1.748005666 -0.298918678 -0.682935312  0.707682478
 [11]  0.636792825 -1.169740323 -0.881330320 -0.154920406 -0.075581804
 [16] -1.605471700  1.480898130 -1.210604267  0.449220000  0.696027570
 [21] -0.694824586 -0.513590008 -0.170011797  2.807801987 -0.831235819
 [26]  0.718420475 -1.032201065  0.340100030  0.287824626 -1.123872091
 [31] -0.834021804  0.231094953  1.533131962  0.620095164  0.482682516
 [36]  1.306266306  1.419670684 -0.859495287  0.513178766 -0.313460805
 [41]  0.473443279  0.311442594 -0.949503327  0.421015936  0.913440647
 [46] -0.469407936 -0.461046034  0.312890026 -0.658316623  0.008941458
 [51] -0.806778602 -0.318705867  0.671732535  1.312480845 -1.387111149
 [56]  0.990427057  0.923540008 -0.147057185  0.911851962  0.196367766
 [61]  0.558894552  0.028925825 -0.073426149  1.100871092  0.968678955
 [66]  0.593355754 -0.020767563  1.080245973  1.165984060 -0.675650817
 [71] -1.857680224  0.134581902 -2.048055574  0.929615791  0.141771827
 [76] -1.112535305  0.707581684  0.641189189 -0.797502322 -1.139520014
 [81] -1.508948525  1.030736749  0.901351771 -0.081110494  0.954460151
 [86]  0.238744584 -0.847182904 -0.283584323 -0.367298997 -0.015540629
 [91] -2.527668709 -1.810129486 -1.067554766 -1.101391198  0.933573373
 [96]  0.861409867 -2.556583624 -1.471268313  0.410384194 -0.320658585
> colRanges(tmp)
           [,1]        [,2]      [,3]      [,4]      [,5]   [,6]     [,7]
[1,] 0.03420984 -0.02694738 -1.674827 0.7825011 -1.012766 1.1394 1.748006
[2,] 0.03420984 -0.02694738 -1.674827 0.7825011 -1.012766 1.1394 1.748006
           [,8]       [,9]     [,10]     [,11]    [,12]      [,13]      [,14]
[1,] -0.2989187 -0.6829353 0.7076825 0.6367928 -1.16974 -0.8813303 -0.1549204
[2,] -0.2989187 -0.6829353 0.7076825 0.6367928 -1.16974 -0.8813303 -0.1549204
          [,15]     [,16]    [,17]     [,18]   [,19]     [,20]      [,21]
[1,] -0.0755818 -1.605472 1.480898 -1.210604 0.44922 0.6960276 -0.6948246
[2,] -0.0755818 -1.605472 1.480898 -1.210604 0.44922 0.6960276 -0.6948246
        [,22]      [,23]    [,24]      [,25]     [,26]     [,27]  [,28]
[1,] -0.51359 -0.1700118 2.807802 -0.8312358 0.7184205 -1.032201 0.3401
[2,] -0.51359 -0.1700118 2.807802 -0.8312358 0.7184205 -1.032201 0.3401
         [,29]     [,30]      [,31]    [,32]    [,33]     [,34]     [,35]
[1,] 0.2878246 -1.123872 -0.8340218 0.231095 1.533132 0.6200952 0.4826825
[2,] 0.2878246 -1.123872 -0.8340218 0.231095 1.533132 0.6200952 0.4826825
        [,36]    [,37]      [,38]     [,39]      [,40]     [,41]     [,42]
[1,] 1.306266 1.419671 -0.8594953 0.5131788 -0.3134608 0.4734433 0.3114426
[2,] 1.306266 1.419671 -0.8594953 0.5131788 -0.3134608 0.4734433 0.3114426
          [,43]     [,44]     [,45]      [,46]     [,47]   [,48]      [,49]
[1,] -0.9495033 0.4210159 0.9134406 -0.4694079 -0.461046 0.31289 -0.6583166
[2,] -0.9495033 0.4210159 0.9134406 -0.4694079 -0.461046 0.31289 -0.6583166
           [,50]      [,51]      [,52]     [,53]    [,54]     [,55]     [,56]
[1,] 0.008941458 -0.8067786 -0.3187059 0.6717325 1.312481 -1.387111 0.9904271
[2,] 0.008941458 -0.8067786 -0.3187059 0.6717325 1.312481 -1.387111 0.9904271
       [,57]      [,58]    [,59]     [,60]     [,61]      [,62]       [,63]
[1,] 0.92354 -0.1470572 0.911852 0.1963678 0.5588946 0.02892582 -0.07342615
[2,] 0.92354 -0.1470572 0.911852 0.1963678 0.5588946 0.02892582 -0.07342615
        [,64]    [,65]     [,66]       [,67]    [,68]    [,69]      [,70]
[1,] 1.100871 0.968679 0.5933558 -0.02076756 1.080246 1.165984 -0.6756508
[2,] 1.100871 0.968679 0.5933558 -0.02076756 1.080246 1.165984 -0.6756508
        [,71]     [,72]     [,73]     [,74]     [,75]     [,76]     [,77]
[1,] -1.85768 0.1345819 -2.048056 0.9296158 0.1417718 -1.112535 0.7075817
[2,] -1.85768 0.1345819 -2.048056 0.9296158 0.1417718 -1.112535 0.7075817
         [,78]      [,79]    [,80]     [,81]    [,82]     [,83]       [,84]
[1,] 0.6411892 -0.7975023 -1.13952 -1.508949 1.030737 0.9013518 -0.08111049
[2,] 0.6411892 -0.7975023 -1.13952 -1.508949 1.030737 0.9013518 -0.08111049
         [,85]     [,86]      [,87]      [,88]     [,89]       [,90]     [,91]
[1,] 0.9544602 0.2387446 -0.8471829 -0.2835843 -0.367299 -0.01554063 -2.527669
[2,] 0.9544602 0.2387446 -0.8471829 -0.2835843 -0.367299 -0.01554063 -2.527669
         [,92]     [,93]     [,94]     [,95]     [,96]     [,97]     [,98]
[1,] -1.810129 -1.067555 -1.101391 0.9335734 0.8614099 -2.556584 -1.471268
[2,] -1.810129 -1.067555 -1.101391 0.9335734 0.8614099 -2.556584 -1.471268
         [,99]     [,100]
[1,] 0.4103842 -0.3206586
[2,] 0.4103842 -0.3206586
> 
> 
> Max(tmp2)
[1] 2.568589
> Min(tmp2)
[1] -2.26245
> mean(tmp2)
[1] 0.1220458
> Sum(tmp2)
[1] 12.20458
> Var(tmp2)
[1] 0.9989833
> 
> rowMeans(tmp2)
  [1]  1.02012002  0.84144956  1.01875811 -0.96226523  0.95003026 -0.45235479
  [7]  0.38408829 -1.71827939  0.93809951 -0.47182604  1.10666068 -0.71951497
 [13] -0.75517918  0.05661202 -1.27241363  1.29555556 -0.48425626 -0.85521660
 [19]  0.50307469  1.51522640  1.47303951  0.16591786  0.79418843  0.47933441
 [25] -0.16084447 -0.89040399  1.04588966  1.66973197  0.02538948 -0.20269458
 [31] -0.91317487  0.29057520 -0.52575065  0.40136031 -1.42120783  0.17838799
 [37]  2.19567919  0.44481482  0.69160407 -0.49732849 -0.47303519 -2.26244978
 [43]  0.59160642  0.30378573  0.53530272  0.83136170  0.82121237 -0.68642145
 [49] -0.85596954  0.24416014  1.24868958 -0.09054983  0.44141444 -2.16337431
 [55]  0.11998201 -1.38418686  1.00010190  0.25487448  0.16597793 -0.94851279
 [61]  2.56858871 -0.77021859  0.60274784 -1.57079829 -0.02173159  0.03979238
 [67] -0.26871203 -0.69984154  2.22833131  0.20480811 -1.06401925  1.77952655
 [73] -0.87315536 -0.72904149 -1.30929201  0.48929220  1.19427258 -0.69313249
 [79]  0.34138882  0.29485347 -1.87249604  1.07056587  0.50831196 -0.53982388
 [85] -0.11432551  0.51365478  1.12365933  0.26635061 -0.08233200  0.97752737
 [91]  0.43075079  1.11262237 -0.90466743  1.99179037 -0.36428687  0.09254600
 [97] -1.70887306  0.41053757  1.64078403  1.03178089
> rowSums(tmp2)
  [1]  1.02012002  0.84144956  1.01875811 -0.96226523  0.95003026 -0.45235479
  [7]  0.38408829 -1.71827939  0.93809951 -0.47182604  1.10666068 -0.71951497
 [13] -0.75517918  0.05661202 -1.27241363  1.29555556 -0.48425626 -0.85521660
 [19]  0.50307469  1.51522640  1.47303951  0.16591786  0.79418843  0.47933441
 [25] -0.16084447 -0.89040399  1.04588966  1.66973197  0.02538948 -0.20269458
 [31] -0.91317487  0.29057520 -0.52575065  0.40136031 -1.42120783  0.17838799
 [37]  2.19567919  0.44481482  0.69160407 -0.49732849 -0.47303519 -2.26244978
 [43]  0.59160642  0.30378573  0.53530272  0.83136170  0.82121237 -0.68642145
 [49] -0.85596954  0.24416014  1.24868958 -0.09054983  0.44141444 -2.16337431
 [55]  0.11998201 -1.38418686  1.00010190  0.25487448  0.16597793 -0.94851279
 [61]  2.56858871 -0.77021859  0.60274784 -1.57079829 -0.02173159  0.03979238
 [67] -0.26871203 -0.69984154  2.22833131  0.20480811 -1.06401925  1.77952655
 [73] -0.87315536 -0.72904149 -1.30929201  0.48929220  1.19427258 -0.69313249
 [79]  0.34138882  0.29485347 -1.87249604  1.07056587  0.50831196 -0.53982388
 [85] -0.11432551  0.51365478  1.12365933  0.26635061 -0.08233200  0.97752737
 [91]  0.43075079  1.11262237 -0.90466743  1.99179037 -0.36428687  0.09254600
 [97] -1.70887306  0.41053757  1.64078403  1.03178089
> 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]  1.02012002  0.84144956  1.01875811 -0.96226523  0.95003026 -0.45235479
  [7]  0.38408829 -1.71827939  0.93809951 -0.47182604  1.10666068 -0.71951497
 [13] -0.75517918  0.05661202 -1.27241363  1.29555556 -0.48425626 -0.85521660
 [19]  0.50307469  1.51522640  1.47303951  0.16591786  0.79418843  0.47933441
 [25] -0.16084447 -0.89040399  1.04588966  1.66973197  0.02538948 -0.20269458
 [31] -0.91317487  0.29057520 -0.52575065  0.40136031 -1.42120783  0.17838799
 [37]  2.19567919  0.44481482  0.69160407 -0.49732849 -0.47303519 -2.26244978
 [43]  0.59160642  0.30378573  0.53530272  0.83136170  0.82121237 -0.68642145
 [49] -0.85596954  0.24416014  1.24868958 -0.09054983  0.44141444 -2.16337431
 [55]  0.11998201 -1.38418686  1.00010190  0.25487448  0.16597793 -0.94851279
 [61]  2.56858871 -0.77021859  0.60274784 -1.57079829 -0.02173159  0.03979238
 [67] -0.26871203 -0.69984154  2.22833131  0.20480811 -1.06401925  1.77952655
 [73] -0.87315536 -0.72904149 -1.30929201  0.48929220  1.19427258 -0.69313249
 [79]  0.34138882  0.29485347 -1.87249604  1.07056587  0.50831196 -0.53982388
 [85] -0.11432551  0.51365478  1.12365933  0.26635061 -0.08233200  0.97752737
 [91]  0.43075079  1.11262237 -0.90466743  1.99179037 -0.36428687  0.09254600
 [97] -1.70887306  0.41053757  1.64078403  1.03178089
> rowMin(tmp2)
  [1]  1.02012002  0.84144956  1.01875811 -0.96226523  0.95003026 -0.45235479
  [7]  0.38408829 -1.71827939  0.93809951 -0.47182604  1.10666068 -0.71951497
 [13] -0.75517918  0.05661202 -1.27241363  1.29555556 -0.48425626 -0.85521660
 [19]  0.50307469  1.51522640  1.47303951  0.16591786  0.79418843  0.47933441
 [25] -0.16084447 -0.89040399  1.04588966  1.66973197  0.02538948 -0.20269458
 [31] -0.91317487  0.29057520 -0.52575065  0.40136031 -1.42120783  0.17838799
 [37]  2.19567919  0.44481482  0.69160407 -0.49732849 -0.47303519 -2.26244978
 [43]  0.59160642  0.30378573  0.53530272  0.83136170  0.82121237 -0.68642145
 [49] -0.85596954  0.24416014  1.24868958 -0.09054983  0.44141444 -2.16337431
 [55]  0.11998201 -1.38418686  1.00010190  0.25487448  0.16597793 -0.94851279
 [61]  2.56858871 -0.77021859  0.60274784 -1.57079829 -0.02173159  0.03979238
 [67] -0.26871203 -0.69984154  2.22833131  0.20480811 -1.06401925  1.77952655
 [73] -0.87315536 -0.72904149 -1.30929201  0.48929220  1.19427258 -0.69313249
 [79]  0.34138882  0.29485347 -1.87249604  1.07056587  0.50831196 -0.53982388
 [85] -0.11432551  0.51365478  1.12365933  0.26635061 -0.08233200  0.97752737
 [91]  0.43075079  1.11262237 -0.90466743  1.99179037 -0.36428687  0.09254600
 [97] -1.70887306  0.41053757  1.64078403  1.03178089
> 
> colMeans(tmp2)
[1] 0.1220458
> colSums(tmp2)
[1] 12.20458
> colVars(tmp2)
[1] 0.9989833
> colSd(tmp2)
[1] 0.9994915
> colMax(tmp2)
[1] 2.568589
> colMin(tmp2)
[1] -2.26245
> colMedians(tmp2)
[1] 0.2244841
> colRanges(tmp2)
          [,1]
[1,] -2.262450
[2,]  2.568589
> 
> 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] -0.2462453  0.5949949 -1.1918942 -1.9411495  1.8291540 -2.7238645
 [7] -1.8129289 -0.7271838  0.6729978 -2.4485504
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -1.1337190
[2,] -0.3882468
[3,] -0.0261979
[4,]  0.2144925
[5,]  1.0083019
> 
> rowApply(tmp,sum)
 [1] -2.2131674  1.3407178 -5.9734802 -4.1548023  3.2244263  1.2965857
 [7] -0.2808193  1.6845106 -2.5989107 -0.3197307
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    8    4    2    5    8    6    7    7    4     5
 [2,]    3    5    8    9   10    8    8    2    9     1
 [3,]    6    7   10    4    1    7    3    4    6     7
 [4,]    9    1    3    2    9    1    4    5    7    10
 [5,]   10    9    6    6    3    9    1    9    3     4
 [6,]    5    2    4   10    2    3    5    6    1     6
 [7,]    1    6    7    1    4   10    9    8    8     9
 [8,]    7   10    5    8    6    2    6    3    2     3
 [9,]    4    8    9    7    5    4    2    1   10     8
[10,]    2    3    1    3    7    5   10   10    5     2
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  0.59691544  1.20094075 -0.02084515  0.45713092 -0.08668239 -1.39809924
 [7] -1.39289177 -3.48709475 -2.35675317  2.69936996  1.42190272 -0.18923138
[13] -0.47471727 -3.25878782  1.25043752  0.05277150  0.15971551 -0.65387265
[19] -3.06703586 -1.24402525
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -0.9287145
[2,] -0.7211822
[3,] -0.5810911
[4,]  0.1177199
[5,]  2.7101834
> 
> rowApply(tmp,sum)
[1]  8.117802 -8.185604 -3.780300  2.808491 -8.751242
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]    5   10   11   20    7
[2,]   13    8   15   10   16
[3,]   14   15    5   13   12
[4,]   19    5    8   17    5
[5,]   18    4   19   12    3
> 
> 
> as.matrix(tmp)
           [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] -0.7211822  1.00392711  1.2017403  2.0669337  1.8309530  1.4436206
[2,] -0.5810911 -0.76253215 -0.2237347 -1.3000842 -1.3929124 -0.5493365
[3,]  0.1177199  0.56150040 -1.2105817 -0.8505471  1.1845616 -0.8831117
[4,]  2.7101834 -0.01897544  0.4347460  1.4987699  0.1047781  0.9052099
[5,] -0.9287145  0.41702083 -0.2230150 -0.9579415 -1.8140627 -2.3144816
           [,7]       [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.2369640 -1.0621389  0.5775443  2.1277657  1.7092952 -0.3140310
[2,] -1.0591107  0.9031899 -0.6657684 -0.3667164 -1.4292615 -0.5519116
[3,] -1.7529981 -1.2222925  1.7175240  0.3396161  0.9258709 -0.1937836
[4,] -0.2946911 -1.6286179 -1.3163606  0.7065721  1.5758186  1.2765605
[5,]  1.4769440 -0.4772354 -2.6696924 -0.1078676 -1.3598204 -0.4060656
          [,13]         [,14]       [,15]       [,16]      [,17]       [,18]
[1,] -1.9180312 -1.2822872875  0.38158049 -0.21985547  0.1858144 -0.01915371
[2,] -2.4437757 -1.4744582887  0.67233912 -0.51553655  2.2355905  2.05856000
[3,]  0.7902458  0.4651408862  0.74916976  0.19962600 -1.6254965 -2.00295459
[4,]  2.2428737 -0.9677470469 -0.63266116  0.05214654 -0.3857344 -1.41859246
[5,]  0.8539702  0.0005639197  0.08000931  0.53639099 -0.2504585  0.72826811
           [,19]      [,20]
[1,] -0.77970829  1.6680512
[2,] -0.86789046  0.1288373
[3,] -0.02410935 -1.0653998
[4,] -0.44453747 -1.5912498
[5,] -0.95079028 -0.3842641
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  709  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  612  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  2.1  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
          col1     col2     col3      col4     col5      col6       col7
row1 -0.716722 -1.30316 1.053594 0.7572719 1.026279 0.1323876 -0.4567174
          col8        col9     col10    col11      col12     col13     col14
row1 -1.296453 -0.01351783 0.3566349 1.539827 -0.7434787 0.1656571 -1.096747
        col15      col16      col17     col18     col19     col20
row1 0.121345 -0.3948321 -0.6913879 0.5604511 -0.235933 -1.164078
> tmp[,"col10"]
          col10
row1  0.3566349
row2 -0.9667087
row3  0.2051693
row4  0.9498496
row5 -0.6135425
> tmp[c("row1","row5"),]
           col1       col2      col3       col4       col5       col6
row1 -0.7167220 -1.3031597 1.0535944  0.7572719  1.0262787 0.13238763
row5  0.8257113 -0.4693191 0.5358238 -0.4834039 -0.5853529 0.03275386
           col7       col8         col9      col10     col11      col12
row1 -0.4567174 -1.2964530 -0.013517829  0.3566349 1.5398266 -0.7434787
row5  0.8117078  0.3308204  0.007417853 -0.6135425 0.8964061 -0.2735904
           col13      col14       col15      col16      col17      col18
row1  0.16565711 -1.0967472  0.12134502 -0.3948321 -0.6913879  0.5604511
row5 -0.03918778 -0.1268874 -0.03337106  1.1398485  0.3496817 -1.0422250
         col19      col20
row1 -0.235933 -1.1640784
row5  1.944262 -0.2011537
> tmp[,c("col6","col20")]
            col6      col20
row1  0.13238763 -1.1640784
row2  0.55155271  0.9251589
row3 -0.79592981  0.1273273
row4 -0.27425068  1.1078685
row5  0.03275386 -0.2011537
> tmp[c("row1","row5"),c("col6","col20")]
           col6      col20
row1 0.13238763 -1.1640784
row5 0.03275386 -0.2011537
> 
> 
> 
> 
> 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.60568 50.26419 51.9871 50.07697 49.452 105.4716 49.63118 49.05612
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.83349 52.00757 51.56958 51.27363 51.91831 50.92316 48.62715 50.86394
        col17    col18   col19    col20
row1 52.48893 50.19237 49.7922 104.6903
> tmp[,"col10"]
        col10
row1 52.00757
row2 30.34634
row3 30.75747
row4 30.85350
row5 50.00208
> tmp[c("row1","row5"),]
         col1     col2    col3     col4    col5     col6     col7     col8
row1 50.60568 50.26419 51.9871 50.07697 49.4520 105.4716 49.63118 49.05612
row5 49.04947 50.86922 50.2369 50.77116 49.8403 105.9147 50.62110 50.19903
         col9    col10    col11    col12    col13    col14    col15    col16
row1 47.83349 52.00757 51.56958 51.27363 51.91831 50.92316 48.62715 50.86394
row5 48.01878 50.00208 49.40959 50.41646 50.13943 50.11559 49.48037 50.01155
        col17    col18    col19    col20
row1 52.48893 50.19237 49.79220 104.6903
row5 50.22002 49.64247 49.98254 104.0451
> tmp[,c("col6","col20")]
          col6     col20
row1 105.47157 104.69029
row2  74.57831  75.89767
row3  74.07161  73.11407
row4  75.16953  74.16278
row5 105.91467 104.04505
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 105.4716 104.6903
row5 105.9147 104.0451
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 105.4716 104.6903
row5 105.9147 104.0451
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,]  1.39380790
[2,]  0.56159748
[3,] -1.21199631
[4,]  0.01496781
[5,]  0.15432447
> tmp[,c("col17","col7")]
           col17       col7
[1,] -0.37058963  0.2372698
[2,] -0.17961795 -1.5194309
[3,] -0.03931635 -0.4042894
[4,]  0.74737255 -0.7231795
[5,] -0.44281520  1.7928479
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
            col6       col20
[1,] -1.32645066  1.46598452
[2,]  2.57118083  0.71247642
[3,] -0.96958843 -0.58785210
[4,]  0.06401927 -0.02135518
[5,] -0.09843649  1.19014846
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] -1.326451
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] -1.326451
[2,]  2.571181
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]       [,2]      [,3]       [,4]       [,5]       [,6]
row3 1.491329762 -0.2382582 0.7305842 -0.6956596 -0.2641467 -0.5342373
row1 0.004118821 -0.2258438 0.4429730 -0.9392904 -0.6659541  0.4189731
            [,7]       [,8]       [,9]    [,10]      [,11]      [,12]
row3 -0.46036882 -0.2143406  0.9597042 2.107312 -0.5000897 -0.4277051
row1  0.07361399 -0.2048213 -0.1432138 0.281099  0.8843305  0.6190764
          [,13]     [,14]     [,15]     [,16]     [,17]      [,18]        [,19]
row3 -0.8375463  0.234313 1.0047737 1.6690724 -1.631106 -0.9357441  0.007558982
row1  0.1217077 -1.204613 0.7773982 0.3674076 -1.059131  0.4550830 -2.196040765
          [,20]
row3  0.2133991
row1 -0.9142445
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]        [,2]      [,3]     [,4]       [,5]      [,6]       [,7]
row2 -0.9633099 -0.04957365 -1.294236 1.063991 -0.6825468 0.3570931 -0.8068611
           [,8]      [,9]      [,10]
row2 -0.3875245 0.1535623 -0.1961543
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
          [,1]      [,2]      [,3]       [,4]       [,5]      [,6]       [,7]
row5 0.9246352 0.9979964 -0.345417 -0.8815326 -0.2893989 -2.051409 -0.6427358
         [,8]        [,9]    [,10]      [,11]     [,12]    [,13]     [,14]
row5 1.138719 -0.08250406 2.145373 -0.4345786 0.4298385 1.559776 -1.158758
         [,15]     [,16]     [,17]      [,18]    [,19]    [,20]
row5 0.1211452 0.1642037 -2.023803 -0.1541524 -0.98531 1.656117
> 
> 
> 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: 0x600000922160>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad44bc44a7"
 [2] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad243f5332"
 [3] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad396f0a35"
 [4] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad29073b08"
 [5] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad19b49f43"
 [6] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad2143f4e4"
 [7] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad7482b5cb"
 [8] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad316d5e2f"
 [9] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad3427903" 
[10] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad116b5a1" 
[11] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad79ee5d95"
[12] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad10421fbd"
[13] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad6531b9a1"
[14] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad23922cee"
[15] "/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests/BM92ad51c3cf80"
> 
> 
> ### 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: 0x60000090d200>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60000090d200>
Warning message:
In dir.create(new.directory) :
  '/Users/biocbuild/bbs-3.20-bioc-mac-arm64/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x60000090d200>
> rowMedians(tmp)
  [1]  0.007766754 -0.077252692  0.289680838 -0.188351679 -0.006536585
  [6] -0.470218610  0.194638088  0.150334765 -0.314104879  0.061579239
 [11] -0.429984084 -0.121635721 -0.124568966  0.149306074 -0.170051400
 [16]  0.545841472  0.301417679 -0.324986437  0.179619490 -0.294857141
 [21]  0.185411367 -0.481219912  0.407920663  0.031500515  0.461496927
 [26]  0.350717633 -0.039638962  0.343246503  0.052156071  0.091875278
 [31] -0.007379989 -0.155919624 -0.159304855  0.491703142  0.062971024
 [36]  0.240308562  0.195431022 -0.332770970 -0.246062482 -0.014400844
 [41] -0.534367661 -0.851846683  0.142090307  0.413343176  0.420712482
 [46]  0.047880044  0.254699746  0.254036410 -0.195668724  0.168723843
 [51]  0.515598177 -0.397527990 -0.091960850 -0.088589675 -0.207458239
 [56] -0.259755728 -0.257012158 -0.273802331 -0.032338997 -0.019070655
 [61] -0.556022297  0.538926232  0.009111053 -0.519059368 -0.471340211
 [66]  0.107562569  0.076614069 -0.419932516  0.026597066  0.636820695
 [71] -0.241467552 -0.361378736  0.042963241 -0.403881683 -0.121766950
 [76]  0.201593697  0.232243510 -0.031643294  0.124018289 -0.530023157
 [81] -0.080597448  0.092765574 -0.128040956 -0.209078634  0.127903236
 [86]  0.158807819 -0.330682176 -0.302033502 -0.087189926 -0.352834824
 [91]  0.202212604 -0.302445965  0.441212707  0.097103034 -0.285002390
 [96]  0.166148747 -0.279340373 -0.455037310 -0.351003027  0.160530406
[101] -0.315948323 -0.042385220 -0.077784562 -0.262171450 -0.227710565
[106] -0.247450501  0.766982794 -0.215115734 -0.037361338  0.668256514
[111]  0.068506816  0.191922943  0.283560247 -0.130383863 -0.317837668
[116] -0.033284899 -0.088741994  0.334264762 -0.049245761  0.057614351
[121] -0.241408044  0.207386265  0.329451804  0.220588534  0.195892328
[126] -0.017776179  0.033017931 -0.531262468 -0.318983889  0.114542810
[131] -0.462627028 -0.392448468 -0.388229015  0.223043231  0.448455587
[136] -0.434823105 -0.107661157  0.191281327  0.052437100 -0.359644656
[141] -0.049640870 -0.212434071 -0.171989045  0.219842657 -0.112105854
[146]  0.296284772 -0.013371699  0.452016386  0.104649558  0.761450323
[151]  0.331360163 -0.374342630 -0.021458520 -0.256500015 -0.333346145
[156] -0.127356508  0.321854071  0.028821969 -0.146977613  0.437161022
[161] -0.461911550 -0.111172230 -0.099179832 -0.228708456 -0.333507552
[166]  0.194081681 -0.239566926 -0.381747870  0.100693217 -0.090099767
[171]  0.004142586 -0.023783307  0.321233210 -0.168984289  0.179094707
[176]  0.125074662  0.130776677  0.292939310  0.323783168  0.305610356
[181] -0.144172472 -0.180615962  0.045135503 -0.207165237 -0.144389335
[186] -0.166609268  0.218893660  0.187696375 -0.216922188 -0.231433079
[191]  0.249067495  0.485086659  0.381630903 -0.087556708  0.108867196
[196]  0.244805588  0.037039839  0.174177020 -0.272466592  0.312761474
[201] -0.067446156  0.164339663 -0.370882564 -0.142391347  0.218959023
[206] -0.228846188 -0.203038324  0.186361536 -0.110270005  0.230376073
[211]  0.102486120  0.038877707  0.061278107  0.032827375  0.304996999
[216] -0.183333696  0.131151892  0.065881671  0.227446391 -0.094794984
[221]  0.677206189  0.364677150  0.027859587  0.218663633  0.311900527
[226]  0.527079760  0.079319128 -0.072404391  0.121069953  0.171051111
> 
> proc.time()
   user  system elapsed 
  1.954   8.173  10.455 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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: 0x600001330000>
> .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: 0x600001330000>
> .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: 0x600001330000>
> .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: 0x600001330000>
> 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: 0x600001324900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001324900>
> .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: 0x600001324900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001324900>
> .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: 0x600001324900>
> 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: 0x600001324ae0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001324ae0>
> .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: 0x600001324ae0>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001324ae0>
> .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: 0x600001324ae0>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x600001324ae0>
> .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: 0x600001324ae0>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x600001324ae0>
> .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: 0x600001324ae0>
> 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: 0x600001324cc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600001324cc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001324cc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001324cc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile92f73aa03176" "BufferedMatrixFile92f76b0f580b"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile92f73aa03176" "BufferedMatrixFile92f76b0f580b"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001324de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001324de0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001324de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600001324de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600001324de0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600001324de0>
> .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: 0x600001324fc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600001324fc0>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600001324fc0>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600001324fc0>
> 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: 0x6000013251a0>
> .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: 0x6000013251a0>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.345   0.109   0.443 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

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.340   0.070   0.395 

Example timings