| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-05 11:35 -0500 (Thu, 05 Mar 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4891 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4583 |
| 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 255/2357 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.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.75.0.tar.gz |
| StartedAt: 2026-03-04 18:49:09 -0500 (Wed, 04 Mar 2026) |
| EndedAt: 2026-03-04 18:49:29 -0500 (Wed, 04 Mar 2026) |
| EllapsedTime: 19.3 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### 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.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-01-15 r89304)
* using platform: aarch64-apple-darwin20
* R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
* running under: macOS Sonoma 14.8.3
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.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.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.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 ... INFO
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, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
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.6-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -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 -std=gnu2x -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 -std=gnu2x -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 -std=gnu2x -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 -std=gnu2x -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
installing to /Library/Frameworks/R.framework/Versions/4.6-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)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 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.130 0.054 0.182
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 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.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 481350 25.8 1058420 56.6 NA 633731 33.9
Vcells 891641 6.9 8388608 64.0 196608 2111462 16.2
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Wed Mar 4 18:49:20 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Wed Mar 4 18:49:20 2026"
>
>
> 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: 0x600000690000>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Wed Mar 4 18:49:21 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Wed Mar 4 18:49:22 2026"
>
> ColMode(tmp2)
<pointer: 0x600000690000>
>
>
>
> ### 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.89615166 0.95438708 2.4732309 -1.2229736
[2,] 0.97500164 -0.93281478 -1.4621399 -0.3703711
[3,] 0.49089463 0.03291162 -0.2802548 0.1625951
[4,] 0.09614521 -1.03969794 -0.3198639 1.3035058
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.89615166 0.95438708 2.4732309 1.2229736
[2,] 0.97500164 0.93281478 1.4621399 0.3703711
[3,] 0.49089463 0.03291162 0.2802548 0.1625951
[4,] 0.09614521 1.03969794 0.3198639 1.3035058
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9948062 0.9769274 1.5726509 1.1058814
[2,] 0.9874217 0.9658234 1.2091898 0.6085812
[3,] 0.7006387 0.1814156 0.5293910 0.4032309
[4,] 0.3100729 1.0196558 0.5655651 1.1417118
>
> 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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.84421 35.72366 43.19974 37.28179
[2,] 35.84922 35.59105 38.55404 31.45618
[3,] 32.49728 26.84707 30.57416 29.19490
[4,] 28.19687 36.23626 30.97551 37.72062
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000006a8000>
> exp(tmp5)
<pointer: 0x6000006a8000>
> log(tmp5,2)
<pointer: 0x6000006a8000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.9838
> Min(tmp5)
[1] 53.30149
> mean(tmp5)
[1] 72.14548
> Sum(tmp5)
[1] 14429.1
> Var(tmp5)
[1] 861.6257
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.88748 70.83869 69.86463 70.38083 70.16682 71.09068 68.05558 69.94579
[9] 74.10280 67.12145
> rowSums(tmp5)
[1] 1797.750 1416.774 1397.293 1407.617 1403.336 1421.814 1361.112 1398.916
[9] 1482.056 1342.429
> rowVars(tmp5)
[1] 8009.92377 67.32102 86.01304 48.83138 57.07815 47.83994
[7] 79.41196 73.05763 94.47670 59.94920
> rowSd(tmp5)
[1] 89.498177 8.204939 9.274321 6.987945 7.555008 6.916643 8.911339
[8] 8.547376 9.719913 7.742687
> rowMax(tmp5)
[1] 467.98377 82.87710 99.65858 84.72333 83.05225 81.82307 88.60189
[8] 82.78083 91.84293 81.14552
> rowMin(tmp5)
[1] 53.33998 53.30149 55.87865 58.68810 56.17037 57.46299 54.07483 54.99739
[9] 55.69260 55.62557
>
> colMeans(tmp5)
[1] 110.46547 70.69228 74.78361 72.88966 67.49578 69.00822 71.78657
[8] 68.27466 66.34427 73.26549 68.04567 65.93646 70.06493 71.76258
[15] 69.17517 68.67706 69.38509 74.25073 69.58862 71.01719
> colSums(tmp5)
[1] 1104.6547 706.9228 747.8361 728.8966 674.9578 690.0822 717.8657
[8] 682.7466 663.4427 732.6549 680.4567 659.3646 700.6493 717.6258
[15] 691.7517 686.7706 693.8509 742.5073 695.8862 710.1719
> colVars(tmp5)
[1] 15866.92110 63.13936 95.66196 61.10280 54.09102 52.19626
[7] 169.95972 53.94829 42.28646 66.10794 74.48378 75.75486
[13] 118.43347 43.35229 81.25988 60.36497 85.54436 41.75940
[19] 33.21407 67.38598
> colSd(tmp5)
[1] 125.963967 7.946028 9.780693 7.816828 7.354660 7.224698
[7] 13.036860 7.344950 6.502804 8.130679 8.630398 8.703727
[13] 10.882714 6.584245 9.014426 7.769490 9.249020 6.462152
[19] 5.763165 8.208897
> colMax(tmp5)
[1] 467.98377 78.86698 89.91460 82.84301 80.02921 81.53238 99.65858
[8] 83.03738 79.13766 83.84986 79.40731 76.25453 91.84293 84.21452
[15] 87.89402 80.53302 84.72333 82.87710 76.81096 88.60189
> colMin(tmp5)
[1] 54.07483 55.87865 61.31015 60.76537 58.95204 58.95562 56.17037 59.54622
[9] 56.80958 61.15291 55.69260 53.30149 55.62557 60.51308 59.75593 58.03435
[17] 54.99739 65.38585 59.35918 62.39793
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 89.88748 70.83869 69.86463 70.38083 70.16682 71.09068 68.05558 69.94579
[9] NA 67.12145
> rowSums(tmp5)
[1] 1797.750 1416.774 1397.293 1407.617 1403.336 1421.814 1361.112 1398.916
[9] NA 1342.429
> rowVars(tmp5)
[1] 8009.92377 67.32102 86.01304 48.83138 57.07815 47.83994
[7] 79.41196 73.05763 94.16956 59.94920
> rowSd(tmp5)
[1] 89.498177 8.204939 9.274321 6.987945 7.555008 6.916643 8.911339
[8] 8.547376 9.704100 7.742687
> rowMax(tmp5)
[1] 467.98377 82.87710 99.65858 84.72333 83.05225 81.82307 88.60189
[8] 82.78083 NA 81.14552
> rowMin(tmp5)
[1] 53.33998 53.30149 55.87865 58.68810 56.17037 57.46299 54.07483 54.99739
[9] NA 55.62557
>
> colMeans(tmp5)
[1] 110.46547 70.69228 74.78361 72.88966 67.49578 69.00822 71.78657
[8] 68.27466 66.34427 NA 68.04567 65.93646 70.06493 71.76258
[15] 69.17517 68.67706 69.38509 74.25073 69.58862 71.01719
> colSums(tmp5)
[1] 1104.6547 706.9228 747.8361 728.8966 674.9578 690.0822 717.8657
[8] 682.7466 663.4427 NA 680.4567 659.3646 700.6493 717.6258
[15] 691.7517 686.7706 693.8509 742.5073 695.8862 710.1719
> colVars(tmp5)
[1] 15866.92110 63.13936 95.66196 61.10280 54.09102 52.19626
[7] 169.95972 53.94829 42.28646 NA 74.48378 75.75486
[13] 118.43347 43.35229 81.25988 60.36497 85.54436 41.75940
[19] 33.21407 67.38598
> colSd(tmp5)
[1] 125.963967 7.946028 9.780693 7.816828 7.354660 7.224698
[7] 13.036860 7.344950 6.502804 NA 8.630398 8.703727
[13] 10.882714 6.584245 9.014426 7.769490 9.249020 6.462152
[19] 5.763165 8.208897
> colMax(tmp5)
[1] 467.98377 78.86698 89.91460 82.84301 80.02921 81.53238 99.65858
[8] 83.03738 79.13766 NA 79.40731 76.25453 91.84293 84.21452
[15] 87.89402 80.53302 84.72333 82.87710 76.81096 88.60189
> colMin(tmp5)
[1] 54.07483 55.87865 61.31015 60.76537 58.95204 58.95562 56.17037 59.54622
[9] 56.80958 NA 55.69260 53.30149 55.62557 60.51308 59.75593 58.03435
[17] 54.99739 65.38585 59.35918 62.39793
>
> Max(tmp5,na.rm=TRUE)
[1] 467.9838
> Min(tmp5,na.rm=TRUE)
[1] 53.30149
> mean(tmp5,na.rm=TRUE)
[1] 72.08666
> Sum(tmp5,na.rm=TRUE)
[1] 14345.25
> Var(tmp5,na.rm=TRUE)
[1] 865.282
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.88748 70.83869 69.86463 70.38083 70.16682 71.09068 68.05558 69.94579
[9] 73.58980 67.12145
> rowSums(tmp5,na.rm=TRUE)
[1] 1797.750 1416.774 1397.293 1407.617 1403.336 1421.814 1361.112 1398.916
[9] 1398.206 1342.429
> rowVars(tmp5,na.rm=TRUE)
[1] 8009.92377 67.32102 86.01304 48.83138 57.07815 47.83994
[7] 79.41196 73.05763 94.16956 59.94920
> rowSd(tmp5,na.rm=TRUE)
[1] 89.498177 8.204939 9.274321 6.987945 7.555008 6.916643 8.911339
[8] 8.547376 9.704100 7.742687
> rowMax(tmp5,na.rm=TRUE)
[1] 467.98377 82.87710 99.65858 84.72333 83.05225 81.82307 88.60189
[8] 82.78083 91.84293 81.14552
> rowMin(tmp5,na.rm=TRUE)
[1] 53.33998 53.30149 55.87865 58.68810 56.17037 57.46299 54.07483 54.99739
[9] 55.69260 55.62557
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.46547 70.69228 74.78361 72.88966 67.49578 69.00822 71.78657
[8] 68.27466 66.34427 72.08945 68.04567 65.93646 70.06493 71.76258
[15] 69.17517 68.67706 69.38509 74.25073 69.58862 71.01719
> colSums(tmp5,na.rm=TRUE)
[1] 1104.6547 706.9228 747.8361 728.8966 674.9578 690.0822 717.8657
[8] 682.7466 663.4427 648.8051 680.4567 659.3646 700.6493 717.6258
[15] 691.7517 686.7706 693.8509 742.5073 695.8862 710.1719
> colVars(tmp5,na.rm=TRUE)
[1] 15866.92110 63.13936 95.66196 61.10280 54.09102 52.19626
[7] 169.95972 53.94829 42.28646 58.81188 74.48378 75.75486
[13] 118.43347 43.35229 81.25988 60.36497 85.54436 41.75940
[19] 33.21407 67.38598
> colSd(tmp5,na.rm=TRUE)
[1] 125.963967 7.946028 9.780693 7.816828 7.354660 7.224698
[7] 13.036860 7.344950 6.502804 7.668891 8.630398 8.703727
[13] 10.882714 6.584245 9.014426 7.769490 9.249020 6.462152
[19] 5.763165 8.208897
> colMax(tmp5,na.rm=TRUE)
[1] 467.98377 78.86698 89.91460 82.84301 80.02921 81.53238 99.65858
[8] 83.03738 79.13766 82.11794 79.40731 76.25453 91.84293 84.21452
[15] 87.89402 80.53302 84.72333 82.87710 76.81096 88.60189
> colMin(tmp5,na.rm=TRUE)
[1] 54.07483 55.87865 61.31015 60.76537 58.95204 58.95562 56.17037 59.54622
[9] 56.80958 61.15291 55.69260 53.30149 55.62557 60.51308 59.75593 58.03435
[17] 54.99739 65.38585 59.35918 62.39793
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.88748 70.83869 69.86463 70.38083 70.16682 71.09068 68.05558 69.94579
[9] NaN 67.12145
> rowSums(tmp5,na.rm=TRUE)
[1] 1797.750 1416.774 1397.293 1407.617 1403.336 1421.814 1361.112 1398.916
[9] 0.000 1342.429
> rowVars(tmp5,na.rm=TRUE)
[1] 8009.92377 67.32102 86.01304 48.83138 57.07815 47.83994
[7] 79.41196 73.05763 NA 59.94920
> rowSd(tmp5,na.rm=TRUE)
[1] 89.498177 8.204939 9.274321 6.987945 7.555008 6.916643 8.911339
[8] 8.547376 NA 7.742687
> rowMax(tmp5,na.rm=TRUE)
[1] 467.98377 82.87710 99.65858 84.72333 83.05225 81.82307 88.60189
[8] 82.78083 NA 81.14552
> rowMin(tmp5,na.rm=TRUE)
[1] 53.33998 53.30149 55.87865 58.68810 56.17037 57.46299 54.07483 54.99739
[9] NA 55.62557
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.74574 69.78398 73.74779 74.01362 67.64446 69.74680 71.30381
[8] 68.48787 65.70540 NaN 69.41823 65.27808 67.64515 70.37903
[15] 67.09530 68.38759 70.13081 74.42497 69.46387 70.06795
> colSums(tmp5,na.rm=TRUE)
[1] 1023.7117 628.0558 663.7301 666.1226 608.8002 627.7212 641.7343
[8] 616.3908 591.3486 0.0000 624.7641 587.5027 608.8063 633.4113
[15] 603.8577 615.4883 631.1773 669.8247 625.1748 630.6115
> colVars(tmp5,na.rm=TRUE)
[1] 17729.23446 61.75043 95.54933 54.52856 60.60369 52.58399
[7] 188.58278 60.18042 42.98051 NA 62.60002 80.34774
[13] 67.36523 27.23647 42.75135 66.96794 89.98140 46.63779
[19] 37.19075 65.67242
> colSd(tmp5,na.rm=TRUE)
[1] 133.151171 7.858144 9.774934 7.384346 7.784837 7.251482
[7] 13.732544 7.757604 6.555952 NA 7.912017 8.963690
[13] 8.207632 5.218857 6.538452 8.183394 9.485853 6.829187
[19] 6.098422 8.103852
> colMax(tmp5,na.rm=TRUE)
[1] 467.98377 78.14785 89.91460 82.84301 80.02921 81.53238 99.65858
[8] 83.03738 79.13766 -Inf 79.40731 76.25453 79.58279 76.22985
[15] 80.46018 80.53302 84.72333 82.87710 76.81096 88.60189
> colMin(tmp5,na.rm=TRUE)
[1] 54.07483 55.87865 61.31015 60.76537 58.95204 58.95562 56.17037 59.54622
[9] 56.80958 Inf 55.78128 53.30149 55.62557 60.51308 59.75593 58.03435
[17] 54.99739 65.38585 59.35918 62.39793
>
>
>
>
> 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] 281.8201 336.4188 254.3723 181.4217 183.7838 114.8895 289.0188 269.3043
[9] 236.1027 177.3310
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 281.8201 336.4188 254.3723 181.4217 183.7838 114.8895 289.0188 269.3043
[9] 236.1027 177.3310
>
>
>
> 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] 1.136868e-13 2.273737e-13 -2.842171e-14 0.000000e+00 -8.526513e-14
[6] 2.842171e-14 5.684342e-14 5.684342e-14 1.563194e-13 0.000000e+00
[11] -1.136868e-13 2.273737e-13 -2.842171e-14 2.842171e-14 -2.273737e-13
[16] 2.842171e-13 -1.136868e-13 -8.526513e-14 1.136868e-13 1.136868e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
8 5
4 5
9 3
9 11
3 10
5 19
5 14
3 13
4 2
3 13
4 13
1 18
6 9
2 17
10 7
7 19
9 16
5 14
2 11
8 16
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.345581
> Min(tmp)
[1] -1.946943
> mean(tmp)
[1] -0.09165049
> Sum(tmp)
[1] -9.165049
> Var(tmp)
[1] 0.8772642
>
> rowMeans(tmp)
[1] -0.09165049
> rowSums(tmp)
[1] -9.165049
> rowVars(tmp)
[1] 0.8772642
> rowSd(tmp)
[1] 0.9366238
> rowMax(tmp)
[1] 2.345581
> rowMin(tmp)
[1] -1.946943
>
> colMeans(tmp)
[1] 0.82447463 0.07833305 -1.13557711 -0.87713148 -1.74978799 0.94596515
[7] -1.03000010 -0.25138311 1.07722778 0.06023066 -0.39163047 0.23200103
[13] 1.30190103 -0.55380539 0.39939284 1.06631534 0.25402291 -1.94694304
[19] 0.04294196 -0.30575373 -0.39047000 -0.46679924 -0.31895142 0.04984183
[25] -0.31053495 -0.10393576 1.45371799 -1.37629220 0.24760301 -0.44426647
[31] 0.21217107 -1.44642214 0.94587793 0.37360032 -0.14728676 1.13694445
[37] -1.24498608 0.64080242 -0.48165586 -0.44659594 -1.57918230 -1.43714755
[43] -0.04855260 0.04853508 -0.72525877 1.25713569 0.27041257 0.20992127
[49] 0.02822682 -0.21831794 0.24855500 -1.17443528 0.29953290 -0.77650640
[55] 1.57162722 -1.36292515 -0.83162522 0.87692826 -0.03061799 -1.03170613
[61] -1.29725123 0.87599903 -0.64704217 0.81730891 -0.35220225 -0.63023269
[67] 0.42965201 0.14958122 1.29000011 -1.10664707 0.14846895 -0.59038288
[73] -0.07661217 -1.13255667 -0.87941715 0.50627762 0.53401518 1.06076523
[79] -1.08525257 -0.34582326 -0.79276967 -1.59974345 -1.60546474 1.88682742
[85] -0.11868774 1.38471172 1.04177085 0.32098599 0.26674198 -0.29932833
[91] -0.34971673 1.71463993 -0.61044823 -0.87338593 -1.51942037 -1.26098944
[97] -0.14182935 2.34558137 2.19285526 -0.33378377
> colSums(tmp)
[1] 0.82447463 0.07833305 -1.13557711 -0.87713148 -1.74978799 0.94596515
[7] -1.03000010 -0.25138311 1.07722778 0.06023066 -0.39163047 0.23200103
[13] 1.30190103 -0.55380539 0.39939284 1.06631534 0.25402291 -1.94694304
[19] 0.04294196 -0.30575373 -0.39047000 -0.46679924 -0.31895142 0.04984183
[25] -0.31053495 -0.10393576 1.45371799 -1.37629220 0.24760301 -0.44426647
[31] 0.21217107 -1.44642214 0.94587793 0.37360032 -0.14728676 1.13694445
[37] -1.24498608 0.64080242 -0.48165586 -0.44659594 -1.57918230 -1.43714755
[43] -0.04855260 0.04853508 -0.72525877 1.25713569 0.27041257 0.20992127
[49] 0.02822682 -0.21831794 0.24855500 -1.17443528 0.29953290 -0.77650640
[55] 1.57162722 -1.36292515 -0.83162522 0.87692826 -0.03061799 -1.03170613
[61] -1.29725123 0.87599903 -0.64704217 0.81730891 -0.35220225 -0.63023269
[67] 0.42965201 0.14958122 1.29000011 -1.10664707 0.14846895 -0.59038288
[73] -0.07661217 -1.13255667 -0.87941715 0.50627762 0.53401518 1.06076523
[79] -1.08525257 -0.34582326 -0.79276967 -1.59974345 -1.60546474 1.88682742
[85] -0.11868774 1.38471172 1.04177085 0.32098599 0.26674198 -0.29932833
[91] -0.34971673 1.71463993 -0.61044823 -0.87338593 -1.51942037 -1.26098944
[97] -0.14182935 2.34558137 2.19285526 -0.33378377
> 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.82447463 0.07833305 -1.13557711 -0.87713148 -1.74978799 0.94596515
[7] -1.03000010 -0.25138311 1.07722778 0.06023066 -0.39163047 0.23200103
[13] 1.30190103 -0.55380539 0.39939284 1.06631534 0.25402291 -1.94694304
[19] 0.04294196 -0.30575373 -0.39047000 -0.46679924 -0.31895142 0.04984183
[25] -0.31053495 -0.10393576 1.45371799 -1.37629220 0.24760301 -0.44426647
[31] 0.21217107 -1.44642214 0.94587793 0.37360032 -0.14728676 1.13694445
[37] -1.24498608 0.64080242 -0.48165586 -0.44659594 -1.57918230 -1.43714755
[43] -0.04855260 0.04853508 -0.72525877 1.25713569 0.27041257 0.20992127
[49] 0.02822682 -0.21831794 0.24855500 -1.17443528 0.29953290 -0.77650640
[55] 1.57162722 -1.36292515 -0.83162522 0.87692826 -0.03061799 -1.03170613
[61] -1.29725123 0.87599903 -0.64704217 0.81730891 -0.35220225 -0.63023269
[67] 0.42965201 0.14958122 1.29000011 -1.10664707 0.14846895 -0.59038288
[73] -0.07661217 -1.13255667 -0.87941715 0.50627762 0.53401518 1.06076523
[79] -1.08525257 -0.34582326 -0.79276967 -1.59974345 -1.60546474 1.88682742
[85] -0.11868774 1.38471172 1.04177085 0.32098599 0.26674198 -0.29932833
[91] -0.34971673 1.71463993 -0.61044823 -0.87338593 -1.51942037 -1.26098944
[97] -0.14182935 2.34558137 2.19285526 -0.33378377
> colMin(tmp)
[1] 0.82447463 0.07833305 -1.13557711 -0.87713148 -1.74978799 0.94596515
[7] -1.03000010 -0.25138311 1.07722778 0.06023066 -0.39163047 0.23200103
[13] 1.30190103 -0.55380539 0.39939284 1.06631534 0.25402291 -1.94694304
[19] 0.04294196 -0.30575373 -0.39047000 -0.46679924 -0.31895142 0.04984183
[25] -0.31053495 -0.10393576 1.45371799 -1.37629220 0.24760301 -0.44426647
[31] 0.21217107 -1.44642214 0.94587793 0.37360032 -0.14728676 1.13694445
[37] -1.24498608 0.64080242 -0.48165586 -0.44659594 -1.57918230 -1.43714755
[43] -0.04855260 0.04853508 -0.72525877 1.25713569 0.27041257 0.20992127
[49] 0.02822682 -0.21831794 0.24855500 -1.17443528 0.29953290 -0.77650640
[55] 1.57162722 -1.36292515 -0.83162522 0.87692826 -0.03061799 -1.03170613
[61] -1.29725123 0.87599903 -0.64704217 0.81730891 -0.35220225 -0.63023269
[67] 0.42965201 0.14958122 1.29000011 -1.10664707 0.14846895 -0.59038288
[73] -0.07661217 -1.13255667 -0.87941715 0.50627762 0.53401518 1.06076523
[79] -1.08525257 -0.34582326 -0.79276967 -1.59974345 -1.60546474 1.88682742
[85] -0.11868774 1.38471172 1.04177085 0.32098599 0.26674198 -0.29932833
[91] -0.34971673 1.71463993 -0.61044823 -0.87338593 -1.51942037 -1.26098944
[97] -0.14182935 2.34558137 2.19285526 -0.33378377
> colMedians(tmp)
[1] 0.82447463 0.07833305 -1.13557711 -0.87713148 -1.74978799 0.94596515
[7] -1.03000010 -0.25138311 1.07722778 0.06023066 -0.39163047 0.23200103
[13] 1.30190103 -0.55380539 0.39939284 1.06631534 0.25402291 -1.94694304
[19] 0.04294196 -0.30575373 -0.39047000 -0.46679924 -0.31895142 0.04984183
[25] -0.31053495 -0.10393576 1.45371799 -1.37629220 0.24760301 -0.44426647
[31] 0.21217107 -1.44642214 0.94587793 0.37360032 -0.14728676 1.13694445
[37] -1.24498608 0.64080242 -0.48165586 -0.44659594 -1.57918230 -1.43714755
[43] -0.04855260 0.04853508 -0.72525877 1.25713569 0.27041257 0.20992127
[49] 0.02822682 -0.21831794 0.24855500 -1.17443528 0.29953290 -0.77650640
[55] 1.57162722 -1.36292515 -0.83162522 0.87692826 -0.03061799 -1.03170613
[61] -1.29725123 0.87599903 -0.64704217 0.81730891 -0.35220225 -0.63023269
[67] 0.42965201 0.14958122 1.29000011 -1.10664707 0.14846895 -0.59038288
[73] -0.07661217 -1.13255667 -0.87941715 0.50627762 0.53401518 1.06076523
[79] -1.08525257 -0.34582326 -0.79276967 -1.59974345 -1.60546474 1.88682742
[85] -0.11868774 1.38471172 1.04177085 0.32098599 0.26674198 -0.29932833
[91] -0.34971673 1.71463993 -0.61044823 -0.87338593 -1.51942037 -1.26098944
[97] -0.14182935 2.34558137 2.19285526 -0.33378377
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.8244746 0.07833305 -1.135577 -0.8771315 -1.749788 0.9459652 -1.03
[2,] 0.8244746 0.07833305 -1.135577 -0.8771315 -1.749788 0.9459652 -1.03
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.2513831 1.077228 0.06023066 -0.3916305 0.232001 1.301901 -0.5538054
[2,] -0.2513831 1.077228 0.06023066 -0.3916305 0.232001 1.301901 -0.5538054
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.3993928 1.066315 0.2540229 -1.946943 0.04294196 -0.3057537 -0.39047
[2,] 0.3993928 1.066315 0.2540229 -1.946943 0.04294196 -0.3057537 -0.39047
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.4667992 -0.3189514 0.04984183 -0.3105349 -0.1039358 1.453718 -1.376292
[2,] -0.4667992 -0.3189514 0.04984183 -0.3105349 -0.1039358 1.453718 -1.376292
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.247603 -0.4442665 0.2121711 -1.446422 0.9458779 0.3736003 -0.1472868
[2,] 0.247603 -0.4442665 0.2121711 -1.446422 0.9458779 0.3736003 -0.1472868
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.136944 -1.244986 0.6408024 -0.4816559 -0.4465959 -1.579182 -1.437148
[2,] 1.136944 -1.244986 0.6408024 -0.4816559 -0.4465959 -1.579182 -1.437148
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.0485526 0.04853508 -0.7252588 1.257136 0.2704126 0.2099213 0.02822682
[2,] -0.0485526 0.04853508 -0.7252588 1.257136 0.2704126 0.2099213 0.02822682
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.2183179 0.248555 -1.174435 0.2995329 -0.7765064 1.571627 -1.362925
[2,] -0.2183179 0.248555 -1.174435 0.2995329 -0.7765064 1.571627 -1.362925
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.8316252 0.8769283 -0.03061799 -1.031706 -1.297251 0.875999 -0.6470422
[2,] -0.8316252 0.8769283 -0.03061799 -1.031706 -1.297251 0.875999 -0.6470422
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.8173089 -0.3522023 -0.6302327 0.429652 0.1495812 1.29 -1.106647
[2,] 0.8173089 -0.3522023 -0.6302327 0.429652 0.1495812 1.29 -1.106647
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.1484689 -0.5903829 -0.07661217 -1.132557 -0.8794172 0.5062776 0.5340152
[2,] 0.1484689 -0.5903829 -0.07661217 -1.132557 -0.8794172 0.5062776 0.5340152
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.060765 -1.085253 -0.3458233 -0.7927697 -1.599743 -1.605465 1.886827
[2,] 1.060765 -1.085253 -0.3458233 -0.7927697 -1.599743 -1.605465 1.886827
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.1186877 1.384712 1.041771 0.320986 0.266742 -0.2993283 -0.3497167
[2,] -0.1186877 1.384712 1.041771 0.320986 0.266742 -0.2993283 -0.3497167
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.71464 -0.6104482 -0.8733859 -1.51942 -1.260989 -0.1418293 2.345581
[2,] 1.71464 -0.6104482 -0.8733859 -1.51942 -1.260989 -0.1418293 2.345581
[,99] [,100]
[1,] 2.192855 -0.3337838
[2,] 2.192855 -0.3337838
>
>
> Max(tmp2)
[1] 2.74953
> Min(tmp2)
[1] -2.646903
> mean(tmp2)
[1] 0.1430072
> Sum(tmp2)
[1] 14.30072
> Var(tmp2)
[1] 1.219614
>
> rowMeans(tmp2)
[1] 0.61522479 -1.25669307 -0.45491677 -0.26128894 -1.12574829 1.39793416
[7] 0.61878833 -1.50528984 1.47497138 -0.31350614 0.50417105 0.35663537
[13] 0.70558263 -0.32231949 0.69976943 -1.90249116 -0.12867171 -0.76563112
[19] -0.69588061 -1.91278365 1.11026570 1.89155256 -0.32356177 0.22376521
[25] 0.76461158 1.44803401 -0.14673546 0.61465596 -0.68703568 -0.44550323
[31] 0.31373963 -0.93723376 0.22616292 -1.30453074 2.51636313 -0.36021938
[37] 0.62716738 0.09294746 1.13653820 0.17240821 -1.51653246 2.04331703
[43] 1.21227991 0.35747608 -1.38015058 -0.26380553 1.76745853 -2.64690285
[49] -0.99688249 -0.13383081 1.46545666 -0.74093399 1.78133294 1.22220040
[55] 2.25315020 0.31252544 -1.43716171 -0.17631642 -0.60109505 -0.46874415
[61] -0.35148032 0.04452383 0.24138971 -0.76351495 1.70868194 -1.44691154
[67] 0.44269393 0.66586794 0.90287116 2.74952963 0.38091985 0.60401429
[73] -0.72109270 -1.13395116 0.63798191 1.05432302 -1.15881371 -0.36120688
[79] -0.74744850 0.32750796 -0.36302113 -0.06662472 -0.39796721 0.26794166
[85] -1.32144315 1.68722932 -1.03281278 2.07680534 1.09151997 -0.36954551
[91] 2.14980578 2.34030420 0.68358701 0.78271756 -1.29982403 0.16998748
[97] 0.88514631 0.10826918 -0.33984050 -0.54149251
> rowSums(tmp2)
[1] 0.61522479 -1.25669307 -0.45491677 -0.26128894 -1.12574829 1.39793416
[7] 0.61878833 -1.50528984 1.47497138 -0.31350614 0.50417105 0.35663537
[13] 0.70558263 -0.32231949 0.69976943 -1.90249116 -0.12867171 -0.76563112
[19] -0.69588061 -1.91278365 1.11026570 1.89155256 -0.32356177 0.22376521
[25] 0.76461158 1.44803401 -0.14673546 0.61465596 -0.68703568 -0.44550323
[31] 0.31373963 -0.93723376 0.22616292 -1.30453074 2.51636313 -0.36021938
[37] 0.62716738 0.09294746 1.13653820 0.17240821 -1.51653246 2.04331703
[43] 1.21227991 0.35747608 -1.38015058 -0.26380553 1.76745853 -2.64690285
[49] -0.99688249 -0.13383081 1.46545666 -0.74093399 1.78133294 1.22220040
[55] 2.25315020 0.31252544 -1.43716171 -0.17631642 -0.60109505 -0.46874415
[61] -0.35148032 0.04452383 0.24138971 -0.76351495 1.70868194 -1.44691154
[67] 0.44269393 0.66586794 0.90287116 2.74952963 0.38091985 0.60401429
[73] -0.72109270 -1.13395116 0.63798191 1.05432302 -1.15881371 -0.36120688
[79] -0.74744850 0.32750796 -0.36302113 -0.06662472 -0.39796721 0.26794166
[85] -1.32144315 1.68722932 -1.03281278 2.07680534 1.09151997 -0.36954551
[91] 2.14980578 2.34030420 0.68358701 0.78271756 -1.29982403 0.16998748
[97] 0.88514631 0.10826918 -0.33984050 -0.54149251
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] 0.61522479 -1.25669307 -0.45491677 -0.26128894 -1.12574829 1.39793416
[7] 0.61878833 -1.50528984 1.47497138 -0.31350614 0.50417105 0.35663537
[13] 0.70558263 -0.32231949 0.69976943 -1.90249116 -0.12867171 -0.76563112
[19] -0.69588061 -1.91278365 1.11026570 1.89155256 -0.32356177 0.22376521
[25] 0.76461158 1.44803401 -0.14673546 0.61465596 -0.68703568 -0.44550323
[31] 0.31373963 -0.93723376 0.22616292 -1.30453074 2.51636313 -0.36021938
[37] 0.62716738 0.09294746 1.13653820 0.17240821 -1.51653246 2.04331703
[43] 1.21227991 0.35747608 -1.38015058 -0.26380553 1.76745853 -2.64690285
[49] -0.99688249 -0.13383081 1.46545666 -0.74093399 1.78133294 1.22220040
[55] 2.25315020 0.31252544 -1.43716171 -0.17631642 -0.60109505 -0.46874415
[61] -0.35148032 0.04452383 0.24138971 -0.76351495 1.70868194 -1.44691154
[67] 0.44269393 0.66586794 0.90287116 2.74952963 0.38091985 0.60401429
[73] -0.72109270 -1.13395116 0.63798191 1.05432302 -1.15881371 -0.36120688
[79] -0.74744850 0.32750796 -0.36302113 -0.06662472 -0.39796721 0.26794166
[85] -1.32144315 1.68722932 -1.03281278 2.07680534 1.09151997 -0.36954551
[91] 2.14980578 2.34030420 0.68358701 0.78271756 -1.29982403 0.16998748
[97] 0.88514631 0.10826918 -0.33984050 -0.54149251
> rowMin(tmp2)
[1] 0.61522479 -1.25669307 -0.45491677 -0.26128894 -1.12574829 1.39793416
[7] 0.61878833 -1.50528984 1.47497138 -0.31350614 0.50417105 0.35663537
[13] 0.70558263 -0.32231949 0.69976943 -1.90249116 -0.12867171 -0.76563112
[19] -0.69588061 -1.91278365 1.11026570 1.89155256 -0.32356177 0.22376521
[25] 0.76461158 1.44803401 -0.14673546 0.61465596 -0.68703568 -0.44550323
[31] 0.31373963 -0.93723376 0.22616292 -1.30453074 2.51636313 -0.36021938
[37] 0.62716738 0.09294746 1.13653820 0.17240821 -1.51653246 2.04331703
[43] 1.21227991 0.35747608 -1.38015058 -0.26380553 1.76745853 -2.64690285
[49] -0.99688249 -0.13383081 1.46545666 -0.74093399 1.78133294 1.22220040
[55] 2.25315020 0.31252544 -1.43716171 -0.17631642 -0.60109505 -0.46874415
[61] -0.35148032 0.04452383 0.24138971 -0.76351495 1.70868194 -1.44691154
[67] 0.44269393 0.66586794 0.90287116 2.74952963 0.38091985 0.60401429
[73] -0.72109270 -1.13395116 0.63798191 1.05432302 -1.15881371 -0.36120688
[79] -0.74744850 0.32750796 -0.36302113 -0.06662472 -0.39796721 0.26794166
[85] -1.32144315 1.68722932 -1.03281278 2.07680534 1.09151997 -0.36954551
[91] 2.14980578 2.34030420 0.68358701 0.78271756 -1.29982403 0.16998748
[97] 0.88514631 0.10826918 -0.33984050 -0.54149251
>
> colMeans(tmp2)
[1] 0.1430072
> colSums(tmp2)
[1] 14.30072
> colVars(tmp2)
[1] 1.219614
> colSd(tmp2)
[1] 1.104361
> colMax(tmp2)
[1] 2.74953
> colMin(tmp2)
[1] -2.646903
> colMedians(tmp2)
[1] 0.1391283
> colRanges(tmp2)
[,1]
[1,] -2.646903
[2,] 2.749530
>
> 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] 4.1192800 3.2108799 3.9794877 -0.9447527 -5.8860263 -1.9581225
[7] -2.5943204 8.7556689 -5.1411710 2.2889674
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.0589324
[2,] -0.3307237
[3,] 0.4223727
[4,] 1.1445886
[5,] 2.0698024
>
> rowApply(tmp,sum)
[1] 6.1585287 0.4744495 1.0595895 2.9462431 2.9028257 2.3738765
[7] -3.1391106 -1.5583880 -5.9982259 0.6101026
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 7 10 6 1 8 9 9 4 5
[2,] 3 9 7 5 9 4 3 8 5 6
[3,] 7 5 9 8 8 5 5 5 8 7
[4,] 4 4 3 7 6 3 4 6 3 9
[5,] 1 6 2 2 5 7 2 4 2 3
[6,] 6 2 8 3 10 1 8 1 6 2
[7,] 8 1 6 4 3 2 10 3 1 10
[8,] 5 10 5 9 7 9 6 10 9 8
[9,] 2 3 1 1 4 10 1 2 7 4
[10,] 10 8 4 10 2 6 7 7 10 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.25880655 -0.07328981 -4.72021408 1.18348200 -5.95852069 3.15822467
[7] -1.43391332 -0.91322233 3.56434049 1.25263507 -0.79249051 -0.81642146
[13] -2.59410556 0.26568794 -1.28304447 1.93696117 4.08972102 3.01907271
[19] -1.65038040 0.86944185
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.4604393
[2,] -0.6924963
[3,] -0.3197445
[4,] 0.4106570
[5,] 0.8032165
>
> rowApply(tmp,sum)
[1] -3.523172 1.856111 -2.656146 3.979531 -1.811166
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 3 5 9 15 13
[2,] 8 7 14 12 11
[3,] 4 4 2 10 4
[4,] 11 15 10 19 1
[5,] 1 8 7 2 3
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.4604393 -0.1913000 -1.2564713 0.06307563 -2.3361104 0.4839975
[2,] -0.6924963 -0.3975675 -0.7886802 0.83987099 -0.3315830 1.4437953
[3,] -0.3197445 0.2982790 -1.4942831 0.11519006 -0.5278026 -0.9956957
[4,] 0.8032165 0.3633192 0.1543586 1.80066299 -1.4125750 0.2692852
[5,] 0.4106570 -0.1460205 -1.3351381 -1.63531768 -1.3504498 1.9568424
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.2656375 0.3121772 1.9661139 -0.1510709 -1.6154442 0.9602818
[2,] 0.2910651 -1.1536767 -0.5961298 -0.2297187 0.2113022 1.1405049
[3,] 0.3415876 0.2911665 0.9129278 1.2940491 0.7437505 -2.1433981
[4,] -1.4998514 0.5050445 2.0300679 -0.6943602 -0.6682193 0.6861706
[5,] -0.3010771 -0.8679338 -0.7486394 1.0337357 0.5361203 -1.4599806
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.3731599 -1.2144688 0.4690354 0.4202351 0.1347440 0.37820078
[2,] -1.3005097 0.5773331 -1.1949123 1.5714492 1.3308236 0.07430376
[3,] -1.2417403 0.2330886 -0.5042444 -1.1012911 1.3246907 0.11920880
[4,] -0.3945075 0.8750453 1.0272966 -0.3828619 0.1178689 1.54655387
[5,] 0.7158118 -0.2053103 -1.0802198 1.4294299 1.1815938 0.90080550
[,19] [,20]
[1,] 0.2489244 -0.09585491
[2,] 0.1129402 0.94799708
[3,] -0.5913799 0.58949463
[4,] -0.5445072 -0.60247681
[5,] -0.8763579 0.03028187
>
>
> 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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 650 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 563 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 1.621862 -1.622257 -0.1560512 0.03110137 0.681254 0.1762181 -1.948196
col8 col9 col10 col11 col12 col13 col14
row1 1.777524 2.329489 -0.2913392 0.6946045 0.1006287 0.215981 -0.543114
col15 col16 col17 col18 col19 col20
row1 -0.7531127 0.9611954 0.7291225 -0.1053665 0.1062 0.5382058
> tmp[,"col10"]
col10
row1 -0.29133922
row2 1.25260967
row3 0.57002580
row4 0.05968403
row5 0.41693662
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 1.6218622 -1.6222572 -0.1560512 0.03110137 0.6812540 0.1762181
row5 -0.4315988 -0.2909303 -0.5104182 -0.86909874 -0.5842266 -0.5672454
col7 col8 col9 col10 col11 col12 col13
row1 -1.9481957 1.777524 2.329489 -0.2913392 0.6946045 0.1006287 0.2159810
row5 -0.2515213 1.229427 1.086542 0.4169366 -0.5134259 1.5220915 -0.4404681
col14 col15 col16 col17 col18 col19
row1 -0.543114 -0.7531127 0.9611954 0.72912254 -0.1053665 0.1062000
row5 -0.726563 0.4689064 0.1470214 -0.06732666 0.1378775 -0.5373323
col20
row1 0.5382058
row5 -0.4916876
> tmp[,c("col6","col20")]
col6 col20
row1 0.1762181 0.5382058
row2 -1.9123864 2.3429330
row3 0.3048864 -0.6829956
row4 2.1021307 0.2591427
row5 -0.5672454 -0.4916876
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.1762181 0.5382058
row5 -0.5672454 -0.4916876
>
>
>
>
> 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 51.14653 50.93189 49.333 51.11781 49.66533 105.3316 49.43303 50.70956
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.15579 49.22861 49.18509 49.724 51.11096 49.33319 49.89709 50.18834
col17 col18 col19 col20
row1 49.9604 51.69744 50.46376 107.34
> tmp[,"col10"]
col10
row1 49.22861
row2 31.79188
row3 27.62742
row4 29.43713
row5 50.04460
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.14653 50.93189 49.33300 51.11781 49.66533 105.3316 49.43303 50.70956
row5 50.13293 49.40010 47.59686 50.24768 50.20057 106.0132 48.64884 47.79903
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.15579 49.22861 49.18509 49.72400 51.11096 49.33319 49.89709 50.18834
row5 49.62623 50.04460 50.93176 52.76521 51.15832 50.40620 49.19127 49.19896
col17 col18 col19 col20
row1 49.96040 51.69744 50.46376 107.3400
row5 51.31378 49.56496 51.13428 104.6191
> tmp[,c("col6","col20")]
col6 col20
row1 105.33164 107.33995
row2 77.25970 74.91511
row3 74.65530 75.73025
row4 74.78002 73.70618
row5 106.01319 104.61913
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.3316 107.3400
row5 106.0132 104.6191
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.3316 107.3400
row5 106.0132 104.6191
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.5571951
[2,] 1.0070762
[3,] -1.4281600
[4,] 0.8054796
[5,] 0.5640597
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.3111708 0.9971344
[2,] 0.8343897 -0.2358241
[3,] -2.3244825 -0.1695903
[4,] -0.3954662 -1.4256449
[5,] -0.3551713 0.6021432
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.110588 -2.5053128
[2,] -2.694440 -1.4630373
[3,] -1.489572 -0.8147547
[4,] 1.263280 -0.6674573
[5,] 1.375379 2.2295307
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.110588
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.110588
[2,] -2.694440
>
>
>
> 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 0.6498474 -2.4607950 -0.4374143 -0.1069501 -0.2515405 -0.2254736
row1 -0.3562067 0.9040204 -1.2554860 0.5546366 -0.1267850 0.4673150
[,7] [,8] [,9] [,10] [,11] [,12]
row3 0.2102290 -0.2966713 -1.0236099 0.02444327 -2.89378811 -0.30175232
row1 -0.5456551 2.3699757 0.9532048 -0.88014964 0.02579127 -0.05525723
[,13] [,14] [,15] [,16] [,17] [,18]
row3 0.8971137 0.5678058 0.1328517 -0.28716455 1.402313 -0.4367415
row1 -0.3369450 -0.5599136 -1.1228888 0.03057742 1.708222 -1.2047671
[,19] [,20]
row3 0.7178789 1.0197778
row1 -0.6817666 0.8856861
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.2524701 0.8720557 0.9840541 1.277708 -1.227522 -0.8570523 -0.2759067
[,8] [,9] [,10]
row2 0.3841352 0.9335874 1.062668
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.6189106 0.6304684 0.03167944 0.1971078 -2.319722 0.2337805 -0.9760279
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.1141576 0.04572132 -0.177733 0.110472 0.2781105 -0.184403 0.01286654
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.014846 0.07058751 0.6958951 0.6083754 -0.9639185 -0.4868628
>
>
> 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: 0x6000006a8120>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM92621dba237c"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9262276fb123"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM926215d6850f"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM926236b9a6fc"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM926256820675"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9262727617b1"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9262270da02c"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM92626f8ebcbb"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9262408d235"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM92625f2097a4"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM926254c3c0c6"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM92627fa532a3"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9262369faccd"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM92622d09e2bf"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM9262640580b2"
>
>
> ### 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: 0x6000006b8360>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000006b8360>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6000006b8360>
> rowMedians(tmp)
[1] -0.091684870 0.230502443 0.305359508 -0.546921134 0.330422757
[6] 0.352665366 -0.260811529 0.182554870 0.357184932 0.183763117
[11] 0.062995539 -0.327753652 -0.315690564 -0.056304835 -0.185980911
[16] -0.485063721 -0.087838012 0.407481143 0.272682502 0.184027945
[21] 0.042445369 0.547037290 0.310059507 -0.404113604 -0.153455083
[26] 0.487090477 0.536536703 -0.060208162 0.124847773 0.647814708
[31] -0.645130412 0.385281419 -0.272884491 0.022884202 0.863382831
[36] 0.123361385 0.104658541 -0.030500048 -0.777750772 0.154256761
[41] -0.078445520 0.128597021 0.479991553 0.138286176 0.287574452
[46] -0.336707884 -0.345325270 -0.367986610 -0.241643953 -0.585421911
[51] 0.143978767 0.300133827 -0.357620779 -0.197265941 -0.228979738
[56] 0.104138995 0.566844425 0.193881227 -0.301948655 0.179435167
[61] 0.326367341 0.657943137 -0.021749078 -0.054104139 0.018513315
[66] 0.271868430 0.286561238 0.487437924 -0.044540292 -0.336653919
[71] -0.103123374 0.188641340 -0.507387040 0.209560406 0.159440056
[76] 0.115893855 0.223986290 0.366321152 -0.875349848 0.235446590
[81] 0.521531131 -0.447994450 -1.027465716 -0.454786175 -0.034085465
[86] -0.138478843 -0.101358767 0.011183421 0.190110984 -0.236054926
[91] -0.281329815 0.021993646 0.032007197 0.319294894 0.217789224
[96] -0.679140987 0.633697087 0.030054702 0.221491691 -0.225412307
[101] -0.456544397 0.216906240 -0.448128409 -0.065342411 0.136808327
[106] -0.312410815 0.293540376 0.557878702 -0.596073306 0.536184130
[111] 0.009200138 -0.295640748 0.142320341 0.042140580 -0.067799121
[116] -0.566648167 0.323065503 -0.064219957 -0.003590215 -0.186608605
[121] -0.297942575 -0.116668853 -0.066038724 -0.088489240 -0.615706843
[126] 0.009659936 -0.011564458 0.118798554 0.350552886 -0.379203014
[131] 0.200424309 0.114906808 -0.265702677 0.005795578 0.481989216
[136] -0.120887165 -0.240381503 -0.244502442 0.069169248 0.623502164
[141] -0.489783213 -0.132252050 0.229244322 0.251383526 0.698099348
[146] -0.019230351 0.098993396 -0.051945116 0.305830487 -0.019570294
[151] 0.044396474 -0.326790088 -0.465813799 0.005010486 -0.123305266
[156] -0.136703542 0.717330240 -0.290089682 0.333982094 -0.117776364
[161] -0.126535866 0.141839503 -0.230015137 0.387122928 0.153212014
[166] -0.703862294 0.455120970 -0.049989144 -0.157695378 0.055574107
[171] 0.333416295 -0.274121163 -0.112265956 0.206144355 0.282116416
[176] -0.160661863 0.026625172 0.093083438 0.542719478 0.253965069
[181] -0.219858680 -0.365972569 -0.135151539 0.478364294 -0.072801479
[186] -0.152263037 -0.547362163 0.005672797 -0.402126056 -0.420088393
[191] -0.079104027 -0.128948570 -0.186326802 0.625263798 -0.002728702
[196] 0.047483887 0.190371959 -0.489613925 -0.428599948 0.537205350
[201] 0.160866365 0.212843588 0.501106079 0.115370237 -0.499699923
[206] -0.215329515 -0.291709758 0.468642388 0.005629087 0.213655494
[211] -0.353709155 0.221788838 0.041436434 -0.517665140 -0.798562474
[216] 0.174681978 -0.089915757 0.149173156 0.399677135 0.204594683
[221] 0.366780542 -0.243387384 0.363839216 0.405406305 0.041975536
[226] -0.125994991 -0.039607249 -0.275929919 0.053409003 -0.038657092
>
> proc.time()
user system elapsed
0.701 3.340 4.555
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 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: 0x60000333c000>
> .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: 0x60000333c000>
> .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: 0x60000333c000>
> .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: 0x60000333c000>
> 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: 0x6000033041e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033041e0>
> .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: 0x6000033041e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033041e0>
> .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: 0x6000033041e0>
> 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: 0x6000033043c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033043c0>
> .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: 0x6000033043c0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000033043c0>
> .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: 0x6000033043c0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000033043c0>
> .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: 0x6000033043c0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000033043c0>
> .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: 0x6000033043c0>
> 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: 0x6000033045a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000033045a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033045a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000033045a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile9654208e5bbd" "BufferedMatrixFile965430c6249f"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile9654208e5bbd" "BufferedMatrixFile965430c6249f"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003304840>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003304840>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003304840>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600003304840>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600003304840>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600003304840>
> .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: 0x600003304a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600003304a20>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600003304a20>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600003304a20>
> 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: 0x600003304c00>
> .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: 0x600003304c00>
> rm(P)
>
> proc.time()
user system elapsed
0.141 0.048 0.182
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 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.130 0.036 0.162