| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-07 11:33 -0500 (Sat, 07 Mar 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences" | 4453 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-02-28 r89501) -- "Unsuffered Consequences" | 3376 |
| 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-06 16:56:44 -0500 (Fri, 06 Mar 2026) |
| EndedAt: 2026-03-06 16:57:07 -0500 (Fri, 06 Mar 2026) |
| EllapsedTime: 22.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-02-28 r89501)
* 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
* current time: 2026-03-06 21:56:45 UTC
* 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-02-28 r89501) -- "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.060 0.238
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-02-28 r89501) -- "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 481912 25.8 1060020 56.7 NA 633742 33.9
Vcells 892229 6.9 8388608 64.0 196608 2111484 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] "Fri Mar 6 16:56:58 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] "Fri Mar 6 16:56:58 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: 0x600003ef42a0>
>
>
>
> 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] "Fri Mar 6 16:56:59 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] "Fri Mar 6 16:57:00 2026"
>
> ColMode(tmp2)
<pointer: 0x600003ef42a0>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.0748180 1.57427483 0.1987427 0.3103805
[2,] -1.9977918 -0.26734601 -1.4373152 0.1588296
[3,] 0.3818376 0.01053495 -0.2407313 0.3805252
[4,] 1.9695179 0.78167780 -1.1420522 -0.7154855
> 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,] 101.0748180 1.57427483 0.1987427 0.3103805
[2,] 1.9977918 0.26734601 1.4373152 0.1588296
[3,] 0.3818376 0.01053495 0.2407313 0.3805252
[4,] 1.9695179 0.78167780 1.1420522 0.7154855
> 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,] 10.0535973 1.2547011 0.4458057 0.5571181
[2,] 1.4134326 0.5170551 1.1988808 0.3985343
[3,] 0.6179301 0.1026399 0.4906438 0.6168673
[4,] 1.4033951 0.8841254 1.0686684 0.8458637
>
> 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,] 226.61079 39.12129 29.65680 30.88156
[2,] 41.13212 30.43790 38.42612 29.14417
[3,] 31.56114 26.03693 30.14717 31.54920
[4,] 41.00347 34.62293 36.82874 34.17412
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003ec80c0>
> exp(tmp5)
<pointer: 0x600003ec80c0>
> log(tmp5,2)
<pointer: 0x600003ec80c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.6607
> Min(tmp5)
[1] 52.31241
> mean(tmp5)
[1] 73.5444
> Sum(tmp5)
[1] 14708.88
> Var(tmp5)
[1] 867.3171
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 94.96263 71.20631 66.14206 69.85482 72.84363 69.97305 72.18539 73.65151
[9] 72.52984 72.09476
> rowSums(tmp5)
[1] 1899.253 1424.126 1322.841 1397.096 1456.873 1399.461 1443.708 1473.030
[9] 1450.597 1441.895
> rowVars(tmp5)
[1] 7916.72634 92.77100 66.24906 71.84119 77.87859 75.44627
[7] 52.26473 30.08017 49.56044 71.34553
> rowSd(tmp5)
[1] 88.975987 9.631770 8.139352 8.475918 8.824885 8.685981 7.229435
[8] 5.484539 7.039918 8.446628
> rowMax(tmp5)
[1] 471.66067 85.65197 87.58207 85.34335 85.32331 88.90568 87.28455
[8] 81.73585 87.32846 82.59121
> rowMin(tmp5)
[1] 61.72674 55.52693 54.19247 55.99399 52.31241 57.69963 56.23780 62.28972
[9] 58.59508 57.33899
>
> colMeans(tmp5)
[1] 116.87358 68.55384 69.20703 70.88497 71.49080 72.23637 68.49199
[8] 71.34893 72.64491 70.11366 72.78702 73.41610 74.72970 71.21425
[15] 67.37801 70.38330 71.08576 71.67357 73.64138 72.73284
> colSums(tmp5)
[1] 1168.7358 685.5384 692.0703 708.8497 714.9080 722.3637 684.9199
[8] 713.4893 726.4491 701.1366 727.8702 734.1610 747.2970 712.1425
[15] 673.7801 703.8330 710.8576 716.7357 736.4138 727.3284
> colVars(tmp5)
[1] 15584.66874 78.00326 73.34353 64.94721 76.06696 91.10705
[7] 44.24572 90.37172 76.91186 68.80629 57.73934 73.48010
[13] 65.51059 69.60372 63.43421 34.40040 83.11333 59.51023
[19] 66.94067 85.45360
> colSd(tmp5)
[1] 124.838571 8.831945 8.564084 8.058983 8.721637 9.545001
[7] 6.651746 9.506404 8.769941 8.294955 7.598641 8.572054
[13] 8.093862 8.342884 7.964560 5.865185 9.116651 7.714287
[19] 8.181728 9.244111
> colMax(tmp5)
[1] 471.66067 81.42583 79.97894 84.14735 88.90568 85.65197 83.23878
[8] 87.28455 83.25461 85.32331 81.73585 80.97100 88.67891 87.58207
[15] 76.90715 76.25252 83.94972 81.83095 85.39219 86.92356
> colMin(tmp5)
[1] 65.69037 54.19247 57.33899 60.65978 61.72876 57.09390 56.23780 58.59490
[9] 58.27232 59.29909 58.59508 55.52693 63.47133 57.69963 52.31241 58.35237
[17] 57.48832 58.18105 58.18916 56.78673
>
>
> ### 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] 94.96263 71.20631 NA 69.85482 72.84363 69.97305 72.18539 73.65151
[9] 72.52984 72.09476
> rowSums(tmp5)
[1] 1899.253 1424.126 NA 1397.096 1456.873 1399.461 1443.708 1473.030
[9] 1450.597 1441.895
> rowVars(tmp5)
[1] 7916.72634 92.77100 68.66000 71.84119 77.87859 75.44627
[7] 52.26473 30.08017 49.56044 71.34553
> rowSd(tmp5)
[1] 88.975987 9.631770 8.286133 8.475918 8.824885 8.685981 7.229435
[8] 5.484539 7.039918 8.446628
> rowMax(tmp5)
[1] 471.66067 85.65197 NA 85.34335 85.32331 88.90568 87.28455
[8] 81.73585 87.32846 82.59121
> rowMin(tmp5)
[1] 61.72674 55.52693 NA 55.99399 52.31241 57.69963 56.23780 62.28972
[9] 58.59508 57.33899
>
> colMeans(tmp5)
[1] 116.87358 68.55384 69.20703 70.88497 71.49080 72.23637 68.49199
[8] 71.34893 72.64491 70.11366 72.78702 73.41610 NA 71.21425
[15] 67.37801 70.38330 71.08576 71.67357 73.64138 72.73284
> colSums(tmp5)
[1] 1168.7358 685.5384 692.0703 708.8497 714.9080 722.3637 684.9199
[8] 713.4893 726.4491 701.1366 727.8702 734.1610 NA 712.1425
[15] 673.7801 703.8330 710.8576 716.7357 736.4138 727.3284
> colVars(tmp5)
[1] 15584.66874 78.00326 73.34353 64.94721 76.06696 91.10705
[7] 44.24572 90.37172 76.91186 68.80629 57.73934 73.48010
[13] NA 69.60372 63.43421 34.40040 83.11333 59.51023
[19] 66.94067 85.45360
> colSd(tmp5)
[1] 124.838571 8.831945 8.564084 8.058983 8.721637 9.545001
[7] 6.651746 9.506404 8.769941 8.294955 7.598641 8.572054
[13] NA 8.342884 7.964560 5.865185 9.116651 7.714287
[19] 8.181728 9.244111
> colMax(tmp5)
[1] 471.66067 81.42583 79.97894 84.14735 88.90568 85.65197 83.23878
[8] 87.28455 83.25461 85.32331 81.73585 80.97100 NA 87.58207
[15] 76.90715 76.25252 83.94972 81.83095 85.39219 86.92356
> colMin(tmp5)
[1] 65.69037 54.19247 57.33899 60.65978 61.72876 57.09390 56.23780 58.59490
[9] 58.27232 59.29909 58.59508 55.52693 NA 57.69963 52.31241 58.35237
[17] 57.48832 58.18105 58.18916 56.78673
>
> Max(tmp5,na.rm=TRUE)
[1] 471.6607
> Min(tmp5,na.rm=TRUE)
[1] 52.31241
> mean(tmp5,na.rm=TRUE)
[1] 73.55818
> Sum(tmp5,na.rm=TRUE)
[1] 14638.08
> Var(tmp5,na.rm=TRUE)
[1] 871.6593
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 94.96263 71.20631 65.89683 69.85482 72.84363 69.97305 72.18539 73.65151
[9] 72.52984 72.09476
> rowSums(tmp5,na.rm=TRUE)
[1] 1899.253 1424.126 1252.040 1397.096 1456.873 1399.461 1443.708 1473.030
[9] 1450.597 1441.895
> rowVars(tmp5,na.rm=TRUE)
[1] 7916.72634 92.77100 68.66000 71.84119 77.87859 75.44627
[7] 52.26473 30.08017 49.56044 71.34553
> rowSd(tmp5,na.rm=TRUE)
[1] 88.975987 9.631770 8.286133 8.475918 8.824885 8.685981 7.229435
[8] 5.484539 7.039918 8.446628
> rowMax(tmp5,na.rm=TRUE)
[1] 471.66067 85.65197 87.58207 85.34335 85.32331 88.90568 87.28455
[8] 81.73585 87.32846 82.59121
> rowMin(tmp5,na.rm=TRUE)
[1] 61.72674 55.52693 54.19247 55.99399 52.31241 57.69963 56.23780 62.28972
[9] 58.59508 57.33899
>
> colMeans(tmp5,na.rm=TRUE)
[1] 116.87358 68.55384 69.20703 70.88497 71.49080 72.23637 68.49199
[8] 71.34893 72.64491 70.11366 72.78702 73.41610 75.16618 71.21425
[15] 67.37801 70.38330 71.08576 71.67357 73.64138 72.73284
> colSums(tmp5,na.rm=TRUE)
[1] 1168.7358 685.5384 692.0703 708.8497 714.9080 722.3637 684.9199
[8] 713.4893 726.4491 701.1366 727.8702 734.1610 676.4956 712.1425
[15] 673.7801 703.8330 710.8576 716.7357 736.4138 727.3284
> colVars(tmp5,na.rm=TRUE)
[1] 15584.66874 78.00326 73.34353 64.94721 76.06696 91.10705
[7] 44.24572 90.37172 76.91186 68.80629 57.73934 73.48010
[13] 71.55615 69.60372 63.43421 34.40040 83.11333 59.51023
[19] 66.94067 85.45360
> colSd(tmp5,na.rm=TRUE)
[1] 124.838571 8.831945 8.564084 8.058983 8.721637 9.545001
[7] 6.651746 9.506404 8.769941 8.294955 7.598641 8.572054
[13] 8.459087 8.342884 7.964560 5.865185 9.116651 7.714287
[19] 8.181728 9.244111
> colMax(tmp5,na.rm=TRUE)
[1] 471.66067 81.42583 79.97894 84.14735 88.90568 85.65197 83.23878
[8] 87.28455 83.25461 85.32331 81.73585 80.97100 88.67891 87.58207
[15] 76.90715 76.25252 83.94972 81.83095 85.39219 86.92356
> colMin(tmp5,na.rm=TRUE)
[1] 65.69037 54.19247 57.33899 60.65978 61.72876 57.09390 56.23780 58.59490
[9] 58.27232 59.29909 58.59508 55.52693 63.47133 57.69963 52.31241 58.35237
[17] 57.48832 58.18105 58.18916 56.78673
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 94.96263 71.20631 NaN 69.85482 72.84363 69.97305 72.18539 73.65151
[9] 72.52984 72.09476
> rowSums(tmp5,na.rm=TRUE)
[1] 1899.253 1424.126 0.000 1397.096 1456.873 1399.461 1443.708 1473.030
[9] 1450.597 1441.895
> rowVars(tmp5,na.rm=TRUE)
[1] 7916.72634 92.77100 NA 71.84119 77.87859 75.44627
[7] 52.26473 30.08017 49.56044 71.34553
> rowSd(tmp5,na.rm=TRUE)
[1] 88.975987 9.631770 NA 8.475918 8.824885 8.685981 7.229435
[8] 5.484539 7.039918 8.446628
> rowMax(tmp5,na.rm=TRUE)
[1] 471.66067 85.65197 NA 85.34335 85.32331 88.90568 87.28455
[8] 81.73585 87.32846 82.59121
> rowMin(tmp5,na.rm=TRUE)
[1] 61.72674 55.52693 NA 55.99399 52.31241 57.69963 56.23780 62.28972
[9] 58.59508 57.33899
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 122.56060 70.14955 69.92477 71.46491 72.57547 72.93334 68.15631
[8] 72.24479 73.39993 71.31528 73.31308 74.86825 NaN 69.39560
[15] 67.39056 71.18475 72.59658 71.51248 72.68062 74.50463
> colSums(tmp5,na.rm=TRUE)
[1] 1103.0454 631.3459 629.3229 643.1842 653.1792 656.4001 613.4068
[8] 650.2031 660.5994 641.8375 659.8177 673.8142 0.0000 624.5604
[15] 606.5150 640.6627 653.3692 643.6123 654.1256 670.5417
> colVars(tmp5,na.rm=TRUE)
[1] 17168.90232 59.10798 76.71605 69.28190 72.33959 97.03054
[7] 48.50872 92.63942 80.11281 61.16332 61.84348 58.94167
[13] NA 41.09506 71.36171 31.47448 67.82329 66.65705
[19] 64.92383 60.81882
> colSd(tmp5,na.rm=TRUE)
[1] 131.030158 7.688171 8.758770 8.323575 8.505268 9.850408
[7] 6.964820 9.624937 8.950576 7.820698 7.864063 7.677348
[13] NA 6.410543 8.447586 5.610212 8.235490 8.164377
[19] 8.057532 7.798642
> colMax(tmp5,na.rm=TRUE)
[1] 471.66067 81.42583 79.97894 84.14735 88.90568 85.65197 83.23878
[8] 87.28455 83.25461 85.32331 81.73585 80.97100 -Inf 79.85497
[15] 76.90715 76.25252 83.94972 81.83095 85.39219 86.92356
> colMin(tmp5,na.rm=TRUE)
[1] 68.14010 60.51570 57.33899 60.65978 63.18797 57.09390 56.23780 58.59490
[9] 58.27232 59.58089 58.59508 55.52693 Inf 57.69963 52.31241 58.35237
[17] 59.95414 58.18105 58.18916 64.57754
>
>
>
>
> 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] 226.2348 199.3571 150.7460 153.0029 207.4043 173.0965 291.4374 231.1540
[9] 311.0096 274.9941
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 226.2348 199.3571 150.7460 153.0029 207.4043 173.0965 291.4374 231.1540
[9] 311.0096 274.9941
>
>
>
> 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 -1.705303e-13 1.136868e-13 -5.684342e-14 1.136868e-13
[6] -2.842171e-13 -5.684342e-14 -1.705303e-13 8.526513e-14 -2.842171e-13
[11] 0.000000e+00 -5.684342e-14 -1.421085e-14 2.842171e-14 -9.947598e-14
[16] -1.278977e-13 1.705303e-13 -5.684342e-14 2.842171e-13 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
6 10
5 6
9 8
9 3
6 15
5 16
7 17
5 9
1 9
6 11
8 8
1 8
8 10
1 9
8 19
8 11
4 3
4 18
4 13
6 5
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.278948
> Min(tmp)
[1] -2.535115
> mean(tmp)
[1] -0.05018908
> Sum(tmp)
[1] -5.018908
> Var(tmp)
[1] 0.8927433
>
> rowMeans(tmp)
[1] -0.05018908
> rowSums(tmp)
[1] -5.018908
> rowVars(tmp)
[1] 0.8927433
> rowSd(tmp)
[1] 0.944851
> rowMax(tmp)
[1] 2.278948
> rowMin(tmp)
[1] -2.535115
>
> colMeans(tmp)
[1] 0.42336616 0.18522564 -0.48187861 -0.41644006 0.48047238 -0.27304166
[7] 0.98320349 -1.93647234 -0.03667412 0.18452038 1.05803100 0.18313480
[13] -0.50361170 1.55145098 -0.66834002 -0.39106640 -1.81929723 -0.33597401
[19] -1.34867380 -0.99413251 1.66159849 -0.65602138 -1.34151276 1.09010082
[25] 0.13374626 -0.07094358 1.13989615 0.60320731 0.33503297 0.94515109
[31] 0.01632089 -1.51066231 -0.27256966 0.38841330 -0.62586413 -2.00199420
[37] 0.33592713 0.41851274 0.24151044 -1.32204259 1.11234015 1.12440084
[43] 0.26825874 1.78450051 1.47744384 -0.96687111 0.24303423 0.74249234
[49] -0.16081516 -0.92172603 0.55194661 0.02182282 -0.72733551 -1.16676203
[55] 0.25991719 0.92095734 -0.35106366 -0.29853883 0.78171922 -0.97867107
[61] -0.07688390 0.44320258 0.37235941 0.79729952 -1.05771522 -0.48536652
[67] -0.53156865 0.09458113 -1.32853089 0.99407764 -1.07446704 -1.25005385
[73] 0.48231754 1.64125959 0.06505264 1.42254099 -0.47797192 -1.26135477
[79] -1.25976581 -0.27362848 0.42949414 -0.24602799 -0.03212318 0.84555116
[85] -0.47109316 -0.07888089 -0.33815398 -0.72932980 -0.15479019 1.99718840
[91] 0.73954893 2.27894837 -0.64395731 -0.40244939 -0.39806891 -2.53511489
[97] 0.98702736 -1.45671860 -0.86669598 -0.24730582
> colSums(tmp)
[1] 0.42336616 0.18522564 -0.48187861 -0.41644006 0.48047238 -0.27304166
[7] 0.98320349 -1.93647234 -0.03667412 0.18452038 1.05803100 0.18313480
[13] -0.50361170 1.55145098 -0.66834002 -0.39106640 -1.81929723 -0.33597401
[19] -1.34867380 -0.99413251 1.66159849 -0.65602138 -1.34151276 1.09010082
[25] 0.13374626 -0.07094358 1.13989615 0.60320731 0.33503297 0.94515109
[31] 0.01632089 -1.51066231 -0.27256966 0.38841330 -0.62586413 -2.00199420
[37] 0.33592713 0.41851274 0.24151044 -1.32204259 1.11234015 1.12440084
[43] 0.26825874 1.78450051 1.47744384 -0.96687111 0.24303423 0.74249234
[49] -0.16081516 -0.92172603 0.55194661 0.02182282 -0.72733551 -1.16676203
[55] 0.25991719 0.92095734 -0.35106366 -0.29853883 0.78171922 -0.97867107
[61] -0.07688390 0.44320258 0.37235941 0.79729952 -1.05771522 -0.48536652
[67] -0.53156865 0.09458113 -1.32853089 0.99407764 -1.07446704 -1.25005385
[73] 0.48231754 1.64125959 0.06505264 1.42254099 -0.47797192 -1.26135477
[79] -1.25976581 -0.27362848 0.42949414 -0.24602799 -0.03212318 0.84555116
[85] -0.47109316 -0.07888089 -0.33815398 -0.72932980 -0.15479019 1.99718840
[91] 0.73954893 2.27894837 -0.64395731 -0.40244939 -0.39806891 -2.53511489
[97] 0.98702736 -1.45671860 -0.86669598 -0.24730582
> 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.42336616 0.18522564 -0.48187861 -0.41644006 0.48047238 -0.27304166
[7] 0.98320349 -1.93647234 -0.03667412 0.18452038 1.05803100 0.18313480
[13] -0.50361170 1.55145098 -0.66834002 -0.39106640 -1.81929723 -0.33597401
[19] -1.34867380 -0.99413251 1.66159849 -0.65602138 -1.34151276 1.09010082
[25] 0.13374626 -0.07094358 1.13989615 0.60320731 0.33503297 0.94515109
[31] 0.01632089 -1.51066231 -0.27256966 0.38841330 -0.62586413 -2.00199420
[37] 0.33592713 0.41851274 0.24151044 -1.32204259 1.11234015 1.12440084
[43] 0.26825874 1.78450051 1.47744384 -0.96687111 0.24303423 0.74249234
[49] -0.16081516 -0.92172603 0.55194661 0.02182282 -0.72733551 -1.16676203
[55] 0.25991719 0.92095734 -0.35106366 -0.29853883 0.78171922 -0.97867107
[61] -0.07688390 0.44320258 0.37235941 0.79729952 -1.05771522 -0.48536652
[67] -0.53156865 0.09458113 -1.32853089 0.99407764 -1.07446704 -1.25005385
[73] 0.48231754 1.64125959 0.06505264 1.42254099 -0.47797192 -1.26135477
[79] -1.25976581 -0.27362848 0.42949414 -0.24602799 -0.03212318 0.84555116
[85] -0.47109316 -0.07888089 -0.33815398 -0.72932980 -0.15479019 1.99718840
[91] 0.73954893 2.27894837 -0.64395731 -0.40244939 -0.39806891 -2.53511489
[97] 0.98702736 -1.45671860 -0.86669598 -0.24730582
> colMin(tmp)
[1] 0.42336616 0.18522564 -0.48187861 -0.41644006 0.48047238 -0.27304166
[7] 0.98320349 -1.93647234 -0.03667412 0.18452038 1.05803100 0.18313480
[13] -0.50361170 1.55145098 -0.66834002 -0.39106640 -1.81929723 -0.33597401
[19] -1.34867380 -0.99413251 1.66159849 -0.65602138 -1.34151276 1.09010082
[25] 0.13374626 -0.07094358 1.13989615 0.60320731 0.33503297 0.94515109
[31] 0.01632089 -1.51066231 -0.27256966 0.38841330 -0.62586413 -2.00199420
[37] 0.33592713 0.41851274 0.24151044 -1.32204259 1.11234015 1.12440084
[43] 0.26825874 1.78450051 1.47744384 -0.96687111 0.24303423 0.74249234
[49] -0.16081516 -0.92172603 0.55194661 0.02182282 -0.72733551 -1.16676203
[55] 0.25991719 0.92095734 -0.35106366 -0.29853883 0.78171922 -0.97867107
[61] -0.07688390 0.44320258 0.37235941 0.79729952 -1.05771522 -0.48536652
[67] -0.53156865 0.09458113 -1.32853089 0.99407764 -1.07446704 -1.25005385
[73] 0.48231754 1.64125959 0.06505264 1.42254099 -0.47797192 -1.26135477
[79] -1.25976581 -0.27362848 0.42949414 -0.24602799 -0.03212318 0.84555116
[85] -0.47109316 -0.07888089 -0.33815398 -0.72932980 -0.15479019 1.99718840
[91] 0.73954893 2.27894837 -0.64395731 -0.40244939 -0.39806891 -2.53511489
[97] 0.98702736 -1.45671860 -0.86669598 -0.24730582
> colMedians(tmp)
[1] 0.42336616 0.18522564 -0.48187861 -0.41644006 0.48047238 -0.27304166
[7] 0.98320349 -1.93647234 -0.03667412 0.18452038 1.05803100 0.18313480
[13] -0.50361170 1.55145098 -0.66834002 -0.39106640 -1.81929723 -0.33597401
[19] -1.34867380 -0.99413251 1.66159849 -0.65602138 -1.34151276 1.09010082
[25] 0.13374626 -0.07094358 1.13989615 0.60320731 0.33503297 0.94515109
[31] 0.01632089 -1.51066231 -0.27256966 0.38841330 -0.62586413 -2.00199420
[37] 0.33592713 0.41851274 0.24151044 -1.32204259 1.11234015 1.12440084
[43] 0.26825874 1.78450051 1.47744384 -0.96687111 0.24303423 0.74249234
[49] -0.16081516 -0.92172603 0.55194661 0.02182282 -0.72733551 -1.16676203
[55] 0.25991719 0.92095734 -0.35106366 -0.29853883 0.78171922 -0.97867107
[61] -0.07688390 0.44320258 0.37235941 0.79729952 -1.05771522 -0.48536652
[67] -0.53156865 0.09458113 -1.32853089 0.99407764 -1.07446704 -1.25005385
[73] 0.48231754 1.64125959 0.06505264 1.42254099 -0.47797192 -1.26135477
[79] -1.25976581 -0.27362848 0.42949414 -0.24602799 -0.03212318 0.84555116
[85] -0.47109316 -0.07888089 -0.33815398 -0.72932980 -0.15479019 1.99718840
[91] 0.73954893 2.27894837 -0.64395731 -0.40244939 -0.39806891 -2.53511489
[97] 0.98702736 -1.45671860 -0.86669598 -0.24730582
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.4233662 0.1852256 -0.4818786 -0.4164401 0.4804724 -0.2730417 0.9832035
[2,] 0.4233662 0.1852256 -0.4818786 -0.4164401 0.4804724 -0.2730417 0.9832035
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.936472 -0.03667412 0.1845204 1.058031 0.1831348 -0.5036117 1.551451
[2,] -1.936472 -0.03667412 0.1845204 1.058031 0.1831348 -0.5036117 1.551451
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.66834 -0.3910664 -1.819297 -0.335974 -1.348674 -0.9941325 1.661598
[2,] -0.66834 -0.3910664 -1.819297 -0.335974 -1.348674 -0.9941325 1.661598
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.6560214 -1.341513 1.090101 0.1337463 -0.07094358 1.139896 0.6032073
[2,] -0.6560214 -1.341513 1.090101 0.1337463 -0.07094358 1.139896 0.6032073
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.335033 0.9451511 0.01632089 -1.510662 -0.2725697 0.3884133 -0.6258641
[2,] 0.335033 0.9451511 0.01632089 -1.510662 -0.2725697 0.3884133 -0.6258641
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -2.001994 0.3359271 0.4185127 0.2415104 -1.322043 1.11234 1.124401
[2,] -2.001994 0.3359271 0.4185127 0.2415104 -1.322043 1.11234 1.124401
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.2682587 1.784501 1.477444 -0.9668711 0.2430342 0.7424923 -0.1608152
[2,] 0.2682587 1.784501 1.477444 -0.9668711 0.2430342 0.7424923 -0.1608152
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.921726 0.5519466 0.02182282 -0.7273355 -1.166762 0.2599172 0.9209573
[2,] -0.921726 0.5519466 0.02182282 -0.7273355 -1.166762 0.2599172 0.9209573
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.3510637 -0.2985388 0.7817192 -0.9786711 -0.0768839 0.4432026 0.3723594
[2,] -0.3510637 -0.2985388 0.7817192 -0.9786711 -0.0768839 0.4432026 0.3723594
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.7972995 -1.057715 -0.4853665 -0.5315686 0.09458113 -1.328531 0.9940776
[2,] 0.7972995 -1.057715 -0.4853665 -0.5315686 0.09458113 -1.328531 0.9940776
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -1.074467 -1.250054 0.4823175 1.64126 0.06505264 1.422541 -0.4779719
[2,] -1.074467 -1.250054 0.4823175 1.64126 0.06505264 1.422541 -0.4779719
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -1.261355 -1.259766 -0.2736285 0.4294941 -0.246028 -0.03212318 0.8455512
[2,] -1.261355 -1.259766 -0.2736285 0.4294941 -0.246028 -0.03212318 0.8455512
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.4710932 -0.07888089 -0.338154 -0.7293298 -0.1547902 1.997188 0.7395489
[2,] -0.4710932 -0.07888089 -0.338154 -0.7293298 -0.1547902 1.997188 0.7395489
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 2.278948 -0.6439573 -0.4024494 -0.3980689 -2.535115 0.9870274 -1.456719
[2,] 2.278948 -0.6439573 -0.4024494 -0.3980689 -2.535115 0.9870274 -1.456719
[,99] [,100]
[1,] -0.866696 -0.2473058
[2,] -0.866696 -0.2473058
>
>
> Max(tmp2)
[1] 2.755384
> Min(tmp2)
[1] -2.313155
> mean(tmp2)
[1] -0.07923506
> Sum(tmp2)
[1] -7.923506
> Var(tmp2)
[1] 1.113315
>
> rowMeans(tmp2)
[1] -1.531672127 0.780405731 1.107190484 0.239636721 -2.218273469
[6] 0.409172026 0.345543763 0.041796143 0.376717969 0.481600246
[11] 0.424113283 -0.466825386 0.107891897 -1.534466440 -1.275937393
[16] 0.006079029 0.379991417 -0.069040685 0.799688331 -0.385276974
[21] 0.412064243 -1.457309206 1.815998156 0.654448580 -0.234277789
[26] -0.350586010 0.132413451 -1.390448602 2.755384416 1.691269891
[31] 0.745181380 0.088724741 1.665015287 0.187830375 -0.689137377
[36] -1.650229504 -1.476079403 -0.039513052 0.540738470 -0.527233051
[41] -2.313155416 0.544153040 0.715849491 0.992632334 -0.401952652
[46] 0.575884792 -1.622059144 -1.699425477 -1.284347818 -1.213147018
[51] 0.419596909 -1.040424149 -0.123471782 -0.733511295 0.654478139
[56] -0.252564294 -0.176854927 -0.256922516 -1.006173025 -1.120529491
[61] 1.148945049 -0.617549607 1.089662200 0.192748434 0.576554676
[66] 0.529381311 -1.259111192 -1.986176584 -1.511379841 0.056269855
[71] 1.733487204 0.037631781 0.363894246 -0.431715267 -1.325763234
[76] 0.766800921 1.818577389 -0.459886838 -0.724654452 0.648675888
[81] 0.895445945 -0.368693132 0.812839627 -1.548812793 1.453536951
[86] 2.130680496 -1.002886372 1.582445787 0.354547036 -0.916953621
[91] -1.049858849 -1.509800148 0.960456916 0.151625434 0.167826821
[96] -0.486390463 -2.207417031 0.014911098 -0.344948616 0.790901978
> rowSums(tmp2)
[1] -1.531672127 0.780405731 1.107190484 0.239636721 -2.218273469
[6] 0.409172026 0.345543763 0.041796143 0.376717969 0.481600246
[11] 0.424113283 -0.466825386 0.107891897 -1.534466440 -1.275937393
[16] 0.006079029 0.379991417 -0.069040685 0.799688331 -0.385276974
[21] 0.412064243 -1.457309206 1.815998156 0.654448580 -0.234277789
[26] -0.350586010 0.132413451 -1.390448602 2.755384416 1.691269891
[31] 0.745181380 0.088724741 1.665015287 0.187830375 -0.689137377
[36] -1.650229504 -1.476079403 -0.039513052 0.540738470 -0.527233051
[41] -2.313155416 0.544153040 0.715849491 0.992632334 -0.401952652
[46] 0.575884792 -1.622059144 -1.699425477 -1.284347818 -1.213147018
[51] 0.419596909 -1.040424149 -0.123471782 -0.733511295 0.654478139
[56] -0.252564294 -0.176854927 -0.256922516 -1.006173025 -1.120529491
[61] 1.148945049 -0.617549607 1.089662200 0.192748434 0.576554676
[66] 0.529381311 -1.259111192 -1.986176584 -1.511379841 0.056269855
[71] 1.733487204 0.037631781 0.363894246 -0.431715267 -1.325763234
[76] 0.766800921 1.818577389 -0.459886838 -0.724654452 0.648675888
[81] 0.895445945 -0.368693132 0.812839627 -1.548812793 1.453536951
[86] 2.130680496 -1.002886372 1.582445787 0.354547036 -0.916953621
[91] -1.049858849 -1.509800148 0.960456916 0.151625434 0.167826821
[96] -0.486390463 -2.207417031 0.014911098 -0.344948616 0.790901978
> 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.531672127 0.780405731 1.107190484 0.239636721 -2.218273469
[6] 0.409172026 0.345543763 0.041796143 0.376717969 0.481600246
[11] 0.424113283 -0.466825386 0.107891897 -1.534466440 -1.275937393
[16] 0.006079029 0.379991417 -0.069040685 0.799688331 -0.385276974
[21] 0.412064243 -1.457309206 1.815998156 0.654448580 -0.234277789
[26] -0.350586010 0.132413451 -1.390448602 2.755384416 1.691269891
[31] 0.745181380 0.088724741 1.665015287 0.187830375 -0.689137377
[36] -1.650229504 -1.476079403 -0.039513052 0.540738470 -0.527233051
[41] -2.313155416 0.544153040 0.715849491 0.992632334 -0.401952652
[46] 0.575884792 -1.622059144 -1.699425477 -1.284347818 -1.213147018
[51] 0.419596909 -1.040424149 -0.123471782 -0.733511295 0.654478139
[56] -0.252564294 -0.176854927 -0.256922516 -1.006173025 -1.120529491
[61] 1.148945049 -0.617549607 1.089662200 0.192748434 0.576554676
[66] 0.529381311 -1.259111192 -1.986176584 -1.511379841 0.056269855
[71] 1.733487204 0.037631781 0.363894246 -0.431715267 -1.325763234
[76] 0.766800921 1.818577389 -0.459886838 -0.724654452 0.648675888
[81] 0.895445945 -0.368693132 0.812839627 -1.548812793 1.453536951
[86] 2.130680496 -1.002886372 1.582445787 0.354547036 -0.916953621
[91] -1.049858849 -1.509800148 0.960456916 0.151625434 0.167826821
[96] -0.486390463 -2.207417031 0.014911098 -0.344948616 0.790901978
> rowMin(tmp2)
[1] -1.531672127 0.780405731 1.107190484 0.239636721 -2.218273469
[6] 0.409172026 0.345543763 0.041796143 0.376717969 0.481600246
[11] 0.424113283 -0.466825386 0.107891897 -1.534466440 -1.275937393
[16] 0.006079029 0.379991417 -0.069040685 0.799688331 -0.385276974
[21] 0.412064243 -1.457309206 1.815998156 0.654448580 -0.234277789
[26] -0.350586010 0.132413451 -1.390448602 2.755384416 1.691269891
[31] 0.745181380 0.088724741 1.665015287 0.187830375 -0.689137377
[36] -1.650229504 -1.476079403 -0.039513052 0.540738470 -0.527233051
[41] -2.313155416 0.544153040 0.715849491 0.992632334 -0.401952652
[46] 0.575884792 -1.622059144 -1.699425477 -1.284347818 -1.213147018
[51] 0.419596909 -1.040424149 -0.123471782 -0.733511295 0.654478139
[56] -0.252564294 -0.176854927 -0.256922516 -1.006173025 -1.120529491
[61] 1.148945049 -0.617549607 1.089662200 0.192748434 0.576554676
[66] 0.529381311 -1.259111192 -1.986176584 -1.511379841 0.056269855
[71] 1.733487204 0.037631781 0.363894246 -0.431715267 -1.325763234
[76] 0.766800921 1.818577389 -0.459886838 -0.724654452 0.648675888
[81] 0.895445945 -0.368693132 0.812839627 -1.548812793 1.453536951
[86] 2.130680496 -1.002886372 1.582445787 0.354547036 -0.916953621
[91] -1.049858849 -1.509800148 0.960456916 0.151625434 0.167826821
[96] -0.486390463 -2.207417031 0.014911098 -0.344948616 0.790901978
>
> colMeans(tmp2)
[1] -0.07923506
> colSums(tmp2)
[1] -7.923506
> colVars(tmp2)
[1] 1.113315
> colSd(tmp2)
[1] 1.055137
> colMax(tmp2)
[1] 2.755384
> colMin(tmp2)
[1] -2.313155
> colMedians(tmp2)
[1] 0.03971396
> colRanges(tmp2)
[,1]
[1,] -2.313155
[2,] 2.755384
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.2868541 -4.4175932 -2.8266635 1.8687645 1.3951993 0.7364615
[7] 4.8949348 -2.9875807 -0.6367523 2.0865445
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.1376136
[2,] -0.5234444
[3,] 0.1085326
[4,] 0.2507768
[5,] 0.7878545
>
> rowApply(tmp,sum)
[1] 1.0336648 0.2816450 1.5250935 -3.5136256 0.1412943 3.9830257
[7] -6.0392771 3.0911991 -0.3502125 -1.3263462
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 6 7 2 9 6 6 6 2 3
[2,] 3 10 4 7 2 1 1 7 1 8
[3,] 2 4 6 1 3 2 4 9 10 2
[4,] 4 1 9 6 8 7 10 2 9 7
[5,] 8 7 3 3 7 9 2 3 8 9
[6,] 9 9 5 5 1 5 9 4 6 6
[7,] 5 8 10 8 10 8 8 10 4 4
[8,] 7 2 8 10 6 4 5 1 5 1
[9,] 1 5 1 4 4 10 7 8 3 5
[10,] 10 3 2 9 5 3 3 5 7 10
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.7925919 2.7912006 -2.2460038 -1.2132593 2.0144652 -2.1048857
[7] -0.4928177 3.6244812 3.3391615 -3.5941047 -1.0850132 0.3030698
[13] -1.8051844 2.7333349 4.9593155 0.8864660 0.1562711 -1.7726985
[19] 0.1579962 0.2660811
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.5700826
[2,] -0.5218299
[3,] -0.2307459
[4,] -0.1834541
[5,] 2.2987043
>
> rowApply(tmp,sum)
[1] -0.4057733 3.1982895 2.0085588 0.9808546 1.9285379
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 20 10 5 8
[2,] 3 11 14 17 19
[3,] 9 8 6 7 6
[4,] 10 3 17 2 2
[5,] 8 14 19 3 18
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.5700826 -0.76127972 -0.05689015 0.1109674 -0.3899058 0.63077103
[2,] 2.2987043 0.04106716 -0.36594925 -0.7010414 0.6059155 -0.47092277
[3,] -0.2307459 0.94188525 -0.85987709 1.6094459 1.8485205 -1.23573087
[4,] -0.5218299 0.89660566 -0.38812224 -1.3275104 -1.1196506 -0.96442808
[5,] -0.1834541 1.67292225 -0.57516509 -0.9051208 1.0695856 -0.06457505
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.67736762 0.1511147 0.7494344 -1.16318817 1.02243809 0.9316542
[2,] -1.53330974 1.2281644 0.4777820 -0.69777725 -1.41839105 -0.4849936
[3,] 2.17559031 0.6853823 1.4952366 -0.86582575 -1.58186791 -0.5672741
[4,] -0.37639421 -0.1547422 0.3471693 -0.07068694 0.05019684 0.9864762
[5,] -0.08133646 1.7145621 0.2695393 -0.79662657 0.84261080 -0.5627928
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.2607293 0.5292615 0.2995111 0.1586960 -0.4188815 -0.9283490641
[2,] -0.3415005 0.1634004 1.1128440 1.1134457 -0.5319184 2.2682276535
[3,] -0.5666954 1.5102570 1.7877270 -2.9779129 0.2351545 -1.7352611621
[4,] -0.5119856 0.1462564 1.0885518 2.2024825 0.4729659 -1.3780363536
[5,] -0.6457322 0.3841595 0.6706816 0.3897547 0.3989506 0.0007203874
[,19] [,20]
[1,] -0.5761550 0.2917486
[2,] -0.3244556 0.7589980
[3,] 0.7467773 -0.4062269
[4,] 0.8937561 0.7097805
[5,] -0.5819266 -1.0882192
>
>
> 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 : 562 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 -0.5641174 0.4837728 -1.810679 0.6988294 -1.399146 1.257067 -0.1168922
col8 col9 col10 col11 col12 col13 col14
row1 -0.8510628 -0.4059297 0.8772139 -0.1789508 1.317435 -0.4251159 1.118212
col15 col16 col17 col18 col19 col20
row1 1.432512 0.03389776 -0.2161871 -1.018993 1.850608 -0.1384696
> tmp[,"col10"]
col10
row1 0.8772139
row2 -1.2740222
row3 -0.3129506
row4 0.1183931
row5 1.4937792
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.5641174 0.4837728 -1.810679 0.6988294 -1.3991456 1.2570665 -0.1168922
row5 -0.8827173 -1.6619528 1.305776 -1.2662588 0.3253974 0.5710518 0.3630845
col8 col9 col10 col11 col12 col13 col14
row1 -0.8510628 -0.4059297 0.8772139 -0.1789508 1.317435 -0.42511594 1.118212
row5 -1.3533290 0.3030999 1.4937792 -0.8832970 1.030750 0.01913764 1.347074
col15 col16 col17 col18 col19 col20
row1 1.432512 0.03389776 -0.2161871 -1.0189926 1.850608 -0.1384696
row5 1.272260 1.91946879 0.0844114 0.9292986 -2.342591 0.6050509
> tmp[,c("col6","col20")]
col6 col20
row1 1.257066504 -0.1384696
row2 1.158638083 -0.8302162
row3 -0.007869761 0.3026880
row4 -0.544770336 0.1762891
row5 0.571051822 0.6050509
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.2570665 -0.1384696
row5 0.5710518 0.6050509
>
>
>
>
> 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.32095 50.92471 49.84365 50.71151 51.35429 105.8782 49.59717 50.53884
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.3571 50.53044 50.01537 48.25136 50.1011 50.21264 49.78063 48.61053
col17 col18 col19 col20
row1 49.85282 50.59974 48.82379 106.0598
> tmp[,"col10"]
col10
row1 50.53044
row2 29.94663
row3 27.91585
row4 28.91245
row5 49.82618
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.32095 50.92471 49.84365 50.71151 51.35429 105.8782 49.59717 50.53884
row5 49.12636 49.60871 49.53948 50.56978 50.71363 104.2023 50.45187 51.15017
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.35710 50.53044 50.01537 48.25136 50.10110 50.21264 49.78063 48.61053
row5 51.51634 49.82618 48.40837 50.31297 48.67753 50.00311 48.54547 49.68360
col17 col18 col19 col20
row1 49.85282 50.59974 48.82379 106.0598
row5 50.50116 50.15164 48.47416 106.1773
> tmp[,c("col6","col20")]
col6 col20
row1 105.87821 106.05981
row2 74.62265 75.58595
row3 77.26422 73.65091
row4 77.04033 74.92468
row5 104.20234 106.17726
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.8782 106.0598
row5 104.2023 106.1773
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.8782 106.0598
row5 104.2023 106.1773
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.1472965
[2,] -0.5580717
[3,] -2.2275632
[4,] 0.7974316
[5,] -1.2322366
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.4024933 0.01066026
[2,] -0.9092435 -1.29508253
[3,] 1.4542112 -0.86664275
[4,] -0.4140823 -0.25522492
[5,] -0.1808925 -0.66598316
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.32112052 1.0993482
[2,] -2.04652096 -0.2523753
[3,] 1.32196446 0.9397168
[4,] 0.04326705 -0.7879364
[5,] 0.29038995 1.5376389
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.3211205
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.3211205
[2,] -2.0465210
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 0.1812288 0.3848141 1.9703051 -0.841336 -0.9014861 1.0795068 -1.0645936
row1 0.5890469 -0.9245263 0.2652216 -1.468329 0.1916565 -0.2062931 0.1633439
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.589388 -1.2410903 -0.7601603 0.5170643 0.06905276 -1.588331 -0.692323
row1 1.817061 0.4105333 -0.4585117 -0.8013701 -0.70293094 -2.085180 -1.141721
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.1339983 1.0244493 0.31661292 -0.56276457 -0.4165471 0.4871731
row1 -1.1623593 -0.4069058 -0.03424727 0.06278364 -1.3141300 0.4460368
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.046415 1.852454 -0.3049123 0.2830566 0.3905377 1.416732 -0.635906
[,8] [,9] [,10]
row2 -0.9538621 -1.226006 -0.7216359
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.5299967 0.4318944 -1.511451 0.8588016 0.5839694 1.362319 -0.9806088
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.4753187 1.610408 1.196884 0.3754246 -0.1048217 -0.2150103 0.5928511
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.4082717 0.2367499 1.967522 0.6255349 -0.3916896 -0.9408268
>
>
> 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: 0x600003ef80c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c455574310"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c453f3fb35"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c436f17fa2"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c428f280dc"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c448ea0084"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c47ac7ff81"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c46057ad20"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c41c27414a"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c4552f6fb6"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c41d4f416b"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c43e4fe6d5"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c46fbbc9e8"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c411c4d7a7"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c4122a1e0e"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BMc0c4b1b3273"
>
>
> ### 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: 0x600003ee00c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003ee00c0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600003ee00c0>
> rowMedians(tmp)
[1] -0.2868434556 0.4828905698 0.3006034071 0.4741599129 0.3974828884
[6] 0.3694538085 -0.6981663421 -0.3208816336 0.1160293967 -0.1914683156
[11] 0.1877480528 0.1515849367 -0.2121603156 -0.0683425420 0.0577463386
[16] 0.1210811370 -0.2974416609 0.3623596960 -0.1029001164 -0.0616220417
[21] 0.5266877916 0.6453647221 0.4255768152 -0.3987625145 -0.0386512474
[26] -0.5214745686 -0.4094785758 -0.0042199707 -0.0699787176 0.0408762849
[31] 0.2542447089 -0.8533603448 -0.0451305869 0.2161400617 0.1091492383
[36] 0.5235427372 0.1544506767 0.0970235513 0.1481412597 0.5571087904
[41] -0.1252756744 -0.1997082432 0.3302206554 -0.2899351078 -0.1681517437
[46] 0.4853930677 -0.0045219967 -0.1358514814 0.1070105359 0.4609676775
[51] 0.2839001992 0.1884205497 -0.4022284013 0.2463710016 -0.2686149569
[56] 0.4941549359 -0.2093520438 -0.1740531270 0.0383062238 0.1464922047
[61] 0.2034386591 0.0064161365 -0.3503525868 0.3471173518 0.5327671573
[66] 0.1793743544 -0.0027670947 0.1322330031 -0.4509420954 -0.1800243912
[71] -0.0740113683 -0.7202835184 -0.2416065194 -0.3633727619 0.2034863250
[76] 0.0118101516 0.2261548138 0.3995568439 0.3411018732 0.5035409857
[81] -0.2998155891 0.1641768763 0.3178744309 -0.1744126657 0.3789815332
[86] 0.5694247077 0.0582147871 0.4525770583 0.0235587156 -0.0318826113
[91] 0.1874619304 0.3862551284 -0.2578584073 -0.2175136222 0.4178679912
[96] 0.1001238637 -0.5403551881 0.2106567865 0.2603159438 -0.4998763186
[101] -0.2847461024 0.0149401319 -0.3436746220 0.1023337256 -0.5466166941
[106] 0.0955458500 -0.0638694487 -0.1045934184 0.0973808367 0.9965969285
[111] 0.0089449098 -0.1053134657 0.0485911533 0.4616273511 0.2393957468
[116] 0.0643348569 0.1643395961 0.1306779038 -0.2083014348 0.5837305129
[121] -0.1513854298 -0.6015092804 0.7252696122 -0.1665207706 0.0361109894
[126] -0.0672685194 0.1869954095 0.3716230190 -0.4761179896 0.1940760806
[131] -0.6987932335 0.5706024160 0.5366689490 -0.2890608101 0.4546801360
[136] 0.0154423732 -0.4749214894 -0.4044319095 0.0389642064 0.1173809964
[141] 0.2613453101 0.1940431681 -0.1567347795 0.2706150086 0.0119637255
[146] 0.0335848350 -0.1417114501 -0.1312089398 0.4923530319 0.2358108264
[151] -0.1165384470 -0.6501458213 0.1641736972 -0.1744289135 -0.1770402139
[156] 0.1050794319 -0.0585290267 0.0361811690 -0.2263429184 -0.2523263774
[161] 0.1205450230 -0.2180510379 -0.0893684461 -0.0999582449 -0.4272979305
[166] -0.1409045137 -0.0848115112 0.0005596717 0.5289155010 -0.0256632124
[171] 0.6128210734 -0.0679218125 0.1570117047 -0.1057734768 0.6184072799
[176] 0.2317106145 -0.2784194774 -0.0473579037 -0.0513317174 0.0454715452
[181] -0.0144306442 0.4634932378 -0.3631702661 0.1652911661 0.2539545103
[186] 0.2596405112 0.2769072921 -0.0988598986 0.0671092125 -0.0973143448
[191] 0.0766169568 -0.1088471391 0.4233174116 -0.5304540169 0.0232604818
[196] 0.2649961246 0.0498013175 -0.0032426077 0.2221038569 0.0757394704
[201] -0.4268111596 0.3993775801 -0.5422422576 -0.0826204209 0.2588289900
[206] -0.2514775788 -0.4909403190 0.0830206978 0.0407257389 0.0210985305
[211] 0.1625111044 -0.4232658251 0.5161442649 -0.3606238836 0.0761990404
[216] -0.3080786176 -0.2216305595 -0.0881114780 -0.1351185933 -0.2131774736
[221] 0.2090776502 0.2631958371 0.3585939105 -0.1328628794 -0.0210085973
[226] 0.0495805499 -0.0542510963 0.0570024406 0.3135850314 -0.1582460501
>
> proc.time()
user system elapsed
0.684 3.787 5.642
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-02-28 r89501) -- "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: 0x6000001b4000>
> .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: 0x6000001b4000>
> .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: 0x6000001b4000>
> .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: 0x6000001b4000>
> 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: 0x6000001b43c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001b43c0>
> .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: 0x6000001b43c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001b43c0>
> .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: 0x6000001b43c0>
> 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: 0x6000001a0360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001a0360>
> .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: 0x6000001a0360>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000001a0360>
> .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: 0x6000001a0360>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000001a0360>
> .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: 0x6000001a0360>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000001a0360>
> .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: 0x6000001a0360>
> 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: 0x6000001a0540>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000001a0540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001a0540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001a0540>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec5f47768af29" "BufferedMatrixFilec5f479c3e9fd"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilec5f47768af29" "BufferedMatrixFilec5f479c3e9fd"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001a0720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001a0720>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000001a0720>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000001a0720>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000001a0720>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000001a0720>
> .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: 0x6000001a0900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000001a0900>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000001a0900>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000001a0900>
> 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: 0x6000001b44e0>
> .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: 0x6000001b44e0>
> rm(P)
>
> proc.time()
user system elapsed
0.111 0.046 0.174
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-02-28 r89501) -- "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.139 0.041 0.225